/* ==========================================================================
   CAS · RoBERTa — A Robustly Optimized BERT Pretraining Approach
   roberta-training.css — Lecture-16-specific visuals on shared series styles.
   ========================================================================== */

/* ------------------------------------------------- sticky top nav */
.topnav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 130;
  display: flex; align-items: center; gap: 1.4rem;
  padding: 0.55rem clamp(1rem, 3vw, 2rem);
  background: rgba(5, 8, 14, 0.82); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topnav-brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--text); flex: none; }
.topnav-brand:hover { text-decoration: none; }
.topnav-brand img { width: 2.1rem; height: 2.1rem; border-radius: 7px; }
.topnav-brand .tb-txt { display: flex; flex-direction: column; line-height: 1.1; }
.topnav-brand .tb-txt strong { font-family: var(--font-display); font-size: 0.85rem; letter-spacing: 0.05em; }
.topnav-brand .tb-txt small { font-family: var(--font-mono); font-size: 0.56rem; letter-spacing: 0.14em; color: var(--text-3); text-transform: uppercase; }
.topnav-links { display: flex; gap: 0.2rem; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.topnav-links::-webkit-scrollbar { display: none; }
.topnav-links a {
  font-size: 0.82rem; font-weight: 500; color: var(--text-2); text-decoration: none;
  padding: 0.35rem 0.65rem; border-radius: 7px; white-space: nowrap; transition: color 0.15s, background 0.15s;
}
.topnav-links a:hover { color: var(--text); background: var(--panel-2); text-decoration: none; }
.topnav-links a.active { color: var(--teal); }
.topnav-back {
  flex: none; font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase;
  border: 1px solid var(--line-2); border-radius: 8px; padding: 0.4rem 0.8rem; color: var(--text);
  text-decoration: none; transition: border-color 0.2s, color 0.2s;
}
.topnav-back:hover { border-color: var(--teal); color: var(--teal); text-decoration: none; }
@media (max-width: 900px) { .topnav-links { display: none; } }

main { padding-top: 3.2rem; }
.scroll-progress { top: 3.2rem; }
.rail-toggle { top: 4.4rem; }
.rail { padding-top: 4.6rem; }

/* ------------------------------------------------- hero */
.sec-hero { text-align: center; padding-top: clamp(3rem, 8vh, 5.5rem); }
.hero-badge {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.06em; color: var(--teal);
  border: 1px solid rgba(94, 234, 212, 0.35); border-radius: 999px; padding: 0.42rem 1.1rem;
  background: rgba(94, 234, 212, 0.06); margin-bottom: 1.6rem;
}
.sec-hero .hero-title { margin-inline: auto; }
.sec-hero .hero-sub { margin-inline: auto; text-align: center; }
.sec-hero .def-banner { text-align: left; margin-inline: auto; }

.hero-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 1rem; max-width: 980px; margin: 0 auto 2.6rem; }
.hstat {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.15rem 1rem 0.95rem; text-align: center; transition: border-color 0.25s, transform 0.25s;
}
.hstat:hover { border-color: rgba(94, 234, 212, 0.45); transform: translateY(-3px); }
.hstat b { display: block; font-family: var(--font-display); font-size: 1.9rem; font-weight: 700; color: var(--teal); letter-spacing: -0.02em; }
.hstat span { display: block; font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-2); margin-top: 0.3rem; }
.hstat small { display: block; font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.08em; color: var(--text-3); margin-top: 0.15rem; }

