@font-face {
  font-family: "Noto Naskh Arabic Local";
  src: url("../../assets/fonts/noto-naskh-arabic/NotoNaskhArabic-Arabic-Variable.woff2") format("woff2-variations");
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --ink: #10211f;
  --ink-soft: #263a36;
  --paper: #f3f6f3;
  --surface: #ffffff;
  --surface-2: #edf2ee;
  --line: #d8e0db;
  --line-dark: #b7c3bc;
  --muted: #6c7c76;
  --jade: #087a68;
  --jade-dark: #075f53;
  --jade-pale: #dceee8;
  --cobalt: #2f6793;
  --cobalt-pale: #e1ebf3;
  --brass: #b77a21;
  --brass-pale: #f8eddc;
  --cinnabar: #bd5748;
  --cinnabar-pale: #f5e7e4;
  --sidebar: 232px;
  --topbar: 64px;
  --radius: 7px;
  --shadow: 0 18px 50px rgba(16, 33, 31, 0.08);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button, a { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(47, 103, 147, 0.28); outline-offset: 2px; }
.arabic-line, .hero-arabic, .turn-arabic, .arabic-cell, [dir="rtl"] {
  font-family: "Noto Naskh Arabic Local", "Traditional Arabic", "Arabic Typesetting", "Noto Naskh Arabic", "Amiri", "Times New Roman", serif;
  letter-spacing: 0;
}
.prototype-shell { min-height: 100vh; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 100; transform: translateY(-150%); background: var(--surface); color: var(--ink); padding: 9px 12px; border: 2px solid var(--jade); font-size: 11px; font-weight: 800; }
.skip-link:focus { transform: translateY(0); }
h1, h2, h3 { text-wrap: balance; scroll-margin-top: calc(var(--topbar) + 12px); }
.app-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  display: flex;
  width: var(--sidebar);
  flex-direction: column;
  overflow-y: auto;
  background: var(--ink);
  color: #e8f0ec;
  border-right: 1px solid rgba(255,255,255,.08);
}
.brand { display: flex; min-height: 78px; align-items: center; gap: 11px; padding: 16px 18px; color: inherit; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.09); }
.brand-mark { position: relative; display: grid; width: 36px; height: 36px; flex: 0 0 36px; place-items: center; overflow: hidden; border: 1px solid rgba(255,255,255,.28); background: #dceee8; color: var(--jade-dark); }
.brand-mark b { font-family: "Traditional Arabic", serif; font-size: 27px; line-height: 1; transform: translateY(-1px); }
.brand-mark i { position: absolute; bottom: 5px; width: 3px; height: 3px; border-radius: 50%; background: var(--cinnabar); }
.brand-mark i:nth-of-type(1) { left: 6px; }.brand-mark i:nth-of-type(2) { left: 11px; }.brand-mark i:nth-of-type(3) { left: 16px; }
.brand-copy { display: grid; gap: 3px; min-width: 0; }
.brand-copy strong { white-space: nowrap; font-size: 15px; }
.brand-copy small { color: #8fa39b; font-family: Georgia, serif; font-size: 9px; letter-spacing: .12em; }
.primary-nav { padding: 14px 10px; }
.nav-label { margin: 16px 10px 7px; color: #789087; font-size: 10px; font-weight: 800; }
.nav-item { position: relative; display: flex; width: 100%; height: 42px; align-items: center; gap: 11px; border: 0; border-left: 2px solid transparent; background: transparent; color: #afbeb8; padding: 0 11px; cursor: pointer; text-align: left; }
.nav-item svg { width: 18px; height: 18px; stroke-width: 1.8; }
.nav-item span { flex: 1; font-size: 13px; }
.nav-item em { border: 1px solid rgba(255,255,255,.12); padding: 2px 5px; color: #789087; font-style: normal; font-size: 9px; }
.nav-item:hover { background: rgba(255,255,255,.055); color: #fff; }
.nav-item.active { border-left-color: #3fc0a6; background: linear-gradient(90deg, rgba(8,122,104,.36), rgba(8,122,104,.08)); color: #fff; }
.sidebar-rights { margin: auto 12px 12px; padding: 13px; border: 1px solid rgba(100, 204, 181, .25); background: rgba(8,122,104,.13); }
.rights-head { display: flex; align-items: center; justify-content: space-between; color: #61d4ba; font-size: 12px; font-weight: 800; }
.rights-head span { display: flex; align-items: center; gap: 6px; }.rights-head svg { width: 15px; height: 15px; }
.sidebar-rights p { margin: 8px 0; color: #9fb2aa; font-size: 10px; }
.rights-meter { height: 3px; overflow: hidden; background: rgba(255,255,255,.1); }.rights-meter span { display: block; height: 100%; background: #37bda0; }
.text-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; background: transparent; color: var(--jade); padding: 0; cursor: pointer; font-size: 12px; font-weight: 800; }
.text-button svg { width: 14px; height: 14px; }
.sidebar-rights .text-button { margin-top: 11px; color: #63cfb7; font-size: 10px; }
.profile-row { display: flex; align-items: center; gap: 10px; min-height: 64px; padding: 12px 15px; border: 0; border-top: 1px solid rgba(255,255,255,.08); background: transparent; color: #eef5f2; cursor: pointer; text-align: left; }
.profile-row .avatar { display: grid; width: 32px; height: 32px; place-items: center; background: #31504a; color: #cdece4; font-size: 12px; }
.profile-row span:nth-child(2) { display: grid; flex: 1; gap: 2px; }.profile-row strong { font-size: 12px; }.profile-row small { color: #789087; font-size: 9px; }.profile-row svg { width: 14px; }
.app-stage { min-height: 100vh; margin-left: var(--sidebar); }
.topbar { position: sticky; top: 0; z-index: 15; display: flex; height: var(--topbar); align-items: center; gap: 18px; padding: 0 26px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); backdrop-filter: blur(12px); }
.mobile-brand, .icon-button.mobile-menu { display: none; }
.global-search { display: flex; width: min(620px, 54vw); height: 38px; align-items: center; gap: 9px; padding: 0 11px; border: 1px solid var(--line); background: #f9fbf9; }
.global-search svg { width: 16px; color: var(--muted); }.global-search input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 12px; }.global-search kbd { border: 1px solid var(--line); background: #fff; padding: 2px 5px; color: var(--muted); font-size: 9px; }
.top-actions { display: flex; margin-left: auto; align-items: center; gap: 7px; }
.icon-button { position: relative; display: inline-grid; width: 34px; height: 34px; flex: 0 0 34px; place-items: center; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.icon-button:hover { border-color: var(--jade); color: var(--jade); }.icon-button svg { width: 16px; height: 16px; stroke-width: 1.8; }
.notice-dot { position: absolute; top: 7px; right: 7px; width: 5px; height: 5px; border-radius: 50%; background: var(--cinnabar); }
.status-chip, .access-badge { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; border: 1px solid #b9dcd2; background: var(--jade-pale); color: var(--jade-dark); padding: 0 10px; font-size: 11px; font-weight: 800; }
.status-chip svg, .access-badge svg { width: 14px; height: 14px; }
.screen-host { min-height: calc(100vh - var(--topbar)); }
.screen { display: none; }.screen.active { display: block; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1fr) 306px; max-width: 1380px; margin: 0 auto; }
.dashboard-main { min-width: 0; padding: 38px 34px 60px; border-right: 1px solid var(--line); }
.dashboard-rail { padding: 38px 24px 60px; }
.page-heading { margin-bottom: 28px; }.heading-split { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.eyebrow { margin: 0 0 7px; color: var(--jade); font-family: Georgia, "Times New Roman", serif; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .09em; }
.page-heading h1 { margin: 0; font-family: "STZhongsong", "Songti SC", serif; font-size: 32px; font-weight: 700; line-height: 1.24; }
.page-heading p:not(.eyebrow) { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.streak-seal { display: grid; width: 74px; height: 74px; flex: 0 0 74px; place-items: center; border: 1px solid var(--line-dark); background: var(--surface); box-shadow: 7px 7px 0 var(--jade-pale); }
.streak-seal span { align-self: end; font-family: Georgia, serif; font-size: 27px; font-weight: 700; }.streak-seal small { align-self: start; color: var(--muted); font-size: 9px; }
.streak-seal span, .weekly-progress strong, .metric-row strong { font-variant-numeric: tabular-nums; }
.ruled-panel { position: relative; border: 1px solid var(--line-dark); background: var(--surface); box-shadow: 10px 10px 0 #e4ebe6; }
.ruled-panel::after { content: ""; position: absolute; inset: 0; pointer-events: none; background-image: linear-gradient(to right, transparent 23px, rgba(8,122,104,.08) 24px, transparent 25px); background-size: 25px 100%; opacity: .45; }
.focus-lesson { display: grid; grid-template-columns: 96px minmax(0,1fr) auto; min-height: 210px; overflow: hidden; }
.section-index { position: relative; z-index: 1; display: grid; align-content: center; gap: 6px; padding: 18px; border-right: 1px solid var(--line); background: rgba(243,246,243,.86); }
.section-index span { font-family: Georgia, serif; color: var(--cinnabar); font-size: 29px; }.section-index small { color: var(--muted); font-size: 9px; writing-mode: vertical-rl; }
.focus-copy { position: relative; z-index: 1; min-width: 0; padding: 26px 28px; }
.focus-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; }
.arabic-line { margin-top: 21px; color: var(--ink); font-size: 34px; font-weight: 700; line-height: 1.8; text-align: right; }
.translation { margin: 0; font-family: "STZhongsong", "Songti SC", serif; font-size: 18px; }
.sentence-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 15px; }.sentence-tags span { border: 1px solid var(--line); background: #f8faf8; padding: 4px 7px; color: var(--muted); font-size: 9px; }
.focus-actions { position: relative; z-index: 1; display: flex; min-width: 160px; flex-direction: column; align-items: flex-end; justify-content: space-between; padding: 24px; }
.audio-button { border-color: #a7d6c9; color: var(--jade); }
.primary-button, .secondary-button { display: inline-flex; min-height: 38px; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--jade); padding: 0 14px; cursor: pointer; font-size: 11px; font-weight: 800; text-decoration: none; }
.primary-button { background: var(--jade); color: #fff; }.primary-button:hover { background: var(--jade-dark); }.secondary-button { background: var(--surface); color: var(--ink); border-color: var(--line-dark); }.primary-button svg, .secondary-button svg { width: 14px; height: 14px; }
.section-block { margin-top: 34px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 15px; }.section-heading h2 { margin: 0; font-family: "STZhongsong", "Songti SC", serif; font-size: 21px; }.section-heading.compact { align-items: center; }.section-heading.compact h2 { font-family: inherit; font-size: 14px; }.section-heading.compact .eyebrow { margin-bottom: 3px; }
.route-track { position: relative; display: grid; grid-template-columns: repeat(3,1fr); border-top: 1px solid var(--line-dark); border-bottom: 1px solid var(--line); }
.route-track::before { content: ""; position: absolute; top: 24px; left: 16.66%; right: 16.66%; border-top: 1px dashed var(--line-dark); }
.route-step { position: relative; z-index: 1; display: grid; place-items: center; gap: 5px; border: 0; background: transparent; padding: 13px 12px 15px; cursor: pointer; }
.route-step > span { display: grid; width: 24px; height: 24px; place-items: center; border: 1px solid var(--line-dark); border-radius: 50%; background: var(--paper); color: var(--muted); font-family: Georgia, serif; font-size: 11px; }.route-step > span svg { width: 13px; }.route-step strong { font-size: 11px; }.route-step small { color: var(--muted); font-size: 9px; }.route-step.done > span { border-color: var(--jade); background: var(--jade); color: #fff; }.route-step.current { background: linear-gradient(180deg, var(--jade-pale), transparent); }.route-step.current > span { border-color: var(--jade); color: var(--jade); }
.topic-grid { display: grid; grid-template-columns: repeat(3,1fr); border: 1px solid var(--line); }
.topic-card { display: grid; grid-template-columns: auto 1fr auto; min-height: 104px; align-items: center; gap: 12px; border: 0; border-right: 1px solid var(--line); background: var(--surface); padding: 15px; text-align: left; cursor: pointer; }.topic-card:last-child { border-right: 0; }.topic-card:hover { background: #f8fbf9; }.topic-icon { display: grid; width: 36px; height: 36px; place-items: center; background: var(--cobalt-pale); color: var(--cobalt); }.topic-card.trade .topic-icon { background: var(--jade-pale); color: var(--jade); }.topic-card.life .topic-icon { background: var(--brass-pale); color: var(--brass); }.topic-icon svg { width: 18px; }.topic-card > span:nth-child(2) { display: grid; gap: 3px; }.topic-card small { color: var(--muted); font-size: 8px; }.topic-card strong { font-size: 13px; }.topic-card em { color: var(--muted); font-style: normal; font-size: 9px; }.topic-card > svg { width: 14px; color: var(--muted); }
.rail-section { padding: 0 0 25px; margin-bottom: 25px; border-bottom: 1px solid var(--line); }.weekly-progress .section-heading strong { color: var(--jade); font-family: Georgia, serif; font-size: 24px; }.week-chart { display: flex; height: 105px; align-items: end; justify-content: space-between; gap: 6px; border-bottom: 1px solid var(--line-dark); padding: 0 3px; }.week-chart span { position: relative; width: 22px; height: var(--h); background: #c9d6d0; }.week-chart span.today { background: var(--jade); }.week-chart i { position: absolute; bottom: -23px; width: 100%; color: var(--muted); font-style: normal; font-size: 8px; text-align: center; }.metric-row { display: grid; grid-template-columns: repeat(3,1fr); margin-top: 34px; }.metric-row span { display: grid; gap: 3px; border-right: 1px solid var(--line); text-align: center; }.metric-row span:last-child { border-right: 0; }.metric-row small { color: var(--muted); font-size: 8px; }.metric-row strong { font-family: Georgia, serif; font-size: 18px; }
.review-list .section-heading { margin-bottom: 5px; }.review-item { display: grid; width: 100%; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 10px 0; text-align: left; cursor: pointer; }.review-mark { display: grid; width: 29px; height: 29px; place-items: center; font-family: "Traditional Arabic", serif; font-size: 16px; }.review-mark.verb { background: var(--cinnabar-pale); color: var(--cinnabar); }.review-mark.noun { background: var(--cobalt-pale); color: var(--cobalt); }.review-mark.particle { background: var(--jade-pale); color: var(--jade); }.review-item > span:nth-child(2) { display: grid; gap: 2px; }.review-item b { font-family: "Traditional Arabic", serif; font-size: 16px; text-align: right; }.review-item small, .review-item em { color: var(--muted); font-size: 8px; font-style: normal; }.review-item em { border: 1px solid var(--line); padding: 3px 5px; }
.plus-note { border-left: 3px solid var(--brass); background: var(--brass-pale); padding: 14px; }.plus-note > span { display: flex; align-items: center; gap: 6px; color: #815516; font-size: 11px; font-weight: 800; }.plus-note svg { width: 14px; }.plus-note p { margin: 7px 0 10px; color: #7e6a4b; font-size: 9px; line-height: 1.6; }.plus-note .text-button { color: #815516; font-size: 9px; }

/* Analyzer */
.analyzer-screen.active { display: grid; grid-template-columns: 218px minmax(560px, 1fr) 304px; min-height: calc(100vh - var(--topbar)); }
.sentence-browser, .inspector-panel { min-width: 0; background: #eef2ef; }.sentence-browser { border-right: 1px solid var(--line); padding: 22px 14px; }.sentence-browser header { position: relative; padding: 0 4px 14px; }.sentence-browser header h2 { margin: 0; font-family: "STZhongsong", serif; font-size: 21px; }.sentence-browser header > span { position: absolute; right: 4px; bottom: 16px; color: var(--muted); font-family: Georgia, serif; font-size: 11px; }
.mini-search { display: flex; height: 34px; align-items: center; gap: 7px; border: 1px solid var(--line); background: #fff; padding: 0 9px; }.mini-search svg { width: 14px; color: var(--muted); }.mini-search input { min-width: 0; flex: 1; border: 0; outline: 0; font-size: 10px; }
.filter-row { display: flex; gap: 5px; margin: 9px 0 14px; }.filter-button { border: 1px solid var(--line); background: transparent; padding: 5px 8px; color: var(--muted); cursor: pointer; font-size: 8px; }.filter-button.active { border-color: var(--jade); background: var(--jade); color: #fff; }
.sentence-list { display: grid; gap: 5px; }.sentence-item { position: relative; display: grid; gap: 4px; min-height: 73px; border: 1px solid transparent; background: transparent; padding: 10px 9px 10px 34px; text-align: left; cursor: pointer; }.sentence-item > span { position: absolute; left: 8px; top: 11px; color: var(--muted); font-family: Georgia, serif; font-size: 8px; }.sentence-item b { overflow: hidden; font-family: "Traditional Arabic", serif; font-size: 17px; font-weight: 600; text-align: right; text-overflow: ellipsis; white-space: nowrap; }.sentence-item small { overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }.sentence-item:hover { border-color: var(--line-dark); background: #fff; }.sentence-item.active { border-color: #a8d0c5; background: #fff; box-shadow: 4px 4px 0 var(--jade-pale); }.sentence-item.active::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--jade); }
.collection-button { display: grid; width: 100%; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; margin-top: 18px; border: 1px solid var(--line); background: transparent; padding: 10px; text-align: left; cursor: pointer; }.collection-button > svg { width: 15px; }.collection-button span { display: grid; gap: 2px; }.collection-button strong { font-size: 10px; }.collection-button small { color: var(--muted); font-size: 8px; }
.analysis-canvas { min-width: 0; background: var(--surface); }.analysis-heading { display: flex; min-height: 82px; align-items: center; justify-content: space-between; gap: 16px; padding: 17px 24px; border-bottom: 1px solid var(--line); }.breadcrumb { margin: 0 0 6px; color: var(--muted); font-size: 9px; }.analysis-heading h1 { margin: 0; font-family: "STZhongsong", serif; font-size: 22px; }.analysis-heading h1 span { color: var(--muted); font-family: Georgia, serif; font-size: 10px; }.canvas-actions { display: flex; gap: 7px; }
.sentence-hero { position: relative; min-height: 235px; padding: 28px 40px 24px; overflow: hidden; border-bottom: 1px solid var(--line); background-color: #fbfcfb; background-image: radial-gradient(circle at 1px 1px, rgba(16,33,31,.08) 1px, transparent 0); background-size: 20px 20px; text-align: center; }.sentence-status { display: flex; justify-content: center; gap: 5px; }.sentence-status span { border: 1px solid var(--line); background: rgba(255,255,255,.88); padding: 4px 6px; color: var(--muted); font-size: 8px; }.hero-audio { position: absolute; top: 24px; right: 26px; display: grid; width: 40px; height: 40px; place-items: center; border: 1px solid #acd3c8; background: #fff; color: var(--jade); cursor: pointer; }.hero-audio svg { width: 17px; }.hero-arabic { margin: 21px 0 0; font-size: 40px; font-weight: 700; line-height: 1.6; }.hero-translation { margin: 2px 0 0; font-family: "STZhongsong", serif; font-size: 19px; }.transliteration { margin: 7px 0 0; color: var(--muted); font-family: Georgia, serif; font-size: 10px; }
.syntax-rail-section, .word-lab { padding: 22px 24px; border-bottom: 1px solid var(--line); }.syntax-rail { position: relative; display: grid; grid-template-columns: repeat(5,1fr); gap: 12px; padding: 22px 8px 5px; }.syntax-rail::before { content: ""; position: absolute; top: 49px; left: 10%; right: 10%; border-top: 2px solid var(--line-dark); }.syntax-node { position: relative; display: grid; min-width: 0; gap: 5px; place-items: center; border: 0; background: transparent; cursor: pointer; }.syntax-node::before { content: ""; position: absolute; top: 20px; z-index: 1; width: 10px; height: 10px; border: 3px solid #fff; border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 1px var(--line-dark); }.syntax-node b { min-width: 72px; border: 1px solid var(--line); background: #fff; padding: 6px 8px 20px; font-family: "Traditional Arabic", serif; font-size: 21px; }.syntax-node span { color: var(--muted); font-size: 8px; }.syntax-node.verb::before { background: var(--cinnabar); }.syntax-node.noun::before { background: var(--cobalt); }.syntax-node.particle::before { background: var(--jade); }.syntax-node.place::before { background: var(--brass); }.syntax-node.active b { border-color: var(--jade); box-shadow: 4px 4px 0 var(--jade-pale); }.syntax-formula { margin: 15px 0 0; color: var(--muted); font-size: 16px; text-align: center; }
.legend { display: flex; gap: 5px; }.legend span { padding: 3px 6px; font-size: 8px; }.legend .verb { background: var(--cinnabar-pale); color: var(--cinnabar); }.legend .noun { background: var(--cobalt-pale); color: var(--cobalt); }.legend .particle { background: var(--jade-pale); color: var(--jade); }
.word-table { border: 1px solid var(--line); }.word-row { display: grid; width: 100%; grid-template-columns: 1.1fr .8fr 1.1fr .7fr 1.25fr 22px; align-items: center; border: 0; border-bottom: 1px solid var(--line); background: #fff; padding: 0; text-align: left; cursor: pointer; }.word-row:last-child { border-bottom: 0; }.word-row > span { display: grid; min-height: 54px; align-content: center; gap: 2px; padding: 8px 9px; border-right: 1px solid var(--line); font-size: 9px; }.word-row > span b { font-size: 9px; }.word-row > span small { color: var(--muted); font-size: 7px; }.word-row > svg { width: 13px; color: var(--jade); }.word-row.table-head { min-height: 30px; background: #edf2ee; color: var(--muted); font-size: 8px; cursor: default; }.word-row.table-head span { min-height: 30px; }.word-row:hover:not(.table-head) { background: #f8fbf9; }.word-row.active { background: #f2f9f6; }.word-row.active::before { content: ""; width: 3px; height: 100%; background: var(--jade); }.word-row.active { grid-template-columns: 3px 1.1fr .8fr 1.1fr .7fr 1.25fr 22px; }.word-row.active > span:first-of-type { grid-column: 2; }.arabic-cell { font-size: 19px !important; text-align: right; }
.grammar-band { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); }.grammar-band > div { display: flex; gap: 11px; min-height: 92px; padding: 17px 20px; background: #f7f9f7; }.section-number { display: grid; width: 27px; height: 27px; flex: 0 0 27px; place-items: center; border: 1px solid var(--line-dark); color: var(--jade); font-family: Georgia, serif; }.grammar-band p { display: grid; gap: 5px; margin: 0; }.grammar-band strong { font-size: 10px; }.grammar-band small { color: var(--muted); font-size: 8px; line-height: 1.7; }.grammar-band b { color: var(--ink); font-size: 14px; }
.inspector-panel { border-left: 1px solid var(--line); padding: 16px 14px; }.inspector-block { margin-bottom: 12px; border: 1px solid var(--line); background: var(--surface); padding: 14px; }.inspector-label { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; color: var(--muted); font-size: 9px; font-weight: 800; }.inspector-label em { font-style: normal; font-size: 7px; font-weight: 400; }.inspector-label .icon-button { width: 25px; height: 25px; flex-basis: 25px; }.inspector-label svg { width: 12px; }
.root-core { display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }.root-core b { grid-row: span 2; font-family: "Traditional Arabic", serif; font-size: 27px; }.root-core span { font-family: Georgia, serif; font-size: 10px; }.root-core small { color: var(--muted); font-size: 8px; }
.derivation-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 11px 0; }.derivation-grid button { display: grid; gap: 2px; border: 1px solid var(--line); background: #f9fbf9; padding: 8px; text-align: center; cursor: pointer; }.derivation-grid b { font-family: "Traditional Arabic", serif; font-size: 18px; }.derivation-grid span { color: var(--jade); font-size: 7px; }.derivation-grid small { color: var(--muted); font-size: 7px; }.full-width { width: 100%; min-height: 28px; border-top: 1px solid var(--line); padding-top: 10px; }
.mastery-options { display: grid; grid-template-columns: repeat(3,1fr); gap: 4px; }.mastery-options button { min-height: 28px; border: 1px solid var(--line); background: #fff; color: var(--muted); cursor: pointer; font-size: 8px; }.mastery-options button.active { border-color: var(--jade); background: var(--jade); color: #fff; }.review-state p { display: flex; gap: 5px; margin: 10px 0 0; color: var(--muted); font-size: 7px; line-height: 1.5; }.review-state p svg { width: 12px; flex: 0 0 12px; }

/* Scenario */
.scenario-screen.active { display: grid; grid-template-columns: 190px minmax(520px,1fr) 270px; min-height: calc(100vh - var(--topbar)); }.lesson-steps { padding: 28px 16px; border-right: 1px solid var(--line); background: #eef2ef; }.lesson-steps h2 { margin: 0; font-family: "STZhongsong", serif; font-size: 22px; }.lesson-steps > p:not(.eyebrow) { color: var(--muted); font-size: 9px; line-height: 1.6; }.lesson-steps ol { margin: 25px 0; padding: 0; list-style: none; }.lesson-steps li { position: relative; padding-bottom: 8px; }.lesson-steps li:not(:last-child)::after { content: ""; position: absolute; top: 29px; bottom: -2px; left: 14px; border-left: 1px dashed var(--line-dark); }.lesson-steps li button { display: grid; width: 100%; grid-template-columns: 29px 1fr; column-gap: 9px; border: 0; background: transparent; padding: 6px; text-align: left; cursor: pointer; }.lesson-steps li span { position: relative; z-index: 1; display: grid; width: 29px; height: 29px; grid-row: span 2; place-items: center; border: 1px solid var(--line-dark); border-radius: 50%; background: #eef2ef; color: var(--muted); font-family: Georgia, serif; font-size: 9px; }.lesson-steps li b { align-self: end; font-size: 10px; }.lesson-steps li small { color: var(--muted); font-size: 7px; }.lesson-steps li.active button { background: #fff; }.lesson-steps li.active span { border-color: var(--jade); background: var(--jade); color: #fff; }.lesson-progress > span { display: block; height: 3px; background: #d2dbd6; }.lesson-progress i { display: block; height: 100%; background: var(--jade); }.lesson-progress small { display: block; margin-top: 7px; color: var(--muted); font-size: 8px; }
.dialogue-canvas { min-width: 0; padding: 28px 28px 60px; background: #fff; }.compact-heading { margin-bottom: 20px; }.compact-heading h1 { font-size: 27px; }.scene-brief { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 13px; border-left: 3px solid var(--jade); background: var(--jade-pale); padding: 14px; }.scene-brief > svg { width: 21px; color: var(--jade); }.scene-brief strong { font-size: 10px; }.scene-brief p { margin: 4px 0 0; color: #45645c; font-size: 9px; line-height: 1.6; }.brief-tags { display: flex; gap: 4px; }.brief-tags span { border: 1px solid #add3c8; background: rgba(255,255,255,.45); padding: 4px 6px; color: var(--jade-dark); font-size: 7px; }
.dialogue-flow { margin-top: 24px; }.dialogue-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 15px; padding-bottom: 12px; border-bottom: 1px solid var(--line-dark); }.dialogue-toolbar h2 { margin: 0; font-family: "STZhongsong", serif; font-size: 19px; }.dialogue-toolbar > div:last-child { display: flex; gap: 6px; }
.dialogue-turn { display: grid; grid-template-columns: 34px 1fr; gap: 12px; padding: 20px 10px; border-bottom: 1px solid var(--line); }.speaker { display: grid; width: 32px; height: 32px; place-items: center; background: var(--jade); color: #fff; font-size: 9px; font-weight: 800; }.seller .speaker { background: var(--brass); }.turn-content header { display: flex; align-items: center; gap: 8px; }.turn-content header strong { flex: 1; font-size: 10px; }.turn-content header > span { border: 1px solid #a9d5c8; background: var(--jade-pale); padding: 3px 5px; color: var(--jade); font-size: 7px; }.turn-content header .icon-button { width: 27px; height: 27px; flex-basis: 27px; }.turn-content header svg { width: 13px; }.turn-arabic { margin: 7px 0 0; font-size: 25px; line-height: 1.7; text-align: right; }.turn-content > p:not(.turn-arabic) { margin: 0; color: var(--muted); font-size: 9px; text-align: right; }.word-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }.word-chips button { display: grid; gap: 1px; border: 1px solid var(--line); background: #f8faf8; padding: 5px 8px; font-family: "Traditional Arabic", serif; font-size: 14px; cursor: pointer; }.word-chips small { color: var(--muted); font-family: sans-serif; font-size: 6px; }.dialogue-turn.selected { border: 1px solid #aad4c8; border-left: 3px solid var(--jade); background: #f4faf7; box-shadow: 5px 5px 0 var(--jade-pale); }.analysis-link { display: inline-flex; align-items: center; gap: 5px; margin-top: 11px; border: 0; background: transparent; color: var(--jade); padding: 0; cursor: pointer; font-size: 8px; font-weight: 800; }.analysis-link svg { width: 12px; }
.scenario-rail { padding: 28px 16px; border-left: 1px solid var(--line); background: #f4f6f4; }.scenario-rail section { margin-bottom: 12px; border: 1px solid var(--line); background: #fff; padding: 14px; }.scenario-rail h2 { margin: 0 0 12px; font-family: "STZhongsong", serif; font-size: 15px; }.outcome-panel > div { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 9px; padding: 9px 0; border-top: 1px solid var(--line); }.outcome-panel > div > span { display: grid; width: 29px; height: 29px; place-items: center; background: var(--jade-pale); color: var(--jade); }.outcome-panel svg { width: 15px; }.outcome-panel p { display: grid; gap: 2px; margin: 0; }.outcome-panel strong { font-size: 9px; }.outcome-panel small { color: var(--muted); font-size: 7px; }.phrase-panel button { display: flex; width: 100%; align-items: center; justify-content: space-between; border: 0; border-top: 1px solid var(--line); background: transparent; padding: 9px 0; cursor: pointer; }.phrase-panel b { font-family: "Traditional Arabic", serif; font-size: 17px; }.phrase-panel span { color: var(--muted); font-size: 7px; }.next-lesson { display: grid; gap: 8px; border-top: 3px solid var(--jade) !important; }.next-lesson > span { color: var(--muted); font-size: 7px; }.next-lesson strong { font-size: 11px; }
.placeholder-screen.active { display: grid; min-height: calc(100vh - var(--topbar)); place-content: center; justify-items: center; gap: 13px; padding: 40px; text-align: center; }.placeholder-screen > svg { width: 46px; height: 46px; color: var(--jade); stroke-width: 1.2; }.placeholder-screen h1 { margin: 0; font-family: "STZhongsong", serif; }.placeholder-screen p { max-width: 520px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.8; }
.mobile-bottom-nav { display: none; }

/* Entry, trial and account flow */
body.entry-mode { padding-bottom: 0; background: #fff; }
body.entry-mode .app-sidebar,
body.entry-mode .topbar,
body.entry-mode .mobile-bottom-nav { display: none; }
body.entry-mode .app-stage { margin-left: 0; }
body.entry-mode .screen-host { min-height: 100vh; }
.landing-screen.active, .trial-screen.active, .access-screen.active { display: block; min-height: 100vh; }
.entry-header, .trial-header, .access-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.entry-header { position: absolute; inset: 0 0 auto; z-index: 5; height: 78px; padding: 0 max(28px, calc((100vw - 1420px) / 2)); border-bottom: 1px solid rgba(255,255,255,.24); color: #fff; }
.entry-brand { display: flex; align-items: center; gap: 10px; border: 0; background: transparent; color: inherit; padding: 0; cursor: pointer; text-align: left; }
.entry-brand > span:last-child { display: grid; gap: 2px; }.entry-brand strong { font-size: 15px; }.entry-brand small { color: rgba(255,255,255,.7); font-size: 9px; }
.entry-brand .brand-mark { border-color: rgba(255,255,255,.45); }.entry-brand.dark { color: var(--ink); }.entry-brand.dark small { color: var(--muted); }.entry-brand.dark .brand-mark { border-color: var(--line-dark); }
.entry-header nav { display: flex; align-items: center; gap: 26px; }.entry-header nav button, .entry-login { border: 0; background: transparent; color: inherit; padding: 8px 0; cursor: pointer; font-size: 11px; font-weight: 700; }.entry-header nav button:hover { color: #6de0c4; }.entry-header nav button:last-child { color: #f3c36a; }
.entry-login { display: inline-flex; align-items: center; gap: 6px; border: 1px solid rgba(255,255,255,.45); padding: 9px 12px; }.entry-login svg { width: 14px; }
.landing-hero { position: relative; min-height: 86svh; overflow: hidden; background: #18322d url("jeddah-waterfront.jpg") center / cover no-repeat; color: #fff; }
.hero-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(7,26,23,.94) 0%, rgba(7,26,23,.8) 42%, rgba(9,34,30,.52) 72%, rgba(8,30,26,.36) 100%), linear-gradient(0deg, rgba(5,23,20,.55), transparent 60%), linear-gradient(180deg, rgba(8,90,76,.16), rgba(8,90,76,.05)); }
.landing-hero-inner { position: relative; z-index: 1; display: grid; width: min(1420px, calc(100% - 56px)); min-height: 86svh; grid-template-columns: minmax(0,1.12fr) minmax(360px,.72fr); align-items: center; gap: clamp(40px, 8vw, 120px); margin: 0 auto; padding: 112px 0 70px; }
.landing-copy { max-width: 760px; }.hero-kicker { margin: 0 0 17px; color: #66d6bc; font-family: Georgia, serif; font-size: 10px; font-weight: 800; letter-spacing: .14em; }.landing-copy h1 { margin: 0; font-family: "STZhongsong", "Songti SC", serif; font-size: clamp(46px, 5.5vw, 78px); line-height: 1.04; }.landing-lead { max-width: 680px; margin: 22px 0 0; color: rgba(255,255,255,.88); font-family: "STZhongsong", serif; font-size: 21px; line-height: 1.8; }
.landing-actions { display: flex; gap: 10px; margin-top: 30px; }.primary-button.large { min-height: 48px; padding-inline: 22px; font-size: 13px; }.glass-button { min-height: 48px; border: 1px solid rgba(255,255,255,.55); background: rgba(5,24,22,.22); color: #fff; padding: 0 22px; cursor: pointer; font-size: 12px; font-weight: 800; backdrop-filter: blur(8px); }
.hero-proof { display: grid; grid-template-columns: repeat(3,1fr); max-width: 680px; margin-top: 38px; border-top: 1px solid rgba(255,255,255,.27); border-bottom: 1px solid rgba(255,255,255,.17); }.hero-proof > span { display: grid; grid-template-columns: auto 1fr; column-gap: 9px; padding: 17px 12px 17px 0; }.hero-proof > span + span { border-left: 1px solid rgba(255,255,255,.18); padding-left: 15px; }.hero-proof svg { width: 19px; grid-row: span 2; color: #56d0b4; }.hero-proof b { font-size: 11px; }.hero-proof small { color: rgba(255,255,255,.65); font-size: 8px; }
.landing-instrument { align-self: center; border: 1px solid rgba(255,255,255,.65); background: rgba(250,253,251,.94); color: var(--ink); padding: 20px; box-shadow: 18px 18px 0 rgba(5,29,26,.24); backdrop-filter: blur(14px); }.instrument-head { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 9px; }.instrument-head button { display: grid; width: 30px; height: 30px; place-items: center; border: 1px solid var(--line); background: #fff; color: var(--jade); cursor: pointer; }.instrument-head svg { width: 14px; }.instrument-arabic { margin: 25px 0 2px; font-family: "Traditional Arabic", serif; font-size: 35px; font-weight: 700; line-height: 1.7; text-align: center; }.instrument-chinese { margin: 0 0 18px; font-family: "STZhongsong", serif; font-size: 15px; text-align: center; }
.instrument-words { display: grid; grid-template-columns: repeat(4,1fr); gap: 5px; }.instrument-words span { display: grid; gap: 2px; border-top: 2px solid var(--cobalt); background: #f1f5f3; padding: 8px 5px; text-align: center; }.instrument-words span:nth-child(1) { border-color: var(--jade); }.instrument-words span:nth-child(3) { border-color: var(--brass); }.instrument-words b { font-family: "Traditional Arabic", serif; font-size: 17px; }.instrument-words small { color: var(--muted); font-family: sans-serif; font-size: 7px; }.instrument-root { display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 9px; margin-top: 13px; border-left: 3px solid var(--jade); background: var(--jade-pale); padding: 10px; }.instrument-root span { color: var(--jade); font-size: 8px; font-weight: 800; }.instrument-root b { font-family: Georgia, serif; }.instrument-root p { margin: 0; color: #4f6c64; font-size: 8px; text-align: right; }.instrument-link { display: flex; width: 100%; align-items: center; justify-content: space-between; margin-top: 14px; border: 0; border-top: 1px solid var(--line); background: transparent; color: var(--jade); padding: 12px 0 0; cursor: pointer; font-size: 9px; font-weight: 800; }.instrument-link svg { width: 13px; }
.photo-credit { position: absolute; right: 12px; bottom: 10px; z-index: 2; color: rgba(255,255,255,.58); font-size: 7px; text-decoration: none; }
.landing-system { padding: 72px max(28px, calc((100vw - 1300px) / 2)); background: #fff; }.landing-section-heading { display: grid; max-width: 740px; gap: 8px; }.landing-section-heading > p { margin: 0; color: var(--jade); font-size: 10px; font-weight: 800; }.landing-section-heading h2, .landing-rights h2 { margin: 0; font-family: "STZhongsong", serif; font-size: 30px; }.landing-section-heading > span { color: var(--muted); font-size: 11px; line-height: 1.7; }
.system-flow { display: grid; grid-template-columns: repeat(4,1fr); margin-top: 32px; border-top: 1px solid var(--line-dark); border-bottom: 1px solid var(--line); }.system-flow button { position: relative; display: grid; min-height: 168px; align-content: center; gap: 7px; border: 0; border-right: 1px solid var(--line); background: transparent; padding: 25px; text-align: left; cursor: pointer; }.system-flow button:last-child { border-right: 0; }.system-flow button:hover { background: var(--jade-pale); }.system-flow em { position: absolute; top: 14px; right: 14px; color: #a9b8b2; font-family: Georgia, serif; font-size: 10px; font-style: normal; }.system-flow svg { width: 25px; color: var(--jade); }.system-flow strong { font-family: "STZhongsong", serif; font-size: 17px; }.system-flow small { color: var(--muted); font-size: 9px; line-height: 1.6; }
.landing-rights { display: grid; grid-template-columns: minmax(0,1fr) minmax(430px,.9fr); gap: 70px; align-items: center; padding: 68px max(28px, calc((100vw - 1300px) / 2)); border-top: 1px solid var(--line); background: #edf2ee; }.landing-rights > div > p:not(.eyebrow) { max-width: 650px; color: var(--muted); font-size: 11px; line-height: 1.9; }.landing-rights .primary-button { margin-top: 12px; }.landing-rights dl { margin: 0; border: 1px solid var(--line-dark); background: #fff; }.landing-rights dl div { display: grid; grid-template-columns: 140px 1fr; gap: 18px; padding: 16px 18px; border-bottom: 1px solid var(--line); }.landing-rights dl div:last-child { border-bottom: 0; }.landing-rights dl .featured { border-left: 4px solid var(--jade); background: var(--jade-pale); }.landing-rights dt { font-size: 11px; font-weight: 800; }.landing-rights dd { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.6; }.entry-footer { display: flex; min-height: 72px; align-items: center; gap: 18px; padding: 0 max(28px, calc((100vw - 1300px) / 2)); background: var(--ink); color: #fff; }.entry-footer strong { font-size: 12px; }.entry-footer span { color: #8fa39b; font-size: 9px; }.entry-footer button { margin-left: auto; border: 0; background: transparent; color: #60cfb6; cursor: pointer; font-size: 9px; font-weight: 800; }

.trial-header, .access-header { min-height: 74px; padding: 0 max(24px, calc((100vw - 1320px) / 2)); border-bottom: 1px solid var(--line); background: #fff; }.trial-step-meter { display: grid; width: min(340px,30vw); gap: 6px; }.trial-step-meter > span { height: 4px; background: var(--surface-2); }.trial-step-meter i { display: block; height: 100%; background: var(--jade); }.trial-step-meter small { color: var(--muted); font-size: 8px; text-align: center; }
.trial-layout { display: grid; grid-template-columns: minmax(0,1fr) 320px; max-width: 1320px; min-height: calc(100vh - 74px); margin: 0 auto; }.trial-canvas { padding: 46px 50px 70px; border-right: 1px solid var(--line); }.trial-sentence { position: relative; border: 1px solid var(--line-dark); background: #fff; padding: 35px; box-shadow: 10px 10px 0 #e4ebe6; }.trial-arabic { margin: 16px 0 0; font-family: "Traditional Arabic", serif; font-size: 40px; font-weight: 700; line-height: 1.7; text-align: center; }.trial-translation { margin: 0 0 27px; font-family: "STZhongsong", serif; font-size: 18px; text-align: center; }.trial-word-strip { display: grid; grid-template-columns: repeat(5,1fr); gap: 7px; }.trial-word-strip button { display: grid; gap: 3px; border: 1px solid var(--line); background: #f7faf8; padding: 10px 6px; cursor: pointer; }.trial-word-strip button.active { border-color: var(--jade); background: var(--jade-pale); box-shadow: 3px 3px 0 #bcded4; }.trial-word-strip b { font-family: "Traditional Arabic", serif; font-size: 20px; }.trial-word-strip small { color: var(--muted); font-family: sans-serif; font-size: 7px; }.trial-explanation { display: grid; grid-template-columns: 78px 1fr; align-items: center; margin-top: 16px; border-left: 3px solid var(--jade); background: #f1f7f4; }.trial-explanation span { padding: 13px; font-family: "Traditional Arabic", serif; font-size: 23px; text-align: center; }.trial-explanation p { margin: 0; border-left: 1px solid var(--line); padding: 13px; color: #49625b; font-size: 9px; line-height: 1.7; }.trial-syntax { display: grid; grid-template-columns: 1fr 16px 1fr 16px 1fr 16px 1fr; align-items: center; margin-top: 24px; }.trial-syntax span { border-top: 3px solid var(--jade); background: #fff; padding: 13px; font-size: 9px; font-weight: 800; text-align: center; }.trial-syntax span:nth-of-type(2) { border-color: var(--cinnabar); }.trial-syntax span:nth-of-type(3) { border-color: var(--cobalt); }.trial-syntax span:nth-of-type(4) { border-color: var(--brass); }.trial-syntax i { border-top: 1px solid var(--line-dark); }
.trial-rail { padding: 46px 28px; background: #eef2ef; }.trial-rail ol { margin: 22px 0 30px; padding: 0; list-style: none; }.trial-rail li { display: grid; grid-template-columns: 29px 1fr; gap: 10px; padding: 13px 0; border-bottom: 1px solid var(--line); }.trial-rail li > span { display: grid; width: 29px; height: 29px; place-items: center; border: 1px solid var(--line-dark); border-radius: 50%; color: var(--muted); font-family: Georgia, serif; font-size: 9px; }.trial-rail li.active > span { border-color: var(--jade); background: var(--jade); color: #fff; }.trial-rail li p { display: grid; gap: 3px; margin: 0; }.trial-rail li strong { font-size: 10px; }.trial-rail li small { color: var(--muted); font-size: 8px; }.trial-value { display: grid; grid-template-columns: auto 1fr; gap: 10px; margin: 26px 0 18px; border-left: 3px solid var(--brass); background: var(--brass-pale); padding: 13px; }.trial-value > svg { width: 18px; color: var(--brass); }.trial-value p { display: grid; gap: 4px; margin: 0; }.trial-value strong { font-size: 9px; }.trial-value small { color: #7a684e; font-size: 8px; line-height: 1.6; }.primary-button.full, .secondary-button.full { width: 100%; }.trial-rail > .text-button { width: 100%; margin-top: 14px; }

.access-screen { background: #f0f4f1; }.access-layout { display: grid; width: min(1100px, calc(100% - 48px)); min-height: calc(100vh - 74px); grid-template-columns: 1.08fr .92fr; align-items: stretch; margin: 0 auto; }.access-intro { padding: 75px 70px 60px 10px; }.access-intro h1 { max-width: 560px; margin: 0; font-family: "STZhongsong", serif; font-size: 40px; line-height: 1.25; }.access-intro > p:not(.eyebrow) { max-width: 590px; color: var(--muted); font-size: 11px; line-height: 1.9; }.access-intro ol { max-width: 580px; margin: 35px 0; padding: 0; list-style: none; }.access-intro li { display: grid; grid-template-columns: 34px 130px 1fr; align-items: center; gap: 12px; min-height: 60px; border-top: 1px solid var(--line); }.access-intro li > span { display: grid; width: 27px; height: 27px; place-items: center; border: 1px solid var(--line-dark); border-radius: 50%; font-family: Georgia, serif; font-size: 9px; }.access-intro li.active > span { border-color: var(--jade); background: var(--jade); color: #fff; }.access-intro li strong { font-size: 10px; }.access-intro li small { color: var(--muted); font-size: 8px; }.access-trust { display: flex; gap: 10px; max-width: 580px; border-left: 3px solid var(--jade); background: var(--jade-pale); padding: 13px; }.access-trust svg { width: 18px; color: var(--jade); }.access-trust span { display: grid; gap: 3px; }.access-trust strong { font-size: 9px; }.access-trust small { color: #4d6d65; font-size: 8px; }
.access-form-panel { align-self: center; min-height: 470px; border: 1px solid var(--line-dark); background: #fff; padding: 44px; box-shadow: 12px 12px 0 #dfe7e2; }.access-step h2 { margin: 0 0 28px; font-family: "STZhongsong", serif; font-size: 25px; }.access-step label { display: grid; gap: 7px; margin-bottom: 17px; color: var(--ink-soft); font-size: 9px; font-weight: 800; }.access-step input { width: 100%; height: 43px; border: 1px solid var(--line-dark); background: #fbfcfb; padding: 0 12px; font-size: 11px; outline: 0; }.access-step input:focus { border-color: var(--jade); }.code-field { display: grid; grid-template-columns: 1fr auto; }.code-field button { border: 1px solid var(--jade); border-left: 0; background: var(--jade-pale); color: var(--jade); padding: 0 12px; cursor: pointer; font-size: 9px; font-weight: 800; }.form-note { color: var(--muted); font-size: 8px; line-height: 1.6; text-align: center; }.signed-account { display: flex; gap: 10px; margin-bottom: 22px; border: 1px solid #b5d8ce; background: var(--jade-pale); padding: 11px; }.signed-account svg { width: 18px; color: var(--jade); }.signed-account span { display: grid; gap: 2px; }.signed-account strong { font-size: 9px; }.signed-account small { color: #527067; font-size: 8px; }.access-step .secondary-button { margin-top: 9px; }.access-step.success { padding-top: 25px; text-align: center; }.access-step.success > p:not(.eyebrow) { color: var(--muted); font-size: 10px; line-height: 1.8; }.success-mark { display: grid; width: 58px; height: 58px; place-items: center; margin: 0 auto 17px; background: var(--jade); color: #fff; box-shadow: 7px 7px 0 var(--jade-pale); }.success-mark svg { width: 28px; }

/* Supporting product screens */
.content-screen.active { display: block; max-width: 1420px; min-height: calc(100vh - var(--topbar)); margin: 0 auto; padding: 36px 34px 70px; }.content-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; padding-bottom: 24px; border-bottom: 1px solid var(--line-dark); }.content-heading h1 { margin: 0; font-family: "STZhongsong", serif; font-size: 29px; }.content-heading > div > p:not(.eyebrow) { margin: 8px 0 0; color: var(--muted); font-size: 10px; line-height: 1.7; }.content-search { display: flex; width: 330px; height: 39px; align-items: center; gap: 8px; border: 1px solid var(--line); background: #fff; padding: 0 10px; }.content-search svg { width: 15px; color: var(--muted); }.content-search input { min-width: 0; flex: 1; border: 0; outline: 0; font-size: 10px; }.content-search kbd { color: var(--jade); font-family: Georgia, serif; font-size: 9px; }.content-columns { display: grid; grid-template-columns: minmax(0,1fr) 310px; gap: 28px; margin-top: 28px; }.content-primary { min-width: 0; }.content-rail { border-left: 1px solid var(--line); padding-left: 25px; }.content-rail h2 { font-family: "STZhongsong", serif; }.content-count { color: var(--muted); font-size: 9px; }
.root-matrix { display: grid; grid-template-columns: repeat(4,1fr); border: 1px solid var(--line); }.root-matrix button { display: grid; min-height: 132px; align-content: center; gap: 6px; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fff; padding: 15px; cursor: pointer; text-align: left; }.root-matrix button:nth-child(4n) { border-right: 0; }.root-matrix button:nth-last-child(-n+4) { border-bottom: 0; }.root-matrix button.active { background: var(--jade-pale); box-shadow: inset 0 3px var(--jade); }.root-matrix b { font-family: Georgia, serif; font-size: 21px; }.root-matrix strong { font-size: 10px; }.root-matrix small { color: var(--muted); font-size: 8px; }.root-usage-strip { display: flex; align-items: center; justify-content: space-between; margin-top: 28px; border-top: 1px solid var(--line-dark); border-bottom: 1px solid var(--line); padding: 15px; }.root-usage-strip > span { display: grid; grid-template-columns: auto 1fr; gap: 3px 8px; }.root-usage-strip svg { width: 17px; grid-row: span 2; color: var(--jade); }.root-usage-strip > svg { color: var(--line-dark); }.root-usage-strip strong { font-size: 9px; }.root-usage-strip small { color: var(--muted); font-size: 7px; }.root-title { display: grid; justify-items: center; gap: 4px; border-bottom: 1px solid var(--line); padding: 5px 0 18px; }.root-title b { font-family: Georgia, serif; font-size: 34px; }.root-title span { color: var(--jade); font-family: Georgia, serif; font-size: 10px; }.root-title small { color: var(--muted); font-size: 8px; }.derivation-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 16px 0; }.derivation-list button { display: grid; gap: 2px; border: 1px solid var(--line); background: #fff; padding: 9px; cursor: pointer; text-align: center; }.derivation-list b { font-family: "Traditional Arabic", serif; font-size: 18px; }.derivation-list span { color: var(--jade); font-size: 7px; }.derivation-list small { color: var(--muted); font-size: 7px; }
.library-overview, .review-stats { display: grid; grid-template-columns: repeat(4,1fr); margin-top: 24px; border: 1px solid var(--line); background: #fff; }.library-overview > span { display: grid; gap: 3px; padding: 15px 18px; border-right: 1px solid var(--line); }.library-overview > span:last-child { border-right: 0; }.library-overview small { color: var(--muted); font-size: 8px; }.library-overview strong { font-family: Georgia, serif; font-size: 21px; }.library-list { border: 1px solid var(--line); }.library-list > button { display: grid; width: 100%; min-height: 82px; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 13px; border: 0; border-bottom: 1px solid var(--line); background: #fff; padding: 12px 15px; cursor: pointer; text-align: left; }.library-list > button:last-child { border-bottom: 0; }.library-list > button.active { box-shadow: inset 3px 0 var(--jade); background: #f5faf7; }.library-icon { display: grid; width: 38px; height: 38px; place-items: center; background: var(--jade-pale); color: var(--jade); }.library-icon.blue { background: var(--cobalt-pale); color: var(--cobalt); }.library-icon.red { background: var(--cinnabar-pale); color: var(--cinnabar); }.library-icon.brass { background: var(--brass-pale); color: var(--brass); }.library-icon svg { width: 18px; }.library-list button > span:nth-child(2) { display: grid; gap: 4px; }.library-list strong { font-size: 11px; }.library-list small, .library-list em { color: var(--muted); font-size: 8px; font-style: normal; }.library-list button > svg { width: 14px; color: var(--muted); }.preview-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 8px; }.vocab-arabic { margin: 24px 0 0; font-family: "Traditional Arabic", serif; font-size: 40px; text-align: center; }.vocab-preview > h2 { margin: 0; text-align: center; }.vocab-meta { display: flex; justify-content: center; gap: 5px; margin: 13px 0; }.vocab-meta span { border: 1px solid var(--line); padding: 4px 6px; color: var(--muted); font-size: 7px; }.vocab-preview > p:not(.vocab-arabic):not(.eyebrow) { color: var(--muted); font-size: 8px; line-height: 1.8; }.vocab-preview > p b { font-family: "Traditional Arabic", serif; font-size: 13px; }.preview-actions { display: grid; grid-template-columns: repeat(3,1fr); gap: 4px; margin: 18px 0; }.preview-actions button { min-height: 30px; border: 1px solid var(--line); background: #fff; color: var(--muted); cursor: pointer; font-size: 8px; }.preview-actions button.active { border-color: var(--jade); background: var(--jade); color: #fff; }
.lookup-heading { max-width: 880px; margin: 15px auto 35px; text-align: center; }.lookup-heading h1 { margin: 0; font-family: "STZhongsong", serif; font-size: 32px; }.lookup-heading > label { display: flex; height: 50px; align-items: center; gap: 10px; margin-top: 25px; border: 1px solid var(--line-dark); background: #fff; padding-left: 15px; box-shadow: 8px 8px 0 #e1e9e4; }.lookup-heading label svg { width: 18px; color: var(--muted); }.lookup-heading label input { min-width: 0; flex: 1; border: 0; outline: 0; font-family: "Traditional Arabic", serif; font-size: 22px; text-align: right; }.lookup-heading label button { align-self: stretch; border: 0; background: var(--jade); color: #fff; padding: 0 23px; cursor: pointer; font-size: 10px; font-weight: 800; }.lookup-heading > p:last-child { color: var(--muted); font-size: 8px; }.lookup-results { display: grid; grid-template-columns: minmax(0,1fr) 330px; gap: 25px; max-width: 1100px; margin: 0 auto; }.lookup-summary, .lookup-block, .plus-boundary-panel { border: 1px solid var(--line); background: #fff; padding: 20px; }.lookup-summary { display: flex; align-items: flex-start; justify-content: space-between; }.lookup-summary span { color: var(--jade); font-size: 8px; }.lookup-summary h2 { margin: 3px 0 0; font-family: "Traditional Arabic", serif; font-size: 38px; }.lookup-summary p { margin: 0; color: var(--muted); font-size: 11px; }.lookup-block { margin-top: 12px; }.lookup-block .section-heading { align-items: center; }.lookup-block .section-heading h2 { font-size: 15px; }.lookup-facts { display: grid; grid-template-columns: repeat(2,1fr); margin: 0; border: 1px solid var(--line); }.lookup-facts div { display: grid; grid-template-columns: 90px 1fr; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }.lookup-facts div:nth-child(even) { border-right: 0; }.lookup-facts div:nth-last-child(-n+2) { border-bottom: 0; }.lookup-facts dt, .lookup-facts dd { margin: 0; padding: 10px; font-size: 8px; }.lookup-facts dt { background: var(--surface-2); color: var(--muted); }.lookup-facts dd { font-weight: 800; }.related-sentence { display: grid; width: 100%; grid-template-columns: 40px minmax(0,1fr) auto; align-items: center; gap: 4px 10px; border: 0; border-top: 1px solid var(--line); background: transparent; padding: 12px 0; cursor: pointer; text-align: left; }.related-sentence > span { grid-row: span 2; color: var(--muted); font-family: Georgia, serif; font-size: 8px; }.related-sentence b { font-family: "Traditional Arabic", serif; font-size: 18px; text-align: right; }.related-sentence small { color: var(--muted); font-size: 8px; }.related-sentence svg { width: 14px; grid-row: span 2; color: var(--jade); }.root-mini { margin-top: 0; }.root-mini > h2 { font-family: Georgia, serif; font-size: 26px; }.root-mini > div { display: grid; gap: 5px; }.root-mini span { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); padding: 9px 0; }.root-mini b { font-family: "Traditional Arabic", serif; font-size: 17px; }.root-mini small { color: var(--muted); font-size: 7px; }.root-mini .text-button { margin-top: 12px; }.plus-boundary-panel { margin-top: 12px; border-color: #e7ca9a; background: var(--brass-pale); }.plus-boundary-panel > span { display: flex; align-items: center; gap: 6px; color: #815516; font-size: 9px; font-weight: 800; }.plus-boundary-panel svg { width: 15px; }.plus-boundary-panel h2 { margin: 13px 0 7px; font-family: "STZhongsong", serif; font-size: 18px; }.plus-boundary-panel p { color: #78664d; font-size: 8px; line-height: 1.7; }
.review-stats section { min-height: 115px; border-right: 1px solid var(--line); padding: 18px; }.review-stats section:last-child { border-right: 0; }.review-stats small { color: var(--muted); font-size: 8px; }.review-stats strong { display: block; margin-top: 7px; font-family: Georgia, serif; font-size: 25px; }.review-stats strong em { color: var(--muted); font-family: sans-serif; font-size: 8px; font-style: normal; }.review-stats section > span { display: block; height: 4px; margin-top: 16px; background: var(--surface-2); }.review-stats section > span i { display: block; width: var(--value); height: 100%; background: var(--jade); }.review-stats section p { color: var(--muted); font-size: 8px; }.review-queue { border: 1px solid var(--line); }.review-queue button { display: grid; width: 100%; min-height: 70px; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 2px 12px; border: 0; border-bottom: 1px solid var(--line); background: #fff; padding: 11px; cursor: pointer; text-align: left; }.review-queue button:last-child { border-bottom: 0; }.review-queue .risk { display: grid; width: 31px; height: 31px; grid-row: span 2; place-items: center; background: var(--cinnabar-pale); color: var(--cinnabar); font-size: 8px; font-weight: 800; }.review-queue .risk.medium { background: var(--brass-pale); color: var(--brass); }.review-queue .risk.low { background: var(--jade-pale); color: var(--jade); }.review-queue b { font-family: "Traditional Arabic", serif; font-size: 18px; text-align: right; }.review-queue small, .review-queue em { color: var(--muted); font-size: 8px; font-style: normal; }.review-queue em { grid-row: span 2; }.review-bars { display: flex; height: 180px; align-items: end; gap: 7px; border-bottom: 1px solid var(--line-dark); padding: 0 5px; }.review-bars span { position: relative; width: 100%; height: var(--h); background: var(--jade-pale); }.review-bars span:nth-child(4), .review-bars span:nth-child(5) { background: var(--jade); }.review-bars i { position: absolute; bottom: -22px; width: 100%; color: var(--muted); font-size: 7px; font-style: normal; text-align: center; }.rhythm-note { margin-top: 35px; color: var(--muted); font-size: 8px; line-height: 1.7; }
.life-layout { display: grid; grid-template-columns: 240px minmax(0,1fr); gap: 28px; margin-top: 28px; }.life-topics { display: grid; align-content: start; border: 1px solid var(--line); }.life-topics button { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 10px; min-height: 72px; border: 0; border-bottom: 1px solid var(--line); background: #fff; padding: 12px; cursor: pointer; text-align: left; }.life-topics button:last-child { border-bottom: 0; }.life-topics button.active { box-shadow: inset 3px 0 var(--jade); background: var(--jade-pale); }.life-topics svg { width: 18px; color: var(--jade); }.life-topics button span { display: grid; gap: 3px; }.life-topics strong { font-size: 10px; }.life-topics small { color: var(--muted); font-size: 7px; }.life-dialogue { max-width: 840px; }.life-turn { display: grid; grid-template-columns: 55px 1fr; border-bottom: 1px solid var(--line); padding: 20px 0; }.life-turn > span { color: var(--jade); font-size: 9px; font-weight: 800; }.life-turn.waiter > span { color: var(--brass); }.life-turn > div { position: relative; }.life-turn > div > button:first-child { position: absolute; right: 0; top: 0; border: 0; background: transparent; color: var(--jade); cursor: pointer; }.life-turn svg { width: 16px; }.life-turn p { margin: 0; padding-right: 35px; font-family: "Traditional Arabic", serif; font-size: 26px; text-align: right; }.life-turn small { display: block; color: var(--muted); font-size: 9px; text-align: right; }

/* Purchase */
.purchase-dialog { width: min(760px, calc(100vw - 32px)); grid-template-columns: 1.2fr .8fr; gap: 24px; overscroll-behavior: contain; border: 1px solid var(--line-dark); border-radius: 0; background: var(--surface); padding: 28px; color: var(--ink); box-shadow: 0 25px 100px rgba(8, 25, 21, .32); }.purchase-dialog[open] { display: grid; }.purchase-dialog::backdrop { background: rgba(16,33,31,.62); backdrop-filter: blur(3px); }.dialog-close { position: absolute; top: 12px; right: 12px; }.purchase-copy h2 { margin: 15px 0 8px; font-family: "STZhongsong", serif; font-size: 25px; }.purchase-copy > p { color: var(--muted); font-size: 10px; line-height: 1.8; }.purchase-copy ul { display: grid; gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; }.purchase-copy li { display: flex; gap: 7px; font-size: 9px; }.purchase-copy li svg { width: 13px; color: var(--jade); }.payment-panel { display: grid; align-content: center; justify-items: center; border-left: 1px solid var(--line); padding-left: 24px; }.payment-panel img { width: 156px; height: 156px; object-fit: contain; border: 1px solid var(--line); padding: 6px; }.payment-panel p { color: var(--muted); font-size: 8px; }.plus-boundary { grid-column: 1 / -1; display: flex; gap: 9px; margin: 0; border-left: 3px solid var(--brass); background: var(--brass-pale); padding: 11px; color: #725122; font-size: 8px; }.plus-boundary svg { width: 15px; }.plus-boundary span { display: grid; gap: 2px; }

@media (max-width: 1180px) {
  :root { --sidebar: 208px; }
  .dashboard-grid { grid-template-columns: minmax(0,1fr) 270px; }
  .dashboard-main { padding-inline: 24px; }.dashboard-rail { padding-inline: 18px; }
  .analyzer-screen.active { grid-template-columns: 180px minmax(500px,1fr) 270px; }
  .scenario-screen.active { grid-template-columns: 170px minmax(480px,1fr) 240px; }
  .word-row { grid-template-columns: 1fr .7fr 1fr .65fr 1.1fr 20px; }
}

@media (max-width: 900px) {
  :root { --topbar: 58px; }
  body { padding-bottom: 66px; }
  .entry-header { height: 66px; padding: 0 16px; }.entry-header nav { display: none; }.entry-login { padding: 8px 10px; font-size: 9px; }
  .landing-hero, .landing-hero-inner { min-height: auto; }.landing-hero { background-position: 58% center; }.landing-hero-inner { width: min(680px, calc(100% - 32px)); grid-template-columns: 1fr; gap: 34px; padding: 110px 0 64px; }.landing-copy h1 { font-size: 52px; }.landing-lead { font-size: 18px; }.landing-instrument { width: min(520px,100%); }.landing-system, .landing-rights { padding: 52px 24px; }.system-flow { grid-template-columns: 1fr 1fr; }.system-flow button:nth-child(2) { border-right: 0; }.system-flow button:nth-child(-n+2) { border-bottom: 1px solid var(--line); }.landing-rights { grid-template-columns: 1fr; gap: 34px; }.entry-footer { padding: 0 18px; }
  .trial-header, .access-header { min-height: 66px; padding: 0 16px; }.trial-step-meter { display: none; }.trial-layout { display: block; }.trial-canvas { padding: 34px 20px 48px; border-right: 0; }.trial-rail { padding: 34px 20px 42px; }.trial-word-strip { grid-template-columns: repeat(5,minmax(86px,1fr)); overflow-x: auto; padding-bottom: 8px; }.trial-syntax { overflow-x: auto; }.access-layout { display: block; width: min(680px, calc(100% - 32px)); }.access-intro { padding: 52px 0 30px; }.access-form-panel { margin-bottom: 48px; }.access-intro h1 { font-size: 34px; }
  .content-screen.active { padding: 28px 18px 60px; }.content-heading { align-items: flex-start; }.content-heading h1 { font-size: 25px; }.content-columns, .lookup-results { grid-template-columns: 1fr; }.content-rail { border-top: 1px solid var(--line); border-left: 0; padding: 24px 0 0; }.root-matrix { grid-template-columns: repeat(2,1fr); }.root-matrix button:nth-child(4n) { border-right: 1px solid var(--line); }.root-matrix button:nth-child(2n) { border-right: 0; }.root-matrix button:nth-last-child(-n+4) { border-bottom: 1px solid var(--line); }.root-matrix button:nth-last-child(-n+2) { border-bottom: 0; }.lookup-results { max-width: 760px; }.life-layout { grid-template-columns: 1fr; }.life-topics { grid-template-columns: repeat(2,1fr); }.life-topics button:nth-child(odd) { border-right: 1px solid var(--line); }
  .app-sidebar { display: none; }.app-stage { margin-left: 0; }
  .topbar { padding: 0 14px; }.mobile-brand { display: flex; align-items: center; gap: 8px; }.mobile-brand .brand-mark { width: 31px; height: 31px; flex-basis: 31px; }.mobile-brand strong { white-space: nowrap; font-size: 13px; }.global-search { display: none; }.top-actions .status-chip, .top-actions > .icon-button:not(.mobile-menu) { display: none; }.icon-button.mobile-menu { display: inline-grid; }
  .dashboard-grid { display: block; }.dashboard-main { padding: 24px 16px 30px; border-right: 0; }.dashboard-rail { padding: 0 16px 30px; }.page-heading h1 { font-size: 26px; }.streak-seal { width: 62px; height: 62px; flex-basis: 62px; }.focus-lesson { grid-template-columns: 54px minmax(0,1fr); }.section-index { padding: 12px; }.focus-copy { padding: 18px 16px; }.focus-meta { display: grid; gap: 3px; }.arabic-line { font-size: 28px; }.focus-actions { grid-column: 1 / -1; min-width: 0; flex-direction: row; align-items: center; border-top: 1px solid var(--line); padding: 12px 14px; }.topic-grid { grid-template-columns: 1fr; }.topic-card { border-right: 0; border-bottom: 1px solid var(--line); }.topic-card:last-child { border-bottom: 0; }
  .analyzer-screen.active, .scenario-screen.active { display: block; }.sentence-browser, .lesson-steps, .inspector-panel, .scenario-rail { display: none; }.analysis-heading { min-height: 66px; padding: 13px 16px; }.analysis-heading .secondary-button { width: 34px; padding: 0; font-size: 0; }.sentence-hero { min-height: 220px; padding: 30px 15px 20px; } .sentence-status { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; padding-bottom: 4px; scrollbar-width: none; } .sentence-status::-webkit-scrollbar { display: none; }.hero-arabic { margin-top: 28px; font-size: 32px; }.hero-translation { font-size: 17px; }.hero-audio { top: 15px; right: 15px; }.syntax-rail-section, .word-lab { padding: 18px 14px; }.syntax-rail { grid-template-columns: repeat(5, minmax(68px,1fr)); overflow-x: auto; padding-bottom: 12px; }.syntax-rail::before { min-width: 360px; }.word-table { overflow-x: auto; }.word-row { min-width: 700px; }.grammar-band { grid-template-columns: 1fr; }.dialogue-canvas { padding: 22px 14px 35px; }.scene-brief { grid-template-columns: auto 1fr; }.brief-tags { grid-column: 1 / -1; }.dialogue-toolbar { align-items: flex-start; }.dialogue-toolbar .secondary-button { display: none; }.turn-arabic { font-size: 23px; }
  .mobile-bottom-nav { position: fixed; inset: auto 0 0 0; z-index: 30; display: grid; height: 66px; grid-template-columns: repeat(5,1fr); border-top: 1px solid var(--line); background: rgba(255,255,255,.96); padding-bottom: env(safe-area-inset-bottom); backdrop-filter: blur(12px); }.mobile-bottom-nav button { display: grid; place-content: center; justify-items: center; gap: 3px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 8px; }.mobile-bottom-nav svg { width: 19px; height: 19px; }.mobile-bottom-nav button.active { color: var(--jade); }
}

@media (max-width: 520px) {
  .entry-brand > span:last-child small { display: none; }.entry-login svg { display: none; }.landing-hero-inner { width: calc(100% - 28px); padding-top: 96px; }.landing-copy h1 { font-size: 42px; }.hero-kicker { font-size: 8px; }.landing-lead { font-size: 16px; line-height: 1.65; }.landing-actions { display: grid; }.landing-actions > button { width: 100%; }.hero-proof { grid-template-columns: 1fr; }.hero-proof > span + span { border-top: 1px solid rgba(255,255,255,.18); border-left: 0; padding-left: 0; }.landing-instrument { padding: 15px; box-shadow: 9px 9px 0 rgba(5,29,26,.24); }.instrument-arabic { font-size: 28px; }.instrument-words { grid-template-columns: repeat(2,1fr); }.instrument-root { grid-template-columns: auto auto; }.instrument-root p { grid-column: 1 / -1; text-align: left; }.landing-system, .landing-rights { padding: 42px 16px; }.landing-section-heading h2, .landing-rights h2 { font-size: 25px; }.system-flow { grid-template-columns: 1fr; border: 1px solid var(--line); }.system-flow button { min-height: 125px; border-right: 0; border-bottom: 1px solid var(--line); }.system-flow button:last-child { border-bottom: 0; }.landing-rights dl div { grid-template-columns: 1fr; gap: 5px; }.entry-footer { min-height: 90px; flex-wrap: wrap; align-content: center; }.entry-footer span { display: none; }.entry-footer button { flex-basis: 100%; margin-left: 0; text-align: left; }
  .trial-header .secondary-button { width: 34px; min-width: 34px; height: 34px; min-height: 34px; flex: 0 0 34px; overflow: hidden; padding: 0; color: transparent; font-size: 0; line-height: 0; white-space: nowrap; }.trial-header .secondary-button::before { content: "¥"; color: var(--jade); font-size: 14px; line-height: 1; }.trial-canvas { padding-inline: 14px; }.trial-sentence { padding: 48px 12px 20px; box-shadow: 6px 6px 0 #e4ebe6; }.trial-arabic { font-size: 31px; line-height: 1.8; }.trial-translation { font-size: 16px; }.trial-word-strip { grid-template-columns: repeat(5,minmax(0,1fr)); overflow: visible; }.trial-word-strip button { padding: 8px 2px; }.trial-word-strip b { font-size: 16px; }.trial-word-strip small { font-size: 6px; }.trial-explanation { grid-template-columns: 62px 1fr; }.trial-syntax { grid-template-columns: repeat(4,minmax(0,1fr)); overflow: visible; gap: 4px; }.trial-syntax i { display: none; }.trial-syntax span { padding-inline: 4px; }.access-intro { padding-top: 38px; }.access-intro h1 { font-size: 29px; }.access-intro li { grid-template-columns: 30px 96px 1fr; }.access-form-panel { min-height: 420px; padding: 30px 20px; box-shadow: 7px 7px 0 #dfe7e2; }.code-field { grid-template-columns: 1fr; }.code-field button { min-height: 36px; border-top: 0; border-left: 1px solid var(--jade); }
  .content-heading { display: grid; }.content-heading .content-search { width: 100%; }.content-heading > .primary-button, .content-heading > .access-badge { justify-self: start; }.root-matrix button { min-height: 112px; padding: 11px; }.root-usage-strip { display: grid; gap: 14px; }.root-usage-strip > svg { transform: rotate(90deg); justify-self: center; }.library-overview, .review-stats { grid-template-columns: 1fr 1fr; }.library-overview > span:nth-child(2), .review-stats section:nth-child(2) { border-right: 0; }.library-overview > span:nth-child(-n+2), .review-stats section:nth-child(-n+2) { border-bottom: 1px solid var(--line); }.library-list > button { grid-template-columns: auto 1fr auto; }.library-list button > em { display: none; }.lookup-heading h1 { font-size: 26px; }.lookup-heading > label { height: 46px; box-shadow: 5px 5px 0 #e1e9e4; }.lookup-heading label button { padding: 0 15px; }.lookup-facts { grid-template-columns: 1fr; }.lookup-facts div, .lookup-facts div:nth-child(even), .lookup-facts div:nth-last-child(-n+2) { border-right: 0; border-bottom: 1px solid var(--line); }.lookup-facts div:last-child { border-bottom: 0; }.related-sentence { grid-template-columns: 34px minmax(0,1fr) 14px; }.life-topics { grid-template-columns: 1fr; }.life-topics button:nth-child(odd) { border-right: 0; }.life-turn { grid-template-columns: 45px 1fr; }.life-turn p { font-size: 22px; }
  .heading-split { gap: 12px; }.page-heading h1 { font-size: 24px; }.page-heading p:not(.eyebrow) { font-size: 10px; }.streak-seal { width: 54px; height: 54px; flex-basis: 54px; box-shadow: 5px 5px 0 var(--jade-pale); }.streak-seal span { font-size: 21px; }.streak-seal small { font-size: 7px; }
  .focus-lesson { display: block; }.section-index { display: flex; align-items: center; gap: 8px; border-right: 0; border-bottom: 1px solid var(--line); }.section-index span { font-size: 18px; }.section-index small { writing-mode: initial; }.focus-copy { padding: 15px; }.arabic-line { margin-top: 15px; font-size: 27px; line-height: 1.75; }.translation { font-size: 16px; }.focus-actions .primary-button { flex: 1; }
  .section-heading h2 { font-size: 18px; }.route-track { grid-template-columns: 1fr; border: 1px solid var(--line); }.route-track::before { display: none; }.route-step { grid-template-columns: 28px 1fr; justify-items: start; text-align: left; }.route-step > span { grid-row: span 2; }.route-step + .route-step { border-top: 1px solid var(--line); }.route-step.current { background: var(--jade-pale); }
  .dashboard-rail { padding-top: 10px; }.topic-card { min-height: 92px; }
  .analysis-heading h1 { font-size: 18px; }.canvas-actions .icon-button:last-child { display: none; }.sentence-status { justify-content: flex-start; }.hero-arabic { font-size: 29px; }.syntax-rail-section .section-heading .text-button, .word-lab .legend { display: none; }
  .syntax-rail { grid-template-columns: repeat(5, minmax(56px, 1fr)); gap: 5px; overflow: visible; padding-inline: 0; }.syntax-rail::before { min-width: 0; left: 8%; right: 8%; }.syntax-node b { min-width: 56px; padding-inline: 3px; font-size: 17px; }.syntax-node span { font-size: 7px; }.syntax-formula { font-size: 13px; }
  .word-table { overflow: visible; border: 0; }.word-row.table-head { display: none; }.word-row:not(.table-head), .word-row.active { position: relative; display: grid; min-width: 0; grid-template-columns: 1fr 1fr !important; margin-bottom: 8px; border: 1px solid var(--line); }.word-row.active::before { position: absolute; inset: 0 auto 0 0; width: 3px; height: auto; }.word-row.active > span:first-of-type { grid-column: auto; }.word-row > span { min-height: 48px; border-right: 0; border-bottom: 1px solid var(--line); }.word-row > span:nth-of-type(odd) { border-right: 1px solid var(--line); }.word-row > span:nth-of-type(5) { grid-column: 1 / -1; border-right: 0; border-bottom: 0; }.word-row > svg { display: none; }
  .grammar-band > div { min-height: 0; }.compact-heading { display: block; }.compact-heading .access-badge { margin-top: 12px; }.dialogue-toolbar > div:last-child .primary-button { padding-inline: 10px; }.dialogue-turn { grid-template-columns: 28px 1fr; gap: 8px; padding-inline: 0; }.speaker { width: 27px; height: 27px; }.turn-arabic { font-size: 22px; }.purchase-dialog[open] { display: block; max-height: calc(100dvh - 24px); overflow-y: auto; padding: 22px 18px; }.purchase-copy h2 { font-size: 22px; }.payment-panel { margin-top: 18px; border-left: 0; border-top: 1px solid var(--line); padding: 18px 0 0; }.plus-boundary { margin-top: 16px; }
}

@media (prefers-reduced-motion: no-preference) {
  .screen.active { animation: reveal .18s ease-out both; }
  .primary-button, .topic-card, .nav-item, .sentence-item { transition: background-color .18s ease, border-color .18s ease, color .18s ease, transform .18s ease; }
  .topic-card:hover { transform: translateY(-2px); }
  @keyframes reveal { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* Readability pass: learning content should remain comfortable at 100% browser zoom. */
body { font-size: 15px; line-height: 1.55; }
.eyebrow { font-size: 12px; }
.text-button { font-size: 13px; }
.primary-button, .secondary-button { min-height: 42px; font-size: 13px; }
.status-chip, .access-badge { min-height: 33px; font-size: 12px; }

/* Application chrome */
.brand-copy strong { font-size: 17px; }
.brand-copy small { font-size: 11px; }
.nav-label { font-size: 12px; }
.nav-item { height: 46px; }
.nav-item span { font-size: 15px; }
.nav-item em { font-size: 11px; }
.rights-head { font-size: 14px; }
.sidebar-rights p { font-size: 12px; }
.sidebar-rights .text-button { font-size: 12px; }
.profile-row strong { font-size: 14px; }
.profile-row small { font-size: 11px; }
.global-search input { font-size: 14px; }
.global-search kbd { font-size: 11px; }

/* Landing, trial and account flow */
.entry-brand strong { font-size: 17px; }
.entry-brand small, .entry-header nav button, .entry-login { font-size: 12px; }
.hero-kicker { font-size: 11px; }
.instrument-head { font-size: 11px; }
.instrument-chinese { font-size: 17px; }
.instrument-words small, .instrument-root span, .instrument-root p, .instrument-link { font-size: 10px; }
.landing-section-heading > p { font-size: 12px; }
.landing-section-heading > span, .landing-rights > div > p:not(.eyebrow) { font-size: 14px; }
.system-flow strong { font-size: 19px; }
.system-flow small { font-size: 12px; }
.landing-rights dt { font-size: 14px; }
.landing-rights dd { font-size: 12px; }
.entry-footer strong { font-size: 14px; }
.entry-footer span, .entry-footer button { font-size: 11px; }
.trial-step-meter small { font-size: 11px; }
.trial-word-strip small { font-size: 10px; }
.trial-explanation p { font-size: 13px; }
.trial-syntax span { font-size: 12px; }
.trial-rail li strong { font-size: 13px; }
.trial-rail li small { font-size: 11px; }
.trial-value strong { font-size: 12px; }
.trial-value small { font-size: 11px; }
.access-intro > p:not(.eyebrow) { font-size: 14px; }
.access-intro li strong { font-size: 13px; }
.access-intro li small { font-size: 11px; }
.access-trust strong, .signed-account strong { font-size: 12px; }
.access-trust small, .signed-account small, .form-note { font-size: 11px; }
.access-step label { font-size: 12px; }
.access-step input { font-size: 14px; }
.code-field button { font-size: 11px; }
.access-step.success > p:not(.eyebrow) { font-size: 13px; }

/* Dashboard */
.page-heading p:not(.eyebrow) { font-size: 14px; }
.section-index small { font-size: 11px; }
.focus-meta { font-size: 12px; }
.translation { font-size: 20px; }
.sentence-tags span { font-size: 11px; }
.section-heading h2 { font-size: 24px; }
.section-heading.compact h2 { font-size: 17px; }
.route-step strong { font-size: 14px; }
.route-step small { font-size: 11px; }
.topic-card small { font-size: 10px; }
.topic-card strong { font-size: 15px; }
.topic-card em { font-size: 12px; }
.metric-row small { font-size: 10px; }
.review-item small, .review-item em { font-size: 10px; }
.plus-note > span { font-size: 13px; }
.plus-note p, .plus-note .text-button { font-size: 11px; }

/* Sentence analyzer */
.sentence-browser header h2 { font-size: 24px; }
.sentence-browser header > span { font-size: 13px; }
.mini-search input { font-size: 13px; }
.filter-button { font-size: 11px; }
.sentence-item { min-height: 88px; padding-block: 13px; }
.sentence-item > span { font-size: 10px; }
.sentence-item b { font-size: 21px; }
.sentence-item small { font-size: 11px; }
.collection-button strong { font-size: 13px; }
.collection-button small { font-size: 11px; }
.breadcrumb { font-size: 12px; }
.analysis-heading h1 { font-size: 27px; }
.analysis-heading h1 span { font-size: 12px; }
.sentence-status span { font-size: 11px; }
.hero-arabic { font-size: 46px; }
.hero-translation { font-size: 22px; }
.transliteration { font-size: 13px; }
.syntax-node b { min-width: 82px; font-size: 25px; }
.syntax-node span { font-size: 11px; }
.syntax-formula { font-size: 19px; }
.legend span { font-size: 11px; }
.word-row > span { min-height: 66px; font-size: 12px; }
.word-row > span b { font-size: 12px; }
.word-row > span small { font-size: 10px; }
.word-row.table-head { font-size: 11px; }
.word-row.table-head span { min-height: 38px; }
.arabic-cell { font-size: 23px !important; }
.grammar-band > div { min-height: 112px; }
.grammar-band strong { font-size: 13px; }
.grammar-band small { font-size: 11px; }
.grammar-band b { font-size: 17px; }
.inspector-label { font-size: 12px; }
.inspector-label em { font-size: 10px; }
.root-core b { font-size: 32px; }
.root-core span { font-size: 12px; }
.root-core small { font-size: 11px; }
.derivation-grid b { font-size: 21px; }
.derivation-grid span, .derivation-grid small { font-size: 10px; }
.mastery-options button { font-size: 11px; }
.review-state p { font-size: 10px; }

/* Scenario learning */
.lesson-steps h2 { font-size: 25px; }
.lesson-steps > p:not(.eyebrow) { font-size: 12px; }
.lesson-steps li span { font-size: 11px; }
.lesson-steps li b { font-size: 13px; }
.lesson-steps li small { font-size: 10px; }
.lesson-progress small { font-size: 11px; }
.compact-heading h1 { font-size: 31px; }
.scene-brief strong { font-size: 13px; }
.scene-brief p { font-size: 12px; }
.brief-tags span { font-size: 10px; }
.dialogue-toolbar h2 { font-size: 23px; }
.speaker { font-size: 11px; }
.turn-content header strong { font-size: 13px; }
.turn-content header > span { font-size: 10px; }
.turn-arabic { font-size: 30px; }
.turn-content > p:not(.turn-arabic) { font-size: 12px; }
.word-chips button { font-size: 18px; }
.word-chips small { font-size: 9px; }
.analysis-link { font-size: 11px; }
.scenario-rail h2 { font-size: 18px; }
.outcome-panel strong { font-size: 12px; }
.outcome-panel small, .phrase-panel span, .next-lesson > span { font-size: 10px; }
.phrase-panel b { font-size: 20px; }
.next-lesson strong { font-size: 14px; }

/* Content, lookup, review and life screens */
.content-heading > div > p:not(.eyebrow), .lookup-heading > p:last-child { font-size: 13px; }
.content-search input { font-size: 13px; }
.content-search kbd, .content-count { font-size: 11px; }
.root-matrix strong { font-size: 13px; }
.root-matrix small, .root-usage-strip strong { font-size: 11px; }
.root-usage-strip small, .root-title small, .derivation-list span, .derivation-list small { font-size: 10px; }
.library-overview small, .library-list small, .library-list em, .preview-top { font-size: 11px; }
.library-list strong { font-size: 14px; }
.vocab-meta span { font-size: 10px; }
.vocab-preview > p:not(.vocab-arabic):not(.eyebrow) { font-size: 12px; }
.preview-actions button { font-size: 11px; }
.lookup-heading > p:last-child { font-size: 11px; }
.lookup-summary span { font-size: 11px; }
.lookup-summary p { font-size: 14px; }
.lookup-facts dt, .lookup-facts dd { font-size: 11px; }
.related-sentence > span, .related-sentence small { font-size: 10px; }
.root-mini small, .plus-boundary-panel p { font-size: 11px; }
.plus-boundary-panel > span { font-size: 12px; }
.review-stats small, .review-stats section p, .review-queue small, .review-queue em, .rhythm-note { font-size: 11px; }
.review-queue .risk { font-size: 10px; }
.life-topics strong { font-size: 13px; }
.life-topics small { font-size: 10px; }
.life-turn > span { font-size: 12px; }
.life-turn small { font-size: 12px; }

@media (min-width: 1181px) {
  .analyzer-screen.active { grid-template-columns: 238px minmax(620px, 1fr) 336px; }
  .scenario-screen.active { grid-template-columns: 210px minmax(580px, 1fr) 300px; }
}

@media (max-width: 900px) {
  .mobile-brand strong { font-size: 15px; }
  .mobile-bottom-nav button { font-size: 11px; }
  .page-heading p:not(.eyebrow) { font-size: 13px; }
  .arabic-line { font-size: 32px; }
  .hero-arabic { font-size: 38px; }
  .hero-translation { font-size: 20px; }
  .turn-arabic { font-size: 28px; }
  .turn-content > p:not(.turn-arabic) { font-size: 13px; }
}

@media (max-width: 520px) {
  .entry-login { font-size: 11px; }
  .hero-kicker { font-size: 10px; }
  .instrument-words small { font-size: 10px; }
  .trial-word-strip b { font-size: 18px; }
  .trial-word-strip small { font-size: 10px; }
  .trial-explanation p { font-size: 11px; }
  .trial-syntax span { font-size: 10px; }
  .analysis-heading h1 { font-size: 21px; }
  .hero-arabic { font-size: 34px; }
  .syntax-node b { min-width: 56px; font-size: 20px; }
  .syntax-node span { font-size: 9px; }
  .syntax-formula { font-size: 15px; }
  .word-row > span { min-height: 58px; font-size: 12px; }
  .word-row > span b { font-size: 12px; }
  .word-row > span small { font-size: 10px; }
  .arabic-cell { font-size: 22px !important; }
  .turn-arabic { font-size: 26px; }
  .life-turn p { font-size: 25px; }
}

/* Spacious workspace pass: prioritize Arabic reading and analysis over panel density. */
:root {
  --sidebar: 248px;
  --topbar: 72px;
}

body { font-size: 16px; line-height: 1.65; }
.topbar { padding-inline: 30px; }
.global-search { height: 44px; }
.nav-item { height: 48px; }
.screen p { line-height: 1.75; }
.screen small { font-size: 12px; line-height: 1.55; }
.content-screen.active { padding-top: 48px; }
.content-heading { margin-bottom: 36px; }
.content-heading h1 { font-size: 36px; line-height: 1.35; }
.content-heading > div > p:not(.eyebrow) { max-width: 760px; font-size: 15px; line-height: 1.8; }

/* Sentence library */
.analyzer-screen.active {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  align-items: start;
  min-height: calc(100vh - var(--topbar));
  background: #f7f9f7;
}

.sentence-browser {
  position: sticky;
  top: var(--topbar);
  grid-row: 1 / span 2;
  display: flex;
  height: calc(100vh - var(--topbar));
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background: #f1f4f1;
  padding: 28px 20px 22px;
}

.sentence-browser header { padding: 0 2px 20px; }
.sentence-browser header h2 { font-size: 28px; }
.sentence-browser header > span { right: 2px; bottom: 22px; font-size: 13px; }
.mini-search { height: 44px; padding-inline: 13px; }
.mini-search svg { width: 17px; }
.mini-search input { font-size: 14px; }
.sentence-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.sentence-filters label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 700; }
.sentence-filters select { width: 100%; height: 38px; border: 1px solid var(--line); border-radius: 0; outline: 0; background: #fff; color: var(--ink); padding: 0 28px 0 10px; font-size: 13px; }
.sentence-filters select:focus-visible { outline: 3px solid rgba(47, 103, 147, .2); outline-offset: 1px; }
.sentence-result-summary { margin: 14px 2px 10px; color: var(--muted); font-size: 12px; }
.sentence-list { min-height: 0; flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 2px 5px 16px 0; scrollbar-width: thin; }
.sentence-item {
  gap: 7px;
  min-height: 116px;
  margin-bottom: 8px;
  border: 1px solid transparent;
  padding: 15px 13px 14px 44px;
}
.sentence-item > span.sentence-number { left: 12px; top: 18px; font-size: 11px; }
.sentence-item b { font-size: 25px; line-height: 1.7; }
.sentence-item small { font-size: 13px; line-height: 1.5; }
.sentence-item-meta { overflow: hidden; color: #87948f; font-style: normal; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.sentence-item.favorite::after { content: "★"; position: absolute; top: 12px; right: 11px; color: var(--brass); font-size: 12px; }
.sentence-item.active { border-color: #9fc9bd; box-shadow: 5px 5px 0 var(--jade-pale); }
.collection-button { min-height: 62px; margin-top: 10px; padding: 12px; background: rgba(255,255,255,.5); }
.collection-button strong { font-size: 14px; }
.collection-button small { font-size: 12px; }
.collection-button.active { border-color: var(--jade); background: var(--jade-pale); color: var(--jade-dark); }
.sentence-empty { display: grid; min-height: 180px; place-content: center; justify-items: center; gap: 9px; border: 1px dashed var(--line-dark); background: rgba(255,255,255,.55); padding: 24px; text-align: center; }
.sentence-empty svg { width: 26px; color: var(--muted); }
.sentence-empty strong { font-size: 15px; }
.sentence-empty p { margin: 0; color: var(--muted); font-size: 13px; }

/* Main reading canvas */
.analysis-canvas { width: 100%; max-width: 1120px; margin: 0 auto; background: var(--surface); }
.analysis-heading { min-height: 108px; padding: 24px 42px; }
.breadcrumb { margin-bottom: 8px; font-size: 13px; }
.analysis-heading h1 { font-size: 31px; }
.analysis-heading h1 span { margin-left: 7px; font-size: 14px; }
.canvas-actions { align-items: center; gap: 10px; }
.sentence-pager { display: flex; align-items: center; gap: 8px; margin-right: 4px; }
.sentence-pager > span { min-width: 64px; color: var(--muted); font-family: Georgia, serif; font-size: 13px; text-align: center; }
.sentence-pager .icon-button:disabled { opacity: .38; cursor: not-allowed; }
.canvas-actions > .icon-button.active { border-color: #d3a14d; background: var(--brass-pale); color: var(--brass); }
.canvas-actions > .icon-button.active svg { fill: currentColor; }
#review-sentence.active { border-color: #9fc9bd; background: var(--jade-pale); color: var(--jade-dark); }

.sentence-hero {
  min-height: 340px;
  padding: 52px 64px 48px;
  background: #fbfcfb;
  background-image: none;
}
.sentence-status { flex-wrap: wrap; gap: 8px; }
.sentence-status span { padding: 6px 10px; font-size: 12px; }
.hero-audio { top: 32px; right: 34px; width: 46px; height: 46px; }
.hero-audio svg { width: 20px; }
.hero-audio.is-playing { border-color: var(--jade); background: var(--jade); color: #fff; }
.hero-arabic { max-width: 920px; margin: 32px auto 0; font-size: 56px; font-weight: 600; line-height: 1.85; }
.hero-word {
  display: inline-block;
  border: 0;
  border-bottom: 2px solid rgba(8, 122, 104, .28);
  border-radius: 4px;
  background: transparent;
  color: inherit;
  padding: 0 .07em .02em;
  font: inherit;
  line-height: inherit;
  cursor: pointer;
}
.hero-word:hover { border-bottom-color: var(--jade); background: var(--jade-pale); color: var(--jade-dark); }
.hero-word:focus-visible { outline-offset: 3px; }
.hero-word.active { border-bottom-color: var(--jade); background: #e7f3ef; color: var(--jade-dark); }
.hero-translation { margin-top: 5px; font-size: 25px; line-height: 1.55; }
.transliteration { margin-top: 12px; font-size: 15px; line-height: 1.6; }

.word-popover[hidden], .saved-word-collection[hidden] { display: none; }
.word-popover {
  position: fixed;
  z-index: 80;
  width: min(420px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line-dark);
  border-top: 4px solid var(--jade);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 22px 60px rgba(16, 33, 31, .2);
  padding: 22px;
}
.word-popover-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.word-popover-head > div:first-child { min-width: 0; }
.word-popover-head > div:first-child > span { color: var(--muted); font-size: 12px; font-weight: 800; }
.word-popover-head > div:last-child { display: flex; gap: 7px; }
.word-popover-head p { margin: 5px 0 0; font-family: "Noto Naskh Arabic Local", "Traditional Arabic", serif; font-size: 42px; font-weight: 600; line-height: 1.45; }
.word-popover-meta { display: grid; grid-template-columns: 1fr 1fr; margin: 0; border-bottom: 1px solid var(--line); }
.word-popover-meta div { min-width: 0; padding: 15px 14px 15px 0; }
.word-popover-meta div + div { border-left: 1px solid var(--line); padding-left: 14px; }
.word-popover-meta dt { margin-bottom: 5px; color: var(--muted); font-size: 11px; }
.word-popover-meta dd { margin: 0; overflow-wrap: anywhere; font-size: 14px; font-weight: 800; line-height: 1.55; }
.word-popover-note, .word-popover-context { padding: 16px 0; border-bottom: 1px solid var(--line); }
.word-popover-note strong, .word-popover-context span { color: var(--muted); font-size: 11px; }
.word-popover-note p, .word-popover-context p { margin: 6px 0 0; color: var(--ink-soft); font-size: 14px; line-height: 1.75; }
.word-popover footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-top: 17px; }
.word-popover footer > span { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.word-popover footer > span svg { width: 15px; color: var(--jade); }
.word-popover footer .primary-button { min-height: 42px; }
.word-popover footer .primary-button.saved { border-color: var(--jade-dark); background: var(--jade-pale); color: var(--jade-dark); }

.syntax-rail-section, .word-lab, .grammar-section { padding: 42px 44px; border-bottom: 1px solid var(--line); }
.section-heading.compact { margin-bottom: 22px; }
.section-heading.compact h2 { font-size: 22px; }
.syntax-overview { max-width: 820px; margin: -5px 0 24px; color: var(--muted); font-size: 15px; line-height: 1.8; }
.syntax-rail { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 14px; padding: 0; }
.syntax-rail::before, .syntax-node::before { display: none; }
.syntax-node { gap: 0; border: 1px solid var(--line); background: #fff; }
.syntax-node b { width: 100%; min-width: 0; border: 0; padding: 16px 10px 9px; font-size: 29px; line-height: 1.45; }
.syntax-node span { width: 100%; min-height: 38px; border-top: 1px solid var(--line); padding: 9px 7px; font-size: 12px; }
.syntax-node.active { border-color: var(--jade); box-shadow: 5px 5px 0 var(--jade-pale); }
.syntax-node.active b { box-shadow: none; }
.syntax-node.verb { border-top: 3px solid var(--cinnabar); }
.syntax-node.noun { border-top: 3px solid var(--cobalt); }
.syntax-node.particle { border-top: 3px solid var(--jade); }
.syntax-node.place { border-top: 3px solid var(--brass); }
.syntax-formula { margin-top: 24px; color: var(--ink-soft); font-size: 15px; line-height: 1.7; }

.word-table { border-color: var(--line-dark); }
#word-table-body { display: contents; }
.word-row, .word-row.table-head, .word-row.active {
  grid-template-columns: minmax(150px, 1fr) minmax(130px, .8fr) minmax(150px, .9fr) minmax(280px, 2fr);
}
.word-row.table-head { min-height: 44px; font-size: 12px; }
.word-row.table-head span { min-height: 44px; }
#word-table-body .word-row { min-height: 94px; }
.word-row > span { min-height: 94px; gap: 5px; padding: 15px 16px; font-size: 14px; line-height: 1.65; }
.word-row > span b { font-size: 14px; }
.word-row > span small { color: var(--muted); font-size: 12px; line-height: 1.5; }
.word-row .arabic-cell { justify-content: center; font-size: 30px !important; line-height: 1.6; }
.word-description { display: block !important; color: var(--ink-soft); font-size: 14px !important; line-height: 1.8 !important; }
.word-row.active { background: #f1f8f5; box-shadow: inset 4px 0 var(--jade); }
.word-row.active::before { display: none; }
.word-row.active > span:first-of-type { grid-column: auto; }

.grammar-section { background: #f8faf8; }
.grammar-band { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; background: transparent; }
.grammar-band > div { min-height: 150px; border: 1px solid var(--line); background: #fff; padding: 24px; }
.section-number { width: 34px; height: 34px; flex-basis: 34px; }
.grammar-band p { gap: 10px; }
.grammar-band strong { font-size: 16px; }
.grammar-band small { color: var(--ink-soft); font-size: 14px; line-height: 1.85; }
.beginner-tip { display: grid; grid-template-columns: 34px 1fr; gap: 13px; margin-top: 18px; border-left: 3px solid var(--brass); background: var(--brass-pale); padding: 18px 20px; }
.beginner-tip > svg { width: 21px; color: var(--brass); }
.beginner-tip strong { font-size: 14px; }
.beginner-tip p { margin: 4px 0 0; color: #725f3f; font-size: 14px; }

/* The inspector becomes a roomy dock on normal desktop widths. */
.inspector-panel {
  grid-column: 2;
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(280px, .9fr);
  align-items: start;
  gap: 22px;
  border-top: 1px solid var(--line);
  border-left: 0;
  background: #eef2ef;
  padding: 34px 38px 46px;
}
.inspector-block { min-width: 0; margin: 0; padding: 24px; }
.inspector-label { margin-bottom: 18px; font-size: 13px; }
.inspector-label em { font-size: 11px; }
.inspector-label .icon-button { width: 34px; height: 34px; flex-basis: 34px; }
.root-inspector {
  display: grid;
  grid-template-columns: minmax(190px, .72fr) minmax(0, 1.55fr);
  grid-template-rows: auto 1fr auto;
  column-gap: 26px;
}
.root-inspector .inspector-label { grid-column: 1 / -1; }
.root-inspector .root-core { display: flex; grid-column: 1; grid-row: 2; align-items: flex-start; justify-content: center; flex-direction: column; border-right: 1px solid var(--line); border-bottom: 0; padding: 8px 24px 14px 2px; }
.root-inspector .root-core b { white-space: nowrap; }
.root-inspector .root-core span { margin-top: 9px; }
.root-inspector .root-core small { margin-top: 4px; }
.root-inspector .derivation-grid { grid-column: 2; grid-row: 2 / span 2; align-self: stretch; }
.root-inspector > .text-button { grid-column: 1; grid-row: 3; align-self: end; justify-content: flex-start; }
.root-core { column-gap: 16px; padding-bottom: 18px; }
.root-core b { font-size: 40px; }
.root-core span { font-size: 13px; }
.root-core small { font-size: 13px; line-height: 1.5; }
.derivation-grid { grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 10px; margin: 0; }
.derivation-grid button { min-height: 98px; padding: 12px 8px; }
.derivation-grid b { font-size: 26px; line-height: 1.55; }
.derivation-grid span, .derivation-grid small { font-size: 11px; line-height: 1.5; }
.root-inspector > .full-width { width: auto; min-height: 42px; margin-top: 18px; border-top: 1px solid var(--line); padding: 13px 4px 0 0; }
.review-state { align-self: start; }
.mastery-options { gap: 8px; }
.mastery-options button { min-height: 42px; font-size: 13px; }
.review-state p { margin-top: 16px; font-size: 12px; line-height: 1.65; }

@media (min-width: 1800px) {
  .analyzer-screen.active { grid-template-columns: 310px minmax(720px, 1fr) 380px; }
  .sentence-browser { grid-column: 1; grid-row: 1; }
  .analysis-canvas { grid-column: 2; grid-row: 1; }
  .inspector-panel {
    position: sticky;
    top: var(--topbar);
    grid-column: 3;
    grid-row: 1;
    display: block;
    height: calc(100vh - var(--topbar));
    overflow-y: auto;
    border-top: 0;
    border-left: 1px solid var(--line);
    padding: 24px 20px;
  }
  .inspector-block { margin-bottom: 18px; }
  .root-inspector { display: block; }
  .root-inspector .root-core { display: grid; border-right: 0; border-bottom: 1px solid var(--line); padding: 0 0 18px; }
  .root-inspector .derivation-grid { grid-template-columns: 1fr 1fr; margin: 16px 0 0; }
  .root-inspector > .text-button { justify-content: center; }
  .root-inspector > .full-width { width: 100%; }
}

@media (min-width: 901px) and (max-width: 1180px) {
  :root { --sidebar: 216px; }
  .analyzer-screen.active { grid-template-columns: 270px minmax(0, 1fr); }
  .sentence-browser { padding-inline: 16px; }
  .analysis-heading { padding-inline: 30px; }
  .sentence-hero { padding-inline: 42px; }
  .syntax-rail-section, .word-lab, .grammar-section { padding-inline: 30px; }
  .inspector-panel { padding-inline: 26px; }
}

@media (min-width: 901px) and (max-width: 1280px) {
  .inspector-panel { grid-template-columns: 1fr; }
}

@media (min-width: 901px) and (max-width: 1050px) {
  .analyzer-screen.active { display: block; }
  .sentence-browser { display: none; }
}

@media (max-width: 900px) {
  :root { --topbar: 64px; }
  .topbar { padding-inline: 16px; }
  .screen small { font-size: 12px; }
  .analyzer-screen.active { display: block; background: #fff; }
  .sentence-browser { display: none; }
  .analysis-canvas { max-width: none; }
  .analysis-heading { min-height: 116px; flex-wrap: wrap; gap: 14px; padding: 18px 20px; }
  .analysis-heading > div:first-child { min-width: 0; flex: 1; }
  .analysis-heading h1 { font-size: 25px; }
  .canvas-actions { width: 100%; justify-content: space-between; }
  .sentence-pager { margin-right: auto; }
  .analysis-heading .secondary-button { width: auto; min-width: 42px; padding-inline: 12px; color: var(--ink); font-size: 13px; }
  .sentence-hero { min-height: 320px; padding: 48px 24px 38px; }
  .hero-audio { top: 22px; right: 20px; }
  .hero-arabic { margin-top: 38px; font-size: 44px; line-height: 1.9; }
  .hero-translation { font-size: 23px; }
  .transliteration { font-size: 14px; }
  .syntax-rail-section, .word-lab, .grammar-section { padding: 34px 20px; }
  .syntax-rail { grid-template-columns: none; grid-auto-columns: minmax(128px, 42%); grid-auto-flow: column; gap: 12px; overflow-x: auto; overscroll-behavior-inline: contain; padding: 4px 5px 12px 0; scroll-snap-type: x proximity; }
  .syntax-node { scroll-snap-align: start; }
  .syntax-node b { font-size: 27px; }
  .syntax-node span { font-size: 12px; }
  .word-table { overflow: visible; border: 0; }
  .word-row.table-head { display: none; }
  #word-table-body { display: block; }
  #word-table-body .word-row, #word-table-body .word-row.active {
    display: grid;
    min-width: 0;
    grid-template-columns: 1fr 1fr !important;
    margin-bottom: 14px;
    border: 1px solid var(--line);
  }
  .word-row > span { min-height: 76px; border-right: 0; border-bottom: 1px solid var(--line); padding: 14px; }
  .word-row > span:nth-child(odd) { border-right: 1px solid var(--line); }
  .word-row > .word-description { grid-column: 1 / -1; min-height: 0; border-right: 0; border-bottom: 0; padding: 16px; }
  .word-row .arabic-cell { font-size: 29px !important; }
  .grammar-band { grid-template-columns: 1fr; }
  .grammar-band > div { min-height: 0; }
  .inspector-panel {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    border-top: 1px solid var(--line);
    padding: 26px 20px 96px;
  }
  .inspector-block { padding: 22px 20px; }
}

@media (max-width: 520px) {
  .screen small { font-size: 11px; }
  .analysis-heading { min-height: 126px; padding: 16px; }
  .breadcrumb { font-size: 11px; }
  .analysis-heading h1 { font-size: 23px; }
  .sentence-pager .icon-button:last-child { display: inline-grid; }
  .sentence-pager > span { min-width: 56px; font-size: 12px; }
  #review-sentence { width: 42px; padding: 0; }
  #review-sentence span { display: none; }
  .sentence-hero { min-height: 300px; padding: 46px 16px 34px; }
  .sentence-status { justify-content: center; padding-inline: 42px; }
  .sentence-status span { padding: 5px 8px; font-size: 11px; }
  .hero-audio { top: 16px; right: 16px; width: 42px; height: 42px; }
  .hero-arabic { margin-top: 34px; font-size: 38px; line-height: 1.9; }
  .hero-translation { font-size: 21px; }
  .syntax-rail-section, .word-lab, .grammar-section { padding: 30px 16px; }
  .section-heading.compact h2 { font-size: 20px; }
  .syntax-overview { font-size: 14px; }
  .syntax-rail { grid-auto-columns: minmax(122px, 58%); }
  .syntax-node b { min-width: 0; padding: 14px 8px 8px; font-size: 26px; }
  .syntax-node span { font-size: 11px; }
  .syntax-formula { font-size: 14px; }
  #word-table-body .word-row, #word-table-body .word-row.active { grid-template-columns: 1fr !important; }
  .word-row > span, .word-row > span:nth-child(odd) { min-height: 0; border-right: 0; padding: 14px 16px; }
  .word-row > .arabic-cell { min-height: 78px; }
  .word-row > .word-description { grid-column: auto; }
  .grammar-band small { font-size: 13px; }
  .beginner-tip { padding: 16px; }
  .root-core b { font-size: 38px; }
  .derivation-grid button { min-height: 92px; }
}

@media (max-width: 700px) {
  .word-popover {
    inset: auto 12px calc(76px + env(safe-area-inset-bottom)) 12px;
    width: auto;
    max-height: min(68vh, 620px);
    border-top-width: 4px;
    padding: 19px 18px;
  }
  .word-popover-head p { font-size: 38px; }
  .word-popover footer { align-items: stretch; flex-direction: column; }
  .word-popover footer > span { order: 2; }
  .word-popover footer .primary-button { width: 100%; }
  .root-inspector { display: block; }
  .root-inspector .root-core { display: grid; border-right: 0; border-bottom: 1px solid var(--line); padding: 0 0 18px; }
  .root-inspector .derivation-grid { grid-template-columns: 1fr 1fr; margin: 16px 0 0; }
  .root-inspector > .text-button { justify-content: center; }
  .root-inspector > .full-width { width: 100%; }
}

/* Product-wide spaciousness and readable type floor. */
.skip-link { font-size: 13px; }
.brand-mark b, .review-mark, .trial-arabic, .trial-word-strip b, .trial-explanation span,
.instrument-arabic, .word-chips button, .vocab-arabic, .vocab-preview > p b,
.derivation-list b, .related-sentence b, .root-mini b, .phrase-panel b, .life-turn p,
.sentence-item b, .syntax-node b, .root-core b, .derivation-grid b,
.root-title b, .lookup-summary h2 {
  font-family: "Noto Naskh Arabic Local", "Traditional Arabic", "Arabic Typesetting", serif;
}

.brand-copy small, .nav-label, .nav-item em, .sidebar-rights p, .sidebar-rights .text-button,
.profile-row small, .global-search kbd, .hero-kicker, .instrument-head, .instrument-words small,
.instrument-root span, .instrument-root p, .instrument-link, .landing-section-heading > p,
.entry-footer span, .entry-footer button, .trial-step-meter small, .trial-word-strip small,
.trial-rail li small, .trial-value small, .access-intro li small, .access-trust small,
.signed-account small, .form-note, .code-field button, .section-index small, .sentence-tags span,
.route-step small, .topic-card small, .topic-card em, .metric-row small, .review-item small,
.review-item em, .plus-note p, .plus-note .text-button, .lesson-steps li span,
.lesson-steps li small, .lesson-progress small, .brief-tags span, .turn-content header > span,
.word-chips small, .analysis-link, .outcome-panel small, .phrase-panel span, .next-lesson > span,
.content-search kbd, .content-count, .root-matrix small, .root-usage-strip small, .root-title small,
.derivation-list span, .derivation-list small, .library-overview small, .library-list small,
.library-list em, .preview-top, .vocab-meta span, .preview-actions button, .lookup-heading > p:last-child,
.lookup-summary span, .lookup-facts dt, .lookup-facts dd, .related-sentence > span,
.related-sentence small, .root-mini small, .plus-boundary-panel p, .review-stats small,
.review-stats section p, .review-queue small, .review-queue em, .rhythm-note,
.life-topics small, .life-turn > span, .life-turn small, .purchase-copy > p,
.purchase-copy li, .payment-panel p, .plus-boundary, .legend span,
.derivation-grid span, .derivation-grid small, .inspector-label em,
.speaker, .hero-proof b, .photo-credit, .system-flow em, .trial-rail li > span,
.access-intro li > span, .root-usage-strip strong, .root-title span,
.review-stats strong em, .review-queue .risk, .review-bars i {
  font-size: 12px;
}

.page-heading p:not(.eyebrow), .focus-meta, .scene-brief p,
.lesson-steps > p:not(.eyebrow), .turn-content > p:not(.turn-arabic),
.content-heading > div > p:not(.eyebrow) {
  font-size: 15px;
}

.dashboard-grid { max-width: 1480px; grid-template-columns: minmax(0, 1fr) 340px; }
.dashboard-main { padding: 52px 48px 82px; }
.dashboard-rail { padding: 52px 30px 82px; }
.page-heading { margin-bottom: 36px; }
.focus-lesson { min-height: 250px; grid-template-columns: 108px minmax(0, 1fr) auto; }
.focus-copy { padding: 34px 36px; }
.focus-actions { min-width: 190px; padding: 30px; }
.section-block { margin-top: 44px; }
.topic-card { min-height: 126px; padding: 22px; }
.rail-section { margin-bottom: 32px; padding-bottom: 32px; }
.route-step > span { font-size: 13px; }
.week-chart i { font-size: 12px; }

.scenario-screen.active { grid-template-columns: 230px minmax(0, 1fr) 330px; }
.lesson-steps { padding: 38px 24px; }
.lesson-steps li button { min-height: 62px; padding: 10px 8px; }
.dialogue-canvas { padding: 44px 44px 80px; }
.scene-brief { gap: 18px; padding: 20px; }
.dialogue-turn { grid-template-columns: 42px 1fr; gap: 16px; padding: 30px 14px; }
.turn-arabic { font-size: 34px; line-height: 1.85; }
.scenario-rail { padding: 38px 22px; }
.scenario-rail section { margin-bottom: 18px; padding: 20px; }

.content-screen.active { max-width: 1480px; padding: 54px 48px 90px; }
.content-heading { padding-bottom: 30px; }
.content-columns { grid-template-columns: minmax(0, 1fr) 340px; gap: 40px; margin-top: 38px; }
.content-rail { padding-left: 34px; }
.root-matrix button { min-height: 156px; padding: 22px; }
.library-list > button { min-height: 104px; padding: 18px 20px; }
.saved-word-collection { margin-top: 34px; border-top: 1px solid var(--line-dark); padding-top: 30px; }
.saved-word-collection .section-heading > span { color: var(--muted); font-size: 12px; }
.saved-word-list { border-top: 1px solid var(--line); }
.saved-word-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: stretch; border-bottom: 1px solid var(--line); background: #fff; }
.saved-word-main { display: grid; min-width: 0; min-height: 98px; grid-template-columns: minmax(120px, .55fr) minmax(0, 1fr) auto; align-items: center; gap: 18px; border: 0; background: transparent; padding: 16px 18px; text-align: left; cursor: pointer; }
.saved-word-main:hover { background: #f3f8f5; }
.saved-word-main > b { font-family: "Noto Naskh Arabic Local", "Traditional Arabic", serif; font-size: 31px; font-weight: 600; line-height: 1.55; text-align: center; }
.saved-word-main > span { display: grid; min-width: 0; gap: 5px; }
.saved-word-main strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.saved-word-main small { overflow: hidden; color: var(--muted); font-size: 12px; line-height: 1.55; text-overflow: ellipsis; white-space: nowrap; }
.saved-word-main > svg { width: 17px; color: var(--jade); }
.saved-word-remove { align-self: center; margin-right: 16px; color: var(--muted); }
.saved-word-empty { display: grid; min-height: 190px; place-content: center; justify-items: center; gap: 14px; background: #f8faf8; text-align: center; }
.saved-word-empty > svg { width: 27px; color: var(--muted); }
.saved-word-empty strong { font-size: 15px; }
.saved-word-empty .secondary-button { min-width: 120px; }
.lookup-facts dd small { display: block; margin-top: 4px; color: var(--muted); font-family: "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 11px; font-weight: 400; line-height: 1.5; unicode-bidi: isolate; }
.life-layout { grid-template-columns: 280px minmax(0, 1fr); gap: 40px; margin-top: 38px; }
.life-topics button { min-height: 88px; padding: 16px; }
.life-turn { padding-block: 28px; }
.life-turn p { font-size: 34px; line-height: 1.85; }
.life-turn small { font-size: 14px; line-height: 1.65; }
.lookup-heading label button { font-size: 13px; }
.lookup-summary h2 { font-size: 46px; }
.related-sentence b, .root-mini b { font-size: 22px; }
.purchase-dialog { gap: 32px; padding: 36px; }
.purchase-copy > p, .purchase-copy li { line-height: 1.75; }

.sentence-item {
  content-visibility: auto;
  contain-intrinsic-size: auto 116px;
}
.sentence-item > span.sentence-number, .sentence-item-meta { font-size: 12px; }

@media (min-width: 901px) and (max-width: 1280px) {
  .dashboard-grid { grid-template-columns: minmax(0, 1fr) 300px; }
  .dashboard-main { padding-inline: 32px; }
  .dashboard-rail { padding-inline: 22px; }
  .scenario-screen.active { grid-template-columns: 200px minmax(0, 1fr) 290px; }
  .dialogue-canvas { padding-inline: 30px; }
}

@media (max-width: 900px) {
  .dashboard-main { padding: 30px 20px 42px; }
  .dashboard-rail { padding: 8px 20px 42px; }
  .focus-lesson { min-height: 0; grid-template-columns: 62px minmax(0, 1fr); }
  .focus-copy { padding: 22px 20px; }
  .focus-actions { min-width: 0; padding: 16px 20px; }
  .topic-card { min-height: 108px; padding: 18px; }
  .dialogue-canvas { padding: 30px 20px 54px; }
  .dialogue-turn { padding-block: 24px; }
  .content-screen.active { padding: 36px 20px 78px; }
  .content-columns { gap: 30px; margin-top: 30px; }
  .content-rail { padding-left: 0; }
  .life-layout { grid-template-columns: 1fr; gap: 30px; }
}

@media (max-width: 520px) {
  .hero-kicker, .instrument-head, .instrument-words small, .trial-word-strip small,
  .trial-explanation p, .trial-syntax span, .breadcrumb, .sentence-status span,
  .syntax-node span, .grammar-band small, .derivation-grid span, .derivation-grid small {
    font-size: 12px;
  }
  .page-heading p:not(.eyebrow), .focus-meta, .scene-brief p,
  .turn-content > p:not(.turn-arabic), .content-heading > div > p:not(.eyebrow) {
    font-size: 14px;
  }
  .dashboard-main, .dashboard-rail { padding-inline: 16px; }
  .landing-hero-inner { gap: 22px; padding-top: 84px; padding-bottom: 42px; }
  .hero-proof { display: none; }
  .instrument-root { display: none; }
  .instrument-arabic { font-size: 32px; line-height: 1.75; }
  .focus-copy { padding: 20px 16px; }
  .dialogue-canvas { padding-inline: 16px; }
  .dialogue-turn { grid-template-columns: 34px 1fr; gap: 12px; }
  .turn-arabic, .life-turn p { font-size: 29px; }
  .content-screen.active { padding-inline: 16px; }
  .saved-word-main { min-height: 112px; grid-template-columns: 92px minmax(0, 1fr) auto; gap: 12px; padding: 14px 10px; }
  .saved-word-main > b { font-size: 27px; }
  .saved-word-main strong { font-size: 12px; }
  .saved-word-main small { white-space: normal; }
  .saved-word-remove { margin-right: 8px; }
}

/* Unified Arabic audio controls */
[data-speak], [data-audio-text] { touch-action: manipulation; }
[data-speak].is-loading svg, [data-audio-text].is-loading svg { animation: audio-pulse .8s ease-in-out infinite alternate; }
.icon-button.is-playing, .hero-audio.is-playing, .sentence-item-audio.is-playing,
.related-sentence-audio.is-playing, .review-queue-audio.is-playing {
  border-color: var(--jade);
  background: var(--jade);
  color: #fff;
}
[data-speak].is-unavailable, [data-audio-text].is-unavailable { border-color: #d8aa61; color: #9a6415; }

@keyframes audio-pulse {
  from { opacity: .35; transform: scale(.88); }
  to { opacity: 1; transform: scale(1.04); }
}

.audio-status {
  position: fixed;
  z-index: 120;
  left: 50%;
  bottom: 24px;
  display: grid;
  width: min(560px, calc(100vw - 32px));
  min-height: 54px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  transform: translateX(-50%);
  border: 1px solid #a8c9c0;
  border-left: 4px solid var(--jade);
  background: #fff;
  box-shadow: 0 16px 42px rgba(16, 33, 31, .18);
  padding: 11px 12px 11px 15px;
  color: var(--ink-soft);
}
.audio-status[hidden] { display: none; }
.audio-status[data-tone="warning"] { border-color: #dfbd83; border-left-color: var(--brass); background: #fffaf0; }
.audio-status > svg { width: 20px; color: var(--jade); }
.audio-status[data-tone="warning"] > svg { color: var(--brass); }
.audio-status > span { font-size: 13px; line-height: 1.6; }
.audio-status > button { display: grid; width: 34px; height: 34px; place-items: center; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.audio-status > button svg { width: 17px; }

.inline-arabic-audio {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  border-bottom: 1px solid rgba(8, 122, 104, .35);
  background: transparent;
  color: inherit;
  padding: 0 2px;
  font-family: "Noto Naskh Arabic Local", "Traditional Arabic", serif;
  font-size: 1.18em;
  line-height: 1.45;
  cursor: pointer;
}
.inline-arabic-audio:hover, .inline-arabic-audio.is-playing { border-bottom-color: var(--jade); color: var(--jade-dark); }
.inline-arabic-audio svg { width: 13px; height: 13px; color: var(--jade); }

.instrument-words button {
  position: relative;
  display: grid;
  gap: 2px;
  border: 0;
  border-top: 2px solid var(--cobalt);
  background: #f1f5f3;
  padding: 8px 18px 8px 5px;
  color: inherit;
  text-align: center;
  cursor: pointer;
}
.instrument-words button:nth-child(1) { border-color: var(--jade); }
.instrument-words button:nth-child(3) { border-color: var(--brass); }
.instrument-words button > svg { position: absolute; top: 7px; right: 6px; width: 11px; color: var(--muted); }
.instrument-words button.is-playing { background: #e0f1ec; color: var(--jade-dark); }
.instrument-root .inline-arabic-audio { font-size: 13px; }

.trial-word-strip button { position: relative; padding-right: 24px; }
.trial-word-strip button > svg { position: absolute; top: 8px; right: 7px; width: 13px; color: var(--muted); }
.trial-word-strip button.is-playing { border-color: var(--jade); box-shadow: inset 0 -3px var(--jade); }

.review-item { grid-template-columns: auto minmax(0, 1fr) 18px auto; }
.review-item > svg { width: 16px; color: var(--jade); }
.review-item.is-playing { background: var(--jade-pale); }

.word-chips button { position: relative; padding-right: 25px; }
.word-chips button > svg { position: absolute; top: 7px; right: 6px; width: 12px; color: var(--jade); }
.word-chips button.is-playing { border-color: var(--jade); background: var(--jade-pale); }
.dialogue-toolbar [data-audio-text].is-playing { box-shadow: inset 0 -3px var(--jade-dark); }

.derivation-list button, .derivation-grid button { position: relative; padding-right: 24px; }
.derivation-list button > svg, .derivation-grid button > svg {
  position: absolute;
  top: 8px;
  right: 7px;
  width: 13px;
  color: var(--jade);
}
.derivation-list button.is-playing, .derivation-grid button.is-playing { border-color: var(--jade); background: var(--jade-pale); }

.sentence-item-row { position: relative; min-width: 0; margin-bottom: 8px; content-visibility: auto; contain-intrinsic-size: auto 116px; }
.sentence-item-row .sentence-item { width: 100%; min-height: 116px; margin-bottom: 0; padding-right: 48px; }
.sentence-item-audio {
  position: absolute;
  z-index: 2;
  right: 10px;
  bottom: 12px;
  width: 34px;
  height: 34px;
  flex-basis: 34px;
  border-color: transparent;
  background: rgba(255, 255, 255, .88);
  color: var(--jade);
}
.sentence-item-row:has(.sentence-item.active) .sentence-item-audio { border-color: #b7d5cd; }

.saved-word-item { grid-template-columns: minmax(0, 1fr) auto auto; }
.saved-word-audio, .saved-word-remove { align-self: center; }
.saved-word-audio { color: var(--jade); }
.saved-word-remove { margin-right: 16px; }

.related-sentence {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding: 0;
}
.related-sentence-main {
  display: grid;
  width: 100%;
  min-width: 0;
  grid-template-columns: 44px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 4px 10px;
  border: 0;
  background: transparent;
  padding: 14px 2px;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.related-sentence-main > span { grid-row: span 2; color: var(--muted); font-family: Georgia, serif; font-size: 10px; }
.related-sentence-main > svg { width: 14px; grid-row: span 2; color: var(--jade); }
.related-sentence-audio { margin-right: 2px; }
.related-sentence .related-sentence-audio svg { width: 16px; grid-row: auto; }

.root-mini span { gap: 10px; }
.root-mini span small { margin-left: auto; }
.root-mini span .icon-button { width: 32px; height: 32px; flex-basis: 32px; color: var(--jade); }

.review-queue-item { position: relative; border-bottom: 1px solid var(--line); background: #fff; }
.review-queue-item:last-child { border-bottom: 0; }
.review-queue .review-queue-main {
  min-height: 82px;
  border-bottom: 0;
  padding-right: 58px;
}
.review-queue .review-queue-audio {
  position: absolute;
  z-index: 2;
  top: 50%;
  right: 12px;
  width: 36px;
  min-height: 36px;
  height: 36px;
  transform: translateY(-50%);
  border: 1px solid var(--line);
  padding: 0;
  color: var(--jade);
}
.review-queue .review-queue-audio svg { width: 16px; }

@media (max-width: 900px) {
  .audio-status { bottom: calc(84px + env(safe-area-inset-bottom)); }
}

@media (max-width: 520px) {
  [data-speak],
  [data-audio-text] {
    min-width: 42px;
    min-height: 42px;
  }
  [data-speak].icon-button,
  [data-audio-text].icon-button,
  #sentence-audio {
    width: 42px;
    min-width: 42px;
    height: 42px;
    min-height: 42px;
    flex-basis: 42px;
  }
  .instrument-words button { padding-right: 18px; }
  .trial-word-strip button { min-height: 76px; padding: 10px 3px 8px; }
  .trial-word-strip button > svg { top: 5px; right: 4px; width: 11px; }
  .sentence-item-row { contain-intrinsic-size: auto 112px; }
  .related-sentence-main { grid-template-columns: 35px minmax(0, 1fr) 14px; gap-inline: 7px; }
  .related-sentence-audio { width: 42px; height: 42px; flex-basis: 42px; }
  .review-queue .review-queue-main { padding-right: 54px; }
  .saved-word-audio { width: 42px; height: 42px; flex-basis: 42px; }
  .saved-word-remove { margin-right: 8px; }
  .audio-status { bottom: calc(78px + env(safe-area-inset-bottom)); }
}

/* Application modules: live data, review states, and honest content availability */
.nav-item > span { flex: 1; }
.nav-item em { margin-left: auto; }

.lesson-steps li.is-pending { opacity: .58; }
.lesson-steps li.is-pending button,
.phrase-panel button:disabled,
.next-lesson button:disabled,
.analysis-link:disabled,
.life-topics button:disabled,
.primary-button:disabled {
  cursor: not-allowed;
}
.lesson-steps li.is-pending span { border-style: dashed; }
.lesson-steps [data-lesson-target]:focus-visible,
#scenario-brief:focus-visible,
#scenario-dialogue:focus-visible,
#scenario-key-sentence:focus-visible,
#scenario-vocabulary:focus-visible { outline: 2px solid var(--jade); outline-offset: 4px; }
#scenario-brief, #scenario-dialogue, #scenario-key-sentence, #scenario-vocabulary { scroll-margin-top: 92px; }
.analysis-link.is-pending { color: var(--muted); }
.analysis-link.is-pending svg { color: var(--brass); }
.phrase-panel button:disabled { color: var(--muted); opacity: .62; }
.phrase-panel button > svg { width: 15px; color: var(--jade); }
.next-lesson .primary-button:disabled { border-color: var(--line-dark); background: var(--surface-2); color: var(--muted); }

.lookup-heading form { max-width: 880px; margin: 26px auto 0; }
.lookup-heading form label {
  display: flex;
  min-height: 58px;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line-dark);
  background: #fff;
  padding-left: 18px;
  box-shadow: 8px 8px 0 #e1e9e4;
}
.lookup-heading form label > svg { width: 20px; flex: 0 0 20px; color: var(--muted); }
.lookup-heading form input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font-family: "Noto Naskh Arabic Local", "Traditional Arabic", serif;
  font-size: 25px;
  line-height: 1.5;
  text-align: right;
}
.lookup-heading form button { align-self: stretch; border: 0; background: var(--jade); color: #fff; padding: 0 28px; cursor: pointer; font-size: 13px; font-weight: 800; }
#lookup-search-note { min-height: 22px; margin-top: 18px; line-height: 1.7; }
.lookup-summary { min-height: 142px; gap: 24px; padding: 26px 28px; }
.lookup-summary > div:first-child { min-width: 0; }
.lookup-summary .icon-button { width: 44px; height: 44px; flex: 0 0 44px; color: var(--jade); }
.lookup-summary.is-empty { display: block; }
.lookup-facts .wide { grid-column: 1 / -1; border-right: 0; }
.lookup-facts .wide:last-child { border-bottom: 0; }
.lookup-facts .wide dd { line-height: 1.7; }
.lookup-matches { padding-bottom: 12px; }
.lookup-match-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.lookup-match-item {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  border: 1px solid var(--line);
  background: #fff;
}
.lookup-match {
  display: grid;
  min-width: 0;
  min-height: 82px;
  grid-template-columns: minmax(92px, .55fr) minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  border: 0;
  background: transparent;
  padding: 12px 14px;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.lookup-match-item:hover, .lookup-match-item.active { border-color: #9fc9bd; background: var(--jade-pale); }
.lookup-match b { font-family: "Noto Naskh Arabic Local", "Traditional Arabic", serif; font-size: 27px; font-weight: 600; line-height: 1.5; text-align: center; }
.lookup-match > span { display: grid; min-width: 0; gap: 4px; }
.lookup-match strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.lookup-match small { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.lookup-match-audio { width: 40px; height: 40px; flex-basis: 40px; margin-right: 10px; color: var(--jade); }
.lookup-related-terms { display: flex; flex-wrap: wrap; gap: 8px; }
.lookup-related-terms .inline-arabic-audio { display: grid; min-height: 52px; grid-template-columns: auto auto; align-items: center; gap: 2px 7px; border: 1px solid var(--line); padding: 6px 10px; }
.lookup-related-terms .inline-arabic-audio small { grid-column: 1 / -1; margin: 0; font-size: 11px; text-align: right; }
.related-sentence-main > span { grid-column: 1; grid-row: 1 / 3; }
.related-sentence-main > b { grid-column: 2; grid-row: 1; line-height: 1.65; }
.related-sentence-main > small { grid-column: 2; grid-row: 2; line-height: 1.6; }
.related-sentence-main > svg { grid-column: 3; grid-row: 1 / 3; }
.root-mini.is-empty { min-height: 210px; }
.lookup-root-note { margin-top: 18px; color: var(--muted); font-size: 12px; line-height: 1.75; }
.lookup-external-panel { margin-top: 12px; overflow: hidden; border: 1px solid var(--line); background: #fff; }
.lookup-external-panel[hidden] { display: none; }
.lookup-external-panel.has-local-results { border-color: #a9d5c8; }
.external-dictionary-reference { display: grid; width: 100%; }
.external-dictionary-reference.is-loading,
.external-dictionary-reference.is-missing,
.external-dictionary-reference.is-error {
  min-height: 180px;
  place-content: center;
  justify-items: center;
  gap: 10px;
  padding: 28px;
  text-align: center;
}
.lookup-external-panel.has-local-results .external-dictionary-reference.is-loading,
.lookup-external-panel.has-local-results .external-dictionary-reference.is-missing,
.lookup-external-panel.has-local-results .external-dictionary-reference.is-error { min-height: 128px; }
.external-dictionary-reference.is-loading > svg,
.external-dictionary-reference.is-missing > svg,
.external-dictionary-reference.is-error > svg { width: 26px; color: var(--jade); }
.external-dictionary-reference.is-loading > strong,
.external-dictionary-reference.is-missing > strong,
.external-dictionary-reference.is-error > strong { font-size: 17px; }
.external-dictionary-reference.is-loading > p,
.external-dictionary-reference.is-missing > p,
.external-dictionary-reference.is-error > p { max-width: 520px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.75; }
.external-dictionary-reference.is-loading > svg { animation: external-reference-pulse 1.1s ease-in-out infinite alternate; }
@keyframes external-reference-pulse { to { opacity: .35; transform: scale(.92); } }
.external-dictionary-reference > header { display: grid; gap: 12px; border-bottom: 1px solid var(--line); padding: 24px 28px 20px; }
.external-dictionary-status { display: flex; flex-wrap: wrap; gap: 7px; }
.external-dictionary-status span { border: 1px solid var(--line-dark); padding: 4px 8px; font-size: 11px; font-weight: 800; }
.external-dictionary-status .external-source-badge { border-color: #e4c38d; background: var(--brass-pale); color: #805414; }
.external-dictionary-status .external-cache-badge { background: var(--surface-2); color: var(--muted); }
.external-dictionary-title { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.external-dictionary-title h2 { margin: 0; font-size: 46px; line-height: 1.55; }
.external-dictionary-title.is-reverse h2 { font-family: "STZhongsong", serif; font-size: 28px; line-height: 1.45; }
.external-dictionary-title .icon-button { width: 44px; height: 44px; flex: 0 0 44px; color: var(--jade); }
.external-dictionary-reference > header > p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.75; }
.external-dictionary-sections { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.external-dictionary-section { min-width: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 20px 24px; }
.external-dictionary-section:nth-child(even) { border-right: 0; }
.external-dictionary-section h3 { margin: 0 0 10px; color: var(--jade-dark); font-size: 14px; }
.external-dictionary-section p,
.external-dictionary-plain { margin: 0; color: var(--ink); font-size: 13px; line-height: 1.9; white-space: pre-line; overflow-wrap: anywhere; }
.external-dictionary-plain { padding: 22px 28px; }
.external-translation-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 20px 24px; }
.external-translation-term { display: grid; min-width: 0; grid-template-columns: minmax(0, 1fr) 44px; align-items: center; border: 1px solid var(--line); background: #fff; }
.external-translation-term-main { display: grid; min-width: 0; min-height: 86px; gap: 2px; border: 0; background: transparent; padding: 10px 14px; cursor: pointer; text-align: right; }
.external-translation-term-main b { font-family: "Noto Naskh Arabic Local", "Traditional Arabic", serif; font-size: 30px; font-weight: 600; line-height: 1.55; }
.external-translation-term-main small { color: var(--muted); font-size: 11px; }
.external-translation-term > .icon-button { width: 44px; height: 44px; color: var(--jade); }
.external-translation-term:hover { border-color: #9fc9bd; background: var(--jade-pale); }
.external-dictionary-source { display: grid; gap: 7px; background: var(--surface-2); padding: 17px 28px; }
.external-dictionary-source p { margin: 0; font-size: 12px; }
.external-dictionary-source a { color: var(--jade-dark); font-weight: 800; text-underline-offset: 3px; }
.external-dictionary-source small { color: var(--muted); font-size: 11px; line-height: 1.7; }

.module-empty { display: grid; min-height: 150px; place-content: center; justify-items: center; gap: 9px; width: 100%; padding: 26px; text-align: center; }
.module-empty.compact { min-height: 130px; }
.module-empty > svg { width: 24px; color: var(--muted); }
.module-empty strong { font-size: 16px; }
.module-empty p { max-width: 520px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.module-empty .secondary-button { width: auto; min-height: 40px; margin-top: 6px; padding: 0 18px; }

.review-filters { display: flex; gap: 4px; border: 1px solid var(--line); background: var(--surface-2); padding: 3px; }
.review-filters button { min-width: 62px; min-height: 34px; border: 0; background: transparent; color: var(--muted); padding: 0 10px; cursor: pointer; font-size: 12px; }
.review-filters button.active { background: #fff; color: var(--jade-dark); box-shadow: 0 1px 3px rgba(6, 39, 31, .09); font-weight: 800; }
.review-stats section > span i { width: 0; transition: width .24s ease; }
.review-stats section p { line-height: 1.55; }
#review-start.is-disabled { border-color: var(--line-dark); background: var(--surface-2); color: var(--muted); }
.review-empty { min-height: 290px; }
.review-queue .review-empty button { display: inline-flex; width: auto; min-height: 42px; border: 1px solid var(--line-dark); padding: 0 18px; }
.review-state-rail { align-self: start; }
.review-state-rail > h2 { margin: 4px 0 24px; font-size: 20px; }
.review-distribution { display: grid; gap: 20px; }
.review-distribution > div { display: grid; grid-template-columns: minmax(80px, 1fr) minmax(96px, auto) 30px; align-items: center; gap: 12px; }
.review-distribution > div > span { display: block; height: 8px; background: var(--surface-2); }
.review-distribution > div > span i { display: block; width: 0; height: 100%; transition: width .24s ease; }
.review-distribution i.unfamiliar { background: var(--cinnabar); }
.review-distribution i.learning { background: var(--brass); }
.review-distribution i.mastered { background: var(--jade); }
.review-distribution p { display: grid; gap: 2px; margin: 0; }
.review-distribution strong { font-size: 13px; }
.review-distribution small { color: var(--muted); font-size: 11px; }
.review-distribution b { font-family: Georgia, serif; font-size: 18px; text-align: right; }
.review-state-rail .rhythm-note { margin-top: 30px; border-top: 1px solid var(--line); padding-top: 20px; font-size: 12px; }

.life-topics button { grid-template-columns: auto minmax(0, 1fr) auto; }
.life-topics button em { border: 1px solid #a9d5c8; background: var(--jade-pale); color: var(--jade-dark); padding: 3px 6px; font-size: 10px; font-style: normal; }
.life-topics button.is-pending { background: var(--surface-2); opacity: .68; }
.life-topics button.is-pending em { border-color: var(--line-dark); background: #fff; color: var(--muted); }
.content-status-note { display: flex; align-items: flex-start; gap: 14px; margin-top: 28px; border: 1px solid #e7ca9a; background: var(--brass-pale); padding: 18px; }
.content-status-note > svg { width: 20px; flex: 0 0 20px; color: #8c5c18; }
.content-status-note p { display: grid; gap: 4px; margin: 0; }
.content-status-note strong { font-size: 13px; }
.content-status-note small { color: #78664d; font-size: 12px; line-height: 1.7; }

@media (max-width: 900px) {
  .content-columns { grid-template-columns: minmax(0, 1fr); }
  .review-workspace > .content-primary,
  .review-state-rail { min-width: 0; width: auto; }
  .review-workspace .section-heading { display: grid; gap: 18px; }
  .lookup-match-list { grid-template-columns: 1fr; }
  .review-filters { width: 100%; }
  .review-filters button { flex: 1; }
}

@media (max-width: 520px) {
  .lookup-heading form { margin-top: 20px; }
  .lookup-heading form label { min-height: 54px; padding-left: 12px; box-shadow: 5px 5px 0 #e1e9e4; }
  .lookup-heading form input { font-size: 22px; }
  .lookup-heading form button { padding-inline: 16px; }
  .lookup-summary { min-height: 128px; padding: 20px 16px; }
  .lookup-summary h2 { font-size: 38px; }
  .lookup-match { min-height: 92px; grid-template-columns: 86px minmax(0, 1fr); padding-inline: 10px; }
  .lookup-match b { font-size: 25px; }
  .lookup-facts .wide { grid-column: auto; }
  .external-dictionary-reference > header { padding: 20px 16px 17px; }
  .external-dictionary-title h2 { font-size: 38px; }
  .external-dictionary-title.is-reverse h2 { font-size: 24px; }
  .external-dictionary-sections { grid-template-columns: 1fr; }
  .external-dictionary-section { border-right: 0; padding: 18px 16px; }
  .external-translation-list { grid-template-columns: 1fr; padding: 16px; }
  .external-dictionary-source { padding: 15px 16px; }
  .review-distribution > div { grid-template-columns: minmax(70px, 1fr) minmax(88px, auto) 24px; gap: 9px; }
  .review-queue .review-queue-main {
    min-height: 112px;
    grid-template-columns: 38px minmax(0, 1fr);
    grid-template-rows: auto auto;
    gap: 3px 10px;
    padding: 14px 54px 14px 10px;
  }
  .review-queue-main .risk { grid-column: 1; grid-row: 1 / 3; }
  .review-queue-main b { grid-column: 2; grid-row: 1; font-size: 23px; line-height: 1.6; }
  .review-queue-main small { grid-column: 2; grid-row: 2; font-size: 11px; line-height: 1.55; }
  .review-queue-main em { display: none; }
  .life-topics button { min-height: 84px; }
  .content-status-note { padding: 15px; }
}

/* Scenario studio: topic library, six-turn dialogue and visible syntax analysis. */
.legacy-scenario-content { display: none !important; }
.scenario-screen.active {
  display: block;
  min-height: calc(100vh - var(--topbar));
  background: #edf2ef;
}
.scenario-library { max-width: 1540px; margin: 0 auto; padding: 46px 42px 90px; }
.scenario-library-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  padding-bottom: 28px;
}
.scenario-library-heading h1 { max-width: 820px; margin: 5px 0 10px; font-family: "STZhongsong", "Songti SC", serif; font-size: 34px; line-height: 1.3; }
.scenario-library-heading > div > p:last-child { max-width: 760px; margin: 0; color: var(--muted); font-size: 15px; line-height: 1.75; }
.scenario-library-heading > .access-badge { flex: 0 0 auto; }
.topic-strip-shell {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: stretch;
  gap: 8px;
}
.topic-strip-control {
  display: grid;
  min-width: 44px;
  min-height: 100px;
  place-items: center;
  border: 1px solid var(--line-dark);
  background: #fff;
  color: var(--jade-dark);
  cursor: pointer;
}
.topic-strip-control:hover { border-color: var(--jade); background: var(--jade-pale); }
.topic-strip-control:disabled { cursor: default; opacity: .35; }
.topic-strip-control svg { width: 20px; height: 20px; }
.scenario-topic-tabs {
  display: flex;
  min-width: 0;
  gap: 1px;
  border: 1px solid var(--line-dark);
  background: var(--line);
  direction: ltr;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-behavior: smooth;
  scroll-snap-type: x proximity;
  scrollbar-color: #9ab7ae #e4ebe7;
  scrollbar-width: thin;
}
.scenario-topic-tabs::-webkit-scrollbar { height: 7px; }
.scenario-topic-tabs::-webkit-scrollbar-track { background: #e4ebe7; }
.scenario-topic-tabs::-webkit-scrollbar-thumb { background: #9ab7ae; }
.scenario-topic-tabs::-webkit-scrollbar-thumb:hover { background: var(--jade); }
.scenario-topic-tabs:focus-visible {
  outline: 2px solid var(--jade);
  outline-offset: 2px;
}
.scenario-topic-tab {
  position: relative;
  display: grid;
  min-width: 236px;
  flex: 0 0 clamp(236px, 24vw, 290px);
  min-height: 100px;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  border: 0;
  border-right: 0;
  background: #fff;
  padding: 20px 16px;
  color: var(--ink);
  direction: ltr;
  scroll-snap-align: start;
  text-align: left;
  cursor: pointer;
}
.scenario-topic-tab:last-child { border-right: 0; }
.scenario-topic-tab::after { content: ""; position: absolute; inset: auto 18px 0; height: 3px; background: transparent; }
.scenario-topic-tab:hover { background: #f7faf8; }
.scenario-topic-tab.active { background: var(--jade); color: #fff; }
.scenario-topic-tab.active::after { background: rgba(255,255,255,.85); }
.scenario-topic-tab.active > svg { color: #d8f3ea; }
.scenario-topic-tab.active .scenario-topic-number { color: rgba(255,255,255,.72); }
.scenario-topic-tab.active small { color: rgba(255,255,255,.78); }
.scenario-topic-tab > svg { width: 23px; height: 23px; color: var(--jade); stroke-width: 1.7; }
.scenario-topic-tab.locked { grid-template-columns: auto auto minmax(0, 1fr) auto; background: #f8faf8; color: #536a63; }
.scenario-topic-tab.locked:hover { background: #eef5f1; }
.scenario-topic-tab.locked > svg:not(.topic-lock) { color: #79938a; }
.scenario-topic-tab.locked .topic-lock { width: 15px; color: #91a59f; }
.scenario-topic-tab.locked small { color: #73857f; }
.scenario-topic-number { color: #8aa098; font-family: Georgia, serif; font-size: 12px; }
.scenario-topic-tab > span:last-child { display: grid; min-width: 0; gap: 5px; }
.scenario-topic-tab strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.scenario-topic-tab small { color: var(--muted); font-size: 11px; white-space: nowrap; }
.scenario-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  align-items: start;
  margin-top: 24px;
  border: 1px solid var(--line-dark);
  background: #fff;
}
.scenario-workspace > .dialogue-canvas { min-width: 0; padding: 42px 46px 72px; }
.scenario-workspace .compact-heading { align-items: flex-start; margin-bottom: 28px; }
.scenario-workspace .compact-heading h1 { margin-top: 4px; font-size: 31px; }
.scenario-workspace .compact-heading p:not(.eyebrow) { max-width: 720px; margin-top: 10px; font-size: 15px; line-height: 1.75; }
.content-review-badge { display: inline-flex; min-height: 34px; flex: 0 0 auto; align-items: center; gap: 7px; border: 1px solid #b8d8cf; background: var(--jade-pale); color: var(--jade-dark); padding: 6px 10px; font-size: 11px; font-weight: 700; }
.content-review-badge svg { width: 15px; }
.scenario-workspace .scene-brief { grid-template-columns: auto minmax(0, 1fr) auto; gap: 18px; padding: 21px 22px; }
.scenario-workspace .scene-brief strong { font-size: 13px; }
.scenario-workspace .scene-brief p { font-size: 13px; line-height: 1.7; }
.scenario-workspace .brief-tags { flex-wrap: wrap; justify-content: flex-end; }
.scenario-workspace .brief-tags span { padding: 6px 8px; font-size: 11px; }
.scenario-workspace .dialogue-flow { margin-top: 38px; }
.scenario-workspace .dialogue-toolbar { align-items: center; padding-bottom: 17px; }
.scenario-workspace .dialogue-toolbar h2 { margin-top: 3px; font-size: 22px; }
.dialogue-list { display: grid; }
.scenario-workspace .dialogue-turn { grid-template-columns: 44px minmax(0, 1fr); gap: 18px; padding: 28px 12px; }
.scenario-workspace .dialogue-turn.selected { margin: 10px 0; border: 1px solid #9fcbbf; padding: 28px 18px; box-shadow: 6px 6px 0 var(--jade-pale); }
.scenario-workspace .speaker { width: 42px; height: 42px; font-size: 12px; }
.scenario-workspace .turn-content header strong { font-size: 14px; }
.scenario-workspace .turn-sequence { color: var(--muted); font-size: 11px; }
.scenario-workspace .turn-content header > span { padding: 4px 7px; font-size: 10px; }
.scenario-workspace .turn-content header .icon-button { width: 42px; height: 42px; flex-basis: 42px; }
.scenario-workspace .turn-arabic { margin-top: 10px; font-size: 34px; line-height: 1.85; }
.scenario-workspace .turn-chinese { font-size: 14px !important; line-height: 1.7; }
.scenario-workspace .analysis-link { min-height: 36px; margin-top: 12px; font-size: 12px; }
.scenario-workspace .analysis-link svg { width: 16px; }
.trial-topic-gate {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 26px;
  margin-top: 18px;
  border-top: 2px solid var(--jade);
  border-bottom: 1px solid var(--line-dark);
  background: #f4f9f6;
  padding: 24px 26px;
}
.trial-topic-gate .eyebrow { display: block; margin-bottom: 5px; color: var(--jade); }
.trial-topic-gate h3 { margin: 0; font-family: "STZhongsong", "Songti SC", serif; font-size: 21px; }
.trial-topic-gate p { max-width: 620px; margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.75; }
.trial-topic-gate .primary-button { min-height: 46px; white-space: nowrap; }
.scenario-analysis { margin-top: 54px; border-top: 3px solid var(--jade); padding-top: 26px; scroll-margin-top: 86px; }
.scenario-analysis-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; }
.scenario-analysis-heading h2 { margin: 4px 0 0; font-family: "STZhongsong", "Songti SC", serif; font-size: 25px; }
.scenario-analysis-heading > span { border: 1px solid var(--line-dark); background: #f6f8f6; padding: 6px 9px; color: var(--muted); font-size: 11px; }
.scenario-key-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 22px; margin-top: 21px; border-top: 1px solid var(--line-dark); border-bottom: 1px solid var(--line); background: #f4f9f6; padding: 24px 26px; }
.scenario-key-hero > div { min-width: 0; text-align: right; }
.scenario-key-hero p { margin: 0; font-family: "Noto Naskh Arabic Local", "Traditional Arabic", serif; font-size: 41px; font-weight: 600; line-height: 1.7; }
.scenario-key-hero small { display: block; margin-top: 2px; color: var(--muted); font-size: 14px; }
.scenario-key-hero .icon-button { width: 44px; height: 44px; flex-basis: 44px; color: var(--jade); }
.scenario-analysis-overview { margin: 18px 0 0; color: #35584f; font-size: 14px; line-height: 1.8; }
.scenario-word-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); gap: 10px; margin-top: 20px; }
.scenario-word-card { position: relative; min-width: 0; border: 1px solid var(--line); border-top: 3px solid var(--muted); background: #fff; padding: 14px; }
.scenario-word-card.verb { border-top-color: var(--cinnabar); }
.scenario-word-card.noun { border-top-color: var(--cobalt); }
.scenario-word-card.particle { border-top-color: var(--jade); }
.scenario-word-card.place { border-top-color: var(--brass); }
.scenario-word-card header { display: flex; min-height: 38px; align-items: center; gap: 7px; }
.scenario-word-card header > span { color: var(--muted); font-family: Georgia, serif; font-size: 11px; }
.scenario-word-card header em { flex: 1; color: var(--jade-dark); font-size: 11px; font-style: normal; }
.scenario-word-card header .icon-button { width: 36px; height: 36px; flex-basis: 36px; color: var(--jade); }
.scenario-word-card > p { margin: 12px 0 7px; font-family: "Noto Naskh Arabic Local", "Traditional Arabic", serif; font-size: 29px; font-weight: 600; line-height: 1.65; text-align: right; }
.scenario-word-card > strong { display: block; font-size: 13px; }
.scenario-word-card > small { display: block; margin-top: 8px; color: var(--muted); font-size: 11px; line-height: 1.75; }
.scenario-analysis-foot { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 1px; margin-top: 14px; background: var(--line); }
.scenario-analysis-foot > section { background: #f7f9f7; padding: 22px; }
.scenario-syntax-card > strong { display: block; margin-top: 8px; font-size: 17px; line-height: 1.65; }
.scenario-syntax-card > p:last-child { margin: 13px 0 0; color: var(--muted); font-size: 12px; line-height: 1.8; }
.scenario-grammar-card > div { display: grid; gap: 12px; margin-top: 10px; }
.scenario-grammar-card article { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; }
.scenario-grammar-card article > span { display: grid; width: 28px; height: 28px; place-items: center; border: 1px solid var(--line-dark); color: var(--jade); font-family: Georgia, serif; font-size: 10px; }
.scenario-grammar-card article p { display: grid; gap: 4px; margin: 0; }
.scenario-grammar-card article strong { font-size: 13px; }
.scenario-grammar-card article small { color: var(--muted); font-size: 11px; line-height: 1.7; }
.scenario-workspace > .scenario-rail { display: block; min-width: 0; align-self: start; border-left: 1px solid var(--line-dark); border-bottom: 1px solid var(--line-dark); background: #f2f5f3; padding: 34px 24px; }
.scenario-workspace > .scenario-rail section { margin: 0; border: 0; border-bottom: 1px solid var(--line-dark); background: transparent; padding: 24px 0; }
.scenario-workspace > .scenario-rail section:first-child { padding-top: 0; }
.scenario-workspace > .scenario-rail section:last-child { border-bottom: 0; }
.scenario-workspace > .scenario-rail h2 { font-size: 20px; }
#scenario-outcomes,
#life-outcomes { display: grid; }
#scenario-outcomes > div,
#life-outcomes > div { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px; border-top: 1px solid var(--line); padding: 14px 0; }
#scenario-outcomes > div > span,
#life-outcomes > div > span { display: grid; width: 36px; height: 36px; place-items: center; background: var(--jade-pale); color: var(--jade); }
#scenario-outcomes svg,
#life-outcomes svg { width: 17px; }
#scenario-outcomes p,
#life-outcomes p { display: grid; gap: 3px; margin: 0; }
#scenario-outcomes strong,
#life-outcomes strong { font-size: 13px; }
#scenario-outcomes small,
#life-outcomes small { color: var(--muted); font-size: 11px; line-height: 1.55; }
.scenario-root-title { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin: 12px 0 18px; }
.scenario-root-title b { font-family: "Noto Naskh Arabic Local", "Traditional Arabic", serif; font-size: 35px; font-weight: 600; }
.scenario-root-title span { color: var(--muted); font-size: 12px; }
.scenario-root-derivations { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.scenario-root-derivations button { position: relative; display: grid; min-width: 0; min-height: 102px; gap: 3px; border: 1px solid var(--line); background: #fff; padding: 12px; text-align: center; cursor: pointer; }
.scenario-root-derivations button:hover { border-color: #9fcbbf; background: var(--jade-pale); }
.scenario-root-derivations b { font-family: "Noto Naskh Arabic Local", "Traditional Arabic", serif; font-size: 24px; font-weight: 600; }
.scenario-root-derivations span { color: var(--jade-dark); font-size: 10px; }
.scenario-root-derivations small { color: var(--muted); font-size: 10px; }
.scenario-root-derivations svg { position: absolute; top: 8px; right: 8px; width: 13px; color: var(--jade); }
.scenario-root-panel .full-width { justify-content: center; margin-top: 14px; }
.scenario-content-note { display: flex; align-items: flex-start; gap: 12px; color: #6e5735; }
.scenario-content-note > svg { width: 19px; flex: 0 0 19px; color: var(--brass); }
.scenario-content-note p { display: grid; gap: 5px; margin: 0; }
.scenario-content-note strong { font-size: 13px; }
.scenario-content-note small { color: #766a56; font-size: 11px; line-height: 1.7; }

@media (min-width: 1181px) {
  .scenario-topic-tab {
    min-width: 0;
    flex-basis: calc((100% - 2px) / 3);
  }
}

@media (min-width: 1700px) {
  .scenario-topic-tab { flex-basis: calc((100% - 3px) / 4); }
}

@media (max-width: 1180px) {
  .scenario-library { padding-inline: 28px; }
  .scenario-topic-tab { min-height: 100px; grid-template-columns: auto minmax(0, 1fr); gap: 8px; padding: 16px 12px; }
  .scenario-topic-tab > svg { display: none; }
  .scenario-workspace { grid-template-columns: minmax(0, 1fr) 300px; }
  .scenario-workspace > .dialogue-canvas { padding-inline: 32px; }
  .scenario-workspace > .scenario-rail { padding-inline: 20px; }
}

@media (max-width: 900px) {
  .scenario-library { padding: 28px 18px 76px; }
  .scenario-library-heading { display: grid; gap: 18px; }
  .scenario-library-heading h1 { font-size: 31px; }
  .scenario-library-heading > .access-badge { justify-self: start; }
  .topic-strip-shell { grid-template-columns: minmax(0, 1fr); }
  .topic-strip-control { display: none; }
  .scenario-topic-tab { min-width: 220px; flex-basis: 220px; border-right: 1px solid var(--line); }
  .scenario-topic-tab > svg { display: block; }
  .scenario-workspace { grid-template-columns: minmax(0, 1fr); }
  .scenario-workspace > .dialogue-canvas { padding: 32px 22px 54px; }
  .scenario-workspace .scene-brief { grid-template-columns: auto minmax(0, 1fr); }
  .scenario-workspace .brief-tags { grid-column: 1 / -1; justify-content: flex-start; }
  .scenario-workspace .dialogue-toolbar { align-items: flex-start; flex-direction: column; }
  .scenario-workspace .dialogue-toolbar > div:last-child { display: grid; width: 100%; grid-template-columns: 1fr 1fr; }
  .scenario-workspace .dialogue-toolbar .secondary-button { display: inline-flex; }
  .scenario-analysis-foot { grid-template-columns: 1fr; }
  .scenario-workspace > .scenario-rail { display: block; border-top: 1px solid var(--line-dark); border-left: 0; padding: 30px 22px; }
  .scenario-root-derivations { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
  .scenario-library { padding: 20px 12px 82px; }
  .scenario-library-heading { padding: 0 5px 20px; }
  .scenario-library-heading h1 { font-size: 27px; }
  .scenario-library-heading > div > p:last-child { font-size: 13px; }
  .scenario-topic-tab { min-width: 212px; min-height: 88px; flex-basis: 212px; border: 0; padding: 13px 11px; }
  .scenario-topic-tab > svg { display: block; }
  .scenario-topic-tab strong { font-size: 13px; }
  .scenario-topic-tab small { font-size: 10px; }
  .scenario-workspace { margin-top: 16px; }
  .scenario-workspace > .dialogue-canvas { padding: 26px 14px 46px; }
  .scenario-workspace .compact-heading { display: grid; gap: 13px; }
  .scenario-workspace .compact-heading h1 { font-size: 26px; }
  .content-review-badge { justify-self: start; }
  .scenario-workspace .scene-brief { padding: 17px 14px; }
  .scenario-workspace .dialogue-flow { margin-top: 30px; }
  .scenario-workspace .dialogue-toolbar > div:last-child { grid-template-columns: 1fr; }
  .scenario-workspace .dialogue-turn { grid-template-columns: 38px minmax(0, 1fr); gap: 11px; padding: 25px 2px; }
  .scenario-workspace .dialogue-turn.selected { margin-inline: 0; padding: 24px 10px; box-shadow: 4px 4px 0 var(--jade-pale); }
  .scenario-workspace .speaker { width: 38px; height: 38px; }
  .scenario-workspace .turn-sequence { display: none; }
  .scenario-workspace .turn-arabic { font-size: 29px; line-height: 1.8; }
  .scenario-workspace .turn-chinese { font-size: 13px !important; }
  .trial-topic-gate { grid-template-columns: 1fr; gap: 18px; padding: 21px 17px; }
  .trial-topic-gate h3 { font-size: 20px; }
  .trial-topic-gate .primary-button { width: 100%; justify-content: center; }
  .scenario-analysis { margin-top: 42px; }
  .scenario-analysis-heading { display: grid; }
  .scenario-analysis-heading h2 { font-size: 23px; }
  .scenario-analysis-heading > span { justify-self: start; }
  .scenario-key-hero { gap: 12px; padding: 19px 13px; }
  .scenario-key-hero p { font-size: 33px; }
  .scenario-key-hero small { font-size: 13px; }
  .scenario-word-grid { grid-template-columns: 1fr; }
  .scenario-word-card { padding: 15px; }
  .scenario-word-card > p { font-size: 31px; }
  .scenario-analysis-foot > section { padding: 19px 16px; }
  .scenario-root-derivations { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 1180px) {
  .scenario-topic-tab.locked { grid-template-columns: auto minmax(0, 1fr) auto; }
  .scenario-topic-tab.locked > svg:not(.topic-lock) { display: none; }
  .scenario-topic-tab.locked .topic-lock { display: block; }
}

/* Account-bound AI credit flow */
.access-step[hidden] {
  display: none !important;
}
.access-intro h1 {
  word-break: keep-all;
}
.access-account {
  display: grid;
  gap: 16px;
}
.access-account .signed-account {
  align-items: center;
  margin-bottom: 0;
}
.access-account .signed-account > span {
  min-width: 0;
  flex: 1;
}
.access-account .signed-account strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.access-account .signed-account .text-button {
  flex: 0 0 auto;
}
.access-right-block {
  border: 1px solid var(--line-dark);
  background: #fff;
  padding: 18px;
}
.access-right-block.ai-credit-block {
  border-color: #9fcfc2;
  background: #f5fbf8;
}
.access-right-heading {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}
.access-right-heading > span {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  background: var(--jade-pale);
  color: var(--jade);
}
.access-right-heading svg {
  width: 19px;
}
.access-right-heading h2 {
  margin: 0;
  font-family: inherit;
  font-size: 17px;
}
.access-right-heading > strong {
  color: var(--jade);
  font-size: 13px;
}
.access-right-heading > strong b {
  font-family: Georgia, serif;
  font-size: 23px;
}
.access-right-block > p {
  margin: 12px 0 15px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.75;
}
.access-right-block label {
  margin-bottom: 10px;
}
.access-ledger {
  display: grid;
  gap: 7px;
  margin-top: 13px;
}
.access-ledger-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
  color: var(--muted);
  font-size: 11px;
}
.access-ledger-row strong {
  color: var(--ink);
}
.access-ledger-row .positive {
  color: var(--jade);
}
.access-ledger-row > span {
  display: grid;
  gap: 3px;
}
.access-ledger-row small,
.access-ledger-empty {
  color: var(--muted);
  font-size: 10px;
}
.access-ledger-empty {
  margin: 0;
  border-top: 1px solid var(--line);
  padding-top: 9px;
}
.contact-admin-strip {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line-dark);
  background: #fff;
  padding: 12px 14px;
}
.access-form-panel > .contact-admin-strip {
  margin-top: 16px;
}
.contact-admin-strip > svg {
  width: 19px;
  color: var(--jade);
}
.contact-admin-strip > span {
  display: grid;
  gap: 3px;
}
.contact-admin-strip strong {
  font-size: 12px;
}
.contact-admin-strip small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}
.contact-admin-strip .text-button {
  min-height: 40px;
  white-space: nowrap;
}
.form-note[data-tone="success"],
.ai-control-note[data-tone="success"] {
  color: var(--jade) !important;
}
.form-note[data-tone="warning"],
.ai-control-note[data-tone="warning"] {
  color: #8b5b12 !important;
}
.form-note[data-tone="error"],
.ai-control-note[data-tone="error"] {
  color: #a13e34 !important;
}

/* Lookup AI control and evidence-backed result */
.ai-analysis-control {
  background: #f7faf8;
  border-color: #9fcfc2;
}
.ai-analysis-control > span {
  color: var(--jade);
}
.ai-credit-meter {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 14px;
  border-block: 1px solid var(--line);
  padding: 11px 0;
}
.ai-credit-meter small {
  color: var(--muted);
  font-size: 11px;
}
.ai-credit-meter strong {
  color: var(--jade);
  font-size: 13px;
}
.ai-credit-meter b {
  font-family: Georgia, serif;
  font-size: 25px;
}
.ai-mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 15px 0 10px;
  border: 1px solid var(--line-dark);
}
.ai-mode-switch button {
  min-height: 42px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}
.ai-mode-switch button + button {
  border-left: 1px solid var(--line-dark);
}
.ai-mode-switch button.active {
  background: var(--jade);
  color: #fff;
}
.ai-control-note {
  min-height: 34px;
  margin: 10px 0 0;
  color: var(--muted) !important;
  font-size: 11px !important;
}
.ai-analysis-result {
  border-color: #9fcfc2;
  box-shadow: 7px 7px 0 #e1eee9;
  scroll-margin-top: 88px;
}
.ai-result-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}
.ai-result-heading h2 {
  margin: 4px 0 0;
  font-family: "STZhongsong", "Songti SC", serif;
  font-size: 23px;
}
.ai-source-label {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  border: 1px solid #d59b43;
  background: #fff8ea;
  color: #8b5b12;
  padding: 7px 9px;
  font-size: 11px;
  font-weight: 700;
}
.ai-source-label svg {
  width: 15px;
}
.ai-result-hero {
  display: grid;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding: 22px 0;
}
.ai-result-arabic-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}
.ai-result-arabic {
  margin: 0;
  font-family: "Traditional Arabic", "Noto Naskh Arabic", serif;
  font-size: 35px;
  line-height: 1.7;
  text-align: right;
}
.ai-result-translation {
  margin: 0;
  color: var(--ink-soft);
  font-size: 17px;
}
.ai-result-summary {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.75;
}
.ai-result-section {
  border-bottom: 1px solid var(--line);
  padding: 20px 0;
}
.ai-result-section:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.ai-result-section h3 {
  margin: 0 0 12px;
  font-size: 15px;
}
.ai-word-breakdown {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.ai-word-item,
.ai-info-item,
.ai-example-item {
  border: 1px solid var(--line);
  background: var(--surface-2);
  padding: 12px;
}
.ai-word-item b,
.ai-example-item b {
  display: block;
  font-family: "Traditional Arabic", "Noto Naskh Arabic", serif;
  font-size: 24px;
  text-align: right;
}
.ai-word-audio-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  align-items: center;
  gap: 8px;
}
.ai-word-audio-row .icon-button {
  width: 40px;
  height: 40px;
}
.ai-word-item span,
.ai-word-item small,
.ai-info-item p,
.ai-example-item span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}
.ai-info-list,
.ai-example-list {
  display: grid;
  gap: 8px;
}
.ai-info-item strong {
  font-size: 13px;
}
.ai-caveat {
  border-left: 3px solid #d59b43;
  background: #fff8ea;
  color: #745426;
  padding: 12px 14px;
  font-size: 12px;
  line-height: 1.7;
}
.ai-collocation-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ai-collocation-list span {
  border: 1px solid var(--line-dark);
  background: var(--surface-2);
  padding: 8px 10px;
  font-size: 12px;
}
.ai-result-footer {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  padding-top: 18px;
  color: var(--muted);
}
.ai-result-footer svg {
  width: 18px;
  color: #8b5b12;
}
.ai-result-footer p {
  margin: 0;
  font-size: 11px;
  line-height: 1.7;
}

/* One concise contact flow for permanent and AI codes */
.purchase-options {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}
.purchase-options > div {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 12px;
}
.purchase-options > div > svg {
  width: 18px;
  color: var(--jade);
}
.purchase-options span {
  display: grid;
  gap: 4px;
}
.purchase-options strong,
.payment-panel > strong {
  font-size: 12px;
}
.purchase-options small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}
.payment-panel > strong {
  margin-top: 10px;
}

/* AI credits appear only at AI use points and in the profile screen */
.profile-ai-entry {
  margin-top: 22px;
  border: 1px solid #9fcfc2;
  background: #f5fbf8;
  padding: 16px;
}
.profile-ai-entry > div {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}
.profile-ai-entry > div > span {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  background: var(--jade-pale);
  color: var(--jade);
}
.profile-ai-entry > div svg {
  width: 18px;
}
.profile-ai-entry > div p {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 0;
}
.profile-ai-entry small {
  color: var(--jade);
  font-size: 11px;
  font-weight: 800;
}
.profile-ai-entry strong {
  color: var(--jade);
  font-size: 12px;
}
.profile-ai-entry strong b {
  font-family: Georgia, serif;
  font-size: 23px;
}
.profile-ai-entry > p {
  margin: 13px 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}
.ai-credit-dialog {
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  grid-template-columns: 1.15fr .85fr;
  overflow: auto;
  border: 1px solid var(--line-dark);
  border-radius: 0;
  background: #fff;
  padding: 0;
  color: var(--ink);
  box-shadow: 0 25px 100px rgba(8, 25, 21, .32);
}
.ai-credit-dialog[open] {
  display: grid;
}
.ai-credit-dialog::backdrop {
  background: rgba(16, 33, 31, .62);
  backdrop-filter: blur(3px);
}
.ai-credit-redeem,
.ai-credit-contact {
  padding: 34px;
}
.ai-credit-dialog-heading {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
}
.ai-credit-dialog-heading > span {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  background: var(--jade-pale);
  color: var(--jade);
}
.ai-credit-dialog-heading svg {
  width: 19px;
}
.ai-credit-dialog-heading h2,
.ai-credit-contact h2 {
  margin: 2px 0 0;
  font-family: "STZhongsong", "Songti SC", serif;
  font-size: 24px;
}
.ai-credit-dialog-heading > strong {
  color: var(--jade);
  font-size: 12px;
}
.ai-credit-dialog-heading > strong b {
  font-family: Georgia, serif;
  font-size: 27px;
}
.ai-credit-redeem > p:not(.form-note) {
  margin: 16px 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.75;
}
.ai-credit-redeem label {
  display: grid;
  gap: 7px;
  margin-bottom: 10px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 800;
}
.ai-credit-redeem input {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line-dark);
  background: #fbfcfb;
  padding: 0 12px;
  font-size: 14px;
  outline: 0;
}
.ai-credit-redeem input:focus {
  border-color: var(--jade);
}
.ai-credit-login-required {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 8px 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  padding: 14px;
}
.ai-credit-login-required[hidden],
.ai-credit-redeem-panel[hidden] {
  display: none !important;
}
.ai-credit-login-required > svg {
  width: 19px;
  color: var(--jade);
}
.ai-credit-login-required > span {
  display: grid;
  gap: 3px;
}
.ai-credit-login-required strong {
  font-size: 12px;
}
.ai-credit-login-required small {
  color: var(--muted);
  font-size: 10px;
}
.ai-credit-login-required .primary-button {
  grid-column: 2;
  justify-self: start;
}
.ai-credit-redeem-panel {
  padding-top: 4px;
}
.ai-credit-contact {
  display: grid;
  align-content: center;
  justify-items: center;
  border-left: 1px solid var(--line);
  background: var(--surface-2);
  text-align: center;
}
.ai-credit-contact img {
  width: 150px;
  height: 150px;
  margin: 18px 0 10px;
  border: 1px solid var(--line-dark);
  background: #fff;
  object-fit: contain;
  padding: 6px;
}
.ai-credit-contact > strong {
  font-size: 12px;
}
.ai-credit-contact > p:last-child {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
}

@media (max-width: 520px) {
  .access-right-block { padding: 15px 13px; }
  .access-right-heading { grid-template-columns: 34px minmax(0, 1fr); }
  .access-right-heading > span { width: 34px; height: 34px; }
  .access-right-heading > strong { grid-column: 2; justify-self: start; }
  .access-account .signed-account .text-button {
    min-width: 48px;
    min-height: 40px;
  }
  .contact-admin-strip {
    grid-template-columns: 32px minmax(0, 1fr);
  }
  .contact-admin-strip .text-button {
    grid-column: 2;
    justify-self: start;
  }
  .purchase-dialog .dialog-close {
    width: 40px;
    height: 40px;
  }
  .ai-credit-dialog[open] {
    display: block;
  }
  .ai-credit-dialog .dialog-close {
    width: 40px;
    height: 40px;
  }
  .ai-credit-redeem,
  .ai-credit-contact {
    padding: 28px 18px;
  }
  .ai-credit-dialog-heading {
    grid-template-columns: 36px minmax(0, 1fr);
  }
  .ai-credit-dialog-heading > span {
    width: 36px;
    height: 36px;
  }
  .ai-credit-dialog-heading > strong {
    grid-column: 2;
    justify-self: start;
  }
  .ai-credit-contact {
    border-top: 1px solid var(--line);
    border-left: 0;
  }
  .profile-ai-entry {
    padding: 14px;
  }
  .ai-result-heading { display: grid; }
  .ai-source-label { justify-self: start; }
  .ai-result-arabic { font-size: 30px; }
  .ai-word-breakdown { grid-template-columns: 1fr; }
}

/* UI polish pass: brand cohesion, Arabic readability, scenario navigation and light motion. */
.system-flow button { overflow: hidden; }
.system-flow button::after { content: attr(data-root); position: absolute; right: 10px; bottom: 2px; direction: rtl; color: rgba(8,122,104,.08); font-family: "Noto Naskh Arabic Local", "Traditional Arabic", serif; font-size: 52px; font-weight: 700; letter-spacing: .06em; line-height: 1; pointer-events: none; }
.system-flow em { color: var(--jade); font-size: 18px; }
.system-flow button:hover::after { color: rgba(8,122,104,.14); }
@media (max-width: 900px) { .system-flow button::after { font-size: 42px; } .system-flow em { font-size: 16px; } }
@media (max-width: 520px) { .system-flow button::after { font-size: 38px; } }

.landing-rights dl .featured { position: relative; box-shadow: 8px 8px 0 rgba(8,122,104,.14); }
.landing-rights dl .featured dt::after { content: "永久买断"; display: inline-block; margin-left: 9px; border: 1px solid var(--jade); background: #fff; color: var(--jade-dark); padding: 3px 7px; font-size: 10px; font-weight: 800; letter-spacing: .12em; vertical-align: 2px; }
.landing-rights dl div:not(.featured) { opacity: .82; }
.landing-system { background: #fdfefd radial-gradient(circle at 1px 1px, rgba(16,33,31,.05) 1px, transparent 0); background-size: 22px 22px; }

.rail-legend { display: flex; align-items: center; gap: 5px; margin-left: auto; }
.rail-legend span { padding: 3px 6px; font-size: 11px; }
.rail-legend .verb { background: var(--cinnabar-pale); color: var(--cinnabar); }
.rail-legend .noun { background: var(--cobalt-pale); color: var(--cobalt); }
.rail-legend .particle { background: var(--jade-pale); color: var(--jade); }
.rail-legend .place { background: var(--brass-pale); color: var(--brass); }
@media (max-width: 520px) { .rail-legend { display: none; } }

.keyline-panel { margin-bottom: 12px; border: 1px solid var(--line); background: #fff; padding: 14px; }
.keyline-panel h2 { margin: 0 0 4px; font-family: "STZhongsong", serif; font-size: 18px; }
.keyline-panel .keyline-list { display: grid; }
.keyline-panel button { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 9px; border: 0; border-top: 1px solid var(--line); background: transparent; padding: 9px 0; cursor: pointer; text-align: left; }
.keyline-panel button:hover .keyline-ar { color: var(--jade-dark); }
.keyline-panel .keyline-seq { display: grid; width: 26px; height: 26px; place-items: center; border: 1px solid var(--line-dark); border-radius: 50%; color: var(--muted); font-family: Georgia, serif; font-size: 10px; }
.keyline-panel .keyline-ar { overflow: hidden; font-family: "Noto Naskh Arabic Local", "Traditional Arabic", serif; font-size: 17px; text-align: right; text-overflow: ellipsis; white-space: nowrap; direction: rtl; }
.keyline-panel .keyline-flag { border: 1px solid #a9d5c8; background: var(--jade-pale); color: var(--jade); padding: 2px 5px; font-size: 9px; }
.keyline-panel .keyline-empty { margin: 8px 0 0; color: var(--muted); font-size: 11px; }

@media (prefers-reduced-motion: no-preference) {
  .icon-button, .secondary-button, .hero-audio, .scenario-topic-tab, .keyline-panel button { transition: background-color .16s ease, border-color .16s ease, color .16s ease, transform .16s ease, box-shadow .16s ease; }
  .primary-button:hover, .secondary-button:hover, .icon-button:hover, .hero-audio:hover { transform: translateY(-1px); }
  .primary-button:hover { box-shadow: 0 6px 16px rgba(8,95,83,.22); }
  .word-popover:not([hidden]) { animation: pop-in .14s ease-out both; }
  @keyframes pop-in { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: scale(1); } }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* AI assistance pass: on-demand lookup panel, scenario compose panel and shared result canvas. */
.ai-analysis-control { padding: 0; overflow: hidden; margin-top: 12px; }
.ai-analysis-control[data-state="collapsed"] { border-color: #7fc3b1; background: linear-gradient(90deg, #e3f3ed, #f2faf6); box-shadow: 6px 6px 0 #dcece5; }
.ai-panel-entry { display: flex; width: 100%; min-height: 62px; align-items: center; gap: 12px; border: 0; background: transparent; padding: 14px 18px; color: inherit; cursor: pointer; text-align: left; }
.ai-panel-entry:hover strong { color: var(--jade-dark); }
.ai-panel-entry > svg { width: 20px; height: 20px; flex: 0 0 20px; color: var(--jade); }
.ai-panel-entry > svg:last-child { width: 16px; color: var(--jade-dark); transition: transform .16s ease; }
.ai-panel-entry > span { display: grid; flex: 1; gap: 3px; min-width: 0; color: inherit; }
.ai-panel-entry strong { font-size: 13px; }
.ai-panel-entry small { color: var(--muted); font-size: 11px; }
.ai-analysis-control[data-state="collapsed"] .ai-panel-body { display: none; }
.ai-analysis-control[data-state="expanded"] { box-shadow: 7px 7px 0 #e1eee9; }
.ai-analysis-control[data-state="expanded"] .ai-panel-entry { border-bottom: 1px solid var(--line); }
.ai-analysis-control[data-state="expanded"] .ai-panel-entry > svg:last-child { transform: rotate(180deg); }
.ai-panel-body { padding: 16px 20px 20px; }
.ai-panel-kicker { display: flex; align-items: center; gap: 6px; color: var(--jade); font-size: 12px; font-weight: 800; }
.ai-panel-kicker svg { width: 15px; height: 15px; }

.ai-compose-panel { margin-bottom: 12px; border: 1px solid #9fcfc2; background: #f7faf8; padding: 14px; }
.ai-compose-panel .eyebrow { display: flex; align-items: center; gap: 5px; margin-bottom: 6px; color: var(--jade); }
.ai-compose-panel .eyebrow svg { width: 13px; height: 13px; }
.ai-compose-panel h2 { margin: 0 0 6px; font-family: "STZhongsong", serif; font-size: 18px; }
.ai-compose-desc { margin: 0 0 11px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.ai-compose-panel textarea { width: 100%; min-height: 74px; border: 1px solid var(--line-dark); background: #fff; padding: 9px 10px; font-family: inherit; font-size: 12px; line-height: 1.6; outline: none; resize: vertical; }
.ai-compose-panel textarea:focus { border-color: var(--jade); box-shadow: 0 0 0 2px rgba(8,122,104,.12); }
.ai-compose-meta { display: flex; align-items: center; justify-content: space-between; margin: 8px 0 10px; color: var(--muted); font-size: 11px; }
.ai-compose-meta b { color: var(--jade); font-family: Georgia, serif; font-size: 15px; }
.ai-compose-panel .primary-button { min-height: 44px; }
.ai-compose-panel .ai-control-note { min-height: 0; }
.ai-compose-result { margin-top: 14px; scroll-margin-top: 88px; }
@media (max-width: 520px) {
  .ai-panel-entry strong { font-size: 12px; }
  .ai-compose-panel h2 { font-size: 17px; }
}

/* AI review save button */
.ai-save-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--jade);
  background: #fff;
  color: var(--jade);
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex: 0 0 auto;
}
.ai-save-button:hover { background: var(--jade-pale); }
.ai-save-button.saved { background: var(--jade); color: #fff; }
.ai-save-button svg { width: 14px; height: 14px; stroke-width: 2; }

/* AI badge in review queue */
.risk.ai-badge { background: #ede5f7; color: #5a3b8c; border-color: #c9b3e8; }

/* AI stat card */
.review-ai-stat small { color: #5a3b8c; }
.review-ai-stat strong { color: var(--ink); }

/* Review queue remove button */
.review-queue-remove {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s;
}
.review-queue-item:hover .review-queue-remove { opacity: 1; }
.review-queue-remove:hover { color: var(--cinnabar); }
.review-queue-remove svg { width: 14px; height: 14px; }

/* AI review dialog */
.ai-review-dialog .modal-panel { max-width: 720px; width: 94vw; max-height: 88vh; overflow-y: auto; }
.ai-review-dialog .modal-body { padding: 0; }
.ai-review-dialog .ai-result-heading { border-bottom: 1px solid var(--line); padding: 18px 22px 14px; }
.ai-review-dialog .ai-result-hero,
.ai-review-dialog .ai-result-section { padding: 0 22px; }
.ai-review-dialog .ai-result-footer { padding: 14px 22px; }

@media (max-width: 520px) {
  .ai-save-button { padding: 5px 8px; font-size: 10px; }
  .ai-save-button span { display: none; }
  .ai-review-dialog .modal-panel { width: 98vw; }
  .review-queue-remove { opacity: 1; }
}

/* ---- Trial mode access control ---- */
body.trial-mode .primary-nav .nav-item.is-locked {
  opacity: 0.55;
  cursor: not-allowed;
}
body.trial-mode .primary-nav .nav-item.is-locked:hover {
  background: transparent;
  color: #afbeb8;
}

/* Trial banner */
.trial-banner {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 16px;
  background: #fff8e1;
  border-bottom: 1px solid #f0d070;
  color: #7a5d00;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 30;
}
body.trial-mode .trial-banner {
  display: flex;
}
.trial-banner button {
  border: 1px solid #c9a030;
  background: #fff;
  color: #7a5d00;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.trial-banner button:hover {
  background: #7a5d00;
  color: #fff;
}

/* Hide restricted screen content in trial mode */
body.trial-mode [data-screen-panel="analyzer"].active,
body.trial-mode [data-screen-panel="roots"].active,
body.trial-mode [data-screen-panel="vocabulary"].active,
body.trial-mode [data-screen-panel="lookup"].active,
body.trial-mode [data-screen-panel="review"].active {
  display: none !important;
}
