/* DomCam — design tokens & UI (plan §10: dark theme, mobile-first, touch targets ≥ 44px).
   Stage 4h restyle: high-tech signal-green / black / white system. Self-hosted fonts (CSP font-src 'self'):
   Audiowide = display/headings · Space Grotesk = UI/body · JetBrains Mono = data (IPs, MACs, timings).
   No frameworks; CSP-safe by construction (no inline styles anywhere in views). */

@font-face {
  font-family: "Audiowide";
  font-style : normal;
  font-weight : 400;
  font-display: swap;
  src        : url("/assets/fonts/audiowide-regular.woff2") format("woff2");
}

@font-face {
  font-family: "Space Grotesk";
  font-style : normal;
  font-weight : 400;
  font-display: swap;
  src        : url("/assets/fonts/space-grotesk-400.woff2") format("woff2");
}

@font-face {
  font-family: "Space Grotesk";
  font-style : normal;
  font-weight : 500;
  font-display: swap;
  src        : url("/assets/fonts/space-grotesk-500.woff2") format("woff2");
}

@font-face {
  font-family: "Space Grotesk";
  font-style : normal;
  font-weight : 600;
  font-display: swap;
  src        : url("/assets/fonts/space-grotesk-600.woff2") format("woff2");
}

@font-face {
  font-family: "Space Grotesk";
  font-style : normal;
  font-weight : 700;
  font-display: swap;
  src        : url("/assets/fonts/space-grotesk-700.woff2") format("woff2");
}

@font-face {
  font-family: "JetBrains Mono";
  font-style : normal;
  font-weight : 400;
  font-display: swap;
  src        : url("/assets/fonts/jetbrains-mono-400.woff2") format("woff2");
}

@font-face {
  font-family: "JetBrains Mono";
  font-style : normal;
  font-weight : 600;
  font-display: swap;
  src        : url("/assets/fonts/jetbrains-mono-600.woff2") format("woff2");
}

:root {
  /* Stage 4h — signal-green / black / white palette (dark-first). Semantic extras keep meaning:
     red = danger/delete, amber = warning/slow/queued, green = primary/live/ok. */
  --accent       : rgb(62 224 132);   /* signal green — the brand hue */
  --on-accent    : rgb(3 14 8);       /* dark text on solid-green controls (contrast) */
  --bg           : rgb(5 9 7);        /* page — near-black with a green cast */
  --bg-deep      : rgb(3 6 5);        /* focus/stage backdrops */
  --border       : rgb(28 46 37);     /* hairlines */
  --border-hi    : rgb(48 82 63);     /* hover / raised borders */
  --field        : rgb(7 13 10);      /* inputs & selects */
  --muted        : rgb(130 155 141);
  --panel        : rgb(10 18 14);     /* cards / tiles / panels */
  --panel-2      : rgb(16 27 21);     /* raised surfaces (hover, popovers) */
  --radius       : 10px;
  --text         : rgb(228 240 233);
  --ok-text      : rgb(140 240 178);
  --danger-bg    : rgba(255, 90, 90, 0.1);
  --danger-solid : rgb(196 58 58);
  --danger-hi    : rgb(216 72 72);
  --danger-text  : rgb(255 126 126);
  --warn         : rgb(240 185 60);
  --font-display : "Audiowide", "Space Grotesk", system-ui, sans-serif;
  --font-body    : "Space Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono    : "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing : border-box; }

html, body {
  /* Stage 4i — safety net: no horizontal page scroll from any over-wide element (clip never creates a
     scrolling box, so sticky/fixed positioning is unaffected). Targeted min-width/ellipsis fixes do the real work. */
  overflow-x    : clip;
  background-color: var(--bg);
  /* Stage 4h — faint signal glow across the top of every screen (static gradient = zero runtime cost). */
  background-image: radial-gradient(900px 480px at 50% -120px, rgba(62, 224, 132, 0.075), transparent 65%);
  background-repeat : no-repeat;
  color       : var(--text);
  font-family : var(--font-body);
  line-height : 1.5;
  margin      : 0;
  padding     : 0;
}

.page {
  align-items     : center;
  display         : flex;
  flex-direction  : column;
  gap             : 1rem;
  justify-content : center;
  min-height      : 100dvh;
  padding         : 1.25rem;
}

.card {
  background    : var(--panel);
  border        : 1px solid var(--border);
  border-radius : var(--radius);
  padding       : 1.5rem;
  position      : relative;
  width         : min(380px, 100%);
}

/* HUD corner ticks — the stage-4h signature detail (also on .modal / .focus-camlist below). */
.card::before, .card::after { content: ""; position: absolute; pointer-events: none; width: 16px; height: 16px; opacity: 0.85; }

.card::before { top: -2px; left: -2px; border-top: 2px solid var(--accent); border-left: 2px solid var(--accent); }

.card::after { bottom: -2px; right: -2px; border-bottom: 2px solid var(--accent); border-right: 2px solid var(--accent); }

h1 {
  font-family   : var(--font-display);
  font-size     : 1.35rem;
  font-weight   : 400; /* Audiowide is single-weight */
  letter-spacing: 0.06em;
  margin        : 0 0 0.75rem;
}

.muted { color : var(--muted); font-weight : 400; }

.note { color : var(--muted); font-size : 0.9rem; margin : 0.25rem 0 1rem; }

.banner {
  background    : var(--danger-bg);
  border        : 1px solid rgba(255, 90, 90, 0.35);
  border-radius : 8px;
  color         : var(--danger-text);
  font-size     : 0.92rem;
  margin        : 0 0 1rem;
  padding       : 0.6rem 0.75rem;
}

label {
  color         : var(--muted);
  display       : block;
  font-size     : 0.92rem;
  letter-spacing: 0.02em;
  margin-bottom : 0.9rem;
}

input[type="email"],
input[type="password"] {
  background    : var(--field);
  border        : 1px solid var(--border);
  border-radius : 8px;
  color         : var(--text);
  font-size     : 1rem;
  margin-top    : 0.35rem;
  min-height    : 44px; /* touch target */
  padding       : 0.6rem 0.75rem;
  width         : 100%;
}

input:focus-visible, button:focus-visible, a:focus-visible {
  outline        : 2px solid var(--accent);
  outline-offset : 2px;
}

button, .btn {
  background      : var(--accent);
  border          : none;
  border-radius   : 6px;
  color           : var(--on-accent);
  display         : inline-block;
  font-size       : 1rem;
  font-weight     : 700;
  min-height      : 46px;
  padding         : 0.65rem 1rem;
  text-align      : center;
  text-decoration : none;
  width           : 100%;
}

