/* GENOME 4 · genome 3's look: Neue Haas Grotesk Display in capitals, one grey surface, soft-UI pills (raised, pressed when
   on), hairlines, a white model. Each CSS weight is served by the next lighter cut, as in genome 3. */
@font-face { font-family: "NHG"; src: url("fonts/NeueHaasDisplayThin.ttf") format("truetype"); font-weight: 300; font-display: swap; }
@font-face { font-family: "NHG"; src: url("fonts/NeueHaasDisplayLight.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "NHG"; src: url("fonts/NeueHaasDisplayRoman.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "NHG"; src: url("fonts/NeueHaasDisplayMediu.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Fragment Mono"; src: url("fonts/FragmentMono-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
:root {
  --L: 300px; --R: 340px; --T: 48px; --B: 34px;
  --bg: #E6E7E9; --surf: #E8E9EB; --well: #DEE0E3; --hi: rgba(255,255,255,.95); --lo: rgba(158,166,178,.55);
  --raise: 3px 3px 7px var(--lo), -3px -3px 7px var(--hi); --raise-s: 2px 2px 5px var(--lo), -2px -2px 5px var(--hi); --press: inset 2px 2px 5px var(--lo), inset -2px -2px 5px var(--hi);
  --ink: #111416; --txt: #23282B; --mut: #3E4449; --fa: #60676C; --line: #CFD1D2; --line2: #B9BCBE;
  --ok: #23703F; --bad: #B3261E; --warn: #9A6212; --c1: #2F5FB0; --c2: #B3261E;
  --font: "NHG", "Helvetica Neue", Arial, system-ui, sans-serif; --mono: "Fragment Mono", Consolas, monospace;
}
body[data-tab="location"] { --B: 164px; }
/* Program: the board (board.html) draws in its own frame; the columns carry its settings and readouts, and no strip runs under it */
body[data-tab="program"] { --B: 0px; }
body[data-tab="program"] #strip { display: none; }
#board { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; background: #fdf7f9; }
/* the parts by programme (settings) and the part under the pointer (readouts) */
.parts { display: flex; flex-direction: column; gap: 2px; }
.parts .pg { font-size: 9.5px; color: var(--fa); letter-spacing: .1em; margin: 9px 0 3px; }
.parts .pt { display: grid; grid-template-columns: 40px 1fr auto; gap: 8px; align-items: center; text-align: left; white-space: normal; padding: 4px 6px; border-radius: 8px; background: transparent; box-shadow: none; font-weight: 400; font-size: 10.5px; }
.parts .pt:hover { background: var(--surf); box-shadow: var(--raise-s); }
.parts .pt.on { background: #1b1f22; color: #fff; }
.parts .pt img { width: 40px; height: 20px; display: block; border-radius: 3px; }
.parts .pt small { display: block; color: var(--fa); font-weight: 300; font-size: 9.5px; }
.parts .pt em { font-style: normal; color: var(--fa); font-feature-settings: "tnum"; }
.parts .pt.on small, .parts .pt.on em { color: #aeb4b8; }
.bcard .bref { font-size: 9.5px; color: var(--fa); letter-spacing: .08em; margin: 0 0 3px; }
.bcard .btitle { font: 500 11px var(--font); letter-spacing: .06em; color: var(--ink); margin: 0 0 6px; }
.bcard .btitle i { display: inline-block; width: 10px; height: 10px; margin-right: 6px; vertical-align: -1px; border: 1px solid #1b1f22; }
.bcard img { display: block; width: 100%; height: auto; border-radius: 10px; box-shadow: var(--raise-s); margin: 4px 0 8px; }
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--txt); font: 400 12.5px/1.3 var(--font); letter-spacing: .06em; word-spacing: .24em; text-transform: uppercase; overflow: hidden; -webkit-font-smoothing: antialiased; }
input, select, button, textarea { font-family: var(--font); text-transform: uppercase; letter-spacing: .05em; word-spacing: .24em; color: var(--txt); }
button, .btn { font: 500 11px var(--font); letter-spacing: .06em; border: 0; background: var(--surf); color: var(--txt); border-radius: 999px; padding: 6px 11px; cursor: pointer; white-space: nowrap; line-height: 1.15; box-shadow: var(--raise-s); transition: box-shadow .15s, background .15s, color .15s; }
button:hover, .btn:hover { box-shadow: var(--raise); color: var(--ink); }
button:active, .btn:active { box-shadow: var(--press); }
button:disabled { opacity: .45; cursor: default; box-shadow: none; }
button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
button.on { background: linear-gradient(180deg, #2A2E31, #0E1012); color: #fff; box-shadow: inset 0 0 8px rgba(0,0,0,.6), var(--raise-s); }
button.primary { background: linear-gradient(180deg, #2A2E31, #0E1012); color: #fff; font-weight: 700; }
button.primary.bad { background: linear-gradient(180deg, #C0392B, #8E1C12); }
button.small { padding: 4px 10px; font-size: 10.5px; }
button.txt, .btn.txt { background: transparent; box-shadow: none; padding: 6px 8px; font-weight: 400; }
button.txt:hover, .btn.txt:hover { box-shadow: var(--raise-s); background: var(--surf); }
button.txt.on { background: var(--surf); color: var(--ink); box-shadow: var(--press); font-weight: 500; }
input[type=checkbox] { appearance: none; -webkit-appearance: none; width: 16px; height: 16px; margin: 0; border: 0; border-radius: 50%; background: var(--surf); box-shadow: var(--press); cursor: pointer; flex: none; position: relative; }
input[type=checkbox]:checked { background: #111416; box-shadow: var(--raise-s); }
input[type=checkbox]:checked::after { content: ""; position: absolute; left: 5.5px; top: 5.5px; width: 5px; height: 5px; background: #fff; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 16px; background: transparent; margin: 0; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 3px; background: var(--well); box-shadow: inset 1px 1px 2px var(--lo); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 13px; height: 13px; margin-top: -4.5px; border-radius: 50%; background: #1b1f22; box-shadow: var(--raise-s); }
input[type=number], select { background: var(--well); border: 0; border-radius: 7px; box-shadow: var(--press); padding: 3px 6px; font-size: 11.5px; width: 100%; }
input[type=number] { width: 62px; text-align: right; font-feature-settings: "tnum"; }

/* ---------- top bar ---------- */
#top { position: fixed; left: 0; right: 0; top: 0; height: var(--T); display: flex; align-items: center; gap: 14px; padding: 0 12px; border-bottom: 1px solid var(--line); background: var(--bg); z-index: 20; }
.brand { display: flex; flex-direction: column; min-width: 190px; }
.brand b { font-weight: 700; font-size: 13px; letter-spacing: .14em; }
.brand span { font-size: 9.5px; color: var(--fa); font-weight: 300; }
#tabs { display: flex; gap: 6px; }
#tabs button { font-size: 11.5px; padding: 7px 13px; }
#tabs button i { font-style: normal; font-weight: 300; margin-right: 7px; color: var(--fa); }
#tabs button.on i { color: #aeb4b8; }
.chips { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.chip { display: inline-flex; align-items: baseline; gap: 6px; background: var(--surf); box-shadow: var(--press); border-radius: 999px; padding: 6px 12px; font-size: 10.5px; color: var(--mut); }
.chip b { font: 700 14px var(--font); color: var(--ink); font-feature-settings: "tnum"; }
.chip small { font-size: 10px; color: var(--fa); }
.chip.bad b { color: var(--bad); }
.chip.ok b { color: var(--ok); }
#ratingD.dn { color: var(--bad); } #ratingD.up { color: var(--ok); }
.acts { display: flex; align-items: center; gap: 2px; }
details.menu { position: relative; }
details.menu > summary { list-style: none; }
details.menu > summary::-webkit-details-marker { display: none; }
.mbody { position: absolute; right: 0; top: 34px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 8px; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--raise); z-index: 30; min-width: 190px; }

/* ---------- columns ---------- */
#left, #right { position: fixed; top: var(--T); bottom: var(--B); overflow-y: auto; padding: 12px 14px 18px; background: var(--bg); z-index: 5; scrollbar-width: thin; }
#left { left: 0; width: var(--L); border-right: 1px solid var(--line); }
#right { right: 0; width: var(--R); border-left: 1px solid var(--line); }
#stage { position: fixed; left: var(--L); right: var(--R); top: var(--T); bottom: var(--B); background: linear-gradient(180deg, #F7F7F6 0%, #E9E9E7 100%); }
/* the settings and sliders are hidden until asked for (S or the Settings button); the stage takes their width */
body:not(.showL) { --L: 0px; }
body:not(.showL) #left { display: none; }
body.showL #bL { color: var(--ink); box-shadow: var(--press); }
#bL small { font-size: 9px; color: var(--fa); margin-left: 4px; }
#three { position: absolute; inset: 0; }
#three canvas { display: block; }
#elev { position: absolute; inset: 0; overflow: auto; background: #FBFBFA; }
#strip { position: fixed; left: 0; right: 0; bottom: 0; height: var(--B); border-top: 1px solid var(--line); background: var(--bg); display: flex; align-items: center; gap: 10px; padding: 0 12px; font-size: 10.5px; color: var(--mut); z-index: 6; overflow-x: auto; }
#xmark { position: absolute; inset: 0; pointer-events: none; }

/* ---------- panels ---------- */
.sec { margin: 0 0 16px; }
.sec > h3 { font: 500 10.5px var(--font); letter-spacing: .12em; color: var(--ink); margin: 0 0 8px; padding-bottom: 5px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: baseline; }
.sec > h3 small { font-weight: 300; color: var(--fa); letter-spacing: .06em; }
.note { font-weight: 300; font-size: 10.5px; color: var(--fa); line-height: 1.35; margin: 4px 0 8px; text-transform: none; letter-spacing: .02em; word-spacing: normal; }
.row { display: grid; grid-template-columns: 1fr 64px; grid-template-rows: auto auto; column-gap: 8px; align-items: center; margin: 0 0 9px; }
.row label { font-size: 10.5px; color: var(--txt); grid-column: 1; }
.row label small { color: var(--fa); font-weight: 300; margin-left: 4px; }
.row input[type=number] { grid-column: 2; grid-row: 1 / span 2; justify-self: end; }
.row input[type=range] { grid-column: 1; }
.tg { display: inline-flex; gap: 7px; align-items: center; font-size: 10.5px; color: var(--txt); cursor: pointer; margin: 0 10px 8px 0; }
.seg { display: flex; flex-wrap: wrap; gap: 5px; margin: 0 0 9px; }
.seg button { padding: 5px 9px; font-size: 10.5px; }
.kv { display: grid; grid-template-columns: 1fr auto; column-gap: 10px; row-gap: 3px; font-size: 10.5px; }
.kv span { color: var(--mut); }
.kv b { font-weight: 500; text-align: right; font-feature-settings: "tnum"; color: var(--ink); }
.kv .sub { color: var(--fa); font-weight: 300; }
.checks { display: flex; flex-direction: column; gap: 2px; }
.ck { display: grid; grid-template-columns: 32px 1fr auto; gap: 6px; align-items: baseline; font-size: 10px; padding: 3px 4px; border-radius: 6px; }
.ck i { font-style: normal; font-weight: 700; }
.ck.ok i { color: var(--ok); }
.ck.bad { background: rgba(179,38,30,.08); }
.ck.bad i, .ck.bad b { color: var(--bad); }
.ck.off { opacity: .55; } .ck.off i { color: var(--fa); }
.ck span { color: var(--txt); }
.ck span small { display: block; color: var(--fa); font-weight: 300; font-size: 9px; }
.ck b { font-weight: 500; text-align: right; font-feature-settings: "tnum"; }
.bars { display: flex; flex-direction: column; gap: 7px; }
.bar { display: grid; grid-template-columns: 1fr 52px; column-gap: 8px; font-size: 10px; }
.bar .t { grid-column: 1 / span 2; display: flex; justify-content: space-between; color: var(--txt); }
.bar .t small { color: var(--fa); font-weight: 300; }
.bar .w { height: 6px; border-radius: 3px; background: var(--well); box-shadow: inset 1px 1px 2px var(--lo); position: relative; overflow: hidden; }
.bar .w > i { position: absolute; left: 0; top: 0; bottom: 0; background: #1b1f22; border-radius: 3px; }
.bar .w > u { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--bad); }
.bar b { font-weight: 500; font-size: 10px; text-align: right; font-feature-settings: "tnum"; }
.legend { display: grid; grid-template-columns: 22px 1fr; gap: 5px 8px; align-items: center; font-size: 10px; }
.legend i { width: 22px; height: 14px; border: 1px solid #1b1f22; display: block; background-size: cover; }

/* ---------- views strip (Location) ---------- */
.views { display: flex; gap: 10px; height: 100%; align-items: center; }
.vw { position: relative; flex: none; width: 212px; height: 138px; border-radius: 10px; overflow: hidden; background: #fff; box-shadow: var(--raise-s); cursor: pointer; }
.vw canvas { display: block; width: 100%; height: 100%; }
.vw .vt { position: absolute; left: 7px; top: 6px; right: 7px; display: flex; justify-content: space-between; font-size: 9.5px; color: var(--ink); text-shadow: 0 0 3px #fff; }
.vw .vb { position: absolute; left: 7px; bottom: 5px; right: 7px; display: flex; justify-content: space-between; font-size: 9.5px; text-shadow: 0 0 3px #fff; }
.vw .vb b.ok { color: var(--ok); } .vw .vb b.no { color: var(--bad); }
.vw.on { outline: 2px solid var(--ink); }

/* ---------- candidates ---------- */
[hidden] { display: none !important; }   /* an author display rule (#cands is flex) would otherwise beat the hidden attribute */
#cands { position: fixed; top: calc(var(--T) + 6px); right: 12px; width: 560px; max-height: calc(100vh - var(--T) - 30px); display: flex; flex-direction: column; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--raise); z-index: 40; }
#cands .ch { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
#cands .ch span { margin-left: auto; font-size: 10px; color: var(--fa); }
#cands .cl { overflow-y: auto; padding: 6px; }
.cr { display: grid; grid-template-columns: 34px 52px 1fr 1fr 1fr; gap: 8px; padding: 5px 7px; border-radius: 8px; font-size: 10.5px; cursor: pointer; font-feature-settings: "tnum"; }
.cr:hover { background: var(--surf); box-shadow: var(--raise-s); }
.cr.on { background: #1b1f22; color: #fff; }
.cr b { font-weight: 700; }
.cr small { color: var(--fa); }
.cr.on small { color: #aeb4b8; }

/* ---------- elevations (Facade) ---------- */
.erow { display: flex; gap: 14px; padding: 14px; align-items: flex-end; flex-wrap: nowrap; }
.ev { flex: none; }
.ev .evh { font: 500 10.5px var(--font); letter-spacing: .1em; margin: 0 0 6px; cursor: pointer; display: flex; justify-content: space-between; }
.ev .evh small { color: var(--fa); font-weight: 300; }
.ev canvas { display: block; background: #fff; box-shadow: var(--raise-s); }
.etip { position: fixed; pointer-events: none; background: rgba(17,20,22,.92); color: #fff; padding: 6px 9px; border-radius: 8px; font-size: 10px; line-height: 1.45; opacity: 0; transition: opacity .1s; z-index: 50; max-width: 300px; }

/* ---------- toast, loading ---------- */
#toast { position: fixed; left: 50%; bottom: calc(var(--B) + 14px); transform: translateX(-50%); background: #1b1f22; color: #fff; padding: 9px 16px; border-radius: 999px; font-size: 11px; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 60; max-width: 70vw; text-align: center; }
#toast.on { opacity: 1; }
#load { position: fixed; inset: 0; background: var(--bg); display: flex; align-items: center; justify-content: center; z-index: 100; transition: opacity .35s; }
#load > div { display: flex; flex-direction: column; gap: 8px; width: 340px; }
#load b { font-weight: 700; letter-spacing: .16em; font-size: 15px; }
#load span { font-size: 11px; color: var(--mut); }
#load i { display: block; height: 4px; border-radius: 2px; background: #1b1f22; width: 0; transition: width .2s; }
#load.done { opacity: 0; pointer-events: none; }
.hint { position: absolute; left: 12px; bottom: 10px; font-size: 10px; color: var(--fa); pointer-events: none; text-shadow: 0 0 3px #fff; }
.legendbox { position: absolute; right: 12px; top: 12px; background: rgba(251,251,250,.92); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; max-width: 260px; }

/* ---------- narrower screens: slimmer columns, then slide-in panels ---------- */
.narrow-only { display: none; }
@media (max-width: 1320px) { :root { --L: 262px; --R: 292px; } .brand span { display: none; } .brand { min-width: 0; } #tabs button i { display: none; } }
@media (max-width: 1040px) {
  :root { --L: 0px; --R: 0px; --T: 96px; }
  .narrow-only { display: inline-flex; }
  #top { flex-wrap: wrap; height: auto; min-height: var(--T); padding: 6px 10px; gap: 8px; }
  #tabs button { padding: 6px 9px; font-size: 10.5px; }
  .chip span { display: none; }
  #left, #right { width: min(88vw, 330px); z-index: 25; transition: transform .2s; box-shadow: var(--raise); }
  #left { transform: translateX(-102%); } #right { transform: translateX(102%); }
  body.showL #left, body.showR #right { transform: none; }
  #cands { left: 8px; right: 8px; width: auto; }
}
