/* Hannale dashboard
   ------------------------------------------------------------------
   Both themes are deliberately stepped, not an automatic inversion.
   Chrome, ink and series colors come from a validated reference palette;
   status colors are fixed across modes and always ship with icon + label.
*/

:root {
  color-scheme: light;

  /* surfaces & ink */
  --plane:        #f9f9f7;
  --surface:      #fcfcfb;
  --surface-2:    #f2f1ec;
  --ink:          #0b0b0b;
  --ink-2:        #52514e;
  --muted:        #898781;
  --border:       rgba(11, 11, 11, 0.10);
  --grid:         #e1e0d9;
  --axis:         #c3c2b7;

  /* data */
  --series-1:     #2a78d6;
  --series-1-soft:#cde2fb;

  /* status — fixed in both modes, never used for series */
  --good:         #0ca30c;
  --warning:      #fab219;
  --serious:      #ec835a;
  --critical:     #d03b3b;

  --shadow:       0 1px 2px rgba(11, 11, 11, .05), 0 8px 24px rgba(11, 11, 11, .04);

  --radius:       14px;
  --radius-sm:    9px;
  --space:        8px;

  --font: system-ui, -apple-system, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --plane:        #0d0d0d;
    --surface:      #1a1a19;
    --surface-2:    #232322;
    --ink:          #ffffff;
    --ink-2:        #c3c2b7;
    --muted:        #898781;
    --border:       rgba(255, 255, 255, 0.10);
    --grid:         #2c2c2a;
    --axis:         #383835;
    --series-1:     #3987e5;
    --series-1-soft:#184f95;
    --shadow:       0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .3);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --plane:        #0d0d0d;
  --surface:      #1a1a19;
  --surface-2:    #232322;
  --ink:          #ffffff;
  --ink-2:        #c3c2b7;
  --muted:        #898781;
  --border:       rgba(255, 255, 255, 0.10);
  --grid:         #2c2c2a;
  --axis:         #383835;
  --series-1:     #3987e5;
  --series-1-soft:#184f95;
  --shadow:       0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .3);
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--plane);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--series-1); }

/* ------------------------------------------------------------------ */
/* Brand                                                               */
/* ------------------------------------------------------------------ */

.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 30px; height: 30px; flex: none; border-radius: 8px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-weight: 650; letter-spacing: -.01em; }
.brand-sub {
  font-size: 11px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .08em;
}

/* ------------------------------------------------------------------ */
/* Login                                                               */
/* ------------------------------------------------------------------ */

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
}

.auth-card .brand { justify-content: center; margin-bottom: 4px; }
.auth-title { font-size: 20px; font-weight: 650; margin: 20px 0 4px; text-align: center; }
.auth-hint { color: var(--ink-2); font-size: 13.5px; margin: 0 0 24px; text-align: center; }

.field { margin-bottom: 14px; }
.field label {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--ink-2); margin-bottom: 6px;
}

input[type="text"], input[type="password"] {
  width: 100%;
  padding: 11px 12px;
  font: inherit;
  font-size: 14.5px;
  color: var(--ink);
  background: var(--plane);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

input:focus-visible {
  border-color: var(--series-1);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--series-1) 22%, transparent);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, border-color .15s, opacity .15s;
}
.btn:hover { border-color: var(--muted); }
.btn:focus-visible { outline: 2px solid var(--series-1); outline-offset: 2px; }
.btn[disabled] { opacity: .55; cursor: default; }

.btn-primary {
  width: 100%;
  background: var(--series-1);
  border-color: transparent;
  color: #fff;
  padding: 12px 16px;
  margin-top: 6px;
}
.btn-primary:hover { filter: brightness(1.06); border-color: transparent; }

.btn-icon { padding: 8px 10px; }

.alert {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  font-size: 13.5px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
  border: 1px solid color-mix(in srgb, var(--critical) 40%, transparent);
  background: color-mix(in srgb, var(--critical) 10%, transparent);
  color: var(--ink);
}
.alert svg { flex: none; margin-top: 2px; }

