/* ── SIFT Console — Global Styles ───────────────────────────────────────── */

:root {
  /* Valeryan palette — warm darks, gold accent (aligned with valeryanlabs.github.io) */
  --bg-primary: #0c0a08;
  --bg-secondary: #161210;
  --bg-card: rgba(30, 24, 18, 0.8);
  --bg-card-hover: rgba(42, 34, 24, 0.85);
  --bg-input: #141110;
  --border: #2a2218;
  --border-focus: #e6a817;
  --text-primary: #e8e0d4;
  --text-secondary: #91857a;
  --text-muted: #5c524a;
  --accent: #e6a817;
  --accent-alt: #c4a46c;           /* lighter gold from valeryanlabs.github.io — inactive/future use */
  --accent-hover: #f0b82a;
  --accent-dim: rgba(230, 168, 23, 0.1);
  --danger: #e55b5b;
  --danger-hover: #d14a4a;
  --green: #00d4aa;
  --amber: #d4a847;
  --red: #e55b5b;
  --neutral: #5c524a;
  --font-ui: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'JetBrains Mono', monospace;
  --radius: 14px;
  --radius-sm: 6px;
  --nav-height: 48px;

  /* Semantic aliases */
  --bg-modal: var(--bg-secondary);
  --border-modal: var(--border);
  --text-heading: #f0ece4;
  --text-label: var(--text-secondary);
  --pcr-mismatch: #FCA5A5;

  /* Spacing scale */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 24px;

  /* Z-index layers */
  --z-dropdown: 100;
  --z-modal-backdrop: 900;
  --z-modal: 1000;
  --z-popup: 9000;
  --z-toast: 9500;

  /* Shadows — deeper, more diffuse (website style) */
  --shadow-modal: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-card: 0 6px 24px rgba(0, 0, 0, 0.4);
}

/* ── Light theme ─────────────────────────────────────────────────────── */
/* Activated via <html data-theme="light"> — build-time toggle           */

[data-theme="light"] {
  --bg-primary: #f6f4f1;
  --bg-secondary: #ffffff;
  --bg-card: rgba(255, 253, 248, 0.92);
  --bg-card-hover: rgba(245, 240, 230, 0.95);
  --bg-input: #f0ece6;
  --border: #d6cfc4;
  --border-focus: #c89a10;
  --text-primary: #1c1814;
  --text-secondary: #5c524a;
  --text-muted: #91857a;
  --accent: #c89a10;
  --accent-hover: #b08808;
  --accent-dim: rgba(200, 154, 16, 0.08);
  --danger: #d14a4a;
  --danger-hover: #b83a3a;
  --green: #059669;
  --amber: #c89a10;
  --red: #d14a4a;
  --neutral: #91857a;

  /* Semantic overrides */
  --bg-modal: #ffffff;
  --border-modal: #d6cfc4;
  --text-heading: #1c1814;
  --text-label: #5c524a;
  --pcr-mismatch: #d14a4a;

  /* Shadows — lighter for light mode */
  --shadow-modal: 0 6px 24px rgba(0, 0, 0, 0.1);
  --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.05);
}
/* Light-mode overrides for hardcoded dark colors in component sections */

/* Cards */
[data-theme="light"] .card {
  background: #ffffff; border-color: transparent; border-left: 2px solid var(--accent);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06), 0 2px 12px rgba(0, 0, 0, 0.03);
}
[data-theme="light"] .card:hover {
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1), 0 4px 20px rgba(0, 0, 0, 0.05);
}
[data-theme="light"] .card-disabled:hover { background: #ffffff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06); }
[data-theme="light"] .card-menu-btn:hover { background: rgba(0, 0, 0, 0.06); }
[data-theme="light"] .card-dropdown { background: var(--bg-secondary); border-color: var(--border); box-shadow: var(--shadow-modal); }
[data-theme="light"] .card-dropdown-item:hover { background: rgba(0, 0, 0, 0.04); }
[data-theme="light"] .card-dropdown-danger:hover { background: rgba(209, 74, 74, 0.08); }
[data-theme="light"] .card-dropdown-divider { border-color: var(--border); }
[data-theme="light"] .card-dropdown-checked { color: var(--text-primary); }

/* Status bar / footer */
[data-theme="light"] .status-bar { background: rgba(246, 244, 241, 0.9); border: 1px solid var(--border); }
[data-theme="light"] .status-bar-error { background: rgba(209, 74, 74, 0.06); border-color: rgba(209, 74, 74, 0.2); }
[data-theme="light"] .status-bar-warn { background: rgba(0, 0, 0, 0.03); border-color: var(--border); }

/* Login page */
[data-theme="light"] .login-page::before { background: linear-gradient(rgba(246, 244, 241, 0.88), rgba(246, 244, 241, 0.88)); }
[data-theme="light"] .login-form { background: rgba(255, 255, 255, 0.85); border-color: var(--border); }
[data-theme="light"] .login-error { color: var(--danger); }
[data-theme="light"] .login-btn { color: #fff; }

/* Navigation */
[data-theme="light"] .nav { border-bottom-color: var(--border); }
[data-theme="light"] .nav { background: var(--bg-secondary); }

/* Main content area overlay */
[data-theme="light"] .main { background-color: #faf8f5; }
[data-theme="light"] .main::before { background: linear-gradient(rgba(246, 244, 241, 0.94), rgba(246, 244, 241, 0.94)); }

/* Attestation */
[data-theme="light"] .att-popup .modal-close-btn { border-color: var(--border); color: var(--text-secondary); }
[data-theme="light"] .att-popup .modal-close-btn:hover { border-color: var(--text-muted); color: var(--text-primary); }
[data-theme="light"] .att-pcr-area { border-top-color: var(--border); }
[data-theme="light"] .att-detail-nav { border-bottom-color: var(--border); }
[data-theme="light"] .btn-detail-back { border-color: var(--border); color: var(--text-secondary); }
[data-theme="light"] .btn-detail-back:hover { border-color: var(--text-muted); color: var(--text-primary); }
[data-theme="light"] .pcr-event-table th { color: var(--text-secondary); border-bottom-color: var(--border); }
[data-theme="light"] .pcr-event-table td { border-bottom-color: var(--border); }
[data-theme="light"] .pcr-stability-badge { background: rgba(0, 0, 0, 0.06); }

/* Dashboard sections */
[data-theme="light"] .card-section-title { color: var(--accent); }
[data-theme="light"] .card-section-line { background: rgba(200, 154, 16, 0.2); }

/* Dialogs / overlays */
[data-theme="light"] .storage-overlay { background: rgba(0, 0, 0, 0.25); }
[data-theme="light"] .storage-dialog { border-color: var(--border); box-shadow: var(--shadow-modal); }

/* Buttons with dark text on accent — flip to white in light mode */
[data-theme="light"] .btn-primary,
[data-theme="light"] .ws-btn-active,
[data-theme="light"] .storage-btn-primary { color: #fff; }

/* Reconnect overlay */
[data-theme="light"] .reconnect-overlay { background: rgba(0, 0, 0, 0.3); }
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
input, button, textarea, select { font-family: inherit; }

html, body {
  height: 100%;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  /* Override viewer.css body reset which sets flex centering + overflow:hidden */
  display: block; overflow: visible;
}

#app { height: 100%; }
.app { display: flex; flex-direction: column; height: 100%; }
.main {
  flex: 1; overflow-y: auto; position: relative;
  background: var(--bg-primary);
  background-size: cover; background-position: center; background-repeat: no-repeat;
  animation: page-fade-in 0.3s ease-out;
}
/* Wallpaper overlay — darkens the background wallpaper.
 * Uses position:fixed so the overlay covers the full viewport even when
 * the content scrolls past the initial view (e.g. Settings page). */
.main::before {
  content: '';
  position: fixed;
  inset: 0;
  background: linear-gradient(rgba(12, 10, 8, 0.88), rgba(12, 10, 8, 0.88));
  z-index: 0;
  pointer-events: none;
}
.main > * { position: relative; z-index: 1; }

.loading {
  display: flex; align-items: center; justify-content: center;
  height: 100%; color: transparent;
}


/* ── Shared Button System ────────────────────────────────────────────── */

.btn {
  background: var(--bg-secondary); border: 1px solid var(--btn-border, var(--border));
  border-radius: var(--radius-sm); padding: var(--space-xs) 10px;
  color: var(--text-primary); font-size: 12px; cursor: pointer;
  font-family: var(--font-ui); transition: border-color 0.15s, color 0.15s;
}
.btn:hover { border-color: var(--btn-border-hover, var(--text-secondary)); }
.btn:disabled { opacity: 0.4; cursor: default; pointer-events: none; }
.btn-primary {
  background: var(--accent); border-color: var(--accent);
  color: #111; font-weight: 600;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-danger { color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: rgba(229, 91, 91, 0.1); }
.btn-ghost {
  background: transparent; border-color: transparent;
  color: var(--text-secondary); padding: var(--space-xs);
}
.btn-ghost:hover { color: var(--text-primary); background: rgba(255,255,255,0.05); }
.btn-outline {
  background: none; border-color: rgba(255, 255, 255, 0.12); color: var(--text-secondary);
}
.btn-outline:hover { border-color: rgba(255, 255, 255, 0.3); color: var(--text-primary); }
[data-theme="light"] .btn-outline {
  border-color: var(--border); color: var(--text-secondary);
}
[data-theme="light"] .btn-outline:hover { border-color: var(--text-muted); color: var(--text-primary); }
.btn-sm { padding: 2px 10px; height: 28px; }
.btn-icon {
  padding: 3px 5px; font-size: 13px; line-height: 1;
}
.btn-icon-sq {
  padding: 0; width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; line-height: 1;
}


/* ── Attestation Modal Shared Classes ────────────────────────────────── */

.att-modal {
  padding: 20px 20px 12px; background: var(--bg-modal); color: var(--text-primary);
  border: 1px solid var(--border-modal); border-radius: var(--radius);
  box-shadow: var(--shadow-modal); cursor: default; text-align: left;
  position: absolute; bottom: calc(100% + 14px); left: 0;
  width: 760px; max-height: calc(100vh - 80px); z-index: var(--z-popup);
  display: flex; flex-direction: column;
  animation: overlay-in 0.5s ease-out;
}
.att-badge {
  position: relative; cursor: pointer; display: inline-flex; align-items: center;
}
.att-screen-dimmer {
  position: fixed;
  top: var(--nav-height);
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(1px);
  z-index: calc(var(--z-modal-backdrop) - 1);
  animation: overlay-in 0.5s ease-out;
}
.att-badge-inner {
  display: flex; align-items: center; gap: 6px;
}
.att-badge-text {
  color: var(--text-label); width: 105px; text-align: left;
}
.att-title {
  margin: 0; color: var(--text-heading); display: flex;
  align-items: center; gap: var(--space-sm);
}
.att-title-status { font-weight: 400; }
.att-countdown {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: var(--space-md);
}
.att-countdown-track {
  flex: 1; height: 3px; background: var(--border);
  border-radius: 2px; overflow: hidden;
}
.att-countdown-fill {
  height: 100%; border-radius: 2px; transition: width 1s linear;
}
.att-countdown-text {
  font-size: 11px; color: var(--text-label); white-space: nowrap;
  font-family: var(--font-mono);
}
.att-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: var(--space-sm);
}
.att-header-actions {
  display: flex; align-items: center; gap: var(--space-sm); margin-left: auto;
}
.att-body {
  line-height: 1.5; flex: 1 1 auto; overflow: hidden; min-height: 0;
}
.att-telemetry {
  display: flex; flex-direction: column; gap: var(--space-md); min-width: 0;
}
.att-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-lg);
}
.att-label {
  color: var(--text-label); font-size: 0.85em;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.att-value {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.att-field {
  display: flex; flex-direction: column; gap: 2px;
}
.att-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
}
.att-dot-green { background: var(--green); }
.att-dot-red { background: var(--red); }
.att-dot-amber { background: var(--amber); }
.att-dot-neutral { background: var(--neutral); }
.att-section {
  padding-top: var(--space-md); border-top: 1px solid var(--border-modal);
}
.att-arrow {
  position: absolute; bottom: -6px; left: 20px;
  width: 10px; height: 10px; background: var(--bg-modal);
  border-bottom: 1px solid var(--border-modal);
  border-right: 1px solid var(--border-modal);
  transform: rotate(45deg);
}

/* ── Nav ──────────────────────────────────────────────────────────────── */

.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; height: var(--nav-height);
  background: var(--bg-secondary); border-bottom: 1px solid var(--border);
  position: relative; z-index: 2;
}
.nav-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.nav-brand {
  display: flex; align-items: center; gap: 6px;
  color: var(--text-primary); text-decoration: none;
  font-weight: 600; font-size: 15px; letter-spacing: 0.5px;
  flex-shrink: 0;
}
.nav-v-logo { height: 16px; width: auto; color: var(--accent); position: relative; top: -0.5px; }
.nav-brand-text { white-space: nowrap; }
.nav-back {
  color: var(--text-secondary); text-decoration: none; font-size: 16px;
  line-height: 1; padding: 2px 4px; width: 24px; text-align: center;
}
.nav-back:hover { color: var(--text-primary); }
.nav-back-hidden { visibility: hidden; }
.nav-sep { color: var(--text-secondary); font-size: 15px; }
.nav-page-title {
  font-size: 15px; color: var(--text-secondary); font-weight: 600; letter-spacing: 0.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nav-right { display: flex; align-items: center; gap: 12px; }
.nav-user { color: var(--text-secondary); font-size: 13px; }
/* nav-logout: now .btn .btn-outline in markup; kept for padding tweak */
.nav-logout { padding: 4px 12px; }

/* ── Conference pill (in nav bar when active) ──────────────────────────── */

.nav-conf-pill {
  display: flex; align-items: center; gap: 6px;
  background: rgba(0, 212, 170, 0.12); border: 1px solid rgba(0, 212, 170, 0.3);
  border-radius: 20px; padding: 2px 10px 2px 8px;
  font-size: 11px; font-weight: 500; color: var(--green);
  text-decoration: none; cursor: pointer;
  animation: error-badge-in 0.25s ease-out;
}
.nav-conf-pill:hover { background: rgba(0, 212, 170, 0.2); }
.nav-conf-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green);
  animation: pip-pulse 2s ease-in-out infinite;
}

/* ── Conference layer (persistent, hidden when user navigates away) ──── */

.conf-layer {
  position: fixed;
  top: var(--nav-height);
  right: 0; bottom: 0; left: 0;
  z-index: 50;
  background: var(--bg-primary);
  overflow: hidden;
}
/* Override .sift-conf height:100% (added by guest SPA to this element) */
.conf-layer.sift-conf {
  height: calc(100vh - var(--nav-height));
  height: calc(100dvh - var(--nav-height));
}

/* ── Conference mini-control (floating bar when backgrounded) ────────── */

.conf-mini {
  position: fixed;
  bottom: 16px; right: 16px;
  z-index: 800;
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 6px 14px 6px 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  animation: error-badge-in 0.25s ease-out;
}
.conf-mini-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green);
  animation: pip-pulse 2s ease-in-out infinite;
  flex-shrink: 0;
}
.conf-mini-label {
  font-size: 12px; font-weight: 500; color: var(--text-primary);
  display: flex; align-items: center; gap: 5px;
  margin-right: 4px;
}
.conf-mini-count {
  font-size: 11px; font-weight: 400; color: var(--text-secondary);
}
.conf-mini-count::before { content: '\00B7 '; }
.conf-mini-btn {
  border: none; background: transparent;
  color: var(--text-secondary); cursor: pointer;
  font-size: 11px; font-weight: 500;
  padding: 3px 8px; border-radius: 6px;
  display: flex; align-items: center; gap: 4px;
}
.conf-mini-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.conf-mini-btn--off { color: var(--danger); }
.conf-mini-btn--off:hover { color: var(--danger); }
.conf-mini-btn--return {
  background: rgba(0, 212, 170, 0.12); color: var(--green);
}
.conf-mini-btn--return:hover { background: rgba(0, 212, 170, 0.22); }
.conf-mini-btn--leave { color: var(--text-muted); }
.conf-mini-btn--leave:hover { color: var(--danger); }

