/* ============================================================
   ONBOARDING — landing + setup + step screens
   Tokens follow Content OS Brand Kit v1.
   Source: LinkedIn_content OS,_brandingKIT/BRAND-KIT.md
   ============================================================ */

/* ----- Thmanyah Arabic typeface (self-hosted) ----- */
@font-face {
  font-family: 'Thmanyah Sans';
  src: url('/static/fonts/thmanyah/thmanyahsans-Light.woff2') format('woff2');
  font-weight: 300; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Thmanyah Sans';
  src: url('/static/fonts/thmanyah/thmanyahsans-Regular.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Thmanyah Sans';
  src: url('/static/fonts/thmanyah/thmanyahsans-Medium.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Thmanyah Sans';
  src: url('/static/fonts/thmanyah/thmanyahsans-Bold.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Thmanyah Sans';
  src: url('/static/fonts/thmanyah/thmanyahsans-Black.woff2') format('woff2');
  font-weight: 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Thmanyah Serif Display';
  src: url('/static/fonts/thmanyah/thmanyahserifdisplay-Regular.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Thmanyah Serif Display';
  src: url('/static/fonts/thmanyah/thmanyahserifdisplay-Medium.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Thmanyah Serif Display';
  src: url('/static/fonts/thmanyah/thmanyahserifdisplay-Bold.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Thmanyah Serif Display';
  src: url('/static/fonts/thmanyah/thmanyahserifdisplay-Black.woff2') format('woff2');
  font-weight: 900; font-style: normal; font-display: swap;
}

@font-face{font-family:'Nunito';src:url('/static/fonts/nunito/Nunito-VariableFont_wght.ttf') format('truetype');font-weight:200 1000;font-style:normal;font-display:swap;}

:root {
  /* ----- Foundation (neutrals) — Apple/Qareen ----- */
  --ink-900: #1d1d1f;
  --ink-700: #515154;
  --ink-500: #6e6e73;
  --ink-300: #d2d2d7;
  --ink-100: #ececef;
  --ink-50:  #f5f5f7;
  --paper:   #ffffff;

  /* ----- Brand (Qareen mint — was violet) ----- */
  --brand-700: #0a7d5c;
  --brand-600: #0a8f6a;   /* mint as text/links/accent (legible) */
  --brand-500: #15f5ba;   /* bright brand mint — fills */
  --brand-100: #e7f4ee;

  /* ----- Functional ----- */
  --good-600: #0a8f6a;
  --good-100: #e7f4ee;
  --warn-600: #c0392b;
  --warn-100: #fdecec;
  --amber-600: #0a8f6a;
  --amber-100: #e7f4ee;

  /* ----- Channel ----- */
  --linkedin: #0a66c2;
  --linkedin-100: #e7f0fa;
  --telegram: #229ed9;
  --telegram-100: #e3f3fb;

  /* ----- Type stacks — Nunito (EN) + Thmanyah (AR) ----- */
  --font-display: 'Nunito', 'Thmanyah Sans', system-ui, sans-serif;
  --font-body: 'Nunito', 'Thmanyah Sans', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  --font-arabic: 'Thmanyah Sans', 'Nunito', system-ui, sans-serif;
  --font-arabic-display: 'Thmanyah Sans', 'Nunito', system-ui, sans-serif;

  /* ----- Spacing (8-pt grid) ----- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --space-16: 64px;

  /* ----- Radii ----- */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-full: 99px;

  /* ----- Shadows ----- */
  --shadow-sm: 0 2px 0 var(--ink-300);
  --shadow-md: 0 8px 24px -10px rgba(0, 0, 0, 0.18);
  --shadow-lg: 0 24px 40px -20px rgba(0, 0, 0, 0.4);

  /* ----- Backwards-compat aliases (old code refs) ----- */
  --bg: var(--ink-50);
  --ink: var(--ink-900);
  --ink-2: var(--ink-700);
  --ink-3: var(--ink-500);
  --rule: var(--ink-300);
  --accent: var(--brand-600);
  --accent-soft: var(--brand-100);
  --good: var(--good-600);
  --good-soft: var(--good-100);
  --tg: var(--telegram);
  --tg-soft: var(--telegram-100);
  --li: var(--linkedin);
  --li-soft: var(--linkedin-100);
  --warn: var(--warn-600);
  --warn-soft: var(--warn-100);
  --mono: var(--font-mono);
  --sans: var(--font-body);
  --serif: var(--font-display);
}

/* ----- RTL mode for Arabic toggle ----- */
[dir="rtl"] body, body[dir="rtl"] {
  font-family: var(--font-arabic);
}
[dir="rtl"] .step-h1,
[dir="rtl"] .hero-left h1,
[dir="rtl"] .story-meta h2 {
  font-family: var(--font-arabic-display);
}
[dir="rtl"] .arabic-line {
  /* In RTL mode, the Arabic line is no longer an "accent" — it's primary copy */
  opacity: 1;
  font-size: inherit;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body.onb-page {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }
button { font-family: inherit; cursor: pointer; }

/* ===== Shared atoms ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 99px;
  font-weight: 600;
  font-size: 14px;
  border: 1px solid var(--rule);
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.18s cubic-bezier(.16,1,.3,1), background 0.12s, border-color 0.12s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: scale(.98); }
.btn-dark { background: #15F5BA; color: #0E2A22; border-color: #15F5BA; }
.btn-linkedin { background: var(--li); color: #fff; border-color: var(--li); }
.btn-telegram { background: var(--tg); color: #fff; border-color: var(--tg); }
.btn-lg { padding: 14px 22px; font-size: 14px; }

.link-skip {
  display: inline-block;
  margin-top: 14px;
  font-size: 12px;
  color: var(--ink-3);
  font-family: var(--mono);
  text-decoration: none;
}
.link-skip:hover { color: var(--ink-2); }
.link-muted {
  color: var(--ink-2);
  text-decoration: none;
  font-size: 14px;
  margin-right: 16px;
}
.link-muted:hover { color: var(--ink); }

.arabic-line {
  direction: rtl;
  text-align: right;
  font-family: 'Tajawal', 'Noto Sans Arabic', system-ui;
  opacity: 0.55;
  font-size: 13px;
  margin: 6px 0 0;
  line-height: 1.6;
}
.arabic-line.center { text-align: center; }

/* ===== Landing nav ===== */
.landing-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 48px;
  max-width: 1320px;
  margin: 0 auto;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--ink);
}
.brand-glyph {
  width: 28px; height: 28px;
  border-radius: 7px;
  background: var(--ink);
  color: #fff;
  display: grid; place-items: center;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  object-fit: cover;   /* when rendered as the Qareen app-icon <img> */
}
.nav-cta { display: flex; align-items: center; }

/* ===== Hero ===== */
.hero {
  max-width: 1320px;
  margin: 0 auto;
  padding: 32px 48px 72px;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 56px;
  align-items: start;
}
.hero-left h1 {
  font-family: var(--serif);
  font-size: 56px;
  line-height: 1.05;
  letter-spacing: -0.025em;
  font-weight: 700;
  margin: 8px 0 16px;
}
.hero-left h1 em { font-style: italic; color: var(--accent); }
.hero-left .sub {
  font-size: 18px;
  line-height: 1.55;
  color: var(--ink-2);
  margin: 0 0 16px;
  max-width: 540px;
}
.cta-row { display: flex; align-items: center; gap: 12px; margin-top: 8px; flex-wrap: wrap; }
.cta-meta { margin-top: 12px; font-size: 12px; color: var(--ink-3); }

.week-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 36px;
  border: 1px solid var(--rule);
  border-radius: 12px;
  overflow: hidden;
}
.week-old, .week-new { padding: 24px; }
.week-old { background: #fafaf6; }
.week-new { background: var(--accent-soft); border-left: 1px solid var(--rule); }
.week-hdr {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
  color: var(--ink-3);
}
.week-new .week-hdr { color: var(--accent); }
.week-old h4, .week-new h4 { margin: 0 0 10px; font-size: 17px; }
.week-old p, .week-new p { margin: 0; font-size: 14px; line-height: 1.55; color: var(--ink-2); }

.nots {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 28px;
}
.not-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 99px;
  background: #fafaf6;
  border: 1px solid var(--rule);
  font-size: 12px;
  color: var(--ink-2);
  font-family: var(--mono);
}
.not-chip .x { color: var(--warn); font-weight: 700; }

.hero-right {
  padding: 32px;
  background: #161616;
  color: #f0f0f0;
  border-radius: 18px;
  position: relative;
  min-height: 540px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.moment-eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: #999;
  margin-bottom: 18px;
}
.moment-card {
  background: #1f1f1f;
  border-radius: 14px;
  padding: 22px;
  transform: rotate(-0.5deg);
  box-shadow: 0 24px 40px -20px rgba(0, 0, 0, 0.6);
  border: 1px solid #2a2a2a;
}
.day-tag {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: #c4b8ff;
  margin-bottom: 10px;
}
.quote {
  font-size: 16px;
  line-height: 1.45;
  margin: 0 0 18px;
  color: #fff;
}
.voice-wave {
  display: inline-flex;
  gap: 2px;
  align-items: end;
  vertical-align: middle;
  margin-right: 8px;
}
.voice-wave span {
  width: 2px;
  background: var(--accent);
  border-radius: 1px;
}
.voice-wave span:nth-child(1) { height: 6px; }
.voice-wave span:nth-child(2) { height: 12px; }
.voice-wave span:nth-child(3) { height: 18px; }
.voice-wave span:nth-child(4) { height: 10px; }
.voice-wave span:nth-child(5) { height: 16px; }
.voice-wave span:nth-child(6) { height: 8px; }
.result {
  border-top: 1px solid #333;
  padding-top: 12px;
  font-size: 12px;
  color: #aaa;
  line-height: 1.6;
}
.result strong { color: #fff; }
.moment-coda {
  margin-top: 28px;
  font-size: 13px;
  line-height: 1.6;
  color: #999;
  max-width: 380px;
}

/* ===== Story band ===== */
.story-band {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 48px 80px;
}
.story-section {
  display: grid;
  grid-template-columns: 0.6fr 1fr;
  gap: 32px;
  align-items: start;
  padding: 36px 0;
  border-top: 1px solid var(--rule);
}
.story-section:last-child { border-bottom: 1px solid var(--rule); }
.story-meta .tag {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.story-meta h2 {
  margin: 8px 0 0;
  font-size: 32px;
  font-family: var(--serif);
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.story-body p {
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-2);
  margin: 0 0 16px;
}
.moment-inline {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 14px 18px;
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.6;
}
.moment-inline strong { color: var(--ink); }

.tagline-footer {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--rule);
  flex-wrap: wrap;
  gap: 16px;
}
.tagline {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--ink-2);
}

.page-footer {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 48px 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--ink-3);
  border-top: 1px dashed var(--rule);
}
.page-footer .mono { font-family: var(--mono); }

/* ===== Step screens (welcome, linkedin, telegram, first-idea) ===== */
.step-canvas {
  max-width: 600px;
  margin: 80px auto;
  padding: 0 24px;
  text-align: center;
}
.step-canvas.two-col {
  max-width: 800px;
  text-align: left;
}
.progress-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 24px;
}
.dot {
  width: 24px;
  height: 4px;
  border-radius: 2px;
  background: var(--rule);
}
.dot.active { background: var(--ink); }
.dot.done { background: var(--good); }
.progress-label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  margin-left: 8px;
}

.step-h1 {
  font-family: var(--serif);
  font-size: 38px;
  letter-spacing: -0.02em;
  line-height: 1.1;
  font-weight: 700;
  margin: 14px 0 16px;
}
.step-sub {
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 520px;
  margin: 0 auto 32px;
}
.step-canvas.two-col .step-sub { margin-left: 0; }

.li-badge {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: var(--li-soft);
  color: var(--li);
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
  font-size: 28px;
  font-weight: 700;
}
.scopes-line {
  margin-top: 18px;
  font-size: 12px;
  color: var(--ink-3);
}
.scopes-line code {
  background: #f0eee5;
  padding: 1px 6px;
  border-radius: 4px;
  font-family: var(--mono);
  margin: 0 2px;
  font-size: 11px;
}
.step-list {
  text-align: left;
  font-size: 14px;
  line-height: 1.8;
  color: var(--ink-2);
  padding-left: 18px;
  margin: 0 0 24px;
}
.pair-info {
  margin-top: 18px;
  padding: 10px 14px;
  background: var(--tg-soft);
  border-left: 3px solid var(--tg);
  border-radius: 8px;
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.5;
}
.first-idea-form textarea {
  width: 100%;
  min-height: 140px;
  padding: 16px 18px;
  border: 1.5px solid var(--rule);
  border-radius: 10px;
  background: #fff;
  font-family: inherit;
  font-size: 15px;
  resize: vertical;
}
.first-idea-form textarea:focus {
  outline: none;
  border-color: var(--ink);
}
.tg-fallback {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px dashed var(--rule);
  font-size: 13px;
  color: var(--ink-3);
}
.tg-fallback strong { color: var(--tg); }

/* ============================================================
   SETUP — chat agent screen
   ============================================================ */
body.setup {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: #fafaf6;
}
.setup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  border-bottom: 1px solid var(--rule);
  background: #fff;
  flex-wrap: wrap;
  gap: 12px;
}
.setup-header .progress-row { margin-bottom: 0; }
.agent-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  background: var(--ink);
  color: #fff;
  border-radius: 99px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
}
.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 8px var(--good);
}
.form-fallback-link {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  text-decoration: none;
}
.form-fallback-link:hover { color: var(--ink-2); text-decoration: underline; }

