/* ==========================================================================
   Learner hub screens: Today (dashboard), the learning path, the lesson catalogue, vocabulary decks, the practice hub.
   Loaded only by the templates that need it ({% block feature_css %}); split out of app.css, ui.css and
   kashi.css (docs/PERFORMANCE.md §7) in their original order, so the cascade is unchanged.
   ========================================================================== */

/* ---- from app.css ---- */
mark.m { background: color-mix(in srgb, var(--saffron) 38%, var(--card)); color: var(--ink); border-radius: 6px; padding: 1px 4px; }
mark.m sup { font-weight: 800; margin-inline-end: 3px; font-size: 0.7em; }
.issues { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.issue { border: 1px solid var(--hair); border-radius: var(--r-md); padding: 12px 14px; display: grid; gap: 6px; background: var(--paper); }
.issue p { margin: 0; }
.issue-head { display: flex; gap: 10px; align-items: center; }
/* ---- from ui.css ---- */
.hello { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: center; justify-content: space-between; }
.hello h1 { font-size: var(--fs-h1); }
.goal { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; }
.ring { inline-size: 104px; block-size: 104px; position: relative; }
.ring svg { inline-size: 100%; block-size: 100%; transform: rotate(-90deg); }
.ring .track { stroke: var(--paper-2); }
.ring .val { stroke: var(--teal-deco); stroke-linecap: round; transition: stroke-dashoffset 900ms var(--ease-out); }
.ring b { position: absolute; inset: 0; display: grid; place-items: center; font: 700 var(--fs-lg) var(--f-display); }
.next-list { display: grid; gap: 10px; }
.next-item { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--hair);
  border-radius: var(--r-md); text-decoration: none; background: var(--card); }