/* ── Error badge (in nav/kvm toolbar) ────────────────────────────────── */

.nav-error-badge {
  display: flex; align-items: center; justify-content: center;
  background: var(--danger); border: none;
  border-radius: 4px; min-width: 18px; height: 18px; padding: 0 4px;
  cursor: pointer; line-height: 1;
  animation: error-badge-in 0.25s ease-out;
}
.nav-error-badge:hover {
  background: #e04040; filter: brightness(1.15);
}
.nav-error-count {
  font-size: 10px; font-weight: 700; color: #fff;
  font-variant-numeric: tabular-nums;
}

@keyframes error-badge-in {
  from { opacity: 0; transform: scale(0.85); }
  to   { opacity: 1; transform: scale(1); }
}

/* ── Error modal ─────────────────────────────────────────────────────── */
/* (intentionally blank — rules below .storage-dialog for cascade priority) */


/* ── Login ────────────────────────────────────────────────────────────── */

.login-page {
  position: relative;
  height: 100vh;
  background: var(--bg-primary);
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.login-page-ready { opacity: 1; }
.login-page::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(rgba(12, 10, 8, 0.95), rgba(12, 10, 8, 0.95));
}
.login-form {
  display: flex; flex-direction: column; gap: 14px;
  padding: 32px;
  background: rgba(12, 10, 8, 0.65); border: 1px solid rgba(230, 168, 23, 0.12);
  border-radius: var(--radius);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  position: absolute;
  z-index: 1;
  box-sizing: border-box;
  justify-content: center;
  overflow: hidden;
}
.login-form-centered {
  width: 432px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}
.login-brand {
  display: flex; flex-direction: column; align-items: center;
  gap: 6px; margin-bottom: 8px;
}
.login-wordmark {
  width: 140px; height: auto; color: var(--text-secondary);
}
.login-subtitle {
  font-size: 13px; font-weight: 500; letter-spacing: 2px;
  color: var(--accent); text-transform: uppercase;
}
.login-error {
  min-height: 16px;
  color: #fff;
  font-size: 13px;
  line-height: 16px;
}
.login-input {
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 12px;
  color: var(--text-primary); font-size: 14px; outline: none;
}
.login-input:focus { border-color: var(--border-focus); }
.login-btn {
  background: var(--accent); border: none; border-radius: var(--radius-sm);
  color: #111; padding: 10px; font-size: 14px; font-weight: 600;
  cursor: pointer;
}
.login-btn:hover { background: var(--accent-hover); }
.login-btn:disabled { opacity: 0.5; cursor: default; }
.login-server-status {
  font-size: 12px; color: var(--text-muted); opacity: 0.7;
  text-align: center; margin-top: 8px;
  font-variant-numeric: tabular-nums;
  animation: overlay-in 0.3s ease-out;
}
.login-server-status span { opacity: 0.5; }
.login-camera {
  display: flex; flex-direction: column; gap: 14px; align-items: center;
}
.login-camera-wrap {
  position: relative; width: 100%; border-radius: var(--radius-sm);
  overflow: hidden; border: 2px solid transparent;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.login-camera-scanning {
  border-color: var(--accent);
  box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 40%, transparent);
  animation: scan-pulse 1.5s ease-in-out infinite;
}
@keyframes scan-pulse {
  0%, 100% { box-shadow: 0 0 8px color-mix(in srgb, var(--accent) 30%, transparent); }
  50% { box-shadow: 0 0 18px color-mix(in srgb, var(--accent) 60%, transparent); }
}
.login-camera-recognized {
  border-color: #22c55e;
  box-shadow: 0 0 16px rgba(34, 197, 94, 0.5);
}
.login-camera-video {
  width: 100%; border-radius: var(--radius-sm);
  background: #000; aspect-ratio: 4/3; object-fit: cover;
  display: block;
}

/* ── Scanning line — thick white horizontal bar sweeping up/down ───── */
.login-scan-line {
  position: absolute; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.3) 10%,
    rgba(255, 255, 255, 0.85) 35%,
    #fff 50%,
    rgba(255, 255, 255, 0.85) 65%,
    rgba(255, 255, 255, 0.3) 90%,
    transparent 100%
  );
  box-shadow: 0 0 16px 4px rgba(255, 255, 255, 0.4);
  animation: scan-sweep 2.5s ease-in-out infinite;
  pointer-events: none;
  z-index: 2;
}
@keyframes scan-sweep {
  0%, 100% { top: 5%; }
  50% { top: 92%; }
}

/* ── Status indicator tags ──────────────────────────────────────────── */
.login-indicators {
  display: flex; gap: 10px; justify-content: center; align-items: center;
  min-height: 24px;
}
.login-tag {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px;
  font-weight: 600; padding: 2px 8px; border-radius: 3px;
}
.login-tag-prompt {
  color: var(--text-secondary); font-size: 13px; text-transform: none;
  letter-spacing: 0; font-weight: 500;
  animation: tag-prompt-pulse 2s ease-in-out infinite;
}
@keyframes tag-prompt-pulse {
  0%, 100% { opacity: 0.9; }
  50% { opacity: 0.4; }
}
.login-tag-green {
  color: #22c55e;
}
.login-tag-red {
  color: #ef4444;
}

/* ── Frozen/blurred video on auth success ──────────────────────────── */
.login-camera-frozen {
  filter: blur(12px) brightness(0.5);
  transition: filter 0.5s ease;
}

/* ── Auth success text ─────────────────────────────────────────────── */
.login-auth-success {
  color: #22c55e; font-size: 20px; font-weight: 600;
  text-align: center; padding: 8px 0;
}
.login-auth-success strong {
  font-weight: 700; text-transform: capitalize;
}

.login-face-status {
  font-size: 13px; color: var(--text-secondary); text-align: center;
  min-height: 36px; display: flex; align-items: center; justify-content: center;
}
.login-mode-switch-wrap {
  min-height: 42px; text-align: center;
  display: flex; align-items: center; justify-content: center;
}
.login-mode-switch {
  background: none; border: none; color: var(--accent);
  font-size: 13px; cursor: pointer; padding: 4px 0;
  text-align: center; opacity: 0.8;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 100%;
}
.login-mode-switch:hover { opacity: 1; text-decoration: underline; }
.login-debug-stats {
  font-size: 10px; color: var(--text-secondary); text-align: center;
  font-family: var(--font-mono, monospace); letter-spacing: -0.2px;
  opacity: 0.7; line-height: 1.5;
  min-height: 2.8em;
}
.login-form form {
  display: flex; flex-direction: column; gap: 14px;
  max-width: 300px; width: 100%; margin: 0 auto;
}

