@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/Vazirmatn-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/Vazirmatn-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/Vazirmatn-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/Vazirmatn-Black.woff2') format('woff2');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #f4efe4;
  --paper-deep: #ece3d2;
  --card: #fffdf8;
  --ink: #15251f;
  --ink-soft: #33453d;
  --muted: #68736b;
  --line: #ded4c2;
  --line-strong: #c9bda7;
  --teal: #0c3b36;
  --teal-2: #0d7a68;
  --teal-soft: #e2f1ec;
  --saffron: #e9b44c;
  --saffron-soft: #fbf0d7;
  --coral: #d96a52;
  --coral-soft: #fae7e2;
  --plum: #72508f;
  --plum-soft: #eee9f7;
  --blue: #2f66a8;
  --blue-soft: #e6eef9;
  --green: #4f7d38;
  --green-soft: #eaf3e3;
  --shadow-sm: 0 2px 0 rgba(21, 37, 31, .06), 0 8px 22px -14px rgba(21, 37, 31, .28);
  --shadow-md: 0 3px 0 rgba(21, 37, 31, .07), 0 22px 50px -28px rgba(21, 37, 31, .4);
  --radius: 22px;
  --radius-sm: 14px;
  --font: 'Vazirmatn', 'Segoe UI', Tahoma, sans-serif;
  --role-subject: #0d7a68;
  --role-object: #b8730a;
  --role-complement: #72508f;
  --role-predicate: #c25545;
  --role-verb: #2f66a8;
  --role-adverb: #4f7d38;
  --role-adjective: #9a6332;
  --role-possessive: #a8456f;
  --role-appositive: #5c6670;
  --role-conjunct: #7a6a2f;
  --role-preposition: #8a7a67;
  --role-ra: #c25e00;
  --role-other: #8b8377;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 1px 1px, rgba(21, 37, 31, .055) 1px, transparent 0),
    radial-gradient(ellipse 80% 50% at 90% -10%, rgba(233, 180, 76, .18), transparent 60%),
    radial-gradient(ellipse 70% 50% at 0% 20%, rgba(13, 122, 104, .09), transparent 55%);
  background-size: 23px 23px, 100% 100%, 100% 100%;
  line-height: 1.9;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection { background: var(--saffron); color: var(--ink); }

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, textarea, input { font: inherit; }
button { cursor: pointer; }
svg { display: block; }

.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.skip-link {
  position: absolute;
  inset-inline-start: 16px;
  top: -60px;
  z-index: 100;
  background: var(--ink);
  color: #fff;
  padding: .7rem 1.1rem;
  border-radius: 0 0 12px 12px;
  transition: top .2s;
}
.skip-link:focus { top: 0; }

.wrap { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }

h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { line-height: 1.35; font-weight: 900; letter-spacing: -.015em; }

/* ── Header ─────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(244, 239, 228, .86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(201, 189, 167, .65);
}
.header-inner {
  min-height: 74px;
  display: flex;
  align-items: center;
  gap: 28px;
}
.brand { display: inline-flex; align-items: center; gap: 11px; flex-shrink: 0; }
.brand-mark { width: 42px; height: 42px; border-radius: 13px; box-shadow: 0 2px 0 rgba(21,37,31,.15); }
.brand-text { display: flex; flex-direction: column; line-height: 1.3; }
.brand-text strong { font-size: 1.32rem; font-weight: 900; letter-spacing: -.03em; }
.brand-text small { font-size: .68rem; color: var(--muted); letter-spacing: .02em; }

.site-nav { display: flex; align-items: center; gap: 6px; margin-inline-start: 8px; }
.site-nav a {
  position: relative;
  padding: .45rem .75rem;
  border-radius: 10px;
  font-size: .93rem;
  font-weight: 500;
  color: var(--ink-soft);
  transition: background .2s, color .2s;
}
.site-nav a:hover { background: rgba(12, 59, 54, .07); color: var(--teal); }

.header-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 12px; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: .72rem;
  font-weight: 500;
  color: var(--ink-soft);
  background: rgba(255, 253, 248, .72);
  border: 1px solid var(--line);
  padding: .32rem .68rem;
  border-radius: 999px;
  white-space: nowrap;
}
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #b08a3d;
  box-shadow: 0 0 0 3px rgba(176, 138, 61, .14);
}
.status-pill.is-online .status-dot { background: #278a63; box-shadow: 0 0 0 3px rgba(39,138,99,.15); }
.status-pill.is-offline .status-dot { background: #c58a25; box-shadow: 0 0 0 3px rgba(197,138,37,.14); }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
}
.icon-btn:hover { background: var(--saffron-soft); }

.menu-toggle { display: none; }

/* ── Buttons ────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  border-radius: 999px;
  border: 1.5px solid var(--ink);
  background: var(--card);
  color: var(--ink);
  font-weight: 700;
  padding: .66rem 1.2rem;
  line-height: 1.5;
  box-shadow: 0 3px 0 var(--ink);
  transition: transform .15s ease, box-shadow .15s ease, background .2s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 5px 0 var(--ink); }
.btn:active { transform: translateY(1px); box-shadow: 0 2px 0 var(--ink); }
.btn-primary { background: var(--teal); color: #fffdf8; border-color: #082722; box-shadow: 0 3px 0 #082722; }
.btn-primary:hover { box-shadow: 0 5px 0 #082722; background: #104b44; }
.btn-ghost { background: transparent; box-shadow: 0 3px 0 rgba(21,37,31,.28); }
.btn-ghost:hover { box-shadow: 0 5px 0 rgba(21,37,31,.28); background: rgba(255,253,248,.6); }
.btn-light { background: var(--paper); color: var(--teal); border-color: var(--paper); box-shadow: 0 3px 0 rgba(0,0,0,.25); }
.btn-light:hover { box-shadow: 0 5px 0 rgba(0,0,0,.25); }
.btn-sm { padding: .45rem .95rem; font-size: .85rem; box-shadow: 0 2px 0 var(--ink); }
.btn-sm:hover { box-shadow: 0 4px 0 var(--ink); }
.btn-lg { padding: .82rem 1.5rem; font-size: 1rem; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.text-btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: .78rem;
  padding: .2rem .35rem;
  border-radius: 8px;
}
.text-btn:hover { color: var(--teal); background: rgba(12,59,54,.06); }

/* ── Hero ───────────────────────────────────────────── */
.hero { position: relative; padding: 66px 0 34px; overflow: clip; }
.hero-glow {
  position: absolute;
  inset-inline-start: -12%;
  top: 4%;
  width: 620px;
  height: 620px;
  background: radial-gradient(circle, rgba(233, 180, 76, .22), transparent 65%);
  filter: blur(10px);
  pointer-events: none;
}
.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.03fr .97fr;
  gap: 46px;
  align-items: center;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .78rem;
  font-weight: 700;
  color: var(--teal-2);
  background: rgba(13, 122, 104, .08);
  border: 1px solid rgba(13, 122, 104, .18);
  border-radius: 999px;
  padding: .38rem .8rem;
  margin-bottom: 20px;
}
.eyebrow-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--teal-2); }

