/* زبان فرانسه — طراحی «پاریس پشت شیشه»
   لایه‌ها: آسمان رنگی محو در پس‌زمینه + پنل‌های شیشه‌ای مات + طلایی خروس به‌عنوان تنها رنگ تأکید */
:root {
  --bg: #E7ECF5;
  --bg-2: #F5F1E8;
  --orb-1: rgba(226, 178, 74, 0.55);
  --orb-2: rgba(74, 112, 214, 0.42);
  --orb-3: rgba(214, 120, 120, 0.30);
  --glass: rgba(255, 255, 255, 0.52);
  --glass-strong: rgba(255, 255, 255, 0.74);
  --glass-hover: rgba(255, 255, 255, 0.66);
  --glass-border: rgba(255, 255, 255, 0.85);
  --edge: rgba(16, 30, 64, 0.10);
  --shadow: 0 10px 40px -12px rgba(22, 38, 84, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  --ink: #101C3A;
  --ink-2: #3B4865;
  --ink-3: #6A7593;
  --gold: #A9771B;
  --gold-2: #D7A944;
  --gold-soft: rgba(201, 152, 46, 0.16);
  --on-gold: #1A1204;
  --blue: #2F55B5;
  --blue-soft: rgba(47, 85, 181, 0.12);
  --ok: #23845A;
  --ok-soft: rgba(35, 132, 90, 0.13);
  --bad: #BE4430;
  --bad-soft: rgba(190, 68, 48, 0.12);
  --warn: #A8740F;
  --warn-soft: rgba(168, 116, 15, 0.14);
  --lv-silver: #7C8798;
  --lv-bronze: #A8673A;
  --lv-blue: #3360C4;
  --lv-gold: #B88A21;
  --lv-green: #2B8C63;
  --font-fa: "Vazirmatn", "Tahoma", system-ui, sans-serif;
  --font-fr: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --font-display: "Fraunces", "Georgia", serif;
  --r-lg: 24px;
  --r-md: 16px;
  --r-sm: 11px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #060B1C; --bg-2: #0B1431;
    --orb-1: rgba(226, 178, 74, 0.30); --orb-2: rgba(60, 98, 220, 0.38); --orb-3: rgba(190, 80, 110, 0.22);
    --glass: rgba(255, 255, 255, 0.055); --glass-strong: rgba(255, 255, 255, 0.10); --glass-hover: rgba(255, 255, 255, 0.09);
    --glass-border: rgba(255, 255, 255, 0.13); --edge: rgba(255, 255, 255, 0.09);
    --shadow: 0 14px 44px -14px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    --ink: #F3EFE6; --ink-2: #C6CCDD; --ink-3: #8D96B0;
    --gold: #E6BD5C; --gold-2: #F5D686; --gold-soft: rgba(230, 189, 92, 0.15); --on-gold: #1A1204;
    --blue: #8DA9F5; --blue-soft: rgba(141, 169, 245, 0.14);
    --ok: #63CF9F; --ok-soft: rgba(99, 207, 159, 0.14); --bad: #F2846D; --bad-soft: rgba(242, 132, 109, 0.14);
    --warn: #F0BF5A; --warn-soft: rgba(240, 191, 90, 0.14);
    --lv-silver: #B5BFCF; --lv-bronze: #D9925C; --lv-blue: #7FA0F2; --lv-gold: #EBC15F; --lv-green: #5FCB9A;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #060B1C; --bg-2: #0B1431;
  --orb-1: rgba(226, 178, 74, 0.30); --orb-2: rgba(60, 98, 220, 0.38); --orb-3: rgba(190, 80, 110, 0.22);
  --glass: rgba(255, 255, 255, 0.055); --glass-strong: rgba(255, 255, 255, 0.10); --glass-hover: rgba(255, 255, 255, 0.09);
  --glass-border: rgba(255, 255, 255, 0.13); --edge: rgba(255, 255, 255, 0.09);
  --shadow: 0 14px 44px -14px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  --ink: #F3EFE6; --ink-2: #C6CCDD; --ink-3: #8D96B0;
  --gold: #E6BD5C; --gold-2: #F5D686; --gold-soft: rgba(230, 189, 92, 0.15); --on-gold: #1A1204;
  --blue: #8DA9F5; --blue-soft: rgba(141, 169, 245, 0.14);
  --ok: #63CF9F; --ok-soft: rgba(99, 207, 159, 0.14); --bad: #F2846D; --bad-soft: rgba(242, 132, 109, 0.14);
  --warn: #F0BF5A; --warn-soft: rgba(240, 191, 90, 0.14);
  --lv-silver: #B5BFCF; --lv-bronze: #D9925C; --lv-blue: #7FA0F2; --lv-gold: #EBC15F; --lv-green: #5FCB9A;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-fa);
  font-size: 15.5px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 50; background: var(--bg); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--blue); }
