/* ---------- fonts ---------- */
@font-face { font-family: "Vazirmatn"; src: url("/fonts/Vazirmatn.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Estedad"; src: url("/fonts/Estedad.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
/* Numbers: Mikhak's digits (free, OFL) — subset to digits, separators and percent; letters fall back to Vazirmatn */
@font-face { font-family: "Num"; src: url("/fonts/Mikhak-digits.woff2") format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0025, U+002B-002E, U+0030-0039, U+0660-066C, U+06F0-06F9, U+2212; }

:root { --tbb: calc(env(safe-area-inset-bottom) * .3 + 6px); --tbn: calc(env(safe-area-inset-bottom) * .5 + 10px);
  color-scheme: light;
  --bg: #f2f2f7;
  --card: #ffffff;
  --fill: #f2f2f6;
  --fill2: #e9e9ef;
  --ink: #111114;
  --ink2: #4a4a50;
  --ink3: #8e8e93;
  --sep: rgba(60, 60, 67, 0.12);
  --glass: rgba(255, 255, 255, 0.66);
  --glass-edge: rgba(255, 255, 255, 0.85);
  --glass-shadow: 0 10px 34px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.06);
  --card-shadow: 0 1px 2px rgba(0, 0, 0, 0.03), 0 6px 22px rgba(0, 0, 0, 0.045);
  --thumb: #ffffff;

  /* data colors (validated categorical steps) */
  --blue: #2a78d6; --orange: #eb6834; --aqua: #1baf7a; --yellow: #eda100; --violet: #6250d6; --rest: #b9b6ae;
  /* founders (as Amin asked: Hamid green, Mohammadreza gold) */
  --amin: #2a78d6; --hamid: #1f9d55; --mreza: #d49a00;
  /* single-hue tints */
  --t-blue: #e8f1fc; --t-orange: #fdefe8; --t-aqua: #e3f6ef; --t-yellow: #fdf4de; --t-violet: #efedfc; --t-gray: #efeff3;
  --t-amin: #e8f1fc; --t-hamid: #e3f4ea; --t-mreza: #fcf3dc;
  --amin-ink: #1f62b5; --hamid-ink: #17834a; --mreza-ink: #a87500;
  --up: #1b8a4a; --up-bg: #e2f4e9; --down: #c93a3a; --down-bg: #fbe8e8;
  --acc: #17996f; --acc-ink: #0f7a57; --t-acc: #e1f4ec; --ok: #1b8a4a; --ok-bg: #e2f4e9; --bad: #c93a3a; --bad-bg: #fbe8e8;
  --ease: cubic-bezier(.32, .72, 0, 1);
  --spring: cubic-bezier(.34, 1.12, .64, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #000000; --card: #1c1c1e; --fill: #2c2c2e; --fill2: #3a3a3c;
    --ink: #f5f5f7; --ink2: #c7c7cc; --ink3: #8e8e93; --sep: rgba(84, 84, 88, 0.55);
    --glass: rgba(44, 44, 48, 0.6); --glass-edge: rgba(255, 255, 255, 0.14); --glass-shadow: 0 10px 34px rgba(0, 0, 0, 0.5); --card-shadow: none; --thumb: #636366;
    --blue: #3987e5; --orange: #d95926; --aqua: #199e70; --yellow: #c98500; --violet: #9085e9; --rest: #5d5b56;
    --amin: #3987e5; --hamid: #26a65e; --mreza: #d19a00;
    --t-blue: #142336; --t-orange: #331c13; --t-aqua: #10291f; --t-yellow: #2f2510; --t-violet: #211d3d; --t-gray: #232325;
    --t-amin: #142336; --t-hamid: #12291b; --t-mreza: #2f2510;
    --amin-ink: #6aa8f0; --hamid-ink: #4cc47f; --mreza-ink: #e0b43c;
    --up: #4ad083; --up-bg: #153222; --down: #ff7b72; --down-bg: #3a1716;
    --acc: #2fc28f; --acc-ink: #5fd8aa; --t-acc: #0f2a20; --ok: #4ad083; --ok-bg: #153222; --bad: #ff7b72; --bad-bg: #3a1716;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000; --card: #1c1c1e; --fill: #2c2c2e; --fill2: #3a3a3c;
  --ink: #f5f5f7; --ink2: #c7c7cc; --ink3: #8e8e93; --sep: rgba(84, 84, 88, 0.55);
  --glass: rgba(44, 44, 48, 0.6); --glass-edge: rgba(255, 255, 255, 0.14); --glass-shadow: 0 10px 34px rgba(0, 0, 0, 0.5); --card-shadow: none; --thumb: #636366;
  --blue: #3987e5; --orange: #d95926; --aqua: #199e70; --yellow: #c98500; --violet: #9085e9; --rest: #5d5b56;
  --amin: #3987e5; --hamid: #26a65e; --mreza: #d19a00;
  --t-blue: #142336; --t-orange: #331c13; --t-aqua: #10291f; --t-yellow: #2f2510; --t-violet: #211d3d; --t-gray: #232325;
  --t-amin: #142336; --t-hamid: #12291b; --t-mreza: #2f2510;
  --amin-ink: #6aa8f0; --hamid-ink: #4cc47f; --mreza-ink: #e0b43c;
  --up: #4ad083; --up-bg: #153222; --down: #ff7b72; --down-bg: #3a1716;
  --acc: #2fc28f; --acc-ink: #5fd8aa; --t-acc: #0f2a20; --ok: #4ad083; --ok-bg: #153222; --bad: #ff7b72; --bad-bg: #3a1716;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Num", "Vazirmatn", system-ui, sans-serif;
  background: var(--bg); color: var(--ink);
  font-size: 15.5px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
button { font: inherit; color: inherit; border: none; background: none; padding: 0; cursor: pointer; }
.n { font-family: "Num", "Vazirmatn", sans-serif; font-variant-numeric: tabular-nums; unicode-bidi: isolate; direction: ltr; display: inline-block; letter-spacing: 0; }
.press { transition: transform 0.25s var(--spring); }
.press:active { transform: scale(0.97); }

/* ---------- glass ---------- */

/* ---------- layout ---------- */
.app { max-width: 680px; margin: 0 auto; padding: 0 16px calc(118px + env(safe-area-inset-bottom)); overflow-x: clip; }
.head { padding: calc(20px + env(safe-area-inset-top)) 4px 8px; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.head .eyebrow { font-size: 13px; font-weight: 650; color: var(--ink3); }
.head h1 { margin: 0; font-family: "Num", "Estedad", "Vazirmatn", sans-serif; font-size: 34px; font-weight: 800; line-height: 1.2; letter-spacing: -0.4px; }
.view { display: none; }
.view.on { display: block; animation: rise .55s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(0.995); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .view.on, .qv .qcard { animation: none !important; } }
.card { position: relative; background: var(--card); border-radius: 26px; padding: 18px; box-shadow: var(--card-shadow); margin-bottom: 12px; }
.card h3 { margin: 0 0 2px; font-family: "Num", "Estedad", "Vazirmatn", sans-serif; font-size: 17px; font-weight: 750; }
.meta { color: var(--ink3); font-size: 12.5px; }
.sec { font-family: "Num", "Estedad", "Vazirmatn", sans-serif; font-size: 20px; font-weight: 800; margin: 24px 6px 10px; }
.muted { color: var(--ink3); }
.banner { background: var(--t-yellow); border-radius: 18px; padding: 10px 14px; font-size: 13px; margin-bottom: 10px; color: var(--ink2); line-height: 1.8; }
.banner.ok { background: var(--t-acc); }

/* ---------- capsules ---------- */
.caps { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 12px; padding: 2px 16px; }
.caps::-webkit-scrollbar { display: none; }
.caps button { flex: none; padding: 7px 15px; border-radius: 999px; background: var(--card); color: var(--ink2); font-size: 14px; font-weight: 650; white-space: nowrap; transition: background .25s, color .25s, transform .25s var(--spring); }
.caps button:active { transform: scale(.95); }
.caps button.on { background: var(--ink); color: var(--card); }
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; border-radius: 999px; padding: 15px; background: var(--ink); color: var(--card); font-weight: 750; font-size: 16px; transition: transform .25s var(--spring), opacity .2s; }
.btn:active { transform: scale(.97); }
.btn.acc { background: var(--acc); color: #fff; }
.btn.soft { background: var(--fill); color: var(--ink); }
.btn.small { width: auto; padding: 9px 18px; font-size: 14px; }
.btn[disabled] { opacity: .45; }
.row { display: flex; gap: 8px; }
.row > * { flex: 1; }

/* ---------- home ---------- */
.hero { background: linear-gradient(160deg, var(--t-acc), var(--card) 70%); }
.hero .lbl { font-size: 14px; font-weight: 650; color: var(--acc-ink); }
.hero .big { font-size: 56px; font-weight: 650; line-height: 1.1; margin: 2px 0 2px; letter-spacing: -1px; }
.hero .big small { font-size: 16px; font-weight: 600; color: var(--ink2); margin-inline-start: 6px; letter-spacing: 0; }
.hero .plan { font-size: 13.5px; color: var(--ink2); margin: 6px 0 14px; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.tile { background: var(--card); border-radius: 22px; padding: 12px 13px; box-shadow: var(--card-shadow); min-width: 0; }
.tile .k { font-size: 12px; color: var(--ink2); font-weight: 650; }
.tile .v { font-size: 26px; font-weight: 650; line-height: 1.3; }
.tile .s { font-size: 11.5px; color: var(--ink3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bars7 { display: flex; align-items: flex-end; gap: 8px; height: 110px; margin-top: 12px; }
.bars7 > div { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.bars7 i { display: block; width: 100%; max-width: 30px; border-radius: 8px; background: var(--acc); min-height: 3px; transition: height .6s var(--ease); }
.bars7 i.z { background: var(--fill2); }
.bars7 span { font-size: 11px; color: var(--ink3); }
.bars7 b { font-size: 11px; font-weight: 600; color: var(--ink2); }
.lvl { height: 8px; border-radius: 999px; background: var(--fill); overflow: hidden; margin-top: 8px; }
.lvl i { display: block; height: 100%; background: var(--acc); border-radius: 999px; }

/* ---------- modes ---------- */
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mode { text-align: start; background: var(--card); border-radius: 24px; padding: 16px; box-shadow: var(--card-shadow); display: flex; flex-direction: column; gap: 4px; min-height: 128px; transition: transform .25s var(--spring); }
.mode:active { transform: scale(.97); }
.mode .ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; margin-bottom: 6px; }
.mode b { font-family: "Num", "Estedad", "Vazirmatn", sans-serif; font-size: 16px; }
.mode span { font-size: 12.5px; color: var(--ink3); line-height: 1.6; }
.mode.wide { grid-column: span 2; min-height: 0; flex-direction: row; align-items: center; gap: 12px; }
.mode.wide .ic { margin: 0; flex: none; }

/* ---------- question view (full screen) ---------- */
.qv { position: fixed; inset: 0; z-index: 50; background: var(--bg); display: none; flex-direction: column; }
.qv.on { display: flex; will-change: transform, opacity; }
.qtop { display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 16px 8px; max-width: 680px; width: 100%; margin: 0 auto; }
.qtop .x { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.qtop .x svg { width: 15px; height: 15px; }
.prog { flex: 1; height: 8px; background: var(--fill2); border-radius: 999px; overflow: hidden; }
.prog i { display: block; height: 100%; width: 0; background: var(--acc); border-radius: 999px; transition: width .4s var(--ease); }
.qtop .cnt { font-size: 13px; font-weight: 650; color: var(--ink2); min-width: 44px; text-align: center; }
.qtimer { height: 4px; margin: 0 auto; width: calc(100% - 32px); max-width: 648px; border-radius: 999px; background: var(--fill2); overflow: hidden; visibility: hidden; }
.qtimer.on { visibility: visible; }
.qtimer i { display: block; height: 100%; background: var(--yellow); width: 100%; }
.qbody { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 8px 16px calc(110px + env(safe-area-inset-bottom)); }
.qcard { max-width: 680px; margin: 0 auto; animation: qin .5s var(--ease) both; }
@keyframes qin { from { opacity: 0; transform: translateX(-18px); } to { opacity: 1; transform: none; } }
.qmeta { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 650; padding: 3px 10px; border-radius: 999px; background: var(--card); color: var(--ink2); }
.chip.acc { background: var(--t-acc); color: var(--acc-ink); }
.chip.warn { background: var(--t-yellow); color: var(--mreza-ink); }
.chip.bad { background: var(--bad-bg); color: var(--bad); }
.stem { font-size: 17.5px; line-height: 2; font-weight: 550; margin: 0 4px 16px; white-space: pre-line; overflow-wrap: anywhere; }
.opts { display: flex; flex-direction: column; gap: 9px; }
.opt { display: flex; align-items: flex-start; gap: 12px; text-align: start; background: var(--card); border-radius: 20px; padding: 14px 15px; font-size: 16px; line-height: 1.8; box-shadow: var(--card-shadow); border: 2px solid transparent; transition: transform .2s var(--spring), background .25s, border-color .25s; overflow-wrap: anywhere; }
.opt:active { transform: scale(.985); }
.opt .k { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--fill); display: grid; place-items: center; font-size: 14px; font-weight: 700; color: var(--ink2); margin-top: 1px; }
.opt.right { background: var(--ok-bg); border-color: var(--ok); }
.opt.right .k { background: var(--ok); color: #fff; }
.opt.wrong { background: var(--bad-bg); border-color: var(--bad); }
.opt.wrong .k { background: var(--bad); color: #fff; }
.opt.pick { border-color: var(--ink3); }
.opts.done .opt { pointer-events: none; }
.opts.done .opt:not(.right):not(.wrong) { opacity: .62; }
.verdict { display: flex; align-items: center; gap: 10px; margin: 16px 2px 10px; font-family: "Num", "Estedad", "Vazirmatn", sans-serif; font-size: 19px; font-weight: 800; }
.verdict.ok { color: var(--ok); } .verdict.bad { color: var(--bad); }
.verdict small { font-family: "Num", "Vazirmatn", sans-serif; font-size: 13px; font-weight: 650; color: var(--ink3); margin-inline-start: auto; }
.ex { background: var(--card); border-radius: 22px; padding: 15px 16px; margin-bottom: 10px; font-size: 15px; line-height: 1.95; }
.ex h4 { margin: 0 0 6px; font-family: "Num", "Estedad", "Vazirmatn", sans-serif; font-size: 14.5px; font-weight: 800; color: var(--acc-ink); }
.ex ul { margin: 0; padding-inline-start: 20px; }
.ex li { margin-bottom: 5px; }
.ex .why b { color: var(--ink2); }
.ex .src { font-size: 12.5px; color: var(--ink3); margin-top: 8px; }
.rel { display: flex; flex-wrap: wrap; gap: 6px; }
.rel button { padding: 5px 12px; border-radius: 999px; background: var(--fill); font-size: 13px; font-weight: 650; color: var(--ink2); }
.qbar { position: fixed; bottom: 0; inset-inline: 0; padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); z-index: 52; }
.qbar .in { max-width: 648px; margin: 0 auto; display: flex; gap: 8px; }
.qbar .in > .btn { flex: 1; }
.qbar .ico { flex: none; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--card); box-shadow: var(--card-shadow); }
.qbar .ico svg { width: 22px; height: 22px; }
.qbar .ico.on { color: var(--yellow); }
.fly { position: fixed; z-index: 60; left: 50%; top: 40%; transform: translate(-50%, 0); font-family: "Num", "Estedad", sans-serif; font-weight: 800; font-size: 22px; color: var(--acc); pointer-events: none; animation: fly 1s var(--ease) forwards; }
@keyframes fly { from { opacity: 0; transform: translate(-50%, 10px) scale(.8); } 30% { opacity: 1; transform: translate(-50%, -10px) scale(1.1); } to { opacity: 0; transform: translate(-50%, -60px) scale(1); } }

/* result */
.res { text-align: center; padding-top: 24px; }
.res .ring { width: 170px; height: 170px; margin: 0 auto 12px; position: relative; }
.res .ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.res .ring .c { position: absolute; inset: 0; display: grid; place-items: center; font-size: 40px; font-weight: 650; }
.res h2 { font-family: "Num", "Estedad", sans-serif; font-size: 26px; margin: 6px 0; }
.res p { color: var(--ink2); margin: 0 0 16px; line-height: 1.9; }
.wl { text-align: start; }
.wl button { display: block; width: 100%; text-align: start; background: var(--card); border-radius: 16px; padding: 10px 14px; margin-bottom: 6px; font-size: 14px; line-height: 1.8; }
.wl button .m { font-size: 12px; color: var(--ink3); }

/* duel */
.duel { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin: 6px 0 14px; }
.duel .p { text-align: center; }
.duel .av { width: 54px; height: 54px; border-radius: 50%; margin: 0 auto 4px; display: grid; place-items: center; font-size: 22px; font-weight: 800; color: #fff; }
.duel .sc { font-size: 30px; font-weight: 650; }
.duel .vs { font-weight: 800; color: var(--ink3); }
.dots { display: flex; justify-content: center; gap: 4px; margin-top: 4px; }
.dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--fill2); }
.dots i.ok { background: var(--ok); } .dots i.bad { background: var(--bad); }
.cat { display: grid; gap: 8px; }

/* ---------- progress ---------- */
.heat { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 1fr); gap: 4px; overflow-x: auto; padding-bottom: 4px; direction: rtl; }
.heat i { width: 15px; height: 15px; border-radius: 4px; background: var(--fill); }
.heat i.l1 { background: color-mix(in srgb, var(--acc) 30%, var(--fill)); }
.heat i.l2 { background: color-mix(in srgb, var(--acc) 55%, var(--fill)); }
.heat i.l3 { background: color-mix(in srgb, var(--acc) 80%, var(--fill)); }
.heat i.l4 { background: var(--acc); }
.heat i.today { outline: 2px solid var(--ink); outline-offset: 1px; }
.heat i.exam { background: var(--bad); }
.heat i.x { visibility: hidden; }
.legend { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink3); margin-top: 8px; }
.mrow { margin-bottom: 12px; }
.mrow .t { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; margin-bottom: 5px; }
.mrow .t b { font-weight: 650; }
.mbar { height: 10px; border-radius: 999px; background: var(--fill); overflow: hidden; display: flex; }
.mbar i { display: block; height: 100%; }
.mbar i.m { background: var(--acc); } .mbar i.s { background: color-mix(in srgb, var(--acc) 35%, var(--fill)); }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.badge { background: var(--card); border-radius: 18px; padding: 12px 8px; text-align: center; font-size: 12px; color: var(--ink3); box-shadow: var(--card-shadow); }
.badge .e { font-size: 28px; filter: grayscale(1); opacity: .4; }
.badge.on { color: var(--ink); }
.badge.on .e { filter: none; opacity: 1; }

/* ---------- account ---------- */
.list { background: var(--card); border-radius: 22px; overflow: hidden; margin-bottom: 12px; }
.li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 16px; font-size: 15px; width: 100%; text-align: start; }
.li + .li { border-top: 0.5px solid var(--sep); }
.li .v { color: var(--ink3); font-size: 14px; }
.li.danger { color: var(--bad); }

/* ---------- tab bar ---------- */
.glass { background: var(--glass); -webkit-backdrop-filter: blur(24px) saturate(190%); backdrop-filter: blur(24px) saturate(190%); border: 0.5px solid var(--glass-edge); box-shadow: var(--glass-shadow), inset 0 1px 0 rgba(255,255,255,.55); }
.tabbar { position: fixed; z-index: 40; inset-inline: 0; margin: 0 auto; bottom: var(--tbn); width: min(92vw, 400px); height: 64px; border-radius: 999px; display: flex; padding: 5px; }
.tabbar .ind { position: absolute; left: 5px; top: 5px; bottom: 5px; width: calc((100% - 10px) / 4); border-radius: 999px; background: var(--fill2); opacity: .9; transition: transform .5s var(--spring); }
.tabbar button { position: relative; z-index: 1; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; font-size: 10.5px; font-weight: 650; color: var(--ink2); border-radius: 999px; transition: color .25s, transform .3s var(--spring); }
.tabbar button:active { transform: scale(.92); }
.tabbar button svg { width: 24px; height: 24px; }
.tabbar button.on { color: var(--acc); }

/* ---------- sheet ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 70; pointer-events: none; display: none; }
.sheet-wrap.vis { display: block; }
.sheet-wrap.on { pointer-events: auto; }
.sheet-wrap .backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.32); opacity: 0; }
.sheet { position: absolute; inset-inline: 0; bottom: 0; margin: 0 auto; max-width: 680px; max-height: 86vh; display: flex; flex-direction: column; background: var(--bg); border-radius: 30px 30px 0 0; box-shadow: 0 -10px 40px rgba(0,0,0,.18); padding-bottom: env(safe-area-inset-bottom); overflow: hidden; transform-origin: 50% 100%; will-change: transform; }
.sheet.deep { height: 86vh; }
.sheet .grab { width: 38px; height: 5px; border-radius: 999px; background: var(--fill2); margin: 8px auto 0; flex: none; }
.sheet > .shx { position: absolute; top: 18px; inset-inline-end: 18px; z-index: 5; }
.sh-stage { position: relative; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.sh-shade { position: absolute; inset: 0; z-index: 2; background: rgba(0,0,0,.14); opacity: 0; pointer-events: none; }
.sh-layer { display: none; flex-direction: column; min-height: 0; background: var(--bg); }
.sh-layer.cur { display: flex; position: relative; flex: 1 1 auto; z-index: 3; }
.sh-layer.under { display: flex; position: absolute; inset: 0; z-index: 1; pointer-events: none; transform-origin: 50% 0; }
.sh-stage:has(.under) .sh-layer.cur { box-shadow: 0 0 28px rgba(0,0,0,.16); }
.sh-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 18px 10px; padding-inline-end: 60px; min-height: 30px; flex: none; }
.sh-head h3 { margin: 0; font-family: "Num", "Estedad", sans-serif; font-size: 19px; font-weight: 800; }
.sh-body { overflow-y: auto; padding: 4px 18px 28px; overscroll-behavior: contain; flex: 1 1 auto; min-height: 0; -webkit-overflow-scrolling: touch; }
.sh-body .caps { margin: 0 -18px 12px; padding: 2px 18px; }
.yrs { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.yrs button { background: var(--card); border-radius: 18px; padding: 12px 6px; font-weight: 700; font-size: 17px; }
.yrs button small { display: block; font-size: 11.5px; font-weight: 600; color: var(--ink3); }

/* ---------- lock ---------- */
.lock { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.lock .box { width: 100%; max-width: 340px; text-align: center; }
.lock .logo { width: 78px; height: 78px; border-radius: 22px; margin: 0 auto 16px; display: grid; place-items: center; background: linear-gradient(150deg, #2fc28f, #127a58); color: #fff; font-family: "Num", "Estedad", sans-serif; font-size: 34px; font-weight: 900; box-shadow: 0 10px 30px rgba(23,153,111,.35); }
.lock h2 { margin: 0 0 4px; font-family: "Num", "Estedad", sans-serif; font-size: 26px; font-weight: 800; }
.lock p { color: var(--ink3); margin: 0 0 22px; font-size: 14px; }
.lock input { width: 100%; border: none; background: var(--card); color: var(--ink); border-radius: 999px; padding: 14px 18px; font: inherit; font-size: 16px; text-align: center; outline: none; box-shadow: var(--card-shadow); margin-bottom: 8px; }
.lock input:focus { box-shadow: 0 0 0 2px var(--acc); }
.lock .link { margin-top: 14px; color: var(--acc-ink); font-weight: 650; font-size: 15px; padding: 6px 12px; }
.lock .err { color: var(--bad); font-size: 13px; min-height: 22px; margin-top: 10px; }
.state { text-align: center; padding: 90px 20px; color: var(--ink3); }
.state .tri-spin { width: 34px; height: 34px; color: var(--ps-tri, #1fae94); }
.foot { text-align: center; color: var(--ink3); font-size: 12px; margin: 26px 0 6px; }
.toast { position: fixed; z-index: 90; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0; padding: 10px 18px; border-radius: 999px; font-size: 14px; font-weight: 650; transition: .35s var(--ease); pointer-events: none; white-space: nowrap; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

.psg { background: var(--card); border-radius: 20px; padding: 12px 15px; margin-bottom: 12px; font-size: 15px; line-height: 1.75; }
.psg summary { font-weight: 750; color: var(--acc-ink); cursor: pointer; }
.psg div { margin-top: 8px; white-space: pre-line; max-height: 46vh; overflow-y: auto; text-align: left; }
[dir="ltr"].stem { text-align: left; font-family: -apple-system, "Segoe UI", Roboto, "Vazirmatn", sans-serif; }
[dir="ltr"] .opt { font-family: -apple-system, "Segoe UI", Roboto, "Vazirmatn", sans-serif; }

.lbtn { margin-top: 10px; }
.lesson p { margin: 0 0 10px; }
.lesson p:last-child { margin-bottom: 0; }
.ex ol { margin: 0; padding-inline-start: 22px; }
.pts li { margin-bottom: 7px; }
.pts .chip { font-size: 11px; padding: 1px 8px; vertical-align: 1px; }
.ex.trap { background: var(--t-yellow); }

.plist { display: flex; flex-direction: column; gap: 6px; }
.pl { display: flex; align-items: center; gap: 12px; text-align: start; background: var(--card); border-radius: 18px; padding: 10px 12px; width: 100%; }
.pl .no { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--fill); font-weight: 750; font-size: 14px; }
.pl .tx { min-width: 0; display: flex; flex-direction: column; }
.pl .tx b { font-size: 14px; font-weight: 650; line-height: 1.6; }
.pl .tx small { font-size: 12px; color: var(--ink3); }
.pl.done { opacity: .6; }
.pl.done .no { background: var(--ok-bg); color: var(--ok); }
.pl.cur { box-shadow: 0 0 0 2px var(--acc); }
.pl.cur .no { background: var(--acc); color: #fff; }
.hero .row { margin-top: 2px; }
.hero .plan b { color: var(--ink); font-weight: 650; }

/* exam booklet */
.xtime { flex: 1; text-align: center; font-weight: 750; font-size: 18px; }
.xq { background: var(--card); border-radius: 22px; padding: 14px 14px 16px; margin-bottom: 12px; box-shadow: var(--card-shadow); scroll-margin-top: 12px; }
.xh { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.xh b { width: 34px; height: 34px; border-radius: 50%; background: var(--fill); display: grid; place-items: center; font-size: 14px; }
.xm { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--ink3); }
.xm svg { width: 20px; height: 20px; }
.xm.on { color: var(--yellow); }
.xq .stem { font-size: 16px; margin: 4px 2px 12px; }
.xq .opt { box-shadow: none; background: var(--bg); padding: 11px 13px; font-size: 15px; }
.xq .opt.pick { background: var(--t-acc); border-color: var(--acc); }
.xq .opt.pick .k { background: var(--acc); color: #fff; }
.xcount { flex: 1; min-width: 0; align-self: center; font-size: 13px; color: var(--ink2); padding-inline-start: 6px; }
.xsheet { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 6px; }
.xsheet button { background: var(--card); border-radius: 14px; padding: 7px 4px; display: flex; flex-direction: column; align-items: center; font-size: 12px; color: var(--ink3); border: 2px solid transparent; }
.xsheet button b { font-size: 14px; color: var(--ink); }
.xsheet button.a { background: var(--ok-bg); }
.xsheet button.a span { color: var(--ok); font-weight: 750; }
.xsheet button.m { border-color: var(--yellow); }

/* cards */
.cstat { flex: 1; text-align: center; font-weight: 700; color: var(--ink2); }
.cwrap { position: relative; flex: 1; max-width: 560px; width: 100%; margin: 0 auto; padding: 8px 16px calc(24px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: auto 1fr auto; gap: 10px; }
.cside { grid-row: 1; border-radius: 20px; padding: 14px 10px; min-height: 76px; display: grid; place-items: center; text-align: center; font-weight: 750; font-size: 16px; background: var(--card); box-shadow: var(--card-shadow); border: 2px solid transparent; cursor: pointer; transition: background .2s, border-color .2s, opacity .2s, transform .2s var(--spring); }
.cside.r { grid-column: 1; } .cside.l { grid-column: 2; }
.cside.hot { border-color: var(--acc); transform: scale(1.03); }
.cside.good { background: var(--ok-bg); border-color: var(--ok); }
.cside.dim { opacity: .45; }
.ccard { grid-column: 1 / -1; grid-row: 2; align-self: center; background: var(--card); border-radius: 28px; padding: 22px 20px; min-height: 220px; display: flex; flex-direction: column; justify-content: center; gap: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.12); touch-action: none; cursor: grab; user-select: none; }
.ctop { font-size: 12.5px; color: var(--ink3); font-weight: 650; }
.cp { font-size: 20px; font-weight: 700; line-height: 1.8; }
.chint { font-size: 12px; color: var(--ink3); }
.cfb { grid-column: 1 / -1; grid-row: 2; align-self: center; display: flex; flex-direction: column; gap: 10px; pointer-events: auto; }
.cfb:empty { pointer-events: none; }
.cv { font-family: "Num", "Estedad", sans-serif; font-size: 22px; font-weight: 800; }
.cv.ok { color: var(--ok); } .cv.bad { color: var(--bad); }
.cex { background: var(--card); border-radius: 18px; padding: 12px 14px; font-size: 15px; line-height: 1.9; }

#xend { flex: 0 0 46%; }
.opt .k { font-size: 13px; }
.xsheet button.w { background: var(--bad-bg); }
.xsheet button.w span { color: var(--bad); font-weight: 750; }
.crow { display: flex; gap: 8px; flex-wrap: wrap; }
.crow .btn { flex: 1; }
.cfb { max-height: 100%; overflow-y: auto; }
.rchips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.rchips button { padding: 8px 14px; border-radius: 999px; background: var(--card); color: var(--ink2); font-size: 14px; font-weight: 650; transition: background .2s, color .2s; }
.rchips button.on { background: var(--ink); color: var(--card); }
#rnote { width: 100%; box-sizing: border-box; border: none; border-radius: 18px; background: var(--card); color: var(--ink); padding: 12px 14px; font: inherit; font-size: 16px; resize: vertical; }
.shx { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--fill); color: var(--ink2); }
.shx svg { width: 12px; height: 12px; }
.cdk { align-self: center; padding: 6px 16px; border-radius: 999px; background: var(--fill); color: var(--ink2); font-size: 13px; font-weight: 650; }
.hintbox { background: var(--t-yellow); color: var(--ink); border-radius: 14px; padding: 10px 12px; font-size: 14px; line-height: 1.85; margin-bottom: 6px; }
.crumbs { display: flex; align-items: center; gap: 4px; overflow-x: auto; white-space: nowrap; scrollbar-width: none; margin: -4px 0 10px; font-size: 12.5px; color: var(--ink3); }
.crumbs::-webkit-scrollbar { display: none; }
.crumbs button { padding: 4px 10px; border-radius: 999px; background: var(--fill); color: var(--ink2); font-size: 12.5px; font-weight: 650; flex: none; }
.crumbs i { font-style: normal; opacity: .6; flex: none; }
.crumbs span { font-weight: 750; color: var(--ink); flex: none; }
.tree { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 4px 0 6px; }
.tree i { font-style: normal; color: var(--ink3); }
.tree button { display: flex; flex-direction: column; align-items: center; padding: 7px 12px; border-radius: 16px; background: var(--fill); color: var(--ink); font-weight: 750; font-size: 14px; }
.tree button small { font-size: 11px; color: var(--ink3); font-weight: 600; }
.tree button.on { background: var(--t-acc); color: var(--acc-ink); }
button.pl { display: inline !important; width: auto !important; min-height: 0 !important; margin: 0 !important; padding: 0 1px !important; border-radius: 0 !important; background: none !important; box-shadow: none !important; color: #1f8a4c !important; font: inherit !important; font-weight: inherit !important; border: 0 !important; vertical-align: baseline; }
button.pl.tl { color: #2563c9 !important; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) button.pl { color: #5ccf8a !important; } :root:not([data-theme="light"]) button.pl.tl { color: #7aaeff !important; } }
:root[data-theme="dark"] button.pl { color: #5ccf8a !important; } :root[data-theme="dark"] button.pl.tl { color: #7aaeff !important; }
.bprog { height: 6px; border-radius: 99px; background: var(--fill); overflow: hidden; margin-bottom: 10px; }
.bprog i { display: block; height: 100%; background: var(--acc); border-radius: 99px; }
.toc { display: flex; flex-direction: column; gap: 4px; background: var(--card); border-radius: 18px; padding: 10px 12px; margin-bottom: 12px; }
.toc button { text-align: start; font-size: 14px; padding: 5px 4px; color: var(--ink2); font-weight: 650; }
.toc button.ok { color: var(--ok); }
.toc button.ok::after { content: ' ✓'; }
.bsec { background: var(--card); border-radius: 22px; padding: 16px; margin-bottom: 12px; font-size: 15.5px; line-height: 2; }
.bsec h2 { margin: 0 0 8px; font-family: "Num", "Estedad", sans-serif; font-size: 17px; font-weight: 800; color: var(--acc-ink); }
.bsec p { margin: 0 0 10px; }
.bbox { border-radius: 14px; padding: 10px 12px; margin: 8px 0; font-size: 14.5px; line-height: 1.9; background: var(--fill); }
.bbox.key { background: var(--t-acc); } .bbox.trap { background: var(--bad-bg); } .bbox.compare { background: var(--t-blue); } .bbox.example { background: var(--t-yellow); }
.btab { overflow-x: auto; margin: 8px 0; }
.btab table { border-collapse: collapse; width: 100%; font-size: 13.5px; line-height: 1.7; }
.btab th, .btab td { border: 1px solid var(--fill); padding: 6px 8px; text-align: start; vertical-align: top; }
.btab th { background: var(--fill); font-weight: 750; }
.bsec .rel { margin: 8px 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
@media print {
  body.printing > *:not(.sheet-wrap) { display: none !important; }
  body.printing .sheet-wrap, body.printing .sheet { position: static !important; transform: none !important; max-height: none !important; height: auto !important; box-shadow: none !important; }
  body.printing .sh-body, body.printing .sh-stage, body.printing .sh-layer.cur { overflow: visible !important; max-height: none !important; position: static !important; transform: none !important; }
  body.printing .sh-layer:not(.cur), body.printing .sh-shade { display: none !important; }
  body.printing .backdrop, body.printing .grab, body.printing .shx, body.printing .crumbs, body.printing [data-read], body.printing #bprint, body.printing .toc, body.printing .rel { display: none !important; }
  body.printing .bsec { break-inside: avoid-page; }
}
.bsec mark, .bbox mark, .btab mark { background: #ffe58a; color: inherit; border-radius: 4px; padding: 0 2px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.xn { display: inline-block; font-size: 11px; font-weight: 800; color: #8a6100; background: #fff3c4; border-radius: 999px; padding: 0 6px; margin-inline-start: 3px; vertical-align: 1px; }
.bsec b { font-weight: 650; }
.ex b, .cp b { font-weight: 650; }
.bsec { text-align: start; }
ul.bl { margin: 4px 0 10px; padding-inline-start: 20px; } ul.bl ul.bl { margin: 2px 0 4px; }
ul.bl li { margin-bottom: 4px; }
.pcards { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 10px; }
.pcard { display: flex; align-items: center; gap: 10px; background: var(--fill); border-radius: 18px; padding: 8px 12px 8px 8px; text-align: start; flex: 1 1 240px; }
.pcard .ph { position: relative; width: 56px; height: 56px; border-radius: 50%; overflow: hidden; flex: none; background: var(--t-acc); display: grid; place-items: center; }
.pcard .ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: saturate(.9); }
.pcard .ph i { font-style: normal; font-weight: 800; font-size: 22px; color: var(--acc-ink); }
.pcard .pt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.pcard .pt b { font-size: 15px; } .pcard .pt small { font-size: 11px; color: var(--ink3); text-align: start; } .pcard .pt span { font-size: 12.5px; color: var(--ink2); line-height: 1.6; }
/* motion: full-screen views spring up, slide away on close; everything tappable gives a soft press */
button:not(.pl):active { transform: scale(.96); }
button { transition: transform .28s var(--spring), background .25s, opacity .25s; }
.mode:active, .li:active { transform: scale(.98); }
/* cards */
.ctopbar { gap: 6px; }
.cnav { padding: 7px 12px; border-radius: 999px; background: var(--card); color: var(--ink2); font-size: 13px; font-weight: 700; flex: none; box-shadow: var(--card-shadow); }
.ctopbar .cstat { font-size: 13.5px; }
.cbottom { position: fixed; inset-inline: 0; bottom: calc(18px + env(safe-area-inset-bottom)); display: flex; justify-content: space-between; align-items: center; padding: 0 18px; pointer-events: none; z-index: 55; max-width: 560px; margin: 0 auto; }
.ccard { position: relative; }
@keyframes cardIn { from { opacity: 0; transform: translateY(24px) scale(.96); } to { opacity: 1; transform: none; } }
.ccard.gone { visibility: hidden; pointer-events: none; }
.ccard.dkp { box-shadow: 0 0 0 2px rgba(245,158,11,.45), 0 12px 40px rgba(0,0,0,.12); }
.ccard.dk { box-shadow: 0 0 0 3px #f59e0b, 0 12px 40px rgba(0,0,0,.12); }
.cfoot { display: flex; gap: 6px; align-items: center; justify-content: flex-end; margin-top: 4px; }
.cseen { font-size: 12px; font-weight: 800; color: var(--ink3); background: var(--fill); border-radius: 999px; padding: 3px 10px; }
.chint:empty { display: none; }
.cfb { animation: cardIn .45s var(--ease) both; }
.cfb:empty { animation: none; }
.sheet .grab { margin: 0 auto; padding: 8px 0 0; height: 5px; box-sizing: content-box; background-clip: content-box; }
.sheet .grab, .sh-head { touch-action: none; }

/* real-question list under booklet sections */
.bq { display: flex; align-items: center; justify-content: center; width: 100%; margin: 12px 0 8px; padding: 12px 16px; border-radius: 999px; background: #eaf1fd; color: #2563c9; font-size: 14.5px; font-weight: 600; }
.qli { background: var(--card); border-radius: 22px; padding: 14px; margin: 0 0 12px; box-shadow: var(--card-shadow); }
.qli .m { font-size: 12px; color: var(--ink3); margin-bottom: 6px; }
.qli .stem { font-size: 15.5px; line-height: 1.9; margin-bottom: 8px; font-weight: 550; }
.qli .qvd { margin: 10px 2px 8px; font-weight: 700; } .qli .qvd.ok { color: var(--ok); } .qli .qvd.bad { color: var(--bad); }
/* theory page */
.tline { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.tline > div { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.tline i { font-style: normal; color: var(--ink3); }
.tchip { display: inline-flex; flex-direction: column; align-items: center; padding: 6px 12px; border-radius: 16px; background: #eaf1fd; color: #2563c9; font-size: 14px; font-weight: 600; }
.tchip small { font-size: 11px; color: var(--ink3); font-weight: 400; }
.tchip.on { background: #2563c9; color: #fff; } .tchip.on small { color: #dbe7ff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bq, :root:not([data-theme="light"]) .tchip { background: #16243d; color: #7aaeff; } }
:root[data-theme="dark"] .bq, :root[data-theme="dark"] .tchip { background: #16243d; color: #7aaeff; }

.tph { display: block; width: 44px; height: 44px; border-radius: 50%; overflow: hidden; margin: 0 auto 4px; background: var(--card); }
.tph:empty { display: none; }
.tph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.phead { display: flex; gap: 12px; align-items: flex-start; }
.ph.big { position: relative; flex: none; width: 76px; height: 76px; border-radius: 50%; overflow: hidden; background: var(--t-acc); display: grid; place-items: center; }
.ph.big img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ph.big i { font-style: normal; font-weight: 800; font-size: 28px; color: var(--acc-ink); }
.bq.ma { background: #f3ebe0; color: #8a5a1a; margin-top: 0; }
.tree button.tl { background: #eaf1fd; color: #2563c9; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tree button.tl { background: #16243d; color: #7aaeff; } }
:root[data-theme="dark"] .tree button.tl { background: #16243d; color: #7aaeff; }

.cset, .cfire { flex: none; width: 44px; height: 44px; padding: 0; border-radius: 50%; display: grid; place-items: center; color: var(--ink); position: relative; }
.ctopbar { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 10px; }
.ctopbar .cstat { min-width: 0; display: flex; flex-direction: column; align-items: center; }
.ctopbar .gbar { width: 100%; max-width: 200px; margin-top: 6px; }
.cfire svg { position: absolute; inset: 0; }
.cfire .trk { fill: none; stroke: currentColor; opacity: .14; stroke-width: 3.5; }
.cfire .prg { fill: none; stroke: #ff7a1a; stroke-width: 3.5; stroke-linecap: round; transition: stroke-dashoffset .6s var(--ease); }
.cfire .fl { font-size: 11px; line-height: 1; position: absolute; top: 6px; }
.cfire b { font-family: "Num", "Vazirmatn", sans-serif; font-size: 14px; font-weight: 800; line-height: 1; position: relative; top: 6px; }
.cfire.full { animation: firepop .7s var(--spring); box-shadow: 0 0 18px rgba(255,122,26,.55); }
@keyframes firepop { 0% { transform: scale(1); } 40% { transform: scale(1.25); } 100% { transform: scale(1); } }
.fireburst { position: fixed; inset: 0; z-index: 200; pointer-events: none; animation: fireout 2.6s ease-out forwards;
  background: radial-gradient(ellipse at 50% 110%, rgba(255,90,0,.55), rgba(255,160,40,.22) 45%, transparent 70%);
  box-shadow: inset 0 0 70px 14px rgba(255,110,10,.7), inset 0 0 160px 30px rgba(255,60,0,.35); }
@keyframes fireout { 0% { opacity: 0; } 15% { opacity: 1; } 55% { opacity: .85; } 100% { opacity: 0; } }

.cgoal { display: flex; justify-content: center; gap: 12px; font-size: 13px; }
.cgoal .rd { font: inherit; padding: 1px 9px; border-radius: 999px; background: var(--t-acc); color: var(--acc-ink); font-weight: 600; font-size: 12px; }
.gbar { position: relative; display: flex; height: 7px; border-radius: 999px; background: var(--fill); overflow: hidden; margin: 5px auto 0; max-width: 220px; }
.gbar i { display: block; height: 100%; transition: width .4s var(--ease); }
.gbar i.ok { background: var(--ok); } .gbar i.bad { background: var(--bad); }
.cvrow { display: flex; align-items: center; justify-content: space-between; gap: 8px; } .cvrow .cfoot { margin: 0; }

/* cards: bottom row — «قبلی ›» right, «نمی‌دانم» centre, «‹ بعدی» left; one capsule size, 48px touch targets */
.cbottom { gap: 10px; padding: 0 16px; }
.cbottom .cnav, .cbottom .cdk { pointer-events: auto; height: 48px; min-width: 48px; padding: 0 18px; border-radius: 999px; background: var(--card); color: var(--ink2); font-size: 15px; font-weight: 750; box-shadow: 0 6px 24px rgba(0,0,0,.12); display: inline-flex; align-items: center; justify-content: center; gap: 6px; line-height: 1; transition: opacity .28s, transform .28s var(--spring); }
.cbottom .cnav i { font-style: normal; font-size: 22px; line-height: 1; margin-top: -2px; color: var(--ink3); }
.cbottom .cdk { padding: 0 26px; }
.cbottom .hid { opacity: 0; pointer-events: none; transform: scale(.92); }
.cardsv .cwrap { touch-action: none; }
.cardsv .cfb { touch-action: pan-y; }
.cw-ghost { position: absolute; margin: 0; pointer-events: none; z-index: 1; }
.cwrap > * { will-change: auto; }
/* answer glow: soft light from the screen edges, fades out in ~350 ms */
.flash { position: fixed; inset: 0; z-index: 66; pointer-events: none; opacity: 0; }
.flash.ok { background: radial-gradient(120% 90% at 50% 50%, rgba(27,160,90,0) 45%, rgba(27,160,90,.30) 100%); box-shadow: inset 0 0 70px rgba(27,160,90,.32); }
.flash.bad { background: radial-gradient(120% 90% at 50% 50%, rgba(201,58,58,0) 55%, rgba(201,58,58,.12) 100%); box-shadow: inset 0 0 50px rgba(201,58,58,.13); }
.caps.tog button.on { background: var(--ink); color: var(--card); }
/* photos: the initial shows until the photo arrives, then the photo fades in */
.ph img, .tph img { transition: opacity .35s; }
img.miss { opacity: 0; }
.tph { position: relative; display: grid !important; place-items: center; background: var(--t-acc) !important; }
.tph img { position: absolute; inset: 0; }
.tph i { font-style: normal; font-weight: 800; font-size: 17px; color: var(--acc-ink); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}
/* home: today's minutes + level card (tappable) */
.tday .tmin { font-size: 15px; color: var(--ink2); margin: 4px 0 2px; }
.tday .tmin b { font-size: 26px; font-weight: 800; color: var(--ink); }
.lvcard { display: block; width: 100%; text-align: start; color: inherit; font: inherit; }
.lvcard .chev { float: inline-end; color: var(--ink3); font-weight: 600; }
.bars7 i.full { background: var(--acc); } .bars7 i:not(.full):not(.z) { background: color-mix(in srgb, var(--acc) 50%, var(--fill)); }
.lvlist { padding: 2px 0; }
.lvrow { display: flex; justify-content: space-between; gap: 12px; padding: 11px 16px; font-size: 14.5px; border-bottom: 0.5px solid var(--sep); }
.lvrow:last-child { border-bottom: 0; }
.lvrow .n { color: var(--ink2); font-weight: 650; white-space: nowrap; }
.lvrow.on { background: var(--t-acc); color: var(--acc-ink); font-weight: 750; }
.lvrow.done { color: var(--ink3); }
/* month calendar */
.cmonth { margin-top: 12px; }
.cmh { font-family: "Num", "Estedad", sans-serif; font-weight: 750; font-size: 15px; margin: 0 2px 6px; }
.cgrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cgrid .wd { text-align: center; font-size: 11.5px; color: var(--ink3); font-weight: 650; }
.cd { aspect-ratio: 1; border-radius: 12px; background: var(--fill); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; font-size: 13px; font-weight: 650; color: var(--ink2); padding: 0; min-width: 0; line-height: 1.1; }
.cd small { font-size: 9.5px; font-weight: 600; opacity: .85; }
.cd.x { visibility: hidden; }
.cd.l1 { background: color-mix(in srgb, var(--acc) 22%, var(--fill)); }
.cd.l2 { background: color-mix(in srgb, var(--acc) 45%, var(--fill)); }
.cd.l3 { background: color-mix(in srgb, var(--acc) 70%, var(--fill)); color: #fff; }
.cd.l4 { background: var(--acc); color: #fff; }
.cd.today { box-shadow: 0 0 0 2px var(--ink); }
.cd.fut { opacity: .5; }
.cd.exam { background: var(--bad); color: #fff; opacity: 1; }
.clegend { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--ink3); flex-wrap: wrap; }
.clegend i { width: 14px; height: 14px; border-radius: 4px; background: var(--fill); display: inline-block; }
.clegend i.l1 { background: color-mix(in srgb, var(--acc) 22%, var(--fill)); } .clegend i.l2 { background: color-mix(in srgb, var(--acc) 45%, var(--fill)); }
.clegend i.l3 { background: color-mix(in srgb, var(--acc) 70%, var(--fill)); } .clegend i.l4 { background: var(--acc); } .clegend i.exam { background: var(--bad); margin-inline-start: 8px; }
/* topic groups */
.tgrp { border-top: 0.5px solid var(--sep); padding: 10px 0 2px; }
.tgrp:first-of-type { border-top: 0; }
.tgrp summary { list-style: none; cursor: pointer; padding-bottom: 8px; }
.tgrp summary::-webkit-details-marker { display: none; }
.tgrp summary .t { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; margin-bottom: 5px; }
.tgrp summary .t b { font-weight: 800; font-size: 15px; }
.tgrp summary .t b::before { content: ''; display: inline-block; width: 11px; height: 11px; vertical-align: -1px; margin-inline-end: 7px; background: var(--ink3); -webkit-mask: var(--chev-f) center / contain no-repeat; mask: var(--chev-f) center / contain no-repeat; transition: transform .3s var(--spring); }
.tgrp[open] summary .t b::before { transform: rotate(-90deg); }
.tgrp .mrow { padding-inline-start: 12px; }
.mrow .t .muted { text-align: end; }
.tgrp summary .t, .tgrp .mrow .t { flex-direction: column; gap: 2px; }
.tgrp summary .t .muted, .tgrp .mrow .t .muted { text-align: start; font-size: 12.5px; }

/* cards bottom row: › next (right) · «نمی‌دانم» · ‹ prev (left), arrows only, 48px capsules */
.cbottom .cnav { width: 64px; padding: 0; }
.cbottom .cnav i { font-size: 26px; color: var(--ink2); margin-top: -3px; }
/* Card text stays at the existing small size. */
.cardsv { --cfs: 0.78; }
.cardsv .cp { font-size: calc(20px * var(--cfs)); }
.cardsv .cex, .cardsv .hintbox { font-size: calc(15px * var(--cfs)); }
.cardsv .eblk { font-size: calc(14px * var(--cfs)); }
/* no zoom */
html, body, button, a, .cside, .cnav, .cdk { touch-action: manipulation; }
.cardsv .ccard { touch-action: none; }
input, textarea, select { font-size: max(16px, 1em); }
.newchip { align-self: flex-start; font-size: 10.5px; padding: 2px 8px; }
.eblks { display: flex; flex-direction: column; gap: 6px; }
.eblk { background: var(--card); border-radius: 16px; padding: 9px 12px; line-height: 1.85; }
.eblk b { display: block; font-size: 11.5px; font-weight: 750; color: var(--acc-ink); margin-bottom: 2px; }

.updbar{position:fixed;left:50%;bottom:calc(88px + env(safe-area-inset-bottom));transform:translateX(-50%);z-index:9999;background:#0a84ff;color:#fff;border:0;border-radius:999px;padding:11px 18px;font:inherit;font-size:14px;font-weight:700;box-shadow:0 8px 24px rgba(0,0,0,.3);white-space:nowrap}

/* ---------- «مسیر ۶۰ روزه» ---------- */
.tile .v .of { font-size: 14px; color: var(--ink3); font-weight: 600; }
.pday { --pc: var(--acc); --pt: var(--t-acc); background: linear-gradient(165deg, var(--pt), var(--card) 72%); padding: 18px 18px 16px; }
.pd-top { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.pd-ring { position: relative; flex: none; width: 64px; height: 64px; display: grid; place-items: center; }
.pd-ring svg { position: absolute; inset: 0; }
.pd-ring b { position: relative; font-size: 15px; font-weight: 750; color: var(--ink); }
.pd-ring.big { width: auto; height: auto; margin: 6px auto 10px; }
.pd-ring.big svg { position: static; display: block; }
.pd-ring.big b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 22px; }
.pd-ring.big b svg { width: 46px; height: 46px; color: var(--pc); }
.pd-tx { min-width: 0; }
.pd-k { font-size: 12.5px; font-weight: 700; color: var(--pc); }
.pday h2, .pdhead h2 { margin: 2px 0 2px; font-family: "Num", "Estedad", "Vazirmatn", sans-serif; font-size: 22px; font-weight: 800; line-height: 1.45; letter-spacing: -0.2px; }
.pd-lead { margin: 0 2px 14px; font-size: 14px; line-height: 1.9; color: var(--ink2); }
.pday.soon h2 { color: var(--ink2); }
.pday.soon .btn { margin-top: 10px; }
.pdhead { background: linear-gradient(165deg, var(--pt), var(--card) 80%); }
.pdhead p { margin: 6px 0 0; color: var(--ink2); font-size: 14px; }
.ptop { display: flex; flex-wrap: wrap; gap: 6px; }
.tchip2 { display: inline-flex; flex-direction: column; align-items: flex-start; padding: 7px 12px; border-radius: 16px; background: var(--fill); font-size: 13.5px; font-weight: 650; text-align: start; }
.tchip2 small { font-size: 11px; color: var(--ink3); font-weight: 600; }
.psum { padding: 14px 16px; }
.psum .lvl { margin: 0 0 10px; }
.psum .meta { line-height: 1.85; margin: 0; }

/* path: one calm vertical line; finished days filled in their part's colour, later days grey */
.path { position: relative; padding: 6px 0 10px; }
.path::before { content: ''; position: absolute; top: 26px; bottom: 34px; inset-inline-start: 27px; width: 3px; border-radius: 3px; background: var(--fill2); }
.pnode { position: relative; display: flex; align-items: center; gap: 14px; width: 100%; text-align: start; padding: 7px 0; }
.pnode .dot { position: relative; z-index: 1; flex: none; width: 40px; height: 40px; margin-inline-start: 8px; border-radius: 50%; display: grid; place-items: center; background: var(--bg); box-shadow: 0 0 0 3px var(--fill2) inset; font-size: 14px; font-weight: 750; color: var(--ink3); }
.pnode .dot svg { width: 18px; height: 18px; }
.pnode .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--card); border-radius: 20px; padding: 10px 14px; box-shadow: var(--card-shadow); }
.pnode .tx small { font-size: 11.5px; font-weight: 650; color: var(--ink3); }
.pnode .tx b { font-size: 15px; font-weight: 700; line-height: 1.6; }
.pnode .tx em { font-style: normal; font-size: 12px; color: var(--ink3); }
.pnode .pr { position: absolute; inset-inline-end: 12px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; }
.pnode.done .dot { background: var(--pc); color: #fff; box-shadow: none; }
.pnode.done .tx { background: color-mix(in srgb, var(--pt) 70%, var(--card)); }
.pnode.done .tx small { color: var(--pc); }
.pnode.cur .dot { background: var(--card); color: var(--pc); box-shadow: 0 0 0 3px var(--pc) inset, 0 0 0 6px color-mix(in srgb, var(--pc) 18%, transparent); animation: pulse 2.4s ease-in-out infinite; }
.pnode.cur .tx { box-shadow: 0 0 0 2px var(--pc), var(--card-shadow); padding-inline-end: 54px; }
.pnode.locked .tx, .pnode.soon .tx { background: color-mix(in srgb, var(--card) 55%, var(--bg)); box-shadow: none; }
.pnode.locked .tx b, .pnode.soon .tx b { color: var(--ink2); font-weight: 650; }
.pnode.soon .tx b { color: var(--ink3); }
.pnode.cur.soon .dot { animation: none; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 3px var(--pc) inset, 0 0 0 5px color-mix(in srgb, var(--pc) 16%, transparent); } 50% { box-shadow: 0 0 0 3px var(--pc) inset, 0 0 0 9px color-mix(in srgb, var(--pc) 6%, transparent); } }

/* day flow (full screen) */
#qv.planv .ptop .cnt { min-width: 52px; }
/* page track: one mark per page (lesson = dot, question = dash, end quiz = ring), sections apart; tap → sections popover */
#qv.planv .ptop { flex-wrap: nowrap; align-items: flex-start; }
.ptk { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; padding: 5px 2px 2px; margin: 0; background: none; border: 0; border-radius: 12px; color: inherit; font: inherit; text-align: start; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.ptk:focus-visible { outline: 2px solid color-mix(in srgb, var(--acc) 60%, transparent); outline-offset: 2px; }
.ptk-svg { display: block; width: 100%; height: 16px; overflow: visible; }
.ptk .tm { transform-box: fill-box; transform-origin: center; transition: fill .35s var(--ease), stroke .35s var(--ease), opacity .35s var(--ease), transform .45s var(--spring); }
.ptk .tm.dot, .ptk .tm.dash { fill: var(--ink3); }
.ptk .tm.ring { fill: transparent; stroke: var(--ink3); stroke-width: 1.5; }
.ptk .tm.ahead { opacity: .32; }
.ptk .tm.done { fill: var(--acc); opacity: .62; }
.ptk .tm.ring.done { fill: var(--acc); stroke: var(--acc); }
.ptk .tm.bad { fill: var(--bad); opacity: .95; transform: scale(.85); }
.ptk .tm.ring.bad { fill: color-mix(in srgb, var(--bad) 22%, transparent); stroke: var(--bad); transform: none; }
.ptk .tm.cur { fill: var(--acc); opacity: 1; transform: scale(1.7); }
.ptk .tm.dash.cur { transform: scale(1.5, 1.35); }
.ptk .tm.ring.cur { fill: color-mix(in srgb, var(--acc) 18%, transparent); stroke: var(--acc); stroke-width: 1.8; transform: scale(1.12); }
.ptk .tm.faint.ahead { opacity: .2; }
.ptk .tm.faint.done { opacity: .36; }
.ptk-line { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-width: 0; font-size: 11.5px; line-height: 1.5; color: var(--ink3); }
.ptk-sec { display: flex; min-width: 0; white-space: nowrap; color: var(--ink3); }
.ptk-sec b { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 650; color: var(--ink2); }
.ptk-sec span { flex: none; font-weight: 550; padding-inline-start: .35em; }
#qv.planv .ptk .cnt { min-width: 0; flex: none; font-size: 11.5px; font-weight: 600; color: var(--ink3); text-align: end; }
.ptk-veil { position: absolute; inset: 0; z-index: 40; }
.ptk-pop { position: absolute; z-index: 41; width: min(300px, calc(100% - 24px)); max-height: min(62vh, 460px); overflow-y: auto; padding: 6px; border-radius: 22px; background: color-mix(in srgb, var(--card) 88%, transparent); -webkit-backdrop-filter: blur(30px) saturate(180%); backdrop-filter: blur(30px) saturate(180%); opacity: 0; transform: translateY(-6px) scale(.96); transform-origin: top right; transition: opacity .2s var(--ease), transform .28s var(--spring); }
.ptk-pop.on { opacity: 1; transform: none; }
.ptk-h { padding: 8px 12px 4px; font-size: 12px; font-weight: 650; color: var(--ink3); }
.ptk-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 15px; }
.ptk-row.cur { background: color-mix(in srgb, var(--acc) 12%, transparent); }
.ptk-row .pk-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--ink3); opacity: .45; }
.ptk-row.cur .pk-dot { background: var(--acc); opacity: 1; box-shadow: 0 0 0 3px color-mix(in srgb, var(--acc) 22%, transparent); }
.ptk-row.full .pk-dot { background: var(--ink2); opacity: .8; }
.ptk-row .pk-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ptk-row .pk-t b { font-size: 14px; font-weight: 650; line-height: 1.5; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ptk-row .pk-t small { font-size: 11.5px; color: var(--ink3); }
.ptk-row.full .pk-t b { color: var(--ink2); }
.ptk-row .pk-n { flex: none; font-size: 12px; font-weight: 600; color: var(--ink3); }
@media (prefers-reduced-motion: reduce) { .ptk .tm, .ptk-pop { transition: none; } .ptk-pop { transform: none; } }
.pw { position: relative; flex: 1; overflow: hidden; max-width: 680px; width: 100%; margin: 0 auto; }
.pg { position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 6px 16px calc(112px + env(safe-area-inset-bottom)); touch-action: pan-y; }
.pg.out { pointer-events: none; }
.pgin { max-width: 640px; margin: 0 auto; }
.pghead { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.chip.ptag { background: var(--t-violet); color: var(--violet); }
.chip.sim { background: var(--t-blue); color: var(--blue); }
.pgt { font-family: "Num", "Estedad", "Vazirmatn", sans-serif; font-size: 23px; font-weight: 800; line-height: 1.5; margin: 2px 2px 12px; letter-spacing: -0.2px; }
.pghtml { font-size: 16px; line-height: 2.05; }
.pghtml > :first-child { margin-top: 0; }
.pghtml p { margin: 0 0 12px; }
.pghtml h3 { font-family: "Num", "Estedad", sans-serif; font-size: 17px; font-weight: 800; margin: 18px 0 6px; color: var(--acc-ink); }
.pghtml ul, .pghtml ol { margin: 0 0 12px; padding-inline-start: 22px; }
.pghtml li { margin-bottom: 6px; }
.pghtml b, .pghtml strong { font-weight: 700; }
.pghtml mark { background: #ffe58a; color: inherit; border-radius: 4px; padding: 0 2px; }
.pghtml table { border-collapse: collapse; width: 100%; font-size: 14px; line-height: 1.75; margin: 8px 0 14px; background: var(--card); border-radius: 16px; overflow: hidden; }
.pghtml th, .pghtml td { border-bottom: 1px solid var(--fill); padding: 8px 10px; text-align: start; vertical-align: top; }
.pghtml th { background: var(--fill); font-weight: 750; }
.pghtml .box, .pghtml .bbox { border-radius: 16px; padding: 11px 14px; margin: 10px 0; background: var(--card); font-size: 15px; line-height: 1.9; }
.pghtml .box.key, .pghtml .bbox.key { background: var(--t-acc); } .pghtml .box.trap, .pghtml .bbox.trap { background: var(--bad-bg); }
.pghtml .box.compare, .pghtml .bbox.compare { background: var(--t-blue); } .pghtml .box.example, .pghtml .bbox.example { background: var(--t-yellow); }
.pghtml .en, .pghtml [lang="en"] { direction: ltr; unicode-bidi: isolate; font-family: -apple-system, "Segoe UI", Roboto, "Vazirmatn", sans-serif; }
.pghtml svg { max-width: 100%; height: auto; }
.pghtml .chip { margin: 0 2px; }
.pg-visual .pghtml, .pg-mindmap .pghtml { background: var(--card); border-radius: 24px; padding: 14px; box-shadow: var(--card-shadow); overflow-x: auto; }
.pq { font-family: "Num", "Estedad", "Vazirmatn", sans-serif; font-size: 21px; font-weight: 750; line-height: 1.8; margin: 6px 2px 14px; }
.pthink { margin: 0 2px 14px; }
.pans { background: var(--card); border-radius: 22px; padding: 14px 16px; box-shadow: var(--card-shadow); margin-bottom: 14px; animation: cardIn .45s var(--ease) both; }
.psec { font-size: 13px; font-weight: 700; color: var(--ink3); margin: 4px 4px 8px; }
.pself { display: flex; gap: 8px; }
.pself button { flex: 1; height: 48px; border-radius: 999px; background: var(--card); box-shadow: var(--card-shadow); font-weight: 750; font-size: 15px; color: var(--ink2); }
.pself button.on.ok { background: var(--ok); color: #fff; } .pself button.on.half { background: var(--yellow); color: #fff; } .pself button.on.no { background: var(--bad); color: #fff; }
.ppts { background: var(--card); border-radius: 22px; padding: 14px 16px 14px 14px; padding-inline-start: 34px; margin: 0 0 12px; line-height: 2; box-shadow: var(--card-shadow); animation: cardIn .45s var(--ease) both; }
.ppts li { margin-bottom: 4px; }
.opts.two .opt .k { width: 34px; border-radius: 999px; font-size: 12px; }
.showans { display: block; margin: 14px auto 0; padding: 8px 18px; border-radius: 999px; background: var(--fill); color: var(--ink2); font-size: 13.5px; font-weight: 650; }
.qblk .showans { margin-top: 10px; }
.qblk .qvd { margin: 10px 2px 8px; font-weight: 700; } .qblk .qvd.ok { color: var(--ok); } .qblk .qvd.bad { color: var(--bad); }
.qblk .m { font-size: 12px; color: var(--ink3); margin-bottom: 6px; }
.qblk .qex:empty { display: none; }
.pwhy { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 2px 2px 10px; }
.pwhy span { font-weight: 800; font-size: 14px; color: var(--ink2); margin-inline-end: 2px; }
.pwhy button { padding: 7px 13px; border-radius: 999px; background: var(--card); box-shadow: var(--card-shadow); font-size: 13.5px; font-weight: 650; color: var(--ink2); }
.pwhy button.on { background: var(--ink); color: var(--card); }
.pwtip { background: var(--t-yellow); border-radius: 16px; padding: 9px 13px; font-size: 13.5px; line-height: 1.85; margin: 0 0 12px; color: var(--ink2); animation: cardIn .4s var(--ease) both; }
.plinks { margin: 2px 0 12px; }
.pstems { background: var(--card); border-radius: 22px; padding: 14px 16px; padding-inline-start: 34px; line-height: 1.95; box-shadow: var(--card-shadow); }
.pstems li { margin-bottom: 10px; }
.pbar.hid { opacity: 0; pointer-events: none; transform: translateY(16px); }
.pbar { transition: opacity .3s, transform .4s var(--ease); }
.pbar .ico.hid { opacity: 0; pointer-events: none; }
.pbar .ico svg { width: 20px; height: 20px; }
#pnext.off { opacity: .4; }
.tstart { text-align: center; padding: 26px 4px; }
.tbig { font-size: 60px; font-weight: 700; color: var(--yellow); line-height: 1.1; }
.tstart .btn { margin-top: 16px; }
.tbar { display: flex; align-items: center; gap: 10px; margin: 2px 2px 14px; font-size: 13.5px; font-weight: 700; color: var(--ink2); }
.tbar #ttime { font-size: 18px; color: var(--ink); min-width: 52px; }
.tprog { flex: 1; height: 6px; border-radius: 999px; background: var(--fill2); overflow: hidden; }
.tprog i { display: block; height: 100%; width: 100%; background: var(--yellow); border-radius: 999px; transition: width .5s linear; }
.tres { text-align: center; }
.tlist { display: flex; flex-direction: column; gap: 8px; }
.titem { background: var(--card); border-radius: 18px; padding: 10px 12px; box-shadow: var(--card-shadow); }
.titem summary { list-style: none; display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 14px; line-height: 1.8; }
.titem summary::-webkit-details-marker { display: none; }
.titem summary b { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--fill); display: grid; place-items: center; font-size: 12px; }
.titem summary span { flex: 1; }
.titem summary i { font-style: normal; font-weight: 800; }
.titem.ok summary i { color: var(--ok); } .titem.bad summary i { color: var(--bad); }
.titem .opts { margin: 10px 0; }
.titem .opt { box-shadow: none; background: var(--bg); padding: 10px 12px; font-size: 14.5px; }
.pdone { text-align: center; padding-top: 18px; }
.pdone h2 { font-family: "Num", "Estedad", sans-serif; font-size: 26px; margin: 4px 0 2px; }
.pdone .list { text-align: start; margin: 16px 0 12px; }
.pdone > .meta { margin: 0 0 12px; line-height: 1.9; }
.pdone .crow { margin-top: 8px; }
.lvrow .v2 { color: var(--ink2); font-weight: 650; white-space: nowrap; }
.lvrow .v2 small { font-weight: 500; color: var(--ink3); font-size: 11px; }
.pghtml > :last-child { margin-bottom: 0; }
.pself + .pwtip { margin-top: 12px; }
.pbar { background: linear-gradient(to top, var(--bg) 55%, color-mix(in srgb, var(--bg) 0%, transparent)); padding-top: 22px; }
/* on the plain page background, soft buttons need the card surface to read as buttons */
.pg .btn.soft { background: var(--card); box-shadow: var(--card-shadow); }
.plinks .btn { flex: 0 0 auto; white-space: nowrap; }
/* flip page: one face per side, both in the same grid cell so the card is as tall as its longer side */
.flip { perspective: 1400px; margin: 4px 0 16px; cursor: pointer; -webkit-user-select: none; user-select: none; }
.flip .fin { display: grid; transform-style: preserve-3d; will-change: transform; }
.flip.on .fin { transform: rotateY(180deg); }
.flip .ff { grid-area: 1 / 1; min-height: 300px; display: flex; flex-direction: column; justify-content: center; gap: 12px; padding: 24px 20px; border-radius: 30px; background: var(--card); box-shadow: 0 12px 40px rgba(0,0,0,.10), var(--card-shadow); -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.flip .ff.front { font-family: "Num", "Estedad", "Vazirmatn", sans-serif; font-size: 21px; font-weight: 750; line-height: 1.8; text-align: center; }
.flip .ff.front small { font-family: "Vazirmatn", sans-serif; font-size: 12.5px; font-weight: 600; color: var(--ink3); }
.flip .ff.back { transform: rotateY(180deg); background: linear-gradient(165deg, var(--t-acc), var(--card) 75%); }
/* one page = one screen: compact chrome so a ≤640 px page fits under the progress bar and above the controls; scroll only as a fallback */
#qv.planv .qtop { padding-bottom: 4px; }
.pg { padding: 2px 16px calc(84px + env(safe-area-inset-bottom)); }
.pghead { margin: 2px 0 6px; gap: 4px; }
.pghead .chip { font-size: 11.5px; padding: 2px 9px; }
.pgt { font-size: 19px; line-height: 1.55; margin: 0 2px 8px; }
.pbar { padding-top: 14px; padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
.pq { font-size: 19px; margin: 2px 2px 12px; }

/* ---------- tabs: خانه / امروز / کارت / نبرد ---------- */
.gearbtn { flex: none; width: 44px; height: 44px; border-radius: 999px; display: grid; place-items: center; color: var(--ink); margin-bottom: 4px; transition: transform .25s var(--spring); }
.gearbtn:active { transform: scale(.92); }
.gearbtn svg { width: 22px; height: 22px; }
.backbtn { display: inline-flex; align-items: center; gap: 4px; margin: calc(10px + env(safe-area-inset-top)) 0 -12px; padding: 6px 2px; font-size: 16px; font-weight: 650; color: var(--acc-ink); }
.backbtn span { display: inline-flex; margin-inline-start: -4px; }
.backbtn span svg { width: 21px; height: 21px; }
.backbtn + .head { padding-top: 14px; }
.hday { display: flex; align-items: center; gap: 10px; width: 100%; text-align: start; color: inherit; font: inherit; padding: 14px 18px; background: linear-gradient(165deg, var(--t-acc), var(--card) 75%); }
.hday .hd-k { flex: none; font-size: 12.5px; font-weight: 700; color: var(--acc-ink); }
.hday b { flex: 1; min-width: 0; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hday .chev, .wk .chev { color: var(--ink3); font-weight: 600; }
.wk { display: block; width: 100%; text-align: start; color: inherit; font: inherit; }
.wk .chev { float: inline-end; }
.seg { display: flex; padding: 3px; margin: 2px 0 12px; border-radius: 999px; background: var(--fill); }
.seg button { flex: 1; padding: 8px 0; border-radius: 999px; font-size: 14.5px; font-weight: 700; color: var(--ink2); transition: background .3s var(--ease), color .3s, box-shadow .3s; }
.seg button.on { background: var(--seg-on, var(--card)); color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.12); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .seg button.on { --seg-on: #3a3a3e; } }
:root[data-theme="dark"] .seg button.on { --seg-on: #3a3a3e; }
.chero { padding: 18px; }
.chero h2 { margin: 2px 0; font-family: "Num", "Estedad", "Vazirmatn", sans-serif; font-size: 22px; font-weight: 800; }
.chero .pd-k { color: var(--acc-ink); }
.chero .btn { width: 100%; margin-top: 14px; }
.rds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 4px; }
.rd { background: var(--fill); border-radius: 16px; padding: 8px 10px; display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 700; color: var(--ink2); }
.rd i { display: block; height: 5px; border-radius: 999px; background: var(--fill2); overflow: hidden; }
.rd i b { display: block; height: 100%; background: var(--acc); border-radius: 999px; transition: width .6s var(--ease); }
.rd small { font-size: 11px; font-weight: 600; color: var(--ink3); }
.rd.on { background: var(--t-acc); color: var(--acc-ink); }
.rd.done i b { background: var(--ok); }
.dvs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; text-align: center; }
.dvs div { background: var(--fill); border-radius: 18px; padding: 10px 4px; display: flex; flex-direction: column; }
.dvs b { font-size: 24px; font-weight: 750; }
.dvs span { font-size: 12px; color: var(--ink2); font-weight: 650; }
.chero.dhero { background: linear-gradient(165deg, var(--t-orange), var(--card) 72%); }

.tabbar button svg.tdi text { font-family: "Num", "Vazirmatn", sans-serif; font-size: 10.5px; font-weight: 800; fill: var(--ink3); }
.tabbar button svg.tdi.on text { fill: var(--ok); }
.tabbar button svg.tdi circle { transition: stroke-dashoffset .8s var(--ease); }
.lib .li > span:first-child { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.lib .li small, .sheet .li small { display: block; width: 100%; font-size: 12px; color: var(--ink3); margin-top: 1px; }
.lib .li > span:first-child { display: grid; grid-template-columns: 34px 1fr; column-gap: 12px; align-items: center; }
.lib .li small { grid-column: 2; }
.lic { grid-row: span 2; width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; font-style: normal; font-size: 17px; }
.sheet .li > span:first-child { min-width: 0; }
.wk .bars7 { height: 84px; margin-top: 8px; }
.tabbar button svg.tdi text { font-size: 12px; }
/* tabs slide like home-screen pages */
.view.on.noanim { animation: none; }
/* «کارت» as a tab: the cards fill the page, the tab bar shrinks to icons under them */
.cardsv.ctab { position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; background: var(--bg); }
.view#v-cards { min-height: 1px; }
.ctab .cwrap { padding-bottom: calc(var(--tbb) + 142px); }
.ctab .cbottom { bottom: calc(var(--tbb) + 74px); }
.ctab .ctopbar { padding-top: calc(12px + env(safe-area-inset-top)); }
.tabbar { --tab-motion: .32s; transition: height var(--tab-motion) var(--ease), width var(--tab-motion) var(--ease), bottom var(--tab-motion) var(--ease); }
.tabbar button span { transition: opacity .2s, max-height var(--tab-motion) var(--ease); max-height: 16px; overflow: hidden; }
body.tb-mini .tabbar { height: 50px; width: min(70vw, 290px); bottom: var(--tbb); }
body.tb-mini .tabbar button span { opacity: 0; max-height: 0; }
.tabbar button svg.tdi .sw { color: var(--ink3); }
.tabbar button svg.tdi.on .sw { color: var(--ok); }
.tabbar button.on svg.tdi .sw { color: var(--ink); }
.tabbar button.on svg.tdi.on .sw { color: var(--ok); }

/* the feedback under a card scrolls inside the card area, never under the tab bar */
.ctab .cwrap { min-height: 0; grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; padding-bottom: calc(128px + env(safe-area-inset-bottom)); }
.ctab .cfb { align-self: stretch; max-height: none; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding-bottom: 8px; justify-content: flex-start; }
.ctab .cfb > :first-child { margin-top: auto; }
.ctab .cfb > :last-child { margin-bottom: auto; }
.ctab .cfb .eblk b { color: var(--acc-ink); font-size: .92em; }
.ctopbar .gbar { height: 8px; background: rgba(120,120,128,.24); }
.ctopbar .cgoal { font-size: 14px; font-weight: 750; }
/* feedback scrolls under the floating buttons: fades out at the top and bottom edges, the buttons are frosted glass */
.ctab .cfb { margin-bottom: calc(-1 * (var(--tbb) + 134px)); padding: 10px 0 calc(var(--tbb) + 177px); position: relative; z-index: 1;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 16px, #000 calc(100% - 158px), transparent calc(100% - 96px));
  mask-image: linear-gradient(to bottom, transparent 0, #000 16px, #000 calc(100% - 158px), transparent calc(100% - 96px)); }
.ctab .cbottom { z-index: 60; }
.ctab .cbottom .cnav, .ctab .cbottom .cdk { background: var(--glass); -webkit-backdrop-filter: blur(22px) saturate(180%); backdrop-filter: blur(22px) saturate(180%); border: .5px solid var(--glass-edge); box-shadow: var(--glass-shadow), inset 0 1px 0 rgba(255,255,255,.5); }

/* Responsive web glass. The real backdrop stays live; light follows input.
   This is a CSS material, not Apple's native optical refraction renderer. */
.tabbar {
  --glass-tone: 255,255,255; --glass-ink: #35353c; --glass-muted: #4f5058;
  --glass-accent: #006b4f; --glass-fill: .19; --glass-edge: .44;
  --glass-light-x: 32%; --glass-light-y: 14%; --lens-light-x: 25%; --lens-light-y: 10%;
  --glass-angle: 92deg; --glass-energy: 0; --glass-shadow: .12; --glass-density: 0; --glass-scene: 242,243,247;
  --ink: var(--glass-ink); --ink2: var(--glass-muted); --ink3: var(--glass-muted); --ok: var(--glass-accent); --acc: var(--glass-accent);
  touch-action: none; user-select: none; -webkit-user-select: none;
  background: rgba(var(--glass-tone),var(--glass-fill));
  -webkit-backdrop-filter: blur(12px) saturate(160%) contrast(1.03);
  backdrop-filter: blur(12px) saturate(160%) contrast(1.03);
  border: .5px solid rgba(255,255,255,.2);
  box-shadow: 0 7px 25px rgba(16,23,35,var(--glass-shadow)), 0 1px 3px rgba(0,0,0,.05);
}
.tabbar[data-glass-scene="dark"] { --glass-tone: 22,24,30; --glass-ink: #f5f5f7; --glass-muted: #dadde6; --glass-accent: #65e3ad; --glass-fill: .26; --glass-edge: .26; }
.tabbar::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(ellipse 42% 115% at var(--glass-light-x) var(--glass-light-y), rgba(255,255,255,calc(.09 + var(--glass-energy) * .22)), transparent 80%);
  opacity: .9;
}
.tabbar::after, .tabbar .ind::after {
  content: ''; position: absolute; inset: -.5px; padding: 1px; border-radius: inherit; pointer-events: none;
  background: conic-gradient(from var(--glass-angle), rgba(255,255,255,.08), rgba(255,255,255,.8) 14%, rgba(255,255,255,.05) 34%, rgba(255,255,255,.08) 58%, rgba(255,255,255,.6) 72%, rgba(255,255,255,.04) 90%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.tabbar .ind {
  background: radial-gradient(ellipse 62% 85% at var(--lens-light-x) var(--lens-light-y), rgba(255,255,255,calc(.18 + var(--glass-energy) * .3)), transparent 82%), rgba(var(--glass-tone),.08);
  border: .5px solid rgba(255,255,255,var(--glass-edge));
  box-shadow: 0 2px 8px rgba(20,30,40,.1), inset 0 -.5px .5px rgba(255,255,255,.14);
  opacity: 1; pointer-events: none; will-change: left, scale;
  transition: scale .38s cubic-bezier(.2,1.35,.4,1), box-shadow .2s, border-color .2s;
}
.tabbar .ind.grab {
  scale: 1.14 1.12;
  border-color: rgba(255,255,255,.28);
  box-shadow: 0 7px 18px rgba(16,23,35,var(--glass-shadow)), inset 0 0 11px rgba(255,255,255,.08);
}
.tabbar .ind::after { opacity: calc(.55 + var(--glass-energy) * .45); }
.tabbar button { color: var(--glass-muted); text-shadow: 0 1px 2px rgba(var(--glass-tone),.5); }
.tabbar button.on, .tabbar button.hot { color: var(--glass-accent); }
.tabbar.pressing button.on:not(.hot) { color: var(--glass-muted); }
.tabbar button:focus-visible { outline: 2px solid var(--glass-accent); outline-offset: 1px; }
@media (prefers-reduced-motion: reduce) { .tabbar .ind.grab { scale: 1; } }
@media (prefers-reduced-transparency: reduce) {
  .tabbar { background: rgba(var(--glass-tone),.96); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .tabbar::before, .tabbar::after, .tabbar .ind::after { display: none; }
  .tabbar .ind { background: rgba(var(--glass-scene),.6); border-color: var(--glass-muted); }
}
@media (prefers-contrast: more) { .tabbar { background: rgba(var(--glass-tone),.96); border: 1px solid var(--glass-ink); } .tabbar .ind { border: 1px solid var(--glass-ink); } }
@media (forced-colors: active) { .tabbar { background: Canvas; } .tabbar::before,.tabbar::after,.tabbar .ind::after { display:none; } .tabbar .ind { border: 2px solid Highlight; } }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .tabbar { background: rgb(var(--glass-tone)); } }

/* «امروز»: the path itself; today's day opens in place, earlier days fold into one row */
.psl { display: flex; align-items: center; gap: 12px; margin: 2px 4px 6px; font-size: 13px; font-weight: 650; color: var(--ink3); }
.psl .lvl { flex: 1; margin: 0; }
.pnode.open { align-items: flex-start; }
.pnode.open .dot { margin-top: 12px; }
.pnode.open .tx { padding: 14px 16px 16px; gap: 10px; background: linear-gradient(165deg, color-mix(in srgb, var(--pt) 70%, var(--card)), var(--card) 60%); box-shadow: 0 0 0 2px var(--pc), var(--card-shadow); }
.pnode.open .otop { display: flex; align-items: center; gap: 12px; }
.pnode.open .ot { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pnode.open .ot small { color: var(--pc); font-weight: 750; }
.pnode.open .ot b { font-size: 18px; line-height: 1.55; }
.pnode.open .pd-ring { flex: none; position: relative; width: 52px; height: 52px; display: grid; place-items: center; }
.pnode.open .pd-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.pnode.open .pd-ring .n { font-size: 12px; }
.pnode.open .pd-lead { margin: 0; font-size: 14px; line-height: 1.95; color: var(--ink2); }
.pnode.open .row { display: flex; gap: 10px; }
.pnode.open .row .btn { flex: 1; width: auto; padding: 13px; }
.pnode.pmore .tx { background: transparent; box-shadow: none; flex-direction: column; padding: 8px 14px; }
.pnode.pmore .dot { background: var(--fill2); color: var(--ink3); box-shadow: none; }
.pnode.pmore b { color: var(--ink2); font-size: 14px; }
.pnote { margin: 6px 6px 0; line-height: 1.85; }


/* Today-first day overview. Scoped away from navigation and the learning player. */
.pd-overview { display: flex; flex-direction: column; gap: 12px; }
.pd-overview .pd-top { margin: 0; justify-content: space-between; }
.pd-overview .pd-tx { flex: 1; }
.pnode.open .tx.pd-overview { padding: 16px; gap: 12px; border-radius: 18px; }
.pnode.open .ot b { font-size: 17px; line-height: 1.65; margin-top: 4px; }
.pd-overview .pd-facts { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 7px; font-size: 11.5px; line-height: 1.8; color: var(--ink2); font-variant-numeric: tabular-nums; }
.pd-overview .pd-facts span { white-space: nowrap; }
.pd-overview .pd-lead { margin: 0; font-size: 13px; line-height: 1.9; color: var(--ink2); }
.pd-topics { display: flex; flex-wrap: wrap; gap: 5px 7px; padding-top: 10px; border-top: 1px solid var(--sep); }
.pd-topics span { font-size: 11.5px; line-height: 1.8; color: var(--pc); font-weight: 650; }
.pd-overview .pd-continue { width: 100%; min-height: 46px; display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 2px 0 0; padding: 11px 14px; border-radius: 13px; font-size: 14px; line-height: 1.7; white-space: nowrap; }
.pd-arrow { display: flex; flex: none; }
.pd-arrow svg { width: 18px; height: 18px; }

.days-head { display: block; }
.days-heading { display: flex; gap: 9px; align-items: baseline; }
.days-heading h1 { white-space: nowrap; }
.days-heading > span { color: var(--ink3); white-space: nowrap; font-size: 15px; }
.days-heading .lvl { align-self: center; flex: 1; min-width: 80px; margin: 0 8px 0 0; background: var(--fill2); }
.days-head .eyebrow { margin-top: 5px; }
.history-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 14px 0; }
.history-page .pgin { padding: 0; }
.history-page button:disabled { opacity: 1; cursor: default; }
.history-page .plinks, .history-page .pwhy, .history-page .showans { display: none; }

.profilebtn { flex: none; min-height: 44px; padding: 9px 11px; border-radius: 15px; display: flex; align-items: center; gap: 5px; color: var(--ink); font-size: 12px; font-weight: 650; margin-bottom: 4px; }
.profilebtn svg { width: 19px; height: 19px; }
.days-heading h1, .pd-overview .ot b, .pd-overview h2, .pd-overview .pd-ring .n { color: var(--ink); }

.pd-separator { color: var(--ink3); font-weight: 400; }

/* Refined hierarchy within the v52 surfaces only. Content stays opaque and calm. */
.pnode.open .tx.pd-overview { padding: 16px; gap: 12px; background: var(--card); border-radius: 20px; box-shadow: var(--card-shadow); border: 1px solid color-mix(in srgb, var(--pc) 18%, var(--sep)); }
.pnode.open .ot small, .pd-overview .pd-k { color: var(--ink3); font-weight: 600; font-size: 11.5px; }
.pnode.open .ot b { font-size: 16.5px; font-weight: 700; line-height: 1.65; margin-top: 5px; }
.pnode.open .pd-ring { width: 44px; height: 44px; }
.pnode.open .pd-ring .n { font-size: 11px; font-weight: 650; }
.pd-overview .pd-facts { gap: 2px 6px; align-items: baseline; margin-top: -2px; }
.pd-overview .pd-count { color: var(--ink2); font-size: 13px; font-weight: 600; }
.pd-overview .pd-estimate { color: var(--ink3); font-size: 11.5px; font-weight: 400; }
.pd-overview .pd-estimate .pd-separator { padding-inline-end: 5px; }
.pd-overview .pd-lead { font-size: 13.5px; line-height: 1.85; color: var(--ink2); }
.pd-topics { gap: 4px 5px; padding-top: 11px; border-color: var(--sep); }
.pd-topics span { font-size: 11.5px; line-height: 1.8; color: var(--ink3); font-weight: 500; }
.pd-overview .pd-continue { border-radius: 12px; min-height: 46px; font-size: 14px; font-weight: 650; margin-top: 1px; }
.days-heading h1 { font-size: 32px; }
.days-heading > span { font-size: 13px; color: var(--ink3); }
.days-heading .lvl { height: 6px; margin-inline-start: 8px; }
.days-head .eyebrow { font-size: 11.5px; font-weight: 500; margin-top: 8px; }
.pnode.pmore { min-height: 48px; padding-block: 4px; }
.pnode.pmore .tx { flex-direction: row; align-items: center; justify-content: space-between; gap: 8px; padding-block: 6px; }
.pnode.pmore .tx b { font-size: 13px; font-weight: 600; }
.pnode.pmore .dot { width: 32px; height: 32px; margin-inline-start: 12px; margin-inline-end: 4px; background: var(--fill); }
.pnode.pmore .dot svg { width: 14px; height: 14px; }
.past-toggle-label { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--ink3); }
.profilebtn { min-height: 44px; max-width: 92px; padding: 8px 10px; border-radius: 14px; gap: 5px; font-size: 12px; font-weight: 550; }
.profilebtn svg { width: 19px; height: 19px; flex: none; }
.history-summary { padding: 16px; }
.history-summary h3 { margin: 0 0 10px; font-size: 16px; font-weight: 650; line-height: 1.7; }
.history-summary .pd-facts { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--ink2); }
.history-summary .meta { font-size: 11.5px; margin: 10px 0 0; color: var(--ink3); }

/* Read-only history uses the existing full-screen layer and left-edge back gesture. */
body.history-reading .tabbar { visibility: hidden; }
.history-reader { padding-top: env(safe-area-inset-top); }
.history-top { display:flex; align-items:center; justify-content:space-between; padding:12px 18px; flex-shrink:0; border-bottom:1px solid var(--sep); }
.history-top > span { font-size:15px; font-weight:650; }
.history-top small { font-size:11px; font-weight:400; color:var(--ink2); margin-inline-start:8px; }
.history-reader #history-view { flex:1; min-height:0; overflow:auto; padding:24px 20px; overscroll-behavior:contain; touch-action:pan-y; }
.history-reader .history-nav { flex:none; margin:0; padding:12px 20px max(12px,env(safe-area-inset-bottom)); border-top:1px solid var(--sep); font-size:12px; color:var(--ink2); }
.history-reader .history-nav button { min-height:44px; font-size:13px; }
.history-reader .history-summary { padding:8px 0; }
.history-kicker { color:var(--ink2); font-size:12px; margin-bottom:10px; }
.history-summary h2 { font-size:22px; line-height:1.7; margin:0 0 28px; }
.history-stats { display:grid; grid-template-columns:1fr 1fr; gap:24px 16px; padding:20px 0; border-block:1px solid var(--sep); }
.history-stats div { display:flex; flex-direction:column; gap:6px; }
.history-stats strong { font-size:24px; font-weight:650; }
.history-stats span { font-size:12px; color:var(--ink2); }
.pd-overview .pd-estimate, .pd-topics span { color:color-mix(in srgb,var(--ink2) 72%,var(--ink3)); }

/* Explicit semantic foregrounds keep the affected surfaces correct during theme changes. */
#v-home, .history-reader { color: var(--ink); }
.history-top .x { width:44px; height:44px; display:grid; place-items:center; flex:none; border-radius:50%; background:var(--fill); }
.history-top .x svg { width:16px; height:16px; }
.history-reader .history-nav { display:grid; grid-template-columns:minmax(0,1fr) auto minmax(0,1fr); gap:16px; }
#history-position { white-space:nowrap; min-width:60px; text-align:center; }
.history-top, .history-reader #history-view, .history-reader .history-nav { width:100%; max-width:680px; margin-inline:auto; }

.history-flip .fin { transform:none !important; display:grid; gap:16px; height:auto; }
.history-flip .ff { position:static; transform:none !important; backface-visibility:visible; min-height:0; padding:16px; border-radius:16px; background:var(--card); }
.history-flip .back { border-top:1px solid var(--sep); }

/* Read-only content must resolve its foreground at the actual text/icon surface,
   including when the system switches theme while the reader is already open. */
.history-reader { --history-ink: var(--ink); }
.history-reader :is(.stem,.pq,.pgt,.ex,.pghtml,.ppts,.history-flip .ff,.titem summary),
.history-reader .opt,
.history-reader .opt > span:not(.k),
.history-reader .history-top .x,
.history-reader .history-top .x svg,
.history-reader .history-summary h2,
.history-reader .history-stats strong { color: var(--history-ink); }
.history-reader .ex :is(p,li,td,th),
.history-reader .pghtml :is(p,li,td,th),
.history-reader .ppts li,
.history-reader .history-flip .pp { color: var(--history-ink); }
.history-reader .history-page .opt:disabled { -webkit-text-fill-color: currentColor; }

/* Compact archived-day reader: retain readable content, remove player-sized chrome. */
.past-day-meta { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:4px 12px; margin-top:5px; }
.past-day-meta time { font-size:11px; color:var(--ink2); }
.past-day-meta > span { font-size:11.5px; color:var(--acc-ink); }
.history-top { padding:6px 16px; }
.history-reader #history-view { padding:16px; }
.history-reader .history-nav { padding:8px 16px max(8px,env(safe-area-inset-bottom)); }
.history-reader .history-nav .btn { padding:8px 12px; border-radius:14px; }
.history-reader .history-page .pghead { gap:4px; margin:0 0 10px; }
.history-reader .history-page .chip { font-size:11px; padding:2px 8px; }
.history-reader .history-page .stem,
.history-reader .history-page .pq { font-size:15.5px; line-height:1.85; margin:0 0 12px; }
.history-reader .history-page .opts { gap:6px; }
.history-reader .history-page .opt { padding:8px 10px; min-height:44px; border-radius:13px; gap:9px; font-size:14.5px; line-height:1.75; }
.history-reader .history-page .opt .k { width:24px; height:24px; font-size:12px; }
.history-reader .history-page .verdict { margin:10px 2px; font-size:13px; }
.history-reader .history-page .ex { padding:12px; margin-bottom:8px; border-radius:15px; font-size:14px; line-height:1.8; }
.history-reader .history-page .ex h4 { font-size:13px; }
.history-reader .history-page .pgt { font-size:18px; line-height:1.6; }
.history-reader .history-page .pghtml { font-size:15px; line-height:1.9; }
.history-reader .history-summary h2 { font-size:20px; line-height:1.65; margin-bottom:20px; }
.history-reader .history-stats { gap:18px 16px; padding:16px 0; }

/* The current day lives on its card; reserve only safe top inset for the path. */
#v-today { padding-top:calc(12px + env(safe-area-inset-top)); }

/* Past-day overview: content and outcomes have separate, readable hierarchies. */
.history-reader .history-summary { padding:4px 0 12px; }
.history-reader .history-intro { padding:0 2px 20px; }
.history-summary .history-date { font-size:12px; color:var(--ink2); margin:0 0 7px; }
.history-reader .history-summary h2 { font-size:21px; line-height:1.65; letter-spacing:-.3px; margin:0 0 10px; }
.history-total { display:flex; align-items:baseline; gap:5px; font-size:13px; color:var(--ink2); margin:0; }
.history-total strong { color:var(--ink); font-size:19px; font-weight:650; }
.history-total-divider { padding-inline:6px; color:var(--ink3); }
.history-block { background:var(--card); border-radius:22px; padding:18px; margin-bottom:14px; }
.history-summary .history-block h3 { font-size:14px; line-height:1.5; margin:0 0 15px; font-weight:650; }
.history-composition-bar { display:flex; gap:3px; height:9px; overflow:hidden; border-radius:5px; margin-bottom:13px; }
.history-composition-bar i { min-width:3px; }
.history-content-row { display:flex; gap:9px; align-items:flex-start; padding:12px 0; border-bottom:1px solid var(--sep); }
.history-content-row:last-child { border-bottom:0; padding-bottom:0; }
.history-content-row > i { width:7px; height:7px; border-radius:50%; flex:none; margin-top:7px; }
.history-content-row > div { flex:1; min-width:0; }
.history-content-row h4 { margin:0 0 3px; font-size:13px; font-weight:600; }
.history-content-row p { margin:0; font-size:11.5px; line-height:1.8; color:var(--ink2); }
.history-content-row > strong { font-size:18px; font-weight:650; display:flex; align-items:baseline; gap:4px; white-space:nowrap; }
.history-content-row strong small { font-size:10px; font-weight:400; color:var(--ink2); }
.history-results { display:grid; grid-template-columns:repeat(auto-fit,minmax(120px,1fr)); gap:18px; }
.history-score + .history-score { border-inline-start:1px solid var(--sep); padding-inline-start:18px; }
.history-score-label { display:flex; flex-direction:column; gap:5px; font-size:12px; color:var(--ink2); }
.history-score-label strong { color:var(--acc-ink); font-size:30px; line-height:1.3; font-weight:650; }
.history-score-label strong small { font-size:17px; margin-inline-start:2px; }
.history-score-track { height:4px; border-radius:3px; background:var(--fill2); overflow:hidden; margin:7px 0 10px; }
.history-score-track i { display:block; height:100%; background:var(--acc); border-radius:3px; }
.history-score p { font-size:12px; line-height:1.7; margin:0; }
.history-score p span { color:var(--ink2); display:block; font-size:11px; }
.history-reader .history-nav.is-summary { display:block; background:var(--bg); border-top:0; padding-top:10px; }
.history-nav.is-summary #history-prev,.history-nav.is-summary #history-position { display:none; }
.history-reader .history-nav.is-summary #history-next { width:100%; border-radius:16px; min-height:50px; background:var(--ink); color:var(--card); font-size:14px; font-weight:600; }
/* Restore the current day's warm visual focus without adding redundant content. */
#v-today .pnode.cur.open .tx.pd-overview { background:color-mix(in srgb,var(--t-orange) 78%,var(--card)); border-color:color-mix(in srgb,var(--orange) 28%,transparent); box-shadow:0 6px 22px color-mix(in srgb,var(--orange) 7%,transparent); }
#v-today .pnode.cur .ot small { color:var(--ink2); }
#v-today .pnode.cur .pd-continue { background:var(--orange); color:#fff; }

/* Semantic foregrounds must stay explicit when the fullscreen layer changes theme. */
.history-reader .history-block,
.history-reader .history-block h3,
.history-reader .history-content-row h4,
.history-reader .history-content-row > strong,
.history-reader .history-score p { color:var(--ink); }
.history-results { grid-template-columns:repeat(2,minmax(0,1fr)); }
.history-score:only-child { grid-column:1 / -1; }
#v-today .pnode.cur .pd-continue { background:#bd461b; color:#fff; }
@media(max-width:350px){
 .history-block { padding:15px; }
 .history-content-row { padding:10px 0; }
 .history-content-row p { font-size:11px; }
 .history-results { gap:12px; }
 .history-score + .history-score { padding-inline-start:12px; }
 .history-reader .history-summary h2 { font-size:20px; }
}

/* Green remains the action color; the current day carries the warm orange gradient. */
#v-today .pnode.cur.open .tx.pd-overview {
 background:linear-gradient(135deg,color-mix(in srgb,var(--orange) 20%,var(--card)) 0%,color-mix(in srgb,var(--t-orange) 60%,var(--card)) 55%,var(--card) 100%);
}
#v-today .pnode.cur .pd-continue { background:var(--acc); color:#fff; }
.history-reader .history-intro { padding-bottom:14px; }
.history-subjects { display:flex; flex-wrap:wrap; gap:7px 16px; padding-top:12px; }
.history-subjects > span { display:flex; align-items:baseline; gap:5px; font-size:11px; color:var(--ink2); }
.history-subjects b { color:var(--ink); font-size:12px; font-weight:600; }
.history-block { padding:16px; margin-bottom:12px; }
.history-summary .history-block h3 { margin-bottom:12px; }
.history-content-row { padding:10px 0; }

#v-today .pnode.cur .pd-continue { background:#087f5b; color:#fff; }
/* Keep the overview compact even on adaptive days with several subject lanes. */
.history-reader .history-summary { padding-bottom:0; }
.history-reader #history-view { padding-bottom:8px; }
.history-summary .history-block:last-of-type { margin-bottom:0; }
.history-score-track { margin:5px 0 6px; }
.history-score-label { gap:3px; }
.history-performance .history-results { gap:14px; }
@media(max-width:350px){
 .history-reader .history-summary h2 { font-size:18px; line-height:1.55; margin-bottom:7px; }
 .history-reader .history-intro { padding-bottom:10px; }
 .history-subjects { padding-top:8px; gap:5px 12px; }
 .history-block { padding:13px; margin-bottom:10px; }
 .history-summary .history-block h3 { margin-bottom:9px; }
 .history-content-row { padding:8px 0; }
 .history-content-row p { line-height:1.65; }
 .history-score-label strong { font-size:26px; }
 .history-score-label { gap:2px; }
}
.history-reader #history-view { padding-top:12px; }
.history-reader .history-summary { padding-top:0; }
.history-reader .history-summary h2 { font-size:20px; line-height:1.5; margin-bottom:8px; }
.history-reader .history-intro { padding-bottom:10px; }
.history-summary .history-date { margin-bottom:5px; }
.history-subjects { gap:4px 14px; padding-top:9px; }
.history-content-row { padding:8px 0; }
.history-block { margin-bottom:10px; }
@media(max-width:350px){
 .history-reader .history-summary h2 { font-size:18px; }
 .history-content-row p { font-size:11px; }
 .history-score-label strong { font-size:25px; }
}
/* Continue is a capsule: the end radius is always at least half its height. */
.pd-overview .pd-continue { border-radius:999px; }

/* Past days: folded above the current day, revealed by a rubber-band pull at the top of the page.
   Content is bottom-anchored and clipped at the top edge, so a partly open block shows its most recent days. */
.past-wrap { position: relative; height: 0; display: flex; flex-direction: column; justify-content: flex-end; clip-path: inset(0 -32px -14px -32px); }
.past-wrap.open { height: auto; clip-path: none; }
.past-in { flex: none; transform-origin: 50% 100%; }
.past-reveal { position: absolute; top: 4px; left: 50%; z-index: 3; transform: translateX(-50%); opacity: 0; pointer-events: none; white-space: nowrap; padding: 8px 16px; border-radius: 999px; background: var(--card); box-shadow: var(--card-shadow); color: var(--ink2); font-size: 12.5px; font-weight: 650; }
.past-reveal:focus-visible { opacity: 1; pointer-events: auto; outline: 2px solid var(--acc); outline-offset: 2px; }
body.past-pulling { user-select: none; -webkit-user-select: none; }
#pdone { user-select:none; -webkit-user-select:none; cursor:pointer; }
#pdone .tx b { font-size:12px; }
#pdone:focus-visible { outline:2px solid var(--acc); outline-offset:3px; border-radius:16px; }

/* This prototype replaces top-edge refresh only while the Days view is active.
   Safari/PWA behavior still needs physical-device validation before publication. */
html:has(#v-today.on):not(:has(body.history-reading)) { overscroll-behavior-y:contain; }
/* the past-days block compensates the scroll itself; browser scroll anchoring would double it */
html:has(#v-today.on) { overflow-anchor:none; }

/* Cards progress is a read-only report, separate from the two settings. */
.ctopbar button.cstat { min-height: 44px; padding: 5px 0; font: inherit; color: var(--ink2); background: transparent; }
.ctopbar .cstat:focus-visible { outline: 2px solid var(--acc); outline-offset: 3px; border-radius: 10px; }
.card-round-summary strong { font-size: 32px; color: var(--acc-ink); }
.card-round-summary p { margin: 3px 0 12px; }
.card-round-row { padding: 12px 0; border-bottom: 1px solid var(--sep); }
.card-round-row:last-child { border-bottom: 0; }
.card-round-row .t { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.card-round-row .meta { margin: 4px 0 7px; }
.card-round-explainer { margin-top: 20px; }
.card-round-explainer p { margin: 8px 0; line-height: 1.8; }


/* Evidence-based daily triangle: distinct from the existing green activity score. */
.triangle-mark { width:24px;height:24px;color:var(--acc);flex:none; }
.triangle-progress { display:flex;gap:16px;align-items:center; }
.triangle-small-medal .triangle-mark { width:40px;height:40px; }
.cd.triangle-day { position:relative;background:transparent!important;isolation:isolate;color:white!important; }
.cd.triangle-day>.triangle-mark { position:absolute;inset:-2px 0 0;width:100%;height:100%;z-index:-1;color:#087f5b; }
.cd.triangle-day>span { padding-top:8px; }
.cd.triangle-day>small { color:white; }
.triangle-day-note { color:var(--acc-ink);font-weight:700; }
.triangle-celebration { background:var(--bg);overflow:auto; }
.triangle-close { position:absolute;top:calc(env(safe-area-inset-top,0px) + 18px);right:22px;z-index:2; }
.triangle-stage { min-height:100%;box-sizing:border-box;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:70px 28px calc(env(safe-area-inset-bottom,0px) + 32px);max-width:500px;margin:auto; }
.triangle-medal { position:relative;width:152px;height:152px;margin-bottom:28px;filter:drop-shadow(0 16px 25px #087f5b35);animation:triangle-arrive .7s cubic-bezier(.2,.8,.2,1) both; }
.triangle-medal>.triangle-mark { width:100%;height:100%;color:#087f5b; }
.triangle-medal>span { position:absolute;inset:62px 53px 38px;color:white; }
.triangle-medal>span svg { width:100%;height:100%; }
.triangle-eyebrow { color:var(--orange);font-size:12px;font-weight:700;margin:0 0 8px; }
.triangle-stage h1 { font-size:27px;line-height:1.5;margin:0 0 12px; }
.triangle-copy { color:var(--ink2);font-size:14px;line-height:1.9;margin:0; }
.triangle-checks { display:flex;gap:14px;font-size:11px;color:var(--acc-ink);margin:22px 0; }
.triangle-streak { display:flex;align-items:center;gap:10px;padding:12px 22px;background:var(--card);border-radius:20px;margin-bottom:28px; }
.triangle-streak b { font-size:26px;color:var(--acc-ink); }
.triangle-streak span { font-size:12px;color:var(--ink2); }
.triangle-continue { border-radius:999px;width:100%;min-height:48px; }
@keyframes triangle-arrive { from { opacity:0;transform:translateY(20px) scale(.8) rotate(-6deg); } to { opacity:1;transform:none; } }
@media(prefers-reduced-motion:reduce) { .triangle-medal { animation:none; } }

.triangle-inline .triangle-mark { width:12px;height:12px;vertical-align:middle; }

/* Explicit modal affordances and contrast in both themes. */
.triangle-celebration { color:var(--ink); }
.triangle-close { width:44px;height:44px;display:grid;place-items:center;border-radius:50%;background:var(--fill);color:var(--ink2); }
.triangle-close svg { width:16px;height:16px;display:block;stroke:currentColor; }
.triangle-stage h1 { color:var(--ink); }
.triangle-medal>span svg { display:block;color:#fff;stroke:#fff; }

/* Keep every Cards subject and difficulty option visible on narrow phones. */
.sh-body .card-settings-choices { flex-wrap: wrap; overflow-x: visible; margin: 0 0 12px; padding: 2px 0; }

/* v56: level + XP merged into the home greeting (compact, game-like) */
.hxp { display: flex; align-items: center; gap: 10px; margin-top: 6px; padding: 0; border: 0; background: none; color: var(--ink2); font: inherit; font-size: 13px; cursor: pointer; text-align: start; }
.hxp-t { white-space: nowrap; }
.hxp-bar { display: block; width: 92px; height: 6px; border-radius: 999px; background: var(--fill2, var(--fill)); overflow: hidden; }
.hxp-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--ok, #2a9d6f), var(--acc)); }
.head h1 { font-size: 30px; }

/* v57: «ساده‌تر بگو» and hints in daily pages */
.psimple { margin-top: 10px; }
.pp-simple { margin-top: 8px; padding: 10px 12px; border-radius: 14px; background: var(--fill); }
.phint { display: inline-flex; align-items: center; gap: 4px; margin: 2px 0 8px; padding: 4px 12px; border: 0; border-radius: 999px; background: var(--t-yellow, var(--fill)); color: var(--ink); font: inherit; font-size: 13px; cursor: pointer; }
.phint::before { content: "💡"; }
.phint-t { margin: 0 0 10px; padding: 8px 12px; border-radius: 12px; background: var(--fill); color: var(--ink2); font-size: 14px; line-height: 1.8; }
.pp math { font-family: "Latin Modern Math", "STIX Two Math", "Cambria Math", math; font-size: 1.08em; direction: ltr; }
.pp math[display="block"] { display: block math; margin: 6px 0; text-align: center; }
.pp img.who { float: left; width: 76px; height: 76px; margin: 2px 0 8px 12px; border-radius: 50%; object-fit: cover; box-shadow: 0 2px 10px rgba(0,0,0,.12); }
.pp table { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 14px; }
.pp th, .pp td { padding: 6px 8px; border-bottom: 1px solid var(--sep, rgba(0,0,0,.08)); text-align: start; vertical-align: top; }
.pp th { color: var(--ink2); font-weight: 700; }
/* v61 rebuilt cards: scientist line, teaching list, answer history dots */
.csay{display:flex;gap:10px;align-items:flex-start;padding:10px 12px;border-radius:18px;background:color-mix(in srgb,var(--acc,#286A9B) 9%,transparent);margin:8px 0}
.csay img{width:44px;height:44px;border-radius:50%;object-fit:cover;flex:none;box-shadow:0 1px 4px rgba(0,0,0,.15)}
.csay b{display:block;font-size:12px;opacity:.75;margin-bottom:2px}
.csay span{display:block;line-height:1.8;font-size:14px}
.csay i{display:block;font-style:normal;font-size:10px;opacity:.5;margin-top:3px}
.cteach ul{margin:4px 0 0;padding-inline-start:18px;line-height:1.85}
.cteach li{margin:2px 0}
.cdots{display:inline-flex;gap:3px;align-items:center;margin-inline-end:6px}
.cdots i{width:7px;height:7px;border-radius:50%;display:block}
.cdots i.g{background:#2e9e5b}.cdots i.r{background:#d2453d}
#cf .crow .btn{white-space:nowrap}
/* v67: question recap on top of the explanation, formulas, structured teaching */
.crecap{padding:12px 14px;border-radius:18px;background:var(--card,rgba(127,127,127,.06));margin:0 0 10px}
.crecap .cq{font-weight:700;line-height:1.8;margin-bottom:8px}
.crecap .co{padding:7px 12px;border-radius:999px;margin-top:6px;font-size:14px;background:rgba(127,127,127,.08)}
.crecap .co.right{background:rgba(46,158,91,.14);color:#1f7a45;font-weight:700}
.crecap .co.wrong{background:rgba(210,69,61,.12);color:#b2342d;text-decoration:line-through;text-decoration-thickness:1px}
.fx{font-family:"Num","Vazirmatn",sans-serif;direction:ltr;unicode-bidi:isolate;white-space:nowrap;display:inline-block;letter-spacing:0}
.fx.w{white-space:normal;display:block;text-align:center;margin:.15em 0}
.fx .fxt{white-space:nowrap}
.cteach .th{color:var(--acc,#286A9B);font-weight:700;margin-inline-end:4px}
.cteach li.trap{color:#b2342d}
.cteach li.code{color:#8A5A00;font-weight:600}
.cdots i.last{width:11px;height:11px}
.csolve ol{margin:4px 0 0;padding-inline-start:20px;line-height:1.9}.csolve{background:rgba(40,106,155,.07)}

/* ================= UI pass 1 (1405/08/21) ================= */
/* 1 · tab icons: one family, same stroke and track */
.tabbar button svg.tdi { overflow: visible; }
.tabbar button svg.tdi text { font-size: 11.5px; }
.tabbar button svg.tdi .tri-side { transition: stroke-dasharray .6s var(--ease); }
/* 2 · «نبرد»: hero ✕ that fills with today's duels, result dots, glass sheet with every duel */
.duelhero { display: flex; flex-direction: column; align-items: center; text-align: center; padding: calc(34px + env(safe-area-inset-top)) 8px 6px; }
.bigwrap { width: 148px; height: 148px; display: grid; place-items: center; margin-bottom: 14px; }
.bigmark { width: 100%; height: 100%; overflow: visible; }
.bigmark .bm-track { stroke: var(--fill2); stroke-width: 2.3; }
.bigmark .bm-fill { stroke: var(--ok); stroke-width: 2.3; stroke-dasharray: 1; stroke-dashoffset: 1; opacity: 0; }
.bigmark .bm-fill.on { opacity: 1; stroke-dashoffset: 0; animation: bmdraw .7s var(--ease) both; animation-delay: calc(var(--i) * 90ms + 120ms); }
@keyframes bmdraw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
.duelhero.full .bigmark { filter: drop-shadow(0 6px 18px color-mix(in srgb, var(--ok) 40%, transparent)); }
.duelhero .dh-t { margin: 0; font-family: "Num", "Estedad", "Vazirmatn", sans-serif; font-size: 25px; font-weight: 800; line-height: 1.35; letter-spacing: -.2px; }
.duelhero .dh-s { margin: 4px 0 0; color: var(--ink3); font-size: 14px; font-weight: 600; }
.dlog { margin-top: 20px; min-height: 44px; display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px 8px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--ink2); transition: transform .25s var(--spring); }
.dlog:active { transform: scale(.96); }
.dlog .cdots { margin: 0; gap: 5px; }
.dlog .cdots i { width: 8px; height: 8px; }
.dlog .cdots i.last { width: 12px; height: 12px; }
.duelgo { margin: 26px 4px 0; text-align: center; }
.duelgo .meta { margin: 0 0 12px; font-size: 13px; }
.cdots i.g { background: var(--ok); } .cdots i.r { background: var(--bad); }
.sheet.glassy { background: color-mix(in srgb, var(--bg) 72%, transparent); -webkit-backdrop-filter: blur(30px) saturate(180%); backdrop-filter: blur(30px) saturate(180%); border-top: .5px solid var(--glass-edge); }
.sheet.glassy .sh-layer { background: transparent; }
.sheet.glassy .list { background: color-mix(in srgb, var(--card) 82%, transparent); }
.dsum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 2px 0 6px; text-align: center; }
.dsum div { background: color-mix(in srgb, var(--card) 82%, transparent); border-radius: 18px; padding: 10px 4px; display: flex; flex-direction: column; }
.dsum b { font-size: 22px; font-weight: 800; }
.dsum span { font-size: 12px; color: var(--ink3); font-weight: 650; }
.sec.dday { font-size: 15px; margin: 16px 6px 8px; color: var(--ink2); }
.dlist .li { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; }
.dres { font-size: 12.5px; font-weight: 750; padding: 3px 11px; border-radius: 999px; }
.dres.win { background: var(--ok-bg); color: var(--ok); } .dres.loss { background: var(--bad-bg); color: var(--bad); }
.dsc { display: inline-flex; gap: 6px; align-items: baseline; font-weight: 750; }
.dsc i { font-style: normal; color: var(--ink3); }
.dnote { line-height: 1.9; margin: 16px 4px 0; }
@media (prefers-reduced-motion: reduce) { .bigmark .bm-fill.on { animation: none; } }

/* 3 · «کارت» top: the tab's rounded square at hero size, today's count inside */
.ctopbar { grid-template-columns: 44px 1fr 44px; }
.ctopbar button.cstat { min-height: 64px; padding: 0; display: grid; place-items: center; border-radius: 18px; }
.csq { position: relative; width: 64px; height: 64px; display: grid; place-items: center; transition: transform .3s var(--spring); }
.cstat:active .csq { transform: scale(.94); }
.csq svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.csq .sq-track { fill: none; stroke: var(--fill2); stroke-width: 1.9; }
.csq .sq-fill { fill: none; stroke: var(--ok); stroke-width: 1.9; stroke-linecap: round; transition: stroke-dashoffset .8s var(--ease); }
.csq.full .sq-fill { filter: drop-shadow(0 2px 6px color-mix(in srgb, var(--ok) 45%, transparent)); }
.csq-n { position: relative; display: flex; flex-direction: column; align-items: center; line-height: 1; gap: 3px; }
.csq-n b { font-size: 21px; font-weight: 800; color: var(--ink); letter-spacing: -.3px; }
.csq-n small { font-size: 9.5px; font-weight: 700; color: var(--ink3); }
.csq.full .csq-n b { color: var(--ok); }
@media (prefers-reduced-motion: reduce) { .csq .sq-fill { transition: none; } }

/* 5 · one floating button under the card: «نمی‌دانم» or the green «بعدی» */
.ctab .cbottom { justify-content: center; }
.ctab .cbottom .hid { display: none; }
.ctab .cbottom .cdk { min-width: 132px; height: 50px; animation: capIn .38s var(--spring) both; }
.ctab .cbottom .cdk.cnext { min-width: 168px; background: var(--acc); color: #fff; border-color: transparent; box-shadow: 0 8px 24px color-mix(in srgb, var(--acc) 38%, transparent), inset 0 1px 0 rgba(255,255,255,.25); }
@keyframes capIn { from { opacity: 0; transform: translateY(8px) scale(.94); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .ctab .cbottom .cdk { animation: none; } }

/* 11 · the card: a real material with depth; the two answers are separate capsules */
.ctab .cwrap { column-gap: 12px; row-gap: 16px; }
.cardsv .ccard {
  background: linear-gradient(180deg, color-mix(in srgb, var(--card) 100%, #fff 0%), color-mix(in srgb, var(--card) 97%, var(--acc) 3%));
  border: .5px solid color-mix(in srgb, var(--ink) 8%, transparent);
  border-radius: 30px; padding: 26px 24px; min-height: 236px; gap: 14px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 1px 2px rgba(17,24,39,.05), 0 10px 24px -8px rgba(17,24,39,.12), 0 30px 60px -24px rgba(17,24,39,.22);
}
.cardsv .ccard .cp { font-size: calc(21px * var(--cfs)); font-weight: 720; line-height: 1.95; letter-spacing: -.1px; text-wrap: pretty; }
.cardsv .ccard.dkp { box-shadow: 0 0 0 2px rgba(245,158,11,.45), 0 10px 24px -8px rgba(17,24,39,.12), 0 30px 60px -24px rgba(17,24,39,.22); }
.cardsv .ccard.dk { box-shadow: 0 0 0 3px #f59e0b, 0 10px 24px -8px rgba(17,24,39,.12), 0 30px 60px -24px rgba(17,24,39,.22); }
.cardsv .cside {
  position: relative; min-height: 64px; padding: 12px 26px; border-radius: 24px; font-size: 15.5px; font-weight: 720; line-height: 1.55;
  background: var(--card);
  border: 1.5px solid color-mix(in srgb, var(--ink) 7%, transparent);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7), 0 1px 2px rgba(17,24,39,.04), 0 8px 20px -10px rgba(17,24,39,.16);
}
/* a faint arrow on the outer edge: «drag the card this way» */
.cardsv .cside::after { content: ""; position: absolute; top: 50%; width: 7px; height: 7px; margin-top: -4px; border: solid var(--ink3); border-width: 1.6px 1.6px 0 0; opacity: .55; border-radius: 1px; }
.cardsv .cside.r::after { right: 13px; transform: rotate(45deg); }
.cardsv .cside.l::after { left: 13px; transform: rotate(-135deg); }
.cardsv .cside.hot { border-color: var(--acc); transform: scale(1.03); }
.cardsv .cside.good { background: var(--ok-bg); border-color: color-mix(in srgb, var(--ok) 70%, transparent); color: var(--ok); }
.cardsv .cside.good::after, .cardsv .cside.dim::after { display: none; }
.cardsv .cside.dim { opacity: .42; box-shadow: none; }
.crecap { padding: 14px 16px; border-radius: 22px; background: var(--card); box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 6px 18px -10px rgba(17,24,39,.16); border: .5px solid color-mix(in srgb, var(--ink) 6%, transparent); }
.crecap .co { padding: 9px 14px; margin-top: 8px; border-radius: 999px; line-height: 1.6; }
.crecap .co.right { background: var(--ok-bg); color: var(--ok); }
.crecap .co.wrong { background: var(--bad-bg); color: var(--bad); }
:root[data-theme="dark"] .cardsv .ccard, :root[data-theme="dark"] .cardsv .cside, :root[data-theme="dark"] .crecap { box-shadow: inset 0 1px 0 rgba(255,255,255,.07), 0 12px 30px -12px rgba(0,0,0,.7); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cardsv .ccard, :root:not([data-theme="light"]) .cardsv .cside, :root:not([data-theme="light"]) .crecap { box-shadow: inset 0 1px 0 rgba(255,255,255,.07), 0 12px 30px -12px rgba(0,0,0,.7); } }
.csq.flip { animation: sqflip .42s var(--ease) both; }
@keyframes sqflip { from { transform: perspective(300px) rotateY(-90deg) scale(.96); opacity: .4; } to { transform: none; opacity: 1; } }
.csq.round .sq-fill { stroke: var(--acc); }
.csq.round .csq-n b { font-size: 17px; }
@media (prefers-reduced-motion: reduce) { .csq.flip { animation: none; } }

/* update capsule: steady (no press transform, no centering transform to fight with), clear busy state */
.updbar { left: 0; right: 0; margin: 0 auto; width: max-content; max-width: calc(100vw - 32px); transform: none !important; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; background: #0a84ff; touch-action: manipulation; user-select: none; -webkit-user-select: none; transition: background .2s, opacity .2s; animation: none; }
.updbar:active { background: #0070e0; }
.updbar.busy { background: #0a6fd6; opacity: .96; cursor: progress; }
.updbar:disabled { color: #fff; }
.upd-spin { width: 15px; height: 15px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; animation: updspin .8s linear infinite; flex: none; }
@keyframes updspin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .upd-spin { animation-duration: 2.4s; } }
body.tb-mini .updbar { bottom: auto; top: calc(env(safe-area-inset-top) + 92px); }

/* the whole screen belongs to the page, so a swipe on the empty lower part of a short page still reaches it */
body { min-height: 100vh; min-height: 100dvh; }

/* 6 · home header: a small glass capsule (inset initial + name, long names end in …), the greeting, one level bar + one line */
.homehead { padding: calc(14px + env(safe-area-inset-top)) 4px 12px; }
.homehead .hh-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.homehead .eyebrow { flex: 1 1 auto; font-size: 13px; font-weight: 650; color: var(--ink3); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.homehead h1 { margin: 8px 0 0; font-family: "Num", "Estedad", "Vazirmatn", sans-serif; font-size: 32px; font-weight: 800; line-height: 1.25; letter-spacing: -.4px; overflow-wrap: anywhere; }
.namebtn { flex: 0 1 auto; display: flex; align-items: center; gap: 8px; min-width: 0; max-width: 44%; height: 40px; min-height: 40px; padding-block: 0; padding-inline: 5px 14px; border-radius: 999px; font-size: 14px; font-weight: 700; line-height: 1; color: var(--ink); transition: transform .25s var(--spring); }
.namebtn:active { transform: scale(.96); }
.namebtn .av { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; font-family: "Estedad", "Vazirmatn", sans-serif; font-size: 14px; font-weight: 800; line-height: 1; color: var(--acc-ink); background: var(--t-acc); box-shadow: inset 0 0 0 .5px color-mix(in srgb, var(--acc) 28%, transparent); }
.namebtn .nm { min-width: 0; max-width: 9.5em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-block: 2px; }
.lvbar { display: block; width: 100%; margin-top: 14px; padding: 2px 0; background: none; border: 0; cursor: pointer; text-align: start; color: inherit; }
.lvbar:active .lv-track { opacity: .8; }
.lv-track { display: block; height: 8px; border-radius: 999px; background: var(--fill2); overflow: hidden; }
.lv-track i { display: block; height: 100%; min-width: 8px; border-radius: 999px; background: linear-gradient(270deg, #34c890, var(--acc)); transition: width .8s var(--ease); }
.lv-left { display: block; margin-top: 8px; font-size: 13px; font-weight: 600; color: var(--ink3); }
.lv-left .n { color: var(--ink2); font-weight: 750; }

/* 7 · «امروز تا مثلث»: the triangle filling side by side + three tappable sides (lesson, cards, duels) */
.tri-today { display: flex; align-items: center; gap: 16px; padding: 16px 18px 14px 16px; }
.tt-fig { flex: none; width: 92px; height: 92px; display: grid; place-items: center; }
.tt-svg { width: 92px; height: 92px; overflow: visible; }
.tt-svg path { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tt-svg .tt-track { stroke: var(--fill2); }
.tt-svg .tt-fill { stroke: color-mix(in srgb, var(--ok) 72%, var(--fill2)); transition: stroke-dasharray .8s var(--ease); }
.tt-svg .tt-fill.full { stroke: var(--ok); }
.tt-svg text { font-family: "Num", "Estedad", "Vazirmatn", sans-serif; font-size: 4.3px; font-weight: 800; fill: var(--ink); }
.tt-svg.done .tt-solid { fill: var(--ok); stroke: var(--ok); }
.tt-svg.done .tt-check { stroke: #fff; stroke-width: 1.9; }
.tt-main { flex: 1; min-width: 0; }
.tri-today h3 { margin: 0 2px 4px; font-family: "Num", "Estedad", "Vazirmatn", sans-serif; font-size: 17px; font-weight: 800; }
.tt-sides { display: flex; flex-direction: column; }
.tt-side { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 10px; width: 100%; padding: 6px 2px 7px; text-align: start; color: var(--ink); border: 0; border-radius: 10px; transition: transform .25s var(--spring), background .2s; }
.tt-side:active { transform: scale(.98); background: var(--fill); }
.tt-l { grid-row: 1; font-size: 14px; font-weight: 700; }
.tt-v { grid-row: 1; font-size: 12.5px; font-weight: 650; color: var(--ink3); display: inline-flex; align-items: center; }
.tt-side.ok .tt-v { color: var(--ok); }
.tt-bar { grid-row: 2; grid-column: 1 / -1; display: block; height: 4px; border-radius: 999px; background: var(--fill2); overflow: hidden; }
.tt-bar b { display: block; height: 100%; border-radius: 999px; background: color-mix(in srgb, var(--ok) 72%, var(--fill2)); transition: width .8s var(--ease); }
.tt-side.ok .tt-bar b { background: var(--ok); }
.tri-today.done { background: color-mix(in srgb, var(--ok) 8%, var(--card)); }

/* 8 · library: secondary — a small quiet heading and one grouped list of three rows */
.sec.lib-sec { font-size: 15px; font-weight: 750; color: var(--ink3); margin: 26px 8px 8px; }
.lib { background: var(--card); border-radius: 22px; overflow: hidden; margin-bottom: 12px; box-shadow: var(--card-shadow); }
.librow { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 16px 11px 14px; text-align: start; color: var(--ink); transition: background .2s; }
.librow:active { background: var(--fill); }
.librow + .librow { border-top: 0.5px solid var(--sep); }
.lib .librow + .librow, .list .librow + .librow { box-shadow: none; }
.librow .lt-ic { flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; }
.librow .lr-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.librow b { font-size: 14.5px; font-weight: 700; line-height: 1.4; }
.librow small { font-size: 12px; color: var(--ink3); line-height: 1.45; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.librow .chev { flex: none; color: var(--ink3); font-weight: 600; }
.tone-blue { background: var(--t-blue); color: var(--blue); } .tone-orange { background: var(--t-orange); color: var(--orange); }
.tone-acc { background: var(--t-acc); color: var(--acc-ink); } .tone-violet { background: var(--t-violet); color: var(--violet); }
.tone-red { background: var(--bad-bg); color: var(--bad); } .tone-yellow { background: var(--t-yellow); color: var(--yellow); }

/* 8b · «درسنامهٔ رتبه یک» header: what it was built from, how much it condenses, how much of the exam it answered */
.bk-hero { position: relative; overflow: hidden; margin: 2px 0 14px; padding: 20px 18px 16px; border-radius: 24px; background: radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--acc) 16%, var(--card)), var(--card) 70%); box-shadow: var(--card-shadow); }
.bk-eye { margin: 0; font-size: 12.5px; font-weight: 750; color: var(--acc-ink); }
.bk-hero h2 { margin: 4px 0 8px; text-wrap: balance; font-family: "Num", "Estedad", "Vazirmatn", sans-serif; font-size: 21px; font-weight: 800; line-height: 1.4; letter-spacing: -.2px; }
.bk-copy { margin: 0 0 12px; font-size: 14px; line-height: 1.85; color: var(--ink2); }
.bk-src { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 16px; }
.bk-src span { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--fill); color: var(--ink2); }
.bk-src .more { background: none; color: var(--ink3); padding-inline: 2px; }
.bk-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.bk-stats > div { padding: 10px 8px 9px; border-radius: 16px; background: color-mix(in srgb, var(--fill) 70%, transparent); text-align: center; }
.bk-stats b { display: block; font-family: "Num", "Estedad", "Vazirmatn", sans-serif; font-size: 20px; font-weight: 800; line-height: 1.3; }
.bk-stats small { display: block; font-size: 11.5px; color: var(--ink3); font-weight: 600; line-height: 1.45; }
.bk-stats .hit { background: var(--t-acc); } .bk-stats .hit b { color: var(--acc-ink); }
.bk-note { margin: 12px 2px 0; font-size: 12.5px; line-height: 1.8; color: var(--ink3); }
.list.bk-more { margin-bottom: 0; }

/* 9 · the triangle celebration: the three sides draw one after another, the medal fills, a check and a few sparks */
.triangle-celebration { background: radial-gradient(120% 70% at 50% 28%, color-mix(in srgb, var(--acc) 16%, var(--bg)), var(--bg) 62%); }
.triangle-medal { animation: none; filter: none; }
.triangle-medal > .triangle-mark { position: relative; z-index: 1; animation: tri-fill .5s ease-out 1.15s both; filter: drop-shadow(0 16px 25px #087f5b40); }
.tri-draw { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; overflow: visible; }
.tri-draw path { fill: none; stroke: var(--acc); stroke-width: 5; stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: 3; stroke-dashoffset: 3; animation: tri-draw 1.1s cubic-bezier(.45,.05,.3,1) .15s both, tri-fade .35s ease-out 1.35s both; }
.triangle-medal > span { z-index: 3; animation: tri-check .55s cubic-bezier(.3,1.5,.5,1) 1.4s both; }
.tri-glow { position: absolute; inset: -30%; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--acc) 34%, transparent), transparent 62%); opacity: 0; animation: tri-glow 2.4s ease-out 1.2s both; }
.tri-spark { position: absolute; left: 50%; top: 58%; width: 6px; height: 6px; margin: -3px; border-radius: 50%; background: var(--acc); opacity: 0; z-index: 0; transform: rotate(var(--a)) translateY(0); animation: tri-spark .9s ease-out calc(1.3s + var(--d)) both; }
.tri-spark:nth-child(3n) { background: var(--orange); width: 5px; height: 5px; }
.triangle-stage > :not(.triangle-medal):not(.triangle-close) { animation: tri-up .6s var(--ease) both; animation-delay: 1.5s; }
.triangle-stage > h1 { animation-delay: 1.55s !important; } .triangle-stage > .triangle-copy { animation-delay: 1.62s !important; }
.triangle-stage > .triangle-checks { animation-delay: 1.7s !important; } .triangle-stage > .triangle-streak { animation-delay: 1.78s !important; } .triangle-stage > .triangle-continue { animation-delay: 1.86s !important; }
@keyframes tri-draw { to { stroke-dashoffset: 0; } }
@keyframes tri-fade { to { opacity: 0; } }
@keyframes tri-fill { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
@keyframes tri-check { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: none; } }
@keyframes tri-glow { 0% { opacity: 0; transform: scale(.6); } 35% { opacity: 1; } 100% { opacity: .55; transform: scale(1); } }
@keyframes tri-spark { 0% { opacity: 0; transform: rotate(var(--a)) translateY(0) scale(.6); } 25% { opacity: 1; } 100% { opacity: 0; transform: rotate(var(--a)) translateY(-118px) scale(1); } }
@keyframes tri-up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .triangle-medal > .triangle-mark, .triangle-medal > span, .tri-glow, .triangle-stage > * { animation: none !important; }
  .tri-draw, .tri-spark { display: none; } .tri-glow { opacity: .55; }
}
.triangle-continue:focus-visible { outline: 3px solid color-mix(in srgb, var(--acc) 40%, transparent); outline-offset: 3px; }

/* 10 · progress: one glance card, one calendar month at a time, details folded */
.pglance { display: grid; grid-template-columns: repeat(4, 1fr); padding: 16px 6px; }
.pglance .pg-c { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; min-width: 0; padding: 0 4px; }
.pglance .pg-c + .pg-c { border-inline-start: .5px solid var(--sep); }
.pglance b { font-size: 22px; font-weight: 800; line-height: 1.3; display: inline-flex; align-items: center; gap: 4px; }
.pglance b small { font-size: 12px; margin-inline-start: 3px; color: var(--ink3); font-weight: 700; }
.pglance .pg-c > span { font-size: 11.5px; color: var(--ink3); font-weight: 650; line-height: 1.4; }
.pglance .triangle-small-medal { display: inline-grid; }
.pglance .triangle-small-medal .triangle-mark { width: 17px; height: 17px; }
.pcal-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pcal-nav { display: flex; align-items: center; gap: 4px; }
.pcal-m { font-family: "Num", "Estedad", sans-serif; font-size: 14px; font-weight: 750; min-width: 92px; text-align: center; }
.pcal-b { width: 36px; height: 36px; border-radius: 50%; background: var(--fill); color: var(--ink2); font-size: 20px; line-height: 1; display: grid; place-items: center; }
.pcal-b:disabled { opacity: .35; }
.pcal .cmonth { margin-top: 10px; }
.pcal .clegend { margin-top: 12px; }
.pcal .clegend .triangle-mark { width: 14px; height: 14px; color: #087f5b; margin-inline-start: 6px; }
.pcal-note { margin-top: 6px; }
.pmore > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; cursor: pointer; }
.pmore > summary::-webkit-details-marker { display: none; }
.pmore > summary h3 { margin: 0; }
.pmore > summary .chev { transition: transform .3s var(--ease); }
.pmore[open] > summary .chev { transform: rotate(-90deg); }

/* 7 · accounts: quick switch on the sign-in screen, invites in settings */
.accs { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: -6px 0 16px; }
.acc-chip { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 4px 14px 4px 5px; border-radius: 999px; background: var(--card); box-shadow: var(--card-shadow); font-size: 14px; font-weight: 700; color: var(--ink); }
.acc-chip .av { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--t-acc); color: var(--acc-ink); font-weight: 800; }
.acc-chip.on { box-shadow: 0 0 0 2px var(--acc); }
.field { width: 100%; border: none; background: var(--card); color: var(--ink); border-radius: 999px; padding: 14px 18px; font: inherit; font-size: 16px; outline: none; box-shadow: var(--card-shadow); }
.field:focus { box-shadow: 0 0 0 2px var(--acc); }
.invcode { margin-top: 16px; padding: 18px; border-radius: 22px; background: var(--card); text-align: center; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.invcode b { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 26px; letter-spacing: 2px; color: var(--acc-ink); }
.invcode span { font-size: 12.5px; color: var(--ink3); }
.invcode .btn { width: auto; padding: 10px 26px; margin-top: 6px; }
.li small { display: block; font-size: 12px; color: var(--ink3); }

/* 10 · card settings popover: grows out of the gear, full width with side margins, small type, closes on any outside tap */
.cpop-catch { position: fixed; inset: 0; z-index: 62; background: transparent; }
.cpop { position: fixed; z-index: 63; inset-inline: 12px; padding: 12px 14px 8px; border-radius: 24px; display: flex; flex-direction: column; gap: 4px;
  opacity: 0; transform: scale(.32); transition: transform .34s cubic-bezier(.3, 1.28, .5, 1), opacity .2s ease; will-change: transform, opacity; }
.cpop.on { opacity: 1; transform: none; }
.cpop.closing { transition: transform .22s cubic-bezier(.4, 0, .9, .5), opacity .18s ease .04s; }
.cp-row { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; padding-bottom: 6px; }
.cp-row + .cp-row { padding-top: 8px; border-top: 0.5px solid var(--sep); }
.cp-chips { flex: 1 1 auto; display: flex; flex-wrap: wrap; gap: 5px; }
.cp-chips button { flex: 1 1 auto; }
.cp-k { font-size: 12px; font-weight: 750; color: var(--ink2); margin-inline-end: 2px; white-space: nowrap; }
.cpop button { min-height: 30px; padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 650; line-height: 1.4; color: var(--ink2); background: color-mix(in srgb, var(--ink) 7%, transparent); white-space: nowrap; transition: background .2s, color .2s, transform .22s var(--spring); }
.cpop button:active { transform: scale(.94); }
.cpop button.on { background: var(--ink); color: var(--card); }
@media (prefers-reduced-motion: reduce) { .cpop, .cpop.closing { transition: opacity .15s ease; transform: none; } }
/* v91 home: no title on the progress card; «تا مثلث امروز» above the triangle on the right; library = one shelf of three tiles */
#go-prog .wk-line { margin: 0 2px 8px; font-size: 13px; }
.tt-fig { width: 104px; height: auto; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.tt-fig h3 { margin: 0; font-size: 14.5px; white-space: nowrap; }
.tt-fig .tt-svg { width: 88px; height: 88px; }
.tt-main { align-self: center; }
.lib { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; background: none; box-shadow: none; border-radius: 0; overflow: visible; }
.libtile { aspect-ratio: 1 / 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 10px 8px; border-radius: 22px; background: var(--card); box-shadow: var(--card-shadow); color: var(--ink); text-align: center; transition: transform .2s var(--ease), background .2s; }
.libtile:active { transform: scale(.96); background: var(--fill); }
.libtile .lt-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; }
.libtile .lt-ic svg { width: 21px; height: 21px; }
.libtile b { font-size: 13px; font-weight: 750; line-height: 1.45; }
.lib { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.libtile { min-width: 0; width: 100%; }
.libtile b { font-size: 12.5px; overflow-wrap: anywhere; }
/* ================= Duel pass (1405/08/21) ================= */
/* chevrons: drawn icons, one rule for RTL — «open / next» points left at the row's left end, «back / previous» points right */
:root { --chev-f: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 5l-7 7 7 7'/%3E%3C/svg%3E"); }
.chev { display: inline-flex; align-items: center; justify-content: center; flex: none; color: var(--ink3); line-height: 1; vertical-align: middle; }
.chev svg { width: 14px; height: 14px; display: block; }
.li .v .chev svg { width: 15px; height: 15px; }
.wk h3 .chev { float: inline-end; margin-top: .35em; }
.wk h3 .chev svg { width: 15px; height: 15px; }
.pmore > summary .chev svg { width: 16px; height: 16px; }
.past-day-meta .chev svg, .btn .chev svg, .bq .chev svg { width: 11px; height: 11px; }
.past-day-meta .chev, .btn .chev, .bq .chev { margin-inline-start: 3px; color: inherit; opacity: .7; }
.crumbs i { display: inline-flex; }
.crumbs i svg { width: 11px; height: 11px; }
.pcal-b svg { width: 17px; height: 17px; }

/* «نبرد» page: today's count under the ✕, then the capsule of the last 8 duels (the whole capsule opens the sheet) */
.duelhero .dh-t .n { margin-inline-end: 2px; }
.dlog { padding: 8px 16px; }

/* the duel itself: full screen, tab bar hidden, ✕ top-right is the way out */
body.duel-on .tabbar { visibility: hidden; }
.qv.duelmode .qtop .x { width: 40px; height: 40px; }
.qv.duelmode .qtimer { height: 5px; margin-bottom: 4px; }
.qv.duelmode .qtimer i { transition: width .25s linear, background .4s; }
.qv.duelmode .qmeta { margin-top: 0; }
.qv.duelmode .stem { font-size: 17px; line-height: 1.95; margin-bottom: 14px; }
.qv.duelmode .opts { gap: 8px; }
.qv.duelmode .opt { padding: 12px 14px; font-size: 15.5px; line-height: 1.75; border-radius: 18px; }
.qv.duelmode .opts.done .opt.right { animation: dpop .45s var(--spring); }
@keyframes dpop { 40% { transform: scale(1.02); } }
.duel { grid-template-columns: 1fr auto 1fr; gap: 6px; margin: 2px 0 12px; padding: 12px 8px 10px; border-radius: 24px; background: var(--card); box-shadow: var(--card-shadow); }
.duel .av { width: 40px; height: 40px; font-size: 17px; margin-bottom: 2px; }
.duel .av.me, .dfin .av.me { background: var(--acc); }
.duel .av.ai, .dfin .av.ai { background: var(--orange); }
.duel .sc { font-size: 26px; font-weight: 750; line-height: 1.2; transition: transform .3s var(--spring); }
.duel .vs { display: flex; flex-direction: column; align-items: center; line-height: 1.15; color: var(--ink3); font-size: 11.5px; font-weight: 700; }
.duel .vs b { font-size: 22px; color: var(--ink); font-weight: 800; }
.duel .vs small { font-size: 11px; font-weight: 650; }
.duel .dots { gap: 3px; margin-top: 6px; }
.duel .dots i { width: 7px; height: 7px; }
.duel .dots i.gap { margin-inline-end: 4px; }
/* between rounds: a short calm card inside the duel */
.dround { min-height: 46vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; animation: dround .5s var(--ease) both; }
@keyframes dround { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
.dround .dr-k { font-family: "Num", "Estedad", "Vazirmatn", sans-serif; font-size: 15px; font-weight: 700; color: var(--ink3); }
.dround .dr-k b { font-size: 34px; color: var(--ink); margin: 0 4px; }
.dround .dr-sc { display: inline-flex; align-items: baseline; gap: 12px; font-size: 40px; font-weight: 800; }
.dround .dr-sc b:first-child { color: var(--acc); } .dround .dr-sc b:last-child { color: var(--orange); }
.dround .dr-sc i { font-style: normal; color: var(--ink3); font-weight: 600; }
.dround .dr-t { font-size: 14px; color: var(--ink2); font-weight: 600; }

/* end of a duel: the score, then the missed ones taught first, then every question of the duel */
.dfin-wrap { padding-top: 8px; }
.dfin { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 6px 0 4px; }
.dfin-mark { width: 86px; height: 86px; margin-bottom: 10px; }
.dfin h2 { margin: 0 0 8px; font-family: "Num", "Estedad", "Vazirmatn", sans-serif; font-size: 27px; font-weight: 800; }
.dfin.loss h2 { color: var(--ink); }
.dfin-sc { display: inline-flex; align-items: center; gap: 14px; padding: 8px 14px; border-radius: 999px; background: var(--card); box-shadow: var(--card-shadow); }
.dfin-sc .p { display: inline-flex; align-items: center; gap: 10px; }
.dfin-sc b { font-size: 26px; font-weight: 800; line-height: 1; }
.dfin-sc .av { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-style: normal; font-size: 14px; font-weight: 800; }
.dfin-sc .vs { font-style: normal; color: var(--ink3); font-weight: 600; }
.dfin p { margin: 12px 0 0; color: var(--ink3); font-size: 13px; line-height: 1.8; }
.dsec { margin: 26px 4px 2px; font-family: "Num", "Estedad", "Vazirmatn", sans-serif; font-size: 19px; font-weight: 800; }
.dsec-s { margin: 0 4px 10px; color: var(--ink3); font-size: 13px; line-height: 1.85; }
.dteach { background: var(--card); border-radius: 22px; padding: 14px 15px 12px; margin-bottom: 10px; box-shadow: var(--card-shadow); text-align: start; }
.dt-m { font-size: 12px; font-weight: 700; color: var(--acc-ink); margin-bottom: 4px; }
.dt-s { font-size: 14.5px; line-height: 1.9; font-weight: 600; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; }
.dt-o { display: flex; gap: 8px; align-items: flex-start; padding: 7px 12px; border-radius: 14px; margin-bottom: 5px; font-size: 13.5px; line-height: 1.75; }
.dt-o i { flex: none; font-style: normal; font-weight: 800; }
.dt-o.right { background: var(--ok-bg); color: var(--ok); font-weight: 650; }
.dt-o.wrong { background: var(--bad-bg); color: var(--bad); }
.dt-o.wrong span { text-decoration: line-through; text-decoration-thickness: 1px; }
.dt-skip { font-size: 12px; font-weight: 700; color: var(--ink3); margin: 0 4px 5px; }
.dt-k, .dt-w { margin-top: 8px; padding: 10px 12px; border-radius: 16px; font-size: 14px; line-height: 1.9; }
.dt-k { background: var(--t-acc); }
.dt-w { background: color-mix(in srgb, var(--yellow) 13%, var(--card)); }
.dt-k b, .dt-w b { display: block; font-size: 12.5px; font-weight: 800; margin-bottom: 2px; }
.dt-k b { color: var(--acc-ink); } .dt-w b { color: color-mix(in srgb, var(--yellow) 70%, var(--ink)); }
.dt-k p, .dt-w p { margin: 0; }
.dt-more { display: inline-flex; align-items: center; gap: 4px; margin-top: 8px; padding: 6px 12px; border-radius: 999px; background: var(--fill); color: var(--ink2); font-size: 13px; font-weight: 700; }
.dt-more .chev svg { width: 11px; height: 11px; }
.dperfect { margin: 22px 4px 0; padding: 14px 16px; border-radius: 20px; background: var(--ok-bg); color: var(--ok); font-weight: 700; text-align: center; }
.dqlist { text-align: start; }
.dqlist .li.dq { justify-content: flex-start; gap: 12px; padding: 11px 14px; }
.dq-r { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.dq-r svg { width: 13px; height: 13px; }
.dq-r.ok { background: var(--ok); } .dq-r.bad { background: var(--bad); }
.dq-t { flex: 1; min-width: 0; font-size: 13.5px; line-height: 1.75; color: var(--ink); }
.dq-t small { display: block; font-size: 11.5px; color: var(--ink3); font-weight: 650; }
.dqlist .li.dq .chev { margin-inline-start: auto; }
@media (prefers-reduced-motion: reduce) { .dround, .qv.duelmode .opts.done .opt.right { animation: none; } }
.duel .av.ai svg, .dfin-sc .av.ai svg { width: 44%; height: 44%; }
.duel .who { display: block; font-size: 11px; font-weight: 700; color: var(--ink3); line-height: 1.3; }
.qv.duelmode .qbar { background: linear-gradient(to top, var(--bg) 62%, color-mix(in srgb, var(--bg) 0%, transparent)); padding-top: 22px; }
.bk-legal { margin: 14px 2px 0; font-size: 11.5px; line-height: 1.8; color: var(--ink3); text-align: center; }
/* v95 booklet hero: 5% → 85% → 100% flow, punch line, pastel source mosaic */
.bk-flow { margin: 16px 0 6px; display: flex; flex-direction: column; gap: 2px; }
.bf-row { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; column-gap: 10px; align-items: end; }
.bf-row b { grid-column: 2; grid-row: 1; font-family: "Num", "Estedad", sans-serif; font-size: 26px; font-weight: 900; line-height: 1.1; }
.bf-row span { grid-column: 1; grid-row: 1; font-size: 13px; font-weight: 650; color: var(--ink2); }
.bf-bar { grid-column: 1 / -1; grid-row: 2; display: block; height: 10px; margin-top: 6px; border-radius: 999px; background: var(--fill2); position: relative; overflow: hidden; }
.bf-bar::after { content: ""; position: absolute; inset: 0 auto 0 0; inset-inline-start: 0; width: var(--w); border-radius: 999px; background: color-mix(in srgb, var(--ink3) 55%, var(--fill2)); }
.bf-bar.hit::after { background: color-mix(in srgb, var(--ok) 75%, var(--fill2)); }
.bf-bar.full::after { background: var(--ok); }
.bf-arrow { height: 16px; width: 2px; margin: 4px auto; background: linear-gradient(var(--fill2), var(--ok)); position: relative; }
.bf-arrow::after { content: ""; position: absolute; bottom: -2px; left: 50%; width: 8px; height: 8px; border-right: 2px solid var(--ok); border-bottom: 2px solid var(--ok); transform: translateX(-50%) rotate(45deg); }
.bk-punch { margin: 14px 2px 4px; font-family: "Num", "Estedad", "Vazirmatn", sans-serif; font-size: 16.5px; font-weight: 850; line-height: 1.7; }
.bk-src { display: flex; flex-wrap: wrap; gap: 6px; }
.bk-src span { padding: 5px 11px; border-radius: 999px; font-size: 11.5px; font-weight: 650; color: var(--ink2); }
.bk-src span.wide { font-size: 11px; }
.bk-src .t0 { background: color-mix(in srgb, #286A9B 12%, var(--card)); } .bk-src .t1 { background: color-mix(in srgb, #0A6F6D 12%, var(--card)); }
.bk-src .t2 { background: color-mix(in srgb, #8A5A00 12%, var(--card)); } .bk-src .t3 { background: color-mix(in srgb, #60427F 12%, var(--card)); }
.bk-src .t4 { background: color-mix(in srgb, #B83242 10%, var(--card)); } .bk-src .t5 { background: color-mix(in srgb, #26323A 9%, var(--card)); }
.bf-bar::after { inset: 0 0 0 auto; right: 0; left: auto; }
.bf-bar:not(.hit):not(.full)::after { background: color-mix(in srgb, var(--ok) 45%, var(--fill2)); min-width: 12px; }

/* duel round 2 (1405/08/21): «رقیبت: سایهٔ رتبه یک» under the start button; the category pick before each round */
.duelgo .drival { margin: 12px 0 0; display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 650; color: var(--ink3); }
.duelgo .drival .av { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--orange) 16%, var(--card)); color: var(--orange); }
.duelgo .drival .av svg { width: 52%; height: 52%; }
.dpick { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 10px 0 8px; animation: dround .45s var(--ease) both; }
.dpick .dp-k { font-family: "Num", "Estedad", "Vazirmatn", sans-serif; font-size: 13px; font-weight: 700; color: var(--ink3); }
.dpick .dp-k b { font-size: 15px; color: var(--ink2); margin: 0 2px; }
.dpick .dp-t { margin: 4px 0 18px; font-family: "Estedad", "Vazirmatn", sans-serif; font-size: 23px; font-weight: 800; line-height: 1.45; letter-spacing: -.2px; }
.dp-grid { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dcat { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-height: 128px; padding: 16px 16px 14px; border-radius: 28px; text-align: start;
  background: color-mix(in srgb, var(--t) 70%, var(--glass)); -webkit-backdrop-filter: blur(22px) saturate(180%); backdrop-filter: blur(22px) saturate(180%);
  border: 0.5px solid color-mix(in srgb, var(--h) 18%, var(--glass-edge)); box-shadow: var(--card-shadow), inset 0 1px 0 rgba(255,255,255,.5);
  transition: transform .3s var(--spring), box-shadow .3s var(--ease), opacity .25s var(--ease); -webkit-tap-highlight-color: transparent; }
.dcat:active { transform: scale(.955); }
.dcat .dc-i { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 8px; color: var(--h); background: color-mix(in srgb, var(--h) 14%, var(--card)); }
.dcat .dc-i svg { width: 23px; height: 23px; }
.dcat .dc-n { font-family: "Estedad", "Vazirmatn", sans-serif; font-size: 16px; font-weight: 800; color: var(--ink); line-height: 1.4; }
.dcat .dc-s { font-size: 11.5px; font-weight: 600; color: var(--ink3); line-height: 1.5; }
.dcat .dc-was { position: absolute; top: 14px; inset-inline-end: 14px; padding: 2px 8px; border-radius: 999px; font-style: normal; font-size: 10.5px; font-weight: 700; color: color-mix(in srgb, var(--h) 80%, var(--ink)); background: color-mix(in srgb, var(--h) 13%, var(--card)); }
.dcat[disabled] { opacity: .4; }
.dp-grid.busy .dcat:not(.on) { opacity: .35; transform: scale(.97); }
.dp-grid.busy .dcat.on { transform: scale(1.03); box-shadow: 0 10px 28px color-mix(in srgb, var(--h) 28%, transparent), inset 0 0 0 1.5px var(--h); }
.dpick .dp-s { margin: 16px 8px 0; font-size: 13px; font-weight: 600; color: var(--ink2); line-height: 1.8; }
@media (max-width: 340px) { .dcat { min-height: 116px; padding: 14px 12px 12px; border-radius: 24px; } .dcat .dc-n { font-size: 15px; } }
@media (prefers-reduced-motion: reduce) { .dpick { animation: none; } .dcat { transition: none; } }
.dfin-cats { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 12px; }
.dfin-cats span { padding: 4px 11px; border-radius: 999px; font-size: 11.5px; font-weight: 700; color: color-mix(in srgb, var(--h) 78%, var(--ink)); background: color-mix(in srgb, var(--h) 13%, var(--card)); }
.dpick .dp-t { margin-top: 6px; }

/* v97 booklet: missions note stands out */
.bk-note { margin: 16px 2px 0; padding: 14px 16px; border-radius: 18px; font-size: 14px; line-height: 1.9; color: var(--ink); background: color-mix(in srgb, var(--accent, #0a84ff) 9%, transparent); border: 1px solid color-mix(in srgb, var(--accent, #0a84ff) 18%, transparent); }
.bk-note b { font-weight: 800; color: var(--ink); }
.bf-row span { white-space: normal; }
/* ---------- «پیشرفت» pass (1405/08/21): mission-minute calendar, card-round subjects ---------- */
:root { --burnt: #3a3a3e; --burnt-ink: #8e8e93; --seen: color-mix(in srgb, var(--acc) 30%, var(--fill)); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --burnt: #050506; --burnt-ink: #5a5a5f; --seen: color-mix(in srgb, var(--acc) 34%, var(--fill)); } }
:root[data-theme="dark"] { --burnt: #050506; --burnt-ink: #5a5a5f; --seen: color-mix(in srgb, var(--acc) 34%, var(--fill)); }
.pglance { grid-template-columns: repeat(3, 1fr); }
/* calendar: a rounded square per day whose outline fills clockwise with the day's mission minutes */
.pcal .cgrid { gap: 6px 5px; }
.cd { position: relative; isolation: isolate; background: transparent; border-radius: 12px; font-family: "Num", "Vazirmatn", sans-serif; transition: transform .18s ease; }
.cd:active { transform: scale(.92); }
.cd > span { position: relative; z-index: 1; }
.cd.today { box-shadow: none; }
.cd .cring { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; overflow: visible; }
.cring path { fill: none; stroke-width: 3.2; }
.cring .cr-t { stroke: var(--ink); stroke-opacity: .1; }
.cring .cr-f { stroke: var(--ok); stroke-linecap: round; }
.cd.ring { color: var(--ink2); }
.cd.ring.full { color: var(--ink); background: color-mix(in srgb, var(--ok) 11%, transparent); }
.cd.ring.full .cr-t { stroke-opacity: 0; }
.cd.today > span { min-width: 24px; height: 24px; padding: 0 4px; border-radius: 999px; display: grid; place-items: center; background: var(--acc); color: #fff; font-weight: 800; line-height: 1; }
.cd.triangle-day.today > span { background: none; }
.cd.fut { opacity: 1; color: var(--ink3); background: color-mix(in srgb, var(--fill) 55%, transparent); }
.cd.fut > span { opacity: .75; }
.cd.burnt { background: var(--burnt); color: var(--burnt-ink); }
.cd.exam { border-radius: 12px; }
.pcal .clegend { flex-wrap: nowrap; gap: 12px; margin-top: 14px; font-size: 11.5px; white-space: nowrap; justify-content: flex-start; }
.clegend .lg { display: inline-flex; align-items: center; gap: 5px; }
.clegend .lg .cring { position: static; width: 15px; height: 15px; flex: none; }
.clegend .lg .cring path { stroke-width: 4.4; }
.pcal .clegend .lg .triangle-mark { margin: 0; width: 15px; height: 15px; }
.clegend i.burnt { width: 14px; height: 14px; border-radius: 4px; background: var(--burnt); }
/* subjects: progress through the cards of the round — seen (light) and mastered (solid) on one bar */
.subj-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.subj-round { font-size: 12.5px; font-weight: 650; color: var(--ink3); }
.subj-key { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 6px 0 4px; font-size: 12px; color: var(--ink3); }
.subj-key span { display: inline-flex; align-items: center; gap: 5px; }
.subj-key i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.subj-key .k-s { background: var(--seen); } .subj-key .k-m { background: var(--acc); }
.subj { display: block; width: 100%; text-align: start; padding: 14px 0 13px; color: inherit; border-top: .5px solid var(--sep); transition: opacity .15s ease; }
.subj:first-of-type { border-top: 0; }
.subj-key + .subj { border-top: 0; }
.subj:active { opacity: .6; }
.subj-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.subj-h > b { font-family: "Num", "Estedad", "Vazirmatn", sans-serif; font-size: 16px; font-weight: 750; padding-bottom: 3px; }
.subj-n { display: flex; gap: 16px; }
.subj-n .sn { display: flex; flex-direction: column; align-items: center; line-height: 1.05; }
.subj-n .sn b { font-size: 24px; font-weight: 800; letter-spacing: -.3px; }
.subj-n .sn small { font-size: 11px; font-weight: 650; color: var(--ink3); margin-top: 2px; }
.subj-n .sn-s b { color: color-mix(in srgb, var(--acc-ink) 55%, var(--ink3)); }
.subj-n .sn-m b { color: var(--acc-ink); }
.subj-n.big { justify-content: center; gap: 34px; margin-bottom: 12px; }
.subj-n.big .sn b { font-size: 34px; }
.sbar { position: relative; height: 10px; border-radius: 999px; background: var(--fill); overflow: hidden; }
.sbar i { position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: 999px; transition: width .5s cubic-bezier(.2,.8,.2,1); }
.sbar .sb-s { background: var(--seen); }
.sbar .sb-m { background: var(--acc); }
.subj-f { display: flex; justify-content: space-between; gap: 10px; margin-top: 7px; font-size: 12px; color: var(--ink3); font-weight: 600; }
.subj-wk.up { color: var(--acc-ink); }
.subj-sum .meta { margin: 10px 0 0; text-align: center; }
.subj-topics { background: var(--card); border-radius: 22px; padding: 4px 16px; }
.stp { padding: 12px 0; border-bottom: .5px solid var(--sep); }
.stp:last-child { border-bottom: 0; }
.stp-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 7px; font-size: 14px; }
.stp-h b { font-weight: 650; }
.stp-h > span { flex: none; font-size: 12px; color: var(--ink3); font-weight: 600; }
.stp-h .n { font-size: 13.5px; font-weight: 800; color: color-mix(in srgb, var(--acc-ink) 55%, var(--ink3)); }
.stp-h .n.sm { color: var(--acc-ink); }
.stp .sbar { height: 7px; }
/* weeks */
.wk-key { display: flex; gap: 14px; margin: 6px 0 12px; font-size: 12px; color: var(--ink3); }
.wk-key span { display: inline-flex; align-items: center; gap: 5px; }
.wk-key i { width: 10px; height: 10px; border-radius: 3px; }
.wkcard > .meta { margin-top: 2px; font-size: 12px; }
.lvrow .lvv { color: var(--ink2); font-weight: 650; white-space: nowrap; }

/* v100 · mission colours (PlayStation): home triangle green, today ring red, cards square pink, duel cross blue */
:root { --ps-tri: #1fae94; --ps-ci: #e8434c; --ps-sq: #dc57a5; --ps-x: #4679d8; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --ps-tri: #34d1b2; --ps-ci: #ff6a71; --ps-sq: #ff7dc8; --ps-x: #77a2ff; } }
:root[data-theme="dark"] { --ps-tri: #34d1b2; --ps-ci: #ff6a71; --ps-sq: #ff7dc8; --ps-x: #77a2ff; }
.tabbar button svg.tdi.on text { fill: var(--ps-ci); }
.tt-svg path { stroke-linecap: butt; }
.tt-svg .tt-track { stroke: color-mix(in srgb, var(--ps-tri) 16%, var(--fill2)); }
.tt-svg .tt-fill, .tt-svg .tt-fill.full { stroke: var(--ps-tri); }
.tt-svg.done .tt-solid { fill: var(--ps-tri); stroke: var(--ps-tri); }
.tt-side[data-go="today"] { --mc: var(--ps-ci); } .tt-side[data-go="cards"] { --mc: var(--ps-sq); } .tt-side[data-go="duel"] { --mc: var(--ps-x); }
.tt-side .tt-bar { background: color-mix(in srgb, var(--mc) 15%, transparent); }
.tt-side .tt-bar b, .tt-side.ok .tt-bar b { background: var(--mc); }
.tt-side.ok .tt-v { color: var(--mc); }
.tri-today.done { background: color-mix(in srgb, var(--ps-tri) 8%, var(--card)); }

/* v101 · each mission tab's page takes its own colour. A page root sets --mission and the brand accent (--acc, --acc-ink,
   --t-acc, --accent) follows it, so anything built on the accent inherits the page's colour. Home (and its sub-pages)
   keeps green. Right / wrong stay --ok / --bad everywhere. */
#v-today { --mission: var(--ps-ci); }
#v-cards { --mission: var(--ps-sq); }
#v-duel, .qv.duelmode { --mission: var(--ps-x); }
#v-today, #v-cards, #v-duel, .qv.duelmode {
  --accent: var(--mission);
  --acc: var(--mission);
  --acc-ink: color-mix(in srgb, var(--mission) 78%, var(--ink));
  --t-acc: color-mix(in srgb, var(--mission) 12%, var(--card));
  --mission-deep: color-mix(in srgb, var(--mission) 78%, #000); /* filled buttons with white text */
}
#v-today .btn.acc, #v-cards .btn.acc, #v-duel .btn.acc, .qv.duelmode .btn.acc { background: var(--mission-deep); }
/* tab bar: the lit tab's label wears its mission colour (home keeps the glass accent) */
.tabbar button[data-t="today"].on, .tabbar button[data-t="today"].hot { color: var(--ps-ci); }
.tabbar button[data-t="cards"].on, .tabbar button[data-t="cards"].hot { color: var(--ps-sq); }
.tabbar button[data-t="duel"].on, .tabbar button[data-t="duel"].hot { color: var(--ps-x); }
/* امروز: the current day's box is a very pale red, its day number sits in a red ring */
#v-today .pnode.cur { --pc: var(--mission) !important; --pt: color-mix(in srgb, var(--mission) 10%, var(--card)) !important; }
#v-today .pnode.cur.open .tx.pd-overview {
  background: linear-gradient(135deg, color-mix(in srgb, var(--mission) 9%, var(--card)) 0%, color-mix(in srgb, var(--mission) 4%, var(--card)) 55%, var(--card) 100%);
  border-color: color-mix(in srgb, var(--mission) 24%, transparent);
  box-shadow: 0 6px 22px color-mix(in srgb, var(--mission) 8%, transparent);
}
#v-today .pnode.cur .pd-continue { background: var(--mission-deep); color: #fff; }
/* کارت: the square goal and the streak ring are pink */
#v-cards .csq .sq-fill { stroke: var(--mission); }
#v-cards .csq .sq-track { stroke: color-mix(in srgb, var(--mission) 16%, var(--fill2)); }
#v-cards .csq.full .sq-fill { filter: drop-shadow(0 2px 6px color-mix(in srgb, var(--mission) 45%, transparent)); }
#v-cards .csq.full .csq-n b { color: var(--acc-ink); }
#v-cards .cfire .prg { stroke: var(--mission); }
#v-cards .cfire.full { box-shadow: 0 0 18px color-mix(in srgb, var(--mission) 50%, transparent); }
/* نبرد: the hero cross fills blue; result dots keep win green / loss red */
:is(#v-duel, .qv.duelmode) .bigmark .bm-track { stroke: color-mix(in srgb, var(--mission) 14%, var(--fill2)); }
:is(#v-duel, .qv.duelmode) .bigmark .bm-fill { stroke: var(--mission); }
#v-duel .duelhero.full .bigmark { filter: drop-shadow(0 6px 18px color-mix(in srgb, var(--mission) 40%, transparent)); }
#v-duel .duelhero { margin-inline: -16px; padding-inline: 24px; background: radial-gradient(110% 75% at 50% 0%, color-mix(in srgb, var(--mission) 10%, transparent), transparent 72%); }
/* v101 · page notes (admins only): a small glass golf flag at the bottom-left of the day player */
.pbar .pflag { flex: none; align-self: center; width: 44px; height: 44px; border-radius: 999px; display: grid; place-items: center; color: var(--ink3); transition: transform .3s var(--spring), color .2s; }
.pbar .pflag:active { transform: scale(.9); }
.pbar .pflag:focus-visible { outline: 2px solid var(--ink3); outline-offset: 2px; }
.pflag svg { width: 22px; height: 22px; overflow: visible; }
.pflag .fl-pole { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
.pflag .fl-pen { fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linejoin: round; }
.pflag .fl-hole { fill: currentColor; opacity: .28; }
.pflag.has { color: var(--ink2); }
.pflag.has .fl-pen { fill: var(--ps-ci); stroke: var(--ps-ci); }
.pn-where { margin: 0 2px 12px; }
.pn-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.pn-item { padding: 10px 14px; border-radius: 16px; background: var(--fill); }
.pn-item p { margin: 0; font-size: 14px; line-height: 1.8; white-space: pre-wrap; }
.pn-item time { display: block; margin-top: 2px; font-size: 11px; color: var(--ink3); }
.pn-text { display: block; width: 100%; box-sizing: border-box; min-height: 92px; resize: none; border: 0; border-radius: 18px; padding: 12px 14px; font: inherit; font-size: 16px; line-height: 1.8; color: var(--ink); background: var(--card); box-shadow: inset 0 0 0 1px var(--sep); outline: none; }
.pn-text:focus { box-shadow: inset 0 0 0 1.5px var(--ink3); }
#pn-send { margin-top: 12px; }
/* the track line: label and what is left, kept apart by space and a hairline instead of «·» (Persian zero is a dot) */
.ptk-sec span { position: relative; padding-inline-start: 13px; }
.ptk-sec span::before { content: ""; position: absolute; inset-inline-start: 6px; top: 50%; width: 1px; height: .95em; transform: translateY(-50%); background: currentColor; opacity: .35; }
/* ---------- درسنامهٔ رتبه یک v3: three books → topic tiles → page reader ---------- */
.bkc-violet { --bk: var(--violet); --bkt: var(--t-violet); } .bkc-acc { --bk: var(--acc); --bkt: var(--t-acc); } .bkc-blue { --bk: var(--blue); --bkt: var(--t-blue); }
.sh-layer[data-tone="violet"] { --bk: var(--violet); --bkt: var(--t-violet); } .sh-layer[data-tone="acc"] { --bk: var(--acc); --bkt: var(--t-acc); } .sh-layer[data-tone="blue"] { --bk: var(--blue); --bkt: var(--t-blue); }
.bk-search { display: flex; align-items: center; gap: 8px; margin: 4px 0 12px; padding: 0 16px; height: 46px; border-radius: 999px; color: var(--ink3); }
.bk-search input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; font: inherit; font-size: 15.5px; color: var(--ink); outline: none; }
.bk-search input::placeholder { color: var(--ink3); }
.bk-search input::-webkit-search-cancel-button { filter: grayscale(1); opacity: .5; }
.bk-res:empty { display: none; }
.bk-res { display: flex; flex-direction: column; gap: 6px; margin: 0 0 14px; animation: cardIn .3s var(--ease) both; }
.bk-searching .bk-books, .bk-searching .bk-tiles, .bk-searching .bk-gsec { display: none; }
.bk-hit { display: flex; flex-direction: column; align-items: stretch; gap: 3px; width: 100%; text-align: start; padding: 11px 14px; border-radius: 18px; background: var(--card); box-shadow: var(--card-shadow); color: var(--ink); font: inherit; }
.bk-hit small { font-size: 11.5px; color: var(--ink3); font-weight: 600; }
.bk-hit .bh-snip { font-size: 14px; line-height: 1.85; color: var(--ink2); }
.bk-hit mark { background: color-mix(in srgb, #ffd43b 50%, transparent); color: inherit; border-radius: 4px; padding: 0 2px; }
.bk-hit.topic b { font-size: 15.5px; font-weight: 750; }
.bk-hit.person { flex-direction: row; align-items: center; gap: 12px; }
.bk-hit.person .tph { width: 40px; height: 40px; margin: 0; flex: none; }
.bk-hit.person > span:last-child { display: flex; flex-direction: column; }
.bk-none { margin: 2px 4px 8px; }
.bk-books { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0 0 12px; }
.bk-book { display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end; gap: 2px; min-width: 0; aspect-ratio: 4 / 5; padding: 14px 12px; border-radius: 24px; text-align: start; color: var(--ink); font: inherit;
  background: radial-gradient(130% 90% at 100% 0%, color-mix(in srgb, var(--bk) 22%, var(--card)), var(--card) 72%); box-shadow: var(--card-shadow); transition: transform .35s var(--spring); }
.bk-book:active { transform: scale(.96); }
.bk-book .bb-ic { margin-bottom: auto; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: color-mix(in srgb, var(--bk) 16%, var(--card)); color: var(--bk); }
.bk-book b { font-family: "Num", "Estedad", sans-serif; font-size: 16px; font-weight: 800; line-height: 1.4; }
.bk-book small { font-size: 12px; color: var(--ink3); font-weight: 600; }
.bk-bookhead { display: flex; align-items: center; gap: 10px; margin: 0 2px 12px; color: var(--ink2); }
.bk-bookhead i { flex: none; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--bkt); color: var(--bk); }
.bk-bookhead p { margin: 0; font-size: 14px; line-height: 1.7; }
.sec.bk-gsec { margin: 18px 6px 8px; font-size: 13px; font-weight: 750; color: var(--ink3); }
.bk-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.bk-tile { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; min-height: 148px; padding: 14px 14px 12px; border-radius: 22px; text-align: start; font: inherit; color: var(--ink);
  background: linear-gradient(165deg, color-mix(in srgb, var(--bk, var(--acc)) 9%, var(--card)), var(--card) 70%); box-shadow: var(--card-shadow); transition: transform .35s var(--spring); }
.bk-tile:active { transform: scale(.96); }
.bk-tile b { font-size: 15px; font-weight: 750; line-height: 1.5; margin-top: 8px; }
.bk-tile .bt-sub { font-size: 12px; line-height: 1.65; color: var(--ink3); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bk-tile .bt-n { margin-top: auto; padding-top: 8px; font-size: 11.5px; font-weight: 650; color: color-mix(in srgb, var(--bk, var(--acc)) 80%, var(--ink)); }
.bk-tile .bt-ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--bk, var(--acc)) 15%, var(--card)); color: var(--bk, var(--acc)); }
.bk-tile .bt-ph { display: flex; }
.bk-tile .bt-ph .tph { width: 38px; height: 38px; margin: 0; box-shadow: 0 0 0 2.5px var(--card); background: color-mix(in srgb, var(--bk, var(--acc)) 15%, var(--card)) !important; }
.bk-tile .bt-ph .tph + .tph { margin-inline-start: -10px; }
.bk-tile .bt-ph .tph i { font-size: 15px; color: var(--bk, var(--acc)); }

/* the reader (full screen; above the day player, below sheets) */
.bkv { position: fixed; inset: 0; z-index: 60; background: var(--bg); display: none; flex-direction: column; }
.bkv.on { display: flex; will-change: transform, opacity; }
.bkv .bk-top { flex-wrap: nowrap; align-items: flex-start; padding-bottom: 4px; }
.bk-back { flex: none; display: inline-flex; align-items: center; gap: 3px; height: 38px; padding: 0 14px 0 12px; border-radius: 999px; font: inherit; font-size: 13.5px; font-weight: 700; color: var(--ink); }
.bk-back svg { width: 15px; height: 15px; }
.bkv .ptk .cnt { min-width: 0; flex: none; font-size: 11.5px; font-weight: 600; color: var(--ink3); text-align: end; }
.bkv .ptk .tm.done { fill: var(--bk); opacity: .55; } .bkv .ptk .tm.cur { fill: var(--bk); }
.bkv .btn.acc { background: var(--bk); }
.bkv .ptk-row.cur { background: color-mix(in srgb, var(--bk) 12%, transparent); } .bkv .ptk-row.cur .pk-dot { background: var(--bk); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bk) 22%, transparent); }
.bk-pop .ptk-row { width: 100%; text-align: start; font: inherit; color: inherit; background: none; }
.bk-pop .ptk-row .pk-t b { white-space: normal; }
.bkv .pgt { font-family: "Num", "Estedad", sans-serif; font-size: 21px; font-weight: 800; line-height: 1.55; margin: 2px 0 12px; text-wrap: balance; }
.bkv .chip.bk-kind { background: var(--bkt); color: var(--bk); font-weight: 750; }
.bkv .chip.bk-kind.k-keys { background: color-mix(in srgb, #ffd43b 30%, var(--card)); color: #8a6100; }
.bkv .chip.bk-kind.k-exam { background: var(--t-violet); color: var(--violet); }
.bk-text { font-size: 16.5px; line-height: 2.1; }
.bk-text p { margin: 0 0 14px; text-align: justify; text-justify: inter-word; }
.bk-text ul { padding-inline-start: 20px; margin: -6px 0 14px; }
.bk-text li { margin-bottom: 4px; }
.bk-text li::marker { color: var(--bk); }
.bkv mark, .bk-text mark { background: linear-gradient(transparent 12%, color-mix(in srgb, #ffd43b 52%, transparent) 12%, color-mix(in srgb, #ffd43b 52%, transparent) 92%, transparent 92%); color: inherit; border-radius: 3px; padding: 0 1px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.bkv mark.bk-hl { background: color-mix(in srgb, var(--bk) 30%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bk) 30%, transparent); animation: bkhl 2.4s var(--ease) both; }
@keyframes bkhl { 0%, 60% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--bk) 40%, transparent); } 100% { box-shadow: 0 0 0 0 transparent; } }
.bkv .xn { color: #8a4b00; background: color-mix(in srgb, #ff9f0a 26%, var(--card)); }
.bkv .xn::before { content: "تست‌خیز "; font-weight: 700; }
.bx.ex { margin: 6px 0 14px; padding: 12px 14px; border-radius: 18px; background: var(--t-yellow); font-size: 15px; line-height: 1.95; }
.bxh, .bk-lbl { display: block; font-size: 12px; font-weight: 800; letter-spacing: .1px; margin-bottom: 2px; }
.bx.ex .bxh { color: color-mix(in srgb, var(--yellow) 75%, var(--ink)); }
.bk-tab { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -16px 12px; padding: 2px 16px 10px; scrollbar-width: none; }
.bk-tab::-webkit-scrollbar { display: none; }
.bk-tab table { border-collapse: separate; border-spacing: 0; table-layout: fixed; width: max(100%, calc(var(--cols, 3) * 118px)); font-size: 14px; line-height: 1.8; background: var(--card); border-radius: 20px; box-shadow: var(--card-shadow); overflow: hidden; }
.bk-tab th:first-child { width: 30%; }
.bk-tab th { background: var(--bkt); color: color-mix(in srgb, var(--bk) 75%, var(--ink)); font-weight: 800; font-size: 13px; text-align: start; padding: 10px 12px; }
.bk-tab td { padding: 10px 12px; border-top: 1px solid var(--fill); vertical-align: top; overflow-wrap: anywhere; }
.bk-tab td.c0 { font-weight: 750; background: color-mix(in srgb, var(--bkt) 45%, var(--card)); }
.bk-rows { display: flex; flex-direction: column; gap: 6px; }
.bk-rows .br { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; padding: 10px 12px; border-radius: 16px; background: var(--card); box-shadow: var(--card-shadow); font-size: 14.5px; line-height: 1.75; }
.bk-rows .br.one { grid-template-columns: 1fr; }
.bk-rows .br i { font-style: normal; color: var(--ink3); font-size: 13px; }
.bk-rows .br-a { font-weight: 750; color: color-mix(in srgb, var(--bk) 78%, var(--ink)); }
.bk-rows .br mark { background: none; padding: 0; }
.bk-rows.cmp .br-c { font-weight: 750; }
.bk-rows.cmp .br-a { font-weight: 550; color: var(--ink); }
.bk-cmph { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 14px 6px; font-size: 12px; font-weight: 800; color: var(--ink3); }
.bk-sub { margin: -6px 2px 12px; }
.bk-key { margin: 0 0 12px; }
.bk-trap, .bk-cmp, .bk-more2, .bk-tip, .bk-cnote { margin: 0 0 12px; padding: 12px 14px; border-radius: 18px; font-size: 15px; line-height: 1.95; }
.bk-trap { background: var(--bad-bg); } .bk-trap .bk-lbl { color: var(--bad); }
.bk-cmp { background: var(--t-blue); } .bk-cmp .bk-lbl { color: var(--blue); } .bk-cmp .bk-rows .br { box-shadow: none; }
.bk-tip, .bk-cnote { background: var(--bkt); }
.bk-more2 { background: var(--card); box-shadow: var(--card-shadow); } .bk-more2 .bk-lbl { color: var(--ink3); }
.bk-more2 ul { margin: 4px 0 0; padding-inline-start: 18px; } .bk-more2 li { margin-bottom: 6px; font-size: 14.5px; } .bk-more2 li::marker { color: var(--bk); }
.bk-seen { margin: 0 0 12px; padding: 12px 14px; border-radius: 18px; background: color-mix(in srgb, #ffd43b 20%, var(--card)); box-shadow: inset 0 0 0 1px color-mix(in srgb, #ffb300 30%, transparent); font-size: 14.5px; line-height: 1.9; }
.bk-seen p { margin: 2px 0 6px; }
.bk-seen .bs-y { display: inline-block; font-size: 12px; font-weight: 800; color: #8a4b00; background: color-mix(in srgb, #ff9f0a 26%, var(--card)); padding: 1px 10px; border-radius: 999px; }
.bk-seen .bs-k b { color: color-mix(in srgb, var(--bk) 78%, var(--ink)); }
.bk-seen .bs-ex { color: var(--ink2); font-size: 14px; }
.bs-orig { display: inline-flex; align-items: center; gap: 2px; padding: 4px 0; font: inherit; font-size: 12.5px; font-weight: 700; color: var(--ink3); background: none; }
.bs-orig .chev svg { width: 11px; height: 11px; }
.bk-q .qblk .m { font-weight: 700; color: var(--violet); }
.bk-moreq { display: block; margin: 4px auto 0; }
.bk-mn { margin: 4px 0 14px; padding: 18px 16px; border-radius: 24px; text-align: center; background: radial-gradient(120% 100% at 50% 0%, color-mix(in srgb, var(--bk) 18%, var(--card)), var(--card) 75%); box-shadow: var(--card-shadow); }
.mn-word { font-family: "Num", "Estedad", sans-serif; font-size: 38px; font-weight: 900; letter-spacing: 1px; color: var(--bk); line-height: 1.5; }
.mn-parts { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 10px; }
.mn-parts div { display: flex; align-items: baseline; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--card); box-shadow: var(--card-shadow); font-size: 13.5px; }
.mn-parts b { font-family: "Num", "Estedad", sans-serif; font-size: 16px; font-weight: 900; color: var(--bk); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bkv .chip.bk-kind.k-keys, :root:not([data-theme="light"]) .bkv .xn, :root:not([data-theme="light"]) .bk-seen .bs-y { color: #ffc46b; } :root:not([data-theme="light"]) .bk-text mark, :root:not([data-theme="light"]) .bkv mark { background: linear-gradient(transparent 12%, rgba(255, 196, 0, .26) 12%, rgba(255, 196, 0, .26) 92%, transparent 92%); } }
:root[data-theme="dark"] .bkv .chip.bk-kind.k-keys, :root[data-theme="dark"] .bkv .xn, :root[data-theme="dark"] .bk-seen .bs-y { color: #ffc46b; }
:root[data-theme="dark"] .bk-text mark, :root[data-theme="dark"] .bkv mark { background: linear-gradient(transparent 12%, rgba(255, 196, 0, .26) 12%, rgba(255, 196, 0, .26) 92%, transparent 92%); }
@media (prefers-reduced-motion: reduce) { .bk-res, .bkv mark.bk-hl { animation: none; } }
.bk-swipe { margin: -4px 2px 8px; font-size: 12px; }
.bk-flow3 { text-align: center !important; font-weight: 750; color: var(--bk); background: var(--bkt); border-radius: 999px; padding: 6px 14px; margin: 0 auto 14px !important; width: fit-content; }
.bk-text h3 { font-family: "Num", "Estedad", sans-serif; font-size: 17px; font-weight: 800; margin: 20px 0 6px; color: color-mix(in srgb, var(--bk) 80%, var(--ink)); }
.mn-word.long { font-size: 24px; letter-spacing: 0; }
.bk-rows .br small { font-size: 11px; color: var(--ink3); font-weight: 500; }
.bk-hist { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border-radius: 22px; background: var(--card); box-shadow: var(--card-shadow); text-align: start; font: inherit; color: var(--ink); }
.bk-hist .lt-ic { flex: none; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; }
.bk-hist > span { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.bk-hist b { font-size: 15px; font-weight: 700; } .bk-hist small { font-size: 12px; color: var(--ink3); }
.bk-searching .bk-hist { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bk-seen { background: color-mix(in srgb, #ffd43b 9%, var(--card)); } }
:root[data-theme="dark"] .bk-seen { background: color-mix(in srgb, #ffd43b 9%, var(--card)); }
/* ---------- tests (v101): «آزمون‌های سراسری», «تست‌های رتبه یک», the exam player, result and review ----------
   one hue each: exams orange (library tile), practice blue; real = plain card, simulator = soft orange tint */
.sh-body .xseg { margin: 2px 0 14px; }
.xhero { --xh: var(--orange); position: relative; overflow: hidden; margin: 0 0 6px; padding: 18px 18px 14px; border-radius: 24px; background: radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--xh) 14%, var(--card)), var(--card) 70%); box-shadow: var(--card-shadow); }
.xhero.xh-prac { --xh: var(--blue); }
.xh-eye { margin: 0; font-size: 12.5px; font-weight: 750; color: color-mix(in srgb, var(--xh) 82%, var(--ink)); }
.xhero h2 { margin: 4px 0 8px; text-wrap: balance; font-family: "Num", "Estedad", "Vazirmatn", sans-serif; font-size: 21px; font-weight: 800; line-height: 1.45; letter-spacing: -.2px; }
.xhero p:not(.xh-eye) { margin: 0 0 10px; font-size: 14px; line-height: 1.9; color: var(--ink2); }
.xhero p:last-child { margin-bottom: 0; }
.xhero p b { color: var(--ink); }
.xyt-c.xh-two { display: inline-grid; grid-template-columns: auto auto; margin: 2px 0 10px; }
.xh-two .xc { min-height: 0; padding: 6px 14px; pointer-events: none; }
.sec.xsec { display: flex; align-items: baseline; gap: 8px; font-size: 18px; margin: 22px 4px 10px; }
.sec.xsec small { font-family: "Vazirmatn", sans-serif; font-size: 12.5px; font-weight: 600; color: var(--ink3); }
.xempty { padding: 16px 18px; border-radius: 20px; background: var(--card); color: var(--ink3); font-size: 13.5px; line-height: 1.8; text-align: center; }

/* a year from 1400 on: the year, then «کنکور واقعی» and «شبیه‌ساز» (two separate capsules, see libux at the end) */
.xyears { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.xyt { padding: 12px 10px 10px; border-radius: 24px; background: var(--card); box-shadow: var(--card-shadow); }
.xyt-y { font-family: "Num", "Estedad", sans-serif; font-size: 24px; font-weight: 800; line-height: 1.2; margin: 0 6px 10px; letter-spacing: -.3px; }
.xyt-c { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 3px; border-radius: 999px; background: var(--fill); }
.xc { min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; min-height: 50px; padding: 6px 4px; border-radius: 999px; background: var(--card); color: var(--ink); font-size: 12.5px; font-weight: 750; line-height: 1.5; text-align: center; transition: transform .25s var(--spring), background .2s; }
.xc:active { transform: scale(.94); }
.xc > span { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.xc small { font-size: 10.5px; font-weight: 600; color: var(--ink3); white-space: nowrap; }
.xc small b { color: var(--ink2); font-weight: 750; }
.xc i { display: inline-grid; width: 13px; height: 13px; } .xc i svg { width: 13px; height: 13px; }
.xc.sim { background: var(--t-orange); color: color-mix(in srgb, var(--orange) 78%, var(--ink)); }
.xc.sim small { color: color-mix(in srgb, var(--orange) 55%, var(--ink3)); }
.xc.soon { background: transparent; color: var(--ink3); box-shadow: inset 0 0 0 1px var(--sep); }
.xc.soon small { color: var(--ink3); opacity: .8; }
.xyt-c .xc.soon { box-shadow: none; }
/* 1393–1399: one tap each */
.xold { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.xold button { display: flex; flex-direction: column; align-items: center; padding: 10px 4px 9px; border-radius: 18px; background: var(--card); box-shadow: var(--card-shadow); transition: transform .25s var(--spring); }
.xold button:active { transform: scale(.94); }
.xold b { font-family: "Num", "Estedad", sans-serif; font-size: 17px; font-weight: 800; line-height: 1.35; }
.xold small { font-size: 11px; font-weight: 600; color: var(--ink3); }

/* past attempts */
.xhist .li.xhr { justify-content: flex-start; gap: 12px; padding: 11px 14px; }
.xh-sc { flex: none; width: 52px; height: 36px; border-radius: 999px; display: flex; align-items: center; justify-content: center; gap: 1px; background: var(--fill); color: var(--ink2); }
.xh-sc b { font-family: "Num", sans-serif; font-size: 16px; font-weight: 800; }
.xh-sc i { font-style: normal; font-size: 12px; font-weight: 700; }
.xh-sc.up { background: var(--ok-bg); color: var(--ok); }
.xh-t { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.xh-t b { font-size: 14.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xh-t small { font-size: 12px; color: var(--ink3); }
.xhr .chev { margin-inline-start: auto; color: var(--ink3); }
.xresume { display: flex; align-items: center; gap: 12px; width: 100%; margin: 12px 0 0; padding: 12px 14px; border-radius: 22px; background: var(--card); box-shadow: var(--card-shadow), inset 0 0 0 1.5px color-mix(in srgb, var(--orange) 45%, transparent); text-align: start; transition: transform .25s var(--spring); }
.xresume:active { transform: scale(.98); }
.xresume .xr-ic { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--t-orange); color: var(--orange); }
.xresume > span:nth-child(2) { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.xresume b { font-size: 14.5px; } .xresume small { font-size: 12px; color: var(--ink3); }
.xresume .chev { color: var(--ink3); }

/* practice: what to practise */
.xscope .li { justify-content: flex-start; gap: 12px; padding: 12px 14px; }
.xs-ic { flex: none; width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--fill); }
.xs-ic.all { background: var(--t-blue); color: var(--blue); }
.xs-ic.s-theories { background: var(--t-violet); } .xs-ic.s-counseling { background: var(--t-acc); } .xs-ic.s-stats { background: var(--t-blue); }
.xs-ic.s-theories::after, .xs-ic.s-counseling::after, .xs-ic.s-stats::after { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--violet); }
.xs-ic.s-counseling::after { background: var(--acc); } .xs-ic.s-stats::after { background: var(--blue); }
.xs-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.xs-t b { font-size: 15px; font-weight: 700; }
.xs-go { flex: none; margin-inline-start: auto; padding: 7px 16px; border-radius: 999px; background: var(--blue); color: #fff; font-size: 13.5px; font-weight: 750; }
.xscope .li > .chev { margin-inline-start: auto; color: var(--ink3); }
.xbig { display: flex; align-items: center; gap: 12px; width: 100%; padding: 16px; border-radius: 22px; background: radial-gradient(120% 120% at 100% 0%, color-mix(in srgb, var(--blue) 12%, var(--card)), var(--card) 75%); box-shadow: var(--card-shadow); text-align: start; transition: transform .25s var(--spring); }
.xbig:active { transform: scale(.98); }
.xbig > span:first-child { display: flex; flex-direction: column; min-width: 0; }
.xbig b { font-size: 16px; font-weight: 800; } .xbig small { font-size: 12.5px; color: var(--ink3); }

/* the player */
.qv.xpl { --xc: var(--orange); --xct: var(--t-orange); }
.qv.xpl.xpl-p { --xc: var(--blue); --xct: var(--t-blue); }
.xtop { justify-content: space-between; }
.xclock { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px 0 10px; border-radius: 999px; color: var(--xc); transition: color .4s, background .4s; }
.xclock .n { font-family: "Num", sans-serif; font-size: 16px; font-weight: 750; color: var(--ink); min-width: 52px; text-align: center; font-variant-numeric: tabular-nums; }
.xclock.low { color: var(--bad); } .xclock.low .n { color: var(--bad); }
.xclock:empty { visibility: hidden; }
.xfl { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: var(--ink2); transition: color .25s, transform .25s var(--spring); }
.xfl svg { width: 19px; height: 19px; } .xfl:active { transform: scale(.9); }
.xfl.on { color: var(--yellow); }
.xtrack { width: calc(100% - 32px); max-width: 648px; margin: 2px auto 4px; min-height: 6px; }
.xt-segs { display: flex; gap: 3px; direction: rtl; }
.xt-segs.dense { gap: 1px; }
.xt-segs i { flex: 1; height: 5px; border-radius: 999px; background: var(--fill2); transition: background .3s; position: relative; }
.xt-segs i.a { background: color-mix(in srgb, var(--xc) 55%, var(--fill2)); }
.xt-segs i.m { background: var(--yellow); }
.xt-segs i.cur { background: var(--ink); }
.xqn { display: flex; align-items: center; gap: 8px; margin: 8px 4px 12px; font-size: 13px; font-weight: 650; color: var(--ink3); }
.xqn b { color: var(--ink); font-size: 15px; }
.xqc .opt.pick { border-color: var(--xc); background: color-mix(in srgb, var(--xct) 70%, var(--card)); }
.xqc .opt.pick .k { background: var(--xc); color: #fff; }
.xbar .in { align-items: center; }
.xbar .ico.xnav { width: 52px; height: 52px; }
.xbar .ico.xnav svg { width: 20px; height: 20px; }
.xbar .ico.xnav:disabled { opacity: .35; }
.xsheetb { flex: 1; height: 52px; border-radius: 999px; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 15px; font-weight: 750; color: var(--ink); }
.xsheetb svg { width: 19px; height: 19px; color: var(--xc); }
.xsheetb small { font-family: "Num", sans-serif; font-size: 12.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--fill); color: var(--ink2); }
.xbar .btn.xfin { flex: none; width: auto; padding: 15px 22px; background: var(--xc); }
.xbar .btn.xgo { background: var(--xc); }
.xbar .btn.xclose { flex: none; width: auto; padding-inline: 26px; }
/* intro */
.xintro { text-align: center; padding: 18px 6px 0; }
.xi-badge { width: 64px; height: 64px; margin: 6px auto 14px; border-radius: 20px; display: grid; place-items: center; background: var(--xct); color: var(--xc); }
.xi-badge svg { width: 30px; height: 30px; }
.xintro h1 { margin: 0 0 6px; font-family: "Num", "Estedad", "Vazirmatn", sans-serif; font-size: 28px; font-weight: 800; letter-spacing: -.3px; }
.xi-sub { margin: 0 auto 18px; max-width: 320px; color: var(--ink2); font-size: 14.5px; line-height: 1.85; }
.xi-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.xi-facts > div { padding: 12px 6px 10px; border-radius: 20px; background: var(--card); box-shadow: var(--card-shadow); display: flex; flex-direction: column; gap: 2px; }
.xi-facts b { font-family: "Num", "Estedad", sans-serif; font-size: 22px; font-weight: 800; line-height: 1.3; }
.xi-facts span { font-size: 11.5px; font-weight: 600; color: var(--ink3); line-height: 1.5; }
.xi-rules { margin: 0; padding: 14px 16px 14px 14px; list-style: none; border-radius: 22px; background: var(--card); text-align: start; font-size: 13.5px; line-height: 1.85; color: var(--ink2); }
.xi-rules li { position: relative; padding-inline-start: 18px; }
.xi-rules li + li { margin-top: 6px; }
.xi-rules li::before { content: ''; position: absolute; inset-inline-start: 2px; top: .8em; width: 6px; height: 6px; border-radius: 50%; background: var(--xc); }
.xi-rules svg { width: 15px; height: 15px; vertical-align: -3px; color: var(--yellow); }
/* «پاسخ‌برگ» */
.xs-sum { display: flex; gap: 6px; margin: 0 0 12px; }
.xs-sum span { flex: 1; text-align: center; padding: 8px 4px; border-radius: 999px; background: var(--card); font-size: 12.5px; color: var(--ink3); }
.xs-sum b { font-size: 15px; color: var(--ink); margin-inline-end: 2px; }
.xs-sum .mk b { color: var(--yellow); }
.xgrid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; margin-bottom: 14px; }
.xgrid button { position: relative; display: flex; flex-direction: column; align-items: center; padding: 8px 2px 7px; border-radius: 16px; background: var(--card); border: 2px solid transparent; transition: transform .2s var(--spring); }
.xgrid button:active { transform: scale(.93); }
.xgrid b { font-size: 15px; font-weight: 750; line-height: 1.4; }
.xgrid span { font-size: 10.5px; font-weight: 600; color: var(--ink3); white-space: nowrap; }
.xgrid .a { background: var(--t-orange); } .xgrid .a span { color: color-mix(in srgb, var(--orange) 75%, var(--ink)); }
.xgrid.p .a { background: var(--t-blue); } .xgrid.p .a span { color: color-mix(in srgb, var(--blue) 75%, var(--ink)); }
.xgrid .m::after { content: ''; position: absolute; top: 6px; inset-inline-end: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--yellow); }
.xgrid .cur { border-color: var(--ink); }
.xs-end { margin-top: 2px; }
/* glass alert */
.xalert { position: fixed; inset: 0; z-index: 95; display: grid; place-items: center; padding: 24px; background: rgba(0,0,0,0); transition: background .25s; }
.xalert.on { background: rgba(0,0,0,.28); }
.xa-card { width: min(320px, 100%); padding: 20px 18px 14px; border-radius: 28px; text-align: center; opacity: 0; transform: scale(1.08); transition: opacity .2s var(--ease), transform .35s var(--spring); }
.xalert.on .xa-card { opacity: 1; transform: none; }
.xa-card h3 { margin: 0 0 6px; font-family: "Num", "Estedad", "Vazirmatn", sans-serif; font-size: 18px; font-weight: 800; }
.xa-card p { margin: 0 0 14px; font-size: 14px; line-height: 1.85; color: var(--ink2); }
.xa-acts { display: flex; flex-direction: column; gap: 8px; }
.xa-acts .btn { padding: 13px; font-size: 15.5px; }
.xa-acts .btn.soft { background: var(--fill); color: var(--ink); }
/* result */
.xres { padding-top: 10px; }
.xr-eye { margin: 6px 4px 0; text-align: center; font-size: 13.5px; font-weight: 700; color: var(--ink3); }
.xr-big { display: flex; align-items: baseline; justify-content: center; gap: 2px; margin: 2px 0 12px; }
.xr-big b { font-family: "Num", "Estedad", sans-serif; font-size: 64px; font-weight: 800; line-height: 1.1; letter-spacing: -1px; }
.xr-big i { font-style: normal; font-size: 28px; font-weight: 800; color: var(--ink3); }
.xr-bar { position: relative; height: 14px; margin: 0 6px; border-radius: 999px; background: var(--fill2); }
.xr-bar .fill { position: absolute; inset-block: 0; inset-inline-start: 0; width: var(--p); border-radius: 999px; background: var(--xc); animation: xgrow 1s var(--ease) both; }
.xr-bar.up .fill { background: var(--ok); }
.xr-bar .line { position: absolute; top: -6px; bottom: -6px; inset-inline-start: var(--l); width: 2.5px; margin-inline-start: -1px; border-radius: 2px; background: var(--ink); }
@keyframes xgrow { from { width: 0; } }
.xr-lab { position: relative; height: 22px; margin: 6px 6px 0; }
.xr-line { position: absolute; inset-inline-start: 65%; transform: translateX(50%); white-space: nowrap; font-size: 11.5px; font-weight: 700; color: var(--ink2); }
.xr-say { margin: 8px 0 16px; text-align: center; font-size: 14.5px; color: var(--ink2); }
.xr-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin-bottom: 12px; }
.xr-stats > div { padding: 10px 4px 8px; border-radius: 18px; background: var(--card); box-shadow: var(--card-shadow); text-align: center; display: flex; flex-direction: column; }
.xr-stats b { font-family: "Num", "Estedad", sans-serif; font-size: 21px; font-weight: 800; line-height: 1.3; }
.xr-stats span { font-size: 11px; font-weight: 600; color: var(--ink3); white-space: nowrap; }
.xr-stats .ok b { color: var(--ok); } .xr-stats .w b { color: var(--bad); }
.xr-split { padding: 6px 14px; border-radius: 22px; background: var(--card); margin-bottom: 6px; }
.xr-sr { display: grid; grid-template-columns: 96px 1fr 48px; align-items: center; gap: 10px; padding: 9px 0; }
.xr-sr + .xr-sr { border-top: .5px solid var(--sep); }
.xr-sn { display: flex; flex-direction: column; font-size: 14px; font-weight: 700; }
.xr-sn small { font-size: 11.5px; font-weight: 600; color: var(--ink3); }
.xr-sb { position: relative; height: 8px; border-radius: 999px; background: var(--fill2); }
.xr-sb i { position: absolute; inset-block: 0; inset-inline-start: 0; width: var(--p); border-radius: 999px; background: var(--xc); }
.xr-sb.up i { background: var(--ok); }
.xr-sb em { position: absolute; top: -4px; bottom: -4px; inset-inline-start: var(--l); width: 2px; border-radius: 2px; background: var(--ink3); }
.xr-sr > b { font-family: "Num", sans-serif; font-size: 14.5px; font-weight: 750; text-align: end; }
.xr-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 20px 4px 10px; }
.xr-head h3 { margin: 0; font-family: "Num", "Estedad", "Vazirmatn", sans-serif; font-size: 18px; font-weight: 800; }
.xr-seg { margin: 0; flex: none; }
.xr-seg button { flex: none; padding: 6px 12px; font-size: 13px; }
.xr-seg .n { font-size: 12px; color: var(--ink3); }
.xrl { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px; margin-bottom: 6px; border-radius: 18px; background: var(--card); text-align: start; transition: transform .2s var(--spring); }
.xrl:active { transform: scale(.98); }
.xrl-t { flex: 1; min-width: 0; font-size: 13.5px; line-height: 1.8; color: var(--ink2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.xrl .chev { color: var(--ink3); flex: none; }
.xd { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 13px; font-weight: 750; background: var(--fill); color: var(--ink2); }
.xd.ok { background: var(--ok-bg); color: var(--ok); } .xd.w { background: var(--bad-bg); color: var(--bad); }
/* review */
.xst { padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 750; background: var(--fill); color: var(--ink2); }
.xst.ok { background: var(--ok-bg); color: var(--ok); } .xst.w { background: var(--bad-bg); color: var(--bad); }
.xrv-at { margin-inline-start: auto; font-size: 12.5px; }
.xkey { display: flex; gap: 8px; margin: 12px 0 10px; }
.xkey span { flex: 1; text-align: center; padding: 9px; border-radius: 999px; background: var(--card); font-size: 13px; color: var(--ink3); }
.xkey b { margin-inline-start: 4px; font-size: 15px; color: var(--ink); }
.xhook { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin: 2px 2px 8px; }
.xhk { width: auto; display: inline-flex; gap: 6px; padding: 9px 14px; font-size: 13.5px; }
.xhk svg { width: 16px; height: 16px; flex: none; }
.xhk span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 280px; }
.xsrc { font-size: 12px; color: var(--ink3); }
.xs-end { background: var(--orange); } .xs-end.p { background: var(--blue); }
.xalert.xt-x .btn.acc { background: var(--orange); } .xalert.xt-p .btn.acc { background: var(--blue); }
.xold small.up { color: var(--ok); font-weight: 700; }
.xh-sc, .xr-big { direction: ltr; }
.xbar .btn.acc { background: var(--xc); }
.qbar.xbar { background: linear-gradient(to top, var(--bg) 62%, color-mix(in srgb, var(--bg) 0%, transparent)); padding-top: 22px; }
.xr-sr > b { direction: ltr; text-align: left; }
/* v101 · cards UX: fire pill, nudge, «هنوز یاد نگرفتم», «یادم بده کامل», exam chips, fires sheet */
.ctopbar { grid-template-columns: 1fr auto 1fr; }
.ctopbar .cfire { justify-self: start; } .ctopbar .cset { justify-self: end; }
.cfire { width: auto; height: 44px; border-radius: 999px; padding: 0 4px 0 12px; display: inline-flex; align-items: center; gap: 7px; font: inherit; color: var(--ink); transition: box-shadow .5s var(--ease), transform .3s var(--spring); }
.cfire:active { transform: scale(.95); }
.cfire .fr-ring { position: relative; width: 36px; height: 36px; display: grid; place-items: center; }
.cfire .fr-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.cfire .trk { fill: none; stroke: currentColor; opacity: .12; stroke-width: 3.4; }
.cfire .prg { fill: none; stroke: #ff8a2a; stroke-width: 3.4; stroke-linecap: round; transition: stroke-dashoffset .6s var(--ease), stroke .5s; }
.cfire .fr-ring b { position: static; top: 0; font-size: 13.5px; font-weight: 800; line-height: 1; color: var(--ink2); }
.cfire .fr-n { display: inline-flex; align-items: center; gap: 2px; line-height: 1; }
.cfire .fr-n .fi { font-size: 16px; filter: grayscale(1) opacity(.45); transition: filter .5s; }
.cfire .fr-n b { position: static; top: 0; font-size: 16px; font-weight: 800; color: var(--ink3); }
.cfire.lit .fr-n .fi { filter: none; } .cfire.lit .fr-n b { color: #e2620c; }
.cfire.warm { box-shadow: var(--glass-shadow), 0 0 14px rgba(255,138,42,.32); } .cfire.warm .prg { stroke: #ff7a1a; }
.cfire.hot { box-shadow: var(--glass-shadow), 0 0 22px rgba(255,106,20,.5); } .cfire.hot .prg { stroke: #ff5a12; } .cfire.hot .fr-ring b { color: #e2620c; }
.cfire.pop { animation: firepop .6s var(--spring); }
.firefly { position: fixed; left: 0; top: 0; z-index: 260; width: 44px; height: 44px; display: grid; place-items: center; font-size: 26px; line-height: 1; pointer-events: none; filter: drop-shadow(0 4px 10px rgba(255,110,20,.45)); will-change: transform; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cfire.lit .fr-n b { color: #ff9a4a; } }
:root[data-theme="dark"] .cfire.lit .fr-n b { color: #ff9a4a; }
.cbottom .cdk.nudge { animation: cdknudge .55s var(--spring); }
@keyframes cdknudge { 0%,100% { transform: scale(1); } 35% { transform: scale(1.09); } 65% { transform: scale(.98); } }

/* «هنوز یاد نگرفتم»: quiet, under the explanation */
.cstuck { display: block; margin: 10px auto 8px; padding: 8px 18px; border-radius: 999px; background: transparent; color: var(--ink3); font: inherit; font-size: 13.5px; font-weight: 700; border: .5px solid var(--sep); }
.cstuck:active { background: var(--fill); }
.cstuck:disabled { opacity: .7; border-color: transparent; }
.stk-lead { margin: 0 2px 12px; line-height: 1.9; }
.stk { display: grid; gap: 10px; }
.stk-o { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px; border-radius: 20px; background: var(--card); text-align: start; font: inherit; color: var(--ink); }
.stk-o > span:nth-child(2) { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.stk-o b { font-size: 16px; font-weight: 800; }
.stk-o small { font-size: 12.5px; color: var(--ink3); line-height: 1.7; }
.stk-o:disabled { opacity: .6; }
.stk-ic { flex: none; width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; font-size: 20px; }
.stk-ic.learn { background: color-mix(in srgb, var(--ps-sq) 14%, transparent); }
.stk-ic.snz { background: color-mix(in srgb, var(--ps-x) 13%, transparent); }

/* «یادم بده کامل»: big, calm reading */
.learn { font-size: 16.5px; line-height: 2; }
.learn section { background: var(--card); border-radius: 20px; padding: 14px 16px; margin-bottom: 10px; }
.learn h4 { margin: 0 0 4px; font-size: 13px; font-weight: 800; color: var(--acc-ink); }
.learn p { margin: 0; }
.learn ul, .learn ol { margin: 0; padding-inline-start: 20px; }
.learn li { margin: 4px 0; }
.learn .ln-q { background: color-mix(in srgb, var(--ps-sq) 8%, var(--card)); }
.learn .ln-p { font-weight: 750; font-size: 17.5px; margin-bottom: 8px; }
.learn .ln-a { font-size: 15.5px; } .learn .ln-a.ok { color: var(--ok, #138a5e); font-weight: 800; } .learn .ln-a.no { color: var(--ink3); }
.learn .ln-v + .ln-v { margin-top: 10px; padding-top: 10px; border-top: .5px solid var(--sep); }
.learn .ln-v p { font-size: 15px; } .learn .ln-v b { display: block; font-size: 15px; color: var(--ok, #138a5e); }
.learn .ln-v small { display: block; font-size: 14px; color: var(--ink2); line-height: 1.9; }
.learn .bk p { margin: 0 0 8px; } .learn .bk .bbox { font-size: 15px; } .learn .bk .btn { margin-top: 8px; }
.learn .thin { color: var(--ink2); } .learn .thin .btn { margin-top: 10px; }
.learn .csay { margin: 0 0 10px; }
.learn .cteach { padding-inline-start: 20px; }

/* exam chips: inline (year + number) and one quiet row */
.xq { display: inline-flex; align-items: baseline; gap: 5px; padding: 1px 9px; margin: 1px 1px; border-radius: 999px; background: color-mix(in srgb, var(--ps-x) 11%, transparent); color: color-mix(in srgb, var(--ps-x) 78%, var(--ink)); font: inherit; font-size: .93em; font-weight: 750; line-height: 1.7; vertical-align: baseline; }
.xq small { font-size: .82em; font-weight: 650; opacity: .75; }
.xq:active { background: color-mix(in srgb, var(--ps-x) 20%, transparent); }
.xqrow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.xqrow > span { flex-basis: 100%; font-size: 11.5px; font-weight: 700; color: var(--ink3); }
.xqrow .xq { padding: 3px 11px; }
.xqv .xqsrc { font-size: 12px; font-weight: 750; color: var(--ink3); }
.xqv .showans { font-weight: 800; }

/* card settings: snoozed topics */
.cp-snz .cp-k { white-space: normal; }
.cp-snzl { flex-basis: 100%; display: flex; flex-direction: column; gap: 4px; }
.snz-i { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.snz-i b { font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.snz-i small { color: var(--ink3); }
.snz-i button { flex: none; padding: 3px 11px; border-radius: 999px; background: var(--fill); color: var(--acc-ink); font: inherit; font-size: 12px; font-weight: 750; }

/* fires sheet */
.fire-hero { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 4px; }
.fire-hero .fh-f { font-size: 46px; line-height: 1.1; filter: drop-shadow(0 6px 14px rgba(255,110,20,.35)); }
.fire-hero b { font-size: 34px; font-weight: 850; line-height: 1.2; }
.fire-hero > span:last-child { font-size: 13px; color: var(--ink3); font-weight: 700; }
.fire-how { text-align: center; color: var(--ink2); line-height: 1.9; margin: 8px 6px 14px; font-size: 14px; }
.fire-stats { display: grid; grid-template-columns: 1fr 1fr; background: var(--card); border-radius: 20px; padding: 12px 6px; }
.fire-stats > div { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.fire-stats > div + div { border-inline-start: .5px solid var(--sep); }
.fire-stats b { font-size: 22px; font-weight: 800; }
.fire-stats span { font-size: 12px; color: var(--ink3); font-weight: 650; display: flex; flex-direction: column; align-items: center; }
.fire-stats small { font-size: 11px; font-weight: 600; opacity: .85; }
.fire-days { display: grid; grid-template-columns: repeat(5, 1fr); align-items: end; gap: 10px; background: var(--card); border-radius: 20px; padding: 14px 16px 10px; margin-top: 10px; min-height: 120px; }
.fire-days > div { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; }
.fire-days i { width: 100%; max-width: 30px; border-radius: 8px; background: linear-gradient(to top, #ff8a2a, #ffb44a); }
.fire-days i[style*="height:3px"] { background: var(--fill2); border-radius: 2px; }
.fire-days b { font-size: 13px; font-weight: 800; color: #e2620c; min-height: 1.3em; }
.fire-days span { font-size: 11.5px; color: var(--ink3); font-weight: 650; }
.fire-days .today span { color: var(--ink); font-weight: 800; }

/* home: today's fires under the triangle; progress: one fires row */
.tt-fire { display: inline-flex; align-items: center; gap: 2px; font-size: 13px; line-height: 1; padding: 3px 8px; border-radius: 999px; background: rgba(255,138,42,.12); }
.tt-fire b { font-size: 13px; font-weight: 800; color: #e2620c; }
.fire-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; text-align: start; font: inherit; color: var(--ink); }
.fire-row .fr-ic { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; background: rgba(255,138,42,.12); }
.fire-row .fr-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.fire-row .fr-t b { font-size: 15px; font-weight: 800; } .fire-row .fr-t small { font-size: 11.5px; color: var(--ink3); }
.fire-row .fr-v { display: flex; gap: 14px; }
.fire-row .fr-v > span { display: flex; flex-direction: column; align-items: center; }
.fire-row .fr-v b { font-size: 18px; font-weight: 800; line-height: 1.3; } .fire-row .fr-v small { font-size: 10.5px; color: var(--ink3); white-space: nowrap; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tt-fire b, :root:not([data-theme="light"]) .fire-days b { color: #ff9a4a; } }
:root[data-theme="dark"] .tt-fire b, :root[data-theme="dark"] .fire-days b { color: #ff9a4a; }
@media (prefers-reduced-motion: reduce) { .cfire.pop, .cbottom .cdk.nudge { animation: none; } }

.nwq { white-space: nowrap; }

.mn-parts div { background: color-mix(in srgb, var(--bk) 12%, var(--card)); }

/* lines with a formula or an English piece: no justify gaps */
.bk-text p:has(.fx), .bk-text p:has([dir="ltr"]) { text-align: start; }

/* ---------- library worlds (libux): «درسنامهٔ رتبه یک», «تست‌های رتبه یک», «آزمون‌های سراسری» open full screen ----------
   The same layer stack as sheets, drawn as iOS push navigation: a glass back capsule naming the page behind, a large title
   that hands over to a small one in the bar as you scroll. The reader is one of these pages. */
.sheet-wrap.world .sheet { inset: 0; max-width: none; max-height: none; height: 100%; border-radius: 0; padding-bottom: 0; box-shadow: 0 0 40px rgba(0,0,0,.16); transform-origin: 50% 50%; }
.sheet-wrap.world .sheet .grab, .sheet-wrap.world .sheet > .shx { display: none; }
.sh-layer.wpage .sh-head { position: relative; padding: calc(8px + env(safe-area-inset-top)) 14px 6px; min-height: 54px; justify-content: flex-start; transition: box-shadow .25s; touch-action: auto; }
.sh-layer.wpage .sh-head h3 { position: absolute; inset-inline: 104px; bottom: 15px; margin: 0; text-align: center; font-size: 16px; font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0; transform: translateY(5px); transition: opacity .22s, transform .32s var(--spring); pointer-events: none; }
.sh-layer.wpage.scrolled .sh-head h3 { opacity: 1; transform: none; }
.sh-layer.wpage.scrolled .sh-head { box-shadow: 0 .5px 0 var(--sep); }
.wback { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 2px; height: 40px; max-width: 68vw; padding: 0 14px 0 11px; border-radius: 999px; font: inherit; font-size: 14px; font-weight: 700; color: var(--ink); transition: transform .25s var(--spring); }
.wback svg { width: 16px; height: 16px; flex: none; }
.wback span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wback:active { transform: scale(.94); }
.sh-layer.wpage .sh-body { padding: 2px max(18px, calc((100% - 680px) / 2)) calc(36px + env(safe-area-inset-bottom)); }
.wtitle { margin: 0 2px 16px; font-family: "Num", "Estedad", sans-serif; font-size: 32px; font-weight: 850; line-height: 1.3; letter-spacing: -.4px; text-wrap: balance; }
.sh-layer.bk-layer .sh-head { display: none; }
.sh-layer.bk-layer .sh-body { padding: 0; overflow: hidden; position: relative; display: flex; flex-direction: column; }
.sh-layer .bkv { position: absolute; inset: 0; z-index: auto; display: flex; }

/* the honest nudge: today's three missions first */
.wnudge { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; padding-block: 8px; padding-inline: 14px 8px; border-radius: 999px; background: color-mix(in srgb, var(--ps-tri) 11%, var(--card)); border: .5px solid color-mix(in srgb, var(--ps-tri) 22%, transparent); }
.wnudge .wn-ic { flex: none; display: grid; place-items: center; width: 20px; height: 20px; color: var(--ps-tri); }
.wnudge .wn-ic svg { width: 17px; height: 17px; }
.wnudge p { margin: 0; flex: 1; min-width: 0; font-size: 14px; font-weight: 700; line-height: 1.6; }
.wn-go { flex: none; height: 34px; padding: 0 15px; border-radius: 999px; background: var(--ps-tri); color: #fff; font: inherit; font-size: 13px; font-weight: 750; transition: transform .25s var(--spring); }
.wn-go:active { transform: scale(.94); }

/* test worlds' heroes: the booklet's language (headline, one picture of the effect, punch line, quiet facts, missions note) */
.xhero p.xh-copy { margin: 0 0 4px; font-size: 14px; line-height: 1.85; color: var(--ink2); }
.xhero p.xh-punch { margin: 14px 2px 4px; font-family: "Num", "Estedad", "Vazirmatn", sans-serif; font-size: 16.5px; font-weight: 850; line-height: 1.7; color: var(--ink); }
.xhero p.xh-meta { margin: 8px 2px 0; font-size: 12px; line-height: 1.8; color: var(--ink3); }
.xhero p.xh-note { margin: 14px 0 0; padding: 12px 14px; border-radius: 18px; font-size: 13.5px; line-height: 1.85; color: var(--ink2); background: color-mix(in srgb, var(--xh) 7%, transparent); border: 1px solid color-mix(in srgb, var(--xh) 16%, transparent); }
.xhero p.xh-note b { color: var(--ink); font-weight: 800; }
.xstep { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 8px; margin: 16px 0 4px; height: 148px; }
.xs-col { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; text-align: center; gap: 2px; }
.xs-bar { display: block; width: min(100%, 92px); height: var(--h); margin: 0 auto 8px; border-radius: 18px 18px 12px 12px; background: color-mix(in srgb, var(--ink3) 22%, var(--fill2)); }
.xs-col.sim .xs-bar { background: linear-gradient(color-mix(in srgb, var(--orange) 92%, #fff), var(--orange)); box-shadow: 0 8px 20px color-mix(in srgb, var(--orange) 26%, transparent); }
.xs-col b { display: inline-flex; align-items: center; justify-content: center; gap: 3px; font-size: 13.5px; font-weight: 800; }
.xs-col b i { display: inline-grid; width: 13px; height: 13px; color: var(--orange); } .xs-col b i svg { width: 13px; height: 13px; }
.xs-col small { font-size: 11.5px; color: var(--ink3); }
.xs-up { align-self: stretch; display: flex; flex-direction: column; align-items: center; justify-content: center; padding-bottom: 46px; }
.xs-up span { font-size: 11.5px; font-weight: 750; line-height: 1.45; text-align: center; color: color-mix(in srgb, var(--orange) 80%, var(--ink)); padding: 5px 9px; border-radius: 12px; background: var(--t-orange); }
.xs-up::after { content: ""; width: 26px; height: 2px; margin-top: 8px; border-radius: 2px; background: linear-gradient(to left, var(--orange), color-mix(in srgb, var(--ink3) 40%, transparent)); }
.xvals { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.xvals li { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; line-height: 1.8; color: var(--ink2); }
.xvals li b { color: var(--ink); }
.xvals i { flex: none; display: grid; place-items: center; width: 28px; height: 28px; margin-top: 1px; border-radius: 50%; background: var(--t-orange); color: var(--orange); }
.xvals i svg { width: 15px; height: 15px; }
.xflow .bf-row { grid-template-columns: 1fr; }
.xflow .bf-row span { grid-column: 1; }
.xh-prac .xflow .bf-bar.hit::after { background: color-mix(in srgb, var(--blue) 55%, var(--fill2)); }
.xh-prac .xflow .bf-bar.full::after { background: var(--blue); }
.xh-prac .xflow .bf-bar:not(.hit):not(.full)::after { background: color-mix(in srgb, var(--blue) 28%, var(--fill2)); }
.xh-prac .xflow .bf-arrow { background: linear-gradient(var(--fill2), var(--blue)); }
.xh-prac .xflow .bf-arrow::after { border-color: var(--blue); }

/* a year from 1400 on: two separate, equal buttons — each its own capsule and its own result (not one split switch) */
.xyears .xyt-c { background: none; padding: 0; gap: 6px; border-radius: 0; }
.xyears .xc { min-height: 54px; padding: 6px 4px; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink3) 18%, transparent); }
.xyears .xc.real { background: var(--fill); }
.xyears .xc.sim { background: var(--t-orange); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--orange) 22%, transparent); }
.xyears .xc.got small b { font-size: 12.5px; }
.xyears .xc.real.got small b { color: var(--ink); }
.xyears .xc.sim.got small b { color: color-mix(in srgb, var(--orange) 85%, var(--ink)); }
.xyears .xyt-c .xc.soon { background: transparent; box-shadow: inset 0 0 0 1px var(--sep); }
/* the page behind a world slides a little to the side: never let that become sideways scrolling */
html:has(> body.in-world), body.in-world { overflow-x: clip; }
/* ---------- booklet: «داستان» sections, «نقشهٔ بزرگ» sub-tiles, the two layers «هسته» / «تکمیلی» (histmap) ----------
   story = warm paper (one soft sand hue, quieter type: read to understand); supplement = the book's hue, dashed edge + badge */
.bkv { --stc: #9a6a2f; --stt: color-mix(in srgb, #e9c79a 22%, var(--bg)); --l2: #2f7d76; --l2t: color-mix(in srgb, #2f7d76 9%, var(--card)); }
.bkv .pg:has(.bk-st) { background: var(--stt); }
.bk-st .pgt { font-size: 20px; font-weight: 750; color: color-mix(in srgb, var(--stc) 55%, var(--ink)); }
.bk-st .bk-text { font-size: 16.5px; line-height: 2.15; color: color-mix(in srgb, var(--ink) 88%, var(--stc)); }
.bk-st .bk-text li::marker { color: var(--stc); }
.bkv .chip.bk-kind.k-story { background: color-mix(in srgb, var(--stc) 16%, var(--card)); color: var(--stc); }
.bk-quiet { align-self: center; font-size: 12px; font-weight: 600; color: color-mix(in srgb, var(--stc) 70%, var(--ink3)); font-style: italic; }
.bk-st .bk-tab th { background: color-mix(in srgb, var(--stc) 13%, var(--card)); color: color-mix(in srgb, var(--stc) 80%, var(--ink)); }
.bk-st .bk-tab td.c0 { background: color-mix(in srgb, var(--stc) 6%, var(--card)); }
.bk-st .bk-mn { background: radial-gradient(120% 100% at 50% 0%, color-mix(in srgb, var(--stc) 16%, var(--card)), var(--card) 75%); }
.bk-st .mn-word, .bk-st .mn-parts b { color: var(--stc); }
.bk-st .bk-tip, .bk-st .bk-cnote { background: color-mix(in srgb, var(--stc) 10%, var(--card)); }
.bk-st .bk-rows .br-a { color: color-mix(in srgb, var(--stc) 70%, var(--ink)); }
.bk-st .bk-key .bk-rows .br { box-shadow: none; background: color-mix(in srgb, var(--card) 80%, transparent); }
.bkv .chip.bk-kind.k-l2 { background: var(--l2t); color: var(--l2); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--l2) 35%, transparent); }
.bkv .pg:has(.bk-l2) { background: color-mix(in srgb, var(--l2) 4%, var(--bg)); }
.bk-l2 .pgt { color: color-mix(in srgb, var(--l2) 60%, var(--ink)); }
.bk-l2 .bk-text li::marker { color: var(--l2); }
.bk-l2 .bk-tab th { background: color-mix(in srgb, var(--l2) 13%, var(--card)); color: color-mix(in srgb, var(--l2) 80%, var(--ink)); }
.bk-l2 .bk-tab td.c0 { background: color-mix(in srgb, var(--l2) 5%, var(--card)); }
.bk-l2 .bk-tip, .bk-l2 .bk-cnote { background: var(--l2t); }
.bk-l2 .bk-mn { background: radial-gradient(120% 100% at 50% 0%, color-mix(in srgb, var(--l2) 15%, var(--card)), var(--card) 75%); }
.bk-l2 .mn-word, .bk-l2 .mn-parts b, .bk-l2 .bk-rows .br-a { color: var(--l2); }
/* the boundary page */
.bk-bound { display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: 6vh; }
.bb-art { display: flex; gap: 6px; width: min(260px, 80%); height: 14px; margin: 0 0 22px; }
.bb-art i { display: block; height: 100%; border-radius: 999px; }
.bb-art .bb-core { flex: 3; background: var(--bk); }
.bb-art .bb-sup { flex: 1; background: repeating-linear-gradient(-45deg, var(--l2) 0 5px, color-mix(in srgb, var(--l2) 45%, transparent) 5px 10px); }
.bk-eye2 { margin: 0 0 4px; font-size: 12.5px; font-weight: 750; color: var(--ink3); }
.bk-bound .pgt { font-size: 21px; line-height: 1.75; margin-bottom: 18px; }
.bb-rows { display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 340px; }
.bb-rows div { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-radius: 18px; background: var(--card); box-shadow: var(--card-shadow); font-size: 14px; }
.bb-rows b { font-weight: 800; color: var(--bk); } .bb-rows .sup b { color: var(--l2); }
.bb-rows span { color: var(--ink2); }
.bk-bnote { margin: 18px 8px 0; max-width: 340px; font-size: 13.5px; line-height: 1.9; color: var(--ink3); }
/* track: story dots sand, supplement dots teal, the boundary a tall bar */
.bkv .ptk .tm.st { fill: var(--stc); } .bkv .ptk .tm.st.done { fill: var(--stc); opacity: .6; } .bkv .ptk .tm.st.cur { fill: var(--stc); }
.bkv .ptk .tm.l2 { fill: var(--l2); } .bkv .ptk .tm.l2.done { fill: var(--l2); opacity: .6; } .bkv .ptk .tm.l2.cur { fill: var(--l2); }
.bkv .ptk .tm.bnd { fill: var(--ink2); opacity: .7; } .bkv .ptk .tm.bnd.cur { fill: var(--l2); opacity: 1; transform: scale(1.3, 1.1); }
.bkv .ptk-sec span { color: var(--l2); }
.bk-pop .ptk-row.story .pk-dot { background: var(--stc); }
.bk-pop .ptk-row.l2 .pk-dot { background: var(--l2); }
.ptk-cut { display: flex; flex-direction: column; align-items: flex-start; width: 100%; margin: 6px 0 2px; padding: 8px 12px 6px; border: 0; border-top: 1px dashed color-mix(in srgb, var(--l2) 45%, transparent); background: none; font: inherit; text-align: start; color: var(--l2); }
.ptk-cut span { font-size: 12.5px; font-weight: 800; } .ptk-cut small { font-size: 11.5px; color: var(--ink3); }
/* tiles */
.bk-tile .bt-l2 { color: var(--l2, #2f7d76); }
.sh-layer { --l2: #2f7d76; }
/* «نقشهٔ بزرگ» is a box like every other tile (Amin, 1405/08/22) */
.bk-tile.bk-big { background: radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--bk, var(--acc)) 13%, var(--card)), var(--card) 70%); }
.bk-parts .bk-tile { min-height: 132px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bkv { --stc: #e2b47a; --stt: color-mix(in srgb, #e9c79a 6%, var(--bg)); --l2: #5cc9bd; } :root:not([data-theme="light"]) .sh-layer { --l2: #5cc9bd; } }
:root[data-theme="dark"] .bkv { --stc: #e2b47a; --stt: color-mix(in srgb, #e9c79a 6%, var(--bg)); --l2: #5cc9bd; }
:root[data-theme="dark"] .sh-layer { --l2: #5cc9bd; }
.bk-l2in { margin: 0 0 14px !important; padding: 10px 14px; border-radius: 16px; background: var(--l2t); color: color-mix(in srgb, var(--l2) 55%, var(--ink)); font-size: 14.5px; line-height: 1.9; text-align: start !important; }
.bk-yr { display: inline-block; margin-inline-start: 2px; padding: 0 8px; border-radius: 999px; font-size: 11.5px; font-weight: 750; line-height: 1.8; vertical-align: 1px; color: #8a4b00; background: color-mix(in srgb, #ff9f0a 22%, var(--card)); white-space: nowrap; }
:root[data-theme="dark"] .bk-yr { color: #ffc46b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bk-yr { color: #ffc46b; } }
.bk-l2 .bk-text h3 { color: color-mix(in srgb, var(--l2) 75%, var(--ink)); }

/* ---------- NAV2: back capsule top-LEFT (chevron pointing left, like iOS); «فهرست» as a centred sheet ---------- */
.sh-layer.wpage .sh-head { justify-content: flex-end; }
.wback, .bk-back, .backbtn { flex-direction: row-reverse; }
.wback { padding: 0 14px 0 10px; }
.bk-back { padding: 0 13px 0 10px; }
.bkv .bk-top { gap: 8px; }
.bkv .bk-top .ptk { order: 0; }
.backbtn { display: flex; width: fit-content; margin-inline-start: auto; gap: 2px; }
.backbtn span { margin-inline-start: 0; margin-inline-end: -4px; }
.bk-tocb { flex: none; display: inline-flex; align-items: center; gap: 5px; height: 38px; padding: 0 12px 0 14px; border-radius: 999px; font: inherit; font-size: 13.5px; font-weight: 750; color: var(--bk, var(--ink)); transition: transform .25s var(--spring); }
.bk-tocb svg { flex: none; }
.bk-tocb:active, .bk-back:active { transform: scale(.94); }
.bk-veil { position: absolute; inset: 0; z-index: 80; display: grid; place-items: center; padding: calc(18px + env(safe-area-inset-top)) 14px calc(18px + env(safe-area-inset-bottom)); background: rgba(10, 12, 16, 0); -webkit-backdrop-filter: blur(0); backdrop-filter: blur(0); transition: background .28s var(--ease), backdrop-filter .28s var(--ease), -webkit-backdrop-filter .28s var(--ease); }
.bk-veil.on { background: rgba(10, 12, 16, .3); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.bk-toc { display: flex; flex-direction: column; width: min(100%, 480px); max-height: min(82vh, 720px); border-radius: 30px; background: color-mix(in srgb, var(--card) 94%, transparent); -webkit-backdrop-filter: blur(30px) saturate(180%); backdrop-filter: blur(30px) saturate(180%); box-shadow: 0 24px 70px rgba(0, 0, 0, .22), 0 0 0 .5px color-mix(in srgb, var(--ink) 10%, transparent); opacity: 0; transform: translateY(18px) scale(.94); transition: opacity .22s var(--ease), transform .42s var(--spring); overflow: hidden; }
.bk-veil.on .bk-toc { opacity: 1; transform: none; }
.bk-veil.off .bk-toc { transition-duration: .2s; }
.tc-hd { position: relative; flex: none; padding: 22px 22px 14px; background: linear-gradient(180deg, color-mix(in srgb, var(--bk, var(--acc)) 13%, transparent), transparent); }
.tc-x { position: absolute; top: 16px; inset-inline-end: 16px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--fill); color: var(--ink2); }
.tc-x svg { width: 12px; height: 12px; }
.tc-eye { margin: 0; font-size: 12.5px; font-weight: 800; color: var(--bk, var(--acc)); }
.tc-hd h2 { margin: 2px 0 4px; padding-inline-end: 40px; font-family: "Num", "Estedad", sans-serif; font-size: 23px; font-weight: 850; line-height: 1.4; letter-spacing: -.2px; text-wrap: balance; }
.tc-meta { margin: 0; font-size: 13px; color: var(--ink2); line-height: 1.8; }
.tc-prog { height: 6px; margin: 12px 0 6px; border-radius: 99px; background: color-mix(in srgb, var(--ink) 9%, transparent); overflow: hidden; display: flex; justify-content: flex-start; }
.tc-prog i { display: block; height: 100%; border-radius: 99px; background: var(--bk, var(--acc)); }
.tc-pl { margin: 0; font-size: 12.5px; color: var(--ink3); }
.tc-list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px 10px 14px; }
.tc-grp { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; width: 100%; margin: 10px 0 2px; padding: 6px 12px; border: 0; background: none; font: inherit; text-align: start; color: var(--bk, var(--acc)); }
.tc-grp b { font-size: 13px; font-weight: 850; } .tc-grp span { font-size: 12px; color: var(--ink3); }
.tc-grp.sup { margin-top: 14px; border-top: 1px dashed color-mix(in srgb, var(--l2) 45%, transparent); padding-top: 12px; color: var(--l2); }
.tc-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 0; border-radius: 18px; background: none; font: inherit; text-align: start; color: inherit; transition: background .2s; }
.tc-row:active { background: var(--fill); }
.tc-n { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 12.5px; font-weight: 750; color: var(--ink3); background: color-mix(in srgb, var(--ink) 7%, transparent); }
.tc-n svg { width: 14px; height: 14px; }
.tc-row.done .tc-n { background: color-mix(in srgb, var(--bk, var(--acc)) 16%, transparent); color: var(--bk, var(--acc)); }
.tc-row.l2 .tc-n { color: var(--l2); }
.tc-row.l2.done .tc-n { background: color-mix(in srgb, var(--l2) 16%, transparent); color: var(--l2); }
.tc-row.story .tc-n { color: var(--stc, var(--ink3)); }
.tc-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tc-t b { font-size: 15px; font-weight: 700; line-height: 1.55; }
.tc-t small { font-size: 12px; color: var(--ink3); line-height: 1.6; }
.tc-row.done .tc-t b { color: var(--ink2); }
.tc-row.cur { background: color-mix(in srgb, var(--bk, var(--acc)) 13%, transparent); }
.tc-row.cur .tc-n { background: var(--bk, var(--acc)); color: #fff; box-shadow: 0 0 0 4px color-mix(in srgb, var(--bk, var(--acc)) 20%, transparent); }
.tc-here { flex: none; padding: 2px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 800; color: var(--bk, var(--acc)); background: color-mix(in srgb, var(--bk, var(--acc)) 14%, var(--card)); }
@media (prefers-reduced-motion: reduce) { .bk-veil, .bk-toc { transition: none; } .bk-toc { transform: none; } }
/* NAV2 #5: the duel explained in plain words (full until the first duel, then «نبرد چیه؟») */
.dexp { margin: 6px 0 14px; padding: 16px 16px 6px; border-radius: 24px; background: color-mix(in srgb, var(--mission, var(--blue)) 7%, var(--card)); box-shadow: var(--card-shadow); text-align: start; }
.dexp h2 { margin: 0 2px 10px; font-family: "Num", "Estedad", sans-serif; font-size: 18px; font-weight: 850; }
.dx-row { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
.dx-row i { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 12px; color: var(--mission, var(--blue)); background: color-mix(in srgb, var(--mission, var(--blue)) 13%, var(--card)); }
.dx-row i svg { width: 19px; height: 19px; }
.dx-row p { margin: 0; font-size: 14.5px; line-height: 1.95; color: var(--ink2); }
.dx-row p b { color: var(--ink); font-weight: 750; }
.dexp-q { margin: 6px 0 0; text-align: center; }
.dexp-q summary { display: inline-block; list-style: none; padding: 6px 14px; border-radius: 999px; font-size: 13.5px; font-weight: 650; color: var(--ink3); cursor: pointer; }
.dexp-q summary::-webkit-details-marker { display: none; }
.dexp-q[open] summary { color: var(--mission, var(--blue)); }
.dexp-q[open] .dexp { animation: dexpIn .4s var(--spring) both; }
@keyframes dexpIn { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
@media (prefers-reduced-motion: reduce) { .dexp-q[open] .dexp { animation: none; } }
/* day pages: «هفت نمودار» as small pictures (plan content, works in light and dark) */
.pp .vtiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: .6em 0; }
.pp .vtiles .vt { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 6px 10px; border-radius: 16px; background: var(--bg2, var(--fill)); text-align: center; line-height: 1.55; }
.pp .vtiles .vt svg { width: 96px; height: 58px; margin-bottom: 4px; background: #f7f8f9; border-radius: 12px; }

/* formulas written in Persian words: one RTL line, real fraction bar (MathML mtext breaks in RTL) */
.pp .fml { margin: .7em 0; padding: 10px 12px; border-radius: 14px; background: var(--fill); text-align: center; font-weight: 750; line-height: 2; }
.pp .fml i { font-family: "Latin Modern Math", "STIX Two Math", serif; font-style: italic; }
.pp .fr { display: inline-flex; flex-direction: column; vertical-align: middle; text-align: center; margin: 0 4px; line-height: 1.7; }
.pp .fr > span:first-child { border-bottom: 1.5px solid currentColor; padding: 0 6px; }
/* day-lesson figures: always on a light card so the drawn colours read the same in dark mode */
.pp .fig { margin: .7em 0; text-align: center; }
.pp .fig svg { display: inline-block; max-width: 100%; height: auto; border-radius: 16px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pp .fig svg { background: #f7f8f9; padding: 6px; box-sizing: border-box; } }
:root[data-theme="dark"] .pp .fig svg { background: #f7f8f9; padding: 6px; box-sizing: border-box; }
.pp .vtiles .vt b { font-size: 14px; }
.pp .vtiles .vt-d { font-size: 11.5px; color: var(--sub, var(--ink3)); }
.pp .vtiles .vt-q { font-size: 12.5px; font-weight: 650; }
.pp .vtiles .vt:last-child:nth-child(odd) { grid-column: 1 / -1; }

/* booklet tiles (1405/08/22): reading time as a small button, the second layer as a green «(+۳۵)», a thin progress stroke */
.bk-tile .bt-t { display: inline-flex; align-items: center; gap: 5px; margin: -4px -6px; padding: 4px 6px; border-radius: 10px; }
.bk-tile .bt-t:active { background: color-mix(in srgb, var(--ink) 8%, transparent); }
.bk-tile .bt-l2 { color: #2f9a62; font-weight: 750; unicode-bidi: isolate; }
.bk-tile .bt-pg { position: absolute; inset: 0; pointer-events: none; transform: scaleX(-1); overflow: visible; }
.bk-tile .bt-pg rect { fill: none; stroke-width: 1.6; }
.bk-tile .bt-pg .trk { stroke: transparent; }
.bk-tile .bt-pg .fil { stroke-linecap: round; transition: stroke-dashoffset .8s var(--ease); }
.bt-pg .core { stroke: #7d4fc0; } .bt-pg .story { stroke: #9a6a3a; } .bt-pg .l2 { stroke: #2f9a62; }
.bk-tile .bt-pg rect { stroke-linecap: butt; }
.bt-pop { position: fixed; inset: 0; z-index: 90; background: rgba(10, 12, 16, 0); transition: background .2s var(--ease); }
.bt-pop.on { background: rgba(10, 12, 16, .18); }
.btp-card { position: absolute; max-height: 60vh; display: flex; flex-direction: column; padding: 14px 14px 10px; border-radius: 22px; background: color-mix(in srgb, var(--card) 94%, transparent); -webkit-backdrop-filter: blur(28px) saturate(180%); backdrop-filter: blur(28px) saturate(180%); box-shadow: 0 16px 50px rgba(0, 0, 0, .2), 0 0 0 .5px color-mix(in srgb, var(--ink) 10%, transparent); opacity: 0; transform: scale(.94); transform-origin: top right; transition: opacity .18s var(--ease), transform .32s var(--spring); }
.bt-pop.on .btp-card { opacity: 1; transform: none; }
.btp-h { font-size: 15px; font-weight: 850; margin-bottom: 8px; }
.btp-rows > div { display: grid; grid-template-columns: 10px 1fr auto; column-gap: 8px; align-items: center; padding: 5px 0; font-size: 13.5px; }
.btp-rows i { width: 9px; height: 9px; border-radius: 50%; }
.btp-rows .story i { background: #9a6a3a; } .btp-rows .core i { background: #7d4fc0; } .btp-rows .l2 i { background: #2f9a62; }
.btp-rows .l2 b { color: #2f9a62; }
.btp-rows small { grid-column: 2 / -1; font-size: 11.5px; color: var(--ink3); }
.btp-list { margin-top: 8px; padding-top: 6px; border-top: .5px solid color-mix(in srgb, var(--ink) 12%, transparent); overflow-y: auto; overscroll-behavior: contain; }
.btp-list button { display: flex; justify-content: space-between; gap: 10px; width: 100%; padding: 7px 4px; border: 0; background: none; font: inherit; font-size: 13px; text-align: start; color: var(--ink); border-radius: 10px; }
.btp-list button small { color: var(--ink3); flex: none; }
.btp-list button.story span { color: #9a6a3a; } .btp-list button.l2 span { color: #2f9a62; }
.btp-list button.here { background: color-mix(in srgb, #7d4fc0 12%, transparent); font-weight: 750; }

/* v125 cards: one fire circle (mirrors the settings button) + today's fires as a badge beside it; clear right/wrong
   flashes; a soft burning page while the run is 10+ */
.cfire { width: 44px; height: 44px; padding: 0; border-radius: 50%; display: grid; place-items: center; gap: 0; overflow: visible; }
.cfire > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.cfire > b { position: static; top: 0; font-size: 14px; font-weight: 800; line-height: 1; color: var(--ink2); }
.cfire.warm > b, .cfire.hot > b, .cfire.burning > b { color: #e2620c; }
.cfire.burning { box-shadow: var(--glass-shadow), 0 0 22px rgba(255,106,20,.45); }
.cfire .fr-badge { position: absolute; top: 50%; right: calc(100% + 6px); transform: translateY(-50%) scale(.6); opacity: 0; display: inline-flex; align-items: center; gap: 2px; padding: 4px 8px 4px 6px; border-radius: 999px; background: color-mix(in srgb, #ff8a2a 14%, var(--card)); box-shadow: 0 2px 10px rgba(255,106,20,.18); transition: opacity .35s var(--ease), transform .45s var(--spring); white-space: nowrap; pointer-events: none; }
.cfire .fr-badge.on { opacity: 1; transform: translateY(-50%) scale(1); }
.cfire .fr-badge .fi { font-size: 14px; line-height: 1; }
.cfire .fr-badge b { font-size: 14px; font-weight: 800; color: #e2620c; line-height: 1; }
.cfire .fr-badge.pop { animation: badgepop .6s var(--spring); }
@keyframes badgepop { 0% { transform: translateY(-50%) scale(1); } 35% { transform: translateY(-50%) scale(1.35); } 100% { transform: translateY(-50%) scale(1); } }
[dir="ltr"] .cfire .fr-badge { right: auto; left: calc(100% + 6px); }
.flash.ok { background: radial-gradient(120% 90% at 50% 50%, rgba(27,160,90,0) 40%, rgba(27,160,90,.34) 100%); box-shadow: inset 0 0 80px rgba(27,160,90,.36); }
.flash.bad { background: radial-gradient(120% 90% at 50% 50%, rgba(214,48,48,0) 38%, rgba(214,48,48,.38) 100%); box-shadow: inset 0 0 80px rgba(214,48,48,.40); }
body.onfire::after { content: ""; position: fixed; inset: auto 0 0 0; height: 42vh; z-index: 0; pointer-events: none; background: radial-gradient(90% 100% at 50% 100%, rgba(255,122,26,.20), rgba(255,170,60,.08) 45%, transparent 75%); animation: emberglow 2.6s ease-in-out infinite alternate; }
@keyframes emberglow { from { opacity: .65; transform: scaleY(.94); transform-origin: bottom; } to { opacity: 1; transform: scaleY(1.04); transform-origin: bottom; } }
.ccheer { margin: 8px 2px 0; font-size: 14px; line-height: 1.75; color: var(--ink2); }
.ccheer.ok { color: color-mix(in srgb, var(--ok, #1ba05a) 70%, var(--ink)); }
.ccheer.bad { color: var(--ink2); }
@media (prefers-reduced-motion: reduce) { body.onfire::after { animation: none; } .cfire .fr-badge.pop { animation: none; } }

/* v126 card feedback: the one thing to remember; the rest folded; a required self-check after a miss; a round flag
   apart in the bottom-left corner */
.ccheer { font-size: 14.5px; font-weight: 600; margin: 6px 2px 2px; }
.ckey { background: color-mix(in srgb, var(--mission, #d64fa3) 7%, var(--card)); }
.ckeyl { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 6px; }
.ckeyl li { display: flex; align-items: center; gap: 8px; font-size: 15px; line-height: 1.7; }
.ckeyl .arr { color: var(--ink3); }
.ckeyl b { font-weight: 800; }
.ckey p { margin: 4px 0 0; font-size: 15px; line-height: 1.8; }
details.cfull { margin-top: 2px; }
details.cfull > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; font-size: 14px; font-weight: 700; color: var(--ink2); background: var(--fill); }
details.cfull > summary::-webkit-details-marker { display: none; }
details.cfull > summary::after { content: ""; width: 7px; height: 7px; border: solid currentColor; border-width: 0 1.8px 1.8px 0; transform: rotate(45deg) translateY(-2px); transition: transform .3s var(--ease); }
details.cfull[open] > summary::after { transform: rotate(-135deg) translateY(-1px); }
details.cfull[open] > summary { margin-bottom: 10px; }
.cself { margin: 14px 0 6px; text-align: center; }
.cself p { margin: 0 0 10px; font-size: 14px; color: var(--ink2); font-weight: 700; }
.cself > div { display: flex; gap: 10px; }
.cself .btn { flex: 1; border-radius: 999px; padding: 13px 10px; font-weight: 800; }
.cself .btn[data-self="ok"] { color: #1a8a50; }
.cself .btn[data-self="no"] { color: #c0453a; }
.cself.done .btn:not(.on) { opacity: .45; }
.cself .btn.on[data-self="ok"] { background: color-mix(in srgb, #1ba05a 16%, var(--card)); }
.cself .btn.on[data-self="no"] { background: color-mix(in srgb, #d63030 14%, var(--card)); }
.cself.nudge { animation: selfnudge .5s var(--spring); }
@keyframes selfnudge { 0%, 100% { transform: none; } 30% { transform: translateX(-6px); } 60% { transform: translateX(5px); } }
.cbottom .cflag { pointer-events: auto; position: absolute; left: 16px; bottom: 50%; transform: translateY(50%); width: 44px; height: 44px; border-radius: 999px; display: grid; place-items: center; color: var(--ink3); }
.cbottom .cflag.hid { display: none; }

/* v130 the answer line writes itself in: words rise and fade in one after another, a light sweeps under the line */
.ccheer { position: relative; }
.ccheer.typing span { display: inline-block; white-space: pre; opacity: 0; transform: translateY(6px); filter: blur(3px); animation: cheerword .42s var(--ease) forwards; }
@keyframes cheerword { to { opacity: 1; transform: none; filter: none; } }
.ccheer.ok::after { content: ""; position: absolute; inset-inline: 2px; bottom: -4px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, transparent, color-mix(in srgb, #1ba05a 55%, transparent), transparent); background-size: 200% 100%; animation: cheersweep 1.4s var(--ease) .2s both; }
@keyframes cheersweep { from { background-position: 100% 0; opacity: 1; } to { background-position: -100% 0; opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .ccheer.ok::after { animation: none; display: none; } }
/* v145 fire pill: one fire, its count under it; the ring is the run toward the next fire (Amin 1405/08/22) */
.cfire .fi { position: relative; font-size: 15px; line-height: 1; top: -4px; }
.cfire b.n { position: absolute; left: 0; right: 0; bottom: 6px; top: auto; text-align: center; font-size: 10.5px; font-weight: 800; color: #e2620c; }
.cfire .fr-badge { display: none; }
.cfire.won { animation: firewon .9s var(--spring); }
.cfire.won .prg { stroke: #ff7a1a; }
.cfire.won .fi { animation: fireflare .9s var(--spring); }
@keyframes firewon { 0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255,122,26,.0); } 35% { transform: scale(1.18); box-shadow: 0 0 0 8px rgba(255,122,26,.18); } 100% { transform: scale(1); box-shadow: 0 0 0 14px rgba(255,122,26,0); } }
@keyframes fireflare { 0% { transform: scale(1); } 30% { transform: scale(1.6) rotate(-8deg); } 60% { transform: scale(.92); } 100% { transform: scale(1); } }
.fspark { position: fixed; z-index: 90; width: 6px; height: 6px; border-radius: 50%; pointer-events: none; background: radial-gradient(circle, #ffd27a, #ff7a1a 70%); }
@media (prefers-reduced-motion: reduce) { .cfire.won, .cfire.won .fi { animation: none; } }
/* v148 answer view (Amin 1405/08/22): marked once at the top; wrong pick soft red + strike; compact question; real self-check buttons */
.cardsv .cside.bad, .cside.bad { background: var(--bad-bg, rgba(210,69,61,.1)); border-color: color-mix(in srgb, var(--bad, #c0453a) 45%, transparent); color: var(--bad, #c0453a); opacity: 1; box-shadow: none; }
.cside.bad span { text-decoration: line-through; text-decoration-thickness: 1.5px; text-decoration-color: color-mix(in srgb, var(--bad, #c0453a) 55%, transparent); }
.cardsv .cside.bad::after { display: none; }
.crecap { padding: 10px 14px; margin: 0 0 6px; }
.crecap .cq { font-size: 14.5px; font-weight: 600; line-height: 1.75; margin: 0; color: var(--ink2, inherit); }
.cv { font-size: 16px; }
.cself .btn { border: 1.5px solid transparent; }
.cself .btn.sgot { background: #1f9d57; color: #fff; }
.cself .btn.snot { background: transparent; color: var(--ink); border-color: color-mix(in srgb, var(--ink) 70%, transparent); }
.cself .btn.on.sgot { background: #17824a; color: #fff; }
.cself .btn.on.snot { background: color-mix(in srgb, var(--ink) 8%, transparent); }
.cside.bad span, .cside.bad span * { text-decoration: line-through !important; text-decoration-thickness: 1.5px; }
/* v149 global report flag: bottom-left above the tab bar, on every screen and over sheets */
.gflag { position: fixed; left: 14px; bottom: calc(env(safe-area-inset-bottom, 0px) + 92px); z-index: 60; width: 44px; height: 44px; border-radius: 999px; display: grid; place-items: center; color: var(--ink3); opacity: .85; }
.gflag.hid { display: none; }
#sh.on ~ .gflag, body .gflag { z-index: 1200; }

/* v149 booklet figures: inline SVG drawn in the page's own colours (works in dark mode) */
.bfig { margin: 14px 0 16px; padding: 12px 10px 10px; border-radius: 18px; background: var(--l2, rgba(120,120,128,.08)); color: var(--ink); }
.bfig svg { display: block; width: 100%; height: auto; max-width: 420px; margin: 0 auto; direction: ltr; overflow: visible; }
.bfig svg text { font-family: inherit; }
.bfig figcaption { margin-top: 8px; font-size: 13px; line-height: 1.7; color: var(--ink2); text-align: center; }
/* v152 fire pill: the circle = ring + one fire (no number); today's fires stand beside it as small fires; the halo
   trembles near the next fire (Amin 1405/08/22) */
.cfire .fr-ring { position: absolute; inset: 0; width: 100%; height: 100%; display: grid; place-items: center; }
.cfire .fr-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.cfire .fr-ring .fi { position: relative; top: 0; font-size: 17px; line-height: 1; }
.cfire .fr-row { position: absolute; top: 50%; right: calc(100% + 6px); transform: translateY(-50%); display: inline-flex; align-items: center; gap: 1px; white-space: nowrap; pointer-events: none; line-height: 1; }
[dir="ltr"] .cfire .fr-row { right: auto; left: calc(100% + 6px); }
.cfire .fr-row i { font-style: normal; font-size: 15px; } .cfire .fr-row i.nw { animation: frIn .5s var(--spring) both; }
.cfire .fr-row b { position: static; font-size: 13px; font-weight: 800; color: #e2620c; margin-inline-start: 3px; }
@keyframes frIn { from { transform: scale(.3); opacity: 0; } to { transform: none; opacity: 1; } }
.cfire.warm { box-shadow: var(--glass-shadow), 0 0 0 2px rgba(255,138,42,.4), 0 0 14px rgba(255,138,42,.35); animation: fireTremble 1.6s ease-in-out infinite; }
.cfire.hot { box-shadow: var(--glass-shadow), 0 0 0 2.5px rgba(255,110,20,.65), 0 0 22px rgba(255,110,20,.55); animation: fireTremble .85s ease-in-out infinite; }
@keyframes fireTremble { 0%,100% { transform: translateX(0) rotate(0); } 20% { transform: translateX(-1px) rotate(-2deg); } 40% { transform: translateX(1px) rotate(2deg); } 60% { transform: translateX(-.6px) rotate(-1deg); } 80% { transform: translateX(.6px) rotate(1deg); } }
@media (prefers-reduced-motion: reduce) { .cfire.warm, .cfire.hot, .cfire .fr-row i { animation: none; } }
/* radicals with a real vinculum (v152) */
.fx .rad { display: inline-flex; align-items: flex-start; white-space: nowrap; }
.fx .rad .rs { font-size: 1.08em; line-height: 1; }
.fx .rad .ri { border-top: 1.4px solid currentColor; padding: .05em .12em 0 .08em; margin-inline-start: -.04em; line-height: 1.15; }
.bk-searching .bk-hero { display: none; }
/* photo zoom (v152) */
.phz { position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center; background: rgba(0,0,0,.0); backdrop-filter: blur(0); transition: background .26s, backdrop-filter .26s; padding: 24px; }
.phz.on { background: rgba(0,0,0,.62); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.phz figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 14px; max-width: 340px; text-align: center; color: #fff; }
.phz img { width: min(72vw, 280px); aspect-ratio: 1; object-fit: cover; border-radius: 50%; box-shadow: 0 18px 50px rgba(0,0,0,.45); }
.phz figcaption { display: flex; flex-direction: column; gap: 4px; opacity: 0; transform: translateY(8px); transition: opacity .3s .12s, transform .3s .12s; }
.phz.on figcaption { opacity: 1; transform: none; }
.phz figcaption b { font-size: 19px; font-weight: 800; }
.phz figcaption span { font-size: 13px; opacity: .7; }
.phz figcaption p { margin: 6px 0 0; font-size: 14px; line-height: 1.8; opacity: .82; }

/* v155: tests pages intro; booklet history boxes; theories map; people tree three per row */
.xh-lead { margin: 2px 4px 12px; font-size: 14.5px; line-height: 1.9; color: var(--ink2); }
.xgroups { margin-bottom: 12px; }
.xgroups .li b { font-weight: 800; }
.xs-go { flex: none; padding: 6px 14px; border-radius: 999px; background: var(--t-blue); color: var(--blue); font-weight: 800; font-size: 13px; }
.bk-histrow { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 4px 0 14px; }
.bk-hbox { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 14px; border-radius: 20px; background: var(--card); box-shadow: var(--card-shadow); color: var(--ink); text-align: start; }
.bk-hbox i { display: grid; place-items: center; width: 38px; height: 38px; margin-bottom: 6px; border-radius: 12px; background: var(--t-yellow); color: var(--yellow); }
.bk-hbox.hb-th i { background: var(--t-blue); color: var(--blue); }
.bk-hbox b { font-weight: 800; font-size: 15px; }
.bk-hbox small { font-size: 12px; color: var(--ink3); line-height: 1.6; }
.thstrip { padding: 12px 14px; }
.ths-ax .ths-bar { height: 16px; background: none; }
.ths-ax em { position: absolute; top: 0; transform: translateX(50%); font-style: normal; font-size: 11px; color: var(--ink3); }
.ths-ax em::after { content: ''; position: absolute; top: 18px; left: 50%; width: 1px; height: 230px; background: var(--sep); opacity: .5; pointer-events: none; }
.thstrip { overflow: hidden; }
.thfam h4 span { color: var(--fc); }
.ths-row { display: flex; align-items: center; gap: 8px; width: 100%; padding: 5px 0; background: none; color: var(--ink); }
.ths-n { flex: 0 0 34%; font-size: 12.5px; font-weight: 750; text-align: start; }
.ths-bar { position: relative; flex: 1; height: 10px; border-radius: 999px; background: var(--fill); }
.ths-bar i { position: absolute; top: 0; bottom: 0; border-radius: 999px; background: currentColor; }
.ths-bar i.tone-violet { color: var(--violet); } .ths-bar i.tone-blue { color: var(--blue); } .ths-bar i.tone-acc { color: var(--acc); }
.ths-bar i.tone-yellow { color: var(--yellow); } .ths-bar i.tone-orange { color: var(--orange); } .ths-bar i.tone-aqua { color: var(--aqua); } .ths-bar i.tone-gray { color: var(--ink3); }
.thfam { --fc: var(--acc); border-inline-start: 4px solid var(--fc); scroll-margin-top: 70px; }
.fam-violet { --fc: var(--violet); } .fam-blue { --fc: var(--blue); } .fam-yellow { --fc: var(--yellow); } .fam-orange { --fc: var(--orange); } .fam-aqua { --fc: var(--aqua); } .fam-gray { --fc: var(--ink3); }
.thfam h4 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.thfam h4 small { font-size: 12px; color: var(--ink3); font-weight: 600; }
.thsc { margin: 10px 0 4px; font-size: 12.5px; font-weight: 800; color: var(--fc); }
.thline { position: relative; margin: 2px 0 4px; padding-inline-start: 4px; }
.thline::before { content: ""; position: absolute; inset-block: 14px; inset-inline-start: 25px; width: 2px; background: color-mix(in srgb, var(--fc) 30%, transparent); }
.thi { position: relative; display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 0; background: none; color: var(--ink); text-align: start; }
.thy { position: relative; z-index: 1; flex: none; width: 44px; padding: 3px 0; border-radius: 999px; background: color-mix(in srgb, var(--fc) 16%, var(--card)); color: var(--fc); font-size: 12px; font-weight: 800; text-align: center; }
.thn { display: flex; flex-direction: column; font-weight: 750; font-size: 14px; line-height: 1.5; }
.thn small { font-size: 11.5px; color: var(--ink3); font-weight: 600; }
.ptnote { margin: -2px 0 8px; }
.ptree { display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 112px; row-gap: 0; column-gap: 4px;
  background-image: repeating-linear-gradient(to bottom, transparent 0 32px, var(--sep) 32px 34px, transparent 34px 112px); background-size: 66.6% 100%; background-position: center; background-repeat: no-repeat repeat; }
.ptree button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px 0; background: none; color: var(--ink); text-align: center; }
.ptree .tph { width: 48px; height: 48px; margin: 0 0 4px; box-shadow: 0 0 0 3px var(--card); }
.ptree b { font-size: 12.5px; font-weight: 800; line-height: 1.35; max-width: 100%; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ptree small { font-size: 10.5px; color: var(--ink3); font-weight: 600; }

/* v155 «قرار»: the rhythm dot in the day player */
.qr { display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; border-radius: 999px; }
.qr i, .qr-dot { display: block; width: 16px; height: 16px; border-radius: 50%; background: hsl(var(--qh, 140) 68% 47%); box-shadow: 0 0 0 4px hsl(var(--qh, 140) 68% 47% / .18); transition: background 2s ease, box-shadow 2s ease; }
.qr-dot { width: 44px; height: 44px; margin-bottom: 8px; box-shadow: 0 0 0 10px hsl(var(--qh, 140) 68% 47% / .15); }
.qr-dot.sm { display: inline-block; width: 10px; height: 10px; margin: 0 0 0 6px; box-shadow: none; vertical-align: middle; }
.qr-big { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 6px 0 14px; text-align: center; }
.qr-big b { font-size: 22px; font-weight: 850; }
.qr-big span { color: var(--ink2); font-size: 14.5px; line-height: 1.8; }
.qr-strip { display: flex; justify-content: center; gap: 7px; margin: 4px 0 6px; }
.qr-strip i { width: 14px; height: 14px; border-radius: 50%; background: hsl(var(--qh) 68% 47%); }
.qr-score { display: inline-flex; align-items: center; gap: 4px; color: var(--ink2); }
/* v155: day pages — a quiet exam year instead of chips; explanations as compact as the cards' */
.pgyr { margin-inline-start: auto; font-size: 12.5px; font-weight: 700; color: var(--ink3); }
.planv .ex { font-size: 14px; line-height: 1.8; padding: 12px 14px; border-radius: 18px; }
.planv .ex h4 { font-size: 13.5px; margin-bottom: 2px; }
.planv .verdict { margin-bottom: 8px; }

/* v159: books — three side by side again, one calm shape: plain card, tinted icon, small type */
.bk-books { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.bk-books .bk-book { aspect-ratio: auto; min-height: 0; padding: 12px 11px 12px; gap: 1px; justify-content: flex-start; background: var(--card) !important; box-shadow: var(--card-shadow); }
.bk-books .bk-book .bb-ic { margin: 0 0 10px; width: 38px; height: 38px; border-radius: 12px; background: color-mix(in srgb, var(--bk) 13%, var(--card)); box-shadow: none; }
.bk-books .bk-book .bb-ic svg { width: 20px; height: 20px; }
.bk-books .bk-book .bb-k { margin: 0; font-size: 10.5px; font-weight: 700; color: var(--ink3); }
.bk-books .bk-book b { font-size: 13.5px; line-height: 1.5; font-weight: 800; text-wrap: balance; }
.bk-books .bk-book small { margin-top: 3px; font-size: 11px; line-height: 1.5; color: var(--ink3); }
.bk-books .bk-book small + small { margin-top: 0; }
.wnudge .wn-ic { width: 26px; height: 26px; }
.wnudge .wn-ic .tt-svg { width: 26px; height: 26px; }
.wnudge .wn-ic .tt-svg path { stroke-width: 2.6; }
.xpil { display: grid; gap: 8px; margin: 14px 0 4px; }
.xpil > div { display: grid; grid-template-columns: 10px 1fr; column-gap: 10px; align-items: baseline; padding: 11px 13px; border-radius: 16px; background: color-mix(in srgb, var(--xh) 6%, var(--card)); }
.xpil i { grid-row: 1 / 3; align-self: start; margin-top: 7px; width: 10px; height: 10px; border-radius: 50%; background: var(--blue); }
.xpil i.t2 { background: var(--violet); } .xpil i.t3 { background: var(--acc); }
.xpil b { font-size: 14.5px; font-weight: 800; color: var(--ink); }
.xpil span { font-size: 13px; line-height: 1.8; color: var(--ink2); }

/* v158: the two tools as tiles in «آغاز راه» */
.bk-tool .bt-ic { background: color-mix(in srgb, var(--yellow) 16%, var(--card)); color: var(--yellow); }
#h-th.bk-tool .bt-ic { background: color-mix(in srgb, var(--blue) 14%, var(--card)); color: var(--blue); }
.bk-tool .bt-n { color: var(--ink3); }

/* v161: the insertion mark in the tests title — a handwritten aside slipped in above the line */
.xhero h2.xh-ins { display: flex; flex-direction: column; align-items: center; margin: 10px 0 14px; text-align: center; line-height: 1.5; }
.xins-n { display: block; margin: 2px 0; font-family: "Vazirmatn", sans-serif; font-size: 13.5px; font-weight: 600; color: color-mix(in srgb, var(--xh) 85%, var(--ink)); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.xpil small { grid-column: 2; margin-top: 4px; font-size: 11px; line-height: 1.7; color: var(--ink3); }
.xwhy { list-style: none; margin: 4px 0 12px; padding: 0; display: grid; gap: 6px; }
.xwhy li { position: relative; padding-inline-start: 26px; font-size: 14px; line-height: 1.75; color: var(--ink); }
.xwhy li::before { content: ""; position: absolute; inset-inline-start: 0; top: .3em; width: 18px; height: 18px; border-radius: 50%; background: color-mix(in srgb, var(--acc) 16%, var(--card)) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2318a37a' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4 8-9'/%3E%3C/svg%3E") center / 12px no-repeat; }

/* v162 (Amin): world bar — the back capsule says the whole name; the small title sits on the right, beside it, never under it */
.wback { max-width: 62vw; font-size: 13px; }
.sh-layer.wpage .sh-head h3 { inset-inline-start: 18px; inset-inline-end: calc(var(--wbw, 120px) + 26px); bottom: auto; top: calc(8px + env(safe-area-inset-top) + 20px); transform: translateY(calc(-50% + 5px)); text-align: start; font-size: 14px; line-height: 1.35; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; text-overflow: clip; }
.sh-layer.wpage.scrolled .sh-head h3 { transform: translateY(-50%); }

/* v162: weak points as a calm list */
.weak-card .wl button { display: grid; grid-template-columns: 1fr auto; column-gap: 8px; align-items: center; width: 100%; padding: 10px 0; margin: 0; border-radius: 0; text-align: start; background: none; color: var(--ink); border-bottom: .5px solid var(--sep); }
.weak-card .wl button:last-child { border-bottom: 0; }
.weak-card .wl b { font-size: 14.5px; font-weight: 750; line-height: 1.6; }
.weak-card .wl small { grid-column: 1; font-size: 12px; line-height: 1.6; color: var(--ink3); }
.weak-card .wl .chev { grid-row: 1 / 3; grid-column: 2; color: var(--ink3); }

/* v163: the practice lead on one line, closer to the top */
.xh-lead { margin: -4px 2px 8px; font-size: clamp(10.5px, 2.9vw, 13px); line-height: 1.7; letter-spacing: -.1px; }
@media (min-width: 360px) { .xh-lead { white-space: nowrap; } }
.wnudge p { font-size: 13.5px; }

/* v165: «ترکیب برنده» as a small equation */
.xwin { margin: 14px 0 4px; padding: 14px; border-radius: 18px; background: color-mix(in srgb, var(--xh) 8%, var(--card)); }
.xw-t { margin: 0 0 10px !important; font-size: 14.5px !important; font-weight: 850; color: var(--ink) !important; text-align: center; }
.xw-eq { display: flex; flex-direction: column; align-items: stretch; gap: 4px; text-align: center; }
.xw-eq span { padding: 8px 12px; border-radius: 14px; background: var(--card); font-size: 13.5px; font-weight: 700; line-height: 1.7; color: var(--ink); }
.xw-eq span small { display: block; font-size: 11.5px; font-weight: 500; color: var(--ink3); }
.xw-eq i { font-style: normal; font-size: 16px; font-weight: 800; line-height: 1.1; color: color-mix(in srgb, var(--xh) 80%, var(--ink)); }
.xw-eq b { padding: 9px 12px; border-radius: 14px; background: var(--xh); color: #fff; font-size: 14.5px; font-weight: 850; }
/* v168: first open — onboarding slides, one-screen phone sign-in (as in ReMiFa), the tab tour */
.ob { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; padding: calc(14px + env(safe-area-inset-top)) 24px calc(22px + env(safe-area-inset-bottom)); max-width: 520px; margin: 0 auto; animation: obIn .45s var(--ease, ease) both; }
@keyframes obIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.ob-skip { align-self: flex-start; min-height: 36px; padding: 6px 4px; color: var(--ink3); font-weight: 650; font-size: 15px; background: none; }
.ob-vis { flex: 1; display: grid; place-items: center; min-height: 200px; }
.ob-svg { width: min(78vw, 300px); height: auto; overflow: visible; }
.ob-svg .trail { fill: none; stroke: var(--fill2, #ddd); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 2 7; }
.ob-svg circle { stroke: var(--card); stroke-width: 3; }
.ob-svg circle.done { fill: var(--acc); } .ob-svg circle.now { fill: var(--card); stroke: var(--acc); stroke-width: 4; } .ob-svg circle.next { fill: var(--fill2, #e5e5ea); }
.ob-svg .tri { fill: color-mix(in srgb, var(--acc) 10%, transparent); stroke: none; }
.ob-svg .s1, .ob-svg .s2, .ob-svg .s3 { fill: none; stroke-width: 9; stroke-linecap: round; }
.ob-svg .s1 { stroke: var(--violet); } .ob-svg .s2 { stroke: var(--blue); } .ob-svg .s3 { stroke: var(--orange); }
.ob-svg text { font: 800 13px "Vazirmatn", sans-serif; fill: var(--ink2); }
.ob-bars { width: min(82vw, 320px); display: grid; gap: 16px; }
.ob-bars div { display: grid; grid-template-columns: auto 1fr; align-items: baseline; column-gap: 10px; }
.ob-bars i { grid-column: 1 / -1; order: 3; height: 10px; border-radius: 999px; background: linear-gradient(to left, var(--acc) var(--w), var(--fill) var(--w)); margin-top: 6px; }
.ob-bars i.hit { background: linear-gradient(to left, color-mix(in srgb, var(--acc) 75%, var(--blue)) var(--w), var(--fill) var(--w)); }
.ob-bars i.full { background: var(--acc); }
.ob-bars b { font: 900 26px "Num", "Estedad", sans-serif; color: var(--ink); }
.ob-bars span { font-size: 13.5px; color: var(--ink2); }
.ob-txt { text-align: center; margin: 8px 0 18px; }
.ob-eye { margin: 0 0 6px; font-size: 13px; font-weight: 800; color: var(--acc); }
.ob-txt h2 { margin: 0 0 10px; font-family: "Num", "Estedad", "Vazirmatn", sans-serif; font-size: 26px; font-weight: 850; line-height: 1.45; letter-spacing: -.3px; }
.ob-c { margin: 0 auto; max-width: 30em; font-size: 15px; line-height: 1.9; color: var(--ink2); }
.ob-foot { display: grid; gap: 16px; }
.ob-dots { display: flex; justify-content: center; gap: 7px; }
.ob-dots i { width: 7px; height: 7px; border-radius: 999px; background: var(--fill2, #d1d1d6); transition: width .3s, background .3s; }
.ob-dots i.on { width: 22px; background: var(--acc); }
.ob-next { width: 100%; min-height: 52px; font-size: 16px; }
.lock .lgcode { display: none; } .lock .lgcode.on { display: block; animation: obIn .3s ease both; }
.lock .btn.hide { display: none; }
.lock .lgst { display: block; min-height: 22px; margin-top: 10px; font-size: 13px; color: var(--bad); line-height: 1.7; }
.lock .lgst.ok { color: var(--ink3); }
.lock .lg-pw { display: block; margin: 18px auto 0; font-size: 14px; color: var(--ink3); }
.lock .otp-in { text-align: center; letter-spacing: .6em; font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.lock [data-again] { display: block; margin: 4px auto 0; font-size: 14px; }
.lock [data-again]:disabled { opacity: .55; }
.tour { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.42); display: flex; align-items: flex-end; justify-content: center; padding: 0 16px calc(110px + env(safe-area-inset-bottom)); animation: obIn .3s ease both; }
.tour-card { width: 100%; max-width: 420px; padding: 18px 18px 14px; border-radius: 24px; background: var(--card); box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.tour-card h3 { margin: 2px 0 6px; font: 850 20px "Num", "Estedad", sans-serif; }
.tour-card p { margin: 0; font-size: 14.5px; line-height: 1.85; color: var(--ink2); }
.tour-card .tour-step { font-size: 12px; font-weight: 750; color: var(--acc); margin-bottom: 2px; }
.tour-row { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }
.tour-row .btn { width: auto; flex: none; min-width: 130px; padding: 0 26px; }
.ob-svg text { paint-order: stroke; stroke: var(--bg); stroke-width: 5px; stroke-linejoin: round; }
.tabbar.tour-lift { z-index: 61; }
.tabbar button.tour-on { color: var(--acc) !important; }
.tabbar button.tour-on svg, .tabbar button.tour-on span { transform: scale(1.08); }
.tabbar.tour-lift button:not(.tour-on) { opacity: .35; }
.ob-preview { position: fixed; inset: 0; z-index: 70; background: var(--bg); overflow: auto; }
.ob-preview .lock { min-height: 100dvh; }
.ob-close { position: fixed; top: calc(12px + env(safe-area-inset-top)); left: 14px; z-index: 71; width: 40px; height: 40px; border-radius: 999px; display: grid; place-items: center; }
/* ---------- v169: first open v2 ---------- */
.ob-pick { justify-content: center; gap: 22px; }
.ob-txt.top { margin-bottom: 4px; }
.ob-opts { display: grid; gap: 12px; }
.ob-opt { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 64px; padding: 0 24px; border-radius: 999px; background: var(--card); box-shadow: var(--card-shadow); font: 800 18px "Num", "Estedad", sans-serif; color: var(--ink); transition: transform .3s var(--spring), box-shadow .25s, background .25s; }
.ob-opt:active { transform: scale(.97); }
.ob-opt.sel { background: var(--acc); color: #fff; box-shadow: 0 10px 28px color-mix(in srgb, var(--acc) 35%, transparent); }
.ob-opt small { font: 650 12.5px "Vazirmatn", sans-serif; color: var(--ink3); }
.ob-opt.off { color: var(--ink3); background: color-mix(in srgb, var(--card) 60%, transparent); box-shadow: none; }
.ob-opt.off small { padding: 4px 10px; border-radius: 999px; background: var(--fill); }
.ob-opt.shake { animation: obShake .4s ease; }
@keyframes obShake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.ob-soon { min-height: 24px; margin: 0; text-align: center; font-size: 13.5px; color: var(--ink3); }
/* the wall of sources: four rows running in turns; «جمعشون کن» pulls them into the 5 % */
.ob2 .ob-vis { min-height: 240px; }
.ob-wall { position: relative; width: calc(100% + 48px); margin: 0 -24px; display: grid; gap: 10px; overflow: hidden; -webkit-mask: linear-gradient(to left, transparent, #000 12%, #000 88%, transparent); mask: linear-gradient(to left, transparent, #000 12%, #000 88%, transparent); padding: 6px 0; }
.ob-row { overflow: hidden; transition: transform .8s var(--ease), opacity .6s, filter .6s; }
.ob-track { display: flex; gap: 10px; width: max-content; animation: obMarq var(--d, 36s) linear infinite; }
.ob-row.rev .ob-track { animation-direction: reverse; }
@keyframes obMarq { to { transform: translateX(50%); } }
.ob-wall .bk { flex: none; width: 88px; height: 112px; border-radius: 6px 12px 12px 6px; padding: 12px 10px 10px 12px; display: flex; flex-direction: column; justify-content: space-between; text-align: start; box-shadow: inset 6px 0 0 rgba(0,0,0,.07), 0 4px 12px rgba(0,0,0,.07); }
.ob-wall .bk b { font: 800 11.5px/1.55 "Estedad", "Vazirmatn", sans-serif; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.ob-wall .bk span { font-size: 9.5px; line-height: 1.5; color: var(--ink2); }
.bk.t-blue { background: var(--t-blue); } .bk.t-orange { background: var(--t-orange); } .bk.t-aqua { background: var(--t-aqua); } .bk.t-yellow { background: var(--t-yellow); } .bk.t-violet { background: var(--t-violet); } .bk.t-gray { background: var(--t-gray); }
.ob-gem5 { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 4px; opacity: 0; transform: scale(.6); transition: opacity .5s .35s, transform .7s .3s var(--spring); pointer-events: none; }
.ob-gem5 b { display: grid; place-items: center; width: 120px; height: 120px; border-radius: 999px; background: var(--acc); color: #fff; font: 900 40px "Num", "Estedad", sans-serif; box-shadow: 0 0 0 14px color-mix(in srgb, var(--acc) 14%, transparent), 0 0 0 30px color-mix(in srgb, var(--acc) 6%, transparent), 0 18px 40px color-mix(in srgb, var(--acc) 40%, transparent); }
.ob-gem5 span { margin-top: 30px; font-size: 13px; font-weight: 750; color: var(--acc-ink); }
.ob2.gathering .ob-row, .ob2.gathered .ob-row { transform: scale(.08); opacity: 0; filter: blur(2px); }
.ob2.gathering .ob-row:nth-child(2n), .ob2.gathered .ob-row:nth-child(2n) { transition-delay: .08s; }
.ob2.gathering .ob-gem5, .ob2.gathered .ob-gem5 { opacity: 1; transform: none; }
.ob2.gathered .ob-row, .ob2.gathered .ob-gem5 { transition: none; }
.ob2.gathering .ob-txt { opacity: 0; transition: opacity .3s; }
/* 80/20 → 85/5 */
.ob-rule { position: relative; display: grid; justify-items: center; gap: 14px; }
.ob-rule .r { display: flex; align-items: baseline; gap: 4px; font: 900 76px/1 "Num", "Estedad", sans-serif; direction: ltr; }
.ob-rule .r i { font-style: normal; color: var(--ink3); font-weight: 500; }
.ob-rule .old { position: absolute; top: 0; color: var(--ink3); animation: ruleOut 1.1s .7s var(--ease) forwards; }
.ob-rule .new { color: var(--acc); opacity: 0; animation: ruleIn .9s 1.2s var(--spring) forwards; }
.ob-rule p { margin: 0; font-size: 14px; font-weight: 750; color: var(--ink2); opacity: 0; animation: obIn .5s 1.8s ease forwards; }
@keyframes ruleOut { to { opacity: 0; transform: translateY(-34px) scale(.8); filter: blur(3px); } }
@keyframes ruleIn { from { opacity: 0; transform: translateY(30px) scale(.85); } to { opacity: 1; transform: none; } }
/* the treasure */
.ob-gem { width: min(76vw, 280px); }
.ob-gem .trail { stroke: var(--acc); stroke-dasharray: 3 8; opacity: .6; stroke-dashoffset: 200; animation: gemTrail 2s .2s ease forwards; }
@keyframes gemTrail { to { stroke-dashoffset: 0; } }
.ob-gem .me { fill: var(--acc); stroke: var(--card); }
.ob-gem .gemp { fill: var(--t-yellow); stroke: var(--yellow); stroke-width: 2.5; stroke-linejoin: round; animation: gemPop .8s 1.4s var(--spring) both; transform-origin: 178px 50px; }
.ob-gem .gemf { fill: none; stroke: var(--yellow); stroke-width: 1.6; stroke-linejoin: round; animation: gemPop .8s 1.4s var(--spring) both; transform-origin: 178px 50px; }
.ob-gem .rays path { stroke: var(--yellow); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 4 6; opacity: 0; animation: gemRays 2.6s 1.8s ease-in-out infinite; }
@keyframes gemPop { from { opacity: 0; transform: scale(.3) rotate(-20deg); } to { opacity: 1; transform: none; } }
@keyframes gemRays { 0%, 100% { opacity: 0; } 50% { opacity: .7; } }
/* the daily triangle draws itself */
.ob-tri .s1, .ob-tri .s2, .ob-tri .s3 { stroke-dasharray: 200; stroke-dashoffset: 200; animation: triDraw .7s var(--ease) forwards; }
.ob-tri .s1 { animation-delay: .3s; } .ob-tri .s2 { animation-delay: 1s; } .ob-tri .s3 { animation-delay: 1.7s; }
@keyframes triDraw { to { stroke-dashoffset: 0; } }
.ob-tri text { opacity: 0; animation: obIn .4s forwards; } .ob-tri text:nth-of-type(1) { animation-delay: .8s; } .ob-tri text:nth-of-type(2) { animation-delay: 1.5s; } .ob-tri text:nth-of-type(3) { animation-delay: 2.2s; }
/* the playable demo card */
.ob-cdemo { width: min(86vw, 340px); }
.ob-cd { padding: 20px 18px 14px; border-radius: 26px; background: var(--card); box-shadow: 0 14px 40px rgba(0,0,0,.09); display: grid; gap: 12px; }
.ob-cd.in { animation: cdIn .45s var(--spring) both; }
@keyframes cdIn { from { opacity: 0; transform: translateX(-30px) rotate(-2deg); } to { opacity: 1; transform: none; } }
.ob-cq { font: 800 16px/1.8 "Estedad", "Vazirmatn", sans-serif; text-align: center; min-height: 58px; display: grid; place-items: center; }
.ob-co { display: grid; gap: 8px; }
.ob-co button { min-height: 48px; border-radius: 999px; background: var(--fill); font-weight: 750; font-size: 15px; color: var(--ink); transition: background .25s, color .25s, opacity .25s, transform .25s var(--spring); }
.ob-co button:active { transform: scale(.97); }
.ob-co button.ok { background: var(--ok); color: #fff; } .ob-co button.bad { background: var(--bad); color: #fff; } .ob-co button.dim { opacity: .45; }
.ob-hint { justify-self: center; font-size: 13.5px; font-weight: 750; color: var(--acc-ink); padding: 4px 14px; border-radius: 999px; background: var(--t-acc); }
.ob-hx { margin: 0; text-align: center; font-size: 13.5px; color: var(--ink2); animation: obIn .3s both; }
/* the duel */
.ob-duel { width: min(84vw, 320px); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; }
.ob-duel .side { display: grid; justify-items: center; gap: 12px; }
.ob-duel .av { width: 66px; height: 66px; border-radius: 999px; display: grid; place-items: center; font-weight: 850; font-size: 15px; }
.ob-duel .me .av { background: var(--t-acc); color: var(--acc-ink); } .ob-duel .op .av { background: var(--t-orange); color: var(--orange); }
.ob-duel .dots { display: flex; gap: 5px; } .ob-duel .dots i { width: 9px; height: 9px; border-radius: 999px; background: var(--fill2); }
.ob-duel .me .dots i { animation: dotOk .3s forwards; } .ob-duel .op .dots i { animation: dotOp .3s forwards; }
.ob-duel .me .dots i:nth-child(1) { animation-delay: .6s; } .ob-duel .me .dots i:nth-child(2) { animation-delay: 1.2s; } .ob-duel .me .dots i:nth-child(3) { animation-delay: 1.8s; } .ob-duel .me .dots i:nth-child(4) { animation-delay: 2.4s; animation-name: dotBad; } .ob-duel .me .dots i:nth-child(5) { animation-delay: 3s; } .ob-duel .me .dots i:nth-child(6) { animation-delay: 3.6s; }
.ob-duel .op .dots i:nth-child(1) { animation-delay: .8s; } .ob-duel .op .dots i:nth-child(2) { animation-delay: 1.4s; animation-name: dotBad; } .ob-duel .op .dots i:nth-child(3) { animation-delay: 2s; } .ob-duel .op .dots i:nth-child(4) { animation-delay: 2.6s; } .ob-duel .op .dots i:nth-child(5) { animation-delay: 3.2s; animation-name: dotBad; } .ob-duel .op .dots i:nth-child(6) { animation-delay: 3.8s; }
@keyframes dotOk { to { background: var(--ok); transform: scale(1.15); } } @keyframes dotBad { to { background: var(--bad); } } @keyframes dotOp { to { background: var(--orange); } }
.ob-duel .vs { font: 900 18px "Num", sans-serif; color: var(--ink3); }
.ob-duel .clock { grid-column: 1 / -1; height: 6px; border-radius: 999px; background: var(--fill); overflow: hidden; margin-top: 14px; }
.ob-duel .clock i { display: block; height: 100%; width: 100%; background: var(--acc); transform-origin: right; animation: clock 4.4s linear infinite; }
@keyframes clock { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@media (prefers-reduced-motion: reduce) { .ob-track, .ob-duel .clock i, .ob-gem .rays path { animation: none !important; } }
/* ---------- v169: «گنجینه» ---------- */
.gj-ic { width: 44px; height: 44px; flex: none; }
.gj-ic .g1 { fill: var(--t-yellow); stroke: var(--yellow); stroke-width: 2.4; stroke-linejoin: round; } .gj-ic .g2 { fill: none; stroke: var(--yellow); stroke-width: 1.6; stroke-linejoin: round; }
.gj-hero { text-align: center; padding: 6px 4px 14px; }
.gj-hero .gj-ic { width: 72px; height: 72px; animation: gemPop .7s var(--spring) both; }
.gj-eye { margin: 6px 0 0; font-size: 13px; font-weight: 800; color: var(--mreza-ink); }
.gj-hero h2 { margin: 2px 0 8px; font: 900 34px "Num", "Estedad", sans-serif; letter-spacing: -.4px; }
.gj-hero p:last-child { margin: 0 auto; max-width: 26em; font-size: 14.5px; line-height: 1.9; color: var(--ink2); }
.gj-why { margin: 0 0 12px; padding: 12px 16px; border-radius: 20px; background: var(--t-yellow); color: var(--ink); font-size: 14px; line-height: 1.85; text-align: center; }
.gj-on { margin: 0 0 12px; padding: 14px 16px; border-radius: 20px; background: var(--t-acc); text-align: center; display: grid; gap: 2px; }
.gj-on b { color: var(--acc-ink); font-size: 15.5px; } .gj-on span { font-size: 13.5px; color: var(--ink2); }
.gj-cmp { background: var(--card); border-radius: 22px; padding: 4px 0; margin-bottom: 14px; }
.gj-r { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 8px; align-items: center; padding: 11px 16px; font-size: 14px; }
.gj-r + .gj-r { border-top: .5px solid var(--sep); }
.gj-r span:nth-child(2), .gj-r span:nth-child(3) { text-align: center; color: var(--ink2); font-size: 13px; }
.gj-r .pro { color: var(--mreza-ink) !important; font-weight: 800; }
.gj-r.h span { font-size: 12.5px !important; font-weight: 800; color: var(--ink3); }
.gj-plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.gj-p { position: relative; padding: 18px 8px 14px; border-radius: 22px; background: var(--card); text-align: center; display: grid; gap: 4px; }
.gj-p.best { box-shadow: 0 0 0 2px var(--yellow); }
.gj-p i { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-style: normal; font-size: 11px; font-weight: 800; padding: 2px 10px; border-radius: 999px; background: var(--yellow); color: #fff; }
.gj-p b { font-size: 15px; } .gj-p span { font-size: 12px; color: var(--ink3); } .gj-p em { font-style: normal; font-size: 12.5px; font-weight: 750; color: var(--mreza-ink); margin-top: 4px; }
.gj-code { display: grid; gap: 10px; margin-bottom: 10px; }
.gj-code .field { text-align: center; letter-spacing: .18em; font-weight: 800; font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.gj-st { min-height: 20px; text-align: center; font-size: 13px; color: var(--bad); } .gj-st.ok { color: var(--ink3); }
.btn.soft.gj-tg { text-decoration: none; }
.gj-note { text-align: center; margin: 12px 8px 4px; line-height: 1.85; }
.gj-days { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.gj-days .chip { font-size: 14px; padding: 8px 16px; } .gj-days .chip.on { background: var(--acc); color: #fff; }
.cd-c { font-family: ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: 1px; }
.gj-lock { grid-column: 1 / -1; grid-row: 2; align-self: center; min-height: 300px; border-radius: 28px; background: var(--card); box-shadow: 0 12px 40px rgba(0,0,0,.08); display: grid; place-content: center; justify-items: center; gap: 10px; text-align: center; padding: 24px; }
.gj-lock .gj-ic { width: 64px; height: 64px; }
.gj-lock b { font: 850 19px "Num", "Estedad", sans-serif; } .gj-lock span { max-width: 22em; font-size: 14.5px; line-height: 1.9; color: var(--ink2); }
.gj-lock .btn { width: auto; min-width: 170px; margin-top: 8px; }
/* profile */
.me-head { justify-content: flex-start; align-items: center; gap: 14px; }
.me-av { width: 60px; height: 60px; flex: none; border-radius: 999px; display: grid; place-items: center; background: var(--t-acc); color: var(--acc-ink); font: 850 26px "Estedad", sans-serif; }
.me-head h1 { font-size: 28px; } .me-head .eyebrow { margin-top: 2px; text-align: right; }
.gj-card { width: 100%; display: flex; align-items: center; gap: 12px; padding: 14px 16px; margin: 8px 0 12px; border-radius: 22px; background: var(--card); text-align: start; box-shadow: var(--card-shadow); transition: transform .25s var(--spring); }
.gj-card:active { transform: scale(.98); }
.gj-card > span { flex: 1; display: grid; gap: 2px; } .gj-card b { font-size: 16px; } .gj-card small { font-size: 13px; color: var(--ink3); }
.gj-card.on { background: linear-gradient(var(--t-yellow), var(--t-yellow)); } .gj-card.on b { color: var(--mreza-ink); }
a.li { color: inherit; text-decoration: none; }

/* v170 first open: the scroll story runs in its own page (public/intro.html) inside this frame */
/* v172: the story fades in over a plain background */
.intro-bg { position: fixed; inset: 0; background: #f2f2f7; }
.intro-frame.wait { opacity: 0; pointer-events: none; transform: translateY(24px); }
.intro-frame { transition: opacity .5s ease, transform .6s cubic-bezier(.16,1,.3,1); }
/* one setup page: field · level · which exam — an inset grouped list, a tick on the chosen row */
.obset { justify-content: flex-start; overflow-y: auto; padding: calc(28px + env(safe-area-inset-top)) 18px calc(24px + env(safe-area-inset-bottom)); }
.os-in { width: 100%; max-width: 440px; margin: 0 auto; display: flex; flex-direction: column; }
.os-logo { width: 56px; height: 56px; border-radius: 17px; background: linear-gradient(135deg, #2fc28f, #127a58); color: #fff; display: grid; place-items: center; font: 900 38px/1 "Vazirmatn", sans-serif; margin: 6px auto 12px; box-shadow: 0 10px 24px rgba(23,153,111,.28); }
.os-in h2 { text-align: center; font: 800 22px/1.6 "Estedad", "Vazirmatn", sans-serif; margin: 0; }
.os-sub { text-align: center; color: var(--ink2); font-size: 14px; margin: 4px 0 6px; }
.os-h { font-size: 13px; font-weight: 650; color: var(--ink3); margin: 16px 16px 6px; }
.os-g { background: var(--card); border-radius: 18px; overflow: hidden; box-shadow: var(--card-shadow); }
.os-r { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 52px; padding: 10px 16px; background: none; border: 0; color: var(--ink); font: inherit; text-align: start; position: relative; transition: background .2s; }
.os-r + .os-r::before { content: ""; position: absolute; top: 0; right: 16px; left: 0; height: .5px; background: color-mix(in srgb, var(--ink) 14%, transparent); }
.os-r:active { background: var(--fill); }
.os-r b { display: block; font-size: 16px; font-weight: 650; }
.os-r small { display: block; font-size: 12.5px; color: var(--ink3); margin-top: 1px; }
.os-ck { width: 22px; height: 22px; color: var(--acc); opacity: 0; transform: scale(.6); transition: opacity .2s, transform .3s var(--spring); }
.os-ck svg { width: 100%; height: 100%; }
.os-r.sel .os-ck { opacity: 1; transform: none; }
.os-r.off b { color: var(--ink3); font-weight: 500; }
.os-r.off em { font-style: normal; font-size: 11.5px; color: var(--ink3); background: var(--fill); border-radius: 999px; padding: 3px 9px; }
.os-r.shake { animation: obShake .4s ease; }
.os-msg { min-height: 22px; text-align: center; font-size: 13px; color: var(--ink2); margin: 12px 8px 0; line-height: 1.8; }
.os-go { margin-top: 8px; }
/* sign-in: help when the code doesn't arrive */
.lg-hbox { text-align: start; font-size: 13px; line-height: 1.9; color: var(--ink2); background: var(--fill); border-radius: 16px; padding: 10px 14px; }
.lg-hbox p { margin: 0; }
.lg-hbox a { color: var(--acc); font-weight: 700; }
/* the tour: lighter veil (the tab underneath stays readable) and an arrow over the tab's button */
.tour { background: rgba(0,0,0,.22); }
.tour-arw { position: fixed; z-index: 62; width: 28px; height: 28px; color: var(--acc); transition: left .45s cubic-bezier(.16,1,.3,1), top .3s; animation: tourBob 1s ease-in-out infinite; pointer-events: none; }
.tour-arw svg { width: 100%; height: 100%; filter: drop-shadow(0 2px 6px rgba(0,0,0,.25)); }
@keyframes tourBob { 50% { transform: translateY(6px); } }
.intro-pv .intro-frame { z-index: 71; }
.intro-frame { position: fixed; left: 0; right: 0; top: env(safe-area-inset-top, 0px); bottom: env(safe-area-inset-bottom, 0px); width: 100%; height: calc(100% - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)); border: 0; background: #f2f2f7; z-index: 40; }
.ob-preview .intro-frame { z-index: 71; }
.ob-preview .ob-close { z-index: 72; }

.lg-free { margin: 6px 0 0; font-size: 12.5px; line-height: 1.9; color: var(--ink2); background: var(--card); border-radius: 14px; padding: 9px 12px; box-shadow: var(--card-shadow); text-align: start; }
.lg-free b { color: var(--acc-ink); }

/* v175: formulas drawn as math (mathHtml): stacked fractions and subscripts in any formula piece, not only plan pages */
.fx .fr { display: inline-flex; flex-direction: column; vertical-align: middle; text-align: center; margin: 0 .18em; line-height: 1.45; font-size: .94em; }
.fx .fr > span { display: block; padding: 0 .3em; white-space: nowrap; }
.fx .fr > span:first-child { border-bottom: 1.4px solid currentColor; }
.fx sub { font-size: .68em; vertical-align: -.35em; line-height: 0; }
.fx.w:has(.fr) { line-height: 2.4; }

/* v175: a highlighted booklet line that has exam questions behind it — tap to see them */
mark.mq { cursor: pointer; text-decoration: underline dotted color-mix(in srgb, currentColor 45%, transparent); text-underline-offset: 4px; text-decoration-thickness: 1.5px; }
mark.mq:active { filter: brightness(.94); }
.fx .rad:has(.fr) { align-items: center; }
.fx .rad:has(.fr) .rs { font-size: 2.1em; line-height: 1; transform: translateY(-.04em); }
.fx .rad:has(.fr) .ri { padding-top: .12em; }
