/* LCD digits: DSEG by keshikan, SIL Open Font License 1.1 (fonts/DSEG-LICENSE.txt). */
@font-face { font-family: "DSEG7"; src: url("../fonts/DSEG7Classic-Bold.woff2") format("woff2"); font-display: block; }
@font-face { font-family: "DSEG14"; src: url("../fonts/DSEG14Classic-Bold.woff2") format("woff2"); font-display: block; }

/* Dark (default): our original palette with Storz & Bickel navy worked in. */
:root {
  --bg: #0f1218; --hero: #141922; --header: #12161e; --text: #f1f2f4; --muted: #9aa3b2;
  --panel: #181c24; --panel-2: #222834; --line: #2a3140;
  --accent: #ff6a00; --accent-ink: #1a0d00; --conn: #ff7a1a;
  --band: linear-gradient(180deg, #0f2459 0%, #0b1b44 100%); --band-ink: #ffffff; --band-card: #15265a; --band-card-ink: #ff8a3d; --band-line: #2a3d7a;
  --nav: #0a1a45; --nav-ink: #7f93c9; --nav-on: #ffffff;
  --lcd-cur: #ff7a1a; --lcd-set: #eef0f4; --tri: #2b3242; --tri-ink: #ffffff; --pill: #2b3242; --pill-ink: #e7e9ee;
  --chronic: #7cbf3f; --heat: #ff8a2a; --ready: #35c46a; --off: #7c838f; --air: #4f8dff; --danger: #ff5d5d;
  --warn-bg: #3a2a12; --warn-line: #7a5420; --radius: 16px; --shadow: 0 4px 16px rgba(0, 0, 0, .35);
  color-scheme: dark;
}
/* Light: follows the official app (white, orange band, navy bar). Declared twice: system + forced. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #ffffff; --hero: #f4f4f4; --header: #ffffff; --text: #373737; --muted: #6d7178;
    --panel: #ffffff; --panel-2: #f1f2f4; --line: #dcdfe3;
    --accent: #ff6600; --accent-ink: #ffffff; --conn: #ff6600;
    --band: #ff6600; --band-ink: #ffffff; --band-card: #ffffff; --band-card-ink: #ff6600; --band-line: #ffb27f;
    --nav: #00298a; --nav-ink: #8ea2dd; --nav-on: #ffffff;
    --lcd-cur: #ff6600; --lcd-set: #373737; --tri: #3a3a3a; --tri-ink: #ffffff; --pill: #3a3a3a; --pill-ink: #ffffff;
    --chronic: #4a8a1f; --heat: #ff6600; --ready: #1c9a4c; --off: #8a919c; --air: #1d5fe0; --danger: #d93a3a;
    --warn-bg: #fff4e2; --warn-line: #f0c27a; --shadow: 0 4px 12px rgba(0, 0, 0, .18);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #ffffff; --hero: #f4f4f4; --header: #ffffff; --text: #373737; --muted: #6d7178;
  --panel: #ffffff; --panel-2: #f1f2f4; --line: #dcdfe3;
  --accent: #ff6600; --accent-ink: #ffffff; --conn: #ff6600;
  --band: #ff6600; --band-ink: #ffffff; --band-card: #ffffff; --band-card-ink: #ff6600; --band-line: #ffb27f;
  --nav: #00298a; --nav-ink: #8ea2dd; --nav-on: #ffffff;
  --lcd-cur: #ff6600; --lcd-set: #373737; --tri: #3a3a3a; --tri-ink: #ffffff; --pill: #3a3a3a; --pill-ink: #ffffff;
  --chronic: #4a8a1f; --heat: #ff6600; --ready: #1c9a4c; --off: #8a919c; --air: #1d5fe0; --danger: #d93a3a;
  --warn-bg: #fff4e2; --warn-line: #f0c27a; --shadow: 0 4px 12px rgba(0, 0, 0, .18);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.45 Roboto, system-ui, -apple-system, "Segoe UI", sans-serif;
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
  -webkit-tap-highlight-color: transparent;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .45; cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

.wrap { max-width: 560px; margin: 0 auto; padding: 16px; }
.stack { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
.center { text-align: center; justify-content: center; }

/* header */
.top { position: sticky; top: 0; z-index: 5; background: var(--header); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top); }
.top-in { max-width: 560px; margin: 0 auto; padding: 10px 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 18px; color: var(--accent); letter-spacing: .2px; }
.brand img { border-radius: 7px; }
.conn { border: 1px solid var(--conn); color: var(--conn); background: transparent; border-radius: 2px; padding: 6px 18px; font-size: 16px; }
.conn:active { background: color-mix(in srgb, var(--conn) 12%, transparent); }
.chips { max-width: 560px; margin: 0 auto; padding: 0 16px 8px; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 4px 12px; font-size: 14px; }
.chip.sel { border-color: var(--accent); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--off); }
.chip.heat .dot { background: var(--heat); } .chip.ready .dot { background: var(--ready); }