/* ── Face Enrollment Modal ──────────────────────────────────────────── */
.face-enroll-backdrop {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex; align-items: center; justify-content: center;
  z-index: var(--z-modal-backdrop);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  animation: overlay-in 0.5s ease-out;
}
.face-enroll-modal {
  background: var(--bg-modal); border: 1px solid var(--border-modal);
  border-radius: var(--radius);
  box-shadow: var(--shadow-modal);
  width: 580px; max-width: 90vw; max-height: 90vh;
  overflow-y: auto; padding: 32px;
  z-index: var(--z-modal);
  animation: overlay-in 0.5s ease-out;
}
.face-enroll-title {
  font-size: 20px; font-weight: 600; margin-bottom: 4px;
  text-align: center; color: var(--text-heading);
}
.face-enroll-desc {
  color: var(--text-secondary); font-size: 14px; margin-bottom: 24px;
  text-align: center;
}
.face-enroll-error {
  background: rgba(229, 91, 91, 0.1); color: var(--danger); border-radius: var(--radius-sm);
  padding: 8px 12px; font-size: 13px; margin-bottom: 12px;
}
.face-enroll-success {
  background: rgba(60, 180, 100, 0.15); color: #6c6; border-radius: var(--radius-sm);
  padding: 8px 12px; font-size: 13px; margin-bottom: 12px;
}
.face-enroll-list { margin-bottom: 24px; }
.face-enroll-list h3 { font-size: 15px; margin-bottom: 8px; color: var(--text-heading); }
.face-enroll-items { display: flex; flex-direction: column; gap: 8px; }
.face-enroll-item {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg-primary); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 12px; font-size: 13px;
}
.face-enroll-delete {
  background: var(--bg-input); border: 1px solid var(--border); color: var(--text-secondary);
  border-radius: var(--radius-sm); padding: 4px 10px; font-size: 12px; cursor: pointer;
}
.face-enroll-delete:hover { border-color: var(--text-muted); color: var(--text-primary); }
.face-enroll-camera { margin-top: 16px; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.face-enroll-video-wrap {
  position: relative; width: 100%;
}
.face-enroll-flash {
  position: absolute; inset: 0; background: #fff; opacity: 0;
  border-radius: var(--radius-sm); pointer-events: none; z-index: 2;
}
.face-enroll-video {
  width: 100%; border-radius: var(--radius-sm);
  background: #000; aspect-ratio: 4/3; object-fit: cover; display: block;
}
.face-enroll-progress {
  display: flex; gap: 8px; justify-content: center;
  position: absolute; bottom: 12px; left: 0; right: 0;
}
.face-enroll-pip {
  width: 12px; height: 12px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.25); border: 2px solid rgba(255, 255, 255, 0.5);
  transition: background 0.3s, border-color 0.3s, box-shadow 0.3s;
}
.face-enroll-pip-done {
  background: #22c55e; border-color: #22c55e;
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.6);
}
.face-enroll-pip-active {
  background: var(--accent); border-color: var(--accent);
  animation: pip-pulse 0.6s ease-in-out infinite;
}
@keyframes pip-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3); }
}
.face-enroll-countdown {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 64px; font-weight: 700; color: #fff;
  text-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
  pointer-events: none;
}
.face-enroll-snap-status {
  font-size: 13px; color: var(--text-secondary); text-align: center;
}
.face-enroll-actions {
  display: flex; gap: 12px; justify-content: center;
}
.face-enroll-cancel {
  background: var(--bg-primary); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 16px; color: var(--text-primary);
  font-size: 14px; cursor: pointer;
}
.face-enroll-cancel:hover { border-color: var(--border-focus); }
.face-enroll-footer {
  text-align: center; margin-top: 20px;
  padding-top: 16px; border-top: 1px solid var(--border);
}
.face-enroll-skip {
  color: var(--text-secondary); font-size: 14px; text-decoration: none;
}
.face-enroll-skip:hover { color: var(--accent); text-decoration: underline; }
.nav-settings {
  color: var(--text-secondary); font-size: 17px; text-decoration: none;
  padding: 4px 6px; border-radius: var(--radius-sm);
  opacity: 0.7; transition: opacity 0.15s;
}
.nav-settings:hover { opacity: 1; color: var(--accent); }

.nav-theme-toggle {
  background: none; border: none; cursor: pointer; padding: 4px;
  display: flex; align-items: center; justify-content: center;
  opacity: 0.6; transition: opacity 0.15s;
}
.nav-theme-toggle:hover { opacity: 1; }
.nav-theme-icon {
  display: block; width: 16px; height: 16px;
  /* Moon icon (dark mode active) */
  background: currentColor;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z'/%3E%3C/svg%3E");
  -webkit-mask-size: contain; mask-size: contain;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  color: var(--text-secondary);
}
/* Sun icon when in light mode */
[data-theme="light"] .nav-theme-icon {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='5'/%3E%3Cline x1='12' y1='1' x2='12' y2='3'/%3E%3Cline x1='12' y1='21' x2='12' y2='23'/%3E%3Cline x1='4.22' y1='4.22' x2='5.64' y2='5.64'/%3E%3Cline x1='18.36' y1='18.36' x2='19.78' y2='19.78'/%3E%3Cline x1='1' y1='12' x2='3' y2='12'/%3E%3Cline x1='21' y1='12' x2='23' y2='12'/%3E%3Cline x1='4.22' y1='19.78' x2='5.64' y2='18.36'/%3E%3Cline x1='18.36' y1='5.64' x2='19.78' y2='4.22'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='5'/%3E%3Cline x1='12' y1='1' x2='12' y2='3'/%3E%3Cline x1='12' y1='21' x2='12' y2='23'/%3E%3Cline x1='4.22' y1='4.22' x2='5.64' y2='5.64'/%3E%3Cline x1='18.36' y1='18.36' x2='19.78' y2='19.78'/%3E%3Cline x1='1' y1='12' x2='3' y2='12'/%3E%3Cline x1='21' y1='12' x2='23' y2='12'/%3E%3Cline x1='4.22' y1='19.78' x2='5.64' y2='18.36'/%3E%3Cline x1='18.36' y1='5.64' x2='19.78' y2='4.22'/%3E%3C/svg%3E");
}

/* ── Dashboard ────────────────────────────────────────────────────────── */

.dashboard {
  display: flex; flex-direction: column;
  min-height: 100%;
  padding: 24px 24px 48px;
}
.dashboard-content { flex: 1; }
.dashboard-title {
  font-size: 20px; font-weight: 600; margin-bottom: 20px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

.card-sections {
  display: flex; flex-direction: column; gap: 24px;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.card-sections-ready {
  opacity: 1;
}

.card-section-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px;
}
.card-section-title {
  font-size: 11px; font-weight: 500; letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-secondary);
  white-space: nowrap;
}
.card-section-line {
  flex: 1; height: 1px;
  background: var(--accent-dim);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 256px));
  gap: 16px;
}