.flow-strip { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0.45rem; max-width: 1080px; margin: 2rem auto 2.4rem; }
.fs-step {
  font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.1em; color: var(--text-2);
  border: 1px solid var(--line-2); border-radius: 999px; padding: 0.42rem 0.8rem;
  background: rgba(8, 13, 24, 0.55);
}
.fs-hl { color: var(--teal); border-color: rgba(94, 234, 212, 0.4); background: rgba(94, 234, 212, 0.06); }
.fs-model { color: #05231f; background: var(--teal); border-color: var(--teal); font-weight: 700; }
.fs-arw { color: var(--text-3); font-size: 0.8rem; }

/* ------------------------------------------------- shared demo primitives */
.tok-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem 1.5rem; }
.tok-chips { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.tok-chip {
  position: relative; display: inline-flex; align-items: center; gap: 0.35rem;
  font-family: var(--font-mono); font-size: 0.84rem; color: var(--text);
  background: rgba(94, 234, 212, 0.08); border: 1px solid rgba(94, 234, 212, 0.35);
  border-radius: 8px; padding: 0.4rem 0.65rem; animation: tokPop 0.25s ease;
}
.tok-chip.mask-chip { border-color: var(--amber); background: rgba(251, 191, 36, 0.18); color: var(--amber); font-weight: 700; }
.tok-chip.keep-chip { border-color: var(--green); background: rgba(52, 211, 153, 0.16); color: var(--green); font-weight: 700; }
.chip-wt { font-size: 0.62rem; color: var(--text-3); font-weight: 500; border-left: 1px solid var(--line-2); padding-left: 0.35rem; }
@keyframes tokPop { from { transform: scale(0.88); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.tok-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr)); gap: 0.8rem; margin-top: 1.1rem; }
.pn-presets { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.pn-preset {
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.06em; color: var(--text-2);
  border: 1px solid var(--line); border-radius: 999px; padding: 0.34rem 0.78rem;
  background: rgba(8, 13, 24, 0.45); cursor: pointer; transition: all 0.15s;
}
.pn-preset:hover { color: var(--teal); border-color: rgba(94, 234, 212, 0.4); }
.pn-preset.on { color: #05231f; background: var(--teal); border-color: var(--teal); font-weight: 700; }
.pn-preset.wrong { color: var(--rose); border-color: rgba(251, 113, 133, 0.6); background: rgba(251, 113, 133, 0.12); }
.pn-preset:disabled { opacity: 0.55; cursor: default; }

.qk-row {
  display: grid; grid-template-columns: minmax(7rem, 15rem) minmax(6rem, 1fr);
  gap: 0.8rem; align-items: center; padding: 0.28rem 0.5rem; border-bottom: 1px dashed var(--line);
}
.qk-row:last-child { border-bottom: 0; }
.qk-row.win { background: rgba(94, 234, 212, 0.06); border-radius: 6px; }
.qk-row.row-dim { opacity: 0.62; }
.qk-row.three { grid-template-columns: minmax(6rem, 12rem) minmax(6rem, 1fr) minmax(6rem, 1fr); }
.qk-tok { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text); }
.qk-w { display: flex; align-items: center; gap: 0.5rem; }
.qk-w i {
  display: block; height: 10px; border-radius: 5px; flex: 1; max-width: calc(100% - 4.2rem); min-width: 3px;
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.45), rgba(56, 189, 248, 0.9));
}
.qk-w i.bar-win { background: linear-gradient(90deg, rgba(94, 234, 212, 0.45), var(--teal)); }
.qk-w i.bar-dim { background: linear-gradient(90deg, rgba(251, 113, 133, 0.35), var(--rose)); }
.qk-w b { font-family: var(--font-mono); font-size: 0.74rem; color: var(--text); min-width: 3.8rem; text-align: right; }

.range-wrap { display: flex; flex-direction: column; gap: 0.35rem; margin-top: 1.1rem; }
.range-header { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.08em; color: var(--text-2); flex-wrap: wrap; gap: 0.4rem; }
.range-val { color: var(--teal); font-weight: 700; }

.nt-grid { display: grid; grid-template-columns: minmax(280px, 1.1fr) minmax(260px, 1fr); gap: 1.4rem; }
@media (max-width: 880px) { .nt-grid { grid-template-columns: 1fr; } }

