/* JUFO companion — extends the shared paper palette (css/style.css) */

:root {
  /* JUFO level ramp — ordinal blues, validated light */
  --l3: #0d366b; --l2: #1c5cab; --l1: #3987e5; --l0: #86b6ef;
  --lvl-pill-ink: #1c5cab;
  /* channel palette — categorical slots 1–4, validated light */
  --ch-cit: #2a78d6; --ch-pol: #eb6834; --ch-pat: #1baf7a; --ch-out: #eda100;
}
@media (prefers-color-scheme: dark) {
  :root {
    --l3: #86b6ef; --l2: #5598e7; --l1: #2a78d6; --l0: #184f95;
    --lvl-pill-ink: #86b6ef;
    --ch-cit: #3987e5; --ch-pol: #d95926; --ch-pat: #199e70; --ch-out: #c98500;
  }
}

.site-head { padding: 3.5rem 0 2.5rem; border-bottom: 1px solid var(--rule); background: var(--paper-tint); }
.site-head h1 { font-family: var(--serif); font-size: clamp(2.2rem, 5vw, 3.4rem); margin: .2rem 0 .6rem; letter-spacing: -.02em; }
.eyebrow { font-size: .8rem; text-transform: uppercase; letter-spacing: .13em; color: var(--accent); margin: 0; font-weight: 600; }
.lede { font-size: 1.12rem; color: var(--ink-soft); max-width: var(--measure); margin: 0; }

.section { padding: 2.8rem 0; border-bottom: 1px solid var(--rule); }
.section > h2 { font-family: var(--serif); font-size: 1.55rem; margin: 0 0 .6rem; letter-spacing: -.01em; }
.measure { max-width: var(--measure); color: var(--ink-soft); }
.note { font-size: .87rem; color: var(--ink-faint); }
.measure a { color: var(--accent); }

.edu-box { border-left: 3px solid var(--accent); background: var(--accent-wash); padding: 1rem 1.2rem; margin-top: 1.2rem; }
.edu-box p { margin-top: 0; }
.edu-box ul { margin: .6rem 0 .2rem; padding-left: 1.2rem; }
.edu-box li { margin-bottom: .5rem; font-size: .95rem; }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); }
.kpi { background: var(--surface); padding: 1.3rem 1.15rem; }
.kpi-value { font-family: var(--serif); font-size: 1.75rem; line-height: 1.1; color: var(--accent); }
.kpi-label { font-size: .9rem; font-weight: 600; margin-top: .35rem; }
.kpi-sub { font-size: .8rem; color: var(--ink-faint); margin-top: .3rem; line-height: 1.45; }

.findings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 1rem; margin-top: 1.4rem; }
.finding-card { background: var(--surface); border: 1px solid var(--rule); padding: 1.15rem; }
.finding-number { font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--accent); font-weight: 700; }
.finding-card h3 { font-family: var(--serif); font-size: 1.06rem; margin: .45rem 0 .5rem; line-height: 1.3; }
.finding-card p { font-size: .9rem; color: var(--ink-soft); margin: 0; line-height: 1.55; }

.fig { background: var(--surface); border: 1px solid var(--rule); padding: 1.1rem; margin: 1.3rem 0 .7rem; }
.fig-plot { position: relative; height: 400px; }
.fig-plot--tall { height: 520px; }
.fig-plot--traj { height: 440px; }
.fig-plot--short { height: 240px; }
.fig-plot--profile { position: relative; height: 340px; margin-top: .6rem; }

/* crosswalk matrix */
.xwalk { overflow-x: auto; }
.xwalk table { border-collapse: collapse; margin: 0 auto; }
.xwalk th, .xwalk td { padding: .55rem .8rem; font-size: .88rem; text-align: center; border: 1px solid var(--rule); }
.xwalk th { background: var(--paper-tint); font-weight: 600; }
.xwalk th.rowh { text-align: right; }
.xwalk td .cell-n { font-weight: 700; display: block; }
.xwalk td .cell-p { font-size: .72rem; color: var(--ink-faint); }