.chat-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 24px 12px;
  overflow: hidden;
}
.chat-stream {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  padding-bottom: 8px;
  scroll-behavior: smooth;
}
.msg {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.msg.user { justify-content: flex-end; }
.msg .avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.msg.user .avatar { background: var(--ink); }
.msg .bubble {
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.55;
  max-width: 540px;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.msg.user .bubble {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.msg.user .bubble.voice {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 12px;
}
.msg.user .bubble.voice .wave {
  display: inline-flex;
  gap: 2px;
  align-items: end;
}
.msg.user .bubble.voice .wave span {
  width: 2px;
  background: var(--accent);
  border-radius: 1px;
}
.msg.user .bubble.voice .wave span:nth-child(1) { height: 8px; }
.msg.user .bubble.voice .wave span:nth-child(2) { height: 14px; }
.msg.user .bubble.voice .wave span:nth-child(3) { height: 20px; }
.msg.user .bubble.voice .wave span:nth-child(4) { height: 12px; }
.msg.user .bubble.voice .wave span:nth-child(5) { height: 18px; }
.msg.user .bubble.voice .wave span:nth-child(6) { height: 8px; }

/* Inline pillar cards (rendered after the assistant message that generated them) */
.pillar-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 8px 0 0 42px;
  max-width: 540px;
}
.pillar-card {
  background: #fafaf6;
  border: 1.5px solid var(--rule);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 12px;
}
.pillar-card .pn {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--accent);
  margin-bottom: 4px;
  letter-spacing: 0.04em;
}
.pillar-card .pt {
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 3px;
  font-size: 13px;
}
.pillar-card .ps {
  color: var(--ink-3);
  font-size: 11px;
  line-height: 1.45;
}
.pillar-card.parked {
  grid-column: 1 / -1;
  opacity: 0.6;
}

/* Voice options */
.voice-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 8px 0 0 42px;
  max-width: 540px;
}
.voice-option {
  background: #fff;
  border: 1.5px solid var(--rule);
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color 0.12s, transform 0.06s;
  font-family: inherit;
  text-align: left;
  font-size: inherit;
  color: inherit;
}
.voice-option:hover { border-color: var(--accent); }
.voice-option:active { transform: translateY(1px); }
.voice-option .v-tag {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-3);
  margin-bottom: 4px;
  letter-spacing: 0.04em;
}
.voice-option .v-title {
  font-weight: 700;
  font-size: 13px;
  color: var(--ink);
  margin-bottom: 3px;
}
.voice-option .v-sub {
  font-size: 11px;
  color: var(--ink-3);
  line-height: 1.45;
}
.voice-option.recommended {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.voice-option.recommended .v-tag {
  color: var(--accent);
  font-weight: 600;
}
.voice-option.linkedin-url-form {
  grid-column: 1 / -1;
  border-color: var(--accent);
  background: #fff;
  cursor: default;
}
.voice-option.linkedin-url-form input {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--rule);
  border-radius: 6px;
  font-family: inherit;
  font-size: 13px;
  margin-top: 6px;
}
.voice-option.linkedin-url-form .url-submit-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