button:hover { filter : brightness(1.07); }

/* Primary buttons glow on hover — ghost/danger variants opt out via their own hover rules. */
.btn:not(.btn-ghost):not(.btn-danger):hover { box-shadow : 0 0 16px rgba(62, 224, 132, 0.28); }

.foot {
  color     : var(--muted);
  font-size : 0.8rem;
  margin    : 0;
  opacity   : 0.8;
}

.center .big-code {
  color       : var(--accent);
  font-family : var(--font-display);
  font-size   : 2.4rem;
  letter-spacing: 0.1em;
  margin      : 0 0 0.25rem;
}

@media (prefers-reduced-motion : reduce) {
  * { animation : none !important; transition : none !important; }
}

/* --- Phase 1: dashboard shell --------------------------------------------
   Same tokens as above; appended (later rules win over the base button/card styles). */
.shell {
  display        : flex;
  flex-direction : column;
  min-height     : 100dvh;
}

.topbar {
  align-items     : center;
  /* Glassy app bar: translucent + blur so the wall glows through while scrolling.
     -webkit- prefix for Safari; without support the rule is ignored (solid fallback). */
  background          : rgba(6, 13, 9, 0.78);
  backdrop-filter     : blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  border-bottom   : 1px solid var(--border);
  display         : flex;
  gap             : 0.75rem;
  justify-content : space-between;
  padding         : 0.6rem 1rem;
  position        : sticky;
  top             : 0;
  z-index         : 5;
}

.brand {
  align-items    : center;
  display        : flex;
  font-family    : var(--font-display);
  font-size      : 1rem;
  font-weight    : 400; /* Audiowide is single-weight */
  gap            : 0.55rem;
  letter-spacing : 0.08em;
  min-height     : 44px; /* touch target */
}

.brand .dot {
  animation      : brand-pulse 2.6s ease-in-out infinite;
  background     : var(--accent);
  border-radius  : 50%;
  box-shadow     : 0 0 10px rgba(62, 224, 132, 0.8);
  display        : inline-block;
  height         : 10px;
  width          : 10px;
}

@keyframes brand-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.55; }
}

.userbox {
  align-items     : center;
  display         : flex;
  flex-wrap       : wrap;
  gap             : 0.75rem;
  justify-content : flex-end;
}

.userbox .who { max-width : 14ch; overflow : hidden; text-overflow : ellipsis; white-space : nowrap; }

.badge {
  background    : var(--field);
  border        : 1px solid var(--border);
  border-radius : 999px;
  color         : var(--muted);
  font-family   : var(--font-mono);
  font-size     : 0.72rem;
  padding       : 0.2rem 0.6rem;
}

.topbar-form { align-items : center; display : flex; margin : 0; }

button.btn-signout {
  background  : transparent;
  border      : 1px solid var(--border);
  color       : var(--text);
  font-weight : 500;
  min-height  : 40px;
  padding     : 0.5rem 0.9rem;
  width       : auto;
}

button.btn-signout:hover { background : var(--panel-2); filter : none; }

.content {
  display        : flex;
  flex           : 1;
  flex-direction : column;
  gap            : 1rem;
  margin         : 0 auto;
  padding        : 1.25rem 1.25rem 2rem;
  width          : min(720px, 100%);
}

.placeholder-card {
  background    : var(--panel);
  border        : 1px dashed var(--border);
  border-radius : var(--radius);
  padding       : 2rem 1.5rem;
  text-align    : center;
}

.footer-wrap { display : flex; justify-content : center; }

/* --- Phase 2: camera wall, tiles & settings modal ------------------------- */
/* Stage 4e F3 — full-width desktop at fleet scale (was a 1200 px cap). */
.content-wide {
  margin-inline: auto;
  width        : min(1760px, calc(100% - 48px));
}

.wall-toolbar {
  /* Stage 4e F3 — app-bar reflow: title left, control group right; wraps on narrow screens. */
  align-items : center;
  display     : flex;
  flex-wrap   : wrap;
  gap         : 0.5rem 0.6rem;
}

.wall-title {
  align-items : center;
  display     : flex;
  font-family : var(--font-display);
  font-size   : 1.05rem;
  font-weight : 400; /* Audiowide is single-weight */
  gap         : 0.5rem;
  letter-spacing: 0.05em;
  margin      : 0 auto 0 0; /* stage 4e F3 — pushes the control group to the right */
}

/* Admin-only controls stay hidden until wall.js marks the document (JS-off = read-only wall). */
#add-camera, #discover-btn, .tile-actions, .btn-cta, .modal-backdrop { display : none; }

.js #add-camera, .js #discover-btn { display : inline-block; width : auto; }

.js .btn-cta { display : inline-block; }

.js .tile-actions { display : flex; }

.btn-ghost {
  background  : transparent;
  border      : 1px solid var(--border);
  color       : var(--text);
  font-weight : 500;
}

.btn-ghost:hover { background : var(--panel-2); filter : none; }