.hero h1 {
  font-size: clamp(2.7rem, 5.7vw, 5rem);
  line-height: 1.15;
  letter-spacing: -.045em;
  margin-bottom: 20px;
}
.hero h1 .hl {
  position: relative;
  color: var(--teal);
  display: inline-block;
}
.hero h1 .hl::after {
  content: '';
  position: absolute;
  inset-inline: -2%;
  bottom: .02em;
  height: .24em;
  background: var(--saffron);
  border-radius: 99px;
  z-index: -1;
  transform: rotate(-1.2deg);
  opacity: .9;
}
.hero-lead {
  font-size: 1.05rem;
  line-height: 2;
  color: var(--ink-soft);
  max-width: 540px;
}
.hero-lead strong { color: var(--teal); font-weight: 700; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: .82rem;
}
.hero-points li { display: inline-flex; align-items: center; gap: 5px; }
.hero-points svg { color: var(--teal-2); }

.hero-art { position: relative; }
.hero-art-frame {
  position: relative;
  border-radius: 30px;
  overflow: visible;
  border: 1.5px solid var(--line-strong);
  background: var(--paper-deep);
  box-shadow: var(--shadow-md);
  transform: rotate(1.2deg);
}
.hero-art-frame::before {
  content: '';
  position: absolute;
  inset: 10px;
  border: 1px dashed rgba(21, 37, 31, .16);
  border-radius: 22px;
  pointer-events: none;
  z-index: 1;
}
.hero-art-frame img {
  width: 100%;
  aspect-ratio: 1.28 / 1;
  object-fit: cover;
  object-position: 38% center;
  border-radius: 28px;
}
.float-chip {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: .34rem .7rem;
  border-radius: 999px;
  font-size: .74rem;
  font-weight: 700;
  background: var(--card);
  border: 1.5px solid currentColor;
  box-shadow: 0 3px 0 rgba(21, 37, 31, .13);
  animation: floaty 5.5s ease-in-out infinite;
}
.float-chip::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip-subject { color: var(--role-subject); top: 10%; inset-inline-start: -14px; animation-delay: -.2s; }
.chip-object { color: var(--role-object); top: 30%; inset-inline-start: -2px; animation-delay: -1.4s; }
.chip-complement { color: var(--role-complement); bottom: 26%; inset-inline-start: -18px; animation-delay: -2.5s; }
.chip-predicate { color: var(--role-predicate); bottom: 10%; inset-inline-start: 4px; animation-delay: -3.6s; }
@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}
.hero-note {
  position: absolute;
  inset-inline-end: -10px;
  bottom: -24px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: .6rem .85rem;
  font-size: .76rem;
  color: var(--ink-soft);
  box-shadow: var(--shadow-sm);
  transform: rotate(-1deg);
}
.hero-note svg { color: var(--saffron); flex-shrink: 0; }

/* ── Section headings ───────────────────────────────── */
.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 28px;
}
.section-heading.compact { margin-bottom: 22px; }
.section-kicker {
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--teal-2);
  margin-bottom: 7px;
}
.section-kicker.light { color: var(--saffron); }
.section-heading h2, .practice-copy h2, .about-copy h2 {
  font-size: clamp(1.7rem, 3.2vw, 2.5rem);
  letter-spacing: -.03em;
}
.section-sub { max-width: 430px; color: var(--muted); font-size: .9rem; line-height: 1.95; }