::selection { background: var(--gold-soft); }

/* ── آسمان پس‌زمینه ── */
.sky { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: linear-gradient(160deg, var(--bg) 0%, var(--bg-2) 100%); pointer-events: none; }
.orb { position: absolute; border-radius: 50%; filter: blur(70px); will-change: transform; }
.orb.o1 { width: 46vmax; height: 46vmax; background: var(--orb-1); top: -14vmax; inset-inline-start: -10vmax; animation: drift1 26s ease-in-out infinite alternate; }
.orb.o2 { width: 52vmax; height: 52vmax; background: var(--orb-2); bottom: -22vmax; inset-inline-end: -14vmax; animation: drift2 32s ease-in-out infinite alternate; }
.orb.o3 { width: 30vmax; height: 30vmax; background: var(--orb-3); top: 38%; inset-inline-start: 40%; animation: drift3 22s ease-in-out infinite alternate; }
.sky::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(var(--edge) 1px, transparent 1px); background-size: 26px 26px; opacity: .55; mask-image: linear-gradient(to bottom, #000 0%, transparent 70%); -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 70%); }
@keyframes drift1 { to { transform: translate(8vmax, 6vmax) scale(1.08); } }
@keyframes drift2 { to { transform: translate(-6vmax, -8vmax) scale(1.12); } }
@keyframes drift3 { to { transform: translate(-10vmax, 4vmax) scale(.9); } }
@media (prefers-reduced-motion: reduce) { .orb { animation: none; } * { transition-duration: 0s !important; animation-duration: 0s !important; } }

/* ── شیشه ── */
.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(22px) saturate(165%);
  backdrop-filter: blur(22px) saturate(165%);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}
.glass-strong { background: var(--glass-strong); }

/* ── چیدمان ── */
.app { position: relative; z-index: 1; display: grid; grid-template-columns: 264px minmax(0, 1fr); gap: 22px; min-height: 100vh; padding-block: 22px; padding-left: max(18px, env(safe-area-inset-left, 0px)); padding-right: max(18px, env(safe-area-inset-right, 0px)); max-width: 1320px; margin: 0 auto; }
.sidebar { position: sticky; top: calc(22px + env(safe-area-inset-top, 0px)); align-self: start; padding: 22px 16px; display: flex; flex-direction: column; gap: 18px; max-height: calc(100vh - 44px); }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 6px; text-decoration: none; color: var(--ink); }
.brand img { width: 46px; height: 46px; filter: drop-shadow(0 4px 10px rgba(169, 119, 27, .35)); }
.brand b { display: block; font-size: 1.22rem; font-weight: 800; line-height: 1.2; }
.brand small { display: block; font-family: var(--font-display); font-style: italic; color: var(--gold); font-size: .92rem; direction: ltr; text-align: end; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 14px; color: var(--ink-2); text-decoration: none; font-weight: 500; transition: background .2s, color .2s; }
.nav a svg { width: 20px; height: 20px; flex: none; }
.nav a:hover { background: var(--glass-hover); color: var(--ink); }
.nav a.active { background: var(--gold-soft); color: var(--ink); box-shadow: inset 0 0 0 1px var(--gold-soft); }
.nav a.active svg { color: var(--gold); }
.side-foot { margin-top: auto; padding: 12px; border-radius: var(--r-md); background: var(--glass); border: 1px solid var(--edge); font-size: .85rem; color: var(--ink-3); }
.side-foot b { color: var(--ink); }