/* Scrape job pill */
.scrape-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 0 42px;
  padding: 6px 12px;
  background: var(--li-soft);
  color: var(--li);
  border-radius: 99px;
  font-family: var(--mono);
  font-size: 11px;
  border: 1px solid #b3d4f4;
}
.scrape-pill.done { background: var(--good-soft); color: var(--good); border-color: #b8d8c2; }
.scrape-pill.failed { background: var(--warn-soft); color: var(--warn); border-color: #f5c3c3; }
.scrape-pill .spin {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 1.4s infinite ease-in-out;
}
@keyframes pulse {
  0%, 100% { opacity: 0.4; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.1); }
}

.status-bar {
  font-size: 12px;
  color: var(--ink-3);
  font-family: var(--mono);
  text-align: center;
  margin-top: 8px;
}

/* Composer */
.composer {
  position: sticky;
  bottom: 0;
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
  padding: 12px 24px 20px;
  background: #fafaf6;
  border-top: 1px solid var(--rule);
}
.composer-row {
  display: flex;
  align-items: end;
  gap: 8px;
  background: #fff;
  border: 1.5px solid var(--rule);
  border-radius: 14px;
  padding: 8px 8px 8px 14px;
}
.composer-row:focus-within { border-color: var(--ink); }
.chat-input {
  flex: 1;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 14px;
  resize: none;
  padding: 8px 0;
  max-height: 160px;
  line-height: 1.45;
}
.mic-btn, .send-btn {
  border: none;
  border-radius: 8px;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  font-size: 16px;
  flex-shrink: 0;
}
.mic-btn {
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  position: relative;
  transition: transform 0.08s;
}
.mic-btn:hover { transform: scale(1.05); }
.mic-btn.recording {
  background: var(--warn);
  box-shadow: 0 0 0 4px rgba(192,57,43,0.18);
}
.mic-btn.recording::after {
  content: "";
  position: absolute; inset: -6px;
  border: 2px solid var(--warn);
  border-radius: 50%;
  animation: rec-pulse 1.2s infinite;
}
@keyframes rec-pulse {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(1.4); opacity: 0; }
}
.send-btn {
  background: var(--ink);
  color: #fff;
}
.send-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.composer-hint {
  margin-top: 6px;
  font-size: 11px;
  color: var(--ink-3);
  text-align: center;
  font-family: var(--mono);
}
.composer-hint kbd {
  background: #f0eee5;
  padding: 1px 6px;
  border-radius: 3px;
  border: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 10px;
}
.composer-next {
  margin-top: 12px;
  text-align: center;
}

