/* App shell, home/setup, results, analytics and history. */
:root {
  --ink: #1e1e1e;
  --ink-2: #4b4b4b;
  --ink-3: #6f6f6f;
  --line: #d9dce3;
  --line-2: #e9ebf0;
  --bg: #f5f6f9;
  --surface: #ffffff;
  --blue: #324dc7;
  --blue-dark: #2a3fa3;
  --blue-tint: #eef1fc;
  --ok: #0ca30c;
  --ok-ink: #0a7a0a;
  --bad: #d03b3b;
  --bad-ink: #b42828;
  --omit: #a3a29c;
  --time: #2a78d6;
  --easy: #6c8fe0;
  --med: #3d5fd4;
  --hard: #1d2f8a;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --sans: 'Noto Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  --serif: 'Noto Serif', Georgia, 'Times New Roman', serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
body.in-test { background: #fff; overflow: hidden; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; }
a { color: var(--blue); }
h1, h2, h3 { margin: 0; line-height: 1.25; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.nowrap { white-space: nowrap; }

/* ---------- Header ---------- */
.app-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 24px;
  height: 60px; padding: 0 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 17px; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 7px; background: var(--blue);
  background-image: radial-gradient(circle at 70% 30%, rgba(255,255,255,.35) 0 4px, transparent 5px);
  position: relative;
}
.brand-mark::after {
  content: ''; position: absolute; left: 7px; right: 7px; bottom: 7px; height: 3px; background: #fff; border-radius: 2px;
}
.app-nav { display: flex; gap: 4px; flex: 1; }
.app-nav a {
  padding: 8px 14px; border-radius: 8px; text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: 14px;
}
.app-nav a:hover { background: var(--bg); color: var(--ink); }
.app-nav a.active { color: var(--blue); background: var(--blue-tint); }
.profile-btn {
  display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface);
  border-radius: 999px; padding: 4px 12px 4px 4px; cursor: pointer; font-size: 14px; font-weight: 500;
}
.profile-btn:hover { border-color: var(--ink-3); }
.avatar {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ink); color: #fff; font-size: 13px; font-weight: 700;
}

/* ---------- Page ---------- */
.page { max-width: 1200px; margin: 0 auto; padding: 28px 24px 64px; }
.page-head { margin-bottom: 20px; }
.page-head h1 { font-size: 28px; font-weight: 700; letter-spacing: -.01em; }
.lede { color: var(--ink-2); margin: 6px 0 0; max-width: 70ch; }
.eyebrow { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow);
}
.card h2 { font-size: 17px; font-weight: 700; margin-bottom: 12px; }
.card + .card, section.card { margin-bottom: 16px; }
.mt { margin-top: 24px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 999px; padding: 9px 20px; font-weight: 600; font-size: 14px;
  border: 1.5px solid transparent; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .12s, border-color .12s, color .12s;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--blue-dark); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--ink); }