.card {
  display: flex; flex-direction: column; gap: 10px;
  padding: 10px 20px 20px; background: var(--bg-card);
  height: 130px; overflow: visible;
  border: 1px solid var(--accent-dim); border-radius: var(--radius);
  outline: 1px solid transparent; outline-offset: -1px;
  cursor: pointer;
  transition: background 0.15s, outline-color 0.15s, box-shadow 0.15s;
  position: relative;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.card:hover {
  background: var(--bg-card-hover);
  outline-color: var(--accent);
  box-shadow: 0 0 12px rgba(230, 168, 23, 0.2), 0 0 4px rgba(230, 168, 23, 0.1);
}
/* Keep hover appearance when kebab dropdown is open (mouse may leave card bounds) */
.card:has(.card-dropdown) {
  z-index: 50;
  background: var(--bg-card-hover);
  outline-color: var(--accent);
  box-shadow: 0 0 12px rgba(230, 168, 23, 0.2), 0 0 4px rgba(230, 168, 23, 0.1);
}
.card:focus { outline: none; }
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.card-disabled {
  cursor: default; opacity: 0.6;
}
.card-disabled:hover { background: var(--bg-card); outline-color: transparent; box-shadow: none; }

.card-header { display: flex; align-items: center; gap: 12px; }
.card-icon { line-height: 1; flex-shrink: 0; color: var(--accent); }
.card-body { min-width: 0; }
.card-title { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.card-subtitle { font-size: 12px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-status { display: flex; align-items: center; gap: 6px; min-width: 0; }
.card-badge {
  position: absolute; top: 12px; right: 12px;
  background: var(--border); border-radius: 10px;
  padding: 2px 8px; font-size: 10px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.5px;
}
.conf-health-warnings { margin-top: 6px; }
.conf-health-warn {
  display: flex; align-items: baseline; gap: 6px;
  font-size: 11px; color: var(--text-secondary);
  line-height: 1.3; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.conf-health-dot {
  flex-shrink: 0; width: 6px; height: 6px;
  border-radius: 50%; background: var(--amber);
  display: inline-block; position: relative; top: -1px;
}
.card-extras { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.card-status-extra {
  margin-top: 0; font-size: 11px; min-width: 0;
}

/* ── Card kebab menu ─── */
.card-menu { position: absolute; top: 8px; right: 8px; z-index: 10; }
/* Legacy alias → .btn .btn-ghost (+ larger font for kebab icon) */
.card-menu-btn {
  background: transparent; border: none; color: var(--text-secondary);
  font-size: 20px; line-height: 1; cursor: pointer;
  padding: var(--space-xs) 6px; border-radius: var(--radius-sm);
  transition: border-color 0.15s;
}
.card-menu-btn:hover { color: var(--text-primary); background: rgba(255,255,255,0.08); }

.card-dropdown {
  position: absolute; top: 100%; right: 0; margin-top: 4px;
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: var(--radius); min-width: 200px; max-width: 320px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 20;
}
.card-dropdown-item {
  padding: 8px 14px; font-size: 13px; cursor: pointer;
  color: var(--text-primary); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.card-dropdown-item:hover { background: rgba(255,255,255,0.06); }
.card-dropdown-item:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.card-dropdown-item:last-child { border-radius: 0 0 var(--radius) var(--radius); }
.card-dropdown-disabled { opacity: 0.35; cursor: default; }
.card-dropdown-disabled:hover { background: none; }
.card-dropdown-danger { color: var(--danger); }
.card-dropdown-danger:hover { background: rgba(229, 91, 91, 0.1); }
.card-dropdown-header {
  padding: 6px 14px; font-size: 10px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.5px;
  cursor: default;
}
.card-dropdown-header:hover { background: none; }
.card-dropdown-divider {
  height: 1px; background: var(--border); margin: 4px 0;
}
.card-dropdown-indent { padding-left: 24px; }
.card-dropdown-active { color: var(--accent); }
.card-dropdown-checked { color: #fff; font-weight: 600; }
.card-dropdown-submenu-trigger {
  display: flex; justify-content: space-between; align-items: center;
}
.card-dropdown-arrow {
  font-size: 10px; color: var(--text-muted); margin-left: 8px;
}

/* ── Mount dialog ─── */
.mount-loading, .mount-empty {
  padding: 12px 0; color: var(--text-secondary); font-size: 13px;
}
.mount-options {
  display: flex; flex-direction: row; gap: 6px; margin-top: 4px; flex-wrap: wrap;
}
.mount-option {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; border-radius: var(--radius-sm);
  font-size: 13px; cursor: pointer;
  border: 1px solid transparent;
}
.mount-option:hover { background: rgba(255,255,255,0.04); }
.mount-option.active {
  border-color: var(--accent); background: rgba(230, 168, 23, 0.06);
}
.mount-option input[type="radio"] { accent-color: var(--accent); }
.mount-option-note { color: var(--text-muted); font-size: 12px; }
.mount-list-item { white-space: normal; display: flex; align-items: center; }
.mount-list-label { flex: 1; min-width: 0; font-size: 12px; line-height: 1.4; }
.mount-list-arrow { color: var(--text-muted); }

.status-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  flex-shrink: 0;
}
.status-dot.green { background: var(--green); box-shadow: 0 0 6px 1px var(--green); }
.status-dot.amber { background: var(--amber); box-shadow: 0 0 6px 1px var(--amber); }
.status-dot.red { background: var(--red); box-shadow: 0 0 6px 1px var(--red); }
.status-dot.neutral { background: var(--neutral); }

/* Attestation popup — force the UI font on the popup and replaced
 * elements (button, input, select) which browsers don't inherit.
 * Uses var(--font-ui) directly — not 'inherit' — so it can't regress
 * if intermediate ancestors lack a font-family declaration. */
.att-popup { font-family: var(--font-ui); }
.att-popup button,
.att-popup input,
.att-popup select,
.att-popup textarea { font-family: var(--font-ui); }
.att-popup .modal-close-btn {
  border-color: #4B5563; color: #9CA3AF;
}
.att-popup .modal-close-btn:hover { border-color: #9CA3AF; color: #F9FAFB; }
/* PCR table rows */
.pcr-row-clickable { transition: background-color 0.12s; }
.pcr-row-clickable:hover { background-color: rgba(255,255,255,0.05) !important; }

/* PCR area: slide container for table ↔ event log drawer */
.att-pcr-area {
  position: relative; overflow: hidden; margin-top: 4px;
  border-top: 1px solid var(--border); padding-top: 4px;
  /* Fixed height so switching table↔events doesn't resize modal */
  height: 340px; flex-shrink: 0;
}
.att-pcr-main {
  transition: transform 0.25s ease, opacity 0.2s ease;
  height: 100%; overflow-y: auto;
}
.att-pcr-main.slide-out {
  transform: translateX(-30%); opacity: 0; pointer-events: none;
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
}
.att-detail-panel {
  transition: transform 0.25s ease, opacity 0.2s ease;
  transform: translateX(100%); opacity: 0; pointer-events: none;
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg-primary); border-radius: 4px; padding: 12px;
}
.att-detail-panel.active {
  transform: translateX(0); opacity: 1; pointer-events: auto;
  position: relative; height: 100%;
}

/* Detail panel nav bar */
.att-detail-nav {
  display: flex; align-items: flex-start; gap: 10px;
  padding-bottom: 10px; border-bottom: 1px solid var(--border); margin-bottom: 8px;
}
.btn-detail-back {
  background: none; border: 1px solid #4B5563; color: #9CA3AF;
  border-radius: 4px; width: 28px; height: 28px; font-size: 18px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: border-color 0.15s, color 0.15s;
}
.btn-detail-back:hover { border-color: #9CA3AF; color: #F9FAFB; }
.att-detail-nav-text { flex: 1; min-width: 0; }

/* Detail panel body */
.att-detail-body { overflow-y: auto; flex: 1 1 auto; min-height: 0; }

/* Event log (inside detail panel) */
.pcr-event-log { display: flex; flex-direction: column; height: 100%; }
.pcr-event-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.pcr-event-table th {
  text-align: left; color: #9CA3AF; font-weight: 500; font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.05em; padding: 4px 8px 6px 0;
  border-bottom: 1px solid var(--border); position: sticky; top: 0;
  background: var(--bg-primary);
}
.pcr-event-table td {
  padding: 3px 8px 3px 0; border-bottom: 1px solid rgba(55,65,81,0.5);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px;
}
.pcr-event-table tr:last-child td { border-bottom: none; }

/* PCR table inner container */
.pcr-table-inner {
  background: var(--bg-primary); border-radius: var(--radius-sm);
  padding: var(--space-md); display: flex; flex-direction: column; gap: 6px;
}
.pcr-row {
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--font-mono); padding: 2px var(--space-xs);
  border-radius: 3px; cursor: pointer;
}
.pcr-row-match { color: var(--text-secondary); }
.pcr-row-unenrolled { color: var(--text-muted); }
.pcr-row-mismatch { color: var(--pcr-mismatch); }
.pcr-row-active { background: rgba(99, 102, 241, 0.15); }

.pcr-col-idx { color: var(--text-muted); flex: 0 0 50px; }
.pcr-col-name {
  color: var(--text-primary); font-style: italic; flex: 0 0 90px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pcr-col-value { flex: 1; padding-left: var(--space-md); text-align: right; }
.pcr-val-warn { color: var(--amber); }
.pcr-col-dot { margin-left: var(--space-md); flex: 0 0 20px; text-align: center; font-size: 10px; }
.pcr-dot-ok { color: var(--green); }
.pcr-dot-na { color: var(--text-muted); }
.pcr-dot-fail { color: var(--red); }
.pcr-col-arrow {
  margin-left: var(--space-xs); flex: 0 0 14px; text-align: center;
  color: var(--text-muted); font-size: 10px; transition: transform 0.15s;
}
.pcr-arrow-open { transform: rotate(90deg); }

/* Event log header classes */
.pcr-event-header-row { display: flex; align-items: center; gap: 6px; }
.pcr-event-index { font-family: var(--font-mono); font-weight: 600; font-size: 13px; }
.pcr-event-name { color: var(--text-secondary); font-size: 13px; }
.pcr-stability-badge {
  font-size: 9px; padding: 1px 5px; border-radius: 3px;
  background: rgba(255,255,255,0.08);
  text-transform: uppercase; letter-spacing: 0.05em;
}
.pcr-event-measures { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.pcr-event-count {
  font-size: 11px; color: var(--text-muted); margin-left: auto; white-space: nowrap;
}
.pcr-event-status {
  color: var(--text-muted); padding: var(--space-xl) 0; text-align: center;
}
.pcr-event-error { color: var(--pcr-mismatch); }
.pcr-event-empty { font-style: italic; }

/* Event log table cell classes */
.pcr-ev-col-seq { width: 30px; }
.pcr-ev-col-hash { width: 140px; }
.pcr-ev-seq { color: var(--text-muted); }
.pcr-ev-type { font-family: var(--font-mono); font-size: 11px; }
.pcr-ev-hash { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }
.pcr-ev-desc { font-size: 11px; color: var(--text-secondary); }

/* StatusGrid: checks row */
.att-checks-row {
  display: flex; gap: var(--space-md); align-items: center;
  margin-top: var(--space-xs); font-size: 11px; font-weight: 500;
  color: var(--text-secondary);
}
.att-check-item { display: flex; align-items: center; gap: var(--space-xs); }

/* DeviceInfo: grid layout */
.att-info-grid { margin-bottom: var(--space-sm); }
.att-info-col { gap: var(--space-sm); }
.status-text {
  font-size: 12px; color: var(--text-secondary);
  flex: 1 1 auto; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.status-bar {
  display: flex; flex-wrap: nowrap; align-items: center;
  margin-top: auto; padding: 12px 20px;
  background: rgba(12, 10, 8, 0.85); border-radius: 0;
  font-size: 12px; color: var(--text-secondary); font-family: var(--font-ui);
  white-space: nowrap; position: fixed; bottom: 0; left: 0; right: 0; z-index: 2;
}
.status-bar-left { flex: 1; display: flex; align-items: center; min-width: 0; }
.status-bar-center { flex: 0 0 auto; display: flex; gap: 16px; align-items: center; }
.status-bar-right { flex: 1; display: flex; justify-content: flex-end; align-items: center; min-width: 0; }
.status-bar-wordmark {
  height: 8px; width: auto; color: var(--text-secondary);
  flex-shrink: 0;
}
.status-bar-error {
  background: rgba(229, 91, 91, 0.08); border: 1px solid rgba(229, 91, 91, 0.25);
  color: var(--red); margin-top: 8px;
}
.status-bar-warn {
  background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted); margin-top: 8px;
}

/* ── Reconnect overlay ────────────────────────────────────────────── */
.reconnect-overlay {
  position: fixed; inset: 0; z-index: 9000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(8, 10, 15, 0.88);
  backdrop-filter: blur(6px);
  animation: overlay-in 0.3s ease-out;
}
/* App-level restart overlay sits above page-level overlays */
.restart-overlay { z-index: 9500; }
.reconnect-elapsed {
  font-size: 13px; color: var(--text-muted); opacity: 0.6;
  font-variant-numeric: tabular-nums;
  margin-top: 4px;
}
@keyframes overlay-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes page-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.reconnect-overlay-content {
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  padding: 40px 48px; text-align: center;
}
.reconnect-spinner {
  width: 32px; height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--text-secondary);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.reconnect-title {
  font-size: 18px; font-weight: 600; color: var(--text-primary);
}
.reconnect-subtitle {
  font-size: 13px; color: var(--text-muted); max-width: 340px; line-height: 1.5;
}

/* ── Nav-bar toast notifications ──────────────────────────────────── */
.nav-toast {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: var(--radius-sm);
  font-size: 12px; cursor: pointer;
  background: rgba(0, 0, 0, 0.85); color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  animation: nav-toast-in 0.25s ease-out;
  white-space: nowrap; max-width: 480px;
  overflow: hidden; text-overflow: ellipsis;
}
.nav-toast--out { animation: nav-toast-out 0.25s ease-in forwards; }
.nav-toast-icon { font-size: 14px; flex-shrink: 0; }
.nav-toast-success .nav-toast-icon { color: var(--green); }
.nav-toast-error .nav-toast-icon { color: var(--red); }
.nav-toast-spinner {
  width: 12px; height: 12px; flex-shrink: 0;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: nav-toast-spin 0.6s linear infinite;
}
@keyframes nav-toast-spin { to { transform: rotate(360deg); } }
@keyframes nav-toast-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes nav-toast-out {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-4px); }
}

/* ── KVM ──────────────────────────────────────────────────────────────── */

.kvm-page { display: flex; flex-direction: column; flex: 1; min-height: 0; animation: page-fade-in 0.3s ease-out; }
.kvm-toolbar {
  display: flex; align-items: center; gap: 12px;
  padding: 0 16px; height: 36px;
  background: var(--bg-secondary); border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.kvm-back {
  color: var(--text-secondary); text-decoration: none; font-size: 16px;
  line-height: 1; padding: 2px 4px;
}
.kvm-back:hover { color: var(--text-primary); }
.kvm-title { font-size: 13px; font-weight: 500; color: var(--text-primary); }
.kvm-spacer { flex: 1; }
.kvm-user { font-size: 12px; color: var(--text-secondary); }
.kvm-share-btn {
  font-size: 11px; padding: 3px 10px; border-radius: var(--radius-sm);
  background: var(--bg-card); border: 1px solid var(--border); color: var(--text-primary);
  cursor: pointer;
}
.kvm-share-btn:hover { background: var(--bg-card-hover); }
.kvm-share-btn--active { background: var(--amber); color: #000; border-color: var(--amber); }
.kvm-share-btn--active:hover { background: #d97706; }
.kvm-loading {
  display: flex; align-items: center; justify-content: center;
  flex: 1; min-height: 0; color: var(--text-secondary);
}

.viewer-container {
  flex: 1; position: relative; overflow: hidden;
  background: var(--bg-primary);
}

.viewer-container #screen,
.viewer-container canvas {
  cursor: none !important;
}

.viewer-container #chin,
.viewer-container #chin *,
.viewer-container .popup-menu,
.viewer-container .popup-menu * {
  cursor: auto !important;
}

/* Neutralize standalone viewer CSS defaults when embedded in sift-console.
 * layout.fit() handles all sizing in container-aware mode; we just need
 * to clear the standalone margins/max-width/max-height that are viewport-based. */
.viewer-container #wrap {
  margin: 0; max-width: none; max-height: none;
  width: 100%; height: 100%;
}
.viewer-container #bezel {
  min-width: 0;
}


/* ── Workspaces ───────────────────────────────────────────────────────── */

.workspaces-page { padding: 24px; max-width: 960px; margin: 0 auto; }
.workspaces-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.workspaces-header h1 { font-size: 20px; font-weight: 600; }
.workspaces-create { display: flex; gap: 8px; align-items: center; }

.ws-profile-select {
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 6px 10px;
  color: var(--text-primary); font-size: 13px;
}
.ws-create-btn {
  background: var(--accent); border: none; border-radius: var(--radius-sm);
  color: #111; padding: 6px 14px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.ws-create-btn:hover { background: var(--accent-hover); }
.ws-create-btn:disabled { opacity: 0.5; cursor: default; }

.ws-loading, .ws-empty {
  padding: 40px; text-align: center; color: var(--text-secondary);
}

.ws-list { display: flex; flex-direction: column; gap: 8px; }
.ws-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.ws-item-info { display: flex; align-items: center; gap: 12px; }
.ws-item-id { font-family: var(--font-mono); font-size: 12px; color: var(--text-secondary); }
.ws-item-profile { font-size: 13px; font-weight: 500; }
.ws-item-state { font-size: 12px; color: var(--text-secondary); }
.ws-item-actions { display: flex; gap: 6px; }

/* Legacy alias → .btn */
.ws-btn {
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: var(--space-xs) 10px;
  color: var(--text-primary); font-size: 12px; cursor: pointer;
  font-family: var(--font-ui); transition: border-color 0.15s;
}
.ws-btn:hover { border-color: var(--text-muted); }
.ws-btn-danger { color: var(--danger); border-color: var(--danger); }
.ws-btn-danger:hover { background: rgba(229, 91, 91, 0.1); }
.ws-btn-active { background: var(--amber); color: #000; border-color: var(--amber); }
.ws-btn-active:hover { background: #d97706; }
.ws-btn-disabled, .ws-btn:disabled { opacity: 0.25; cursor: default; pointer-events: none; }


/* ── Recordings ──────────────────────────────────────────────────────── */

.recordings-page { padding: 24px; max-width: 1100px; margin: 0 auto; display: flex; flex-direction: column; height: calc(100vh - 64px); }
.recordings-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.recordings-header h1 { font-size: 20px; font-weight: 600; }

.rec-loading, .rec-empty {
  padding: 40px; text-align: center; color: var(--text-secondary);
}

/* Session Archive table — extends .storage-table */
.rec-table { flex: 1; overflow-y: auto; display: block; }
.rec-table thead { position: sticky; top: 0; z-index: 2; background: var(--bg-secondary); }
.rec-table thead tr, .rec-table tbody tr { display: table; width: 100%; table-layout: fixed; }
.rec-table thead, .rec-table tbody { display: block; width: 100%; }
.rec-table tbody { overflow-y: auto; }
.rec-table td { white-space: nowrap; }

/* Column widths for table-layout: fixed */
.rec-table th:nth-child(1), .rec-table td:nth-child(1) { width: 36%; } /* Source */
.rec-table th:nth-child(2), .rec-table td:nth-child(2) { width: 10%; } /* Status */
.rec-table th:nth-child(3), .rec-table td:nth-child(3) { width: 18%; } /* Date */
.rec-table th:nth-child(4), .rec-table td:nth-child(4) { width: 11%; text-align: right; } /* Duration */
.rec-table th:nth-child(5), .rec-table td:nth-child(5) { width: 8%; text-align: right; }  /* Size */
.rec-table th:nth-child(6), .rec-table td:nth-child(6) { width: 14%; text-align: center; } /* Actions */
.rec-table th:nth-child(7), .rec-table td:nth-child(7) { width: 3%; }  /* Checkbox */

.rec-cell-source { font-family: var(--font-mono); font-size: 12px !important; }
.rec-cell-status { text-align: left; min-width: 72px; }
.rec-cell-date { font-family: var(--font-mono); font-size: 12px !important; color: var(--text-secondary); }
.rec-cell-right { text-align: right; }
.rec-cell-actions { text-align: center; }
.rec-cell-check { width: 20px; text-align: center; padding-left: 2px !important; }
.rec-actions { gap: 3px !important; display: inline-flex; align-items: center; }
.rec-actions .storage-action-btn { padding: 3px 5px; }
.rec-row-selected { background: rgba(255, 255, 255, 0.03); }
.rec-checkbox-input {
  width: 14px; height: 14px; cursor: pointer;
  accent-color: var(--accent); opacity: 0.35;
}
.rec-checkbox-input:checked { opacity: 0.7; }
.rec-checkbox-input:hover { opacity: 0.8; }
.rec-item-status { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; }
.rec-status-ok { color: var(--text-muted); opacity: 0.5; }
.rec-status-recording { color: #e53935; }
.rec-status-closing { color: var(--amber); }

/* Sealed badge in status column */
.rec-sealed-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; color: var(--green);
  cursor: pointer; padding: 2px 0; letter-spacing: 0.2px;
}
.rec-sealed-badge:hover { opacity: 0.8; }

/* Session info modal header */
.rec-info-title-group {
  display: flex; align-items: center; gap: 10px;
}
.rec-info-dialog .rec-info-title-group h3 { margin: 0; }
/* .rec-info-copy-btn — now uses shared .modal-close-btn class */
.rec-info-copy-ok { font-size: 11px; color: var(--green); white-space: nowrap; }

/* Session info modal */
.rec-info-dialog { min-width: 728px; max-width: 832px; max-height: 80vh; display: flex; flex-direction: column; }
.rec-info-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px; flex-shrink: 0;
}
.rec-info-header h3 { margin-bottom: 0; }
.rec-info-loading { color: var(--text-muted); font-size: 13px; padding: 12px 0; }
.rec-info-body { display: flex; flex-direction: column; gap: 16px; overflow-y: auto; padding-right: 4px; }
.rec-info-section { display: flex; flex-direction: column; gap: 1px; }
.rec-info-section-title {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-muted); margin-bottom: 4px; padding: 0 8px;
}
.rec-info-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 3px 8px; font-size: 12px; border-radius: var(--radius-sm);
}
.rec-info-row:nth-child(even) { background: rgba(255, 255, 255, 0.02); }
.rec-info-label { color: var(--text-secondary); flex-shrink: 0; margin-right: 16px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.3px; }
.rec-info-value { color: var(--text-primary); text-align: right; word-break: break-all; min-width: 0; font-family: var(--font-mono); font-size: 12px; }
.rec-info-hash { font-size: 10px; color: var(--text-secondary); max-width: 34ch; line-height: 1.4; }
.rec-info-row-hash { align-items: flex-start; }

/* ── Verification UI ──────────────────────────────────────────────────── */
.rec-verify-section { padding: 4px 0; }

/* Unverified prompt row */
.rec-verify-prompt {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
}
.rec-verify-prompt-text { flex: 1; font-size: 12px; color: var(--text-secondary); }
.rec-verify-btn {
  padding: 4px 14px; font-size: 11px; font-weight: 600;
  color: var(--accent); background: rgba(230, 168, 23, 0.1);
  border: 1px solid rgba(230, 168, 23, 0.3); border-radius: var(--radius-sm);
  cursor: pointer; transition: background 0.15s;
}
.rec-verify-btn:hover { background: rgba(230, 168, 23, 0.2); }

/* Progress spinner */
.rec-verify-progress {
  display: flex; align-items: center; gap: 10px;
  padding: 12px; font-size: 12px; color: var(--text-secondary);
}
.rec-verify-spinner {
  width: 14px; height: 14px;
  border: 2px solid rgba(230, 168, 23, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: rec-spin 0.8s linear infinite;
}
@keyframes rec-spin { to { transform: rotate(360deg); } }

/* Verification result */
.rec-verify-result { display: flex; flex-direction: column; gap: 12px; }

/* Status banner */
.rec-verify-banner {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 600;
}
.rec-verify-banner-pass {
  background: rgba(0, 212, 170, 0.08);
  border: 1px solid rgba(0, 212, 170, 0.25);
  color: var(--green);
}
.rec-verify-banner-fail {
  background: rgba(229, 91, 91, 0.08);
  border: 1px solid rgba(229, 91, 91, 0.25);
  color: var(--red);
}

/* Chain of trust visualization */
.rec-trust-chain { display: flex; flex-direction: column; padding: 0 4px; }
.rec-trust-step { display: flex; gap: 10px; min-height: 40px; }
.rec-trust-connector {
  display: flex; flex-direction: column; align-items: center;
  width: 14px; flex-shrink: 0; padding-top: 2px;
}
.rec-trust-dot {
  width: 8px; height: 8px; border-radius: 50%;
  flex-shrink: 0;
}
.rec-trust-line {
  width: 1.5px; flex: 1;
  min-height: 12px;
}
.rec-trust-content { flex: 1; padding-bottom: 8px; }
.rec-trust-label { font-size: 12px; font-weight: 600; color: var(--text-primary); }
.rec-trust-detail {
  font-size: 11px; color: var(--text-secondary);
  font-family: var(--font-mono); line-height: 1.4;
  margin-top: 2px;
}

/* Errors */
.rec-verify-errors {
  padding: 8px 10px;
  background: rgba(229, 91, 91, 0.06);
  border: 1px solid rgba(229, 91, 91, 0.15);
  border-radius: var(--radius-sm);
}
.rec-verify-error {
  font-size: 11px; color: var(--red);
  font-family: var(--font-mono);
  padding: 2px 0;
}

/* Copy verification record button */
.rec-verify-actions { display: flex; justify-content: flex-end; }
.rec-verify-copy-btn {
  padding: 5px 12px; font-size: 11px;
  color: var(--text-secondary); background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  cursor: pointer; transition: all 0.15s;
  font-family: var(--font-ui);
}
.rec-verify-copy-btn:hover { color: var(--text-primary); background: rgba(255, 255, 255, 0.08); }

/* Bulk toolbar — always rendered to reserve space */
.rec-bulk-toolbar {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 16px; margin-bottom: 4px;
  background: rgba(230, 168, 23, 0.08); border: 1px solid rgba(230, 168, 23, 0.2);
  border-radius: var(--radius);
}
.rec-bulk-toolbar-hidden {
  visibility: hidden;
}
.rec-bulk-count { font-size: 13px; font-weight: 500; color: var(--accent); margin-right: auto; }

/* ── Recording Player ── */

.rec-player-page {
  display: flex; flex-direction: column; height: 100%;
  background: #000;
}
.rec-player-toolbar {
  display: flex; align-items: center; gap: 12px;
  padding: 0 16px; height: 36px;
  background: var(--bg-secondary); border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.rec-player-back {
  background: none; border: none; color: var(--text-secondary);
  font-size: 16px; cursor: pointer; padding: 2px 4px;
}
.rec-player-back:hover { color: var(--text-primary); }
.rec-player-title { font-size: 13px; font-weight: 500; color: var(--text-primary); }
.rec-player-info { font-size: 12px; color: var(--text-muted); margin-left: auto; }

.rec-video-area {
  flex: 1; display: flex; align-items: center; justify-content: center;
  overflow: hidden; cursor: pointer;
}
.rec-video-area video {
  max-width: 100%; max-height: 100%;
}

.rec-controls {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px;
  background: var(--bg-secondary); border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.rec-ctrl-btn {
  background: none; border: none; color: var(--text-secondary);
  cursor: pointer; padding: 4px; display: flex; align-items: center;
}
.rec-ctrl-btn:hover { color: var(--text-primary); }
.rec-ctrl-time {
  font-size: 12px; color: var(--text-secondary);
  font-family: var(--font-mono); min-width: 40px;
}

.rec-seek {
  flex: 1; height: 24px; cursor: pointer;
  display: flex; align-items: center;
}
.rec-seek-track {
  width: 100%; height: 4px; position: relative;
  background: var(--border); border-radius: 2px;
}
.rec-seek-fill {
  position: absolute; top: 0; left: 0; height: 100%;
  background: var(--accent); border-radius: 2px;
}
.rec-seek-hover {
  position: absolute; top: 0; width: 2px; height: 100%;
  background: rgba(255,255,255,0.3); transform: translateX(-50%);
}
.rec-seek-thumb {
  position: absolute; top: 50%; width: 12px; height: 12px;
  background: var(--accent); border-radius: 50%;
  transform: translate(-50%, -50%);
}


/* ── Storage ─────────────────────────────────────────────────────────── */

.storage-page {
  padding: 24px; max-width: 960px; margin: 0 auto;
  position: relative; min-height: 300px;
}
.storage-page.drag-over { outline: 2px dashed var(--accent); outline-offset: -4px; }

.storage-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; gap: 16px;
}
.storage-header h1 { font-size: 20px; font-weight: 600; }
.storage-header-actions { display: flex; gap: 8px; align-items: center; }

.storage-breadcrumbs {
  display: flex; align-items: center; gap: 4px;
  font-size: 14px; flex-wrap: wrap;
}
.storage-back-btn {
  background: none; border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-secondary); padding: 4px 8px; cursor: pointer;
  font-size: 16px; line-height: 1; margin-right: 8px;
}
.storage-back-btn:hover { border-color: var(--text-muted); color: var(--text-primary); }
.storage-breadcrumb-sep { color: var(--text-muted); margin: 0 2px; }
.storage-breadcrumb-link {
  color: var(--accent); cursor: pointer; text-decoration: none;
}
.storage-breadcrumb-link:hover { text-decoration: underline; }
.storage-breadcrumb-current { color: var(--text-primary); font-weight: 500; }

/* Legacy alias → .btn (slightly larger padding/font for storage dialogs) */
.storage-btn {
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 6px 14px;
  color: var(--text-primary); font-size: 13px; cursor: pointer;
  font-family: var(--font-ui); transition: border-color 0.15s;
}
.storage-btn:hover { border-color: var(--text-muted); }
.storage-btn:disabled { opacity: 0.5; cursor: default; }
.storage-btn-primary {
  background: var(--accent); border-color: var(--accent); color: #111; font-weight: 600;
}
.storage-btn-primary:hover { background: var(--accent-hover); }
.storage-btn-danger {
  color: var(--danger); border-color: var(--danger);
}
.storage-btn-danger:hover { background: rgba(229, 91, 91, 0.1); }

/* Table */
.storage-table {
  width: 100%; border-collapse: separate; border-spacing: 0;
}
.storage-table thead th {
  text-align: left; padding: 8px 12px; font-size: 11px;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}
.storage-table tbody td {
  padding: 10px 12px; font-size: 13px;
  border-bottom: 1px solid rgba(42, 46, 62, 0.5);
  vertical-align: middle;
}
.storage-row { cursor: pointer; transition: background 0.1s; }
.storage-row:hover { background: var(--bg-card-hover); }

.storage-name {
  display: flex; align-items: center; gap: 8px; font-weight: 500;
}
.storage-icon { font-size: 16px; flex-shrink: 0; font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif; }

.storage-table td:nth-child(2) { white-space: nowrap; }
.storage-table td:nth-child(6) { white-space: nowrap; min-width: 100px; }
.storage-actions { display: flex; gap: 6px; }
/* Legacy alias → .btn .btn-icon */
.storage-action-btn {
  background: none; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 3px 8px; cursor: pointer; font-size: 14px; line-height: 1;
  color: var(--text-secondary); text-decoration: none; display: inline-flex;
  align-items: center; transition: border-color 0.15s;
}
.storage-action-btn:hover { border-color: var(--text-muted); color: var(--text-primary); }
.storage-action-btn.danger:hover { border-color: var(--danger); color: var(--danger); }

/* Empty state */
.storage-empty {
  padding: 60px 20px; text-align: center; color: var(--text-secondary);
}
.storage-empty-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.5; }
.storage-empty-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* Drag & drop overlay */
.storage-drop-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(12, 10, 8, 0.85);
  border: 2px dashed var(--accent);
  border-radius: var(--radius);
  z-index: 100;
  pointer-events: none;
}
.storage-drop-message {
  font-size: 18px; font-weight: 600; color: var(--accent);
}

/* Dialogs */
.storage-overlay {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.6); z-index: 200;
  animation: overlay-in 0.5s ease-out;
}
.storage-dialog {
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
  min-width: 380px; max-width: 480px;
}
.storage-dialog h3 {
  font-size: 16px; font-weight: 600; margin-bottom: 16px;
}

/* Shared modal close/icon button — inherits .btn system.
 * Markup: class="btn btn-outline btn-icon modal-close-btn"
 * Kept as thin override for font-size + flex-shrink. */
.modal-close-btn {
  font-size: 16px; padding: 0 7px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  height: 28px; line-height: 1;
}
.modal-close-btn:disabled { opacity: 0.25; }
.storage-dialog-actions {
  display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px;
}

.storage-label {
  display: block; font-size: 12px; color: var(--text-secondary);
  margin-bottom: 4px; margin-top: 12px;
}
.storage-input {
  width: 100%; background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 12px;
  color: var(--text-primary); font-size: 14px; outline: none;
}
.storage-input:focus { border-color: var(--border-focus); }

.storage-size-presets {
  display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px;
}
.storage-size-btn {
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 6px 12px;
  color: var(--text-secondary); font-size: 13px; cursor: pointer;
}
.storage-size-btn:hover { border-color: var(--text-muted); color: var(--text-primary); }
.storage-size-btn.active {
  border-color: var(--accent); color: var(--accent); background: rgba(230, 168, 23, 0.08);
}

.storage-error {
  background: rgba(229, 91, 91, 0.1); border: 1px solid var(--danger);
  border-radius: var(--radius-sm); padding: 8px 12px;
  color: var(--danger); font-size: 13px; margin-bottom: 12px;
}

/* ── AMT info dialog ──── */
.amt-info-dialog { min-width: 440px; max-width: 550px; }
.amt-info-body { display: flex; flex-direction: column; gap: 16px; }
.amt-info-section { display: flex; flex-direction: column; gap: 4px; }
.amt-info-section-title {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-muted); margin-bottom: 2px;
}
.amt-info-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 2px 0; font-size: 13px;
}
.amt-info-label { color: var(--text-secondary); flex-shrink: 0; margin-right: 12px; }
.amt-info-value { color: var(--text-primary); text-align: right; word-break: break-word; min-width: 0; }
.amt-info-value.amt-info-loading { opacity: 0.3; }
.amt-info-title { display: flex; align-items: baseline; gap: 10px; flex: 1; min-width: 0; }
.amt-info-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
/* .amt-info-close — now uses shared .modal-close-btn class */
.amt-info-close { margin-left: 12px; }
.amt-info-title-loading {
  font-size: 12px; font-weight: 400; color: var(--text-muted);
  animation: amt-info-pulse 1.5s ease-in-out infinite;
}
@keyframes amt-info-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

/* ── Live Console diagnostics dialog ──── */
.streamer-info-dialog {
  width: min(1200px, calc(100vw - 32px));
  min-width: min(960px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  max-height: min(60vh, calc(100vh - 96px));
  display: flex;
  flex-direction: column;
  padding: 20px 24px 24px;
  align-self: center;
}
.streamer-info-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.streamer-info-title-group {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  gap: 6px;
}
.streamer-info-meta {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.streamer-info-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.streamer-info-action-btn {
  padding: 6px 12px;
  font-size: 12px;
  white-space: nowrap;
}
.streamer-info-copy-btn {
  min-width: 32px;
  min-height: 28px;
  padding: 2px 8px;
}
.streamer-info-close { margin-left: 2px; }
.streamer-info-copy-ok {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--green);
  white-space: nowrap;
}
.streamer-info-loading {
  color: var(--text-secondary);
  font-size: 13px;
  padding: 4px 0;
}
.streamer-info-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable both-edges;
  scrollbar-width: auto;
  scrollbar-color: rgba(255, 255, 255, 0.26) rgba(255, 255, 255, 0.07);
}
.streamer-info-content {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  padding-right: 4px;
}
.streamer-info-updated {
  color: var(--text-muted);
  font-size: 12px;
}
.streamer-info-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.streamer-info-section + .streamer-info-section {
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.streamer-info-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.streamer-info-grid-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(106px, 122px) minmax(0, 1fr));
  align-items: start;
  column-gap: 6px;
  row-gap: 6px;
  padding: 2px 0;
  font-size: 13px;
  line-height: 1.45;
}
.streamer-info-grid-row-pre {
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  padding-top: 8px;
}
.streamer-info-label {
  color: var(--text-secondary);
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.35;
}
.streamer-info-value {
  color: var(--text-primary);
  min-width: 0;
  display: flex;
  justify-content: flex-start;
  text-align: left;
}
.streamer-info-grid-row-pre .streamer-info-value {
  justify-content: flex-start;
  text-align: left;
}
.streamer-info-value-text {
  display: block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.streamer-info-pre {
  margin: 0;
  padding: 10px 12px;
  overflow: auto;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 11px;
  line-height: 1.45;
  white-space: pre;
  word-break: normal;
  overflow-wrap: normal;
  scrollbar-gutter: stable both-edges;
  scrollbar-width: auto;
  scrollbar-color: rgba(255, 255, 255, 0.26) rgba(255, 255, 255, 0.07);
  font-family: 'SF Mono', SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace;
}

.streamer-info-body::-webkit-scrollbar,
.streamer-info-pre::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

.streamer-info-body::-webkit-scrollbar-track,
.streamer-info-pre::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.07);
  border-radius: 999px;
}

.streamer-info-body::-webkit-scrollbar-thumb,
.streamer-info-pre::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.26);
  border: 2px solid transparent;
  border-radius: 999px;
  background-clip: padding-box;
}