/* ===== Mobile ===== */
@media (max-width: 880px) {
  .hero { grid-template-columns: 1fr; padding: 24px; gap: 36px; }
  .hero-left h1 { font-size: 42px; }
  .hero-right { min-height: auto; padding: 24px; }
  .week-compare { grid-template-columns: 1fr; }
  .week-new { border-left: none; border-top: 1px solid var(--rule); }
  .story-band { padding: 32px 24px; }
  .story-section { grid-template-columns: 1fr; gap: 16px; padding: 28px 0; }
  .story-meta h2 { font-size: 26px; }
  .tagline-footer { padding: 24px; flex-direction: column; align-items: flex-start; }
  .landing-nav { padding: 18px 24px; }
  .nav-cta { gap: 8px; }
  .pillar-cards, .voice-options { grid-template-columns: 1fr; margin-left: 0; }
  .composer { padding: 12px 16px; }
}

/* ============================================================
   SETUP GUIDE — reusable "How do I get this? / كيف أحصل عليه؟"
   accordion (templates/partials/setup_guide.html). Onboarding variant
   (uses onboarding tokens). Mirrors the app-shell rules in styles.css.
   RTL-safe via logical properties. Requires Phosphor icons on the page.
   ============================================================ */
.setup-guide {
  border: 1px solid var(--ink-100);
  border-radius: 12px;
  background: var(--paper);
  margin: 18px 0 0;
  overflow: hidden;
  text-align: start;
}
.setup-guide[open] { border-color: var(--ink-300); box-shadow: var(--shadow-sm, 0 1px 2px rgba(0,0,0,0.05)); }
.setup-guide-toggle {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  font-family: 'Nunito', system-ui, sans-serif;
  user-select: none;
}
.setup-guide-toggle::-webkit-details-marker { display: none; }
.setup-guide-toggle:hover { background: var(--brand-100); }
.setup-guide .sg-q {
  display: inline-grid;
  place-items: center;
  width: 28px; height: 28px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--brand-100);
  color: var(--brand-700);
  font-size: 16px;
}
.setup-guide .sg-titles {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1 1 auto;
  min-width: 0;
}
.setup-guide .sg-title-ar {
  font-family: 'Thmanyah Sans', 'Nunito', sans-serif;
  font-size: 14px; font-weight: 700;
  color: var(--ink-900);
  direction: rtl; text-align: start;
}
.setup-guide .sg-title-en {
  font-size: 12px; color: var(--ink-500);
  direction: ltr; text-align: start;
}
.setup-guide .sg-caret {
  flex: 0 0 auto;
  color: var(--ink-500);
  font-size: 16px;
  transition: transform 0.18s ease;
}
.setup-guide[open] .sg-caret { transform: rotate(180deg); }
.setup-guide-body {
  padding: 4px 18px 18px;
  border-top: 1px solid var(--ink-100);
}
.setup-guide .sg-steps {
  counter-reset: sg;
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
}
.setup-guide .sg-step {
  counter-increment: sg;
  position: relative;
  padding: 10px 0 10px 40px;
  border-bottom: 1px solid var(--ink-100);
}
.setup-guide .sg-step:last-child { border-bottom: 0; }
.setup-guide .sg-step::before {
  content: counter(sg);
  position: absolute;
  inset-inline-start: 0;
  top: 9px;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--brand-500);
  color: var(--ink-900);
  font-weight: 700; font-size: 13px;
  display: grid; place-items: center;
}
.setup-guide .sg-step-ar {
  display: block;
  font-family: 'Thmanyah Sans', 'Nunito', sans-serif;
  font-size: 14px; line-height: 1.6;
  color: var(--ink-900);
}
.setup-guide .sg-step-en {
  display: block;
  font-size: 12.5px; line-height: 1.55;
  color: var(--ink-500);
  margin-top: 2px;
}
.setup-guide .sg-step code {
  background: var(--brand-100);
  color: var(--brand-700);
  padding: 1px 6px; border-radius: 5px;
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  direction: ltr; display: inline-block;
}
.setup-guide .sg-step a {
  color: var(--brand-700);
  text-decoration: underline;
}
.setup-guide .sg-note {
  display: flex; gap: 8px; align-items: flex-start;
  margin-top: 14px;
  padding: 11px 13px;
  background: var(--brand-100);
  border-radius: 9px;
  font-size: 12.5px; line-height: 1.55;
  color: var(--brand-700);
}
.setup-guide .sg-note .ph { font-size: 16px; flex: 0 0 auto; margin-top: 1px; }
.setup-guide .sg-note-ar { display: block; font-family: 'Thmanyah Sans', 'Nunito', sans-serif; }
.setup-guide .sg-note-en { display: block; color: var(--ink-500); margin-top: 2px; direction: ltr; }
.setup-guide .sg-note code {
  background: rgba(255,255,255,0.65);
  padding: 0 4px; border-radius: 4px;
  font-family: var(--font-mono, monospace); font-size: 11.5px;
}
.setup-guide .sg-link {
  display: inline-flex; align-items: center; gap: 7px;
  margin-top: 16px;
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--ink-900);
  color: var(--paper);
  font-size: 13px; font-weight: 600;
  text-decoration: none;
}
.setup-guide .sg-link:hover { background: var(--ink-700); }
.setup-guide .sg-link .ph { font-size: 16px; }