/* Red = destructive, per the stage-4h semantic palette (delete surfaces). */
.btn-danger { background : var(--danger-solid); color : #fff; }

.btn-danger:hover { background : var(--danger-hi); box-shadow : 0 0 16px rgba(255, 90, 90, 0.25); filter : none; }

/* Stage 4e F2 — one real button spec: .btn h40 · .btn-sm h32 for toolbar density.
   The global `button,.btn` base stays for full-width form buttons (login page). */
.btn { min-height : 40px; padding : 0.5rem 1rem; width : auto; }

.btn-sm { font-size : 0.85rem; min-height : 32px; padding : 0.35rem 0.8rem; }

@media (hover: none) {
  .btn-sm, .cadence-label select { min-height : 40px; } /* touch: §10 target — toolbar controls stay reachable */
}

/* Stage 4e F3 — larger base cell (26-cam wall fills the desktop); ≥1920 px screens go wider still. */
.wall-grid {
  display               : grid;
  gap                   : 0.75rem;
  /* Stage 4i — min(…,100%): the track minimum never exceeds the container (no horizontal overflow on very narrow phones). */
  grid-template-columns : repeat(auto-fill, minmax(min(176px, 100%), 1fr));
}

@media (min-width: 1920px) {
  .wall-grid { grid-template-columns : repeat(auto-fill, minmax(min(200px, 100%), 1fr)); }
}

.tile {
  background     : var(--panel);
  border         : 1px solid var(--border);
  border-radius  : var(--radius);
  display        : flex;
  flex-direction : column;
  overflow       : hidden;
}

.tile-off { opacity : 0.55; }

.tile-media {
  align-items     : center;
  aspect-ratio    : 16 / 9;
  background      : var(--field);
  border-bottom   : 1px solid var(--border);
  color           : var(--muted);
  display         : flex;
  font-family     : var(--font-mono);
  font-size       : 0.68rem;
  justify-content : center;
  letter-spacing  : 0.1em;
  text-transform  : uppercase;
}

.tile-body { padding : 0.5rem 0.6rem 0.3rem; }

.tile-name {
  font-size     : 0.95rem;
  font-weight   : 600;
  margin        : 0;
  overflow      : hidden;
  text-overflow : ellipsis;
  white-space   : nowrap;
}

.tile-meta {
  color         : var(--muted);
  font-size     : 0.78rem;
  margin        : 0.05rem 0 0.3rem;
  overflow      : hidden;
  text-overflow : ellipsis;
  white-space   : nowrap;
}

.tile-status {
  align-items : center;
  color       : var(--muted);
  display     : flex;
  font-size   : 0.75rem;
  gap         : 0.35rem;
  margin      : 0;
}

.dot {
  border-radius : 50%;
  display       : inline-block;
  flex          : 0 0 auto;
  height        : 10px;
  width         : 10px;
}

.dot-green { background : var(--accent); box-shadow : 0 0 8px rgba(62, 224, 132, 0.5); }

.dot-amber { background : var(--warn); }

.dot-red { background : rgb(255 107 107); box-shadow : 0 0 8px rgba(255, 90, 90, 0.4); }

.dot-grey { background : var(--muted); opacity : 0.6; }

.tile-actions {
  display : flex;
  gap     : 0.4rem;
  padding : 0 0.6rem 0.6rem;
}

.btn-tile {
  background    : var(--field);
  border        : 1px solid var(--border);
  border-radius : 6px;
  color         : var(--text);
  font-size     : 0.8rem;
  font-weight   : 500;
  min-height    : 34px;
  padding       : 0.3rem 0.7rem;
  width         : auto;
}

.btn-tile:hover { background : var(--panel-2); filter : none; }

.btn-tile-danger {
  border-color : rgba(255, 90, 90, 0.4);
  color        : var(--danger-text);
}

.empty-state {
  border        : 1px dashed var(--border);
  border-radius : var(--radius);
  padding       : 2rem 1.5rem;
  text-align    : center;
}

.btn-cta { margin-top : 0.75rem; max-width : 240px; }

/* --- settings modal ---------------------------------------------------------
   display is controlled by the .js gate above: JS-off sessions never see the modal. */
.modal-backdrop {
  align-items     : flex-start;
  background      : rgba(3, 6, 5, 0.72);
  inset           : 0;
  justify-content : center;
  overflow-y      : auto;
  padding         : 1.25rem;
  position        : fixed;
  z-index         : 20;
}

.js .modal-backdrop:not([hidden]) { display : flex; }

.modal {
  background    : var(--panel);
  border        : 1px solid var(--border);
  border-radius : var(--radius);
  /* Stage 4i — the card always fits the viewport: pinned title/close, a scrolling .modal-body middle,
     and sticky actions. The backdrop's overflow-y:auto stays only as an untriggered safety net. */
  display       : flex;
  flex-direction: column;
  max-height    : min(700px, calc(100dvh - 2.5rem)); /* backdrop padding is 1.25rem top + bottom */
  padding       : 1.25rem;
  position      : relative;
  width         : min(640px, 100%);
}

/* HUD corner ticks (stage 4h). */
.modal::before, .modal::after { content: ""; position: absolute; pointer-events: none; width: 16px; height: 16px; opacity: 0.85; }

.modal::before { top: -2px; left: -2px; border-top: 2px solid var(--accent); border-left: 2px solid var(--accent); }

.modal::after { bottom: -2px; right: -2px; border-bottom: 2px solid var(--accent); border-right: 2px solid var(--accent); }

.modal h2 {
  flex          : 0 0 auto; /* stage 4i — pinned above the scroll region (never scrolls away) */
  font-family   : var(--font-display);
  font-size     : 1.05rem;
  font-weight   : 400; /* Audiowide is single-weight */
  letter-spacing: 0.05em;
  margin        : 0 0 1rem;
}

/* Stage 4i — the variable middle of every modal (fields / results / account list) is its only scroll region,
   so a 13-field camera form on a laptop-height screen scrolls INSIDE the card instead of the whole page. */
.modal-body {
  flex            : 1 1 auto;
  min-height      : 0;
  overflow-y      : auto;
  overscroll-behavior: contain;
  scrollbar-color : var(--border-hi) transparent;
  scrollbar-width : thin;
}

.modal-body::-webkit-scrollbar { width : 10px; }

.modal-body::-webkit-scrollbar-thumb {
  background    : var(--border-hi);
  border        : 2px solid var(--panel);
  border-radius : 5px;
}

.modal-close {
  background    : transparent;
  border        : none;
  border-radius : 6px;
  color         : var(--muted);
  font-size     : 1.05rem;
  min-height    : 44px;
  min-width     : 44px;
  padding       : 0;
  position      : absolute;
  right         : 0.6rem;
  top           : 0.5rem;
  width         : auto;
}

.modal-close:hover { background : var(--panel-2); color : var(--text); filter : none; }

.field { margin-bottom : 0.85rem; }

.field > label { margin-bottom : 0.3rem; }

.field input[type="text"],
.field input[type="number"],
.field select,
.field textarea {
  background    : var(--field);
  border        : 1px solid var(--border);
  border-radius : 8px;
  color         : var(--text);
  font-family   : inherit;
  font-size     : 0.95rem;
  min-height    : 44px; /* touch target */
  padding       : 0.55rem 0.7rem;
  width         : 100%;
}

/* Technical data fields read better in mono (stage 4h). */
#f-mac, #f-model, #f-serial, #f-fw, #f-main, #f-sub {
  font-family: var(--font-mono);
  font-size  : 0.85rem;
}

.field textarea { min-height : 64px; resize : vertical; }

.field-row {
  display               : grid;
  gap                   : 0.6rem;
  grid-template-columns : 1fr 1fr 1fr;
}

.field-check { align-items : flex-end; display : flex; }

.check {
  align-items : center;
  color       : var(--text);
  cursor      : pointer;
  display     : flex;
  gap         : 0.5rem;
  margin      : 0.3rem 0 0;
  min-height  : 44px;
}

.check input { min-height : 0; width : auto; }