.svg-wrap { width: 100%; }
.svg-wrap svg { width: 100%; height: auto; display: block; }
.svg-tick { font-family: var(--font-mono); font-size: 11px; fill: #94a3b8; }
.svg-lab { font-family: var(--font-mono); font-size: 11.5px; font-weight: 600; fill: #e2e8f0; }
.svg-lab.svg-hi { fill: var(--teal); }

/* ------------------------------------------------- headlines showcase */
.hl-showcase {
  text-align: left;
  margin: 0 auto 2.4rem;
  padding: 1.65rem 1.75rem;
  border-radius: 16px;
  border: 1px solid rgba(94, 234, 212, 0.32);
  background:
    radial-gradient(circle at 12% 0%, rgba(94, 234, 212, 0.11), transparent 48%),
    radial-gradient(circle at 88% 100%, rgba(56, 189, 248, 0.09), transparent 52%),
    rgba(7, 12, 22, 0.88);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.hl-head {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 1.2rem; flex-wrap: wrap;
  padding-bottom: 1.15rem; margin-bottom: 1.35rem; border-bottom: 1px solid var(--line);
}
.hl-pill-badge {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font-family: var(--font-mono); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.12em;
  color: var(--amber); background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.4); border-radius: 999px;
  padding: 0.28rem 0.85rem; margin-bottom: 0.55rem;
}
.hl-title { margin: 0; font-family: var(--font-display); font-size: clamp(1.35rem, 2.4vw, 1.85rem); color: var(--text); letter-spacing: -0.02em; }
.hl-title em { font-style: normal; color: var(--teal); }
.hl-sub { margin: 0.4rem 0 0; font-size: 0.92rem; color: var(--text-2); max-width: 72ch; line-height: 1.55; }
.hl-bento-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 1rem; }
.hl-card {
  display: flex; flex-direction: column; gap: 0.7rem; padding: 1.2rem 1.25rem;
  border-radius: 13px; border: 1px solid var(--line-2); background: rgba(10, 16, 29, 0.82);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
  position: relative; overflow: hidden; cursor: pointer;
}
.hl-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--teal), var(--sky), var(--violet)); opacity: 0.75;
}
.hl-card.acc-sky::before { background: linear-gradient(90deg, var(--sky), var(--teal)); }
.hl-card.acc-amber::before { background: linear-gradient(90deg, var(--amber), var(--sky)); }
.hl-card.acc-violet::before { background: linear-gradient(90deg, var(--violet), var(--sky)); }
.hl-card.acc-green::before { background: linear-gradient(90deg, var(--green), var(--teal)); }
.hl-card.acc-rose::before { background: linear-gradient(90deg, var(--rose), var(--violet)); }
.hl-card:hover { transform: translateY(-4px); border-color: rgba(94, 234, 212, 0.55); box-shadow: 0 14px 36px rgba(0, 0, 0, 0.45), 0 0 28px rgba(94, 234, 212, 0.08); }
.hl-card h3 { margin: 0.1rem 0 0; font-family: var(--font-display); font-size: 1.06rem; font-weight: 700; color: var(--text); line-height: 1.32; }
.hl-card p { margin: 0; font-size: 0.85rem; color: var(--text-2); line-height: 1.55; }
.hl-theme {
  align-self: flex-start; font-family: var(--font-mono); font-size: 0.62rem; font-weight: 700;
  letter-spacing: 0.12em; color: var(--teal); background: rgba(94, 234, 212, 0.09);
  border: 1px solid rgba(94, 234, 212, 0.35); border-radius: 999px; padding: 0.18rem 0.6rem;
}
.hl-go { font-family: var(--font-mono); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; color: var(--teal); margin-top: auto; }

/* ------------------------------------------------- §01 hero unicorn */
.uc-ctx { font-size: 1.02rem; line-height: 1.6; color: var(--amber); margin: 0; max-width: 72ch; }
.uc-out {
  min-height: 7.5rem; font-size: 0.98rem; line-height: 1.72; color: var(--text);
  border: 1px dashed var(--line-2); border-radius: var(--radius-s); padding: 0.9rem 1.05rem;
  background: rgba(5, 8, 14, 0.6); margin: 0; white-space: pre-wrap;
}
.uc-out.uc-live { border-color: rgba(94, 234, 212, 0.5); box-shadow: 0 0 24px rgba(94, 234, 212, 0.07) inset; }

