/* Shared by the Patcher and Sandbox tabs: palette, header, tabs, status and Mute all.
   Modelled on the Max 8 dark patcher. Deliberately dark-only. */
:root {
  color-scheme: dark;
  --chrome: #242424; --chrome-2: #333; --canvas: #3b3b3b; --grid: #424242;
  --box: #2a2a2a; --box-line: #5c5c5c; --ink: #dedede; --muted: #9a9a9a;
  --port: #a6a6a6; --sel: #6db3e3; --val: #86c6ea; --cord: #a9a9a9;
  --warn: #e2775d; --ok: #7cc48f; --stale: #e0b050;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink);
  font: 12px/1.35 Lato, "Helvetica Neue", Arial, sans-serif; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--sel); outline-offset: 1px; }

header { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 10px;
  height: 46px; padding: 0 12px; background: var(--chrome); border-bottom: 1px solid #111; }
header > * { flex: none; }
h1 { margin: 0 4px 0 0; font-size: 14px; font-weight: 700; }
h1 a { color: inherit; text-decoration: none; }

.group { display: flex; align-items: center; gap: 6px; }
.tb { background: var(--chrome-2); border: 1px solid #4a4a4a; border-radius: 4px; padding: 4px 10px; cursor: pointer; }
.tb:hover { border-color: #6a6a6a; }

/* State by shape and word, colour is extra: offline = hollow ring, online = filled disc,
   stalled = triangle. */
header > .status { flex: 0 1 auto; min-width: 0; overflow: hidden; }
.status { display: flex; gap: 12px; color: var(--muted); white-space: nowrap; }
.status > span { display: inline-flex; align-items: center; gap: 5px; }
.dot { width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--warn); flex: none; }
.dot.on { background: var(--ok); border-color: var(--ok); }
.dot.stale { border: 0; border-radius: 0; background: var(--stale); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.word { color: var(--ink); font-weight: 700; }
.word.off { color: var(--muted); font-weight: 400; }
header > .spacer { flex: 1 1 0; }

/* The emulator: the header's blue rule and this indicator, where the live pages
   show the broker and the Pis. */
body.emulator header { border-bottom: 2px solid var(--sel); }
.emulator-mode { gap: 7px !important; padding: 3px 11px 3px 9px; border-radius: 999px;
  background: rgb(109 179 227 / .14); box-shadow: inset 0 0 0 1px rgb(109 179 227 / .45); color: var(--sel); font-weight: 700; }
.emulator-mode .dot.on { background: var(--sel); border-color: var(--sel); }
.emulator-mode .where { color: var(--ink); font-weight: 400; }
.emulator-mode.waiting .dot { background: transparent; }

#mute-all { border: 0; border-radius: 6px; background: var(--warn); color: #fff; padding: 7px 16px;
  font-weight: 700; cursor: pointer; }
#mute-all kbd { font: 700 10px ui-monospace, monospace; border: 1px solid rgb(255 255 255 / .6);
  border-radius: 3px; padding: 0 4px; margin-left: 6px; }

.banner { display: none; background: var(--warn); color: #fff; padding: 6px 12px; font-weight: 700; }
body.offline .banner { display: block; }

/* Narrower windows: a tighter toolbar, so the device status stays readable. */
@media (max-width: 1400px) { header { gap: 8px; } .tb { padding: 4px 7px; } .status { gap: 9px; } }
