/* Lingo Copilot CCL — per-language sites. One stylesheet, script-aware via html[data-script]. */
:root {
  --ink: #1E3A5F; --text: #1F2937; --muted: #5C6B7A;
  --teal: #0F766E; --teal-dark: #115E59; --teal-soft: #E7F4F2;
  --paper: #FFFFFF; --panel: #F4F7FA; --panel-2: #E9EFF5; --rule: #D9E0E8;
  --mark: #FFE58F; --mark-soft: #FFF7D9;
  --en: #1E3A5F; --lote: #0F766E;
  --radius: 16px; --radius-sm: 10px;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --lh: 1.75; --measure: 42rem; --wrap: 74rem;
  --shadow: 0 1px 2px rgba(30,58,95,.06), 0 8px 24px -12px rgba(30,58,95,.18);
}
html[data-script="cjk"] { --lh: 1.9; }
html[data-script="indic"] { --lh: 1.95; font-size: 106%; }
html[data-script="thai"] { --lh: 1.95; font-size: 104%; }
html[data-script="arabic"] { --lh: 2; font-size: 104%; }
html[data-script="nastaliq"] { --lh: 2.25; font-size: 112%; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; overflow-x: clip; background: var(--paper); color: var(--text); font-family: var(--font-body); line-height: var(--lh); font-size: 1.0625rem; text-rendering: optimizeLegibility; }
html[data-script="cjk"] body, html[data-script="thai"] body { overflow-wrap: anywhere; line-break: strict; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--teal-dark); text-decoration-thickness: 1px; text-underline-offset: .15em; }
a:hover { color: var(--teal); }
:focus-visible { outline: 3px solid #F59E0B; outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--ink); line-height: 1.25; margin: 0 0 .5em; letter-spacing: -0.005em; overflow-wrap: anywhere; }
/* Nastaliq descends steeply: big headings collide unless the leading is generous and the
   display size is capped. Tuned against ur.ccl.lingo-copilot.com at 1366px and 390px. */
html[data-script="nastaliq"] h1 { line-height: 2.4; font-size: clamp(1.6rem, 1.05rem + 2.2vw, 2.5rem); padding-block: .1em; }
html[data-script="nastaliq"] h2 { line-height: 2.15; font-size: clamp(1.35rem, 1rem + 1.3vw, 1.85rem); }
html[data-script="nastaliq"] h3 { line-height: 1.95; }
html[data-script="nastaliq"] .lead { line-height: 2.2; }
html[data-script="nastaliq"] .marks-facts dt { line-height: 1.4; }
html[data-script="nastaliq"] .btn { padding-block: .95rem; }
html[data-script="nastaliq"] .site-nav a { padding-block: .5rem; }
html[data-script="indic"] h1, html[data-script="indic"] h2, html[data-script="indic"] h3 { line-height: 1.5; padding-block: .05em; }
html[data-script="arabic"] h1, html[data-script="arabic"] h2 { line-height: 1.55; }
html[data-script="thai"] h1, html[data-script="thai"] h2, html[data-script="thai"] h3 { line-height: 1.6; }
h1 { font-size: clamp(2rem, 1.2rem + 3.2vw, 3.25rem); font-weight: 800; }
/* Balanced lines instead of one orphaned word under a long first line. Korean breaks between words,
   Japanese between phrases where the browser supports it; .phrase groups come from headline(). */
h1, h2 { text-wrap: balance; }
html[lang="ko"] h1, html[lang="ko"] h2, html[lang="ko"] h3 { word-break: keep-all; }
html[lang="ja"] h1, html[lang="ja"] h2, html[lang="ja"] h3 { word-break: auto-phrase; }
.phrase { display: inline-block; }
/* CJK glyphs are dense: at the Latin size a Japanese page title holds ~15 characters a line and its
   bracketed part wraps inside itself. */
html[data-script="cjk"] .page-head h1 { font-size: clamp(1.8rem, 1.2rem + 2.2vw, 2.6rem); }
h2 { font-size: clamp(1.55rem, 1.1rem + 1.8vw, 2.2rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 700; font-family: var(--font-body); }
p { margin: 0 0 1em; }
ul, ol { padding-inline-start: 1.4em; margin: 0 0 1em; }
li { margin-bottom: .4em; }
strong { color: var(--ink); }
.skip { position: absolute; inset-inline-start: .5rem; top: -4rem; background: var(--ink); color: #fff; padding: .6rem 1rem; border-radius: 8px; z-index: 100; }
.skip:focus { top: .5rem; }
.container { max-width: var(--wrap); margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2rem); min-width: 0; }
.container.narrow { max-width: 50rem; }
.container.prose > * { max-width: none; }
.measure { max-width: var(--measure); }
.eyebrow { display: inline-flex; align-items: center; gap: .6rem; color: var(--teal-dark); font-weight: 600; font-size: .95rem; margin-bottom: .9rem; }
.eyebrow::before { content: ""; width: 1.6rem; height: 3px; background: var(--teal); border-radius: 2px; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: var(--measure); }
.muted { color: var(--muted); }
.small { font-size: .92rem; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .8rem 1.4rem; border-radius: 999px; font-weight: 600; text-decoration: none; border: 1.5px solid transparent; line-height: 1.3; transition: background .15s, color .15s, border-color .15s, transform .15s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-dark); color: #fff; }
.btn-ghost { border-color: var(--rule); color: var(--ink); background: #fff; }
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); }
.btn-light { background: #fff; color: var(--ink); }
.btn-light:hover { background: var(--teal-soft); color: var(--ink); }
.btn svg { width: 1.1em; height: 1.1em; flex: none; }
html[dir="rtl"] .btn svg.arrow { transform: scaleX(-1); }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.92); backdrop-filter: saturate(160%) blur(10px); border-bottom: 1px solid var(--rule); }
.header-row { display: flex; align-items: center; gap: 1rem; min-height: 4.25rem; position: relative; }
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--ink); }
.brand img { width: 38px; height: 38px; border-radius: 9px; }
.brand-name { font-weight: 700; font-size: 1rem; letter-spacing: .01em; line-height: 1.1; }
.lang-chip { display: inline-block; margin-top: .2rem; font-size: .78rem; font-weight: 600; color: var(--teal-dark); background: var(--teal-soft); border-radius: 999px; padding: .05rem .55rem; }
.site-nav { margin-inline-start: auto; display: flex; align-items: center; gap: .25rem 1.25rem; flex-wrap: wrap; }
.site-nav a { color: var(--ink); text-decoration: none; font-weight: 500; font-size: .98rem; padding: .35rem 0; border-bottom: 2px solid transparent; }
.site-nav a:hover, .site-nav a[aria-current="page"] { border-bottom-color: var(--teal); }
.site-nav .btn { padding: .6rem 1.1rem; font-size: .95rem; }
.site-nav .btn:hover { border-bottom-color: transparent; }
/* `.site-nav a` outranks `.btn-primary`, which painted the header button navy-on-teal (unreadable). */
.site-nav a.btn-primary { color: #fff; font-weight: 700; border-bottom-color: transparent; }
.site-nav a.btn-primary:hover { color: #fff; background: var(--teal-dark); }
.nav-toggle { display: none; }
@media (max-width: 56rem) {
  .site-nav { display: none; }
  .nav-toggle { display: block; margin-inline-start: auto; }
  .nav-toggle summary { list-style: none; cursor: pointer; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--rule); }
  .nav-toggle summary::-webkit-details-marker { display: none; }
  .nav-toggle[open] .site-nav { display: flex; flex-direction: column; align-items: flex-start; position: absolute; inset-inline: 0; top: 100%; background: #fff; border-bottom: 1px solid var(--rule); padding: 1rem clamp(1rem, 4vw, 2rem) 1.25rem; gap: .35rem; box-shadow: var(--shadow); }
  .nav-toggle[open] .site-nav a { font-size: 1.1rem; padding: .5rem 0; }
}

/* Hero: one column, one message, one button */
.hero { background: linear-gradient(180deg, var(--panel) 0%, #fff 100%); border-bottom: 1px solid var(--rule); padding-block: clamp(3rem, 8vw, 6rem); }
.hero-copy { max-width: 50rem; margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2rem); text-align: start; }
.hero h1 { margin-bottom: .5em; font-size: clamp(1.9rem, 1.2rem + 2.6vw, 3rem); }
.hero .lead { font-size: 1.2rem; color: var(--text); max-width: 42rem; }
.cta-row { display: flex; flex-wrap: wrap; gap: .9rem 1.6rem; align-items: center; margin-top: 1.75rem; }

.cta-row .btn-primary { padding: 1rem 1.7rem; font-size: 1.05rem; font-weight: 700; box-shadow: 0 8px 20px -10px rgba(15,118,110,.7); }
.link-arrow { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; color: var(--ink); text-decoration: none; }
.link-arrow:hover { color: var(--teal-dark); text-decoration: underline; }
.link-arrow svg { width: 1.05em; height: 1.05em; }
html[dir="rtl"] .link-arrow svg { transform: scaleX(-1); }
.trust { margin-top: 1rem; font-size: .92rem; color: var(--muted); }

/* Sample dialogue section: explanation beside the rail */
.dialogue-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem; align-items: start; }
@media (min-width: 62rem) { .dialogue-grid { grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 3.5rem; } }
.dialogue-copy .lead { margin-bottom: .8em; }
.rail { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: .75rem; }
.rail-caption { font-size: .9rem; color: var(--muted); margin: 0 0 .75rem; display: flex; align-items: center; gap: .5rem; }
.rail-caption::before { content: ""; width: .55rem; height: .55rem; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 4px var(--teal-soft); flex: none; }
.segment { background: #fff; border: 1px solid var(--rule); border-radius: var(--radius); padding: 1rem 1.1rem; box-shadow: var(--shadow); animation: seg-in .55s ease both; }
.segment:nth-child(2) { animation-delay: .18s; } .segment:nth-child(3) { animation-delay: .36s; } .segment:nth-child(4) { animation-delay: .54s; }
@keyframes seg-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.seg-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .55rem; font-size: .82rem; flex-wrap: wrap; }
.seg-speaker { color: var(--muted); font-weight: 600; }
.dir { display: inline-flex; align-items: center; gap: .35rem; font-weight: 700; border-radius: 999px; padding: .1rem .6rem; letter-spacing: .01em; }
.segment[data-dir="en_to_lote"] .dir { background: #E8EEF6; color: var(--en); }
.segment[data-dir="lote_to_en"] .dir { background: var(--teal-soft); color: var(--lote); }
.seg-source { font-size: 1.02rem; overflow-wrap: anywhere; color: var(--ink); margin: 0 0 .6rem; font-weight: 500; }
.seg-render { margin: 0; padding-inline-start: .85rem; border-inline-start: 3px solid var(--rule); color: var(--muted); font-size: .96rem; }
.segment[data-dir="en_to_lote"] .seg-render { border-color: var(--lote); }
.segment[data-dir="lote_to_en"] .seg-render { border-color: var(--en); }
.seg-en { font-family: "Noto Sans", system-ui, sans-serif; direction: ltr; text-align: left; }

/* Sections */
.section { padding-block: clamp(3rem, 7vw, 5.5rem); }
.section.alt { background: var(--panel); }
.section-head { max-width: var(--measure); margin-bottom: 2rem; }
.section-head .lead { margin-bottom: 0; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; } @media (min-width: 48rem) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.grid-3 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; } @media (min-width: 52rem) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.card { background: #fff; border: 1px solid var(--rule); border-radius: var(--radius); padding: 1.4rem 1.5rem; }
.card h3 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }
.section.alt .card { box-shadow: var(--shadow); border-color: transparent; }
.prose { max-width: var(--measure); }

/* Marks: one shared 0–90 axis. Dialogue bars are half the width of the total bar (45 of 90); the
   teal fill runs from 0 to the mark you must reach (29 per dialogue, 63 overall). */
.marks { background: #fff; border: 1px solid var(--rule); border-radius: var(--radius); padding: 1.5rem 1.5rem 1.25rem; margin: 1.5rem 0; }
.marks-rows { display: grid; gap: 1.1rem; margin-bottom: 1.6rem; }
.marks-row { display: grid; grid-template-columns: minmax(5rem, 9rem) minmax(0, 1fr); gap: 1rem; align-items: center; }
.marks-row-label { font-weight: 600; color: var(--ink); font-size: .95rem; line-height: 1.35; }
.marks-track-wrap { position: relative; direction: ltr; margin-top: 1.4rem; padding-inline-end: 2.8rem; }
.marks-track { position: relative; width: var(--w); height: 1.5rem; background: var(--panel-2); border-radius: 8px; }
.marks-row.total .marks-track { height: 1.8rem; }
.marks-fill { position: absolute; top: 0; bottom: 0; left: 0; width: var(--need); background: linear-gradient(90deg, var(--teal-dark), var(--teal)); border-radius: 8px 0 0 8px; }
.marks-need { position: absolute; left: var(--need); top: -1.55rem; transform: translateX(-50%); background: var(--ink); color: #fff; font-family: var(--font-mono); font-size: .78rem; font-weight: 700; line-height: 1.4; padding: .05rem .5rem; border-radius: 999px; white-space: nowrap; }
.marks-need::after { content: ""; position: absolute; left: 50%; top: 100%; transform: translateX(-50%); border: 5px solid transparent; border-top-color: var(--ink); }
.marks-max { position: absolute; left: calc(100% + .6rem); top: 50%; transform: translateY(-50%); font-family: var(--font-mono); font-size: .85rem; color: var(--muted); white-space: nowrap; }
.marks-axis { display: grid; grid-template-columns: minmax(5rem, 9rem) minmax(0, 1fr); gap: 1rem; }
.marks-axis > div { position: relative; height: 1.2rem; direction: ltr; font-family: var(--font-mono); font-size: .75rem; color: var(--muted); border-top: 1px solid var(--rule); margin-inline-end: 2.8rem; }
.marks-axis > div > span { position: absolute; top: .15rem; transform: translateX(-50%); white-space: nowrap; }
.marks-axis > div > span:first-child { transform: none; }
.marks-axis > div > span:last-child { transform: translateX(-100%); }
.marks-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 1rem; margin: 0; }
.marks-facts div { border-inline-start: 3px solid var(--teal); padding-inline-start: .8rem; }
.marks-facts dt { font-family: var(--font-display); font-size: 1.9rem; font-weight: 800; color: var(--ink); line-height: 1.1; direction: ltr; text-align: start; }
.marks-facts dd { margin: .2rem 0 0; font-size: .9rem; color: var(--muted); }

/* Video facade + list */
.video { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }
@media (min-width: 56rem) { .video { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; } }
.video-facade { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: var(--ink); box-shadow: var(--shadow); }
.video-facade img { width: 100%; height: 100%; object-fit: cover; opacity: .92; }
.video-facade .play { position: absolute; inset: 0; display: grid; place-items: center; }
.video-facade .play span { width: 74px; height: 74px; border-radius: 50%; background: rgba(255,255,255,.95); display: grid; place-items: center; box-shadow: 0 8px 30px rgba(0,0,0,.35); transition: transform .15s; }
.video-facade:hover .play span { transform: scale(1.06); }
.video-facade .play svg { width: 30px; height: 30px; margin-inline-start: 4px; fill: var(--teal-dark); }
.video-facade iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-facade .badge { position: absolute; top: .8rem; inset-inline-start: .8rem; background: rgba(30,58,95,.85); color: #fff; font-size: .78rem; font-weight: 600; padding: .25rem .6rem; border-radius: 999px; }
.video-side h3 { margin-top: 0; }
.video-list { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .35rem; }
.video-list a { display: flex; gap: .6rem; align-items: baseline; text-decoration: none; color: var(--text); padding: .5rem .6rem; border-radius: 8px; border: 1px solid transparent; font-size: .95rem; }
.video-list a:hover { background: var(--panel); border-color: var(--rule); }
.video-list .date { font-size: .8rem; color: var(--muted); flex: none; font-variant-numeric: tabular-nums; direction: ltr; }
.video-links { display: flex; flex-wrap: wrap; gap: .5rem; }
.video-links .btn { padding: .55rem 1rem; font-size: .92rem; }

/* Worked note-taking example */
.notes-example { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; margin: 1.5rem 0; }
.note-card { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; background: #fff; border: 1px solid var(--rule); border-radius: var(--radius); padding: 1.2rem; }
@media (min-width: 56rem) { .note-card { grid-template-columns: 1.2fr .9fr 1.2fr; } }
.note-card .lbl { display: block; font-size: .78rem; font-weight: 700; color: var(--muted); margin-bottom: .4rem; }
.note-heard { font-size: 1rem; color: var(--ink); }
.note-heard .speaker { font-size: .8rem; color: var(--muted); font-weight: 600; display: block; margin-bottom: .2rem; }
.note-pad { font-family: var(--font-mono); font-size: .92rem; white-space: pre-wrap; line-height: 1.7; background: var(--mark-soft); background-image: repeating-linear-gradient(transparent 0 calc(1.7em - 1px), rgba(30,58,95,.12) calc(1.7em - 1px) 1.7em); border-inline-start: 4px solid var(--mark); border-radius: 6px; padding: .5rem .8rem; color: var(--ink); direction: ltr; text-align: left; margin: 0; }
.note-why { font-size: .95rem; color: var(--text); }
.notes-cta { margin-top: 1.5rem; grid-template-columns: minmax(0, 1fr); }
.notes-cta .btn { justify-self: start; }
.article .video { grid-template-columns: minmax(0, 1fr); }
.notes-cta h3 { margin-bottom: .3rem; }
.notes-cta .note { margin-top: 0; }

/* Steps (a real sequence: listen → interpret → score) */
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }
@media (min-width: 52rem) { .steps { grid-template-columns: repeat(3, 1fr); } }
.steps li { counter-increment: step; background: #fff; border: 1px solid var(--rule); border-radius: var(--radius); padding: 1.4rem 1.5rem 1.4rem; position: relative; }
.steps li::before { content: counter(step); display: inline-grid; place-items: center; width: 2.1rem; height: 2.1rem; border-radius: 50%; background: var(--ink); color: #fff; font-weight: 700; font-family: var(--font-mono); margin-bottom: .8rem; }
.steps h3 { margin: 0 0 .4rem; }
.steps p { margin: 0; color: var(--muted); }
.free-box { background: var(--teal-soft); border: 1px solid #CDE7E3; border-radius: var(--radius); padding: 1.5rem; margin-top: 1.5rem; display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; }
@media (min-width: 52rem) { .free-box { grid-template-columns: 1fr auto; align-items: center; } }
.free-box ul { list-style: none; padding: 0; margin: .5rem 0 0; display: grid; gap: .3rem; }
.free-box li { display: flex; gap: .5rem; align-items: baseline; }
.free-box li::before { content: "✓"; color: var(--teal-dark); font-weight: 800; }
.free-box h3 { margin: 0; }
.free-box .note { margin: .6rem 0 0; font-size: .9rem; color: var(--muted); }

/* FAQ */
.faq { max-width: none; }
.faq details { border-top: 1px solid var(--rule); }
.faq details:last-child { border-bottom: 1px solid var(--rule); }
.faq summary { cursor: pointer; list-style: none; padding: 1rem 0; padding-inline-end: 2.2rem; font-weight: 600; color: var(--ink); position: relative; font-size: 1.05rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; inset-inline-end: .2rem; top: .9rem; font-size: 1.4rem; color: var(--teal); font-family: var(--font-mono); }
.faq details[open] summary::after { content: "–"; }
.faq .answer { padding: 0 0 1.1rem; color: var(--text); max-width: 60ch; }
.faq .answer p:last-child { margin-bottom: 0; }

/* CTA band */
.cta-band { background: var(--ink); color: #fff; padding-block: clamp(3rem, 7vw, 5rem); }
.cta-band h2 { color: #fff; }
.cta-band p { color: #D6DEE8; max-width: var(--measure); }
.cta-band .btn-light { margin-top: .75rem; }
.callout { background: var(--panel); border-inline-start: 4px solid var(--teal); border-radius: var(--radius-sm); padding: 1rem 1.2rem; margin: 1.25rem 0; }
.callout-title { font-weight: 700; color: var(--ink); margin: 0 0 .3rem; }
.callout p:last-child { margin-bottom: 0; }
.inline-cta { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; background: var(--teal-soft); border-radius: var(--radius); padding: 1.2rem 1.4rem; margin: 1.5rem 0; }
.inline-cta p { margin: 0; color: var(--ink); font-weight: 500; }

/* Article layout */
.page-head { padding-block: clamp(2.5rem, 5vw, 4rem) 1.5rem; }

.page-head .meta { color: var(--muted); font-size: .9rem; margin-top: 1rem; }
.breadcrumb { font-size: .88rem; color: var(--muted); margin-bottom: 1rem; }
.breadcrumb a { color: var(--muted); }
.breadcrumb span { margin-inline: .4rem; }
.article-layout { padding-block: .5rem clamp(3rem, 6vw, 5rem); }
/* Collapsible table of contents (the 目次 box). Open by default; site.js closes it on narrow screens. */
.toc { border: 1px solid var(--rule); background: var(--panel); border-radius: var(--radius-sm); padding: .85rem 1.2rem; margin: 0 0 2.25rem; }
.toc summary { list-style: none; cursor: pointer; font-weight: 700; color: var(--ink); display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.toc summary::-webkit-details-marker { display: none; }
.toc summary::after { content: ""; width: .5rem; height: .5rem; flex: none; margin-inline-end: .3rem; border-inline-end: 2px solid var(--teal); border-bottom: 2px solid var(--teal); transform: rotate(45deg) translateY(-.15rem); transition: transform .15s; }
.toc[open] summary::after { transform: rotate(-135deg) translateY(-.1rem); }
.toc ol { margin: .8rem 0 .2rem; padding-inline-start: 1.5rem; font-size: .95rem; }
.toc li { margin-bottom: .3rem; }
.toc a { color: var(--ink); text-decoration: none; }
.toc a:hover { color: var(--teal-dark); text-decoration: underline; }
.article { max-width: none; }
.article h2 { margin-top: 2.4em; scroll-margin-top: 5.5rem; padding-top: .2em; }
.article > h2:first-child, .article section:first-child h2 { margin-top: .5em; }
.article h3 { margin-top: 1.6em; }
.table-wrap { overflow-x: auto; margin: 1.2rem 0; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td { text-align: start; padding: .6rem .7rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { color: var(--ink); font-weight: 700; background: var(--panel); }

/* Vocabulary */
.vocab-nav { position: sticky; top: 4.3rem; z-index: 10; background: rgba(255,255,255,.95); backdrop-filter: blur(8px); border-bottom: 1px solid var(--rule); padding: .6rem 0; }
.vocab-nav .row { display: flex; gap: .4rem; overflow-x: auto; scrollbar-width: none; padding-bottom: .1rem; }
.vocab-nav a { flex: none; font-size: .88rem; padding: .3rem .8rem; border-radius: 999px; border: 1px solid var(--rule); color: var(--ink); text-decoration: none; background: #fff; }
.vocab-nav a:hover { border-color: var(--teal); color: var(--teal-dark); }
.vocab-cat { padding-block: 1.5rem; scroll-margin-top: 8rem; }
.vocab-cat h2 { display: flex; align-items: baseline; gap: .7rem; flex-wrap: wrap; }
.vocab-cat h2 .count { font-family: var(--font-body); font-size: .9rem; color: var(--muted); font-weight: 500; }
.vocab-pdf { margin: 1.5rem 0 .5rem; }
.vocab-pdf .note { margin: 0; font-size: 1rem; color: var(--ink); }
.vocab-box { border: 1px solid var(--rule); border-radius: var(--radius-sm); overflow: hidden; }
.vocab-box .table-wrap { margin: 0; }
.vocab-box td:last-child, .vocab-box th:last-child { border-bottom-color: var(--rule); }
.vocab-box tbody tr:last-child td { border-bottom: 0; }
.vocab-more { background: var(--panel); border-top: 1px solid var(--rule); padding: .8rem 1rem; }
.vocab-more a { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; text-decoration: none; }
.vocab-more a:hover { text-decoration: underline; }
.vocab-more svg { width: 1em; height: 1em; }
html[dir="rtl"] .vocab-more svg { transform: scaleX(-1); }
.vocab-cat .cat-intro { color: var(--muted); max-width: var(--measure); }
.vocab-table td:first-child { font-family: "Noto Sans", system-ui, sans-serif; color: var(--ink); font-weight: 600; width: 26%; direction: ltr; }
.vocab-table td:nth-child(2) { font-weight: 600; color: var(--ink); width: 26%; }

/* Footer */
.site-footer { background: var(--panel); border-top: 1px solid var(--rule); padding-block: 3rem 2rem; font-size: .95rem; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem; }
@media (min-width: 48rem) { .footer-grid { grid-template-columns: 1.6fr 1fr 1fr; } }
.site-footer h3 { font-size: .9rem; margin: 0 0 .6rem; color: var(--ink); }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .35rem; }
.site-footer a { color: var(--text); text-decoration: none; }
.site-footer a:hover { color: var(--teal-dark); text-decoration: underline; }
.footer-brand { display: flex; align-items: center; gap: .6rem; margin-bottom: .8rem; color: var(--ink); font-weight: 700; }
.footer-brand img { width: 32px; height: 32px; border-radius: 8px; }
.footer-bottom { margin-top: 2rem; padding-top: 1.2rem; border-top: 1px solid var(--rule); color: var(--muted); font-size: .85rem; }
.footer-bottom p { margin: 0 0 .5rem; max-width: 70ch; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } html { scroll-behavior: auto; } }
@media print { .site-header, .site-footer, .cta-band, .video, .nav-toggle { display: none !important; } }
