/* Trials HQ. The hero is the clock; the four columns are the subjects; the strip is the run-up. */
.page.th { gap: 14px; }

/* ---------- hero ---------- */
.th-hero { padding: 28px 34px 26px; border-radius: var(--r-xl); display: flex; flex-direction: column; gap: 22px; overflow: hidden; view-transition-name: trials-hero; }
.th-hero::after {
  content: ""; position: absolute; z-index: -1; inset: auto -10% -60% -10%; height: 90%; pointer-events: none;
  background: radial-gradient(40% 60% at 15% 50%, rgba(41, 151, 255, .10), transparent 70%),
              radial-gradient(40% 60% at 40% 60%, rgba(255, 159, 10, .08), transparent 70%),
              radial-gradient(40% 60% at 65% 50%, rgba(191, 90, 242, .09), transparent 70%),
              radial-gradient(40% 60% at 90% 60%, rgba(48, 209, 88, .08), transparent 70%);
}
.th-hero-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px 40px; flex-wrap: wrap; }
.th-eyebrow { font-size: 14px; color: var(--muted); margin-bottom: 10px; }
.th-hero h1 { margin: 0; padding-left: 0; font-size: clamp(42px, 5.4vw, 76px); line-height: .95; font-weight: 700; letter-spacing: -0.045em; }
.th-count { text-align: right; }
.th-count-big { display: flex; align-items: baseline; justify-content: flex-end; gap: 12px; font-size: clamp(64px, 8.4vw, 124px); font-weight: 700; letter-spacing: -0.06em; line-height: .9; }
.th-count-big .unit { font-size: 22px; font-weight: 500; letter-spacing: -0.01em; color: var(--muted); }
.th-count-clock { margin-top: 10px; font-size: 20px; color: var(--soft); font-variant-numeric: tabular-nums; }
.th-count-what { margin-top: 4px; font-size: 13.5px; color: var(--dim); }

.th-line { position: relative; }
.th-line .track { position: relative; height: 78px; border-radius: 14px; background: var(--card-2); border: 1px solid var(--line); overflow: hidden; }
.th-line .day { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--line); }
.th-line .day:first-child { border-left: 0; }
.th-line .day.in { background: rgba(255, 255, 255, .025); }
.th-line .day.rev { background: repeating-linear-gradient(135deg, rgba(255, 255, 255, .04) 0 4px, transparent 4px 9px); }
.th-line .day .lbl { position: absolute; left: 8px; bottom: 7px; font: 500 10.5px 'Geist Mono', monospace; color: var(--dim); white-space: nowrap; }
.th-line .pin {
  position: absolute; top: 9px; transform: translateX(-2px); display: flex; flex-direction: column; gap: 2px; padding: 5px 8px 6px;
  border-radius: 9px; background: color-mix(in srgb, var(--c) 22%, var(--card)); border: 1px solid color-mix(in srgb, var(--c) 60%, transparent);
  color: var(--text); font-size: 11px; line-height: 1.1; white-space: nowrap; z-index: 2;
  animation: fx-msg .6s var(--glide) both; animation-delay: calc(var(--i) * 60ms + 300ms);
  transition: transform .3s var(--glide), background-color .2s;
}
.th-line .pin::before { content: ""; position: absolute; left: -1px; top: 6px; bottom: 6px; width: 3px; border-radius: 2px; background: var(--c); }
.th-line .pin b { font-weight: 650; }
.th-line .pin span { color: var(--muted); font-size: 10.5px; }
.th-line .pin:hover { transform: translateX(-2px) translateY(-2px); background: color-mix(in srgb, var(--c) 34%, var(--card)); color: var(--text); }
.th-line .pin.done { opacity: .45; }
.th-line .pin:nth-of-type(even) { top: 40px; }
.th-line .now { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--text); box-shadow: 0 0 12px rgba(var(--sun), .7); }