/* ============================================================
   ONBOARDING V2 - voice-first shell + shared components
   Shell: templates/onboarding/_step.html. Locked tokens only.
   ============================================================ */

.onb-step { background: var(--ink-50); }
.onb-canvas {
  max-width: 640px; margin: 0 auto; padding: 28px 24px 80px;
  display: flex; flex-direction: column; align-items: center; min-height: 100vh;
}
.onb-canvas--wide { max-width: 900px; }

.onb-topbar {
  width: 100%; display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; gap: 12px; margin-bottom: 28px;
}
.onb-topbar__side { display: flex; align-items: center; }
.onb-topbar__side--start { justify-content: flex-start; }
.onb-topbar__side--end { justify-content: flex-end; }
.onb-back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; color: var(--ink-500); text-decoration: none;
}
.onb-back:hover { color: var(--ink-900); }
.onb-back__icon { font-size: 16px; }
[dir="rtl"] .onb-back__icon { transform: scaleX(-1); }

.onb-skip { font-family: var(--font-mono); font-size: 12px; color: var(--ink-500); text-decoration: none; }
.onb-skip:hover { color: var(--ink-700); text-decoration: underline; }

.onb-progress { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 180px; }
.onb-progress__track {
  width: 180px; height: 4px; background: var(--ink-100);
  border-radius: var(--radius-full); overflow: hidden;
}
.onb-progress__fill {
  height: 100%; background: var(--brand-500); border-radius: var(--radius-full);
  transition: width 0.4s cubic-bezier(.16,1,.3,1);
}
.onb-progress__label { font-family: var(--font-mono); font-size: 11px; color: var(--ink-500); }

