/* Theories hub and theory pages. Loaded only there. */
.room-page { max-width: 1080px; }
.room-page h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(34px, 7vw, 60px); line-height: 1.02; letter-spacing: -0.03em; margin: 0 0 12px; }
.th-one h1 { font-size: clamp(28px, 5.5vw, 46px); max-width: 22ch; }
.th-kicker { font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--lime); margin: 0 0 10px; }
.room-sub { color: var(--muted); font-size: 18px; line-height: 1.5; max-width: 40rem; margin: 0 0 30px; }
.room-h { font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin: 34px 0 14px; }
.room-h span { color: var(--text); margin-left: 6px; }
.room-note { color: var(--muted); font-size: 14px; margin: 12px 0 0; max-width: 42rem; }

.leads { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.lead { position: relative; display: flex; flex-direction: column; gap: 12px; padding: 18px 18px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--bg-2, #111317); color: inherit; transition: border-color .15s; }
.lead:hover { border-color: var(--lime); }
.lead h3 { font-family: var(--serif); font-weight: 500; font-size: 22px; line-height: 1.2; margin: 0; letter-spacing: -0.01em; }
.lnum { position: absolute; top: 14px; right: 16px; font-family: var(--serif); font-size: 34px; line-height: 1; color: var(--lime); opacity: .9; }
.ltopic { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.lbig { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.lbig b { font-family: var(--mono); font-size: 34px; font-weight: 600; color: var(--lime); letter-spacing: -0.02em; }
.lbig span { color: var(--muted); font-size: 14px; }
.big2 b { font-size: 48px; }

.bars { display: grid; gap: 8px; }
.rbar { display: grid; grid-template-columns: minmax(0, 9.5rem) 1fr 3.4rem; align-items: center; gap: 10px; font-size: 14px; }
.bl { color: var(--muted); line-height: 1.2; }
.bt { height: 12px; border-radius: 6px; background: rgba(255,255,255,.06); overflow: hidden; }
.bt i { display: block; height: 100%; border-radius: 6px; background: var(--muted); }
.rbar.fit .bt i { background: var(--lime); }
.rbar b { font-family: var(--mono); font-weight: 500; text-align: right; }

.vchip { display: inline-flex; align-self: flex-start; align-items: center; padding: 4px 10px; border-radius: 999px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; border: 1px solid currentColor; white-space: nowrap; }
.v-strong, .v-clear { color: var(--lime); }
.v-strong { background: rgba(216,255,62,.12); }
.v-some, .v-mixed { color: var(--gold); }
.v-none { color: var(--text); opacity: .7; }
.v-thin, .v-pending, .v-cant { color: var(--muted); }

.room-tools { display: grid; gap: 10px; margin: 0 0 14px; }
.room-tools[hidden] { display: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { min-height: 36px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: none; color: var(--muted); font: 13px var(--sans); cursor: pointer; }
.chips button span { color: var(--text); margin-left: 4px; font-family: var(--mono); font-size: 12px; }
.chips button.on { color: var(--bg); background: var(--lime); border-color: var(--lime); }
.chips button.on span { color: var(--bg); }
.sortby { color: var(--muted); font-size: 13px; display: inline-flex; gap: 8px; align-items: center; }
.sortby select { background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font: 13px var(--sans); }

.tlist { border-top: 1px solid var(--line); }
.trow2 { display: grid; grid-template-columns: minmax(0, 1fr) 13rem 14rem; gap: 6px 16px; align-items: center; padding: 14px 2px; border-bottom: 1px solid var(--line); color: inherit; }
.trow2[hidden] { display: none; }
.trow2:hover .tsay { color: var(--lime); }
.tsay { font-size: 17px; line-height: 1.35; }
.tsay small, .tval small { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; line-height: 1.3; }
.tval b { font-family: var(--mono); font-size: 18px; font-weight: 600; }
.trow2 .vchip { justify-self: start; }

.case { font-size: 19px; line-height: 1.5; max-width: 40rem; margin: 0 0 14px; }
.who { display: inline-block; color: var(--muted); font-size: 13px; font-family: var(--mono); letter-spacing: .04em; margin-left: 4px; }
.who:before { content: "— "; }
.ev { margin: 26px 0 0; max-width: 40rem; display: grid; gap: 14px; }
.ev h2 { font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin: 0; }
.ev p { margin: 0; font-size: 17px; line-height: 1.5; }
.ev.ex { grid-template-columns: 1fr 1fr; gap: 20px; }
.ev.ex ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.ev.ex a { color: var(--text); border-bottom: 1px solid var(--line); }
.ev.ex small { color: var(--muted); }
.ev.more a { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); color: inherit; }
.ev.more a:hover { color: var(--lime); }
.ev.wait p { color: var(--muted); }

.dots { display: flex; flex-wrap: wrap; gap: 6px; }
.dot { width: 18px; height: 18px; border-radius: 50%; display: block; }
.d-top { background: var(--lime); }
.d-mid { background: var(--gold); }
.d-late { background: var(--coral); }
.dkey { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.dkey span { background: none !important; display: inline-flex; align-items: center; gap: 6px; }
.dkey span:before { content: ""; width: 10px; height: 10px; border-radius: 50%; }
.dkey .d-top:before { background: var(--lime); }
.dkey .d-mid:before { background: var(--gold); }
.dkey .d-late:before { background: var(--coral); }

.th-back { display: inline-flex; align-items: center; min-height: 44px; margin: 0 0 12px; color: var(--lime); font-family: var(--mono); font-size: 13px; letter-spacing: .06em; text-transform: uppercase; }
.th-method { margin: 30px 0 8px; }
.th-method a { color: var(--lime); }

@media (max-width: 720px) {
  .trow2 { grid-template-columns: 1fr auto; }
  .trow2 .tsay { grid-column: 1 / -1; }
  .rbar { grid-template-columns: minmax(0, 7.5rem) 1fr 3rem; font-size: 13px; }
  .ev.ex { grid-template-columns: 1fr; }
  .lead h3 { font-size: 20px; padding-right: 30px; }
}

/* Theory scores */
.sgrid { display: grid; gap: 14px; }
.sbar { display: grid; grid-template-columns: minmax(0, 12rem) 1fr 3.4rem; align-items: center; gap: 10px; font-size: 14px; }
.sbar .bt i.up { background: var(--lime); }
.sbar .bt i.dn { background: var(--coral); opacity: .75; }
.sbar b { font-family: var(--mono); font-weight: 600; text-align: right; }
.sppl { margin: 4px 0 0 !important; font-size: 13px !important; line-height: 1.5 !important; color: var(--muted); }
.sppl a { color: var(--text); border-bottom: 1px solid var(--line); }
.sppl span { display: block; }
.sppl small { color: var(--muted); }
@media (max-width: 560px) { .sbar { grid-template-columns: minmax(0, 8.5rem) 1fr 3rem; } }
a.tsay { color: inherit; }
.tcuts { grid-column: 1 / -1; font-size: 13px; color: var(--muted); }
.tcuts a { color: var(--text); border-bottom: 1px solid var(--line); }
.tcuts a:hover { color: var(--lime); }
.th-parent { margin: -4px 0 12px; color: var(--muted); font-size: 14px; }
.th-parent a { color: var(--text); border-bottom: 1px solid var(--line); }
.cutn { font-family: var(--mono); color: var(--lime); font-weight: 600; }

/* Where it holds: era and position cuts */
.wh { display: grid; gap: 6px; }
.whr { display: grid; grid-template-columns: minmax(0, 8rem) 1fr 3.4rem; gap: 10px; align-items: center; font-size: 14px; }
.whr .bl { color: var(--muted); }
.whr .wv { font-family: var(--mono); font-size: 13px; }
.whr b { font-family: var(--mono); font-weight: 600; text-align: right; }
.whr.few .wv, .whr.few b { color: var(--muted); font-weight: 400; }
.wh h3 { font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 10px 0 2px; }

/* Age curve */
.curve { display: block; width: 100%; height: auto; max-width: 560px; overflow: visible; }
.curve polyline { fill: none; stroke: var(--lime); stroke-width: 2.5; stroke-linejoin: round; }
.curve circle { fill: var(--lime); }
.curve text { text-anchor: middle; font-family: var(--mono); }
.curve .cv { fill: var(--text); font-size: 12px; font-weight: 600; }
.curve .cx { fill: var(--muted); font-size: 12px; }
.curve .cn { fill: var(--muted); font-size: 10px; opacity: .8; }
.curve.spark { width: 160px; max-width: 160px; }
.curve.spark polyline { stroke-width: 2; }
.tspark { display: flex; align-items: center; gap: 10px; margin: 2px 0 6px; }
.tspark small { color: var(--muted); font-size: 12px; }

/* Question-led theory pages */
.ev.q h2 { font-family: var(--serif); font-size: 24px; font-weight: 500; letter-spacing: -0.01em; text-transform: none; color: var(--text); line-height: 1.2; }
.dtab-wrap { overflow-x: auto; min-width: 0; max-width: 100%; }
.ev > * { min-width: 0; }
.ev { grid-template-columns: minmax(0, 1fr); }
.dtab { width: 100%; border-collapse: collapse; font-size: 14px; }
.dtab th, .dtab td { padding: 8px 8px; text-align: right; border-bottom: 1px solid var(--line); vertical-align: top; white-space: nowrap; }
.dtab th:first-child { text-align: left; font-weight: 500; }
.dtab thead th { font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); white-space: normal; }
.dtab td b { font-family: var(--mono); font-size: 16px; color: var(--lime); }
.dtab td { font-family: var(--mono); }
.dtab small { display: block; color: var(--muted); font-size: 11px; font-family: var(--sans); font-weight: 400; }
.dtab tr.few td, .dtab tr.few th { color: var(--muted); }
@media (max-width: 560px) { .dtab { font-size: 13px; } .dtab th, .dtab td { padding: 7px 4px; } .dtab td b { font-size: 14px; } .dtab thead th { font-size: 10px; letter-spacing: .04em; } .ev.q h2 { font-size: 21px; } }
.dtab tr.thin td, .dtab tr.thin th { opacity: .6; }
.dtab tr.thin td b { color: var(--text); }
/* Height, inch by inch */
.ev table.inch { width: 100%; border-collapse: collapse; font-size: 14px; }
.ev table.inch th, .ev table.inch td { padding: 5px 8px; border-bottom: 1px solid var(--line, rgba(127,127,127,.2)); text-align: left; }
.ev table.inch th { font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ev table.inch .num { text-align: right; font-variant-numeric: tabular-nums; }
.ev table.inch td.bar { width: 28%; }
.ev table.inch td.bar span { display: block; height: 8px; border-radius: 4px; background: var(--muted); opacity: .45; }
.ev table.inch tr.edge td.bar span { background: var(--accent, currentColor); opacity: .9; }
.ev table.inch tr.edge td:first-child { font-weight: 600; }
.ev details.all-schools{margin-top:14px}
.ev details.all-schools summary{cursor:pointer;color:var(--muted);font-size:14px;padding:6px 0}
.ev details.all-schools[open] summary{margin-bottom:8px}
