/* SpectraSelect web poster. Plain academic styling: neutral greys, one muted accent, thin borders, square corners. */
:root {
  --ink: #1f2326;
  --ink-2: #4a4f54;
  --ink-3: #6b7177;
  --rule: #d4d6d8;
  --rule-2: #e7e8e9;
  --panel: #f6f6f4;
  --paper: #ffffff;
  --accent: #2f5d50;
  --accent-2: #4f7d70;
  --accent-tint: #e6eeeb;
  --m5: #222255;
  --agent: #ee7733;
  --rule-c: #009988;
  --cma: #aa3377;
  --de: #4477aa;
  --refine: #228833;
  --written: #ccbb44;
  --diag: #aa3377;
  --initial: #bbbbbb;
  --engine: #4477aa;
  color-scheme: light;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Source Sans 3", "Source Sans Pro", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

a { color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.page { max-width: 1120px; margin: 0 auto; padding: 0 16px 48px; }

/* ------------------------------------------------------------------ header and tabs */
header.masthead { padding: 18px 0 10px; }
h1 { font-size: 21px; line-height: 1.3; margin: 0 0 6px; font-weight: 700; max-width: 980px; }
.authors { margin: 0; font-size: 15px; color: var(--ink-2); }

.tabbar-wrap { position: sticky; top: 0; z-index: 10; background: var(--paper); border-bottom: 1px solid var(--rule);
  margin: 0 -16px; padding: 0 16px; }
.tabbar { position: relative; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.tab { font: inherit; font-size: 15px; background: none; border: 0; border-bottom: 3px solid transparent; color: var(--ink-2);
  padding: 10px 12px 8px; cursor: pointer; white-space: nowrap; flex: 0 0 auto; }
.tab:hover { color: var(--accent); }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 700; }
.tab:focus-visible, .subtab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.panel { padding: 18px 0 8px; }
.panel:focus { outline: none; }
.panel.enter, .subpanel.enter { animation: fadein 180ms ease-out; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .panel.enter, .subpanel.enter { animation: none; } }

.lead { font-size: 17px; max-width: 860px; margin: 0 0 14px; }
.fig-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; margin-bottom: 6px; }
.fig-head .fig-title { margin: 0; }
.cap1 { font-size: 14px; color: var(--ink-2); margin: 4px 0 0; min-height: 1.5em; }
.summary-line { margin: 0 0 8px; font-size: 15px; }

.counters { display: grid; grid-template-columns: repeat(5, 1fr); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  margin: 6px 0 18px; }
.counter { padding: 12px 14px 12px 0; }
.counter + .counter { border-left: 1px solid var(--rule); padding-left: 14px; }
.counter .big { display: block; font-size: 38px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums;
  line-height: 1.1; }
.counter .cap { display: block; font-size: 13.5px; color: var(--ink-2); margin-top: 4px; }

button.more { font: inherit; font-size: 14px; background: none; border: 0; padding: 2px 0; color: var(--accent); cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px; margin-top: 6px; }
button.more[aria-expanded="true"] { color: var(--ink-2); }
.details { font-size: 14.5px; color: var(--ink-2); max-width: 900px; border-left: 3px solid var(--rule); padding: 2px 0 2px 12px;
  margin: 6px 0 4px; }
.details p { margin: 0 0 8px; }

.subtabs { position: relative; display: flex; gap: 0; overflow-x: auto; border-bottom: 1px solid var(--rule); margin-bottom: 12px; }
.subtab { font: inherit; font-size: 14px; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--ink-2);
  padding: 6px 12px; cursor: pointer; white-space: nowrap; flex: 0 0 auto; }
.subtab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 700; }
.about { max-width: 860px; font-size: 15.5px; }
.about p { margin: 0 0 12px; }
.val.wide { min-width: 0; color: var(--ink-2); }