.hint {
  color     : var(--muted);
  font-size : 0.78rem;
  margin    : -0.45rem 0 0.85rem;
}

.url-saved {
  align-items : center;
  color       : var(--ok-text);
  display     : flex;
  font-size   : 0.8rem;
  gap         : 0.4rem;
  margin      : -0.45rem 0 0.85rem;
}

.modal-msg {
  background    : rgba(62, 224, 132, 0.09);
  border        : 1px solid rgba(62, 224, 132, 0.3);
  border-radius : 8px;
  color         : var(--ok-text);
  font-size     : 0.88rem;
  margin        : 0 0 0.75rem;
  padding       : 0.55rem 0.7rem;
}

.modal-error {
  background    : var(--danger-bg);
  border        : 1px solid rgba(255, 90, 90, 0.35);
  border-radius : 8px;
  color         : var(--danger-text);
  font-size     : 0.88rem;
  margin        : 0 0 0.75rem;
  padding       : 0.55rem 0.7rem;
}

/* Stage 4i — actions pin to the scroll region's bottom edge while long forms scroll behind them
   (padding, not margin, above keeps the stuck block opaque). Short modals render exactly as before. */
.modal-actions {
  background : var(--panel);
  border-top : 1px solid var(--border);
  display    : flex;
  flex-wrap  : wrap;
  gap        : 0.6rem;
  padding    : 0.75rem 0 0.2rem;
  position   : sticky;
  bottom     : 0;
}

.modal-actions .btn { width : auto; }

/* --- discovery panel (phase 2b) ----------------------------------------------
    The panel reuses .modal-backdrop/.modal, so it inherits the .js gate above. */
.discover-note { color : var(--muted); font-size : 0.85rem; margin : 0.4rem 0 0.85rem; }

.discover-results { margin : 0.25rem 0 0.5rem; }

.discover-row {
  align-items : center;
  border-top  : 1px solid var(--border);
  display     : flex;
  flex-wrap   : wrap;
  gap         : 0.55rem;
  padding     : 0.6rem 0.15rem;
}

.discover-row .ip { font-family : var(--font-mono); font-weight : 600; }

.discover-row .prov { color : var(--muted); font-size : 0.8rem; }

.discover-badge { margin-left : 0.25rem; }

/* In-flight scan feedback (field polish 2026-09-21): visual status row — spinner, per-phase bar,
   elapsed timer, running count. JS-created (.dscan); hidden until a scan starts, stays visible
   until the stream's done/error so a long sweep never looks finished mid-confirm/tiebreak.
   Announced phase text travels through #discover-msg (role=status) — this row is aria-hidden. */
.dscan {
  align-items : center;
  display     : none;
  flex-wrap   : wrap;
  gap         : .5rem;
  margin      : .3rem 0 .4rem;
}

.dscan.on { display : flex; }

.dspin {
  animation        : dspin 1s linear infinite;
  border           : 2px solid var(--border);
  border-top-color : var(--accent);
  border-radius    : 50%;
  flex             : none;
  height           : 14px;
  width            : 14px;
}

@keyframes dspin {
  to { transform : rotate(1turn); }
}

.dbar {
  background    : var(--border);
  border-radius : 2px;
  flex          : 1 1 60px;
  height        : 4px;
  min-width     : 48px;
  overflow      : hidden;
}

.dfill {
  background    : var(--accent);
  border-radius : 2px;
  box-shadow    : 0 0 8px rgba(62, 224, 132, 0.5);
  height        : 100%;
  transition    : width .3s ease;
  width         : 0;
}

.dphase, .dtimer, .dfound { color : var(--muted); font-size : .8rem; }

.dtimer { flex : none; font-family : var(--font-mono); font-variant-numeric : tabular-nums; }

/* --- Phase 3c: snapshot tiles, state chips & focus view ---------------------
    Tiles stay progressive (JS-off = static list); everything below only activates
    with .js present or via elements JS creates (.snap / .tile-chip). */
/* Micro-interactions: lift + shadow on hover, gentle image breathe (150–200 ms ease-out;
   prefers-reduced-motion kill-switch above disables all of it). */
.js .wall-grid .tile { cursor : pointer; transition : transform 0.18s ease-out, box-shadow 0.18s ease-out, border-color 0.18s ease-out; }

.js .wall-grid .tile:hover {
  border-color: var(--border-hi);
  box-shadow  : 0 12px 28px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(62, 224, 132, 0.16);
  transform   : translateY(-2px);
  z-index     : 1;
}

.tile-media img.snap { transition : transform 0.3s ease-out; }

.js .wall-grid .tile:hover img.snap { transform : scale(1.035); }

.tile-media { position : relative; }

.tile-media img.snap {
  display     : block;
  height      : 100%;
  object-fit  : cover;
  width       : 100%;
}

/* State chip (starting… / queued / no signal / LIVE) — top-left of the media area. */
.tile-chip {
  background    : rgba(3, 6, 5, 0.78);
  border        : 1px solid var(--border);
  border-radius : 999px;
  color         : var(--text);
  font-size     : 0.68rem;
  letter-spacing: 0.04em;
  line-height   : 1;
  padding       : 0.32rem 0.55rem;
  position      : absolute;
  top           : 0.4rem;
  left          : 0.4rem;
  z-index       : 2;
}

.chip-amber { border-color : rgba(240, 185, 60, 0.55); color : var(--warn); }

.chip-red   { border-color : rgba(255, 90, 90, 0.55); color : var(--danger-text); }

.chip-green { border-color : rgba(62, 224, 132, 0.55); color : var(--accent); box-shadow : 0 0 10px rgba(62, 224, 132, 0.18); }

/* --- focus view (tap → live play) -------------------------------------------
    display is .js-gated like the modal: JS-off sessions never see an empty overlay. */
.focus-view { display : none; }
.js .focus-view:not([hidden]) {
  align-items   : stretch;
  background    : var(--bg-deep);
  bottom        : 0;
  display       : flex;
  flex-direction: column;
  inset         : 0;
  left          : 0;
  position      : fixed;
  right         : 0;
  top           : 0;
  z-index       : 30;
}

.focus-topbar {
  align-items : center;
  display     : flex;
  gap         : 0.6rem;
  justify-content: space-between;
  padding     : 0.55rem 0.75rem;
}

.focus-title {
  flex        : 1 1 auto; /* stage 4e F1 — leaves room for the position indicator + close */
  min-width   : 0;
  font-size   : 1rem;
  font-weight : 600;
  letter-spacing: 0.02em;
  margin      : 0;
  overflow    : hidden;
  text-overflow: ellipsis;
  white-space : nowrap;
}