.btn-secondary:hover { background: var(--bg); }
.btn-danger { background: var(--bad); color: #fff; }
.btn-danger-outline { background: var(--surface); color: var(--bad-ink); border-color: var(--bad); }
.btn-link { background: none; border: none; color: var(--blue); padding: 6px 4px; text-decoration: underline; text-underline-offset: 2px; }
.btn-block { width: 100%; }
.btn-lg { padding: 13px 22px; font-size: 16px; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn:focus-visible, .seg-btn:focus-visible, .chip:focus-visible { outline: 3px solid #8aa0f0; outline-offset: 2px; }

/* ---------- Segmented controls & chips ---------- */
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg-btn {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center;
  min-height: 44px; padding: 8px 16px; border-radius: 10px; cursor: pointer; text-align: left;
  background: var(--surface); border: 1.5px solid var(--line);
}
.seg-btn:hover { border-color: var(--ink-3); }
.seg-btn.on { border-color: var(--blue); background: var(--blue-tint); box-shadow: inset 0 0 0 1px var(--blue); }
.seg-label { font-weight: 600; font-size: 14px; }
.seg-btn.on .seg-label { color: var(--blue); }
.seg-sub { font-size: 12px; color: var(--ink-3); }
.seg-sm .seg-btn { min-height: 34px; padding: 5px 12px; border-radius: 8px; }
.seg-sm .seg-label { font-size: 13px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px 8px 10px;
  border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer;
  font-weight: 600; font-size: 14px;
}
.chip:hover { border-color: var(--ink-3); }
.chip.on { border-color: var(--blue); background: var(--blue-tint); }
.chip-box {
  width: 18px; height: 18px; border-radius: 4px; border: 1.5px solid var(--ink-3);
  display: grid; place-items: center; color: #fff;
}
.chip.on .chip-box { background: var(--blue); border-color: var(--blue); }
.chip-box svg { width: 13px; height: 13px; }
.chip-count { font-weight: 500; font-size: 12px; color: var(--ink-3); background: var(--bg); padding: 1px 7px; border-radius: 999px; }

.diff-bars { display: inline-flex; gap: 2px; align-items: flex-end; margin-right: 6px; vertical-align: -1px; }
.diff-bars i { width: 4px; border-radius: 1px; background: #c9cdd8; }
.diff-bars i:nth-child(1) { height: 6px; }
.diff-bars i:nth-child(2) { height: 9px; }
.diff-bars i:nth-child(3) { height: 12px; }
.diff-bars i.on { background: var(--ink); }

/* ---------- Home ---------- */
.home-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.filters .card { margin-bottom: 16px; }
.step h2 { display: flex; align-items: center; gap: 10px; }
.step-n {
  width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: #fff;
  font-size: 12px; display: grid; place-items: center; flex: none;
}
.step p.muted { margin: -4px 0 12px; }
.summary { position: sticky; top: 76px; }
.summary-card { text-align: left; }
.big-num { font-size: 48px; font-weight: 700; line-height: 1.1; margin-top: 8px; letter-spacing: -.02em; }
.dist { display: flex; gap: 2px; height: 10px; border-radius: 5px; overflow: hidden; margin: 16px 0 8px; background: var(--line-2); }
.dist-seg { height: 100%; }
.dist-E { background: var(--easy); }
.dist-M { background: var(--med); }
.dist-H { background: var(--hard); }
.dist-legend { display: flex; gap: 12px; font-size: 12px; color: var(--ink-2); margin-bottom: 18px; flex-wrap: wrap; }
.dist-legend .dot { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; }
.summary-meta { margin-top: 10px; text-align: center; }
.small-card { padding: 14px 20px; }
.small-card p { margin: 4px 0 0; }

.tree { display: flex; flex-direction: column; gap: 6px; }
.tree-all { font-weight: 600; font-size: 14px; display: flex; gap: 10px; align-items: center; padding: 6px 4px 10px; border-bottom: 1px solid var(--line-2); margin-bottom: 4px; cursor: pointer; }
.tree-domain { border: 1px solid var(--line-2); border-radius: 10px; padding: 6px 10px; }
.tree-row { display: flex; align-items: center; gap: 10px; padding: 5px 4px; cursor: pointer; border-radius: 6px; font-size: 14px; }
.tree-row:hover { background: var(--bg); }
.tree-row-domain { font-weight: 700; }
.tree-skills { padding-left: 26px; }
.tree-name { flex: 1; }
.tree-count { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.tree input[type=checkbox], .tree-all input { width: 17px; height: 17px; accent-color: var(--blue); margin: 0; flex: none; }

details.adv { margin-top: 14px; }
details.adv summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--ink-2); }
details.adv p { margin: 8px 0; }

.opt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 24px; }
.opt-label { font-size: 13px; font-weight: 700; color: var(--ink-2); margin-bottom: 8px; }

.resume { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; border-left: 4px solid var(--blue); }
.resume-title { font-weight: 700; font-size: 17px; margin: 2px 0; }
.resume-actions { display: flex; gap: 8px; }

.browse-card { margin-top: 4px; }
.browse-head { display: flex; justify-content: space-between; align-items: center; }
.browse-head h2 { margin: 0; }
.browse { margin-top: 12px; }
tr[data-pick] { cursor: pointer; }
tr.picked td { background: var(--blue-tint); }

.loading { display: flex; align-items: center; gap: 10px; color: var(--ink-2); padding: 18px 0; }
.spinner {
  width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid #cfd5ea; border-top-color: var(--blue);
  animation: spin .8s linear infinite; display: inline-block; flex: none;
}
@keyframes spin { to { transform: rotate(360deg); } }
.alert { background: #fff4f2; border: 1px solid #f1c3bb; color: #7a1f12; padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; font-size: 14px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line-2); border-radius: 10px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; background: #f8f9fb; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover td { background: #fafbfd; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .cbx { width: 36px; }
.tbl .cbx input { accent-color: var(--blue); width: 16px; height: 16px; }
.tbl th.sortable { cursor: pointer; user-select: none; }
.tbl th.sortable.on { color: var(--blue); }
.tbl td.slow { color: var(--bad-ink); font-weight: 600; }
.tbl .btn-link { padding: 0; }

.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--bg); color: var(--ink-2); border: 1px solid var(--line); }
.tag-active { background: #e9f6ee; color: #146c2e; border-color: #bfe3cb; }
.diff { white-space: nowrap; }

.res { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-size: 13px; white-space: nowrap; }
.res svg { width: 14px; height: 14px; }
.res-ok { color: var(--ok-ink); }
.res-bad { color: var(--bad-ink); }
.res-omit { color: var(--ink-3); }
.flag-mini { color: #c13145; display: inline-flex; vertical-align: -2px; }
.flag-mini svg { width: 13px; height: 13px; }

/* ---------- Stats / results ---------- */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.stat { padding: 18px 20px; }
.stat-row > .card { margin: 0; }
.stat-label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.stat-value { font-size: 32px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat-value .of { font-size: 20px; color: var(--ink-3); font-weight: 600; }
.stat-sub { font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.stat.hero { border-top: 4px solid var(--blue); }
.actions-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 4px 0 18px; }

.dom-bars { display: flex; flex-direction: column; gap: 10px; }
.dom-bar { display: grid; grid-template-columns: 260px 1fr 60px; gap: 14px; align-items: center; font-size: 14px; }
.dom-bar-val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.meter { display: flex; gap: 2px; height: 12px; border-radius: 4px; overflow: hidden; background: var(--line-2); }
.meter-ok { background: var(--ok); }
.meter-bad { background: var(--bad); }

.empty { text-align: center; padding: 48px 24px; }
.empty p { color: var(--ink-2); margin: 8px 0 20px; }

/* ---------- Analytics charts ---------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.an-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.an-grid > .card { margin: 0; }
.an-wide { grid-column: 1 / -1; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
.chart-legend { display: flex; gap: 14px; font-size: 13px; color: var(--ink-2); flex-wrap: wrap; }
.chart-legend span { display: inline-flex; align-items: center; gap: 4px; }
.chart-legend svg { width: 12px; height: 12px; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.sw-ok { background: var(--ok); }
.sw-bad { background: var(--bad); }
.sw-omit { background: var(--omit); }
.sw-time { background: var(--time); }
.sw-pace { width: 0; height: 14px; border-left: 2px dashed var(--ink); border-radius: 0; }

.sk-head, .sk-row, .tm-row { display: grid; grid-template-columns: minmax(180px, 2.1fr) minmax(120px, 3fr) 130px 70px; gap: 14px; align-items: center; }
.sk-head { font-size: 12px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; padding-bottom: 6px; }
.sk-head span:nth-child(3), .sk-head span:nth-child(4) { text-align: right; }
.sk-row, .tm-row { padding: 5px 0; font-size: 14px; }
.sk-domain { font-weight: 700; border-top: 1px solid var(--line-2); padding-top: 10px; margin-top: 4px; }
.sk-skill { padding-left: 14px; color: var(--ink-2); font-size: 13.5px; }
.sk-val, .sk-time { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ink); }
.sk-time { color: var(--ink-2); }
.sk-section + .sk-section { margin-top: 18px; }
.sk-section-title { font-weight: 700; font-size: 15px; margin: 6px 0 4px; }
.sbar { display: flex; gap: 2px; height: 14px; cursor: default; }
.sbar.sbar-empty { background: var(--line-2); border-radius: 4px; height: 6px; }
.sbar span:first-child { border-radius: 4px 0 0 4px; }
.sbar span:last-child { border-radius: 0 4px 4px 0; }
.sbar span:only-child { border-radius: 4px; }
.sb-ok { background: var(--ok); }
.sb-bad { background: var(--bad); }
.sb-omit { background: var(--omit); }
.sbar:hover span { filter: brightness(.92); }

.tm-row { grid-template-columns: minmax(180px, 2.1fr) minmax(120px, 3fr) 70px; }
.tm-track { position: relative; height: 22px; display: flex; align-items: center; }
.tm-bar { height: 12px; background: var(--time); border-radius: 0 4px 4px 0; min-width: 3px; }
.tm-bar.over { background: #1b5bb0; }
.tm-pace { position: absolute; top: 0; bottom: 0; border-left: 2px dashed var(--ink); }

.act { display: grid; grid-template-columns: 28px 1fr; gap: 6px; height: 200px; }
.act-axis { display: flex; flex-direction: column; justify-content: space-between; font-size: 11px; color: var(--ink-3); text-align: right; padding-bottom: 20px; }
.act-plot { position: relative; display: flex; gap: 2px; align-items: stretch; }
.act-grid { position: absolute; inset: 0 0 20px 0; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.act-grid i { border-top: 1px solid var(--line-2); }
.act-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; position: relative; min-width: 0; }
.act-col:hover { background: rgba(50, 77, 199, .05); }
.act-stack { display: flex; flex-direction: column; gap: 2px; margin-bottom: 20px; }
.act-stack span:first-child { border-radius: 4px 4px 0 0; }
.act-x { position: absolute; bottom: 0; left: 0; font-size: 11px; color: var(--ink-3); white-space: nowrap; }

.focus-list { display: flex; flex-direction: column; gap: 8px; }
.focus-item { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 10px; }
.focus-name { font-weight: 600; font-size: 14px; }
.focus-acc { font-weight: 700; font-size: 18px; font-variant-numeric: tabular-nums; }

.chart-tip {
  position: fixed; z-index: 100; pointer-events: none; max-width: 300px;
  background: var(--ink); color: #fff; font-size: 12.5px; line-height: 1.4; padding: 7px 10px; border-radius: 6px;
  box-shadow: 0 4px 14px rgba(0,0,0,.2);
}

/* ---------- History ---------- */
.sessions { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.session-chip { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: var(--ink); }
.session-chip:hover { border-color: var(--blue); background: var(--blue-tint); }
.session-score { font-weight: 700; font-size: 18px; min-width: 52px; font-variant-numeric: tabular-nums; }
.session-name { font-weight: 600; font-size: 14px; }
.hist-tools { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.search { flex: 1; min-width: 180px; padding: 7px 12px; border-radius: 8px; border: 1.5px solid var(--line); font: inherit; font-size: 14px; }
.search:focus { outline: none; border-color: var(--blue); }
.hist-actions { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.hist-actions .muted { margin-right: auto; }
.data-card .actions-row { margin-bottom: 0; }

/* ---------- Modal & toast ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 200; background: rgba(15, 20, 35, .45); display: grid; place-items: center; padding: 16px; }
.modal { background: #fff; border-radius: 14px; width: min(480px, 100%); padding: 24px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.modal h2 { font-size: 20px; margin-bottom: 10px; }
.modal-body { color: var(--ink-2); }
.modal-body p { margin: 0 0 10px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.field { display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.field input { padding: 10px 12px; border-radius: 8px; border: 1.5px solid var(--line); font: inherit; }
.field input:focus { outline: none; border-color: var(--blue); }
.kbd-table td { padding: 6px 12px 6px 0; }
kbd { display: inline-block; min-width: 22px; text-align: center; padding: 1px 6px; border: 1px solid #bbb; border-bottom-width: 2px; border-radius: 4px; font-family: var(--sans); font-size: 12px; background: #fafafa; }

.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translate(-50%, 10px); z-index: 300;
  background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 14px;
  opacity: 0; transition: opacity .2s, transform .2s; max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .home-grid { grid-template-columns: 1fr; }
  .summary { position: static; order: -1; }
  .stat-row { grid-template-columns: 1fr 1fr; }
  .an-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .app-header { padding: 0 16px; gap: 10px; }
  .brand-text { display: none; }
  .profile-btn span:last-child { display: none; }
  .profile-btn { padding: 4px; }
  .page { padding: 20px 16px 48px; }
  .opt-grid { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: 1fr; }
  .sk-head, .sk-row { grid-template-columns: 1fr 90px; }
  .sk-row .sbar { grid-column: 1 / -1; grid-row: 2; }
  .sk-head span:nth-child(2), .sk-head span:nth-child(4), .sk-row .sk-time { display: none; }
  .tm-row { grid-template-columns: 1fr 60px; }
  .tm-row .tm-track { grid-column: 1 / -1; grid-row: 2; }
  .dom-bar { grid-template-columns: 1fr 50px; }
  .dom-bar .meter { grid-column: 1 / -1; grid-row: 2; }
  .resume { flex-direction: column; align-items: stretch; }
}

/* ---------- Custom question count ---------- */
.count-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: stretch; }
.count-custom {
  display: inline-flex; align-items: center; gap: 8px; padding: 4px 6px 4px 14px; min-height: 44px;
  border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); cursor: text;
  font-weight: 600; font-size: 14px;
}
.count-custom:focus-within { border-color: var(--blue); }
.count-custom.on { border-color: var(--blue); background: var(--blue-tint); box-shadow: inset 0 0 0 1px var(--blue); color: var(--blue); }
.count-custom input {
  width: 64px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit; font-size: 14px; color: var(--ink);
  background: #fff;
}
.count-custom input:focus { outline: none; border-color: var(--blue); }

/* ---------- Sessions ---------- */
.stat-row-3 { grid-template-columns: repeat(3, 1fr); }
.tag-open { background: #fff5d6; color: #7a5300; border-color: #f0d68a; }
.tag-done { background: #e9f6ee; color: #146c2e; border-color: #bfe3cb; }
.sess-tbl td { vertical-align: middle; }
.sess-name { font-weight: 600; }
.sess-score { font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; }
.sess-prog { display: flex; flex-direction: column; gap: 4px; min-width: 120px; }
.sess-prog-bar { height: 6px; border-radius: 3px; background: var(--line-2); overflow: hidden; }
.sess-prog-bar span { display: block; height: 100%; background: var(--blue); border-radius: 3px; }
.sess-actions { white-space: nowrap; text-align: right; }
.sess-actions .btn-link { margin-left: 8px; }
.empty-inline { padding: 24px 4px 8px; }
.history-note { margin: -8px 0 14px; }

/* ---------- Daily SAT ---------- */
.daily-hero { padding: 28px; margin-bottom: 16px; }
.daily-hero h1 { font-size: 28px; margin-top: 4px; }
.daily-slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 22px 0; }
.daily-slot {
  position: relative; border: 1.5px dashed #9aa3b8; border-radius: 12px; padding: 16px 18px; background: #fbfcfe;
}
.daily-slot.slot-answered { border-style: solid; border-color: var(--blue); background: var(--blue-tint); }
.daily-slot.slot-correct { border-style: solid; border-color: var(--ok); background: #f0faf0; }
.daily-slot.slot-incorrect { border-style: solid; border-color: var(--bad); background: #fdf3f3; }
.daily-slot.slot-omitted, .daily-slot.slot-ungraded { border-style: solid; border-color: var(--omit); }
.slot-n {
  width: 30px; height: 30px; display: grid; place-items: center; background: var(--ink); color: #fff;
  font-weight: 700; border-radius: 4px; margin-bottom: 10px;
}
.slot-res { position: absolute; top: 14px; right: 14px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.slot-res.ok { background: var(--ok); }
.slot-res.bad { background: var(--bad); }
.slot-res.omit { background: var(--omit); }
.slot-sec { font-weight: 700; font-size: 16px; }
.slot-diff { color: var(--ink-2); font-size: 14px; }
.slot-skill { color: var(--ink-3); font-size: 13px; margin-top: 6px; }
.daily-done { display: flex; align-items: center; gap: 20px; margin-bottom: 14px; }
.daily-score { font-size: 56px; font-weight: 700; line-height: 1; letter-spacing: -.02em; }
.daily-score span { font-size: 26px; color: var(--ink-3); }
.daily-squares { font-size: 26px; letter-spacing: 4px; margin-bottom: 4px; }

.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 52px)); gap: 6px; }
.cal-cell {
  aspect-ratio: 1; border-radius: 6px; border: 1px solid transparent; font-size: 12px; font-weight: 600;
  display: grid; place-items: center; cursor: default; padding: 0;
}
.cal-cell[data-day] { cursor: pointer; }
.cal-cell[data-day]:hover { outline: 2px solid var(--ink); outline-offset: 1px; }
.cal-none { background: #fff; border-color: var(--line); color: var(--ink-3); }
/* Sequential green ramp: more correct answers, darker cell. */
.cal-s0 { background: #e3f4e3; color: var(--ink); }
.cal-s1 { background: #a8dca8; color: var(--ink); }
.cal-s2 { background: #4fb54f; color: #fff; }
.cal-s3 { background: #0a7a0a; color: #fff; }
.cal-today { box-shadow: 0 0 0 2px var(--blue); }
.cal-legend { margin-top: 12px; }
.cal-legend .sw { border: 1px solid var(--line); }

@media (max-width: 640px) {
  .stat-row-3 { grid-template-columns: 1fr; }
  .daily-slots { grid-template-columns: 1fr; }
  .daily-hero { padding: 20px 16px; }
  .daily-done { flex-direction: column; align-items: flex-start; gap: 8px; }
  .cal { grid-template-columns: repeat(7, 1fr); }
  .app-nav { overflow-x: auto; scrollbar-width: none; }
  .app-nav a { padding: 8px 8px; font-size: 13px; white-space: nowrap; }
}
