/* Bagpipe App suite tokens. suite.css is loaded LAST on every page, so these win over each tool's own :root.
   One palette for every page; each tool's accent is its icon colour (body[data-tool]). */
:root {
  color-scheme: dark;
  --s-bg: #0d1117; --s-bar: #11151c; --s-panel: #161b22; --s-panel2: #1d232c; --s-line: #30363d;
  --s-fg: #e6edf3; --s-mut: #8b949e; --s-ok: #3fb950; --s-warn: #d29922; --s-bad: #f85149;
  --s-r: 14px; --s-r-btn: 10px;
  --tool: #f5c518; --tool-ink: #1d2b5c;
  /* every alias the tools use, mapped onto the one palette */
  --bg: var(--s-bg); --panel: var(--s-panel); --card: var(--s-panel); --card2: var(--s-panel2);
  --line: var(--s-line); --border: var(--s-line); --fg: var(--s-fg); --text: var(--s-fg);
  --mut: var(--s-mut); --muted: var(--s-mut); --dim: var(--s-mut);
  --good: var(--s-ok); --ok: var(--s-ok); --warn: var(--s-warn); --bad: var(--s-bad); --danger: var(--s-bad);
  --accent: var(--tool); --acc: var(--tool);
}
body[data-tool=gauge]   { --tool: #e08a0b; --tool-ink: #1b1206; }
body[data-tool=chanter] { --tool: #24945a; --tool-ink: #ffffff; }
body[data-tool=drones]  { --tool: #2a66c9; --tool-ink: #ffffff; }
/* Band (B1 icon #6b3fa8) and Admin (A1 icon #4f5b6b): lifted a little so links stay readable on the dark background */
body[data-tool=band], body[data-tool=band-admin] { --tool: #8a5cd0; --tool-ink: #ffffff; }
body[data-tool=site-admin] { --tool: #7d8ba0; --tool-ink: #ffffff; }
.suiteGroup .area-band, .suiteGroup .area-band-admin { color: #b597ec; } .suiteGroup .area-site-admin { color: #aab6c6; }
.suiteGroup a[hidden] { display: none !important; }
html, body { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 15px; line-height: 1.4; }

/* Buttons: one shape and size everywhere; .primary takes the tool accent. */
button, .btn, a.btnlink { border-radius: var(--s-r-btn); }
button.primary, .btn.primary, .card button.primary { background: var(--tool); border-color: var(--tool); color: var(--tool-ink); font-weight: 600; }
.tabs a.on { background: var(--tool); border-color: var(--tool); color: var(--tool-ink); }
a { color: var(--tool); }
/* status pills */
.pill { font-size: 12px; padding: 3px 9px; border-radius: 999px; background: var(--s-panel2); border: 1px solid var(--s-line); color: var(--s-fg); white-space: nowrap; text-decoration: none; }
/* cards: one radius */
.card, .panel, .chart-card, .readout-card, .gauge-card, .view, body[data-tool=chanter] main section, .tool { border-radius: var(--s-r); }
/* empty / error states */
.empty { color: var(--s-mut); text-align: center; padding: 18px 10px; font-size: 14px; }
.errbox { color: #ffd7d7; background: #3a1c1c; border: 1px solid #a33; border-radius: var(--s-r-btn); padding: 10px 12px; font-size: 14px; }

/* Shared header: [icon] Bold regular ............ [extras] [☰] */
header.suitebar { position: sticky; top: 0; z-index: 6; max-width: none; display: flex; align-items: center; gap: 8px; box-sizing: border-box;
  min-height: 56px; padding: calc(7px + env(safe-area-inset-top)) 12px 7px; background: var(--s-bar); border-bottom: 1px solid var(--s-line); }
header.suitebar > .brand { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 0; }
header.suitebar .status, header.suitebar .who { display: flex; gap: 6px; align-items: center; flex: none; }
header.suitebar select { min-height: 40px; padding: 6px 10px; }
.suite-menu-btn, header.suitebar .menuBtn { flex: none; width: 42px; height: 40px; min-height: 40px; padding: 0; display: inline-grid; place-items: center;
  font-size: 19px; line-height: 1; border-radius: var(--s-r-btn); background: var(--s-panel2); border: 1px solid var(--s-line); color: var(--s-fg); }
/* the tuners pad their body sideways; the header still runs edge to edge */
body[data-tool=chanter] { padding-top: 0; }
body[data-tool=chanter] > header.suitebar { margin: 0 -10px; }
body[data-tool=drones] { padding-top: 0; }
body[data-tool=drones] > header.suitebar { margin: 0 -12px; }
@media (min-width: 1300px) { body[data-tool=chanter] > header.suitebar, body[data-tool=drones] > header.suitebar { margin-left: 0; margin-right: 0; border-radius: 0 0 var(--s-r) var(--s-r); } }

/* Shared ☰ footer group (shared/suite-menu.js): All tools, Account & band, Sign out. */
.suiteGroup a, .suiteGroup button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 8px 12px; box-sizing: border-box;
  font: inherit; font-size: 15px; text-align: left; text-decoration: none; color: var(--s-fg); background: var(--s-panel2); border: 1px solid var(--s-line); border-radius: var(--s-r-btn); cursor: pointer; }
.suiteGroup img { width: 22px; height: 22px; border-radius: 5px; }
.suiteGroup .who { color: var(--s-mut); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suiteGroup [aria-current=page] { border-color: var(--tool); }
.menuGroup .menuBtns, .menuRow { display: flex; flex-wrap: wrap; gap: 8px; }
.menuGroup > button, .menuGroup > a.btnlink { width: 100%; min-height: 44px; }
a.btnlink { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 14px; border: 1px solid var(--s-line); background: var(--s-panel2); color: var(--s-fg); text-decoration: none; font-size: 15px; box-sizing: border-box; }
.menuNote { margin: 0; color: var(--s-mut); font-size: 13px; }

/* Home link back to the picker. */
.suite-home { display: inline-flex; align-items: center; flex: none; margin-right: 8px; text-decoration: none; }
.suite-home img { width: 28px; height: 28px; border-radius: 7px; display: block; }
header .suite-home + .brand, header .suite-home + h1 { display: inline-block; }

/* Shared ☰ menu pattern (Chanter, Drones): a ☰ button at the right of the header opens a full-height side panel
   (<dialog class="menu">, .menuHead with ✕); the main actions live in a fixed .bottombar. */
.bottombar { position: fixed; left: 0; right: 0; bottom: 0; display: flex; gap: 8px; align-items: stretch; padding: 10px 10px calc(10px + env(safe-area-inset-bottom)); background: var(--s-bar); border-top: 1px solid var(--line, #30363d); z-index: 5; }
.bottombar > button { flex: 1; padding: 12px 8px; font-size: 16px; }
@media (min-width: 900px) { .bottombar { max-width: 1280px; margin: 0 auto; } }
.nudge { width: 44px; min-height: 40px; padding: 0; font-size: 22px; line-height: 1; }
.lowaval { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 4.2ch; text-align: right; }
dialog.menu { width: min(560px, 100vw); max-width: 100vw; height: 100vh; max-height: 100vh; margin: 0 0 0 auto; border-radius: 0; border-width: 0 0 0 1px; padding: 10px; overflow-y: auto; }
.menuHead { display: flex; align-items: center; justify-content: space-between; margin: 2px 0 8px; font-size: 17px; }
.menuGroup { border-top: 1px solid var(--line, #30363d); padding: 10px 0; display: grid; gap: 8px; }
.menuLbl { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; opacity: .7; }

/* Shared tool title, same as the Gauge header: first word bold, second regular and muted ("Bagpipe Gauge", "Chanter Tuner", "Drone Tuner"). */
.brand { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-weight: 700; font-size: 17px; line-height: 1.4; letter-spacing: normal; color: var(--s-fg); text-decoration: none; }
h1.brand { margin: 0; font-size: 17px; font-weight: 700; white-space: nowrap; }
.brand .muted, .brand span { color: var(--s-mut); font-weight: 400; }
dialog.menu { background: var(--s-panel); color: var(--s-fg); border-color: var(--s-line); border-style: solid; }
.menuHead button { width: 40px; height: 40px; min-height: 40px; padding: 0; display: inline-grid; place-items: center; font: inherit; font-size: 17px; line-height: 1;
  border-radius: var(--s-r-btn); background: var(--s-panel2); border: 1px solid var(--s-line); color: var(--s-fg); cursor: pointer; }
dialog.menu::backdrop { background: rgba(0, 0, 0, .55); }

/* Bottom dock (chanter and drones): just the Low A bar, identical on both.  [Set Low A] [−] 480.0 Hz [+] status */
.bottombar.dock { flex-direction: column; gap: 8px; padding-top: 8px; }
.dock .lowabar { display: flex; align-items: center; gap: 8px; margin: 0; padding: 0; background: none; border: 0; }
.dock .lowabar #btnLowA { flex: 0 1 auto; min-width: 56px; min-height: 56px; padding: 10px 14px; font-size: 17px; font-weight: 600; white-space: nowrap; }
.dock .lowabox { display: inline-flex; align-items: baseline; gap: 3px; }
.dock .lowabox .unit { color: var(--mut, #8b949e); font-size: 13px; }
.dock .lowamode { color: var(--mut, #8b949e); font-size: 12px; min-width: 3.6em; text-align: right; }
.dock .lowamode.fixed { color: var(--warn, #d29922); }
.dock .btnrow { display: flex; gap: 8px; }
.dock .btnrow > button { flex: 1; padding: 12px 8px; font-size: 16px; }
/* "Tap to start listening" (shared/autolisten.js): one small pill, only when the browser needs a tap to start audio */
.tapToListen { position: fixed; left: 50%; top: 42%; transform: translate(-50%, -50%); z-index: 20; padding: 12px 18px; border-radius: 999px;
  border: 1px solid var(--line, #30363d); background: color-mix(in srgb, var(--panel, #161b22) 92%, transparent); color: var(--fg, #e6edf3);
  font: 600 15px system-ui, sans-serif; box-shadow: 0 6px 24px #0008; }

/* Tuner notice (shared/tunerui.js): no permanent status line; a small pill just above the Low A bar, only when there is
   something to say (mic blocked, file results, Low A changes). Errors are red and stay until the next message. */
body[data-tool=chanter] .notice, body[data-tool=drones] .notice { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--dock-h, 72px) + 8px);
  z-index: 12; width: max-content; max-width: calc(100vw - 32px); box-sizing: border-box; margin: 0; padding: 7px 12px; border-radius: 12px; min-height: 0;
  background: color-mix(in srgb, var(--s-panel2) 94%, transparent); border: 1px solid var(--s-line); color: var(--s-fg);
  font-size: 13px; line-height: 1.35; text-align: center; box-shadow: 0 4px 16px #0007; }
.notice[hidden] { display: none !important; }
body[data-tool] .notice.err { background: #3a1c1c; border-color: #a33; color: #ffd7d7; }
.dock .lowabar .nudge { flex: 1 1 64px; width: auto; min-width: 46px; max-width: 84px; min-height: 56px; font-size: 30px; font-weight: 600; }
.dock .lowabar .lowabox { flex: none; }
.dock .lowabar .lowaval { font-size: 22px; min-width: 4.2ch; }
.dock .lowabar .lowamode { min-width: 0; flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Low A bar (Darren, 13 Oct 2026, variant A): three equal thirds [−] [480.0 Hz] [+]. Tapping the frequency measures Low A
   (Chanter: from the chanter; Drones: tap = tenor drone, double tap = chanter). No Set button, no auto/fixed label. */
.dock .lowabar { gap: 8px; }
.dock .lowabar > .nudge, .dock .lowabar > #btnLowA.lowabox { flex: 1 1 0; width: auto; min-width: 0; max-width: none; height: 64px; min-height: 64px; padding: 0; }
.dock .lowabar > .nudge { font-size: 34px; font-weight: 700; }
.dock .lowabar > #btnLowA.lowabox { display: flex; align-items: center; justify-content: center; gap: 4px; white-space: nowrap; }
.dock .lowabar #btnLowA .lowaval { font-size: 24px; font-weight: 700; min-width: 0; }