@media (hover: hover) and (pointer: fine) { .next-item:hover { border-color: var(--indigo); } }
.next-item .t { font-weight: 700; }
.plan-days { display: grid; gap: 8px; }
.plan-day { display: grid; grid-template-columns: 70px 1fr; gap: 10px; padding: 8px 12px; border-radius: var(--r-md); border: 1px solid var(--hair); font-size: var(--fs-sm); }
.plan-day.today { border-color: var(--teal-deco); background: color-mix(in srgb, var(--teal-deco) 7%, var(--card)); }
.plan-day b { font-size: var(--fs-sm); }
.plan-day ul { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.plan-day li a { position: relative; display: inline-flex; align-items: center; min-block-size: 32px; padding: 2px 10px; border-radius: 999px; background: var(--paper-2); text-decoration: none; font-size: var(--fs-xs); }
.plan-day li a::before { content: ""; position: absolute; inset: -6px 0; }
.countdown { font: 800 var(--fs-2xl) var(--f-display); color: var(--indigo); }
/* catalog --------------------------------------------------------------------- */
.unit { display: grid; gap: 10px; margin-block-end: 24px; }
.unit h2 { font-size: var(--fs-md); display: flex; gap: 8px; align-items: center; }
.lcards { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .lcards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .lcards { grid-template-columns: repeat(3, 1fr); } }
.lcardx { display: grid; gap: 6px; padding: 14px; border-radius: var(--r-lg); border: 1px solid var(--hair); background: var(--card); text-decoration: none;
  transition: transform 180ms var(--ease-out), border-color 180ms; }
@media (hover: hover) and (pointer: fine) { .lcardx:hover { transform: translateY(-2px); border-color: var(--indigo); } }
.lcardx h3 { font-size: var(--fs-base); line-height: 1.6; }
.lcardx p { color: var(--ink-2); font-size: var(--fs-sm); }
.lcardx .mini { block-size: 6px; border-radius: 6px; background: var(--paper-2); overflow: hidden; }
.lcardx .mini i { display: block; block-size: 100%; background: var(--ok); }
.lcardx.done { border-color: color-mix(in srgb, var(--ok) 50%, var(--hair)); }
@media (max-width: 559px) { .lcardx { padding: 12px 14px; gap: 4px; } }
/* dashboard «پیشرفت من» (templates/learn/dashboard.html): the numbers, folded under one row; open state remembered */
.dash-more { padding: 0; overflow: hidden; }
.dash-more > summary { display: flex; align-items: center; gap: 12px; min-block-size: 60px; padding: 14px 18px; cursor: pointer; list-style: none;
  -webkit-tap-highlight-color: transparent; }
.dash-more > summary::-webkit-details-marker { display: none; }
.dash-more > summary:focus-visible { outline: 2px solid var(--indigo); outline-offset: -2px; border-radius: inherit; }
.dm-head { display: grid; gap: 2px; flex: 1; min-inline-size: 0; }
.dm-head h2 { margin: 0; }
.dm-head small { font-size: var(--fs-xs); line-height: 1.6; }
.dm-chev { inline-size: 20px; block-size: 20px; flex: none; color: var(--ink-2); transition: transform var(--dur-2) var(--spring); }
.dash-more[open] .dm-chev { transform: rotate(180deg); }
.dm-grid { display: grid; gap: 0; padding: 0 18px 8px; }
.dm-block { padding-block: 16px; border-block-start: 0.5px solid var(--sep); min-inline-size: 0; }
.dm-block h3 { margin: 0 0 12px; font-size: var(--fs-md); }
@media (min-width: 760px) { .dm-grid { grid-template-columns: 1fr 1fr; column-gap: 28px; } }
html[data-motion]:not([data-motion="0"]) .dash-more[open] .dm-grid { animation: dm-in var(--dur-3) var(--ease-std); }
@keyframes dm-in { from { opacity: 0; transform: translateY(-6px); } }
/* dashboard: the learner's study programme (learn/programmes.py) */
.prog-card { display: grid; gap: 8px; }
.prog-card h2 { display: flex; align-items: center; gap: 6px; font-size: var(--fs-lg); margin: 0; }
.prog-cta { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.prog-cta small { display: block; color: var(--ink-2); }
/* ---- from kashi.css ---- */
/* ---- learning path ------------------------------------------------------------------------------------------- */
.path-head { display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: end; justify-content: space-between; margin-block-end: 16px; }
.path-head h1 { font-size: var(--fs-h1); }
.path-head p.muted { max-inline-size: 52ch; }
.path-layout { display: grid; gap: 24px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 980px) { .path-layout { grid-template-columns: 320px minmax(0, 1fr); gap: 40px; } .path-side { position: sticky; inset-block-start: 76px; } }
.path-side { display: grid; gap: 12px; }
.path-side .linkbtn { display: inline-flex; gap: 8px; align-items: center; justify-self: start; }
.now-card { position: relative; overflow: hidden; display: grid; gap: 10px; padding: 16px; border-radius: var(--r-xl); color: var(--ink);
  background: var(--lattice), linear-gradient(160deg, color-mix(in srgb, var(--saffron) 22%, var(--card)), var(--card) 70%);
  border: 1px solid color-mix(in srgb, var(--saffron) 45%, var(--hair)); box-shadow: var(--e2); }
.now-row { display: flex; gap: 12px; align-items: center; }
.now-row h2 { font-size: var(--fs-md); line-height: 1.55; }
.now-unit { font-size: var(--fs-xs); color: var(--ink-2); font-weight: 500; }
.now-card .btn { justify-self: start; }
.track-meter { display: grid; gap: 6px; padding: 12px 14px; border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--hair); font-size: var(--fs-sm); }
.track-meter .bar { block-size: 8px; }
.legend-tiles { list-style: none; margin: 0; padding: 10px 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; font-size: var(--fs-xs);
  color: var(--ink-2); border-radius: var(--r-lg); border: 1px dashed var(--hair); }
.legend-tiles li { display: flex; gap: 8px; align-items: center; }
@media (max-width: 979px) { .path-side .legend-tiles, .path-side .track-meter { display: none; } }
.path-main { display: grid; gap: 24px; min-inline-size: 0; }
.lvl-band { display: grid; gap: 14px; }
.lvl-gate { position: relative; display: flex; gap: 14px; align-items: center; padding: 16px 18px 14px; color: var(--ink); font-size: var(--fs-sm);
  background: var(--surface); border-radius: 120px 120px 18px 18px / 48px 48px 18px 18px; box-shadow: var(--e1); }  /* the gate arch stays; a light surface */
.lvl-gate h2 { font-size: var(--fs-lg); color: var(--ink); }
.lvl-gate p { color: var(--ink-2); }
.lvl-medal { position: relative; display: grid; place-items: center; inline-size: 52px; aspect-ratio: 1; flex: none; }
.lvl-medal svg { position: absolute; inset: 0; fill: var(--tile-sun); stroke: var(--tile-sun); stroke-width: 6; stroke-linejoin: round; }
.lvl-medal b { position: relative; color: var(--on-sun); font-size: var(--fs-sm); font-weight: 800; }
.court { display: grid; gap: 4px; }
.court-head { position: sticky; inset-block-start: 62px; z-index: 6; display: flex; gap: 10px; align-items: center; padding: 8px 14px;
  border-radius: var(--r-lg); background: color-mix(in srgb, var(--card) 94%, transparent); border: 1px solid var(--hair); box-shadow: 0 8px 20px -16px rgb(20 18 43 / 0.5); }
html[data-motion="2"] .court-head, html[data-motion="3"] .court-head { backdrop-filter: blur(10px); }
.court-num { font-size: var(--fs-xs); font-weight: 700; color: var(--teal); }
.court-head h3 { font-size: var(--fs-base); line-height: 1.5; }
.court-pct { position: relative; inline-size: 40px; block-size: 40px; display: grid; place-items: center; flex: none; }
.court-pct svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.court-pct circle { fill: none; stroke-width: 4; }
.court-pct .track { stroke: var(--paper-2); }
.court-pct .val { stroke: var(--tile-done); stroke-linecap: round; }
.court-pct span { font-size: var(--fs-2xs); font-weight: 700; }
/* margin-block-end: the checkpoint's label hangs ~20px below the trail; without room it slid under the next section */
.trail { position: relative; direction: ltr; inline-size: min(100%, 440px); margin-inline: auto; margin-block-end: 30px; container-type: inline-size; }
.trail-line { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; overflow: visible; }
.trail-line path { fill: none; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.tl-base { stroke: var(--hair); stroke-width: 10; stroke-dasharray: 1 16; }
.tl-done { stroke: color-mix(in srgb, var(--tile-done) 55%, transparent); stroke-width: 10; }
.trail-nodes { list-style: none; margin: 0; padding: 0; }
@media (min-width: 980px) { .trail { inline-size: min(100%, 520px); } .tile-btn .khatam { inline-size: 80px; } .pnode-label { font-size: var(--fs-sm); } }
.pnode { position: absolute; inset-inline-start: var(--x); inset-block-start: var(--y); transform: translate(-50%, -50%); display: grid; place-items: center; }
.tile-btn, .medal-btn { display: grid; place-items: center; padding: 0; border: 0; background: none; border-radius: 50%; text-decoration: none; -webkit-tap-highlight-color: transparent; }
.tile-btn:focus-visible, .medal-btn:focus-visible { outline: 3px solid var(--indigo); outline-offset: 4px; }
@media (hover: hover) and (pointer: fine) { .tile-btn:hover .k-face { transform: translateY(-2px); } }
.tile-btn:active .k-face, .tile-btn:active .ic { transform: translateY(7px); }
.pnode-label { position: absolute; inset-block-start: 50%; transform: translateY(-50%); inline-size: max-content; max-inline-size: 150px;
  direction: rtl; font-size: var(--fs-xs); font-weight: 600; line-height: 1.6; color: var(--ink-2); pointer-events: none;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* labels never leave the trail: their width is capped by the room between the tile and the trail edge */
.side-l .pnode-label { right: calc(100% + 10px); text-align: right; max-inline-size: min(150px, calc(var(--xn) * 1cqi - 50px)); }
.side-r .pnode-label { left: calc(100% + 10px); text-align: right; max-inline-size: min(150px, calc((100 - var(--xn)) * 1cqi - 50px)); }
.pnode.checkpoint .pnode-label { inset-block-start: calc(100% + 6px); transform: none; text-align: center; left: 50%; translate: -50% 0; }
.pnode.current .pnode-label, .pnode.checkpoint.done .pnode-label { color: var(--ink); }
.pnode.done .pnode-label { color: var(--ink-2); }
.pnode.current::before { content: ""; position: absolute; inset: -14px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--saffron) 45%, transparent), transparent); }
html[data-motion="2"] .pnode.current::before, html[data-motion="3"] .pnode.current::before { animation: halo 2.4s var(--ease-std) 3; }
.start-chip { position: absolute; inset-block-end: calc(100% + 4px); padding: 2px 12px; border-radius: var(--r-sm); background: var(--ink); color: var(--paper);
  font-weight: 700; font-size: var(--fs-xs); white-space: nowrap; box-shadow: var(--shadow); direction: rtl; left: 50%; translate: -50% 0; }