/* hero: current temperature, set point, controls */
.hero { background: var(--hero); border-bottom: 1px solid var(--line); }
.hero-in { max-width: 520px; margin: 0 auto; padding: 22px 16px 18px; display: grid; justify-items: center; gap: 14px; }
.lcd { font-family: "DSEG7", ui-monospace, monospace; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 2px; }
.cur { display: flex; align-items: flex-start; gap: 6px; color: var(--off); }
.cur .lcd { font-size: 46px; line-height: 1; }
.cur .lcd-unit { font-size: 26px; font-weight: 700; line-height: 1; }
.cur.heat { color: var(--lcd-cur); } .cur.ready { color: var(--ready); }

.setrow { width: 100%; display: grid; grid-template-columns: 72px 1fr 72px; align-items: center; gap: 8px; }
.tri { width: 72px; height: 58px; border: 0; background: transparent; padding: 0; touch-action: none; user-select: none; -webkit-user-select: none; }
.tri svg { width: 100%; height: 100%; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .3)); }
.tri path { fill: var(--tri); stroke: var(--tri); stroke-width: 12; stroke-linejoin: round; }
.tri rect { fill: var(--tri-ink); }
.tri:active svg { transform: translateY(2px); filter: none; }
.setbox { justify-self: center; display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 14px; border: 2px solid transparent; cursor: text; }
.setbox:focus-within { border-color: var(--accent); }
.lcd.set {
  width: 3.3ch; font-size: 52px; line-height: 1.1; color: var(--lcd-set); background: transparent; border: 0; padding: 0;
  text-align: right; caret-color: var(--accent); outline: none;
}