/* ── Analyzer ───────────────────────────────────────── */
.analyzer-section { padding: 42px 0 60px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.workbench { padding: 24px 26px 22px; position: relative; }
.workbench-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px dashed var(--line);
  margin-bottom: 18px;
}
.grade-switch {
  display: inline-flex;
  padding: 4px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  gap: 3px;
}
.grade-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: .4rem 1.05rem;
  font-size: .84rem;
  font-weight: 700;
  transition: background .2s, color .2s, box-shadow .2s;
}
.grade-btn:hover { color: var(--ink); }
.grade-btn.is-active {
  background: var(--teal);
  color: #fff;
  box-shadow: 0 2px 0 rgba(0, 0, 0, .18);
}
.engine-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .7rem;
  color: var(--muted);
  background: var(--paper);
  border: 1px solid var(--line);
  padding: .3rem .65rem;
  border-radius: 999px;
}
.engine-badge.is-live { color: var(--teal-2); background: var(--teal-soft); border-color: rgba(13,122,104,.2); }
.engine-badge.is-local { color: #9a6a12; background: var(--saffron-soft); border-color: rgba(185,126,20,.22); }

.input-label {
  display: block;
  font-size: .78rem;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 9px;
}
.input-shell {
  border: 1.5px solid var(--line-strong);
  border-radius: 18px;
  background: #fffefb;
  transition: border-color .2s, box-shadow .2s;
}
.input-shell:focus-within {
  border-color: var(--teal-2);
  box-shadow: 0 0 0 4px rgba(13, 122, 104, .1);
}
#sentence-input {
  display: block;
  width: 100%;
  min-height: 108px;
  resize: vertical;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 16px 18px 8px;
  font-size: 1.18rem;
  line-height: 2;
  color: var(--ink);
}
#sentence-input::placeholder { color: #a99f8e; font-size: 1rem; }
.input-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 14px 10px 18px;
  color: var(--muted);
  font-size: .72rem;
}
.input-meta .text-btn { font-size: .72rem; }

.samples {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.samples-label {
  font-size: .74rem;
  color: var(--muted);
  padding-top: .32rem;
  flex-shrink: 0;
}
.sample-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.sample-chip {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink-soft);
  border-radius: 999px;
  padding: .3rem .72rem;
  font-size: .72rem;
  transition: background .18s, border-color .18s, transform .18s;
}
.sample-chip:hover {
  background: var(--saffron-soft);
  border-color: rgba(185, 126, 20, .35);
  transform: translateY(-1px);
}
.sample-chip:disabled { opacity: .55; cursor: wait; }

.workbench-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px dashed var(--line);
}
.workbench-hint { font-size: .72rem; color: var(--muted); display: flex; align-items: center; gap: 5px; }
kbd {
  display: inline-block;
  padding: .05rem .34rem;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--paper);
  font-family: inherit;
  font-size: .66rem;
}
.btn-analyze { padding-inline: 1.55rem; font-size: .95rem; }
.form-error {
  margin-top: 12px;
  color: #a13a2a;
  background: #fbe9e4;
  border: 1px solid rgba(161, 58, 42, .18);
  border-radius: 10px;
  padding: .55rem .8rem;
  font-size: .78rem;
}

/* ── Result shell ───────────────────────────────────── */
.result-region { margin-top: 24px; }

.empty-report {
  padding: 44px 32px 38px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 0%, rgba(233, 180, 76, .1), transparent 52%),
    var(--card);
  border-style: dashed;
  border-color: var(--line-strong);
}
.empty-illustration {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.empty-token {
  font-size: .78rem;
  font-weight: 700;
  padding: .36rem .8rem;
  border-radius: 999px;
  border: 1px solid currentColor;
  background: var(--card);
  transform: rotate(var(--r, 0deg));
  box-shadow: 0 2px 0 rgba(21,37,31,.08);
}
.t-subject { color: var(--role-subject); --r: -3deg; }
.t-object { color: var(--role-object); --r: 2deg; }
.t-complement { color: var(--role-complement); --r: -1deg; }
.t-predicate { color: var(--role-predicate); --r: 3deg; }
.empty-report h3 { font-size: 1.25rem; margin-bottom: 8px; }
.empty-report p { max-width: 640px; margin-inline: auto; color: var(--muted); font-size: .88rem; }
.empty-hints {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 18px;
  font-size: .74rem;
  color: var(--muted);
}
.empty-hints span { display: inline-flex; align-items: center; gap: 5px; }
.empty-hints svg { color: var(--teal-2); }

/* Loading */
.loading-report { padding: 34px 30px; }
.loading-head { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.loading-spark {
  width: 38px; height: 38px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--teal-soft); color: var(--teal-2);
  animation: pulse 1.5s ease-in-out infinite;
}
.loading-lines { flex: 1; display: grid; gap: 8px; }
.skeleton {
  height: 10px;
  border-radius: 6px;
  background: linear-gradient(90deg, #eee6d7 25%, #f8f3e9 50%, #eee6d7 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
.skeleton.w-40 { width: 40%; }
.skeleton.w-70 { width: 70%; }
.skeleton.w-90 { width: 90%; }
.skeleton.w-55 { width: 55%; }
.skeleton.big { height: 18px; }
.skeleton.tall { height: 74px; border-radius: 12px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.94); opacity: .7; } }
.loading-steps { display: grid; gap: 8px; margin-top: 18px; }
.loading-step {
  display: flex; align-items: center; gap: 8px;
  font-size: .76rem; color: var(--muted);
}
.loading-step::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: var(--line-strong);
}
.loading-step.is-active { color: var(--teal-2); font-weight: 700; }
.loading-step.is-active::before { background: var(--teal-2); box-shadow: 0 0 0 3px rgba(13,122,104,.13); }