/* ------------------------------------------------------------------ */
/* Shell                                                               */
/* ------------------------------------------------------------------ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px 20px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.topbar-spacer { flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

.user-chip {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--ink-2);
  padding-left: 12px; margin-left: 4px;
  border-left: 1px solid var(--border);
}

main { padding: 20px; max-width: 1320px; margin: 0 auto; }

/* ------------------------------------------------------------------ */
/* Status pill — icon + label, never color alone                       */
/* ------------------------------------------------------------------ */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 11px 6px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--ink);
  white-space: nowrap;
}
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.pill[data-state="good"]     .dot { background: var(--good); }
.pill[data-state="warning"]  .dot { background: var(--warning); }
.pill[data-state="serious"]  .dot { background: var(--serious); }
.pill[data-state="critical"] .dot { background: var(--critical); }
.pill[data-state="good"] .dot { animation: pulse 2.4s ease-in-out infinite; }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 55%, transparent); }
  70%      { box-shadow: 0 0 0 5px transparent; }
}
@media (prefers-reduced-motion: reduce) {
  .pill[data-state="good"] .dot { animation: none; }
}

.timestamp { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* ------------------------------------------------------------------ */
/* Cards & tiles                                                       */
/* ------------------------------------------------------------------ */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}

.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.card-title { font-size: 14px; font-weight: 650; margin: 0; }
.card-sub { font-size: 12px; color: var(--muted); margin: 2px 0 0; }
.card-head .spacer { flex: 1; }

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.tile { display: flex; flex-direction: column; gap: 6px; }
.tile-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .07em;
}
.tile-value {
  font-size: 26px;
  font-weight: 650;
  letter-spacing: -.02em;
  line-height: 1.1;
}
/* The one hero figure on the page. */
.tile-value.hero { font-size: 48px; }
.tile-value.tile-value-sm { font-size: 20px; }
.tile-unit { font-size: 15px; font-weight: 500; color: var(--muted); margin-left: 3px; }
.tile-note { font-size: 12.5px; color: var(--ink-2); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
  align-items: start;
}
.span-2 { grid-column: span 2; }
@media (max-width: 720px) {
  .span-2 { grid-column: span 1; }
  main { padding: 14px; }
  .topbar { padding: 10px 14px; }
  .tile-value.hero { font-size: 38px; }
}

/* ------------------------------------------------------------------ */
/* Meter — fill carries severity, track is a lighter step of the ramp  */
/* ------------------------------------------------------------------ */

.meter {
  height: 6px;
  border-radius: 999px;
  background: var(--series-1-soft);
  overflow: hidden;
}
.meter > span {
  display: block;
  height: 100%;
  width: var(--fill, 0%);
  border-radius: 999px;
  background: var(--series-1);
  transition: width .5s ease;
}
.meter[data-severity="warning"]  > span { background: var(--warning); }
.meter[data-severity="serious"]  > span { background: var(--serious); }
.meter[data-severity="critical"] > span { background: var(--critical); }

/* ------------------------------------------------------------------ */
/* Signal bars                                                         */
/* ------------------------------------------------------------------ */
/* Fill count and color come from data- attributes rather than inline
   styles, so the strict CSP needs no 'unsafe-inline' for style-src.   */

.signal-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 34px;
  padding-bottom: 4px;
  flex: none;
}

.bars .bar {
  width: 7px;
  border-radius: 2px;
  background: var(--series-1-soft);
  transition: background .4s ease, height .4s ease;
}
.bars .bar:nth-child(1) { height: 28%; }
.bars .bar:nth-child(2) { height: 46%; }
.bars .bar:nth-child(3) { height: 64%; }
.bars .bar:nth-child(4) { height: 82%; }
.bars .bar:nth-child(5) { height: 100%; }

/* Filled bars take the status color for the current level. */
.bars[data-bars="1"] .bar:nth-child(-n+1),
.bars[data-bars="2"] .bar:nth-child(-n+2),
.bars[data-bars="3"] .bar:nth-child(-n+3),
.bars[data-bars="4"] .bar:nth-child(-n+4),
.bars[data-bars="5"] .bar:nth-child(-n+5) { background: var(--good); }