/* ------------------------------------------------- §02 thesis */
.tm-seq { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.tm-part {
  font-family: var(--font-mono); font-size: 0.88rem; font-weight: 700;
  border-radius: 8px; padding: 0.45rem 0.75rem; border: 1px solid var(--line-2);
}
.tm-part.tone-task { color: var(--amber); border-color: rgba(251, 191, 36, 0.5); background: rgba(251, 191, 36, 0.1); }
.tm-part.tone-in { color: var(--sky); border-color: rgba(56, 189, 248, 0.45); background: rgba(56, 189, 248, 0.09); }
.tm-part.tone-out { color: var(--teal); border-color: rgba(94, 234, 212, 0.55); background: rgba(94, 234, 212, 0.12); }
.tm-comma { color: var(--text-3); font-family: var(--font-mono); }
.tm-svg { width: 100%; height: auto; display: block; }

/* ------------------------------------------------- §03 webtext */
.wt-stages { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); gap: 0.7rem; }
.wt-stage {
  display: flex; flex-direction: column; gap: 0.15rem; text-align: left; cursor: pointer;
  border: 1px solid var(--line-2); border-radius: 12px; padding: 0.85rem 0.95rem;
  background: rgba(8, 13, 24, 0.5); transition: all 0.18s;
}
.wt-stage:hover { border-color: rgba(94, 234, 212, 0.4); }
.wt-stage.on { border-color: var(--teal); background: rgba(94, 234, 212, 0.07); }
.wt-stage-n { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; color: var(--teal); }
.wt-stage-u { font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-3); }
.wt-stage-l { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.1em; color: var(--text-2); margin-top: 0.2rem; }
.wt-detail { margin-top: 0.9rem; padding: 0.85rem 1rem; border-left: 3px solid var(--teal); background: rgba(94, 234, 212, 0.05); border-radius: 0 10px 10px 0; }
.wt-detail p { margin: 0.2rem 0 0; font-size: 0.92rem; color: var(--text); line-height: 1.6; }
.wt-en { font-size: 0.9rem; color: var(--text); line-height: 1.6; margin: 0; }
.wt-fr { font-size: 0.9rem; color: var(--sky); line-height: 1.6; margin: 0.3rem 0 0; }

