:root { --paper: #f6f2ea; --card: #fffdf8; --ink: #2b2b2a; --muted: #5c5950; --line: #d9d2c3; --brass: #b08d5a; --brass-d: #7a5c2e; --slate: #9fb2c2; --warn: #8f5508; --exh: #1f5fc4; --inh: #c42a22; --res: #6b3490; --en: #c88a1c; }
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--paper); color: var(--ink); font: 14px/1.45 "Helvetica Neue", Helvetica, Arial, sans-serif; display: flex; flex-direction: column; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: 6px 10px; z-index: 20; } .skip:focus { left: 8px; top: 8px; }
header#top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 16px; border-bottom: 2px solid var(--brass); }
.brand { display: flex; align-items: center; gap: 12px; } .hdr { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mark { width: 9px; height: 30px; background: var(--brass); border-radius: 2px; }
h1 { font-size: 1.15rem; margin: 0; } h1 span { font-weight: 400; color: var(--muted); } .brand p { margin: 0; color: var(--muted); font-size: 0.78rem; }
h2 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--brass-d); margin: 0 0 6px; } h2.sect { margin: 12px 0 6px; }
.chip { font: 12px/1.3 ui-monospace, Menlo, monospace; background: var(--card); border: 1px solid var(--line); padding: 4px 10px; border-radius: 12px; }
#banner { background: #ebe3d3; padding: 4px 16px; font-size: 0.78rem; border-bottom: 1px solid var(--line); }
#layout { flex: 1; min-height: 0; display: grid; grid-template-columns: 250px minmax(0, 1fr) 310px; grid-template-areas: "left stage right"; }
#left { grid-area: left; } #stage { grid-area: stage; } #right { grid-area: right; }
#layout.focus { grid-template-columns: minmax(0, 1fr); grid-template-areas: "stage"; } #layout.focus #left, #layout.focus #right { display: none; }
aside#left, aside#right { overflow: auto; padding: 10px 12px; } #left { border-right: 1px solid var(--line); } #right { border-left: 1px solid var(--line); }
#stage { position: relative; min-width: 0; min-height: 320px; background: radial-gradient(circle at 50% 40%, #fbf8f1, #efe8d8); }
#canvas { width: 100%; height: 100%; display: block; touch-action: none; } #canvas:focus-visible { outline: 3px solid var(--brass-d); outline-offset: -3px; }
#toolbar { position: absolute; top: 8px; left: 8px; right: 8px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; pointer-events: none; z-index: 3; } #toolbar > * { pointer-events: auto; }
.hint { font-size: 0.72rem; color: var(--muted); background: rgba(255,253,248,0.85); padding: 2px 8px; border-radius: 6px; }
button, select { font: inherit; color: var(--ink); background: var(--card); border: 1px solid #b9b0a0; border-radius: 6px; padding: 5px 10px; cursor: pointer; min-height: 30px; }
button:hover { border-color: var(--brass-d); }
:focus-visible { outline: 3px solid var(--brass-d); outline-offset: 2px; }
.seg { display: inline-flex; } .seg button { border-radius: 0; } .seg button:first-child { border-radius: 6px 0 0 6px; } .seg button:last-child { border-radius: 0 6px 6px 0; margin-left: -1px; }
button[aria-pressed="true"] { background: var(--brass-d); color: #fff; border-color: var(--brass-d); } button:disabled { opacity: 0.55; cursor: default; }
.row { display: flex; gap: 6px; margin: 4px 0 8px; flex-wrap: wrap; align-items: center; }
.field { display: block; font-size: 0.78rem; color: var(--muted); margin-bottom: 8px; } .field select { display: block; width: 100%; margin-top: 3px; }
.field.inline { display: inline-flex; gap: 8px; align-items: center; background: var(--card); border: 1px solid var(--line); padding: 3px 10px; border-radius: 6px; margin: 0; }
input[type=range] { width: 100%; accent-color: var(--brass-d); }
details { margin: 0 0 6px; } summary { cursor: pointer; padding: 3px 0; font-weight: 600; }
.chk { display: flex; gap: 6px; align-items: center; font-size: 0.82rem; padding: 1px 0; cursor: pointer; }
.g { display: inline-block; width: 1.2em; text-align: center; font-weight: 700; } .g.exh, .exh { color: var(--exh); } .g.inh, .inh { color: var(--inh); } .g.res { color: var(--res); } .g.en { color: var(--en); }
.note { margin: 2px 0 0; font-size: 0.72rem; color: var(--muted); }
.item { display: flex; align-items: center; gap: 6px; padding: 1px 0 1px 4px; font-size: 0.82rem; border-radius: 4px; }
.item .id { cursor: pointer; flex: 1; font-family: ui-monospace, Menlo, monospace; font-size: 0.78rem; } .item.sel { background: #ecdfc6; } .item .no { color: var(--muted); font-size: 0.72rem; min-width: 1.6em; text-align: right; }
.badge { display: inline-block; font-size: 0.68rem; font-weight: 400; border: 1px solid #b9b0a0; border-radius: 8px; padding: 0 7px; margin-right: 4px; background: var(--card); color: var(--ink); } .badge.ph { background: #dfe7ee; border-color: #7e93a5; } .badge.cand { background: #f1e2c6; border-color: var(--brass-d); }
.muted { color: var(--muted); } table { border-collapse: collapse; width: 100%; font-size: 0.8rem; } td, th { text-align: left; padding: 2px 6px 2px 0; vertical-align: top; border-bottom: 1px solid var(--line); } td.k { font-family: ui-monospace, Menlo, monospace; font-size: 0.76rem; }
td code, td.k { overflow-wrap: anywhere; } td:first-child { white-space: nowrap; padding-right: 10px; }
.issue { padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 0.8rem; cursor: pointer; } .issue b { font-family: ui-monospace, Menlo, monospace; } .issue:hover { background: #f4ecda; } .issue.dec b { color: var(--warn); }
.warn { color: var(--warn); } code { font-family: ui-monospace, Menlo, monospace; font-size: 0.78rem; } #right section { margin-bottom: 14px; }
#tunereadout { font-size: 0.82rem; margin: 2px 0 6px; } #acnotes p, #enotes p, #pnotes p { margin: 0 0 6px; font-size: 0.78rem; }
#energylist { list-style: none; padding-left: 0; margin: 0 0 6px; font-size: 0.8rem; } #energylist li { padding: 2px 0; cursor: pointer; } #energylist li.lit { background: #f5e3bd; border-radius: 3px; }
#transport { position: absolute; left: 8px; right: 8px; bottom: 8px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; background: rgba(255,253,248,0.94); border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px; z-index: 3; }
#tlwrap { position: relative; flex: 1; min-width: 150px; height: 34px; }
#phasebar { position: absolute; left: 0; right: 0; top: 7px; height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--inh) 0, var(--inh) var(--split), var(--exh) var(--split), var(--exh) 100%); opacity: 0.6; }
#timeline { position: absolute; left: 0; right: 0; top: 0; width: 100%; margin: 0; height: 20px; background: transparent; }
#phaselabels { position: absolute; left: 0; right: 0; top: 19px; font-size: 0.66rem; font-weight: 700; display: flex; } #phaselabels .inh { width: var(--split, 40%); } 
#clock { font: 12px ui-monospace, Menlo, monospace; color: var(--muted); min-width: 7.5em; }
.pill { padding: 3px 14px; border-radius: 14px; font-weight: 700; letter-spacing: 0.06em; font-size: 0.78rem; color: #fff; }
.pill.inhale { background: var(--inh); } .pill.inhale::before { content: "◆ "; } .pill.exhale { background: var(--exh); } .pill.exhale::before { content: "● "; }
.pill.energy { background: var(--en); color: var(--ink); font-size: 0.7rem; letter-spacing: 0.01em; font-weight: 600; }
#pn-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 1; }
.pn-label { position: absolute; left: 0; top: 0; font-size: 0.68rem; background: rgba(255,253,248,0.88); border: 1px solid #b9b0a0; border-radius: 4px; padding: 0 5px; white-space: nowrap; margin: -8px 0 0 8px; }
.pn-label.oop { border-style: dashed; color: var(--warn); } .pn-label.en { border-color: var(--en); font-weight: 700; padding: 0 6px; } .pn-label.en.ring { background: rgba(255,244,222,0.92); } .pn-label.en.ph { border-style: dashed; background: rgba(223,231,238,0.94); }
#intro { position: absolute; left: 8px; top: 84px; width: 300px; max-height: calc(100% - 270px); overflow: auto; background: rgba(255,253,248,0.97); border: 1px solid var(--brass); border-radius: 8px; padding: 10px 12px; z-index: 4; font-size: 0.78rem; box-shadow: 0 2px 10px rgba(0,0,0,0.12); }
#intro[hidden] { display: none; } #intro ul { margin: 0 0 8px; padding-left: 16px; } #intro li { margin-bottom: 4px; }
#loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--muted); background: rgba(246,242,234,0.92); z-index: 6; }
#fallback { padding: 16px; max-width: 900px; margin: 0 auto; } #fallback[hidden] { display: none; } .fbimgs img { max-width: 100%; border: 1px solid var(--line); margin: 6px 0; background: #fff; }
body.nowebgl #layout, body.nowebgl #banner { display: none; }
@media (max-width: 1180px) {
  html, body { height: auto; } body { min-height: 100%; }
  #layout { grid-template-columns: 1fr 1fr; grid-template-areas: "stage stage" "left right"; min-height: 0; } #stage { min-height: 0; display: flex; flex-direction: column; }
  #left, #right { border: 0; max-height: none; } #canvas { flex: none; height: 62vh; min-height: 320px; }
  #toolbar { position: static; padding: 6px; } #transport { position: static; margin: 6px; } #intro { position: static; width: auto; max-height: none; margin: 6px; } #pn-labels { display: none; } #layout.focus { grid-template-columns: 1fr 1fr; grid-template-areas: "stage stage" "left right"; } #layout.focus #left, #layout.focus #right { display: block; }
  header#top { flex-wrap: wrap; }
}
@media (max-width: 700px) { #layout { grid-template-columns: 1fr; grid-template-areas: "stage" "left" "right"; } }
@media (pointer: coarse) { button, select, summary { min-height: 44px; } .chk, .item { min-height: 36px; } input[type=range] { min-height: 32px; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