/* Stage 4e F1 — "N / M" position indicator in the user's wall order (topbar).
   Stage 4h — mono data readout; lights up while a multi-camera wall is focused. */
.focus-pos {
  color               : var(--muted);
  flex                : 0 0 auto;
  font-family         : var(--font-mono);
  font-size           : 0.8rem;
  font-variant-numeric: tabular-nums;
}

.focus-pos:not(:empty) { color : var(--accent); }

.focus-close { flex : 0 0 auto; min-height : 44px; padding : 0.35rem 0.8rem; }

.focus-stage {
  display     : flex;
  flex        : 1 1 auto;
  align-items : center;
  justify-content: center;
  min-height  : 0;
  position    : relative;
  background  : var(--bg-deep);
}

.focus-stage video {
  max-height  : 100%;
  max-width   : 100%;
  width       : 100%;
  aspect-ratio: 16 / 9;
  object-fit  : contain;
  background  : var(--bg-deep);
}

.focus-chip { top : 0.6rem; left : 0.6rem; font-size : 0.72rem; }

.focus-controls {
  align-items : center;
  display     : flex;
  flex-wrap   : wrap;
  gap         : 0.5rem;
  padding     : 0.55rem 0.75rem calc(0.55rem + env(safe-area-inset-bottom));
  background  : var(--panel);
  border-top  : 1px solid var(--border);
}

/* Stage 4h — focus control clusters: position controls left, stream actions right;
   every control shares one height so the bar reads as a single aligned row. */
.focus-nav {
  display    : flex;
  flex-wrap  : wrap; /* stage 4i — the row gained two buttons; on phones it wraps inside itself instead of pushing the bar over */
  gap        : 0.4rem;
}

.focus-nav .btn-tile { white-space : nowrap; }

/* Stage 4i — reorder-from-focus glyphs (admin-only): compact square spec, same height as the rest of the bar.
   Disabled at first/last wall position (wall.js), mirroring the tile ⋮ menu. */
.focus-move-btn {
  font-size    : 1rem;
  line-height  : 1;
  min-width    : 38px;
  padding      : 0 0.55rem;
}

.focus-acts { display : flex; gap : 0.4rem; margin-left : auto; }

.focus-controls .btn-tile, .focus-quality select { min-height : 38px; }

@media (hover: none) {
  .focus-controls .btn-tile, .focus-quality select { min-height : 44px; } /* §10 touch target */
}

.focus-jump-btn { letter-spacing : 0.02em; }

.focus-jump-btn[aria-expanded="true"] { border-color : var(--accent); color : var(--accent); }

.focus-quality {
  align-items : center;
  color       : var(--muted);
  display     : flex;
  font-size   : 0.8rem;
  gap         : 0.45rem;
}

.focus-quality select {
  background    : var(--field);
  border        : 1px solid var(--border);
  border-radius : 6px;
  color         : var(--text);
  font-size     : 0.8rem;
  min-height    : 38px;
  padding       : 0.25rem 0.5rem;
}

.discover-add { margin-left : auto; min-height : 44px; width : auto; }

/* --- Stage 4h: jump-to-camera list (position selector popup) ------------------
   wall.js positions it above the controls bar (inline bottom) and rebuilds rows on open. */
.focus-camlist {
  background    : var(--panel);
  border        : 1px solid var(--border);
  border-radius : var(--radius);
  box-shadow    : 0 18px 48px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(62, 224, 132, 0.08);
  display       : none;
  flex-direction: column;
  left          : 50%;
  max-height    : min(52vh, 420px);
  overflow      : hidden;
  position      : fixed;
  transform     : translateX(-50%);
  width         : min(400px, calc(100vw - 32px));
  z-index       : 35;
}

.js .focus-camlist:not([hidden]) { display : flex; animation : camlist-in 0.18s ease-out; }

@keyframes camlist-in {
  from { opacity : 0; transform : translateX(-50%) translateY(6px); }
  to   { opacity : 1; transform : translateX(-50%); }
}

/* HUD corner ticks (stage 4h). */
.focus-camlist::before, .focus-camlist::after { content: ""; position: absolute; pointer-events: none; width: 16px; height: 16px; opacity: 0.85; }

.focus-camlist::before { top: -2px; left: -2px; border-top: 2px solid var(--accent); border-left: 2px solid var(--accent); }

.focus-camlist::after { bottom: -2px; right: -2px; border-bottom: 2px solid var(--accent); border-right: 2px solid var(--accent); }

.fcl-head {
  align-items   : center;
  border-bottom : 1px solid var(--border);
  color         : var(--muted);
  display       : flex;
  font-size     : 0.75rem;
  justify-content: space-between;
  letter-spacing: 0.08em;
  margin        : 0;
  padding       : 0.6rem 0.8rem 0.5rem;
  text-transform: uppercase;
}

.fcl-count { font-family : var(--font-mono); font-size : 0.72rem; letter-spacing : 0; opacity : 0.9; text-transform : none; }

.fcl-scroll {
  display         : flex;
  flex-direction  : column;
  gap             : 0.15rem;
  overflow-y      : auto;
  overscroll-behavior: contain;
  padding         : 0.3rem;
}

.fcl-row {
  align-items   : center;
  background    : transparent;
  border        : none;
  border-left   : 2px solid transparent;
  border-radius : 4px;
  color         : var(--text);
  cursor        : pointer;
  display       : flex;
  gap           : 0.6rem;
  min-height    : 40px;
  padding       : 0.3rem 0.55rem;
  text-align    : left;
  width         : 100%;
}

.fcl-row:hover { background : var(--panel-2); filter : none; }

.fcl-row.cur { background : rgba(62, 224, 132, 0.08); border-left-color : var(--accent); }

.fcl-row .idx {
  color        : var(--muted);
  flex         : 0 0 auto;
  font-family  : var(--font-mono);
  font-size    : 0.72rem;
  text-align   : right;
  width        : 2ch;
}

.fcl-row.cur .idx { color : var(--accent); }

.fcl-row .nm {
  flex         : 1 1 auto;
  font-size    : 0.85rem;
  font-weight  : 500;
  overflow     : hidden;
  text-overflow: ellipsis;
  white-space  : nowrap;
}

.fcl-row .ip { color : var(--muted); flex : 0 0 auto; font-family : var(--font-mono); font-size : 0.72rem; }