/* Report */
.report { animation: rise .35s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.report-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.report-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.report-title h2 { font-size: 1.34rem; }
.report-title .report-stamp {
  font-size: .66rem;
  font-weight: 700;
  color: var(--teal-2);
  background: var(--teal-soft);
  border: 1px solid rgba(13,122,104,.16);
  border-radius: 999px;
  padding: .18rem .55rem;
}
.report-actions { display: flex; align-items: center; gap: 8px; }
.report-actions .text-btn { border: 1px solid var(--line); background: var(--card); padding: .3rem .6rem; }
.report-actions .text-btn:hover { background: var(--paper); }

.source-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .68rem;
  font-weight: 500;
  border-radius: 999px;
  padding: .26rem .62rem;
  border: 1px solid transparent;
  white-space: nowrap;
}
.source-badge svg { width: 14px; height: 14px; }
.source-badge.source-deepseek { background: var(--teal-soft); color: var(--teal-2); border-color: rgba(13,122,104,.18); }
.source-badge.source-sample { background: var(--blue-soft); color: var(--blue); border-color: rgba(47,102,168,.16); }
.source-badge.source-local { background: var(--saffron-soft); color: #92640e; border-color: rgba(185,126,20,.22); }

.report-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
}
.sentence-card {
  background:
    linear-gradient(transparent 0 31px, rgba(201,189,167,.22) 31px 32px) 0 0 / 100% 32px,
    var(--card);
  padding: 24px 26px 22px;
}
.annotated {
  font-size: clamp(1.35rem, 2.5vw, 1.85rem);
  line-height: 2.35;
  font-weight: 500;
  letter-spacing: -.01em;
  word-break: normal;
  overflow-wrap: break-word;
}
.annotated .txt-space { white-space: pre; }
.annotated .tok {
  position: relative;
  display: inline-block;
  padding: 0 .16em;
  margin: 0 .02em;
  border-radius: 7px;
  background: var(--rs, transparent);
  box-shadow: inset 0 -.18em 0 var(--rc, transparent);
  transition: background .16s, box-shadow .16s, transform .16s;
  cursor: pointer;
}
.annotated .tok:hover {
  background: color-mix(in srgb, var(--rc) 18%, transparent);
  transform: translateY(-1px);
}
.annotated .tok.is-active {
  background: color-mix(in srgb, var(--rc) 24%, transparent);
  box-shadow: inset 0 -.2em 0 var(--rc), 0 0 0 2px color-mix(in srgb, var(--rc) 30%, transparent);
}
.annotated .tok[data-role="سایر"] { cursor: default; }
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}
.legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .68rem;
  padding: .22rem .55rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--rc) 25%, var(--line));
  background: var(--rs);
  color: var(--rc);
  font-weight: 700;
  transition: transform .15s;
}
.legend-chip:hover { transform: translateY(-1px); }
.legend-chip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.legend-chip.is-muted { opacity: .35; }
.sentence-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
  color: var(--muted);
  font-size: .7rem;
}
.sentence-toolbar .token-hint { display: inline-flex; align-items: center; gap: 5px; }

.structure-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  margin-top: 14px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}
.structure-cell { background: var(--card); padding: 12px 14px; }
.structure-cell span { display: block; font-size: .66rem; color: var(--muted); margin-bottom: 3px; }
.structure-cell strong { display: block; font-size: .82rem; font-weight: 700; color: var(--ink); line-height: 1.6; }

.report-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.52fr) minmax(280px, .88fr);
  gap: 20px;
  margin-top: 20px;
}
.report-main { display: grid; gap: 14px; align-content: start; }
.report-side { display: grid; gap: 14px; align-content: start; }

.panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .82rem;
  font-weight: 900;
  margin-bottom: 12px;
}
.panel-title svg { color: var(--teal-2); }
.panel-title .count {
  font-size: .64rem;
  color: var(--muted);
  background: var(--paper);
  border-radius: 999px;
  padding: 0 .45rem;
  font-weight: 500;
}