.th-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.th-facts .fact { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 14px; background: var(--card-2); border: 1px solid var(--border); min-width: 0; }
.th-facts .k { font-size: 12px; color: var(--dim); }
.th-facts .v { font-size: 22px; font-weight: 650; letter-spacing: -0.02em; }
.th-facts .s { font-size: 12px; color: var(--muted); line-height: 1.35; }
.th-facts .warn .v { color: var(--warn); }
.th-facts .ok .v { color: var(--ok); }
.th-facts .bar { height: 5px; border-radius: 3px; background: var(--border); overflow: hidden; display: block; }
.th-facts .bar span { display: block; height: 100%; background: var(--ok); border-radius: 3px; transform-origin: left; animation: grow .9s var(--ease) both; }

/* ---------- subjects ---------- */
.th-subjects { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-items: stretch; }
.th-subj { padding: 20px 20px 18px; display: flex; flex-direction: column; gap: 14px; min-width: 0; overflow: hidden; }
.th-subj::after { content: ""; position: absolute; z-index: -1; inset: -40% -30% auto auto; width: 90%; height: 60%; pointer-events: none; background: radial-gradient(closest-side, color-mix(in srgb, var(--c) 16%, transparent), transparent 70%); }
.th-subj-head { display: flex; align-items: center; gap: 9px; color: var(--text); flex-wrap: wrap; }
.th-subj-head:hover { color: var(--text); }
.th-subj-head:hover h2 { color: var(--c); }
.th-subj-head h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -0.03em; transition: color .2s; }
.th-subj-head .board { font-size: 12px; color: var(--dim); width: 100%; }
.th-papers { display: flex; flex-direction: column; gap: 6px; }
.th-papers .pp { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: baseline; font-size: 13.5px; }
.th-papers .n { font-weight: 600; color: var(--soft); }
.th-papers .when { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.th-papers .in { color: var(--c); font-size: 12.5px; font-weight: 600; }
.th-papers .done { opacity: .45; }
.th-scope { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 14px; background: color-mix(in srgb, var(--warn) 9%, var(--card-2)); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); }
.th-scope.ok { flex-direction: row; align-items: center; gap: 8px; background: color-mix(in srgb, var(--ok) 8%, var(--card-2)); border-color: color-mix(in srgb, var(--ok) 28%, transparent); font-size: 13.5px; color: var(--soft); }
.th-scope.ok .ic { color: var(--ok); font-weight: 800; }
.th-scope .q { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; align-items: start; }
.th-scope .t { display: flex; flex-direction: column; gap: 2px; font-size: 13px; color: var(--muted); }
.th-scope .t b { color: var(--text); font-weight: 600; font-size: 13.5px; }
.th-scope .late { color: #ff9086; }
.tick {
  width: 20px; height: 20px; margin-top: 1px; border-radius: 50%; border: 1.5px solid var(--faint); background: transparent; position: relative;
  cursor: pointer; padding: 0; display: flex; align-items: center; justify-content: center; color: transparent;
  transition: border-color .2s, background-color .2s, transform .3s var(--glide), color .2s;
}
.tick:hover { border-color: var(--ok); transform: scale(1.12); color: var(--ok); }
.tick.ticking { background: var(--ok); border-color: var(--ok); color: var(--bg); animation: fx-pop .5s var(--pop) both; }
.th-levels { display: flex; flex-direction: column; gap: 8px; }
.th-levels .row { display: flex; align-items: baseline; gap: 8px; }
.th-levels .pct { font-size: 20px; font-weight: 650; color: var(--text); }
.th-levels .lbl { font-size: 12.5px; color: var(--dim); }
.th-levels .cells { display: flex; flex-wrap: wrap; gap: 4px; }
.th-levels .cell { width: 15px; height: 15px; border-radius: 4px; transition: transform .25s var(--glide), filter .2s; animation: fx-cell .5s var(--glide) both; animation-delay: calc(var(--c, 0) * 10ms + 350ms); }
.th-levels .cell:hover { transform: scale(1.35); filter: brightness(1.3); }
.th-levels .cell.flag { box-shadow: inset 0 0 0 2px var(--warn); }
.th-levels .cell.mc { outline: 1px solid rgba(255, 255, 255, .28); outline-offset: -1px; }
.th-levels .flags { font-size: 12.5px; color: var(--flag-text); line-height: 1.4; }
.th-block { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.th-block .bh { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--dim); }
.th-block .bar { display: flex; gap: 3px; }
.th-block .bar span { flex: 1; height: 6px; border-radius: 3px; background: var(--border); }
.th-block .bar span.done { background: var(--c); }
.th-block .bar span.late { background: color-mix(in srgb, var(--bad) 60%, var(--border)); }
.th-block .next { display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; color: var(--soft); line-height: 1.35; }
.th-block .next .when { font-size: 12px; color: var(--c); font-weight: 600; }
.th-block .acts { display: flex; gap: 8px; }
.th-practice { display: flex; gap: 8px; flex-wrap: wrap; }
.th-practice .chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--border-hi); color: var(--soft); font-size: 13px; background: var(--card-2); transition: border-color .2s, color .2s, transform .3s var(--glide); }
.th-practice .chip:hover { color: var(--text); border-color: var(--c); transform: translateY(-1px); }
.th-practice .chip b { color: var(--text); }
.th-mc { display: flex; flex-direction: column; gap: 6px; }
.th-mc .k, .th-mist .k { font-size: 12px; color: var(--dim); }
.th-mc .list { display: flex; flex-wrap: wrap; gap: 5px; }
.th-mc .list a { font: 500 11.5px 'Geist Mono', monospace; padding: 3px 8px; border-radius: 7px; color: var(--soft); background: color-mix(in srgb, var(--c) 14%, var(--card-2)); border: 1px solid color-mix(in srgb, var(--c) 30%, transparent); }
.th-mc .list a:hover { color: var(--text); border-color: var(--c); }
.th-mist { margin-top: auto; display: flex; flex-direction: column; gap: 6px; }
.th-mist .last { margin: 0; font-size: 13px; line-height: 1.4; color: var(--muted); display: flex; flex-direction: column; gap: 2px; }
.th-mist .last .w { color: var(--soft); }
.th-mist .last .f { color: var(--ok); }

