/* ============================================================
   irikos — TRAINER page.
   Ported from the Claude Design handoff (Trainer.html). Built almost
   entirely on the real platform classes from styles.css (.card,
   .cta-primary, .segmented, .switch, .cat-card, .cat-list,
   .mistakes-card, .qcard, .answer-input …). Only the connective
   tissue (.t-*) lives here. The app shell (.sidenav / .bottom-nav /
   data-shell="main") provides the chrome — the design's device frames
   (.t-desk / .t-phone) are replaced by media queries.
   ============================================================ */

/* ---- section rhythm (HIG: group with space, not boxes) ---- */
.t-shell { max-width: 1080px; margin: 0 auto; padding: 26px 40px 64px; }
.t-block { margin-top: 40px; }
.t-block:first-of-type { margin-top: 14px; }

.t-page-title { font-weight: 700; font-size: clamp(28px, 3vw, 36px); letter-spacing: -0.025em; margin: 0; }
.t-facts { color: var(--ink-3); font-size: 14px; margin: 8px 0 0; }
.t-facts b { color: var(--ink-2); font-weight: 700; }

/* a quiet section heading */
.t-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 16px; }
.t-head h2 { font-weight: 700; font-size: 19px; letter-spacing: -0.015em; margin: 0; }
.t-head .sub { font-size: 13px; color: var(--ink-3); }
.t-head .sub.is-link { margin-left: auto; color: var(--accent-ink); font-weight: 600; }

/* ---- entry card (Mixed practice / Irregular Verbs) ---- */
.t-trainer { width: 100%; text-align: left; display: block; }
.t-trainer-head { display: flex; align-items: center; gap: 14px; }
.t-trainer-head .dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.t-trainer-head .h { min-width: 0; flex: 1; }
.t-trainer-head .h h3 { font-weight: 700; font-size: 20px; letter-spacing: -0.015em; margin: 0; }
.t-trainer-head .h .meta { font-size: 13px; color: var(--ink-3); margin-top: 3px; }
.t-trainer-head .h .meta b { color: var(--ink-2); font-weight: 700; }
.t-trainer .cat-list { margin-top: 18px; border-top: 1px solid var(--rule); padding-top: 6px; }
.t-chev { color: var(--ink-4); flex-shrink: 0; display: inline-flex; }

/* ---- Live: a slim row, not a big block ---- */
.t-liverow {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  padding: 14px 4px; background: none; border: 0; cursor: pointer; color: inherit; font: inherit;
}
.t-liverow .mark {
  width: 42px; height: 42px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-ink);
  display: grid; place-items: center; flex-shrink: 0; position: relative;
}
.t-liverow .mark .ld { position: absolute; top: -1px; right: -1px; width: 9px; height: 9px; border-radius: 50%; background: var(--no); border: 2px solid var(--bg); }
.t-liverow .lt { flex: 1; min-width: 0; }
.t-liverow .lt .a { font-size: 15.5px; font-weight: 700; color: var(--ink); display: block; }
.t-liverow .lt .b { font-size: 13px; color: var(--ink-3); margin-top: 2px; display: block; }
.t-liverow .chev { color: var(--ink-4); flex-shrink: 0; display: inline-flex; }
.t-liverow:hover .lt .a { color: var(--accent-ink); }

/* ---- picker: cat-card carries a switch on the right ---- */
.cat-card .cat-card-head .switch { flex-shrink: 0; }
.cat-card-eg { font-size: 12.5px; color: var(--accent-ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.t-pickgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

/* run-length + start row (desktop) */
.t-launch { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.t-launch .segmented { display: inline-flex; }
.t-launch .sub { color: var(--ink-3); font-size: 13px; }
.segmented.t-block-seg { display: flex; width: 100%; }
.segmented.t-block-seg .segmented-btn { flex: 1; text-align: center; }

/* back link */
.t-back { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--ink-3); background: none; border: 0; cursor: pointer; padding: 0; margin-bottom: 14px; }
.t-back:hover { color: var(--accent-ink); }

/* mobile sticky action bar for the picker */
.t-action {
  position: sticky; bottom: 0; left: 0; right: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  background: color-mix(in oklab, var(--card) 92%, transparent);
  border-top: 1px solid var(--rule); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  margin: 24px -16px 0;
}
.t-action .sum { font-size: 13px; color: var(--ink-3); }

/* ---- mobile overrides (was `.t-phone X` in the design) ---- */
@media (max-width: 760px) {
  .t-shell { padding: 8px 16px calc(84px + env(safe-area-inset-bottom, 0px)); }
  .t-page-title { font-size: 30px; }
  .t-block { margin-top: 30px; }
  .t-pickgrid { grid-template-columns: 1fr; }
}

/* ============================================================
   QUESTION CARD (one verb item in the real .qcard)
   ============================================================ */
.t-prac-top { display: flex; align-items: center; gap: 14px; padding: 6px 2px 18px; }
.t-prac-track { flex: 1; height: 6px; background: var(--bg-2); border-radius: 999px; overflow: hidden; }
.t-prac-track > span { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width 240ms var(--ease, ease); }
.t-prac-count { font-size: 13px; font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }

.t-cue { font-weight: 700; font-size: clamp(28px, 5vw, 34px); letter-spacing: -0.01em; margin: 2px 0 0; color: var(--ink); }
.t-cue .blank { display: inline-block; min-width: 2.4em; border-bottom: 3px solid var(--accent); margin: 0 2px; vertical-align: middle; }
.t-bracket { color: var(--ink-4); font-weight: 600; }
.t-tense { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 4px 11px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); margin: 14px 0 0; }
.t-tense::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

.t-twofields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 18px; }
.t-field { display: flex; flex-direction: column; gap: 8px; }
.t-field-label { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }

/* the empty band under the card: live stats + report over a faint drifting motif */
.t-prac-foot { position: relative; flex: 1 1 auto; min-height: 150px; margin-top: 16px; display: flex; align-items: flex-end; overflow: hidden; border-radius: var(--radius-lg); }
.t-foot-content { position: relative; z-index: 1; width: 100%; display: flex; flex-direction: column; gap: 12px; }
.t-statstrip { display: flex; background: color-mix(in oklab, var(--card) 62%, transparent); border: 1px solid var(--rule); border-radius: var(--radius-lg); overflow: hidden; -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.t-statcell { flex: 1; padding: 11px 6px; display: flex; flex-direction: column; align-items: center; gap: 3px; border-right: 1px solid var(--rule); }
.t-statcell:last-child { border-right: 0; }
.t-stat-v { font-size: 18px; font-weight: 800; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; color: var(--ink); }
.t-statcell.is-accent .t-stat-v { color: var(--accent-ink); }
.t-stat-l { font-size: 10px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink-3); }
.t-report { display: inline-flex; align-items: center; gap: 7px; align-self: center; white-space: nowrap; font-size: 13px; font-weight: 600; color: var(--ink-3); padding: 6px 14px; border-radius: 999px; background: none; border: 0; cursor: pointer; }
.t-report svg { color: var(--ink-4); }
.t-report:hover, .t-report:hover svg { color: var(--no); }

.t-qbg { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.t-qbg::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(78% 96% at 50% 128%, color-mix(in oklab, var(--accent) 18%, transparent) 0%, transparent 62%);
  animation: t-breathe 11s ease-in-out infinite;
}
.t-qshape { position: absolute; display: block; opacity: 0.14; will-change: transform; animation-name: t-drift; animation-timing-function: linear; animation-iteration-count: infinite; }
.t-qshape svg { width: 100%; height: 100%; display: block; }
@keyframes t-drift { from { transform: translate3d(0,0,0) rotate(0deg); } to { transform: translate3d(var(--dx,20px), var(--dy,-30px), 0) rotate(var(--dr,40deg)); } }
@keyframes t-breathe { 0%, 100% { opacity: 0.4; } 50% { opacity: 0.75; } }
:root[data-motion="reduced"] .t-qshape, :root[data-motion="reduced"] .t-qbg::before { animation: none; }
@media (prefers-reduced-motion: reduce) { .t-qshape, .t-qbg::before { animation: none; } }

/* run screen scaffolding */
.t-run { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--bg); font-family: var(--sans); }
/* During a task the desktop side-panel stays put (data-shell="run"); shift the run
   body to start after it so the card isn't stranded in a wide empty viewport. */
@media (min-width: 761px) { .app-root[data-shell="run"] .t-run { left: var(--sidenav-w, 236px); } }
.t-run-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; position: relative; z-index: 1; }
.t-run-shell { max-width: 640px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; padding: max(12px, env(safe-area-inset-top)) 18px 18px; }
/* OGE passages (whole-text cloze) are long — on desktop give them the side space
   so the prose flows wider and scrolls less, instead of a tall narrow column. */
@media (min-width: 761px) { .t-run-shell[data-passage="1"] { max-width: 1000px; } }
.t-run-actions { flex: 0 0 auto; position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px calc(12px + env(safe-area-inset-bottom, 0px)); background: var(--card); border-top: 1px solid var(--rule); }
.t-prac-shell { display: flex; flex-direction: column; min-height: 100%; }

/* 'Report a problem' in the foot: centered, no rule above it (per the design). */
.t-foot-content .report-control { border-top: none; margin-top: 0; padding-top: 0; text-align: center; }
.t-foot-content .report-link { color: var(--ink-3); }
.t-foot-content .report-panel, .t-foot-content .report-actions { text-align: left; }

/* verb-run feedback line under the card */
.vb-feedback { margin-top: 16px; font-size: 15px; font-weight: 600; color: var(--ink-2); }
.vb-feedback[data-ok="1"] { color: var(--ok); }
.vb-feedback b { color: var(--accent-ink); }

/* Home mistake strip (mobile) — between the Begin buttons and the daily stats. */
.mistake-strip { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 12px 14px; margin: 14px 0 0; border-radius: var(--radius-md, 12px); border: 1px solid var(--rule); background: var(--card); font: inherit; }
.mistake-strip.is-alert { cursor: pointer; background: color-mix(in oklab, var(--no) 12%, var(--card)); border-color: color-mix(in oklab, var(--no) 32%, var(--rule)); }
.mistake-strip.is-alert .ms-icon, .mistake-strip.is-alert .ms-text, .mistake-strip.is-alert .ms-arrow { color: var(--no); }
.mistake-strip.is-alert:hover { background: color-mix(in oklab, var(--no) 17%, var(--card)); }
.mistake-strip.is-zero { background: var(--bg-2); }
.mistake-strip.is-zero .ms-icon { color: var(--ok); }
.mistake-strip.is-zero .ms-text { color: var(--ink-3); }
.ms-icon { display: inline-flex; flex-shrink: 0; }
.ms-text { font-size: 14px; font-weight: 600; }
.ms-text b { font-weight: 800; }
.ms-arrow { margin-left: auto; font-size: 16px; font-weight: 700; flex-shrink: 0; }