.roles-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.role-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 16px 14px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform .18s, border-color .18s, box-shadow .18s;
}
.role-card::before {
  content: '';
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 4px;
  background: var(--rc);
}
.role-card.is-flash { border-color: var(--rc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--rc) 18%, transparent), var(--shadow-sm); }
.role-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.role-name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--rc);
  font-size: .8rem;
  font-weight: 900;
}
.role-name::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.role-stage {
  font-size: .6rem;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 .4rem;
  background: var(--paper);
}
.role-phrase {
  font-size: 1.16rem;
  font-weight: 900;
  line-height: 1.6;
  color: var(--ink);
  margin-bottom: 7px;
}
.role-reason {
  font-size: .78rem;
  line-height: 1.9;
  color: var(--ink-soft);
  background: color-mix(in srgb, var(--rc) 6%, var(--card));
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 8px;
}
.role-reason b { color: var(--rc); font-weight: 700; }
.role-tip {
  display: flex;
  gap: 7px;
  font-size: .72rem;
  line-height: 1.85;
  color: var(--muted);
  padding: 0 2px;
}
.role-tip svg { width: 15px; height: 15px; color: var(--saffron); flex-shrink: 0; margin-top: 2px; }
.role-conf {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 9px;
  font-size: .62rem;
  color: var(--muted);
}
.conf-dots { display: inline-flex; gap: 2px; }
.conf-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--line-strong); }
.conf-dots i.on { background: var(--rc); }

.summary-card {
  background: linear-gradient(160deg, rgba(13,122,104,.075), rgba(233,180,76,.07)), var(--card);
}
.summary-card p { font-size: .8rem; line-height: 1.95; color: var(--ink-soft); }

.tree { display: grid; gap: 0; font-size: .78rem; }
.tree-node {
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: .36rem 0 .36rem 0;
  border-bottom: 1px dashed rgba(222,212,194,.7);
}
.tree-node:last-child { border-bottom: 0; }
.tree-node .tree-role { color: var(--rc); font-weight: 900; font-size: .68rem; min-width: 58px; }
.tree-node .tree-phrase { color: var(--ink); }
.tree-branch { color: var(--line-strong); font-size: .7rem; }

.clause-list { display: grid; gap: 8px; }
.clause-item {
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 8px 10px;
  background: var(--paper);
}
.clause-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 3px; }
.clause-type { font-size: .62rem; color: var(--teal-2); font-weight: 700; background: var(--teal-soft); border-radius: 999px; padding: 0 .4rem; }
.clause-text { font-size: .78rem; color: var(--ink-soft); }
.clause-note { font-size: .66rem; color: var(--muted); margin-top: 2px; }

.trap-card { background: #fffaf0; border-color: #ecd9b6; }
.trap-list { display: grid; gap: 10px; }
.trap-item { display: flex; gap: 8px; }
.trap-item svg { width: 16px; height: 16px; color: #b07a1c; flex-shrink: 0; margin-top: 3px; }
.trap-item strong { display: block; font-size: .76rem; margin-bottom: 2px; }
.trap-item p { font-size: .72rem; line-height: 1.8; color: var(--ink-soft); }

.engine-note {
  display: flex;
  gap: 8px;
  font-size: .7rem;
  line-height: 1.8;
  color: var(--muted);
  background: var(--paper);
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  padding: 10px 12px;
}
.engine-note svg { width: 15px; height: 15px; color: #b07a1c; flex-shrink: 0; margin-top: 2px; }

/* Mini practice inside report */
.report-practice-card { background: var(--card); }
.mini-quiz { display: grid; gap: 12px; }
.mini-question { font-size: .82rem; font-weight: 700; line-height: 1.8; }
.mini-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.mini-option {
  display: flex;
  align-items: center;
  gap: 7px;
  text-align: start;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink-soft);
  border-radius: 9px;
  padding: .42rem .6rem;
  font-size: .74rem;
  transition: background .15s, border-color .15s;
}
.mini-option:hover:not(:disabled) { border-color: var(--teal-2); background: var(--teal-soft); }
.mini-option .opt-letter {
  width: 18px; height: 18px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--card); border: 1px solid var(--line);
  font-size: .62rem; flex-shrink: 0;
}
.mini-option.is-correct { background: #e4f3e6; border-color: #5b9c64; color: #225b2a; }
.mini-option.is-wrong { background: #fbe8e3; border-color: #cc7b6a; color: #8a3526; }
.mini-option:disabled { cursor: default; }
.mini-feedback {
  font-size: .72rem;
  line-height: 1.85;
  background: var(--paper);
  border-radius: 9px;
  padding: 8px 10px;
  color: var(--ink-soft);
  border-inline-start: 3px solid var(--teal-2);
}
.mini-feedback.is-bad { border-color: var(--coral); }
.mini-next { justify-self: start; font-size: .72rem; }

/* History */
.history-block { margin-top: 26px; }
.history-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.history-head h3 { display: flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--muted); font-weight: 700; }
.history-list { display: flex; flex-wrap: wrap; gap: 8px; }
.history-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: .34rem .7rem;
  font-size: .72rem;
  color: var(--ink-soft);
  max-width: 100%;
  transition: border-color .16s, background .16s;
}
.history-chip:hover { border-color: var(--line-strong); background: var(--saffron-soft); }
.history-chip .hc-grade { color: var(--muted); font-size: .62rem; }
.history-chip .hc-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }

/* ── How section ────────────────────────────────────── */
.how-section { padding: 20px 0 30px; }
.how-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.how-card {
  position: relative;
  background: rgba(255, 253, 248, .66);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px 20px 18px;
  overflow: hidden;
}
.how-card:hover { background: var(--card); }
.how-num {
  position: absolute;
  inset-inline-end: 16px;
  top: 8px;
  font-size: 2.8rem;
  font-weight: 900;
  color: rgba(21, 37, 31, .07);
  line-height: 1;
}
.how-icon {
  width: 42px; height: 42px;
  border-radius: 12px;
  display: grid; place-items: center;
  background: var(--teal-soft);
  color: var(--teal-2);
  margin-bottom: 12px;
}
.how-card:nth-child(2) .how-icon { background: var(--saffron-soft); color: #a06b0e; }
.how-card:nth-child(3) .how-icon { background: var(--coral-soft); color: var(--coral); }
.how-card h3 { font-size: 1rem; margin-bottom: 6px; }
.how-card p { font-size: .78rem; color: var(--muted); line-height: 1.9; }

/* ── Lessons ────────────────────────────────────────── */
.lessons-section { padding: 64px 0; }
.grade-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: rgba(255, 253, 248, .7);
  border: 1px solid var(--line);
  border-radius: 999px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.grade-tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: .42rem 1.15rem;
  font-size: .84rem;
  font-weight: 700;
  transition: background .2s, color .2s;
}
.grade-tab:hover { color: var(--ink); }
.grade-tab.is-active { background: var(--ink); color: var(--paper); }

.lesson-panels { display: grid; gap: 10px; }
.lesson {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  transition: border-color .2s, box-shadow .2s;
}
.lesson[open] { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.lesson summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 18px;
  cursor: pointer;
  user-select: none;
}
.lesson summary::-webkit-details-marker { display: none; }
.lesson-role-dot {
  width: 34px; height: 34px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: var(--rs);
  color: var(--rc);
  font-size: .72rem;
  font-weight: 900;
  flex-shrink: 0;
}
.lesson-title-wrap { flex: 1; min-width: 0; }
.lesson-title-wrap h3 { font-size: .94rem; margin-bottom: 2px; }
.lesson-title-wrap p { font-size: .7rem; color: var(--muted); }
.lesson-chevron { color: var(--muted); transition: transform .2s; flex-shrink: 0; }
.lesson[open] .lesson-chevron { transform: rotate(180deg); }
.lesson-body {
  padding: 0 18px 18px 18px;
  display: grid;
  gap: 14px;
}
.lesson-def {
  font-size: .82rem;
  line-height: 1.95;
  color: var(--ink-soft);
  background: var(--paper);
  border-radius: 10px;
  padding: 10px 12px;
  border-inline-start: 3px solid var(--rc);
}
.signal-row { display: flex; flex-wrap: wrap; gap: 6px; }
.signal {
  font-size: .66rem;
  color: var(--ink-soft);
  background: var(--rs);
  border: 1px solid color-mix(in srgb, var(--rc) 18%, var(--line));
  border-radius: 999px;
  padding: .18rem .55rem;
}
.lesson-examples { display: grid; gap: 7px; }
.lesson-example {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  background: #fffefb;
  border-radius: 11px;
  padding: 9px 11px;
}
.lesson-example .le-text { font-size: .8rem; color: var(--ink); }
.lesson-example .le-note { display: block; font-size: .66rem; color: var(--muted); margin-top: 2px; }
.lesson-example button {
  flex-shrink: 0;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: .22rem .55rem;
  font-size: .64rem;
  color: var(--teal-2);
  transition: background .15s, border-color .15s;
}
.lesson-example button:hover { background: var(--teal-soft); border-color: rgba(13,122,104,.3); }
.lesson-tip {
  display: flex;
  gap: 8px;
  font-size: .74rem;
  line-height: 1.85;
  color: var(--ink-soft);
  background: #fffaf0;
  border: 1px dashed #ecd9b6;
  border-radius: 10px;
  padding: 8px 10px;
}
.lesson-tip svg { width: 15px; height: 15px; color: #b07a1c; flex-shrink: 0; margin-top: 2px; }
.lesson-trap {
  display: flex;
  gap: 8px;
  font-size: .72rem;
  line-height: 1.8;
  color: #8a4030;
  background: #fbeee9;
  border-radius: 10px;
  padding: 8px 10px;
}
.lesson-trap svg { width: 15px; height: 15px; color: var(--coral); flex-shrink: 0; margin-top: 2px; }

/* ── Practice ───────────────────────────────────────── */
.practice-section { padding: 60px 0; }
.practice-grid {
  display: grid;
  grid-template-columns: .85fr 1.15fr;
  gap: 34px;
  align-items: center;
}
.practice-copy p { color: var(--muted); font-size: .88rem; margin-top: 12px; max-width: 420px; }
.practice-points { list-style: none; padding: 0; margin: 18px 0; display: grid; gap: 7px; }
.practice-points li { display: flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--ink-soft); }
.practice-points svg { color: var(--teal-2); }
.practice-grade { display: flex; gap: 6px; flex-wrap: wrap; }
.pill-btn {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  border-radius: 999px;
  padding: .34rem .9rem;
  font-size: .76rem;
  font-weight: 700;
  transition: background .18s, color .18s, border-color .18s;
}
.pill-btn:hover { border-color: var(--line-strong); }
.pill-btn.is-active { background: var(--teal); color: #fff; border-color: var(--teal); }

.quiz-card { padding: 22px 22px 20px; min-height: 340px; display: flex; flex-direction: column; }
.quiz-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.quiz-label { font-size: .74rem; font-weight: 700; color: var(--teal-2); }
.quiz-score { font-size: .7rem; color: var(--muted); background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: .16rem .55rem; }
.quiz-progress { height: 5px; border-radius: 99px; background: var(--paper-deep); margin: 12px 0 18px; overflow: hidden; }
.quiz-progress span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--teal-2), var(--saffron)); transition: width .35s ease; }
.quiz-body { flex: 1; display: flex; flex-direction: column; }
.quiz-topic { font-size: .64rem; color: var(--muted); margin-bottom: 5px; }
.quiz-question { font-size: .92rem; font-weight: 700; line-height: 1.9; margin-bottom: 14px; }
.quiz-options { display: grid; gap: 7px; }
.quiz-option {
  display: flex;
  align-items: center;
  gap: 9px;
  text-align: start;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 11px;
  padding: .52rem .7rem;
  font-size: .78rem;
  color: var(--ink-soft);
  transition: border-color .16s, background .16s, transform .16s;
}
.quiz-option:hover:not(:disabled) { border-color: var(--teal-2); background: var(--teal-soft); transform: translateX(-2px); }
.quiz-option .opt-letter {
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  background: var(--card);
  font-size: .66rem;
  flex-shrink: 0;
}
.quiz-option.is-correct { background: #e4f3e6; border-color: #5b9c64; color: #225b2a; }
.quiz-option.is-wrong { background: #fbe8e3; border-color: #cc7b6a; color: #8a3526; }
.quiz-option:disabled { cursor: default; }
.quiz-feedback { margin-top: 12px; font-size: .74rem; line-height: 1.9; background: var(--paper); border-inline-start: 3px solid var(--teal-2); border-radius: 8px; padding: 8px 10px; color: var(--ink-soft); }
.quiz-feedback.is-bad { border-color: var(--coral); }
.quiz-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; }
.quiz-footer .text-btn { font-size: .7rem; }
.quiz-final { text-align: center; padding: 20px 10px; }
.quiz-final .qf-emoji { font-size: 2.4rem; margin-bottom: 8px; }
.quiz-final h3 { font-size: 1.2rem; margin-bottom: 6px; }
.quiz-final p { font-size: .8rem; color: var(--muted); margin-bottom: 16px; }
.quiz-best { margin-top: 8px; font-size: .68rem; color: var(--muted); }

/* ── About ──────────────────────────────────────────── */
.about-section { padding: 66px 0; }
.about-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 44px; align-items: start; }
.about-copy p { color: var(--muted); font-size: .88rem; margin-top: 14px; }
.about-badges { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 20px; }
.about-badges span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .68rem;
  color: var(--ink-soft);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .3rem .65rem;
}
.about-badges svg { color: var(--teal-2); }
.faq { display: grid; gap: 8px; }
.faq details {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 13px;
  overflow: hidden;
}
.faq summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  cursor: pointer;
  font-size: .82rem;
  font-weight: 700;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary svg { color: var(--muted); transition: transform .2s; flex-shrink: 0; }