/* ---------- run-up ---------- */
.th-runup, .th-admin { padding: 22px 24px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.th-runup h2, .th-admin h2 { margin: 0; font-size: 20px; font-weight: 650; letter-spacing: -0.02em; }
.th-days { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 8px; scroll-snap-type: x proximity; min-width: 0; max-width: 100%; }
.th-days .dc {
  flex: 0 0 64px; height: 92px; border-radius: 14px; border: 1px solid var(--border); background: var(--card-2); color: var(--muted);
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 4px; padding: 9px 4px; cursor: pointer; position: relative;
  font-family: inherit; scroll-snap-align: start; transition: border-color .2s, background-color .2s, transform .35s var(--glide), color .2s;
  animation: fx-msg .5s var(--out) both; animation-delay: calc(var(--i) * 18ms + 200ms);
}
.th-days .dc:hover { color: var(--text); transform: translateY(-2px); border-color: var(--border-hi); }
.th-days .dc .wd { font-size: 11.5px; }
.th-days .dc .dn { font-size: 20px; font-weight: 600; color: var(--text); }
.th-days .dc .focus { width: 70%; height: 5px; border-radius: 3px; background: var(--border); }
.th-days .dc .pins { display: flex; gap: 3px; margin-top: 2px; }
.th-days .dc .pins i { width: 7px; height: 7px; border-radius: 2px; }
.th-days .dc.today { border-color: var(--text); }
.th-days .dc.in { background: color-mix(in srgb, var(--bad) 7%, var(--card-2)); }
.th-days .dc.rev { background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, .04) 0 4px, transparent 4px 9px); }
.th-days .dc.done::after { content: "✓"; position: absolute; top: 5px; right: 7px; font-size: 11px; color: var(--ok); font-weight: 800; }
.th-days .dc[aria-selected="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.th-days .dc[aria-selected="true"] .dn { color: var(--bg); }
.th-day-detail .pane { display: flex; flex-direction: column; gap: 10px; animation: fx-msg .4s var(--out) both; }
/* The page refreshes every 2 minutes and redraws: only the first paint plays the entrance.
   A day you pick still slides its detail in (.picked). */
.th-still .th-line .pin, .th-still .th-days .dc, .th-still .th-levels .cell, .th-still .th-facts .bar span,
.th-still .th-day-detail .pane:not(.picked) { animation: none; }
.th-day-detail h3 { margin: 0; font-size: 16px; font-weight: 650; }
.th-day-detail .paper { display: flex; align-items: center; gap: 10px; font-size: 14px; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--bad) 8%, var(--card-2)); border: 1px solid color-mix(in srgb, var(--bad) 28%, transparent); }
.th-day-detail .blk { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border-radius: 14px; background: var(--card-2); border: 1px solid var(--border); }
.th-day-detail .blk.done { opacity: .6; }
.th-day-detail .bt { display: flex; align-items: center; gap: 9px; font-size: 14.5px; }
.th-day-detail .bt .eff { margin-left: auto; font-size: 12px; color: var(--dim); }
.th-day-detail .detail { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--muted); max-width: 80ch; }
.th-day-detail .acts { display: flex; gap: 8px; align-items: center; }
.th-day-detail .donel { font-size: 13px; color: var(--ok); }
.th-admin-list { display: flex; flex-direction: column; }
.th-admin-list .ar { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 2px; border-top: 1px solid var(--line); font-size: 14px; }
.th-admin-list .ar:first-child { border-top: 0; }
.th-admin-list .d { font-size: 12.5px; color: var(--dim); }
.th-admin-list .d.late { color: #ff9086; }
.th-toast { position: fixed; z-index: 45; left: 50%; bottom: 84px; transform: translateX(-50%); display: flex; gap: 14px; align-items: center; padding: 10px 16px; border-radius: 14px; background: var(--glass-hi); border: 1px solid var(--edge-hi); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); font-size: 13.5px; color: var(--soft); box-shadow: 0 16px 40px rgba(0, 0, 0, .5); animation: fx-toast .5s var(--glide) both; }