.start-chip::after { content: ""; position: absolute; inset-block-start: 100%; left: 50%; translate: -50% 0; border: 7px solid transparent; border-block-start-color: var(--ink); }
html[data-motion="2"] .start-chip, html[data-motion="3"] .start-chip { animation: bob 1.8s var(--ease-std) 3; }
/* ---- Today (dashboard) --------------------------------------------------------------------------------------- */
.today-hero { position: relative; overflow: hidden; display: grid; gap: 16px; padding: clamp(16px, 2.2vw, 24px); border-radius: var(--r-xl);
  color: #f5f5f7; background: radial-gradient(120% 90% at 100% 0%, rgb(108 112 240 / 0.55) 0%, transparent 60%),
  radial-gradient(90% 80% at 0% 100%, rgb(34 184 171 / 0.4) 0%, transparent 65%), #111118; box-shadow: var(--e2); }
@media (min-width: 900px) { .today-hero { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: center; } }
.today-hero h1 { font-size: var(--fs-h1); color: #fff; }
.today-hero .th-sub { color: #d9d6ee; font-size: var(--fs-sm); }
.today-hero .th-sub a { color: #fff; }
.today-hero .lvl { background: rgb(255 255 255 / 0.14); color: #fff; }
.th-main { display: grid; gap: 12px; }
.continue-card { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: var(--r-lg); text-decoration: none; color: inherit;
  background: rgb(255 255 255 / 0.09); border: 0; transition: transform 180ms var(--ease-out), background-color 180ms; }
@media (hover: hover) and (pointer: fine) { .continue-card:hover { background: rgb(255 255 255 / 0.13); transform: translateY(-2px); } }
.continue-card .cc-text { display: grid; gap: 2px; flex: 1; min-inline-size: 0; }
.continue-card small { color: #d9d6ee; font-size: var(--fs-xs); }
.continue-card b { font-size: var(--fs-md); line-height: 1.55; }
.mini-trail { display: flex; align-items: center; gap: 4px; text-decoration: none; color: #d9d6ee; font-size: var(--fs-xs); flex-wrap: wrap; }
.mini-trail .khatam { inline-size: 34px; }
.mini-trail .khatam.open { --tf: rgb(255 255 255 / 0.1); --ts: rgb(255 255 255 / 0.22); --tl: rgb(255 255 255 / 0.18); --ti: #d9d6ee; }
.mini-trail .dash-line { inline-size: 12px; block-size: 3px; border-radius: 4px; background: rgb(255 255 255 / 0.22); }
.mini-trail span.lbl { margin-inline-start: 8px; }
.th-goal { display: grid; gap: 12px; justify-items: center; text-align: center; padding: 16px; border-radius: var(--r-lg); background: rgb(255 255 255 / 0.07); }
.th-goal .ring { inline-size: 128px; block-size: 128px; }
.th-goal .ring .track { stroke: rgb(255 255 255 / 0.14); }
.th-goal .ring .val { stroke: var(--tile-sun); }
.th-goal .ring b { color: #fff; font-size: var(--fs-lg); display: grid; place-content: center; line-height: 1.2; }
.th-goal .ring b small { font-size: var(--fs-2xs); font-weight: 500; color: #d9d6ee; }
.th-goal p { color: #d9d6ee; font-size: var(--fs-sm); }
.week-dots { display: flex; gap: 6px; justify-content: center; list-style: none; margin: 0; padding: 0; }
.week-dots li { display: grid; gap: 2px; justify-items: center; font-size: var(--fs-2xs); color: #d9d6ee; }
.week-dots .khatam { inline-size: 24px; block-size: 26px; }
.week-dots li { align-content: start; }
.week-dots .khatam.open { --tf: rgb(255 255 255 / 0.08); --ts: rgb(255 255 255 / 0.2); --tl: rgb(255 255 255 / 0.12); }
.week-dots .today .khatam.open { --ts: var(--tile-sun); }
.th-stats { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.th-stats span { display: inline-flex; gap: 6px; align-items: center; padding: 4px 10px; border-radius: 999px; background: rgb(255 255 255 / 0.08); font-weight: 700; font-size: var(--fs-sm); }
.th-stats .ic { color: var(--tile-sun); }
.quick { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); }
@media (max-width: 560px) { .qtile { padding: 10px 12px; } .qtile b { font-size: var(--fs-lg); } .qtile b.word { font-size: var(--fs-base); } .qtile span { font-size: var(--fs-xs); } }
details.week-plan > summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; min-block-size: 44px; }
details.week-plan > summary::-webkit-details-marker { display: none; }
details.week-plan > summary::after { content: "+"; font-size: 1.25rem; font-weight: 400; color: var(--indigo); }
details.week-plan[open] > summary::after { content: "–"; }
details.week-plan > summary h2 { margin: 0; }
.qtile { position: relative; display: grid; gap: 2px; padding: 12px 14px; border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--hair);
  text-decoration: none; overflow: hidden; transition: transform 180ms var(--ease-out), border-color 180ms; }
@media (hover: hover) and (pointer: fine) { .qtile:hover { transform: translateY(-2px); border-color: var(--indigo); } }
.qtile .ic { inline-size: 20px; block-size: 20px; color: var(--indigo); margin-block-end: 4px; }
.qtile b { font-size: var(--fs-xl); line-height: 1.25; font-variant-numeric: tabular-nums; }
.qtile span { color: var(--ink-2); font-size: var(--fs-sm); }
.qtile b.word { font-size: var(--fs-md); line-height: 1.6; }
.qtile.hot { border-color: color-mix(in srgb, var(--saffron) 60%, var(--hair)); background: linear-gradient(160deg, color-mix(in srgb, var(--saffron) 14%, var(--card)), var(--card)); }
.qtile.hot .ic { color: var(--tile-sun-ledge); }
.todo { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.todo a { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 8px 12px; border-radius: var(--r-md); min-block-size: 48px;
  border: 1px solid var(--hair); background: var(--paper); text-decoration: none; transition: border-color 160ms; }
@media (hover: hover) and (pointer: fine) { .todo a:hover { border-color: var(--indigo); } }
.todo .dot { inline-size: 30px; block-size: 30px; border-radius: var(--r-sm); display: grid; place-items: center; background: color-mix(in srgb, var(--indigo) 12%, var(--card)); color: var(--indigo); }
.todo .dot .ic { inline-size: 17px; block-size: 17px; }
.todo .t { font-weight: 600; font-size: var(--fs-sm); }
.todo .m { color: var(--ink-2); font-size: var(--fs-xs); }
/* ---- catalogue --------------------------------------------------------------------------------------------- */
.lcardx .khatam.xs { inline-size: 28px; }
.lcardx { box-shadow: 0 2px 0 var(--hair); }
.lcardx.done { background: linear-gradient(160deg, color-mix(in srgb, var(--tile-done) 8%, var(--card)), var(--card) 60%); }
.unit h2 { padding-block-end: 6px; border-block-end: 1px dashed var(--hair); }
/* ---- vocabulary decks ------------------------------------------------------------------------------------- */
.deck-jump { margin-block-end: 18px; }
.deck-group { --h: var(--indigo); display: grid; gap: 12px; margin-block-end: 28px; scroll-margin-block-start: 76px; }
.dg-phrasal { --h: #b8336a; }
.dg-academic { --h: #b4640a; }
.dg-topics { --h: #07756d; }
.dg-head { display: flex; gap: 12px; align-items: center; font-size: var(--fs-sm); }
.dg-head h2 { font-size: var(--fs-lg); }
.dg-ic { inline-size: 38px; block-size: 38px; border-radius: var(--r-md); display: grid; place-items: center; flex: none; color: #fff; background: var(--h);
  box-shadow: 0 var(--ledge) 0 color-mix(in srgb, var(--h) 60%, #000); }
.dg-ic .ic { inline-size: 20px; block-size: 20px; }
.deck-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
@media (max-width: 560px) {
  .deck-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .deckc { padding: 12px; gap: 6px; }
  .deckc h3 { font-size: var(--fs-sm); }
  .deckc .en, .deckc .tag.ok { display: none; }
  .deckc .btn { inline-size: 100%; padding-inline: 8px; gap: 4px; font-size: var(--fs-xs); }
}
.deckc { position: relative; display: grid; gap: 6px; align-content: start; padding: 14px; border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--hair);
  box-shadow: 0 3px 0 color-mix(in srgb, var(--h) 18%, var(--hair)), 0 6px 0 -2px color-mix(in srgb, var(--h) 9%, var(--paper)); margin-block-end: 6px; font-size: var(--fs-sm); }
.deckc.on { border-color: color-mix(in srgb, var(--h) 50%, var(--hair)); }
.deckc h3 { font-size: var(--fs-base); line-height: 1.55; }
.deckc h3 a { text-decoration: none; }
.deckc h3 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.deckc form { position: relative; z-index: 1; }
.deck-meter { display: grid; gap: 4px; }
.deck-meter .bar { block-size: 6px; }
.deck-meter .bar > i { background: var(--h); }
.wordcards { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.wcard { display: grid; gap: 6px; align-content: start; padding: 12px 14px; border-radius: var(--r-lg); font-size: var(--fs-sm); background: var(--card); border: 1px solid var(--hair); }
.wcard.known { border-inline-start: 3px solid var(--tile-done); }
.wc-head { display: flex; gap: 8px; align-items: center; }
.wc-en { font-size: var(--fs-lg); }
.wc-fa { font-weight: 600; color: var(--teal); }
.wc-ex { padding: 6px 10px; border-radius: var(--r-sm); background: var(--paper-2); }
.wc-ex .en { display: block; }
.wc-coll { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; direction: ltr; }
.wc-coll li { padding: 1px 8px; border-radius: 999px; border: 1px solid var(--hair); font-size: var(--fs-xs); color: var(--ink-2); }
/* ---- practice hub bento -------------------------------------------------------------------------------------- */
.hub { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 900px) { .hub { grid-template-columns: repeat(12, minmax(0, 1fr)); } }
.htile { --h: var(--indigo); position: relative; overflow: hidden; display: grid; gap: 4px; align-content: start; padding: 14px; border-radius: var(--r-lg); min-block-size: 132px;
  background: var(--card); border: 1px solid var(--hair); text-decoration: none; color: var(--ink); transition: transform 200ms var(--ease-out), border-color 200ms, box-shadow 200ms; }
.htile::after { content: ""; position: absolute; inset-block-start: -36px; inset-inline-end: -36px; inline-size: 120px; block-size: 120px; border-radius: 50%;
  background: var(--lattice), color-mix(in srgb, var(--h) 16%, transparent); pointer-events: none; }
@media (hover: hover) and (pointer: fine) { .htile:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--h) 60%, var(--hair)); box-shadow: var(--e2); } }
.htile .hic { position: relative; z-index: 1; inline-size: 38px; block-size: 38px; border-radius: var(--r-md); display: grid; place-items: center; color: #fff; background: var(--h);
  box-shadow: 0 var(--ledge) 0 color-mix(in srgb, var(--h) 60%, #000); margin-block-end: 6px; }
.htile .hic .ic { inline-size: 20px; block-size: 20px; }
.htile h2 { font-size: var(--fs-md); position: relative; z-index: 1; }
.htile p { color: var(--ink-2); font-size: var(--fs-sm); position: relative; z-index: 1; }
.htile .count { position: relative; z-index: 1; justify-self: start; margin-block-start: auto; padding: 1px 8px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 600;
  background: color-mix(in srgb, var(--h) 14%, var(--card)); color: var(--ink); }
.htile.big { grid-column: span 2; min-block-size: 184px; }
.htile.big h2 { font-size: var(--fs-lg); }
.htile .viz { position: relative; z-index: 1; block-size: 52px; display: flex; align-items: center; gap: 5px; direction: ltr; margin-block: 6px; }
.viz.wavebars i { inline-size: 4px; border-radius: 4px; background: var(--h); opacity: 0.8; }
.viz.lines { display: grid; gap: 8px; align-content: center; inline-size: 70%; }
.viz.lines i { block-size: 7px; border-radius: 4px; background: var(--hair); }
.viz.lines i.hl { background: linear-gradient(to right, color-mix(in srgb, var(--saffron) 70%, transparent) 0 55%, var(--hair) 55%); }
.htile.c-read { --h: var(--sk-reading); }
.htile.c-listen { --h: var(--sk-listening); }
.htile.c-write { --h: var(--sk-writing); }
.htile.c-speak { --h: var(--sk-speaking); }
.htile.c-place { --h: #14122b; }
.htile.c-media { --h: #8e2756; }
.htile.c-pron { --h: var(--sk-pronunciation); }
.htile.c-tech { --h: #0b7a3e; }
.htile.c-chat { --h: #2a78d6; }
.htile.c-review { --h: #c0322b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .htile.c-place { --h: #8f8ab8; } }
:root[data-theme="dark"] .htile.c-place { --h: #8f8ab8; }
@media (min-width: 900px) {
  .htile.big { grid-column: span 6; }
  .htile.mid { grid-column: span 4; }
  .htile.sm { grid-column: span 3; }
}
.pnode.in_progress .pnode-label, .pnode.review_due .pnode-label { color: var(--ink); }
/* floating "back to the current tile" (bottom, end side = left in RTL), above the tab bar on phones */
.to-current { position: fixed; z-index: 50; inset-inline-end: 16px; inset-block-end: calc(16px + var(--safe-b));
  display: inline-flex; gap: 6px; align-items: center; min-block-size: 44px; padding: 8px 14px; border-radius: 999px; text-decoration: none;
  background: var(--ink); color: var(--paper); font-weight: 600; font-size: var(--fs-sm); box-shadow: var(--shadow); }
.to-current[hidden] { display: none; }
.to-current .ic { inline-size: 18px; block-size: 18px; transition: transform 160ms var(--ease-std); }
.to-current.up .ic { transform: rotate(180deg); }
.has-tabbar .to-current { inset-block-end: calc(72px + var(--safe-b)); }
@media (min-width: 900px) { .has-tabbar .to-current { inset-block-end: 24px; } }
html[data-motion="2"] .to-current:not([hidden]), html[data-motion="3"] .to-current:not([hidden]) { animation: sheet-in 220ms var(--ease-out); }
/* ---- Today v2: one primary action, Jalali week goal with freezes, getting-started checklist ---- */
.continue-card .cc-ic { inline-size: 44px; block-size: 44px; flex: none; border-radius: var(--r-md); display: grid; place-items: center;
  background: var(--tile-sun); color: var(--on-sun); box-shadow: 0 var(--ledge) 0 var(--tile-sun-ledge); }
.continue-card .cc-ic .ic { inline-size: 22px; block-size: 22px; }
.continue-card.calm { background: rgb(255 255 255 / 0.05); }
.btn-glass { background: rgb(255 255 255 / 0.12); color: #fff; border: 1px solid rgb(255 255 255 / 0.28); }
@media (hover: hover) and (pointer: fine) { .btn-glass:hover { background: rgb(255 255 255 / 0.2); } }
.mini-trail .lbl .ic { inline-size: 14px; block-size: 14px; vertical-align: -3px; }
.th-goal-top { display: flex; gap: 14px; align-items: center; justify-content: center; inline-size: 100%; }
.th-goal .ring { inline-size: 100px; block-size: 100px; flex: none; }
.th-goal .ring.full .val { stroke: var(--tile-sun); }
.th-goal .ring b svg.ic { transform: none; }
.th-goal .ring b .ic { inline-size: 26px; block-size: 26px; color: var(--tile-sun); margin-inline: auto; stroke-width: 2.25; }
.wk-head { display: grid; gap: 4px; text-align: start; }
.wk-num { font-size: var(--fs-sm); font-weight: 600; color: #d9d6ee; line-height: 1.5; }
.wk-num span { display: block; font-size: var(--fs-xl); font-weight: 800; color: #fff; line-height: 1.2; font-variant-numeric: tabular-nums; }
.week-dots li.future { opacity: 0.55; }
.week-dots .khatam.frozen .ic { inline-size: 52%; margin-block-end: 8%; }
.th-stats .minor { font-weight: 600; background: rgb(255 255 255 / 0.05); color: #d9d6ee; }
.th-stats .minor .ic { color: #d9d6ee; }
.th-stats svg.ic { inline-size: 16px; block-size: 16px; color: var(--ice); }
.wk-goal { inline-size: 100%; text-align: start; border-block-start: 1px solid rgb(255 255 255 / 0.12); padding-block-start: 8px; }
.wk-goal summary { cursor: pointer; min-block-size: 44px; display: flex; align-items: center; color: #fff; font-weight: 600; font-size: var(--fs-sm); }
.wk-goal form { padding-block: 8px 4px; }
.wk-goal p { color: #d9d6ee; }
.chips-pick { display: flex; flex-wrap: wrap; gap: 8px; border: 0; margin: 0; padding: 0; }
.chips-pick label { position: relative; }
.chips-pick input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.chips-pick span { display: grid; place-items: center; inline-size: 44px; block-size: 44px; border-radius: var(--r-md); font-weight: 700;
  border: 1px solid rgb(255 255 255 / 0.35); color: #fff; }
.chips-pick input:checked + span { background: var(--tile-sun); color: var(--on-sun); border-color: var(--tile-sun); }
.chips-pick input:focus-visible + span { outline: 3px solid #fff; outline-offset: 2px; }
.starter { display: grid; gap: 10px; padding: 16px; border-radius: var(--r-lg); background: rgb(255 255 255 / 0.08); }
.starter h2 { font-size: var(--fs-md); color: #fff; }
.starter .small { color: #d9d6ee; }
.starter .bar { flex: none; block-size: 8px; background: rgb(255 255 255 / 0.14); }
.starter .bar > i { background: var(--tile-sun); }
.starter .btn-sun { justify-self: start; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.st-row { display: flex; gap: 10px; align-items: center; min-block-size: 44px; padding: 4px 6px; border-radius: var(--r-sm); text-decoration: none; color: inherit; font-size: var(--fs-sm); }
@media (hover: hover) and (pointer: fine) { a.st-row:hover { background: rgb(127 127 127 / 0.12); } }
.st-row > .ic { margin-inline-start: auto; inline-size: 16px; block-size: 16px; }
.st-dot { inline-size: 22px; block-size: 22px; flex: none; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid currentColor; opacity: 0.8; }
.steps li.is-done .st-dot { background: var(--tile-done); border-color: var(--tile-done); color: var(--on-done, #fff); opacity: 1; }
.steps li.is-done .st-dot .ic { inline-size: 14px; block-size: 14px; stroke-width: 2.5; }
.steps li.is-done .st-row > span:not(.st-dot) { text-decoration: line-through; text-decoration-thickness: 1px; opacity: 0.8; }
.starter-card .st-row { color: var(--ink); }
.todo li.is-done a { background: color-mix(in srgb, var(--tile-done) 7%, var(--card)); }
.todo li.is-done .dot { background: var(--tile-done); color: var(--on-done, #fff); }
.todo li.is-done .t { color: var(--ink-2); text-decoration: line-through; text-decoration-thickness: 1px; }
.todo li.is-done .m { color: var(--teal); font-weight: 700; }
.next-step { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; padding: 12px 14px; border-radius: var(--r-lg); text-decoration: none; font-size: var(--fs-sm);
  color: #f4f1fb; background: var(--lattice-light), linear-gradient(135deg, #14122b, var(--sk-reading) 85%); box-shadow: var(--e2); }
.next-step.listening { background: var(--lattice-light), linear-gradient(135deg, #14122b, var(--sk-listening) 85%); }
.next-step b { color: #fff; font-size: var(--fs-md); }
.next-step .ns-text { display: grid; gap: 2px; flex: 1 1 240px; }
.next-step small { color: #d9d6ee; }
.htile .mine { position: relative; z-index: 1; font-size: var(--fs-xs); font-weight: 600; color: var(--ink); display: flex; gap: 6px; align-items: center; }
.htile .mine .ic { inline-size: 14px; block-size: 14px; color: var(--h); }
.htile .weakest { position: relative; z-index: 1; justify-self: start; padding: 1px 8px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 600;
  background: var(--warning-bg); color: var(--warning-fg); }
/* `.done` is also the lesson-complete screen class in app.css (grid, centred, 24px padding): keep it off tiles and rows */
.pnode.done { padding: 0; gap: 0; }
.mini-trail .lbl { white-space: nowrap; display: inline-flex; gap: 4px; align-items: center; }
.starter-card .steps { max-inline-size: 440px; }
/* the mini trail sits on the dark hero: locked tiles must not glow white */
.mini-trail .khatam.locked { --tf: rgb(255 255 255 / 0.06); --ts: rgb(255 255 255 / 0.16); --tl: rgb(255 255 255 / 0.1); --ti: #b6b2d1; }
.mini-trail { padding: 4px 6px; margin-inline: -6px; border-radius: var(--r-md); transition: background-color 160ms var(--ease-std); }
@media (hover: hover) and (pointer: fine) { .mini-trail:hover { background: rgb(255 255 255 / 0.06); } }
/* week-goal chips: one row of seven on every phone */
.chips-pick { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.chips-pick span { inline-size: 100%; }
/* Today: tidy empty states and the recent-tests list */
.recent-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.recent-list a { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: var(--r-md);
  text-decoration: none; border: 1px solid var(--hair); background: var(--paper); transition: border-color 160ms; }
@media (hover: hover) and (pointer: fine) { .recent-list a:hover { border-color: var(--indigo); } }
.recent-list .ri { inline-size: 30px; block-size: 30px; border-radius: var(--r-sm); display: grid; place-items: center; background: color-mix(in srgb, var(--sk-reading) 12%, var(--card)); color: var(--sk-reading); }
.recent-list .ri.listening { background: color-mix(in srgb, var(--sk-listening) 12%, var(--card)); color: var(--sk-listening); }
.recent-list .ri .ic { inline-size: 16px; block-size: 16px; }
.recent-list .t { font-weight: 600; font-size: var(--fs-sm); line-height: 1.55; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-list .m { font-size: var(--fs-xs); font-weight: 600; white-space: nowrap; }
.weekbars.is-empty i { opacity: 0.35; }
.chart-empty { margin-block-start: -4px; }
.recent-list .t { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.deck-jump { position: sticky; inset-block-start: 62px; z-index: 5; box-shadow: 0 6px 16px -14px rgb(20 18 43 / 0.5); }
/* Today, desktop: the two card stacks flow as balanced columns instead of one short and one very long column */
@media (min-width: 980px) {
  .page > .dash:has(#todo-h) { display: block; columns: 2; column-gap: 12px; }
  .page > .dash:has(#todo-h) > .stack { display: contents; }
  .page > .dash:has(#todo-h) > .stack > * { break-inside: avoid; margin-block-end: 12px; inline-size: 100%; }
}
.deck-jump { mask-image: linear-gradient(to left, #000 calc(100% - 28px), transparent); padding-inline-end: 24px; }
/* sticky bars under the site header: the header is taller inside the app (status bar), so offsets include --safe-t
   (writing.css, speaking.css and tools.css carry the same fix for their own bars) */
.deck-jump { inset-block-start: calc(var(--header-h) + var(--safe-t) + 10px); }