.onb-mascot-wrap { margin: 4px 0 20px; }
.onb-mascot { width: 120px; height: 120px; border-radius: 24px; object-fit: cover; display: block; }

.onb-card { width: 100%; text-align: center; }
.onb-h1 {
  font-family: var(--font-display); font-size: 30px; line-height: 1.18;
  letter-spacing: -0.02em; font-weight: 700; color: var(--ink-900); margin: 0 0 12px;
}
.onb-sub { font-size: 16px; line-height: 1.55; color: var(--ink-700); max-width: 520px; margin: 0 auto 24px; }
.onb-actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px; margin-top: 28px; }
.onb-form { width: 100%; }
.onb-form--left { text-align: start; max-width: 460px; margin: 0 auto; }

.onb-field { display: block; margin-bottom: 16px; text-align: start; }
.onb-field__label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-700); margin-bottom: 6px; }
.onb-input {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--ink-300);
  border-radius: var(--radius-md); background: var(--paper); font-family: inherit;
  font-size: 15px; box-sizing: border-box;
}
.onb-input:focus { outline: none; border-color: var(--brand-600); }

.onb-options { display: grid; grid-template-columns: 1fr; gap: 10px; max-width: 460px; margin: 0 auto; text-align: start; }
.onb-options--row { grid-template-columns: repeat(3, 1fr); max-width: 560px; text-align: center; }
.onb-option {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  border: 1.5px solid var(--ink-300); border-radius: var(--radius-lg);
  background: var(--paper); cursor: pointer; position: relative;
  transition: border-color .14s, background .14s, transform .14s;
}
.onb-option:hover { transform: translateY(-1px); border-color: var(--ink-500); }
.onb-option input { position: absolute; opacity: 0; pointer-events: none; }
.onb-option:has(input:checked) { border-color: var(--brand-600); background: var(--brand-100); }
.onb-option__emoji { font-size: 22px; line-height: 1; }
.onb-option__label { font-size: 15px; font-weight: 600; color: var(--ink-900); }
.onb-option--big { flex-direction: column; gap: 6px; padding: 22px 14px; text-align: center; }
.onb-option__count { font-family: var(--font-display); font-size: 22px; font-weight: 800; color: var(--ink-900); }