.bars[data-level="fair"][data-bars] .bar:nth-child(-n+3) { background: var(--warning); }
.bars[data-level="poor"][data-bars] .bar:nth-child(-n+2) { background: var(--serious); }
.bars[data-level="bad"][data-bars]  .bar:nth-child(-n+1) { background: var(--critical); }

.bars[data-level="unknown"] .bar { background: var(--series-1-soft); }

.meter-block { margin: 16px 0 0; }
.meter-block-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13.5px;
  margin-bottom: 8px;
}
.meter-block-head dt { color: var(--ink-2); margin: 0; }
.meter-block-head dd { margin: 0; font-weight: 550; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ */
/* Definition rows                                                     */
/* ------------------------------------------------------------------ */

.rows { display: grid; gap: 1px; background: var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.rows-spaced { margin-top: 12px; }
.rows:empty, .rows[hidden] { display: none; }
.row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 9px 12px;
  background: var(--surface);
  font-size: 13.5px;
}
.row dt { color: var(--ink-2); margin: 0; }
.row dd { margin: 0; font-weight: 550; text-align: right; font-variant-numeric: tabular-nums; }
.row dd.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }

/* ------------------------------------------------------------------ */
/* Chart                                                               */
/* ------------------------------------------------------------------ */

.chart-wrap { position: relative; }
.chart { display: block; width: 100%; height: 180px; touch-action: none; }

.chart .grid-line { stroke: var(--grid); stroke-width: 1; }
.chart .axis-line  { stroke: var(--axis); stroke-width: 1; }
.chart .tick       { fill: var(--muted); font-size: 10.5px; font-variant-numeric: tabular-nums; }
.chart .area       { fill: var(--series-1); opacity: .10; }
.chart .line       { fill: none; stroke: var(--series-1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .end-dot    { fill: var(--series-1); stroke: var(--surface); stroke-width: 2; }
.chart .crosshair  { stroke: var(--axis); stroke-width: 1; }
.chart .hover-dot  { fill: var(--series-1); stroke: var(--surface); stroke-width: 2; }
.chart .hidden     { display: none; }

.tooltip {
  position: absolute;
  pointer-events: none;
  z-index: 5;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  padding: 7px 10px;
  font-size: 12.5px;
  white-space: nowrap;
  transform: translate(-50%, -100%);
  transition: opacity .12s;
}
.tooltip .tt-time { color: var(--muted); font-size: 11px; }
.tooltip .tt-value { font-weight: 650; font-variant-numeric: tabular-nums; }
.tooltip[hidden] { display: none; }

.empty {
  display: grid;
  place-items: center;
  height: 180px;
  color: var(--muted);
  font-size: 13px;
}

/* ------------------------------------------------------------------ */
/* Tables                                                              */
/* ------------------------------------------------------------------ */

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 0 10px 8px;
  border-bottom: 1px solid var(--border);
}
td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}
tr:last-child td { border-bottom: 0; }
.td-muted { color: var(--muted); }
.cell-status { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.cell-status .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); flex: none; }
.cell-status[data-state="good"] .dot { background: var(--good); }
.cell-status[data-state="warning"] .dot { background: var(--warning); }
.table-scroll { overflow-x: auto; max-height: 260px; overflow-y: auto; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }

/* ------------------------------------------------------------------ */
/* Camera                                                              */
/* ------------------------------------------------------------------ */

.camera-body { display: flex; flex-direction: column; gap: 14px; }
.camera-preview {
  position: relative;
  display: grid;
  place-items: center;
  height: 120px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
}
.camera-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.camera-actions .btn { flex: 1; min-width: 130px; }

/* ------------------------------------------------------------------ */
/* Live view stage                                                     */
/* ------------------------------------------------------------------ */
/* The stage owns the height. `resize: vertical` gives a native drag
   handle, and the size select sets discrete heights; both write to the
   same box so they can't disagree.                                     */

.stage {
  position: relative;
  overflow: hidden;
  resize: vertical;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #000;
  min-height: 160px;
}
.stage[data-size="sm"] { height: 220px; }
.stage[data-size="md"] { height: 340px; }
.stage[data-size="lg"] { height: 480px; }
.stage[data-size="xl"] { height: 680px; }