/* --- Phase 4b: wall scale to 26+ (content-visibility) + per-user layout (D8) --
   content-visibility is progressive enhancement: engines without support ignore it.
   The `auto` keyword in contain-intrinsic-size remembers each tile's last rendered size, so
   scrollbars don't jump once a tile has painted. */
.tile { content-visibility : auto; contain-intrinsic-size : auto 200px; }

/* Reorder control — JS-only (progressive wall), 44 px touch target (§10). Hover-revealed on
   pointer devices, always visible on touch. Button taps never reach the focus handler (JS guard). */
.tile-more {
  align-items    : center;
  background     : rgba(3, 6, 5, 0.78);
  border         : 1px solid var(--border);
  border-radius  : 6px;
  color          : var(--text);
  display        : none;
  font-size      : 1rem;
  height         : 44px;
  justify-content: center;
  line-height    : 1;
  padding        : 0;
  position       : absolute;
  right          : 6px;
  top            : 6px;
  /* Explicit width (not just min-width): the global `button { width:100% }` rule otherwise
     stretches this to full tile width and centers the glyph (box round-2 screenshot, 2026-09-20). */
  width          : 44px;
  z-index        : 2;
}

.js .tile { position : relative; }

.js .tile-more {
  display   : flex;
  opacity   : 0.55;
  transition: opacity 120ms ease;
}

.js .tile:hover .tile-more,
.js .tile:focus-within .tile-more,
.js .tile-more:focus-visible { opacity : 1; }

@media (hover: none) {
  .js .tile-more { opacity : 0.85; } /* touch: always visible */
}

/* Shared reorder menu — wall.js sets left/top inline at the tapped ⋮ button. Below the modal (z 20). */
.tile-menu {
  background    : var(--panel);
  border        : 1px solid var(--border);
  border-radius : var(--radius);
  box-shadow    : 0 8px 24px rgba(0, 0, 0, 0.5);
  display       : none;
  flex-direction: column;
  gap           : 0.3rem;
  left          : 0;
  padding       : 0.35rem;
  position      : fixed;
  top           : 0;
  /* Explicit width — deterministic geometry; mirrors the mw constant in wall.js openTileMenu(). */
  width         : 176px;
  z-index       : 15;
}

.js .tile-menu:not([hidden]) { display : flex; }

.tile-menu-item {
  text-align: left;
  width     : 100%;
  min-height: 44px; /* §10 touch target */
}

.tile-menu-item:disabled { cursor : default; opacity : 0.45; }

/* Stage 4k — "Reset order" moved into a two-step ⋯ overflow menu (admin-only). The popover mirrors the
   .tile-menu panel spec — wall.js sets left/top inline at the trigger's rect; z16 keeps it clear of the
   tile menu. Without JS nothing removes [hidden], so the popover can never appear on its own. */
#wall-menu-btn { min-width : 38px; padding-left : 0.5rem; padding-right : 0.5rem; } /* deterministic icon geometry (.btn gives width:auto) */

.wall-menu {
  background    : var(--panel);
  border        : 1px solid var(--border);
  border-radius : var(--radius);
  box-shadow    : 0 8px 24px rgba(0, 0, 0, 0.5);
  display       : none;
  flex-direction: column;
  gap           : 0.3rem;
  left          : 0;
  padding       : 0.35rem;
  position      : fixed;
  top           : 0;
  /* Explicit width — deterministic geometry; mirrors the mw constant in wall.js openWallMenu(). */
  width         : 200px;
  z-index       : 16;
}

.js .wall-menu:not([hidden]) { display : flex; }

.wm-head {
  border-bottom : 1px solid var(--border);
  color         : var(--muted);
  font-size     : 0.7rem;
  letter-spacing: 0.08em;
  margin        : -0.35rem -0.35rem 0;
  padding       : 0.45rem 0.65rem;
  text-transform: uppercase;
}

/* Stage 4l — live order-state line (wall.js fills it on every open). */
.wm-state {
  color   : var(--muted);
  font-size: 0.75rem;
  margin  : 0;
}

/* Stage 4e F5 — wall refresh cadence control (toolbar, all roles). JS-hidden: without .js the select
   has no persistence path, so it stays out of the read-only wall (same treatment as stage 4k's popover). */
.cadence-label {
  align-items : center;
  color       : var(--muted);
  display     : none;
  font-size   : 0.8rem;
  gap         : 0.4rem;
  margin      : 0;
  white-space : nowrap;
}

.js .cadence-label { display : inline-flex; }

.cadence-label select {
  background    : var(--field);
  border        : 1px solid var(--border);
  border-radius : 6px;
  color         : var(--text);
  font-family   : var(--font-mono); /* stage 4h — timing readout */
  font-size     : 0.8rem;
  min-height    : 32px; /* stage 4e F2 — matches the .btn-sm toolbar spec */
  padding       : 0.25rem 0.5rem;
  width         : auto;
}

.layout-status {
  color     : var(--muted);
  font-size : 0.8rem;
  margin    : 0;
  min-height: 1em;
}

.btn-tile:disabled { cursor : default; opacity : 0.45; }

/* Focus cinema mode: chrome fades after idle (wall.js toggles .idle),
   any mouse move / key restores it. pointer-events off while hidden so nothing phantom-clicks. */
.focus-view .focus-topbar,
.focus-view .focus-controls { transition : opacity 0.45s ease; }

.js .focus-view.idle .focus-topbar,
.js .focus-view.idle .focus-controls { opacity : 0; pointer-events : none; }

/* Modal polish: soft fade + slide on open (keyframes only run when shown). */
@keyframes backdrop-in {
  from { opacity : 0; }
  to   { opacity : 1; }
}

@keyframes modal-in {
  from { opacity : 0; transform : translateY(8px) scale(0.985); }
  to   { opacity : 1; transform : none; }
}

.js .modal-backdrop:not([hidden]) { animation : backdrop-in 0.16s ease-out; }
.js .modal-backdrop:not([hidden]) > .modal { animation : modal-in 0.2s ease-out; }

/* Kiosk stage mode (pure snapshot grid). z25 = below focus(30), above wall chrome;
   gap/padding MUST mirror STAGE_GAP/STAGE_PAD in wall.js (fit math assumes them).
   align-content:center is SAFE-centred by flexbox spec: when the grid outgrows the viewport it
   degrades to top alignment and .stage-view scrolls instead of clipping the first row. */
.stage-view { display : none; }

.js .stage-view:not([hidden]) {
  background: var(--bg-deep);
  display   : block; /* house pattern — the base `display:none` wins the cascade without this (field bug 2026-10-19) */
  inset     : 0;
  overflow  : auto;
  position  : fixed;
  z-index   : 25;
}