.onb-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; max-width: 560px; margin: 0 auto; }
.onb-chip {
  display: inline-flex; align-items: center; padding: 9px 16px; position: relative;
  border: 1.5px solid var(--ink-300); border-radius: var(--radius-full);
  background: var(--paper); cursor: pointer;
  transition: border-color .14s, background .14s, color .14s;
}
.onb-chip input { position: absolute; opacity: 0; pointer-events: none; }
.onb-chip__label { font-size: 14px; font-weight: 600; color: var(--ink-700); }
.onb-chip:has(input:checked) { border-color: var(--brand-600); background: var(--brand-100); }
.onb-chip:has(input:checked) .onb-chip__label { color: var(--brand-700); }
.onb-chip--warn:has(input:checked) { border-color: var(--warn-600); background: var(--warn-100); }
.onb-chip--warn:has(input:checked) .onb-chip__label { color: var(--warn-600); }

/* Off-limits custom add: runtime-added chips are always "on" (no checkbox to
   toggle), so render them in the warn-active state and give them a remove btn. */
.onb-chip--custom { border-color: var(--warn-600); background: var(--warn-100); cursor: default; }
.onb-chip--custom .onb-chip__label { color: var(--warn-600); }
.onb-chip__remove {
  display: inline-flex; align-items: center; justify-content: center;
  margin-inline-start: 6px; padding: 0; width: 18px; height: 18px;
  border: none; border-radius: var(--radius-full); background: transparent;
  color: var(--warn-600); cursor: pointer; font-size: 14px; line-height: 1;
}
.onb-chip__remove:hover { background: rgba(192,57,43,0.12); }