.stage .camera-preview {
  position: relative;
  height: 100%;
  width: 100%;
  border: 0;
  border-radius: 0;
  background: #000;
  cursor: crosshair;
  touch-action: none;
  outline: none;
}
.stage .camera-preview:focus-visible { box-shadow: inset 0 0 0 2px var(--series-1); }
.stage .camera-preview.dragging { cursor: grabbing; }

#camera-frame, #camera-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #000;
  -webkit-user-drag: none;
  user-select: none;
}
#camera-frame[hidden], #camera-video[hidden] { display: none; }

/* Fullscreen: the stage becomes the whole screen, so drop the fixed height. */
.stage:fullscreen { height: 100%; width: 100%; border-radius: 0; resize: none; }
.stage:fullscreen .camera-preview { height: 100%; }
.stage:-webkit-full-screen { height: 100%; width: 100%; }

/* Aim marker showing where a click will centre the view. */
.aim {
  position: absolute;
  width: 34px; height: 34px;
  margin: -17px 0 0 -17px;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0,0,0,.5), inset 0 0 0 1px rgba(0,0,0,.5);
  pointer-events: none;
  opacity: .9;
  animation: aim-pop .5s ease-out forwards;
}
@keyframes aim-pop {
  from { transform: scale(.4); opacity: 1; }
  to   { transform: scale(1.3); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .aim { animation: none; opacity: .6; } }

/* Rubber-band selection for zoom-to-area. */
.selection {
  position: absolute;
  border: 1.5px solid #fff;
  background: rgba(255, 255, 255, .16);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .55), 0 0 0 9999px rgba(0, 0, 0, .28);
  pointer-events: none;
  border-radius: 2px;
}
.selection[hidden] { display: none; }