.stage-grid {
  align-content   : center;
  display         : flex;
  flex-wrap       : wrap;
  gap             : 6px;
  justify-content : center;
  min-height      : 100%;
  padding         : 12px;
}

.stage-cell {
  aspect-ratio: 16 / 9;
  background  : rgb(8, 14, 10);
  border-radius: 4px;
  cursor      : pointer;
  flex        : none;
  overflow    : hidden;
}

.stage-cell img { display : block; height : 100%; object-fit : cover; width : 100%; }

/* Awaiting first frame — subtle pulse (reduced-motion kill-switch above disables it). */
.stage-cell-empty { animation : stage-pulse 1.6s ease-in-out infinite; }

@keyframes stage-pulse {
  0%, 100% { background : rgb(8, 14, 10); }
  50%      { background : rgb(14, 24, 18); }
}

.stage-hint {
  bottom        : 0.5rem;
  color         : var(--muted);
  font-family   : var(--font-mono);
  font-size     : 0.72rem;
  opacity       : 0;
  pointer-events: none;
  position      : fixed;
  right         : 0.6rem;
  transition    : opacity 0.3s ease;
}

.stage-view:not(.idle) .stage-hint { opacity : 0.8; }

.stage-view.idle { cursor : none; }

/* Stage 4j — on-screen exit for touch devices (the "mobile stage broken" field report): a phone has no
   Esc/'S' and the toolbar Stage button sits under this overlay, so there was no way out. Fixed SIBLING of
   #stage-view (not a child) so it stays pinned while the grid scrolls; z26 = above stage (25), below the
   focus view (30), which covers it with its own close button when open on top. */
#stage-exit, #group-exit { display : none; }

.js #stage-exit:not([hidden]),
.js #group-exit:not([hidden]) {
  align-items    : center;
  background     : rgba(5, 9, 7, 0.78);
  border         : 1px solid var(--border);
  border-radius  : 8px;
  color          : var(--text);
  display        : inline-flex;
  font-size      : 0.8rem;
  gap            : 0.4rem;
  min-height     : 38px;
  opacity        : 0.92;
  padding        : 0.35rem 0.7rem;
  position       : fixed;
  right          : 12px;
  top            : calc(10px + env(safe-area-inset-top));
  transition     : opacity 0.3s ease;
  z-index        : 26; /* above stage (25), below focus view (30) */
}

@media (hover: none) {
  .js #stage-exit:not([hidden]),
  .js #group-exit:not([hidden]) { min-height : 44px; } /* §10 touch target — the ONLY exit on a phone */
}

/* Kiosk idle fade for pointer devices only — mouse users keep Esc/'S'; on touch it never fades. */
@media (hover: hover) {
  .stage-view.idle ~ #stage-exit { opacity : 0; pointer-events : none; }
}

/* Group view — the 8-camera live wall (user request 2026-10-19). Third kiosk overlay beside stage:
   z25 like stage (below focus 30, above wall chrome); #group-exit reuses the .stage-exit spec (z26).
   gap/padding MUST mirror GROUP_GAP/GROUP_PAD in wall.js — the fit math assumes them. */
.group-view { display : none; }

.js .group-view:not([hidden]) {
  background: var(--bg-deep);
  display   : block; /* house pattern — the base `display:none` wins the cascade without this (field bug 2026-10-19) */
  inset     : 0;
  overflow  : auto;
  position  : fixed;
  z-index   : 25;
}

.group-grid {
  align-content   : center;
  display         : flex;
  flex-wrap       : wrap;
  gap             : 6px;   /* mirrors GROUP_GAP in wall.js */
  justify-content : center;
  min-height      : 100%;
  padding         : 12px;  /* mirrors GROUP_PAD in wall.js */
}

.group-cell {
  aspect-ratio : 16 / 9;
  background   : rgb(8, 14, 10);
  border-radius: 4px;
  cursor       : pointer;
  flex         : none;
  overflow     : hidden;
  position     : relative; /* anchors the name label + state chip */
}

/* Live tile video — contain like focus (letterbox, never crop a wall of cameras). */
.group-cell video {
  background: rgb(8, 14, 10);
  display   : block;
  height    : 100%;
  object-fit: contain;
  width     : 100%;
}

/* Empty slot — the ＋ Add affordance (dashed = "drop a camera here"). */
.group-add {
  align-items    : center;
  background     : transparent;
  border         : 1px dashed var(--border-hi);
  border-radius  : 4px;
  color          : var(--muted);
  cursor         : pointer;
  display        : flex;
  font-family    : var(--font-mono);
  font-size      : 0.78rem;
  height         : 100%;
  justify-content: center;
  letter-spacing : 0.06em;
  width          : 100%;
}

.group-add:hover { background : var(--panel-2); color : var(--text); }

/* Name label — bottom-left mono, clear of the chip (top-left) and ✕ (top-right). */
.group-name {
  background   : linear-gradient(0deg, rgba(3, 6, 5, 0.82), transparent);
  bottom       : 0;
  color        : var(--text);
  font-family  : var(--font-mono);
  font-size    : 0.7rem;
  left         : 0;
  letter-spacing: 0.04em;
  margin       : 0;
  max-width    : calc(100% - 2.6rem);
  overflow     : hidden;
  padding      : 1.1rem 0.5rem 0.35rem;
  position     : absolute;
  text-overflow: ellipsis;
  white-space  : nowrap;
}

/* ✕ remove — top-right, mirrors the tile ⋮ placement; §10 touch target. */
.group-remove {
  align-items    : center;
  background     : rgba(3, 6, 5, 0.78);
  border         : 1px solid var(--border);
  border-radius  : 6px;
  color          : var(--text);
  cursor         : pointer;
  display        : flex;
  font-size      : 0.9rem;
  height         : 34px;
  justify-content: center;
  position       : absolute;
  right          : 0.4rem;
  top            : 0.4rem;
  width          : 34px;
}

.group-remove:hover { border-color : var(--border-hi); background : rgba(16, 27, 21, 0.9); }

/* State chip (starting… / queued ≈Ns / no signal) — top-left via the shared .tile-chip spec.
   The off/removed paint reuses it too; live tiles carry no chip (the video is proof of life). */
.group-chip { font-size : 0.62rem; }

/* Group hint — stage-hint parity: visible at rest, fades with the kiosk idle class. */
.group-hint {
  bottom        : 0.5rem;
  color         : var(--muted);
  font-family   : var(--font-mono);
  font-size     : 0.72rem;
  opacity       : 0.8;
  pointer-events: none;
  position      : fixed;
  right         : 0.6rem;
}