.moderow { width: 100%; display: grid; grid-template-columns: 96px 1fr 96px; align-items: center; gap: 8px; }
.lcd14 { font-family: "DSEG14", ui-monospace, monospace; font-weight: 700; font-size: 26px; text-align: center; color: var(--lcd-set); letter-spacing: 0; white-space: nowrap; }
.pillbtn {
  height: 40px; border: 0; border-radius: 18px 8px 18px 8px; background: var(--pill); color: var(--pill-ink);
  font: 700 13px/1 Georgia, "Times New Roman", serif; letter-spacing: .5px; box-shadow: 0 3px 5px rgba(0, 0, 0, .3); transition: box-shadow .2s, background .2s;
}
.pillbtn:active { transform: translateY(1px); box-shadow: none; }
.pillbtn.heat.on, .pillbtn.boost.on { background: var(--heat); color: #fff; box-shadow: 0 0 14px color-mix(in srgb, var(--heat) 70%, transparent); }
.pillbtn.air.on { background: var(--air); color: #fff; box-shadow: 0 0 14px color-mix(in srgb, var(--air) 70%, transparent); }
.linkbtn { border: 0; background: transparent; color: var(--accent); font-weight: 600; padding: 2px 8px; }
.status { font-size: 14px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.status.heat { color: var(--heat); } .status.ready { color: var(--ready); }

/* Venty boost offsets */
.boostbox { width: 100%; display: grid; gap: 10px; justify-items: center; }
.boostrow { display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: center; color: var(--muted); font-size: 14px; }
.boostrow label { display: inline-flex; align-items: center; gap: 4px; }
.num.boost { width: 3.4em; text-align: center; }

/* temperature chips (sessions, Venty) */
.tchips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.tchip {
  min-width: 64px; border: 2px solid var(--accent); background: transparent; color: var(--accent); border-radius: 999px;
  padding: 5px 12px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.tchip.on { background: var(--accent); color: var(--accent-ink); }
.tchip.done { opacity: .45; }

/* orange (light) / navy (dark) band */
.band { background: var(--band); color: var(--band-ink); padding: 18px 16px 26px; }
.band > * { max-width: 520px; margin-left: auto; margin-right: auto; }
.band h2 { text-align: center; font-size: 16px; font-weight: 500; letter-spacing: .5px; margin: 0 0 14px; }
.band-note { text-align: center; font-size: 13px; opacity: .85; margin-top: 12px; }
.run, .preset {
  display: grid; gap: 12px; background: var(--band-card); color: var(--text); border-radius: 18px; padding: 16px; box-shadow: var(--shadow);
}
.run-name { color: var(--band-card-ink); font-size: 20px; text-align: center; }
.run-line { text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; }
.run-line.big { font-size: 20px; color: var(--text); }
.run-line b { color: var(--band-card-ink); }
.run .sel { justify-self: center; color: var(--band-card-ink); font-size: 18px; }
.presets { display: grid; gap: 12px; }
.preset { border: 2px solid transparent; text-align: left; grid-template-columns: 1fr auto; align-items: center; }
.preset strong { color: var(--band-card-ink); font-size: 18px; font-weight: 500; }
.preset span { color: var(--muted); font-variant-numeric: tabular-nums; }
.preset.on { border-color: var(--accent); }

/* cards */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); margin: 0 0 8px; font-weight: 700; }
.card.center h2 { font-size: 18px; text-transform: none; letter-spacing: 0; color: var(--text); }

.num, .txt, .sel { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; font-variant-numeric: tabular-nums; }
.num { width: 4.2em; text-align: center; }
.txt { flex: 1 1 0; width: 0; min-width: 0; }

.btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.run .btns { margin-top: 0; }
.btn { border: 1px solid var(--line); background: var(--panel-2); border-radius: 12px; padding: 10px 16px; font-weight: 600; text-decoration: none; display: inline-block; color: var(--text); }
.btn.sm { padding: 6px 12px; font-size: 14px; border-radius: 10px; }
.btn.big { padding: 13px 26px; font-size: 17px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.danger { color: var(--danger); }
.btn:active { transform: translateY(1px); }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--panel-2); }
.seg-btn { border: 0; background: transparent; padding: 7px 12px; font-weight: 600; color: var(--muted); font-size: 14px; }
.seg-btn + .seg-btn { border-left: 1px solid var(--line); }
.seg-btn.on { background: var(--accent); color: var(--accent-ink); }

.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.card > h2 + .row, .card > h2 + p + .row { border-top: 0; }
.row.col { flex-direction: column; align-items: stretch; gap: 4px; }
.row small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.row > span:first-child { min-width: 0; }
.row-head { display: flex; align-items: center; gap: 8px; }
.pill-val { background: var(--panel-2); border-radius: 6px; padding: 1px 8px; font-size: 14px; font-variant-numeric: tabular-nums; }
.range { width: 100%; accent-color: var(--accent); height: 28px; }

.switch { appearance: none; width: 46px; height: 28px; border-radius: 99px; background: var(--line); position: relative; flex: none; cursor: pointer; transition: background .2s; margin: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(18px); }

.editor { padding: 12px 0; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.editor-top { display: flex; gap: 8px; align-items: center; }
.tedits { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tedit { display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--line); background: var(--panel-2); border-radius: 10px; padding: 0 6px 0 2px; color: var(--muted); }
.tedit .num { border: 0; background: transparent; padding: 7px 2px; width: 3.2em; color: var(--text); }
.x { border: 0; background: transparent; color: var(--muted); font-size: 14px; padding: 2px 4px; line-height: 1; }
.x:hover { color: var(--danger); }
.unit { color: var(--muted); }

.muted { color: var(--muted); }
.small { font-size: 13px; }
p { margin: 6px 0 0; }
.notice { border: 1px solid var(--warn-line); background: var(--warn-bg); border-radius: var(--radius); padding: 14px 16px; }
.notice p { margin-top: 4px; }

.info { margin: 0; }
.info > div { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.info > div:first-child { border-top: 0; }
.info dt { color: var(--text); }
.info dd { margin: 0; }
.badge { background: #6c757d; color: #fff; border-radius: 99px; padding: 2px 10px; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* toasts */
.toasts { position: fixed; left: 0; right: 0; bottom: calc(80px + env(safe-area-inset-bottom)); display: grid; gap: 8px; justify-items: center; padding: 0 16px; z-index: 20; pointer-events: none; }
.toast {
  pointer-events: auto; max-width: 528px; width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; box-shadow: var(--shadow); animation: rise .2s ease;
}
.toast.err { border-color: var(--danger); } .toast.warn { border-color: var(--warn-line); }
.toast-btn { border: 0; background: transparent; color: var(--accent); font-weight: 700; white-space: nowrap; }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }

/* bottom nav (navy, as in the official app) */
.nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 10; display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--nav); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.nav button, .nav a {
  border: 0; background: transparent; display: grid; justify-items: center; gap: 2px; padding: 6px 0;
  color: var(--nav-ink); font-size: 12px; font-weight: 600; text-decoration: none;
}
.nav svg { width: 26px; height: 26px; fill: currentColor; }
.nav .on { color: var(--nav-on); }

@media (max-width: 360px) {
  .setrow { grid-template-columns: 56px 1fr 56px; } .tri { width: 56px; height: 46px; }
  .lcd.set { font-size: 42px; } .moderow { grid-template-columns: 80px 1fr 80px; } .lcd14 { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* HEAT / AIR on-off chips in the sessions card */
.onoff { display: flex; justify-content: center; gap: 10px; }
.onchip {
  display: inline-flex; align-items: center; gap: 8px; min-width: 116px; justify-content: center;
  border: 2px solid var(--line); background: var(--panel-2); color: var(--text); border-radius: 999px; padding: 7px 14px; font-weight: 700; letter-spacing: .4px;
}
.onchip b { font-weight: 800; color: var(--muted); }
.onchip .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--off); }
.onchip.heat.on { border-color: var(--heat); } .onchip.heat.on .dot { background: var(--heat); box-shadow: 0 0 8px var(--heat); } .onchip.heat.on b { color: var(--heat); }
.onchip.air.on { border-color: var(--air); } .onchip.air.on .dot { background: var(--air); box-shadow: 0 0 8px var(--air); } .onchip.air.on b { color: var(--air); }

/* one-of-many "Selected" chip on the Sessions tab (acts as a radio button) */
.selchip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; border: 2px solid var(--line); background: transparent;
  color: var(--muted); border-radius: 999px; padding: 5px 12px 5px 8px; font-size: 14px; font-weight: 700;
}
.selchip .ring { width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; display: grid; place-items: center; }
.selchip.on { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.selchip.on .ring::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.band { padding-top: 22px; }
/* a typed value beyond the device's range: shown red, snapped to the limit on Enter */
.over, .lcd.set.over { color: var(--danger) !important; }
.lcd.set.wide { font-size: 40px; width: 4.3ch; }   /* same box width as 3 digits at 52px */
@media (max-width: 360px) { .lcd.set.wide { font-size: 32px; } }
/* Venty: no live temperature, so the set point carries the state (as the official app does) */
.setbox[data-state="off"] .lcd.set { color: var(--off); }
.setbox[data-state="heat"] .lcd.set { color: var(--lcd-cur); }
.setbox[data-state="ready"] .lcd.set { color: var(--ready); }

/* Volcano stopwatch + 10 s cycle widgets (below the sessions card) */
.widgets { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.widget { background: var(--band-card); color: var(--text); border-radius: 14px; padding: 7px 12px 8px; box-shadow: var(--shadow); display: grid; gap: 2px; min-width: 0; }
.wlabel { font-size: 11px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); }
.wrow { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 32px; }
.wtime { font-size: 20px; color: var(--lcd-set); letter-spacing: 0; white-space: nowrap; }
.widget.cycle .wrow { justify-content: center; }
.widget.cycle .wtime { font-size: 22px; }
.wbtns { display: inline-flex; gap: 6px; flex: none; }
.wbtn { width: 32px; height: 32px; padding: 0; border-radius: 50%; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); display: grid; place-items: center; }
.wbtn svg { width: 18px; height: 18px; fill: currentColor; }
.wbtn:active { transform: translateY(1px); }
.widget.flash { animation: wrapflash .5s ease; }
@keyframes wrapflash { 0% { box-shadow: 0 0 0 3px var(--accent); } 100% { box-shadow: var(--shadow); } }
@media (max-width: 380px) { .wtime { font-size: 16px; } .widget.cycle .wtime { font-size: 18px; } .wbtn { width: 28px; height: 28px; } }

/* Chronic Saver: standby button beside Next, and the status line while holding */
.btn.icon { display: inline-grid; place-items: center; padding: 0; width: 52px; }
.btn.big.icon { height: 50px; }
.btn.icon svg { width: 22px; height: 22px; fill: currentColor; }
.btn.standby.on { background: var(--air); border-color: var(--air); color: #fff; box-shadow: 0 0 12px color-mix(in srgb, var(--air) 60%, transparent); }
.status.saver { color: var(--air); }
.inline { display: inline-flex; align-items: center; gap: 6px; flex-wrap: nowrap; }

/* the words "Chronic Saver": leafy green everywhere they appear (not the description text) */
.chronic { color: var(--chronic); font-weight: 700; }

/* "Connecting" screen: from picking a device in the browser's list until it is ready */
.connecting { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 16px; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(6px); }
.conn-card { width: min(360px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 26px 22px 20px; box-shadow: var(--shadow); display: grid; justify-items: center; gap: 8px; text-align: center; }
.spinner { width: 48px; height: 48px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--accent); animation: spin .9s linear infinite; margin-bottom: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }
.conn-title { font-size: 19px; font-weight: 700; }
.conn-name { color: var(--muted); font-size: 14px; min-height: 1.2em; }
.conn-steps { list-style: none; padding: 0; margin: 8px 0 10px; display: grid; gap: 6px; text-align: left; color: var(--muted); font-size: 15px; }
.conn-steps li::before { content: "○"; display: inline-block; width: 1.4em; }
.conn-steps li.now { color: var(--text); font-weight: 600; }
.conn-steps li.now::before { content: "●"; color: var(--accent); }
.conn-steps li.done::before { content: "✓"; color: var(--ready); }
@media (prefers-reduced-motion: reduce) { .spinner { animation: spin 2.5s linear infinite !important; } }
.nav button:disabled { opacity: .35; cursor: not-allowed; }
.widget.cycle.off .wtime, .widget.cycle.off .wlabel { opacity: .4; }

/* ======== Device panels, drawn after the real hardware (always dark, in both themes) ======== */
.vpanel, .ypanel {
  --dev-line: #d9dbe0; --dev-dim: #6b7079; --dev-orange: #ff7a1a;
  width: 100%; max-width: 460px; border-radius: 24px; padding: 14px 12px;
  background: linear-gradient(160deg, #2b2d32 0%, #17181b 70%); border: 1px solid #3a3d44;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 6px 18px rgba(0, 0, 0, .35); color: #f2f3f5;
}
/* Volcano: [-] display [+] / [HEAT] display [AIR] */
.vpanel { display: grid; grid-template-columns: 70px 1fr 70px; grid-template-areas: "minus disp plus" "heat disp air"; gap: 8px 10px; align-items: center; }
/* direct children only: the live-temperature box inside the display also carries "heat" while heating */
.vpanel > .minus { grid-area: minus; } .vpanel > .plus { grid-area: plus; }
.vpanel > .heat { grid-area: heat; } .vpanel > .air { grid-area: air; }
.vdisp { grid-area: disp; background: #0d0e10; border-radius: 14px; padding: 10px 10px 8px; box-shadow: inset 0 2px 8px rgba(0, 0, 0, .8); display: grid; justify-items: center; gap: 2px; }
.vdisp .cur { color: var(--dev-dim); }
.vdisp .cur .lcd { font-size: 38px; }
.vdisp .cur .lcd-unit { font-size: 20px; }
.vdisp .cur.heat, .vdisp .cur.ready { color: var(--dev-orange); }
.vset { display: flex; align-items: center; gap: 6px; }
.pwr { width: 18px; height: 18px; color: var(--dev-dim); flex: none; }
.pwr svg { width: 100%; height: 100%; fill: currentColor; }
.pwr.on { color: var(--dev-orange); filter: drop-shadow(0 0 4px var(--dev-orange)); }
.vpanel .setbox, .ypanel .setbox { padding: 2px 4px; gap: 6px; }
.vpanel .lcd.set { color: #f4f4f4; font-size: 44px; }

/* outlined triangles, as on the Volcano's front */
.tri.volcano { width: 66px; height: 54px; }
.tri.volcano svg { filter: none; }
.tri.volcano path { fill: rgba(255, 255, 255, .03); stroke: var(--dev-line); stroke-width: 4; stroke-linejoin: round; }
.tri.volcano rect { fill: var(--dev-line); }
.tri.volcano:active path { fill: rgba(255, 255, 255, .12); }

/* outlined HEAT / AIR buttons */
.vbtn {
  height: 30px; border: 1.5px solid var(--dev-line); background: transparent; color: var(--dev-line);
  border-radius: 14px 5px 14px 5px; font: 600 11px/1 system-ui, "Segoe UI", sans-serif; letter-spacing: .8px; padding: 0 6px;
}
.vbtn:active { background: rgba(255, 255, 255, .1); }
.vbtn.heat.on { border-color: var(--dev-orange); color: var(--dev-orange); box-shadow: 0 0 10px rgba(255, 122, 26, .55); }
.vbtn.air.on { border-color: #4f8dff; color: #4f8dff; box-shadow: 0 0 10px rgba(79, 141, 255, .55); }

/* Venty: [orange -] green display [orange +] */
.ypanel { display: grid; grid-template-columns: 64px 1fr 64px; align-items: center; gap: 10px; }
.tri.venty { width: 62px; height: 52px; }
.tri.venty svg { filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .5)); }
.tri.venty path { fill: #f07a1e; stroke: #f07a1e; stroke-width: 10; stroke-linejoin: round; }
.tri.venty rect { fill: #7a3306; }
.ydisp { background: #070b08; border-radius: 12px; padding: 10px 10px 8px; box-shadow: inset 0 2px 8px rgba(0, 0, 0, .9); display: grid; justify-items: center; gap: 6px; }
.ydisp .lcd.set { font-size: 46px; }
.ydisp .setbox[data-state="off"] .lcd.set { color: #3f6a50; }
.ydisp .setbox[data-state="heat"] .lcd.set { color: #ffb03a; }
.ydisp .setbox[data-state="ready"] .lcd.set { color: #43ff8c; text-shadow: 0 0 8px rgba(67, 255, 140, .45); }
.ystatus { display: flex; align-items: center; gap: 8px; color: #43ff8c; font-size: 12px; }
.batt { display: inline-flex; gap: 2px; padding: 2px; border: 1.5px solid #43ff8c; border-radius: 3px; position: relative; }
.batt::after { content: ""; position: absolute; right: -5px; top: 3px; width: 3px; height: 6px; background: #43ff8c; border-radius: 0 2px 2px 0; }
.batt i { width: 5px; height: 8px; background: #1b3a26; border-radius: 1px; }
.batt i.on { background: #43ff8c; }
.batt-pct { min-width: 2.5em; }
.bt { width: 14px; height: 14px; color: #43ff8c; } .bt svg { width: 100%; height: 100%; fill: currentColor; }
.tchip.static { cursor: default; }

@media (max-width: 380px) {
  .vpanel { grid-template-columns: 58px 1fr 58px; padding: 12px 8px; gap: 8px 6px; }
  .tri.volcano { width: 56px; height: 46px; }
  .vpanel .lcd.set { font-size: 36px; } .vdisp .cur .lcd { font-size: 30px; }
  .ypanel { grid-template-columns: 54px 1fr 54px; } .tri.venty { width: 52px; height: 44px; } .ydisp .lcd.set { font-size: 38px; }
}

/* session-name button on the Volcano card, and the session picker it opens (must be answered) */
.run-name.pick { justify-self: center; background: none; border: 0; padding: 2px 8px; border-radius: 8px; cursor: pointer; font: inherit; font-size: 20px; color: var(--band-card-ink); }
.run-name.pick:hover { background: color-mix(in srgb, var(--band-card-ink) 12%, transparent); }
.run-name .caret { font-size: 14px; opacity: .8; }
.modal { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 16px; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(6px); }
.modal-card { width: min(380px, 100%); max-height: 80vh; overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 18px; box-shadow: var(--shadow); }
.modal-card h2 { margin: 0 0 12px; font-size: 17px; text-align: center; }
.modal-list { display: grid; gap: 8px; }
.modal-item { display: grid; gap: 2px; text-align: left; padding: 12px 14px; border-radius: 14px; border: 2px solid var(--line); background: var(--panel-2); color: var(--text); }
.modal-item strong { font-weight: 600; } .modal-item span { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.modal-item.on { border-color: var(--accent); }
.modal-item:hover { border-color: var(--accent); }
.paren { color: var(--muted); font-size: 13px; }
/* Venty: all (up to 5) sessions listed on the main screen, compact enough to fit without scrolling */
.presets { gap: 8px; }
.presets .preset { padding: 9px 14px; border-radius: 14px; gap: 8px; }
.presets .preset strong { font-size: 16px; }
.presets .preset span { font-size: 14px; }
.band:has(.presets) { padding-top: 14px; padding-bottom: 14px; }
.band:has(.presets) .band-note { margin-top: 8px; font-size: 12px; }
/* Venty active-session name above its display (same look as the Volcano's session name) */
.venty-name { margin-bottom: -4px; }
.venty-name:disabled { opacity: .6; cursor: default; }
.demo-btns { display: grid; gap: 8px; justify-content: center; margin-top: 12px; } .demo-btns .btn { min-width: 210px; }

/* ---- Volcano display window, as on the device: [icons] [digits] [unit] [°C/°F switch] ----
   The .cur and .setbox wrappers drop out of layout (display: contents) so both temperatures share one grid:
   the units stack in one column and both sets of digits end flush against it. */
.vdisp { grid-template-columns: 16px auto auto; grid-template-rows: auto auto; column-gap: 8px; row-gap: 0;
  justify-content: center; justify-items: start; align-items: center; padding: 8px 12px; }
.vdisp .cur, .vdisp .setbox { display: contents; }
.vdisp .bt-ic { grid-column: 1; grid-row: 1; }
.vdisp .pwr { grid-column: 1; grid-row: 2; }
.vdisp .cur .lcd { grid-column: 2; grid-row: 1; justify-self: end; font-size: 40px; line-height: 1.1; }
.vdisp .lcd.set { grid-column: 2; grid-row: 2; justify-self: end; font-size: 40px; line-height: 1.1; color: #f4f4f4; }
.vdisp .lcd.set.wide { font-size: 31px; width: 4.3ch; }
.vdisp .cur .lcd-unit, .vdisp .set-unit { align-self: start; margin-top: 5px; font-size: 18px; font-weight: 700; line-height: 1; }
.vdisp .cur .lcd-unit { grid-column: 3; grid-row: 1; }
.vdisp .set-unit { grid-column: 3; grid-row: 2; color: #f4f4f4; }
/* icons: always white (Bluetooth over power), as on the device */
.vicon, .vdisp .pwr, .vdisp .pwr.on { width: 16px; height: 16px; color: #fff; filter: none; display: grid; place-items: center; }
.vicon svg { width: 100%; height: 100%; fill: currentColor; }
/* not heating: the set point is ~80% dimmed (almost off, still faintly lit); full brightness while it is being edited */
.vdisp[data-heat="off"] .lcd.set, .vdisp[data-heat="off"] .set-unit { opacity: .22; transition: opacity .2s; }
.vdisp[data-heat="off"]:focus-within .lcd.set, .vdisp[data-heat="off"]:focus-within .set-unit { opacity: 1; }
.vdisp .lcd.set:focus { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
@media (max-width: 380px) {
  .vdisp { column-gap: 5px; padding: 8px 8px; }
  .vdisp .cur .lcd, .vdisp .lcd.set { font-size: 32px; } .vdisp .lcd.set.wide { font-size: 25px; }
  .vdisp .cur .lcd-unit, .vdisp .set-unit { font-size: 15px; }
}

/* ---- Volcano display brightness (2026-10-20) ----
   The live temperature is always orange and never faded. --lit follows the Volcano's own LED
   brightness setting and --dim (dimmed set point) is an eighth of it; both are set from app.js. */
.vdisp .cur, .vdisp .cur.off, .vdisp .cur.heat, .vdisp .cur.ready { color: var(--dev-orange); }
.vdisp .cur .lcd, .vdisp .cur .lcd-unit, .vdisp .lcd.set, .vdisp .set-unit, .vdisp .vicon { opacity: var(--lit, 1); transition: opacity .25s; }
.vdisp[data-heat="off"] .lcd.set, .vdisp[data-heat="off"] .set-unit { opacity: var(--dim, .12); }
.vdisp[data-heat="off"]:focus-within .lcd.set, .vdisp[data-heat="off"]:focus-within .set-unit { opacity: var(--lit, 1); }
/* Only the two temperatures (digits + their unit labels) dim or follow the LED brightness.
   The Bluetooth / power icons and the °C|°F switch always stay at full brightness. */
.vdisp .vicon { opacity: 1; }
/* no live reading (or 0, a cold Volcano): the reading and its unit go dark, as on the device (space kept) */
.vdisp[data-cool="blank"] .cur .lcd, .vdisp[data-cool="blank"] .cur .lcd-unit { visibility: hidden; }

/* ---- Volcano icon column (2026-10-20): Bluetooth, power, and the air bars, stacked down the left of the display ---- */
.vdisp .vicons { grid-column: 1; grid-row: 1 / 3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; }
.vdisp .vicons .vicon { grid-column: auto; grid-row: auto; }
/* air bars: hidden unless the pump runs; then they build 1 (narrow, bottom) -> 1-2 -> 1-2-3 over ~1 s and repeat */
.air-bars { visibility: hidden; }
.air-bars.on { visibility: visible; }
.air-bars rect { fill: currentColor; }
.air-bars.on .b2 { animation: airbar2 1.2s steps(1, end) infinite; }
.air-bars.on .b3 { animation: airbar3 1.2s steps(1, end) infinite; }
@keyframes airbar2 { 0% { opacity: 0; } 33.3% { opacity: 1; } 100% { opacity: 1; } }
@keyframes airbar3 { 0% { opacity: 0; } 66.6% { opacity: 1; } 100% { opacity: 1; } }

/* AIR button while the air runs: the device's light blue, filled, with a white border and white label */

/* icons 50% larger (16 -> 24 px), 2026-10-20 */
.vdisp { grid-template-columns: 24px auto auto; }
.vicon, .vdisp .pwr, .vdisp .pwr.on, .vdisp .vicons .vicon { width: 24px; height: 24px; }
.vdisp .vicons { gap: 4px; }
@media (max-width: 380px) { .vdisp { grid-template-columns: 20px auto auto; } .vicon, .vdisp .pwr, .vdisp .pwr.on, .vdisp .vicons .vicon { width: 20px; height: 20px; } }
/* air bars 25% slower (1.2 s -> 1.5 s per 1 / 1-2 / 1-2-3 cycle), 2026-10-20 */
.air-bars.on .b2, .air-bars.on .b3 { animation-duration: 1.5s; }
/* air bars: 0 -> 1 -> 1-2 -> 1-2-3, 0.5 s per step (2 s cycle), 2026-10-20 */
.air-bars.on .b1 { animation: airbar4-1 2s steps(1, end) infinite; }
.air-bars.on .b2 { animation: airbar4-2 2s steps(1, end) infinite; }
.air-bars.on .b3 { animation: airbar4-3 2s steps(1, end) infinite; }
@keyframes airbar4-1 { 0% { opacity: 0; } 25% { opacity: 1; } 100% { opacity: 1; } }
@keyframes airbar4-2 { 0% { opacity: 0; } 50% { opacity: 1; } 100% { opacity: 1; } }
@keyframes airbar4-3 { 0% { opacity: 0; } 75% { opacity: 1; } 100% { opacity: 1; } }

/* "Remember this device" (2026-10-20): the flag hint under the row, when the browser cannot reconnect at page open */
.remember-note { display: block; margin: -2px 0 10px; line-height: 1.35; }

/* ---- unit labels are the °C/°F switch (2026-10-21); the separate switch is gone ----
   Plain text that looks exactly like the label; a little padding makes it an easier target. Hover / keyboard focus
   lights it to full brightness, so even the dimmed set-point unit (heat off) shows what is being tapped. */
.unit-tap { background: none; border: 0; padding: 2px 4px; margin: -2px -4px; font: inherit; color: inherit; cursor: pointer; border-radius: 6px; -webkit-tap-highlight-color: transparent; }
.vdisp .cur .unit-tap { color: inherit; font-size: 18px; font-weight: 700; line-height: 1; }
.vdisp .unit-tap:hover, .vdisp .unit-tap:focus-visible { opacity: var(--lit, 1); }
.unit-tap:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
/* Venty: its unit sits after the set point, coloured with it */
.ydisp .set-unit { align-self: flex-start; margin-top: 6px; font-size: 20px; font-weight: 700; line-height: 1; }
.ydisp .setbox[data-state="off"] .set-unit { color: #3f6a50; }
.ydisp .setbox[data-state="heat"] .set-unit { color: #ffb03a; }
.ydisp .setbox[data-state="ready"] .set-unit { color: #43ff8c; }
@media (max-width: 380px) { .vdisp .cur .unit-tap { font-size: 15px; } .ydisp .set-unit { font-size: 17px; } }

/* ---- display icons are controls (2026-10-23): Bluetooth = info / disconnect, power = heat, air bars = air ---- */
.icon-btn { background: none; border: 0; padding: 0; margin: 0; color: inherit; font: inherit; display: grid; place-items: center; border-radius: 6px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.icon-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* power: white with the heat off, shading to the display orange as the Volcano goes from 0 °C to its set point */
.vdisp .vicons .pwr-btn .pwr { color: color-mix(in srgb, var(--dev-orange) var(--heat-pct, 0%), #fff); transition: color .6s; }
.vdisp .vicons .pwr-btn.full .pwr { filter: drop-shadow(0 0 4px var(--dev-orange)); }
/* air: the bars' spot stays clickable while they're hidden; hovering shows them faintly */
.air-btn:hover .air-bars:not(.on), .air-btn:focus-visible .air-bars:not(.on) { visibility: visible; opacity: .35; }
/* device info: the Bluetooth popover, and the same table in the disconnect question */
.devpop { position: fixed; z-index: 40; min-width: 220px; max-width: min(320px, calc(100vw - 16px)); padding: 10px 12px; border-radius: 12px;
  background: var(--panel); color: var(--text); border: 1px solid var(--line); box-shadow: var(--shadow); pointer-events: none; font-size: 13px; }
.devpop-title { font-weight: 700; margin-bottom: 6px; }
.devpop-hint { margin-top: 6px; color: var(--muted); font-size: 12px; }
.devinfo { width: 100%; border-collapse: collapse; font-size: 13px; }
.devinfo th { text-align: left; font-weight: 500; color: var(--muted); padding: 4px 12px 4px 0; white-space: nowrap; }
.devinfo td { text-align: right; font-variant-numeric: tabular-nums; padding: 4px 0; overflow-wrap: anywhere; }
.devinfo tr + tr th, .devinfo tr + tr td { border-top: 1px solid var(--line); }
.modal-card .devinfo { margin: 2px 0 14px; }
.modal-card .btns.center { justify-content: center; }

/* "Remember this device?" question (2026-11-02) */
.modal-card p { margin: 0 0 10px; }
.modal-check { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 4px 0 14px; color: var(--muted); font-size: 14px; cursor: pointer; }
.modal-check input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }

/* ---- Volcano session player (2026-11-07): Winamp-style playlist left, transport right ---- */
/* the playlist column is as wide as its rows (the gap before the marker was halved, 72 -> 36 px, user 2026-11-07) */
.player { display: grid; grid-template-columns: max-content 1fr; gap: 12px; align-items: stretch; }
/* the playlist window: black, white rows; the selected row is orange text with no bar (user, 2026-11-07) */
.playlist { margin: 0; padding: 4px; background: #000; border: 1px solid #3a4a3a; border-radius: 6px; max-height: 206px; overflow-y: auto;
  font: 600 15px/1.2 ui-monospace, Consolas, "Courier New", monospace; box-shadow: inset 0 0 0 1px #000, inset 0 2px 6px rgba(0, 0, 0, .8); }
.pl-row { width: 100%; display: flex; gap: 6px; align-items: baseline; padding: 4px 6px; border: 0; border-radius: 2px; background: transparent;
  color: #fff; text-align: left; font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; user-select: none; }
.pl-row .pl-n { min-width: 2.4ch; text-align: right; opacity: .85; }
.pl-row { white-space: nowrap; }
.pl-row .pl-mark svg { width: 13px; height: 13px; fill: #7cbf3f; }
.now .np-leaf svg { width: 1em; height: 1em; vertical-align: -2px; fill: var(--chronic); }
.pl-row .pl-mark { flex: none; margin-left: auto; padding-left: 30px; width: 43px; box-sizing: border-box; display: flex; justify-content: center; align-items: center; font-size: 11px; }

.pl-row:hover { background: #161a20; }
.pl-row.sel { color: #ff7a1a; } /* the display orange (--dev-orange only exists inside the device panels) */
.pl-row:focus-visible { outline: 1px dotted #a9b8ff; outline-offset: -1px; }
.deck { display: grid; align-content: center; gap: 12px; min-width: 0; }
.now { text-align: center; font-size: 17px; font-variant-numeric: tabular-nums; color: var(--text); }
.now b { color: var(--band-card-ink); }
.transport { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.tp { height: 50px; display: grid; place-items: center; padding: 0; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); }
.tp svg { width: 24px; height: 24px; fill: currentColor; }
.tp:hover { border-color: var(--accent); }
.tp.play { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.tp:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 430px) {
  .player { gap: 10px; }
  .transport { grid-template-columns: repeat(2, 1fr); }
  .tp { height: 44px; }
}