.faq details[open] summary svg { transform: rotate(180deg); }
.faq-body { padding: 0 16px 14px; font-size: .78rem; color: var(--muted); line-height: 1.95; }

/* ── CTA band ───────────────────────────────────────── */
.cta-band {
  background:
    radial-gradient(circle at 15% 20%, rgba(233,180,76,.18), transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(217,106,82,.16), transparent 42%),
    var(--teal);
  color: var(--paper);
  padding: 42px 0;
  position: relative;
  overflow: hidden;
}
.cta-band::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,.1) 1px, transparent 0);
  background-size: 22px 22px;
  opacity: .5;
  pointer-events: none;
}
.cta-inner { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.cta-inner h2 { font-size: clamp(1.45rem, 2.8vw, 2.1rem); color: #fffdf8; }
.cta-inner .section-kicker { margin-bottom: 3px; }

/* ── Footer ─────────────────────────────────────────── */
.site-footer { background: #10231e; color: rgba(244,239,228,.72); padding: 46px 0 22px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.2fr; gap: 30px; }
.footer-brand .brand-text strong { color: #fffdf8; }
.footer-brand .brand-text small { color: rgba(244,239,228,.55); }
.footer-brand p { font-size: .76rem; line-height: 1.95; margin: 12px 0 14px; max-width: 300px; color: rgba(244,239,228,.62); }
.preview-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .72rem;
  color: var(--saffron);
  border: 1px solid rgba(233,180,76,.25);
  background: rgba(233,180,76,.07);
  border-radius: 999px;
  padding: .3rem .65rem;
}
.preview-link:hover { background: rgba(233,180,76,.15); }
.footer-col { display: flex; flex-direction: column; gap: 7px; }
.footer-col h4 { font-size: .78rem; color: #fffdf8; margin-bottom: 4px; }
.footer-col a { font-size: .74rem; color: rgba(244,239,228,.68); transition: color .18s; }
.footer-col a:hover { color: var(--saffron); }
.footer-muted { font-size: .68rem; color: rgba(244,239,228,.42); margin-top: 4px; }
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px solid rgba(244,239,228,.12);
  font-size: .68rem;
  color: rgba(244,239,228,.45);
}
.footer-quote { font-style: italic; }

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 1080px) {
  .hero-grid { gap: 32px; }
  .report-grid { grid-template-columns: 1fr; }
  .report-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-side .summary-card { grid-column: 1 / -1; }
  .practice-grid, .about-grid { grid-template-columns: 1fr; gap: 28px; }
  .practice-copy p { max-width: none; }
}

@media (max-width: 900px) {
  .site-nav {
    position: absolute;
    top: calc(100% + 1px);
    inset-inline: 16px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 12px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
  }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: .65rem .75rem; }
  .menu-toggle { display: inline-grid; }
  .header-cta { display: none; }
  .status-pill { display: none; }

  .hero { padding-top: 44px; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-copy { max-width: 660px; }
  .hero-art { max-width: 620px; width: 100%; margin-inline: auto; }
  .hero-art-frame { transform: rotate(.6deg); }
  .hero-lead { max-width: none; }

  .structure-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .how-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .cta-inner { flex-direction: column; align-items: flex-start; }
  .section-heading { flex-direction: column; align-items: flex-start; gap: 10px; }
  .section-sub { max-width: 620px; }
}

@media (max-width: 720px) {
  .wrap { width: min(100% - 28px, 1180px); }
  .header-inner { min-height: 66px; gap: 12px; }
  .brand-text small { display: none; }
  .hero h1 { font-size: clamp(2.25rem, 11vw, 3.2rem); }
  .hero-lead { font-size: .95rem; }
  .hero-actions .btn { width: 100%; }
  .hero-points { font-size: .75rem; }
  .float-chip { font-size: .64rem; padding: .28rem .55rem; }
  .chip-subject { inset-inline-start: -6px; }
  .chip-object { inset-inline-start: 0; }
  .chip-complement { inset-inline-start: -8px; }
  .chip-predicate { inset-inline-start: 2px; }
  .hero-note { inset-inline-end: 4px; bottom: -18px; font-size: .68rem; }

  .workbench { padding: 18px 16px 16px; }
  .workbench-head { flex-direction: column; align-items: flex-start; gap: 10px; }
  .grade-switch { width: 100%; }
  .grade-btn { flex: 1; }
  .engine-badge { align-self: flex-start; }
  #sentence-input { font-size: 1.02rem; min-height: 98px; }
  .samples { gap: 6px; }
  .workbench-foot { flex-direction: column; align-items: stretch; }
  .workbench-foot .btn { width: 100%; }
  .workbench-hint { justify-content: center; order: 2; }

  .empty-report { padding: 30px 18px; }
  .empty-report h3 { font-size: 1.08rem; }
  .report-head { flex-direction: column; align-items: flex-start; }
  .report-actions { width: 100%; }
  .sentence-card { padding: 18px 16px; }
  .annotated { font-size: 1.28rem; line-height: 2.3; }
  .structure-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .structure-cell:last-child { grid-column: 1 / -1; }
  .roles-grid { grid-template-columns: 1fr; }
  .report-side { grid-template-columns: 1fr; }
  .mini-options { grid-template-columns: 1fr; }
  .lesson summary { padding: 12px 12px; gap: 9px; }
  .lesson-body { padding: 0 12px 14px; }
  .lesson-example { flex-direction: column; align-items: flex-start; gap: 6px; }
  .lesson-example button { align-self: flex-start; }
  .quiz-card { padding: 18px 15px; min-height: 320px; }
  .practice-section { padding: 44px 0; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 22px; }
  .footer-bottom { flex-direction: column; text-align: center; gap: 4px; }
  .footer-quote { display: none; }
  .cta-inner .btn { width: 100%; }
  .hero-art-frame img { aspect-ratio: 1.2 / 1; }
}

@media (max-width: 480px) {
  .hero h1 { letter-spacing: -.03em; }
  .hero-actions { gap: 9px; }
  .header-actions { gap: 6px; }
  .history-chip .hc-text { max-width: 170px; }
  .trap-item p, .role-tip { font-size: .7rem; }
  .section-heading h2, .practice-copy h2, .about-copy h2 { font-size: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ── Toast و ریزتنظیم‌های تعاملی ─────────────────────── */
.toast {
  position: fixed;
  inset-inline: 0;
  bottom: 22px;
  z-index: 80;
  width: max-content;
  max-width: min(92vw, 460px);
  margin-inline: auto;
  padding: .62rem 1rem;
  border-radius: 999px;
  background: #10231e;
  color: var(--paper);
  font-size: .76rem;
  line-height: 1.7;
  box-shadow: 0 18px 38px -18px rgba(0, 0, 0, .65);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.toast.is-show { opacity: 1; transform: none; }
.lesson-example button { display: inline-flex; align-items: center; gap: 4px; }
.lesson-role-dot { overflow: hidden; }
@media (max-width: 560px) {
  .toast { bottom: 14px; font-size: .72rem; }
}