/* ------------------------------------------------- §04 byte-level BPE */
.bb-input {
  width: 100%; font-family: var(--font-mono); font-size: 0.95rem; color: var(--text);
  background: rgba(5, 8, 14, 0.7); border: 1px solid var(--line-2); border-radius: 10px;
  padding: 0.7rem 0.9rem; outline: none; transition: border-color 0.2s;
}
.bb-input:focus { border-color: var(--teal); }
.bb-regex {
  display: block; font-size: 0.78rem; color: var(--amber); background: rgba(251, 191, 36, 0.06);
  border: 1px solid rgba(251, 191, 36, 0.3); border-radius: 8px; padding: 0.5rem 0.75rem; overflow-x: auto; white-space: nowrap;
}
.bb-bytes { display: flex; flex-direction: column; gap: 0.3rem; max-height: 15rem; overflow-y: auto; }
.bb-piece { display: flex; align-items: baseline; gap: 0.7rem; flex-wrap: wrap; border-bottom: 1px dashed var(--line); padding: 0.22rem 0.1rem; }
.bb-piece:last-child { border-bottom: 0; }
.bb-piece-src { font-size: 0.78rem; color: var(--text-2); min-width: 9ch; }
.bb-piece-bytes { font-size: 0.92rem; color: var(--teal); letter-spacing: 0.06em; word-break: break-all; }
.bb-vocab { display: flex; flex-wrap: wrap; gap: 0.35rem; min-height: 2.2rem; }
.bb-vm-grid { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.bb-vm {
  border: 1px solid var(--line-2); border-radius: 10px; padding: 0.55rem 0.9rem;
  background: rgba(8, 13, 24, 0.55); text-align: center; min-width: 8.5rem;
}
.bb-vm b { display: block; font-family: var(--font-display); font-size: 1.25rem; color: var(--teal); }
.bb-vm span { font-size: 0.68rem; color: var(--text-2); }
.bb-vm-total { border-color: var(--teal); background: rgba(94, 234, 212, 0.09); }
.bb-vm-total b { color: var(--teal); font-size: 1.5rem; }
.bb-vm-plus { font-family: var(--font-display); font-size: 1.3rem; color: var(--text-3); }

/* ------------------------------------------------- §05 rewire */
.rw-body { min-height: 5.5rem; }
.rw-svg { width: 100%; height: auto; display: block; }

/* ------------------------------------------------- §06 parameter audit */
.pa-total {
  font-family: var(--font-display); font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 700;
  color: var(--teal); margin: 0 0 0.7rem; letter-spacing: -0.02em;
}

/* ------------------------------------------------- §07 zero-shot */
.zs-sota-line {
  display: flex; justify-content: space-between; align-items: center; gap: 0.8rem;
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.08em; color: var(--text-3);
  border: 1px dashed var(--line-2); border-radius: 8px; padding: 0.4rem 0.65rem; margin-bottom: 0.55rem;
}
.zs-sota-line b { color: var(--amber); font-size: 0.82rem; }

/* ------------------------------------------------- §08 LAMBADA */
.lb-ctx {
  font-size: 0.98rem; line-height: 1.72; color: var(--text);
  border: 1px solid var(--line-2); border-radius: var(--radius-s); padding: 0.85rem 1rem;
  background: rgba(5, 8, 14, 0.6); margin: 0; white-space: pre-wrap;
}

/* ------------------------------------------------- §09 Winograd */
.wg-sentence { font-size: 1.12rem; line-height: 1.7; color: var(--text); border-left: 3px solid var(--violet); padding: 0.5rem 0 0.5rem 1rem; margin: 0; }
.wg-pron { color: var(--violet); font-weight: 700; border-bottom: 2px dashed var(--violet); }
.wg-blank { color: var(--amber); font-weight: 700; }

/* ------------------------------------------------- §10 QA */
.qa-hist { display: flex; flex-direction: column; gap: 0.15rem; }
.qa-line { font-family: var(--font-mono); font-size: 0.84rem; color: var(--text-2); margin: 0; }
.qa-line.qa-a { color: var(--sky); padding-left: 1.2rem; }
.qa-line.qa-final { color: var(--amber); font-weight: 700; font-size: 0.95rem; }
.qa-model { font-size: 1.15rem; color: var(--teal); margin: 0; display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.qa-model b { font-family: var(--font-display); font-size: 1.5rem; }

/* ------------------------------------------------- §11 prompting */
.sp-prompt {
  font-size: 0.85rem; color: var(--teal); background: rgba(94, 234, 212, 0.06);
  border: 1px solid rgba(94, 234, 212, 0.3); border-radius: 8px; padding: 0.55rem 0.8rem; margin: 0;
  line-height: 1.6; overflow-x: auto; white-space: pre-wrap; word-break: break-word;
}

/* ------------------------------------------------- §12 overlap */
.ov-calc {
  display: flex; align-items: baseline; gap: 0.7rem; flex-wrap: wrap;
  border: 1px solid rgba(94, 234, 212, 0.35); border-radius: 10px;
  background: rgba(94, 234, 212, 0.05); padding: 0.75rem 1rem;
}
.ov-calc b { font-family: var(--font-display); font-size: 1.25rem; color: var(--teal); }
.ov-hit { font-family: var(--font-mono); font-size: 0.8rem; color: var(--amber); margin: 0.25rem 0; border-left: 2px solid rgba(251, 191, 36, 0.5); padding-left: 0.6rem; }

/* ------------------------------------------------- §13 timeline */
.tl-rail { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); gap: 0.7rem; }
.tl-card {
  display: flex; flex-direction: column; gap: 0.2rem; text-align: left; cursor: pointer;
  border: 1px solid var(--line-2); border-radius: 12px; padding: 0.85rem 0.95rem;
  background: rgba(8, 13, 24, 0.5); transition: all 0.18s;
}
.tl-card:hover { border-color: rgba(251, 113, 133, 0.45); }
.tl-card.on { border-color: var(--rose); background: rgba(251, 113, 133, 0.07); }
.tl-date { font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.14em; color: var(--rose); font-weight: 700; }
.tl-model { font-family: var(--font-display); font-size: 1.05rem; font-weight: 700; color: var(--text); }
.tl-title { font-size: 0.72rem; color: var(--text-2); }

/* ------------------------------------------------- footer & kickers */
.cite-note { font-size: 0.8rem; color: var(--text-3); max-width: 78ch; line-height: 1.6; }
.sec-head .kicker { gap: 0.4rem; letter-spacing: 0.22em; }
.sec-head .kicker .knum { display: inline; border: 0; background: none; padding: 0; min-width: 0; height: auto; border-radius: 0; white-space: nowrap; }
.sec-head .kicker .knum::before { content: "— SECTION "; }
.sec-head .kicker .knum::after { content: " ·"; }

/* ------------------------------------------------- hero objectives + CTA */
.obj-strip {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0.5rem;
  max-width: 1080px; margin: 0 auto 0.4rem;
}
.obj-label {
  font-family: var(--font-mono); font-size: 0.62rem; font-weight: 700; letter-spacing: 0.16em;
  color: var(--text-3); margin-right: 0.3rem;
}
.obj-chip {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-2);
  border: 1px solid var(--line-2); border-radius: 999px; padding: 0.3rem 0.75rem;
  background: rgba(8, 13, 24, 0.5);
}
.obj-chip b { color: var(--teal); font-weight: 700; }