/* ------------------------------------------------------------------ sections */
section.block { padding-top: 26px; }
h2 { font-size: 23px; margin: 0 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--rule); }
h2 .num { color: var(--accent); margin-right: 6px; }
h3 { font-size: 18px; margin: 22px 0 6px; }
.prose { max-width: 820px; }
.prose p { margin: 0 0 12px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.two-col > .prose { max-width: none; }

/* ------------------------------------------------------------------ figures */
figure.fig { margin: 16px 0 22px; border: 1px solid var(--rule); padding: 14px 14px 10px; background: var(--paper); }
figure.fig figcaption { font-size: 14px; color: var(--ink-2); margin-top: 8px; border-top: 1px solid var(--rule-2);
  padding-top: 6px; }
figure.fig figcaption b { color: var(--ink); }
.fig-title { font-weight: 700; font-size: 15px; margin: 0 0 8px; }
.sub-title { font-weight: 700; font-size: 14px; margin: 4px 0 4px; color: var(--ink-2); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-2-wide { display: grid; grid-template-columns: 1.35fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.note { font-size: 13px; color: var(--ink-3); margin: 6px 0 0; }
.illus { font-size: 13px; color: var(--ink-2); background: var(--panel); border-left: 3px solid var(--accent-2);
  padding: 6px 10px; margin: 8px 0 0; }

.plot { position: relative; width: 100%; }
.plot svg { display: block; overflow: visible; position: relative; z-index: 1; }
.plot canvas { position: absolute; left: 0; top: 0; pointer-events: none; }
.plot svg text { font-family: inherit; }
.plot .tick text, .plot .axis-label { fill: var(--ink-2); }
.plot .axis-label { font-size: 13px; }
.plot .tick text { font-size: 12px; }
.plot .axis line, .plot .axis path { stroke: #8d9196; }

/* ------------------------------------------------------------------ controls */
.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 6px 0 10px; font-size: 14px; }
.controls .group { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.controls label { display: inline-flex; align-items: center; gap: 6px; }
.controls .lab { color: var(--ink-2); }
button.btn {
  font: inherit; font-size: 14px; color: var(--ink); background: var(--paper); border: 1px solid #9aa0a5;
  border-radius: 0; padding: 4px 10px; cursor: pointer; line-height: 1.35;
}
button.btn:hover { border-color: var(--accent); color: var(--accent); }
button.btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
button.btn:disabled { color: #a4a8ac; border-color: #d0d3d6; cursor: default; }
.seg { display: inline-flex; }
.seg button.btn + button.btn { margin-left: -1px; }
input[type="range"] { accent-color: var(--accent); width: 190px; max-width: 100%; }
input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; }
select { font: inherit; font-size: 14px; border: 1px solid #9aa0a5; border-radius: 0; padding: 3px 6px; background: #fff;
  color: var(--ink); }
.val { font-variant-numeric: tabular-nums; min-width: 4.2em; display: inline-block; color: var(--ink); }

.legend { display: flex; flex-wrap: wrap; gap: 4px 6px; margin: 4px 0 6px; }
.legend button.key { font: inherit; font-size: 13px; background: #fff; border: 1px solid var(--rule); border-radius: 0;
  padding: 2px 8px 2px 6px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; color: var(--ink); }
.legend button.key[aria-pressed="false"] { color: #9a9ea3; }
.legend button.key[aria-pressed="false"] .sw { opacity: 0.25; }
.legend .sw { width: 18px; height: 3px; display: inline-block; }
.legend.static span.key { font-size: 13px; display: inline-flex; align-items: center; gap: 6px; margin-right: 10px; }
.legend .box { width: 12px; height: 12px; display: inline-block; border: 1px solid #8d9196; }

/* readouts */
.readout { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0; border: 1px solid var(--rule);
  margin: 6px 0 8px; }
.readout div { padding: 6px 10px; border-right: 1px solid var(--rule); }
.readout div:last-child { border-right: 0; }
.readout .k { display: block; font-size: 12.5px; color: var(--ink-3); }
.readout .v { display: block; font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; }

table.data { border-collapse: collapse; font-size: 13.5px; width: 100%; font-variant-numeric: tabular-nums; }
table.data th, table.data td { padding: 3px 6px; border-bottom: 1px solid var(--rule-2); text-align: right; }
table.data th:first-child, table.data td:first-child { text-align: left; }
table.data thead th { border-bottom: 1px solid #9aa0a5; font-weight: 600; color: var(--ink-2); }
table.conf td.cell { text-align: center; min-width: 30px; }
table.conf th.col { text-align: center; }
.tablewrap { overflow-x: auto; }

/* step-through */
.steps-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 8px; font-size: 14px; }
.step-label { font-weight: 700; }
.msgs { border: 1px solid var(--rule); background: var(--panel); padding: 8px 10px; min-height: 150px; font-size: 14px; }
.msg { margin: 0 0 8px; padding-bottom: 8px; border-bottom: 1px solid var(--rule-2); }
.msg:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.msg .who { font-weight: 700; }
.msg .meta { color: var(--ink-3); font-size: 12.5px; }
.msg q { display: block; margin: 3px 0 0; color: var(--ink-2); font-style: italic; quotes: "\201C" "\201D"; }
.msg .dec { margin: 2px 0 0; }

.tip { position: fixed; pointer-events: none; background: #fff; border: 1px solid #8d9196; padding: 5px 8px;
  font-size: 12.5px; line-height: 1.35; z-index: 20; display: none; max-width: 260px; color: var(--ink); }
.tip b { font-weight: 700; }


#selftest { white-space: pre-wrap; font-family: Consolas, "Courier New", monospace; font-size: 12px; border: 1px solid var(--rule);
  padding: 8px; margin-top: 16px; }

@media (max-width: 860px) {
  .counters { grid-template-columns: repeat(3, 1fr); }
  .counter:nth-child(4) { border-left: 0; padding-left: 0; }
  .summary, .two-col, .grid-2, .grid-2-wide { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  h1 { font-size: 19px; }
  figure.fig { padding: 10px 10px 8px; }
}
@media (max-width: 480px) {
  h1 { font-size: 17px; }
  .counters { grid-template-columns: 1fr 1fr; }
  .counter:nth-child(n) { border-left: 0; padding-left: 0; }
  .counter:nth-child(even) { border-left: 1px solid var(--rule); padding-left: 12px; }
  .counter .big { font-size: 30px; }
  .lead { font-size: 15.5px; }
  .tab { padding: 9px 9px 7px; font-size: 14.5px; }
  body { font-size: 15.5px; }
  input[type="range"] { width: 150px; }
  .readout .v { font-size: 17px; }
}
@media print {
  .tabbar-wrap { position: static; }
  .panel[hidden] { display: block !important; }
  .controls, .steps-bar, .tabbar-wrap, button.more { display: none; }
}

/* grid children may shrink below their content width, so wide content scrolls inside instead of widening the page */
.two-col > *, .grid-2 > *, .grid-2-wide > *, .grid-3 > *, .summary > * { min-width: 0; }
.math { overflow-x: auto; overflow-y: hidden; text-align: center; margin: 4px 0 12px; }
.math math { font-size: 17px; }
table.conf { max-width: 760px; }
.img-cell { transition: fill 400ms ease, stroke 400ms ease; }
@media (prefers-reduced-motion: reduce) { .img-cell { transition: none; } }
.still .panel.enter, .still .subpanel.enter { animation: none; }
.still .img-cell { transition: none; }
.fig-head .lab, .fig-head label, .fig-head select { font-size: 14px; }
.fig-head .group { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