.streamer-info-body::-webkit-scrollbar-thumb:hover,
.streamer-info-pre::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.34);
  background-clip: padding-box;
}

@media (max-width: 1100px) {
  .streamer-info-grid-row {
    grid-template-columns: repeat(2, minmax(114px, 134px) minmax(0, 1fr));
  }
}

/* Upload progress */
.storage-uploads {
  display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px;
}
.storage-upload-item {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 12px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 12px;
}
.storage-upload-name {
  flex-shrink: 0; max-width: 200px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.storage-progress-bar {
  flex: 1; height: 4px; background: var(--border); border-radius: 2px;
  overflow: hidden;
}
.storage-progress-fill {
  height: 100%; background: var(--accent); border-radius: 2px;
  transition: width 0.2s;
}
.storage-progress-fill.error { background: var(--danger); }
.storage-upload-status { flex-shrink: 0; color: var(--text-muted); }
.storage-upload-status.done { color: var(--green); }
.storage-upload-status.error { color: var(--danger); }

/* ── View toggle ──── */
.storage-view-toggle {
  display: flex; gap: 2px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  overflow: hidden;
}
.storage-view-btn {
  background: none; border: none; padding: 5px 10px;
  color: var(--text-muted); cursor: pointer; font-size: 15px; line-height: 1;
}
.storage-view-btn:hover { color: var(--text-primary); background: rgba(255,255,255,0.04); }
.storage-view-btn.active {
  color: var(--accent); background: rgba(230, 168, 23, 0.1);
}

/* ── Card grid view ──── */
.storage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
.storage-card {
  display: flex; flex-direction: column; align-items: center;
  gap: 8px; padding: 20px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius);
  cursor: pointer; transition: background 0.15s, border-color 0.15s;
  position: relative; text-align: center;
  min-height: 190px;
}
.storage-card:hover { background: var(--bg-card-hover); border-color: var(--accent); }
.storage-card-mounted { border-color: var(--amber, #e6a817); }
.storage-card-usb { cursor: not-allowed; opacity: 0.8; }
.storage-card-usb:hover { border-color: var(--amber, #e6a817); }

.storage-card-create {
  border-style: dashed; border-color: var(--text-muted);
  color: var(--text-muted); justify-content: center;
  min-height: 160px; background: transparent;
}
.storage-card-create:hover {
  border-color: var(--accent); color: var(--accent); background: rgba(230, 168, 23, 0.04);
}
.storage-card-plus { font-size: 36px; line-height: 1; font-weight: 300; }
.storage-card-label { font-size: 13px; }

.storage-card-icon { font-size: 32px; line-height: 1; font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif; }
.storage-card-name {
  font-size: 14px; font-weight: 600; word-break: break-all;
  max-width: 100%; line-height: 1.25;
}
.storage-card-meta { font-size: 12px; color: var(--text-secondary); }
.storage-card-actions {
  display: flex; gap: 6px; margin-top: auto; padding-top: 8px;
}
.storage-name-text {
  cursor: context-menu;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 420px; display: inline-block;
}

/* ── Mount status badges ──── */
.storage-mount-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px;
  padding: 2px 8px; border-radius: 10px;
  white-space: nowrap;
}
.storage-mount-usb {
  background: rgba(230, 168, 23, 0.15); color: var(--accent);
  border: 1px solid rgba(230, 168, 23, 0.3);
}
.storage-mount-browser {
  background: rgba(212, 168, 71, 0.15); color: var(--amber);
  border: 1px solid rgba(212, 168, 71, 0.3);
  cursor: pointer;
}
.storage-mount-browser:hover {
  background: rgba(212, 168, 71, 0.25);
  border-color: rgba(212, 168, 71, 0.5);
}

/* Badge in card view — top-right corner */
.storage-card .storage-mount-badge {
  position: absolute; top: 8px; right: 8px;
}

/* ── Verification badge ──── */
.storage-verify-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; color: var(--green);
  padding: 2px 0; letter-spacing: 0.2px;
  white-space: nowrap;
}
.storage-card .storage-verify-badge {
  position: absolute; top: 8px; left: 8px;
}

/* ── Enhanced delete dialog ──── */
.storage-dialog-danger { border-color: var(--danger); }
.storage-dialog-icon {
  font-size: 32px; text-align: center; margin-bottom: 8px;
}
.storage-dialog-message {
  font-size: 14px; color: var(--text-primary); margin-bottom: 12px;
}
.storage-dialog-details {
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 14px;
  font-size: 12px; color: var(--text-secondary);
  display: flex; flex-direction: column; gap: 4px;
}
.storage-dialog-warning {
  color: var(--accent); font-weight: 500; margin-top: 4px;
}
.storage-dialog-caution {
  font-size: 12px; color: var(--danger); margin-top: 12px;
  font-weight: 500;
}
.storage-rename-input-wrap {
  display: flex; align-items: center; gap: 8px;
}
.storage-rename-ext {
  font-size: 12px; color: var(--text-muted);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 8px 10px; background: var(--bg-input);
  min-width: 50px; text-align: center;
}

/* ── Add Image dialog ──── */
.storage-dialog-wide { min-width: 420px; max-width: 520px; }

.add-section { margin-top: 4px; }
.add-section-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-muted); margin-bottom: 8px;
}
.add-section-actions {
  display: flex; justify-content: flex-end; margin-top: 14px;
}