.onb-addrow {
  display: flex; gap: 10px; align-items: center;
  max-width: 460px; margin: 18px auto 0;
}
.onb-addrow__input { flex: 1; }
[dir="rtl"] .onb-addrow { direction: rtl; }
@media (max-width: 560px) {
  .onb-addrow { flex-direction: column; align-items: stretch; }
}

.onb-pillar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; text-align: start; }
.onb-pillar {
  display: grid; gap: 4px; padding: 16px; position: relative;
  border: 1.5px solid var(--ink-300); border-radius: var(--radius-lg);
  background: var(--paper); cursor: pointer;
  transition: border-color .14s, background .14s, transform .14s;
}
.onb-pillar:hover { transform: translateY(-1px); border-color: var(--ink-500); }
.onb-pillar input { position: absolute; opacity: 0; pointer-events: none; }
.onb-pillar:has(input:checked) { border-color: var(--brand-600); background: var(--brand-100); }
.onb-pillar__emoji { font-size: 22px; }
.onb-pillar__name { font-size: 15px; font-weight: 700; color: var(--ink-900); }
.onb-pillar__desc { font-size: 13px; line-height: 1.5; color: var(--ink-500); }

.onb-post-list { display: grid; gap: 12px; text-align: start; }
.onb-post-pick {
  display: grid; gap: 8px; padding: 16px; position: relative;
  border: 1.5px solid var(--ink-300); border-radius: var(--radius-lg);
  background: var(--paper); cursor: pointer;
  transition: border-color .14s, background .14s;
}
.onb-post-pick input { position: absolute; opacity: 0; pointer-events: none; }
.onb-post-pick:has(input:checked) { border-color: var(--brand-600); background: var(--brand-100); }
.onb-post-pick__preview {
  font-size: 14px; line-height: 1.6; color: var(--ink-900);
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.onb-post-pick__meta { display: inline-flex; gap: 14px; align-items: center; font-size: 12px; color: var(--ink-500); font-family: var(--font-mono); }
.onb-post-pick__meta .ph { font-size: 14px; }

.onb-textarea {
  width: 100%; padding: 14px 16px; border: 1.5px solid var(--ink-300);
  border-radius: var(--radius-md); background: var(--paper); font-family: inherit;
  font-size: 15px; line-height: 1.6; resize: vertical; box-sizing: border-box;
}
.onb-textarea:focus { outline: none; border-color: var(--brand-600); }
.onb-rewrite { margin-bottom: 20px; text-align: start; }
.onb-rewrite__seed {
  font-size: 15px; color: var(--ink-700); background: var(--ink-100);
  border-radius: var(--radius-md); padding: 10px 14px; margin: 0 0 8px;
}

.onb-reveal-kicker { font-size: 14px; color: var(--ink-500); font-weight: 600; margin: 0 0 14px; }
.onb-reveal-card {
  background: var(--paper); border: 1px solid var(--ink-300); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md); padding: 36px 28px; max-width: 460px; margin: 0 auto;
}
.onb-reveal-card__emoji { font-size: 48px; line-height: 1; }
.onb-reveal-card__name-ar { font-family: var(--font-display); font-size: 28px; font-weight: 800; color: var(--ink-900); margin: 14px 0 2px; }
.onb-reveal-card__name-en { font-family: var(--font-mono); font-size: 13px; color: var(--ink-500); letter-spacing: 0.02em; margin: 0 0 16px; }
.onb-reveal-card__blurb { font-size: 16px; line-height: 1.6; color: var(--ink-700); margin: 0 0 18px; white-space: pre-line; }
.onb-reveal-card__points { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; text-align: start; }
.onb-reveal-card__points li { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-700); }
.onb-reveal-card__points .ph { color: var(--brand-600); font-size: 16px; }

@media (max-width: 560px) {
  .onb-topbar { grid-template-columns: auto 1fr auto; }
  .onb-progress, .onb-progress__track { min-width: 120px; width: 120px; }
  .onb-options--row { grid-template-columns: 1fr; }
}