/* ------------------------------------------------- §02b token simulator */
.ts-cand { cursor: pointer; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px dashed var(--line); transition: background 0.15s; }
.ts-cand:hover { background: rgba(94, 234, 212, 0.05); border-radius: 6px; }
.ts-cand:last-of-type { border-bottom: 0; }

/* ------------------------------------------------- §05b causal mask refresher */
.mr-wrap { display: flex; justify-content: center; padding: 0.4rem 0; }
.mr-table { display: grid; grid-template-columns: repeat(5, minmax(4.6rem, 5.4rem)); gap: 4px; }
.mr-cell {
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 0.82rem; font-weight: 700;
  border-radius: 7px; padding: 0.55rem 0.2rem; min-height: 2.3rem;
}
.mr-hd { color: var(--text-2); background: rgba(148, 163, 184, 0.08); font-size: 0.72rem; }
.mr-ok { color: var(--teal); background: rgba(94, 234, 212, 0.13); border: 1px solid rgba(94, 234, 212, 0.4); }
.mr-self { color: #05231f; background: var(--teal); border: 1px solid var(--teal); }
.mr-masked { color: var(--rose); background: rgba(251, 113, 133, 0.09); border: 1px dashed rgba(251, 113, 133, 0.45); }
.mr-off { color: rgba(148, 163, 184, 0.25); background: rgba(148, 163, 184, 0.03); border: 1px dashed rgba(148, 163, 184, 0.12); }
@media (max-width: 560px) { .mr-table { grid-template-columns: repeat(5, minmax(3.2rem, 1fr)); } .mr-cell { font-size: 0.7rem; min-height: 1.9rem; } }

/* ------------------------------------------------- §06 memory explorer */
.pa-memory { display: flex; flex-wrap: wrap; gap: 1rem; align-items: stretch; }
.pa-memory .hstat { flex: 1 1 220px; margin: 0; }

/* ------------------------------------------------- §11b in-context learning lab */
.icl-prompt {
  font-size: 0.92rem; line-height: 1.8; color: var(--text);
  border: 1px solid var(--line-2); border-radius: 10px; padding: 0.85rem 1rem;
  background: rgba(5, 8, 14, 0.6); margin: 0; white-space: pre-wrap;
}
.icl-cue { color: var(--amber); font-weight: 700; border-bottom: 2px solid rgba(251, 191, 36, 0.55); }
.icl-ex {
  color: var(--sky); background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.35); border-radius: 7px; padding: 0.12rem 0.45rem;
}
.icl-shot-n { color: var(--text-3); font-size: 0.68rem; font-family: var(--font-mono); }
.icl-q { color: var(--teal); font-weight: 600; border-bottom: 2px solid rgba(94, 234, 212, 0.55); }
.icl-sep { color: var(--text-3); }
.icl-out { font-size: 1.25rem; color: var(--teal); margin: 0; display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.icl-out b { font-family: var(--font-display); font-size: 1.6rem; }
@media (max-width: 880px) { .icl-prompt { white-space: normal; } }

/* ------------------------------------------------- §13 evolution strip + comparison */
.evo-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); gap: 0.7rem; }
.evo-card {
  border: 1px solid var(--line-2); border-radius: 12px; padding: 0.8rem 0.9rem;
  background: rgba(8, 13, 24, 0.5); display: flex; flex-direction: column; gap: 0.2rem;
}
.evo-card b { font-family: var(--font-display); font-size: 1rem; color: var(--text); }
.evo-card p { margin: 0.15rem 0 0; font-size: 0.78rem; color: var(--text-2); line-height: 1.5; }
.evo-year { font-family: var(--font-mono); font-size: 0.66rem; font-weight: 700; letter-spacing: 0.14em; color: var(--sky); }
.evo-card.evo-now { border-color: var(--teal); background: rgba(94, 234, 212, 0.07); }
.evo-card.evo-now .evo-year, .evo-card.evo-now b { color: var(--teal); }