.add-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 18px 0 14px;
  color: var(--text-muted); font-size: 12px;
}
.add-divider::before, .add-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

.add-dropzone {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 24px 16px;
  border: 2px dashed var(--border); border-radius: var(--radius);
  background: transparent;
  transition: border-color 0.15s, background 0.15s;
}
.add-dropzone.active,
.add-dropzone:hover {
  border-color: var(--accent); background: rgba(230, 168, 23, 0.04);
}
.add-dropzone-icon { font-size: 28px; opacity: 0.5; }
.add-dropzone-text { font-size: 13px; color: var(--text-secondary); }

/* ── Remux progress overlay ──────────────────────────────────────────── */

.remux-dialog {
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px 28px;
  min-width: 320px; max-width: 380px; text-align: center;
}
.remux-header {
  font-size: 14px; font-weight: 600; margin-bottom: 16px;
  color: var(--text-primary);
}
.remux-bar-track {
  height: 6px; background: var(--bg-input); border-radius: 3px;
  overflow: hidden;
}
.remux-bar-fill {
  height: 100%; background: var(--accent);
  border-radius: 3px;
  transition: width 0.4s ease-out;
}
.remux-bar-done { background: var(--green); }
.remux-percent {
  font-size: 12px; color: var(--text-secondary); margin-top: 8px;
}
.remux-error-msg {
  font-size: 13px; color: var(--text-secondary); margin-bottom: 16px;
}
.remux-actions {
  display: flex; justify-content: center;
}