main { min-width: 0; display: flex; flex-direction: column; gap: 20px; padding-bottom: 40px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 6px 4px 0; }
.page-head h1 { margin: 0; font-size: clamp(1.5rem, 2.6vw, 2.1rem); font-weight: 800; line-height: 1.3; text-wrap: balance; }
.page-head .sub { color: var(--ink-3); margin: 2px 0 0; }
.eyebrow { font-size: .78rem; font-weight: 700; letter-spacing: .02em; color: var(--gold); }
.fr-tag { font-family: var(--font-display); font-style: italic; color: var(--gold); direction: ltr; unicode-bidi: isolate; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: start; }
.card { padding: 22px; min-width: 0; }
.card h2, .card h3 { margin: 0 0 10px; line-height: 1.4; text-wrap: balance; }
.card h2 { font-size: 1.18rem; font-weight: 800; }
.card h3 { font-size: 1.02rem; font-weight: 700; }
.muted { color: var(--ink-3); }
.small { font-size: .86rem; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.divider { height: 1px; background: var(--edge); margin: 14px 0; border: 0; }
.num { font-variant-numeric: tabular-nums; }

/* ── فرانسه ── */
.fr { direction: ltr; unicode-bidi: isolate; font-family: var(--font-fr); text-align: left; }
span.fr { display: inline-block; }
.fr-big { font-family: var(--font-display); font-weight: 600; font-size: 1.5rem; line-height: 1.3; }
.tr { color: var(--ink-3); font-size: .92rem; display: block; }
body.mode-help .tr { display: none; }
body.mode-help .reveal.open .tr { display: block; }
body.mode-help .reveal { cursor: pointer; }
body.mode-fr .tr, body.mode-fr .fa-only { display: none !important; }
body:not(.mode-both) .both-only { display: none !important; }
body.mode-both .fr-help-only { display: none; }

/* ── دکمه‌ها ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 999px; border: 1px solid transparent; cursor: pointer; font-weight: 700; text-decoration: none; transition: transform .15s, box-shadow .2s, background .2s; white-space: nowrap; }
.btn svg { width: 18px; height: 18px; }
.btn:active { transform: scale(.97); }
.btn-gold { background: linear-gradient(135deg, var(--gold-2), var(--gold)); color: var(--on-gold); box-shadow: 0 8px 22px -8px rgba(169, 119, 27, .6), inset 0 1px 0 rgba(255,255,255,.45); }
.btn-gold:hover { box-shadow: 0 10px 28px -8px rgba(169, 119, 27, .75), inset 0 1px 0 rgba(255,255,255,.5); }
.btn-ghost { background: var(--glass); border-color: var(--glass-border); color: var(--ink); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.btn-ghost:hover { background: var(--glass-hover); }
.btn-sm { padding: 6px 12px; font-size: .86rem; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center; border: 1px solid var(--glass-border); background: var(--glass); cursor: pointer; color: var(--ink); flex: none; transition: background .2s, transform .15s; }
.icon-btn:hover { background: var(--gold-soft); color: var(--gold); }
.icon-btn:active { transform: scale(.94); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn.sm { width: 32px; height: 32px; }
.icon-btn.sm svg { width: 15px; height: 15px; }
.icon-btn.rec { color: var(--bad); }
.icon-btn.recording { background: var(--bad); color: #fff; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px var(--bad-soft); } }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ── چیپ وضعیت ── */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: var(--glass-strong); border: 1px solid var(--edge); color: var(--ink-2); white-space: nowrap; }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .85; }
.chip.plain::before { display: none; }
.chip.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.chip.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.chip.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.chip.gold { background: var(--gold-soft); color: var(--gold); border-color: transparent; }
.chip.blue { background: var(--blue-soft); color: var(--blue); border-color: transparent; }
.lv { display: inline-grid; place-items: center; min-width: 46px; height: 30px; padding: 0 10px; border-radius: 10px; font-family: var(--font-display); font-weight: 700; font-size: .98rem; color: #fff; direction: ltr; }
.lv.silver { background: linear-gradient(135deg, #B9C2D0, #6F7A8D); }
.lv.bronze { background: linear-gradient(135deg, #D59A66, #8F5229); }
.lv.blue { background: linear-gradient(135deg, #7F9EF0, #2C4FAE); }
.lv.gold { background: linear-gradient(135deg, #F2D27E, #A97A17); color: #241603; }
.lv.green { background: linear-gradient(135deg, #6ED3A4, #237A54); }

/* ── پیشرفت ── */
.bar { height: 8px; border-radius: 99px; background: var(--edge); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--gold-2), var(--gold)); transition: width .6s; }
.ring { --p: 0; --s: 76px; width: var(--s); height: var(--s); border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--gold) calc(var(--p) * 1%), var(--edge) 0); position: relative; flex: none; }
.ring::before { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: var(--glass-strong); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.ring b { position: relative; font-size: 1rem; font-weight: 800; }

/* ── هیرو امروز ── */
.hero { padding: 26px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 22px; align-items: center; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; inset-inline-end: -60px; top: -60px; width: 240px; height: 240px; background: url("../assets/logo.svg") no-repeat center / contain; opacity: .09; pointer-events: none; }
.hero h2 { font-size: clamp(1.25rem, 2.2vw, 1.6rem); margin: 4px 0 6px; font-weight: 800; }
.countdown { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; letter-spacing: .02em; font-variant-numeric: tabular-nums; color: var(--gold); line-height: 1.1; }
.timeline { display: flex; flex-direction: column; gap: 10px; }
.slot { display: grid; grid-template-columns: 74px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 14px; border-radius: var(--r-md); background: var(--glass); border: 1px solid var(--edge); text-decoration: none; color: inherit; transition: background .2s, transform .2s; }
a.slot:hover { background: var(--glass-hover); transform: translateY(-1px); }
.slot .time { font-weight: 800; font-variant-numeric: tabular-nums; font-size: .95rem; line-height: 1.3; }
.slot .time small { display: block; color: var(--ink-3); font-weight: 500; }
.slot .t { font-weight: 700; line-height: 1.45; }
.slot .t small { display: block; color: var(--ink-3); font-weight: 400; }

/* ── تقویم ── */
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.seg { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--glass); border: 1px solid var(--edge); gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 14px; border-radius: 999px; cursor: pointer; font-weight: 600; color: var(--ink-2); }
.seg button.on { background: var(--glass-strong); color: var(--ink); box-shadow: 0 2px 8px -2px rgba(0,0,0,.15); }
.week-grid { display: grid; grid-template-columns: repeat(7, minmax(120px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.day-col { min-height: 240px; padding: 10px; border-radius: var(--r-md); background: var(--glass); border: 1px solid var(--edge); display: flex; flex-direction: column; gap: 8px; }
.day-col.today { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.day-col.off { opacity: .6; }
.day-col h4 { margin: 0; font-size: .9rem; display: flex; justify-content: space-between; gap: 6px; }
.day-col h4 small { color: var(--ink-3); font-weight: 500; }
.ev { display: block; padding: 8px 10px; border-radius: 12px; font-size: .82rem; line-height: 1.45; text-decoration: none; color: var(--ink); border-inline-start: 3px solid var(--gold); background: var(--glass-strong); }
.ev.drive { border-inline-start-color: var(--lv-green); }
.ev.quiz { border-inline-start-color: var(--blue); }
.ev b { display: block; font-variant-numeric: tabular-nums; }
.ev .chip { margin-top: 4px; }
.month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.month-grid .dow { text-align: center; font-size: .78rem; font-weight: 700; color: var(--ink-3); padding: 4px 0; }
.mcell { min-height: 74px; padding: 6px; border-radius: 12px; background: var(--glass); border: 1px solid var(--edge); font-size: .82rem; display: flex; flex-direction: column; gap: 4px; }
.mcell.dim { opacity: .35; }
.mcell.today { border-color: var(--gold); }
.mcell .dots { display: flex; gap: 3px; flex-wrap: wrap; }
.mcell .dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }
.mcell .dots i.ok { background: var(--ok); } .mcell .dots i.bad { background: var(--bad); } .mcell .dots i.warn { background: var(--warn); } .mcell .dots i.drive { background: var(--lv-green); }

/* ── کارت مسیرها ── */
.track-card { padding: 22px; display: flex; flex-direction: column; gap: 12px; text-decoration: none; color: inherit; transition: transform .25s, box-shadow .25s; position: relative; overflow: hidden; }
.track-card:hover { transform: translateY(-3px); }
.track-card .big { font-family: var(--font-display); font-size: 3rem; font-weight: 700; line-height: 1; direction: ltr; text-align: end; opacity: .14; position: absolute; inset-inline-start: 18px; bottom: 6px; }
.facts { display: flex; gap: 14px; flex-wrap: wrap; font-size: .86rem; color: var(--ink-2); }
.facts span b { color: var(--ink); }

/* ── درس ── */
.lesson-wrap { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 18px; align-items: start; }
.steps { padding: 14px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: calc(22px + env(safe-area-inset-top, 0px)); }
.step-link { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 12px; border: 0; background: transparent; cursor: pointer; text-align: start; color: var(--ink-2); }
.step-link .dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--edge); font-size: .8rem; font-weight: 800; }
.step-link.on { background: var(--gold-soft); color: var(--ink); }
.step-link.on .dot { border-color: var(--gold); color: var(--gold); }
.step-link.done .dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.step-link small { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.timer-bar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.timer-bar .clock { font-weight: 800; font-variant-numeric: tabular-nums; font-size: 1.15rem; min-width: 64px; }
.timer-bar .bar { flex: 1; }
.vocab-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.vcard { padding: 14px; border-radius: var(--r-md); background: var(--glass); border: 1px solid var(--edge); display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.vcard .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.vcard .w { font-family: var(--font-display); font-size: 1.22rem; font-weight: 600; line-height: 1.3; word-break: break-word; }
.vcard .ph { color: var(--gold); font-weight: 600; font-size: .9rem; }
.vcard .m { font-weight: 600; }
.vcard .ex { font-size: .86rem; color: var(--ink-2); border-top: 1px dashed var(--edge); padding-top: 6px; }
.g-m, .g-f { font-size: .7rem; font-weight: 800; padding: 1px 7px; border-radius: 6px; }
.g-m { background: var(--blue-soft); color: var(--blue); }
.g-f { background: var(--bad-soft); color: var(--bad); }
.gram-table { width: 100%; border-collapse: separate; border-spacing: 0; border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--edge); font-size: .94rem; }
.gram-table th { background: var(--gold-soft); font-weight: 800; text-align: start; padding: 9px 12px; }
.gram-table td { padding: 8px 12px; border-top: 1px solid var(--edge); background: var(--glass); }
.table-wrap { overflow-x: auto; }
.dlg { display: flex; flex-direction: column; gap: 10px; }
.line { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 10px 14px; border-radius: var(--r-md); background: var(--glass); border: 1px solid var(--edge); transition: background .3s, border-color .3s; }
.line.speaking { background: var(--gold-soft); border-color: var(--gold); }
.line .who { font-weight: 800; font-size: .82rem; color: var(--gold); padding-top: 3px; max-width: 120px; direction: ltr; }
.line .fr { font-size: 1.05rem; }
.callout { padding: 14px 16px; border-radius: var(--r-md); background: var(--blue-soft); border: 1px solid var(--edge); }
.callout.gold { background: var(--gold-soft); }
.break-box { text-align: center; padding: 40px 20px; }
.break-box .countdown { font-size: 3.4rem; }

/* ── تمرین و آزمون ── */
.q { padding: 16px; border-radius: var(--r-md); background: var(--glass); border: 1px solid var(--edge); display: flex; flex-direction: column; gap: 10px; }
.q .qh { display: flex; gap: 10px; align-items: flex-start; }
.q .qn { flex: none; width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold); font-weight: 800; font-size: .85rem; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { padding: 8px 16px; border-radius: 12px; border: 1px solid var(--edge); background: var(--glass-strong); cursor: pointer; font-weight: 600; transition: background .15s, border-color .15s; }
.opt:hover { border-color: var(--gold); }
.opt.sel { border-color: var(--gold); background: var(--gold-soft); }
.opt.right { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); }
.opt.wrong { border-color: var(--bad); background: var(--bad-soft); color: var(--bad); }
textarea, input[type="text"], input[type="time"], input[type="date"], input[type="search"], select {
  width: 100%; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--edge); background: var(--glass-strong); outline: none;
}
textarea { min-height: 96px; resize: vertical; }
textarea:focus, input:focus, select:focus { border-color: var(--gold); }
.model { padding: 10px 14px; border-radius: 12px; background: var(--ok-soft); white-space: pre-line; }
.result-box { padding: 22px; text-align: center; }
.score-big { font-size: 3rem; font-weight: 800; color: var(--gold); line-height: 1.1; font-variant-numeric: tabular-nums; }
.exam-section-title { display: flex; align-items: center; gap: 10px; font-weight: 800; margin-top: 8px; }
.rubric { display: flex; flex-direction: column; gap: 6px; }
.rubric label { display: flex; gap: 8px; align-items: center; cursor: pointer; }

/* ── واژه‌نامه ── */
.dict-tools { display: grid; grid-template-columns: minmax(0, 1fr) 200px auto; gap: 10px; align-items: center; }
.dict-list { display: flex; flex-direction: column; gap: 8px; }
.drow { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 16px; border-radius: var(--r-md); background: var(--glass); border: 1px solid var(--edge); }
.drow .w { font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; }
.drow .ph { color: var(--gold); font-size: .88rem; font-weight: 600; }
.drow .ex { grid-column: 1 / -1; font-size: .86rem; color: var(--ink-2); border-top: 1px dashed var(--edge); padding-top: 6px; display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.flash { perspective: 1200px; }
.flash-inner { position: relative; min-height: 230px; transition: transform .6s; transform-style: preserve-3d; cursor: pointer; }
.flash.flipped .flash-inner { transform: rotateY(180deg); }
.flash-face { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 24px; border-radius: var(--r-lg); background: var(--glass-strong); border: 1px solid var(--glass-border); backface-visibility: hidden; -webkit-backface-visibility: hidden; text-align: center; }
.flash-face.back { transform: rotateY(180deg); }

/* ── پرونده ── */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi { padding: 14px; border-radius: var(--r-md); background: var(--glass); border: 1px solid var(--edge); }
.kpi b { display: block; font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.3; }
.kpi span { font-size: .82rem; color: var(--ink-3); }
.weights { display: flex; flex-direction: column; gap: 10px; }
.wrow { display: grid; grid-template-columns: 120px minmax(0, 1fr) 70px; gap: 10px; align-items: center; font-size: .9rem; }
.reg { width: 100%; border-collapse: collapse; font-size: .88rem; }
.reg th, .reg td { padding: 8px 10px; border-bottom: 1px solid var(--edge); text-align: start; white-space: nowrap; }
.reg th { color: var(--ink-3); font-weight: 700; }

/* ── مدرک (همیشه کاغذی و روشن) ── */
.cert-stage { overflow-x: auto; padding: 4px; }
.cert {
  width: 880px; max-width: none; margin: 0 auto; min-height: 622px; position: relative;
  background: radial-gradient(circle at 50% 40%, #FFFDF6 0%, #F6EFDC 100%);
  color: #1B2236; border-radius: 6px; padding: 44px 60px 40px; box-shadow: 0 30px 60px -20px rgba(0,0,0,.45);
  font-family: var(--font-fa); display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; overflow: hidden;
}
.cert::before { content: ""; position: absolute; inset: 16px; border: 2px solid #B98E2E; border-radius: 4px; pointer-events: none; }
.cert::after { content: ""; position: absolute; inset: 24px; border: 1px solid rgba(185, 142, 46, .5); border-radius: 2px; pointer-events: none; }
.cert .seal { width: 76px; height: 76px; }
.cert .c-fr { font-family: var(--font-display); font-style: italic; color: #9A6F18; direction: ltr; font-size: 1.05rem; }
.cert h2 { margin: 2px 0 0; font-size: 2rem; font-weight: 800; color: #14203F; }
.cert .who { font-size: 2.1rem; font-weight: 800; color: #14203F; border-bottom: 1px solid #C9A64F; padding: 0 40px 4px; margin-top: 8px; }
.cert .lvl { font-family: var(--font-display); font-size: 3.2rem; font-weight: 700; color: #A97A17; line-height: 1; direction: ltr; }
.cert .meta { display: flex; gap: 34px; justify-content: center; margin-top: 10px; font-size: .92rem; }
.cert .meta div b { display: block; font-size: 1.15rem; color: #14203F; }
.cert .foot { margin-top: auto; display: flex; width: 100%; justify-content: space-between; align-items: flex-end; font-size: .78rem; color: #5A6178; }
.cert .stamp-sample { position: absolute; top: 44%; left: 50%; transform: translate(-50%, -50%) rotate(-18deg); font-size: 7rem; font-weight: 900; color: rgba(190, 68, 48, .12); pointer-events: none; }

/* ── آنبوردینگ ── */
.onb { max-width: 760px; margin: 0 auto; padding: 32px; display: flex; flex-direction: column; gap: 20px; }
.onb-logo { width: 96px; height: 96px; filter: drop-shadow(0 10px 22px rgba(169, 119, 27, .45)); }
.pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pick label { display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: var(--r-md); background: var(--glass); border: 1px solid var(--edge); cursor: pointer; transition: border-color .2s, background .2s; }
.pick label:has(input:checked) { border-color: var(--gold); background: var(--gold-soft); }
.pick input { position: absolute; opacity: 0; pointer-events: none; }
.pick b { font-weight: 800; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-weight: 700; font-size: .92rem; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--edge); }
.switch:last-child { border-bottom: 0; }
.toggle { appearance: none; -webkit-appearance: none; width: 46px; height: 26px; border-radius: 99px; background: var(--edge); position: relative; cursor: pointer; transition: background .2s; flex: none; border: 1px solid var(--edge); }
.toggle::after { content: ""; position: absolute; top: 2px; inset-inline-start: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: inset-inline-start .2s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.toggle:checked { background: var(--gold); }
.toggle:checked::after { inset-inline-start: 22px; }

.banner { padding: 12px 18px; border-radius: var(--r-md); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: var(--warn-soft); border: 1px solid var(--edge); font-size: .9rem; }
.toast { position: fixed; bottom: calc(96px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%) translateY(20px); opacity: 0; padding: 12px 22px; border-radius: 999px; z-index: 100; transition: opacity .3s, transform .3s; pointer-events: none; font-weight: 700; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.empty { padding: 30px; text-align: center; color: var(--ink-3); }
.lock-note { display: flex; gap: 10px; align-items: center; color: var(--ink-3); font-size: .9rem; }
.lock-note svg { width: 18px; height: 18px; flex: none; }

/* ── نوار پایین موبایل ── */
.tabbar { display: none; }
@media (max-width: 920px) {
  .app { grid-template-columns: minmax(0, 1fr); padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
  .sidebar { display: none; }
  .tabbar {
    display: flex; position: fixed; z-index: 40; bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    left: max(12px, env(safe-area-inset-left, 0px)); right: max(12px, env(safe-area-inset-right, 0px));
    padding: 6px; justify-content: space-around; border-radius: 22px;
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; border-radius: 14px; font-size: .7rem; color: var(--ink-3); text-decoration: none; flex: 1; min-width: 0; }
  .tabbar a svg { width: 21px; height: 21px; }
  .tabbar a.active { color: var(--gold); background: var(--gold-soft); }
  .mobile-brand { display: flex !important; }
  .grid-main, .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .lesson-wrap { grid-template-columns: minmax(0, 1fr); }
  .steps { position: static; flex-direction: row; overflow-x: auto; }
  .step-link { grid-template-columns: 28px auto; white-space: nowrap; }
  .step-link small { display: none; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dict-tools { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  body { font-size: 15px; }
  .card { padding: 16px; }
  .hero { grid-template-columns: minmax(0, 1fr); padding: 20px; }
  .slot { grid-template-columns: 62px minmax(0, 1fr); }
  .slot > :last-child { grid-column: 1 / -1; justify-self: start; }
  .pick { grid-template-columns: minmax(0, 1fr); }
  .drow { grid-template-columns: minmax(0, 1fr) auto; }
  .drow .m { grid-column: 1 / -1; order: 3; }
  .drow .ex { order: 4; }
  .line { grid-template-columns: minmax(0, 1fr) auto; }
  .line .who { grid-column: 1 / -1; max-width: none; }
  .wrow { grid-template-columns: 90px minmax(0, 1fr) 54px; }
  .onb { padding: 20px; }
}
.mobile-brand { display: none; align-items: center; gap: 10px; }
.mobile-brand img { width: 38px; height: 38px; }
.mobile-brand b { font-weight: 800; font-size: 1.1rem; }

/* ── چاپ مدرک ── */
@media print {
  @page { size: A4 landscape; margin: 0; }
  body { background: #fff; }
  .sky, .sidebar, .tabbar, .page-head, .no-print, .toast { display: none !important; }
  .app { display: block; padding: 0; }
  .cert-stage { overflow: visible; padding: 0; }
  .cert { box-shadow: none; width: 297mm; height: 210mm; aspect-ratio: auto; border-radius: 0; }
  main > *:not(.print-area) { display: none !important; }
}

/* حالت آنبوردینگ: بدون منو */
.app.onboarding { grid-template-columns: minmax(0, 1fr); }
.app.onboarding .sidebar, .app.onboarding ~ .tabbar { display: none !important; }
details > summary::-webkit-details-marker { display: none; }

.timer-bar svg, .slot .time svg, .row > svg, .row > span > svg, .empty svg, .lock-note svg, .exam-section-title svg { width: 18px; height: 18px; flex: none; }
.slot .time svg { width: 22px; height: 22px; color: var(--gold); }
main > .seg { align-self: flex-start; }