.cmp-details {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel);
  padding: 0; overflow: hidden;
}
.cmp-details summary {
  cursor: pointer; list-style: none; padding: 1rem 1.3rem;
  font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.06em; color: var(--teal);
}
.cmp-details summary::-webkit-details-marker { display: none; }
.cmp-details summary::before { content: "▸ "; }
.cmp-details[open] summary::before { content: "▾ "; }
.cmp-details[open] summary { border-bottom: 1px solid var(--line); }
.cmp-details > *:not(summary) { padding: 0 1.3rem 1rem; }

/* comparison tables (paper-verbatim tables + the details card) */
.cmp-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--panel); }
.cmp-table { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
.cmp-table th, .cmp-table td { text-align: left; padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--line); vertical-align: top; line-height: 1.5; }
.cmp-table th { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3); }
.cmp-table td:first-child { color: var(--text); font-weight: 600; white-space: nowrap; }
.cmp-table td { color: var(--text-2); }
.cmp-table tr:last-child td { border-bottom: 0; }
.cmp-hl { background: rgba(94, 234, 212, 0.05); color: var(--text) !important; }

.cite-note a { color: var(--teal); text-decoration: underline; text-decoration-color: rgba(94, 234, 212, 0.4); text-underline-offset: 3px; }
.cite-note a:hover { text-decoration-color: var(--teal); }

/* ------------------------------------------------- static print mode */
html.static .tok-chip { animation: none; transition: none; }
html.static .uc-out { min-height: 0; }


/* ------------------------------------------------- hero recipe mixer */
.rm-meter { font-family: var(--font-display); font-size: clamp(2.2rem, 5vw, 3.2rem); font-weight: 700; color: var(--teal); margin: 0; letter-spacing: -0.02em; }
.rm-barwrap { height: 12px; border-radius: 6px; background: rgba(148, 163, 184, 0.12); overflow: hidden; margin-top: 0.5rem; }
.rm-barwrap i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, rgba(94, 234, 212, 0.45), var(--teal)); transition: width 0.5s ease; }

/* ------------------------------------------------- §03 dynamic masking */
.dm-row { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; border: 1px solid var(--line-2); border-radius: 10px; padding: 0.55rem 0.8rem; background: rgba(8, 13, 24, 0.5); }
.dm-row .mini.dim { min-width: 6.5rem; }

/* ------------------------------------------------- §05 data cards */
.ds-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); gap: 0.7rem; }
.ds-card {
  display: flex; flex-direction: column; gap: 0.15rem; text-align: left; cursor: pointer;
  border: 1px solid var(--line-2); border-radius: 12px; padding: 0.85rem 0.95rem;
  background: rgba(8, 13, 24, 0.5); transition: all 0.18s; color: var(--text);
}
.ds-card:hover { border-color: rgba(94, 234, 212, 0.4); }
.ds-card.on { border-color: var(--teal); background: rgba(94, 234, 212, 0.07); }
.ds-card b { font-family: var(--font-display); font-size: 0.98rem; }
.ds-gb { font-family: var(--font-mono); font-size: 1.35rem; font-weight: 700; color: var(--teal); }

/* ------------------------------------------------- §09 comparison rows */
.cmp-row { width: 100%; text-align: left; background: none; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.cmp-row:hover { border-color: rgba(94, 234, 212, 0.45); }
.cmp-row.win { border-color: var(--teal); background: rgba(94, 234, 212, 0.06); }
.cmp-row .qk-tok { font-weight: 700; }

/* ------------------------------------------------- wide paper tables */
.qk-row.four { grid-template-columns: minmax(9rem, 1.5fr) repeat(3, minmax(4.2rem, 1fr)); }
.qk-row.five { grid-template-columns: minmax(9rem, 1.6fr) repeat(4, minmax(4.2rem, 1fr)); }
@media (max-width: 760px) { .qk-row.five { grid-template-columns: minmax(6rem, 1.3fr) repeat(4, minmax(2.6rem, 1fr)); } }
.qk-row.seven { grid-template-columns: minmax(6.5rem, 1.1fr) repeat(6, minmax(3rem, 1fr)); }
.qk-row.four .qk-w, .qk-row.seven .qk-w { min-width: 0; }
.qk-row.four .qk-w b, .qk-row.seven .qk-w b { min-width: 0; text-align: left; }
@media (max-width: 760px) {
  .qk-row.four { grid-template-columns: minmax(7rem, 1.4fr) repeat(3, minmax(3rem, 1fr)); }
  .qk-row.seven { grid-template-columns: repeat(4, 1fr); }
}