/* ── Settings page ───────────────────────────────────────────────────── */

.settings-page {
  max-width: 640px; margin: 0 auto; padding: 32px 24px 64px;
  position: relative;
}
.settings-section {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 24px; margin-bottom: 16px;
}
.settings-section-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border);
}
.settings-section-header h2 {
  font-size: 15px; font-weight: 600; color: var(--text-primary); margin: 0;
}
.settings-badge {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  padding: 2px 6px; border-radius: 3px; letter-spacing: 0.5px;
  border: 1px solid var(--text-secondary); color: var(--text-secondary);
  margin-left: auto; line-height: 1.4;
}
.settings-add-btn {
  background: none; border: 1px solid var(--border); color: var(--text-secondary);
  border-radius: var(--radius-sm); font-size: 14px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  line-height: 1; padding: 2px 6px;
}
.settings-add-btn:hover { border-color: var(--accent); color: var(--accent); }
.settings-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; min-height: 40px;
}
.settings-row + .settings-row { border-top: 1px solid var(--border); }
.settings-row-label { font-size: 13px; color: var(--text-primary); }
.settings-row-sublabel { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.settings-row-value { font-size: 13px; color: var(--text-secondary); text-align: right; }

/* Toggle switch — adaptive per theme.
 * Off: accent border + accent thumb (gold dot on dark track).
 * On:  accent fill + contrasting thumb (white in dark, dark in light). */
.toggle-switch { position: relative; width: 40px; height: 22px; cursor: pointer; flex-shrink: 0; }
.toggle-track {
  width: 40px; height: 22px; border-radius: 11px;
  background: var(--bg-input); border: 1px solid var(--accent);
  transition: background 0.2s, border-color 0.2s;
}
.toggle-track.on { background: var(--accent); border-color: var(--accent); }
.toggle-thumb {
  position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--accent); transition: transform 0.2s, background 0.2s;
}
.toggle-track.on + .toggle-thumb { transform: translateX(18px); background: #fff; }
[data-theme="light"] .toggle-track.on + .toggle-thumb { background: var(--text-primary); }

/* Status dot */
.status-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px;
  vertical-align: middle;
}
.status-dot.green { background: var(--green); }
.status-dot.neutral { background: var(--text-secondary); opacity: 0.4; }

/* Remote access URL — always visible to prevent layout shift */
.remote-url-row {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-input); padding: 8px 12px; border-radius: var(--radius-sm);
  font-size: 12px; font-family: monospace; color: var(--text-secondary);
  margin-top: 8px; border: 1px solid var(--border); min-height: 34px;
}
.remote-url-empty { opacity: 0.4; }
.remote-url-placeholder { color: var(--text-secondary); opacity: 0.5; }
.remote-url-copy {
  margin-left: auto; background: none; border: none;
  color: var(--accent); cursor: pointer; font-size: 12px; white-space: nowrap;
}
/* Inline spinner for status indicators */
.settings-spinner {
  display: inline-block; width: 10px; height: 10px; margin-right: 6px;
  border: 1.5px solid var(--text-secondary); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.8s linear infinite; vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }
.settings-action-btn {
  padding: 7px 16px; border-radius: var(--radius-sm);
  font-size: 13px; cursor: pointer; border: 1px solid var(--border);
  background: transparent; color: var(--text-primary);
}
.settings-action-btn:hover { border-color: var(--accent); color: var(--accent); }
.settings-action-btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.settings-action-btn.primary:hover { background: var(--accent-hover); }