/* Compass overlay. */
.compass {
  position: absolute;
  top: 10px; right: 10px;
  width: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  pointer-events: none;
}
.compass[hidden] { display: none; }
.compass svg { width: 64px; height: 64px; }
.compass-ring {
  fill: rgba(0, 0, 0, .45);
  stroke: rgba(255, 255, 255, .55);
  stroke-width: 1.5;
}
.compass-cardinal {
  fill: rgba(255, 255, 255, .8);
  font-size: 9px;
  font-weight: 600;
  text-anchor: middle;
  font-family: var(--font);
}
.compass-north { fill: var(--critical); }
.compass-south { fill: rgba(255, 255, 255, .75); }
.compass-hub { fill: #fff; }
#compass-needle { transition: transform .45s ease; transform-origin: 32px 32px; }
@media (prefers-reduced-motion: reduce) { #compass-needle { transition: none; } }

.compass-readout {
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: rgba(0, 0, 0, .55);
  padding: 2px 7px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}

/* Segmented control for the drag mode. */
.segmented {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.seg-btn {
  font: inherit;
  font-size: 12.5px;
  padding: 7px 11px;
  border: 0;
  background: var(--surface-2);
  color: var(--ink-2);
  cursor: pointer;
}
.seg-btn + .seg-btn { border-left: 1px solid var(--border); }
.seg-btn.active { background: var(--series-1); color: #fff; }
.seg-btn:focus-visible { outline: 2px solid var(--series-1); outline-offset: -2px; }

/* Imaging + compass panels. */
.imaging { margin-top: 18px; display: flex; flex-direction: column; gap: 10px; }
.imaging[hidden] { display: none; }
.imaging .inline-field { justify-content: space-between; }
#imaging-sliders { display: flex; flex-direction: column; gap: 10px; }
.slider-row label {
  display: flex; justify-content: space-between;
  font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 5px;
}
.slider-row input[type="range"] { width: 100%; accent-color: var(--series-1); }
#imaging-note, #compass-status { margin: 0; }

.stage-hint, .stage-badge {
  position: absolute;
  bottom: 8px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  color: #fff;
  background: rgba(0, 0, 0, .55);
  pointer-events: none;
  backdrop-filter: blur(4px);
}
.stage-hint { left: 8px; transition: opacity .3s; }
.stage-hint.faded { opacity: 0; }
.stage-badge { right: 8px; font-weight: 600; }

.stage-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.stage-bar .spacer { flex: 1; }

.inline-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-2);
}
.inline-field select {
  font: inherit;
  font-size: 13px;
  padding: 7px 8px;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.inline-field select:focus-visible { outline: 2px solid var(--series-1); outline-offset: 1px; }
.camera-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
}
.camera-placeholder[hidden] { display: none; }

/* ------------------------------------------------------------------ */
/* PTZ control                                                         */
/* ------------------------------------------------------------------ */

.ptz-body {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
}

.dpad {
  display: grid;
  grid-template-columns: repeat(3, 46px);
  grid-template-rows: repeat(3, 46px);
  gap: 6px;
  flex: none;
}

.dpad-btn {
  font: inherit;
  font-size: 17px;
  line-height: 1;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--ink);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  transition: background .12s, transform .08s, border-color .12s;
}
.dpad-btn:hover:not([disabled]) { border-color: var(--muted); }
.dpad-btn:focus-visible { outline: 2px solid var(--series-1); outline-offset: 2px; }
.dpad-btn.active {
  background: var(--series-1);
  border-color: transparent;
  color: #fff;
  transform: scale(.94);
}
.dpad-btn[disabled] { opacity: .4; cursor: not-allowed; }
.dpad-home { font-size: 19px; }

.ptz-side { display: flex; flex-direction: column; gap: 16px; flex: 1; min-width: 150px; }

.ptz-zoom { display: flex; align-items: center; gap: 8px; }
.ptz-zoom .btn { width: 44px; font-size: 19px; padding: 8px 0; }
.ptz-zoom .btn.active { background: var(--series-1); border-color: transparent; color: #fff; }
.ptz-zoom-label {
  font-size: 11px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .07em;
}

.ptz-speed { margin: 0; }
.ptz-speed label {
  display: flex; justify-content: space-between;
  font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px;
}
.ptz-speed input[type="range"] { width: 100%; accent-color: var(--series-1); }

.ptz-presets { margin-top: 18px; display: flex; flex-direction: column; gap: 10px; }
.ptz-presets[hidden] { display: none; }
.preset-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.preset-head .tile-label { flex: 1; }
.btn-small { font-size: 12px; padding: 6px 10px; }

.preset-list { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.preset-empty { font-size: 12.5px; }

/* A preset is a recall button with a delete affordance attached. */
.preset {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface-2);
}
.preset button {
  font: inherit;
  font-size: 13px;
  border: 0;
  background: none;
  color: var(--ink);
  cursor: pointer;
  padding: 7px 11px;
}
.preset button:hover { background: var(--border); }
.preset .preset-del {
  padding: 7px 9px;
  color: var(--muted);
  border-left: 1px solid var(--border);
  font-size: 14px;
  line-height: 1;
}
.preset .preset-del:hover { color: #fff; background: var(--critical); }
.preset button:focus-visible { outline: 2px solid var(--series-1); outline-offset: -2px; }

#ptz-position { margin: 0; font-variant-numeric: tabular-nums; }

#ptz-card[data-enabled="no"] .ptz-body { opacity: .4; pointer-events: none; }
#ptz-banner { margin: 16px 0 0; }

/* ------------------------------------------------------------------ */
/* Misc                                                                */
/* ------------------------------------------------------------------ */

.banner {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  margin-bottom: 14px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  border: 1px solid color-mix(in srgb, var(--critical) 40%, transparent);
  background: color-mix(in srgb, var(--critical) 9%, transparent);
}
.banner[data-state="warning"] {
  border-color: color-mix(in srgb, var(--warning) 45%, transparent);
  background: color-mix(in srgb, var(--warning) 10%, transparent);
}
.banner svg { flex: none; margin-top: 1px; }
.banner code { font-size: 12px; word-break: break-all; }
.banner[hidden] { display: none; }

.error-page { display: grid; place-items: center; min-height: 100vh; text-align: center; padding: 24px; }
.error-code { font-size: 56px; font-weight: 650; letter-spacing: -.03em; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

[hidden] { display: none !important; }

footer {
  padding: 24px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}