@media (max-width: 1280px) { .th-subjects { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .th-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .th-count { text-align: left; }
  .th-count-big { justify-content: flex-start; }
}
@media (max-width: 640px) {
  .th-subjects { grid-template-columns: minmax(0, 1fr); }
  .th-hero { padding: 22px 20px; }
  .th-line .track { height: 92px; }
  .th-line .day .lbl { font-size: 9px; left: 3px; }
  .th-line .pin { padding: 4px 5px; }
  .th-line { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .th-line .pin, .th-days .dc, .th-levels .cell, .th-day-detail .pane, .tick.ticking, .th-toast, .th-facts .bar span { animation: none !important; }
}

/* Link to a subject's trial revision page (/trials/<subject>). */
.th-trial { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; align-items: center; padding: 11px 12px; border-radius: 14px; text-decoration: none; color: var(--text); background: color-mix(in srgb, var(--c) 12%, var(--card-2)); border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); }
.th-trial:hover { background: color-mix(in srgb, var(--c) 18%, var(--card-2)); }
.th-trial .k { font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: color-mix(in srgb, var(--c) 70%, white); }
.th-trial .t { grid-column: 1; font-size: 13px; color: var(--soft); }
.th-trial .go { grid-column: 2; grid-row: 1 / span 2; font-size: 13.5px; font-weight: 650; white-space: nowrap; }
/* The all-subject diagnostic link (13 Nov 2026), between the hero and the subjects. */
.th-dx { --c: #9fa3ff; margin: 0 0 18px; }