/* Users list */
.users-list { margin-top: 4px; }
.user-row { display: flex; align-items: center; padding: 8px 0; gap: 12px; }
.user-row + .user-row { border-top: 1px solid var(--border); }
.user-name { font-size: 13px; font-weight: 500; width: 140px; flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-you { color: var(--accent); font-size: 11px; font-weight: 400; margin-left: 6px; }
.user-role-col { font-size: 12px; color: var(--text-secondary); width: 50px; flex-shrink: 0; flex-grow: 1; }
.user-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.user-action-btn {
  background: none; border: 1px solid var(--border); color: var(--text-secondary);
  padding: 4px 10px; border-radius: var(--radius-sm); font-size: 12px; cursor: pointer;
}
.user-action-btn:hover { border-color: var(--border-hover); color: var(--text-primary); }
.user-remove-btn {
  background: none; border: none; color: var(--text-secondary);
  font-size: 14px; cursor: pointer; padding: 2px 6px; opacity: 0.5;
  transition: opacity 0.15s, color 0.15s;
}
.user-remove-btn:hover:not(.disabled) { opacity: 1; color: var(--text-primary); }
.user-remove-btn.disabled { opacity: 0.15; cursor: default; }

/* Add user modal */
.settings-add-dialog {
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; min-width: 320px; max-width: 380px;
}
.settings-add-dialog h3 {
  font-size: 15px; font-weight: 600; margin: 0 0 16px;
}
.settings-add-fields {
  display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px;
}
.settings-add-actions {
  display: flex; justify-content: flex-end; gap: 8px;
}
.add-user-input {
  padding: 8px 10px; border-radius: var(--radius-sm);
  background: var(--bg-input); border: 1px solid var(--border);
  color: var(--text-primary); font-size: 13px; outline: none; width: 100%;
}
.add-user-input:focus { border-color: var(--accent); }
.add-user-input::placeholder { color: var(--text-secondary); opacity: 0.6; }

/* ── Error modal (after .storage-dialog so cascade wins) ─────────────── */

.error-modal {
  width: 80vw; min-width: 80vw; max-width: 80vw;
  height: 60vh; min-height: 60vh; max-height: 60vh;
  display: flex; flex-direction: column;
}
.error-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.error-modal-title { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.error-modal-footer {
  display: flex; align-items: center; gap: 8px;
  padding-top: 10px; border-top: 1px solid var(--border); margin-top: auto;
}
.error-modal-footer-left { display: flex; gap: 6px; }
.error-modal-toast {
  position: absolute; bottom: 100%; left: 0; margin-bottom: 6px;
  background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 4px 10px; font-size: 12px; color: var(--accent); white-space: nowrap;
  pointer-events: none; animation: error-toast-in 0.15s ease-out;
}
.error-modal-toast-out { opacity: 0; transition: opacity 0.3s ease-out; }
@keyframes error-toast-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* ── Reusable copy-to-clipboard toast ──────────────────────────────── */
.copy-btn-wrap { position: relative; display: inline-flex; }
.copy-toast {
  position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%);
  margin-bottom: 6px; background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 3px 8px; font-size: 11px;
  color: var(--accent); white-space: nowrap; pointer-events: none;
  animation: copy-toast-in 0.15s ease-out; z-index: var(--z-toast);
}
.copy-toast-out { opacity: 0; transition: opacity 0.3s ease-out; }
@keyframes copy-toast-in { from { opacity: 0; transform: translateX(-50%) translateY(4px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
.copy-btn { padding: 4px 6px; }
.error-modal-meta {
  font-size: 11px; color: var(--text-muted); padding: 0 4px 6px;
}
.error-modal-list {
  overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 6px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 8px;
}
.error-modal-entry {
  padding: 8px 12px; background: var(--bg-primary);
  border: none; border-radius: var(--radius-sm);
  font-size: 12px; color: var(--text-secondary);
  word-break: break-word; white-space: pre-wrap;
  font-family: 'SF Mono', 'Menlo', monospace;
  line-height: 1.5;
}
.error-modal-time {
  font-size: 10px; color: #9b9fb5;
  font-variant-numeric: tabular-nums;
  margin-right: 8px;
}
.error-modal-source {
  font-size: 10px; color: var(--text-primary); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.3px;
  margin-right: 6px;
}
.error-modal-message {
  color: var(--text-secondary);
}
.error-modal-context {
  margin-top: 2px;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.4;
}
.error-modal-empty {
  text-align: center; color: var(--text-muted); padding: 24px 0; font-size: 13px;
}

/* ── Conference (embedded from guest SPA — only dashboard health styles remain) ── */

.conf-error { color: var(--danger); font-size: 13px; margin-top: 4px; }

/* ── Responsive: mobile ── */
@media (max-width: 640px) {
  .streamer-info-dialog {
    min-width: 0;
    width: calc(100vw - 16px);
    max-width: calc(100vw - 16px);
    max-height: min(60vh, calc(100vh - 24px));
    padding: 16px;
  }
  .streamer-info-header {
    flex-direction: column;
    align-items: stretch;
  }
  .streamer-info-meta {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }
  .streamer-info-actions { justify-content: flex-start; }
  .streamer-info-content {
    padding-right: 4px;
  }
  .streamer-info-grid-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .streamer-info-value {
    justify-content: flex-start;
    text-align: left;
  }
  .streamer-info-label {
    white-space: nowrap;
  }

  /* ── Login ── */
  .login-form {
    width: calc(100vw - 32px);
    padding: 20px;
  }
  .login-wordmark { width: 110px; }
  .login-subtitle { font-size: 11px; }
  .login-auth-success { font-size: 16px; }

  /* ── Nav ── */
  .nav { padding: 0 12px; }
  .nav-brand { font-size: 13px; }
  .nav-brand-text { display: none; }
  .nav-back-hidden { display: none; }
  .nav-right { gap: 8px; }
  .nav-user { display: none; }
  .nav-settings { font-size: 15px; }

  /* ── Dashboard ── */
  .dashboard { padding: 16px 12px 48px; }
  .dashboard-title { font-size: 17px; margin-bottom: 14px; }
  .card-grid { grid-template-columns: 1fr; gap: 12px; }
  .card { padding: 14px; height: 120px; }

  /* ── Status bar / footer ── */
  .status-bar {
    flex-wrap: wrap; gap: 6px 12px;
    white-space: normal; font-size: 11px;
    padding: 10px 12px;
  }

  /* ── Session Archive ── */
  .recordings-page { padding: 12px; }
  .recordings-header { margin-bottom: 10px; }
  .recordings-header h1 { font-size: 17px; }
  .rec-table { overflow-x: auto; }
  .rec-table thead tr, .rec-table tbody tr {
    table-layout: auto; min-width: 700px;
  }
  .rec-table th:nth-child(1), .rec-table td:nth-child(1),
  .rec-table th:nth-child(2), .rec-table td:nth-child(2),
  .rec-table th:nth-child(3), .rec-table td:nth-child(3),
  .rec-table th:nth-child(4), .rec-table td:nth-child(4),
  .rec-table th:nth-child(5), .rec-table td:nth-child(5),
  .rec-table th:nth-child(6), .rec-table td:nth-child(6),
  .rec-table th:nth-child(7), .rec-table td:nth-child(7) {
    width: auto;
  }
  .rec-sealed-badge span { display: none; }
  .rec-bulk-toolbar { flex-wrap: wrap; gap: 6px; padding: 6px 10px; font-size: 12px; }
  .rec-bulk-toolbar-hidden { display: none; }

  /* ── Nav breadcrumb — on mobile subpages, hide brand, show only page title ── */
  .nav-sep { display: none; }
  .nav-page-title { font-size: 14px; color: var(--text-primary); font-weight: 600; }

  /* ── KVM toolbar ── */
  .kvm-toolbar { padding: 0 10px; gap: 8px; }
  .kvm-user { display: none; }
}

/* Conference health warnings (dashboard card) */
.conf-health-warnings { margin-top: 4px; display: flex; flex-direction: column; gap: 2px; }
.conf-health-warn {
  display: flex; align-items: baseline; gap: 5px;
  font-size: 11px; color: var(--amber); line-height: 1.3;
}
.conf-health-dot {
  display: inline-block; width: 6px; height: 6px; min-width: 6px;
  border-radius: 50%; background: var(--amber); margin-top: 2px;
}
/* Conference pre-flight health details (join error) */
.conf-health-details {
  margin-top: 8px; padding: 8px 10px;
  background: rgba(213, 168, 71, 0.1); border: 1px solid var(--amber);
  border-radius: 6px; font-size: 12px; color: var(--text-secondary);
}
.conf-health-details summary {
  cursor: pointer; color: var(--amber); font-weight: 500; font-size: 12px;
}
.conf-health-details ul {
  margin: 4px 0 0 0; padding-left: 18px; list-style: disc;
}
.conf-health-details li { margin: 2px 0; }

/* ── Telemetry page ───────────────────────────────────────────────────── */

.telemetry-page {
  max-width: 1100px; margin: 0 auto; padding: 10px 24px 40px;
}
.telemetry-sticky {
  position: sticky; top: 0; z-index: 5;
  margin: -10px -24px 14px;
  padding: 10px 24px 6px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
  /* Break out of max-width container to span full viewport */
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  padding-left: calc(50vw - 50% + 24px);
  padding-right: calc(50vw - 50% + 24px);
  box-sizing: border-box;
}
/* Ensure chart panels stack below the sticky header */
.telemetry-grid, .workloads-view { position: relative; z-index: 0; overflow-x: hidden; }
.telemetry-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px; flex-wrap: wrap; gap: 8px;
}
.telemetry-header h1 {
  font-size: 20px; font-weight: 600; color: var(--text-primary); margin: 0;
}
.telemetry-time-range {
  display: flex; gap: 4px;
}
.telemetry-range-btn {
  background: transparent; border: 1px solid var(--border); color: var(--text-secondary);
  padding: 3px 10px; border-radius: var(--radius); cursor: pointer;
  font-size: 12px; transition: background 0.15s, color 0.15s;
}
.telemetry-range-btn:hover { background: rgba(255,255,255,0.05); color: var(--text-primary); }
.telemetry-range-btn.active {
  background: var(--accent); color: #000; border-color: var(--accent); font-weight: 600;
}

/* Tabs */
.telemetry-tabs {
  display: flex; gap: 2px; margin-bottom: 12px;
  border-bottom: 1px solid var(--border); padding-bottom: 0;
  overflow-x: auto;
}
.telemetry-tab {
  background: transparent; border: none; color: var(--text-secondary);
  padding: 7px 16px; cursor: pointer; font-size: 13px; font-weight: 500;
  border-bottom: 2px solid transparent; transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.telemetry-tab:hover { color: var(--text-primary); }
.telemetry-tab.active {
  color: var(--accent); border-bottom-color: var(--accent);
}

/* Metric picker */
.telemetry-picker {
  display: flex; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 16px;
}
.telemetry-picker-item {
  display: flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--text-secondary); cursor: pointer;
}
.telemetry-picker-item input[type="checkbox"] {
  accent-color: var(--accent); width: 14px; height: 14px;
}

/* Grid — full-width single column */
.telemetry-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

/* Panel */
.telemetry-panel {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 6px 14px 8px; min-height: 100px;
}
.telemetry-panel-header {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 4px;
}
.telemetry-panel-label {
  font-size: 12px; font-weight: 500; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.telemetry-panel-actions {
  display: flex; align-items: baseline; gap: 8px;
}
.telemetry-panel-value {
  font-size: 18px; font-weight: 600; color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.telemetry-csv-btn {
  background: transparent; border: 1px solid var(--border);
  color: var(--text-muted); cursor: pointer; font-size: 13px;
  padding: 1px 6px; border-radius: var(--radius);
  line-height: 1; transition: color 0.15s, border-color 0.15s;
}
.telemetry-csv-btn:hover {
  color: var(--text-primary); border-color: var(--text-secondary);
}
.telemetry-panel-chart { min-height: 96px; }

/* Bar chart layout */
.bar-chart-wrap {
  display: flex; gap: 4px;
}
.bar-y-axis {
  display: flex; flex-direction: column; justify-content: space-between;
  position: relative; min-width: 28px; padding: 0 2px 16px 0;
  text-align: right;
}
.bar-y-label {
  font-size: 10px; color: var(--text-secondary);
  font-variant-numeric: tabular-nums; line-height: 1;
  position: absolute; right: 2px; transform: translateY(50%);
}
.bar-chart-body { flex: 1; min-width: 0; }
.bar-chart-svg { width: 100%; height: 80px; display: block; }
.iface-sparklines .bar-chart-svg { height: 50px; }
.bar-rect { transition: opacity 0.1s; }
.bar-rect:hover { opacity: 0.8; }
.bar-x-axis {
  display: flex; position: relative; height: 16px;
}
.bar-x-label {
  position: absolute; transform: translateX(-50%);
  font-size: 10px; color: var(--text-secondary);
  font-variant-numeric: tabular-nums; line-height: 1;
  white-space: nowrap;
}
.spark-empty {
  color: var(--text-muted); font-size: 12px; text-align: center;
  padding: 20px 0;
}

/* Heatmap timeseries */
.heatmap-y-axis {
  display: flex; flex-direction: column; gap: 1px;
  padding-bottom: 0;
}
.heatmap-ts-label {
  font-size: 9px; color: var(--text-muted); text-align: right;
  line-height: 7px; height: 7px; font-variant-numeric: tabular-nums;
}
.heatmap-ts-grid { width: 100%; }
.heatmap-ts-cell {
  border-radius: 1px;
}
.heatmap-ts-cell:hover {
  outline: 1px solid rgba(255,255,255,0.5);
  z-index: 1; position: relative;
}
.heatmap-ts-legend {
  display: flex; align-items: center; gap: 4px;
  font-size: 9px; color: var(--text-muted); margin-top: 6px;
  margin-left: 28px;
}
.heatmap-ts-legend-bar {
  width: 80px; height: 6px; border-radius: 2px;
  background: linear-gradient(to right, #3ca03c, #dcc800, #e02828);
}

/* Area chart */
.area-chart-wrap { }
.area-legend {
  display: flex; gap: 10px; margin-top: 6px; flex-wrap: wrap;
}
.area-legend-item {
  display: flex; align-items: center; gap: 4px;
  font-size: 11px; color: var(--text-secondary);
}
.area-legend-swatch {
  width: 8px; height: 8px; border-radius: 2px; display: inline-block;
}

/* Per-interface network chart */
.iface-chart { display: flex; flex-direction: column; gap: 6px; }
.iface-row {
  display: flex; align-items: baseline; gap: 12px;
  font-variant-numeric: tabular-nums;
}
.iface-dir {
  font-size: 12px; font-weight: 600; min-width: 40px;
}
.iface-val {
  font-size: 16px; font-weight: 600; color: var(--text-primary);
  min-width: 110px;
}
.iface-bytes {
  font-size: 11px; color: var(--text-muted);
}
.iface-sparklines { margin-bottom: 4px; }

/* Loading */
.telemetry-loading {
  text-align: center; color: var(--text-muted); padding: 40px 0;
  font-size: 14px;
}

/* ── Workloads view ─────────────────────────────────────────────────── */
.workloads-view { max-width: 1100px; }
.workloads-summary {
  display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap;
}
.workloads-summary-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 16px; flex: 1; min-width: 130px;
}
.workloads-summary-label {
  font-size: 11px; color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.03em; margin-bottom: 4px;
}
.workloads-summary-value {
  font-size: 20px; font-weight: 600; color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.workloads-summary-sub {
  font-size: 11px; color: var(--text-secondary); margin-top: 2px;
}
.workloads-chart { margin-bottom: 16px; }
.workloads-chart-title {
  font-size: 12px; font-weight: 500; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px;
}
.workloads-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.workloads-table th {
  text-align: left; padding: 6px 10px; color: var(--text-muted);
  border-bottom: 1px solid var(--border); font-weight: 500; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.03em;
}
.workloads-table td {
  padding: 6px 10px; border-bottom: 1px solid var(--border-subtle, rgba(42,34,24,0.2));
  color: var(--text-primary);
}
.workloads-table td.mono {
  font-variant-numeric: tabular-nums;
}
.workload-group-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  margin-right: 6px; vertical-align: middle;
}
.workload-group-badge {
  font-size: 10px; padding: 1px 6px; border-radius: 3px;
  background: rgba(255,255,255,0.06); color: var(--text-secondary);
  text-transform: capitalize;
}