.mismatch-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.4rem; margin-top: 1.4rem; }
.edge-block { max-width: none; }
.etable { border-collapse: collapse; width: 100%; margin-top: .5rem; font-size: .84rem; }
.etable th, .etable td { padding: .35rem .5rem; text-align: right; border-bottom: 1px solid var(--rule); }
.etable th:first-child, .etable td:first-child { text-align: left; }
.etable th { font-weight: 600; color: var(--ink-soft); }
.erow { cursor: pointer; }
.erow:hover { background: var(--paper-tint); }
.mismatch-col h3 { font-family: var(--serif); font-size: 1.02rem; margin: 0 0 .5rem; }
.mismatch-col ol { margin: 0; padding-left: 1.3rem; }
.mismatch-col li { font-size: .88rem; color: var(--ink-soft); margin-bottom: .3rem; }
.mismatch-col .mm-fwci { color: var(--ink-faint); font-size: .8rem; }

.controls { display: flex; flex-wrap: wrap; gap: .85rem; align-items: center; margin-top: 1.1rem; }
.controls label { font-size: .84rem; color: var(--ink-soft); display: flex; gap: .4rem; align-items: center; }
.controls select, .controls input[type=search] {
  font: inherit; font-size: .87rem; padding: .42rem .6rem; background: var(--surface);
  color: var(--ink); border: 1px solid var(--rule-strong); border-radius: 3px; max-width: 320px;
}
.controls .chk { user-select: none; }
.controls .count { font-size: .84rem; color: var(--ink-faint); margin-left: auto; }

.table-wrap { overflow-x: auto; border: 1px solid var(--rule); margin-top: 1rem; background: var(--surface); max-height: 560px; overflow-y: auto; }
.jtable { border-collapse: collapse; width: 100%; font-size: .855rem; }
.jtable th, .jtable td { padding: .5rem .65rem; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--rule); }
.jtable th:first-child, .jtable td:first-child { text-align: left; }
.jtable td:first-child { white-space: normal; min-width: 240px; }
.jtable thead th { position: sticky; top: 0; background: var(--paper-tint); cursor: pointer; user-select: none; font-weight: 600; border-bottom: 2px solid var(--rule-strong); }
.jtable thead th:hover { color: var(--accent); }
.jtable tbody tr:hover { background: var(--paper-tint); }
.jtable tbody tr { cursor: pointer; }
.pill { display: inline-block; padding: .1rem .45rem; border-radius: 3px; font-weight: 700; font-size: .78rem; }
.pill-lvl { color: var(--lvl-pill-ink); }
.star { color: var(--accent); font-weight: 700; }

.site-foot { padding: 2rem 0 3rem; color: var(--ink-faint); font-size: .87rem; }
.site-foot a { color: var(--accent); }

.detail-panel { position: relative; background: var(--surface); border: 1px solid var(--rule-strong); padding: 1.3rem; margin-top: 1.2rem; }
.detail-panel h3 { font-family: var(--serif); font-size: 1.25rem; margin: 0 0 .3rem; padding-right: 2rem; }
.detail-meta { font-size: .85rem; color: var(--ink-soft); margin: 0; line-height: 1.7; }
.close-btn { position: absolute; top: .7rem; right: .9rem; background: none; border: none; font-size: 1.6rem; line-height: 1; color: var(--ink-faint); cursor: pointer; }
.close-btn:hover { color: var(--accent); }

.gloss { border: 1px solid var(--rule); background: var(--surface); padding: .7rem .9rem; margin-bottom: .5rem; max-width: var(--measure); }
.gloss summary { cursor: pointer; font-weight: 600; font-size: .93rem; }
.gloss-n { color: var(--ink-faint); font-weight: 400; font-size: .82rem; }
.gloss ul { margin: .6rem 0 .2rem; padding-left: 1.1rem; }
.gloss li { font-size: .87rem; color: var(--ink-soft); margin-bottom: .25rem; }
.gloss-unit { color: var(--ink-faint); font-size: .78rem; }
.dl-list { padding-left: 1.1rem; }
.dl-list li { font-size: .88rem; margin-bottom: .45rem; color: var(--ink-soft); }
.dl-list a { color: var(--accent); font-family: var(--mono); font-size: .84rem; }

@media (max-width: 640px) {
  .fig-plot, .fig-plot--tall, .fig-plot--traj { height: 330px; }
  .controls .count { margin-left: 0; width: 100%; }
}
