:root {
  --ink:#183b40; --deep:#143d44; --sea:#08766f; --mint:#c5eadd; --pale:#edf5f2; --paper:#fbfdfb; --line:#cadbd5; --muted:#47635f; --red:#9d3932;
  font: 100%/1.55 'Avenir Next', 'Nunito', 'Segoe UI', sans-serif; color:var(--ink); background:var(--paper); font-synthesis:none;
}
* { box-sizing:border-box; }
[hidden] { display:none !important; }
body { margin:0; }
a { color:var(--sea); text-underline-offset:.2em; }
button, input, select { font:inherit; }
button, select { cursor:pointer; }
button { color:inherit; }
button:disabled, input:disabled, select:disabled { cursor:wait; opacity:.56; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline:3px solid #da6828; outline-offset:3px; }
.skip { position:absolute; top:-10rem; background:white; padding:.6rem; }
.skip:focus { top:0; z-index:3; }
.mast { display:flex; align-items:center; gap:1rem; padding:1.15rem max(5vw,calc((100vw - 76rem)/2)); border-bottom:1px solid var(--line); background:#fff; }
.brand { display:inline-flex; align-items:center; gap:.4rem; text-decoration:none; color:var(--deep); font-size:2.05rem; line-height:1; font-weight:800; letter-spacing:-.09em; }
.logo { display:inline-flex; justify-content:center; align-items:center; gap:4px; background:#205451; height:29px; width:36px; border-radius:10px 10px 12px 12px; transform:rotate(-4deg); }
.logo i { width:5px; height:12px; background:#bbf7e4; border-radius:4px; }
.station-name { color:var(--muted); border-left:1px solid var(--line); padding-left:1rem; }
.mast-links { margin-left:auto; display:flex; align-items:center; gap:1.1rem; font-size:.95rem; font-weight:650; }
.mast-links a, .view-nav a, .tool-links a { text-decoration:none; }
.mast-links a:hover, .tool-links a:hover { text-decoration:underline; }
#lock,.secondary { padding:.55rem .95rem; border:1px solid #94b4aa; border-radius:8px; background:transparent; font-weight:650; }
#lock:hover,.secondary:hover { background:var(--pale); }
main { max-width:82rem; padding:0 clamp(1rem,5vw,4.5rem) 4rem; margin:auto; }
h1,h2,h3,h4,p,figure,dl,dd { margin:0; }
h1,h2,h3,h4 { line-height:1.14; }
h1 { font-size:clamp(2.55rem,5vw,4.8rem); letter-spacing:-.065em; }
h2 { font-size:clamp(1.35rem,3vw,1.95rem); letter-spacing:-.045em; }
h3 { font-size:1.25rem; letter-spacing:-.035em; }
p { max-width:65ch; }
#access { display:grid; grid-template-columns:1.05fr 1fr; margin:clamp(2rem,6vw,5rem) auto 0; min-height:32rem; border:1px solid var(--line); border-radius:20px; overflow:hidden; }
.access-content { align-self:center; padding:clamp(1.6rem,4vw,4rem); }
.intro { margin:.9rem 0 2.15rem; font-size:1.15rem; color:var(--muted); }
#signin { max-width:28rem; }
label { font-weight:700; }
input:not([type=checkbox]),select { color:var(--ink); border:1px solid #83a69c; border-radius:7px; background:white; padding:.65rem .75rem; max-width:100%; }
#owner-code { display:block; width:100%; margin:.35rem 0; }
.hint { font-size:.9rem; color:var(--muted); }
.primary { background:var(--sea); color:white; border:1px solid var(--sea); border-radius:8px; padding:.64rem 1.15rem; font-weight:700; }
.primary:hover { background:#095e57; }
#signin .primary { margin-top:1.4rem; }
#access-error { color:var(--red); margin-top:1rem; }
.portrait { background-color:var(--mint); background-image:radial-gradient(#a9d6c5 1.2px,transparent 1.2px); background-size:18px 18px; display:grid; grid-template-rows:1fr auto; }
.portrait img { width:100%; height:auto; display:block; align-self:center; max-height:29rem; object-fit:contain; }
.portrait figcaption { padding:1rem 1.4rem; display:flex; justify-content:space-between; align-items:baseline; gap:1rem; color:#234f42; font-weight:700; }
.portrait figcaption span { font-weight:500; font-size:.9rem; }
.view-nav { display:flex; flex-wrap:wrap; gap:1.8rem; border-bottom:1px solid var(--line); }
.view-nav a { display:block; padding:1rem 0 .8rem; color:var(--muted); font-weight:600; border-bottom:3px solid transparent; }
.view-nav a[aria-current=page] { color:var(--ink); border-bottom-color:var(--sea); }
.page-head { display:flex; align-items:center; justify-content:space-between; gap:1rem; margin:2.3rem 0 1.8rem; }
.page-head h1 { font-size:clamp(2.3rem,5vw,3.65rem); }
.page-head p,.settings-stack p,.muted { color:var(--muted); }
.page-head p { margin-top:.45rem; }
#notice:not(:empty),#problem:not(:empty) { margin-top:1rem; border-left:4px solid var(--sea); background:var(--pale); padding:.65rem 1rem; }
#problem:not(:empty) { border-color:var(--red); background:#fff2ec; }
.work-grid { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.12fr); gap:clamp(1.5rem,4vw,3.8rem); align-items:start; }
.instrument { background:var(--deep); color:white; border-radius:18px; padding:clamp(1.2rem,3vw,2rem); }
.instrument-head { display:flex; align-items:baseline; justify-content:space-between; gap:1rem; }
.instrument-head span { font-size:.84rem; color:#c0d8d1; }
.instrument-face { display:flex; justify-content:center; gap:1.5rem; align-items:center; width:8.8rem; height:4.5rem; margin:1.7rem auto; border:1px solid #5c827d; background:#0c292e; border-radius:17px; }
.instrument-face i { display:block; width:.8rem; height:1.7rem; border-radius:30px; background:#abedd9; }
.readout,.wheel-pair { display:grid; grid-template-columns:1fr 1fr; gap:.5rem; }
.readout { padding:1rem 0; border-top:1px solid #537775; }
.readout span,.wheel-pair dt { color:#c0d8d1; font-size:.9rem; }
.readout strong { display:block; font-size:clamp(1.2rem,2.4vw,1.55rem); }
.wheel-pair dd { font-size:1.05rem; font-weight:650; font-variant-numeric:tabular-nums; }
.stop { width:100%; margin-top:1.3rem; padding:.65rem; border:0; border-radius:7px; background:#ffd8c8; color:#742b1d; font-weight:750; }
.stop span { font-size:.75em; margin-right:.4rem; }
.settings-stack { display:grid; gap:2.1rem; }
.settings-stack h2,.diagnostics h2 { margin-bottom:.85rem; }
.switch-row { display:flex; align-items:center; justify-content:space-between; gap:.75rem; padding:.85rem 0; border-top:1px solid var(--line); }
.switch-row p { font-size:.94rem; }
input[role=switch] { appearance:none; -webkit-appearance:none; margin:0; flex:none; width:3rem; height:1.75rem; border:2px solid #78918a; border-radius:3rem; background:#e4ece8; cursor:pointer; }
input[role=switch]::before { content:''; display:block; width:1.12rem; height:1.12rem; margin:.17rem; background:#49625a; border-radius:50%; }
input[role=switch]:checked { background:var(--sea); border-color:var(--sea); }
input[role=switch]:checked::before { margin-left:auto; background:white; }
#reveal { margin-top:.7rem; }
output:not([hidden]) { display:block; margin-top:.6rem; padding:.5rem .7rem; background:var(--pale); border-radius:5px; overflow-wrap:anywhere; font-family:ui-monospace,monospace; user-select:all; }
.diagnostics { margin:2rem 0 1.3rem; }
.facts { display:flex; gap:1rem 2.5rem; flex-wrap:wrap; border-top:1px solid var(--line); padding:1rem 0; }
.facts dt,.form-pair small { color:var(--muted); font-size:.9rem; }
.facts dd { font-weight:650; }
.tool-links { display:flex; flex-wrap:wrap; gap:1.5rem; }
.tool-links a { text-decoration:underline; }
.profile-tabs { display:flex; flex-wrap:wrap; gap:.6rem; padding-bottom:1.4rem; }
.profile-tabs button { display:flex; align-items:center; gap:.65rem; background:white; border:1px solid var(--line); padding:.5rem .85rem; border-radius:9px; }
.profile-tabs button[aria-pressed=true] { border-color:var(--sea); background:#e7f5ee; box-shadow:inset 0 0 0 1px var(--sea); }
.avatar { display:grid; place-items:center; border-radius:50%; background:var(--mint); color:var(--deep); width:1.8rem; height:1.8rem; font-weight:750; }
.profile-tabs small { color:var(--muted); }
.family-layout { display:grid; grid-template-columns:minmax(0,1.2fr) minmax(0,1fr); align-items:start; gap:clamp(1.3rem,4vw,3.6rem); }
.family-layout section { margin-bottom:1.7rem; }
.family-layout h2 { margin-bottom:.8rem; }
.profile-head { background:var(--deep); color:white; border-radius:15px; padding:1.4rem; }
.profile-head p { color:#d0e7df; }
.profile-head .facts { border-color:#537775; margin-top:.9rem; padding-bottom:0; }
.profile-head dt { color:#c0d8d1; }
.review-item,.build-panel,.activity details { padding:1rem 0; border-top:1px solid var(--line); }
.review-item p,.build-panel p,.family-layout details p { margin:.4rem 0; white-space:pre-wrap; overflow-wrap:anywhere; }
.review-item .meta,.build-panel .meta { color:var(--muted); font-size:.92rem; }
.actions { display:flex; align-items:center; flex-wrap:wrap; gap:.5rem; margin-top:.7rem; }
.form-pair { display:grid; gap:.35rem; margin:.85rem 0; }
.form-pair label { font-size:.95rem; }
.form-pair select,.form-pair input { width:100%; }
summary { cursor:pointer; font-weight:650; overflow-wrap:anywhere; }
.history-list { padding-left:1.2rem; margin:.6rem 0 0; }
.history-list li { padding:.25rem 0; overflow-wrap:anywhere; }
.profile-controls { border-top:1px solid var(--line); padding-top:.2rem; }
.danger { color:var(--red); border-color:#c49b94; }
@media (max-width:760px) {
  #access { grid-template-columns:1fr; }
  .portrait { grid-row:1; grid-template-columns:1fr 1fr; grid-template-rows:1fr; align-items:end; }
  .portrait img { max-height:12rem; }
  .portrait figcaption { display:block; padding:.8rem; }
  .portrait figcaption span { display:block; }
  .work-grid,.family-layout { grid-template-columns:1fr; }
  .instrument-face { margin:1rem auto; }
}
@media (max-width:520px) {
  .mast { gap:.6rem; flex-wrap:wrap; padding:.9rem 1rem; }
  .station-name { display:none; }
  .mast-links { gap:.65rem; }
  .page-head { align-items:flex-start; }
  .portrait img { max-height:9rem; }
  #access { margin-top:1.2rem; }
  .access-content { padding:1.3rem; }
  .profile-tabs button { padding:.4rem .6rem; }
}
.design-card { position:relative; padding:1rem 1.2rem; background:var(--pale); border-radius:8px; margin:.65rem 0; }
.design-card blockquote { margin:.5rem 0 0; color:var(--muted); font-style:italic; overflow-wrap:anywhere; }
.design-card h3 { overflow-wrap:anywhere; }
.design-colours { display:flex; float:right; margin-left:1rem; }
.design-colours i { width:1.25rem; height:1.25rem; border-radius:50%; border:1px solid #628579; }
.design-colours i + i { margin-left:-.25rem; }
[data-colour=mint] { background:#83d9bb; } [data-colour=lagoon] { background:#5ba8c8; }
[data-colour=lilac] { background:#bea9df; } [data-colour=sunshine] { background:#efcd72; }
[data-colour=apricot] { background:#efad78; } [data-colour=coral] { background:#e48577; }
[data-colour=sky] { background:#99ccea; } [data-colour=lemon] { background:#ecdd83; }
.turns { margin:.8rem 0; }
.turns dt { font-weight:650; font-size:.9rem; }
.turns dd { margin:.1rem 0 .8rem; white-space:pre-wrap; overflow-wrap:anywhere; }
#family-content details { margin-top:.75rem; padding:.65rem 0; border-top:1px solid var(--line); }
#family-content summary { color:var(--sea); }
.design-card canvas { display:block; width:100%; height:11rem; object-fit:contain; margin-bottom:1rem; }
.stencil { display:grid; grid-template-columns:repeat(8,1fr); grid-template-rows:repeat(8,1fr); width:4rem; height:4rem; margin:.5rem 0; border:1px solid var(--line); }
.stencil i { background:white; }
.stencil i[data-bit="1"] { background:var(--deep); }