/* Group picker — same anatomy as #focus-camlist, but wall.js anchors it near the tapped slot with
   inline left/top, so the centring transform + its keyframes are switched off for this id only. */
#group-camlist { animation : none; left : auto; transform : none; }

/* Rows already in the group: disabled + dimmed (one slot per camera). */
.fcl-row.off, .fcl-row:disabled { cursor : default; opacity : 0.45; }

/* Fast/slow snapshot indicator: ~10 px dot in the media corner (bottom-right, clear of
   chip top-left and ⋮ top-right). Low-opacity at rest → full on tile hover; title carries last + avg ms. */
.tile-speed {
  border-radius: 50%;
  bottom       : 0.4rem;
  height       : 9px;
  opacity      : 0.55;
  position     : absolute;
  right        : 0.4rem;
  transition   : opacity 0.15s ease;
  width        : 9px;
  z-index      : 2;
}

.js .wall-grid .tile:hover .tile-speed,
.js .wall-grid .tile:focus-within .tile-speed { opacity : 1; }

.tile-speed.speed-fast { background : var(--accent); box-shadow : 0 0 6px rgba(62, 224, 132, 0.55); }

.tile-speed.speed-slow { background : var(--warn); box-shadow : 0 0 6px rgba(240, 185, 60, 0.6); }

/* Read-only identity block at the top of the shared ⋮ menu (all roles; the move items
   below it stay admin-gated in JS per decision D-B). Widths fit the 176 px menu without wrapping. */
.tile-menu-info {
  border-bottom: 1px solid var(--border);
  display      : flex;
  flex-direction: column;
  gap          : 0.15rem;
  margin-bottom: 0.25rem;
  padding      : 0.3rem 0.45rem 0.5rem;
}

.tmi-name {
  color        : var(--text);
  font-size    : 0.85rem;
  font-weight  : 600;
  margin       : 0 0 0.15rem;
  max-width    : 20ch;
  overflow     : hidden;
  text-overflow: ellipsis;
  white-space  : nowrap;
}

.tmi-row {
  color      : var(--muted);
  display    : flex;
  font-size  : 0.75rem;
  gap        : 0.5rem;
  line-height: 1.35;
  margin     : 0;
}

.tmi-row .k { flex : 0 0 auto; min-width : 4ch; opacity : 0.8; }

.tmi-row .v {
  font-family         : var(--font-mono); /* stage 4h — IP/MAC/timing readouts */
  font-size           : 0.72rem;
  font-variant-numeric: tabular-nums;
  overflow            : hidden;
  text-overflow       : ellipsis;
  white-space         : nowrap;
}

/* Topbar account menu. Progressive: without the js-users marker (users.js failed or
   absent) the legacy Sign-out form stays visible, so sign-out is never lost to a script error. */
.userbtn {
  align-items : center;
  background  : var(--field);
  border      : 1px solid var(--border);
  border-radius: 999px;
  color       : var(--text);
  cursor      : pointer;
  display     : none;
  font-size   : 0.85rem;
  gap         : 0.5rem;
  min-height  : 40px;
  padding     : 0.2rem 0.7rem 0.2rem 0.3rem;
  width       : auto;
}

.js-users .userbtn { display : inline-flex; }
.userbtn:hover { background : var(--panel-2); filter : none; }

.user-avatar {
  align-items   : center;
  background    : var(--accent);
  border-radius : 50%;
  color         : var(--on-accent);
  display       : flex;
  font-size     : 0.72rem;
  font-weight   : 700;
  height        : 26px;
  justify-content: center;
  letter-spacing: 0.02em;
  min-width     : 26px;
  padding       : 0 4px;
}

.userbtn .who { max-width : 14ch; overflow : hidden; text-overflow : ellipsis; white-space : nowrap; }

.js-users .userbox > .topbar-legacy { display : none; } /* legacy sign-out hides only while the menu is live */

.usermenu-signout { align-items : stretch; display : flex; margin : 0; width : 100%; }
.usermenu-signout .usermenu-item { border-radius : 6px; }

.usermenu {
  background    : var(--panel);
  border        : 1px solid var(--border);
  border-radius : var(--radius);
  box-shadow    : 0 8px 24px rgba(0, 0, 0, 0.5);
  display       : none;
  flex-direction: column;
  gap           : 0.3rem;
  /* Stage 4i — capped to the viewport so it can't bleed past a phone's right edge (was a bare min-width). */
  width         : min(280px, calc(100vw - 2rem));
  padding       : 0.35rem;
  position      : fixed;
  right         : 1rem;
  top           : 3.6rem;
  z-index       : 12;
}

.js-users .usermenu:not([hidden]) { display : flex; }

.usermenu-acc {
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.2rem;
  max-width    : 26ch;
  padding      : 0.45rem 0.6rem 0.55rem;
}

.usermenu-acc .n {
  font-size    : 0.9rem;
  font-weight  : 600;
  overflow     : hidden;
  text-overflow: ellipsis;
  white-space  : nowrap;
}

.usermenu-item {
  align-items : center;
  background  : transparent;
  border      : none;
  border-radius: 6px;
  color       : var(--text);
  cursor      : pointer;
  display     : flex;
  font-size   : 0.88rem;
  gap         : 0.5rem;
  min-height  : 40px;
  padding     : 0 0.6rem;
  text-align  : left;
  width       : 100%;
}

.usermenu-item:hover { background : var(--panel-2); filter : none; }

/* Account list rows in the Manage dialog (reuses .modal chrome). */
.users-list { display : flex; flex-direction : column; margin-bottom : 1rem; }

.user-row {
  align-items: center;
  border-top : 1px solid var(--border);
  display    : flex;
  flex-wrap  : wrap;
  gap        : 0.55rem;
  padding    : 0.6rem 0.15rem;
}

.user-row:first-child { border-top : none; }

.user-row .n { font-weight : 600; min-width : 8ch; overflow : hidden; text-overflow : ellipsis; white-space : nowrap; max-width: 22ch; }

.user-row .e {
  color        : var(--muted);
  flex         : 1 1 auto;
  font-family  : var(--font-mono);
  font-size    : 0.78rem;
  min-width    : 12ch;
  overflow     : hidden;
  text-overflow: ellipsis;
  white-space  : nowrap;
}

.user-row .l { color : var(--muted); font-family : var(--font-mono); font-size : 0.75rem; font-variant-numeric : tabular-nums; margin-left : auto; }
