* { box-sizing: border-box; }

:root {
  --bg: #f7f4f1;
  --surface: #ffffff;
  --surface-subtle: #faf7f4;
  --surface-raised: #ffffff;
  --border: #dfe3ea;
  --border-strong: #c2c9d6;
  --text: #14171f;
  --text-muted: #5b6472;
  --text-faint: #8a92a0;
  --accent: #C74A22;
  --accent-soft: #FBEFEA;
  --accent-strong: #9E3A1A;
  --green: #16815a;
  --green-soft: #e6f6ee;
  --red: #c22c2c;
  --red-soft: #fbe9e9;
  --amber: #96620a;
  --amber-soft: #fdf1dc;
  --media-bg: #10141c;
  --shadow-xs: 0 1px 2px rgba(20, 23, 31, 0.05), 0 1px 1px rgba(20, 23, 31, 0.04);
  --shadow-sm: 0 4px 10px rgba(20, 23, 31, 0.07), 0 1px 3px rgba(20, 23, 31, 0.05);
  --shadow-md: 0 10px 24px rgba(20, 23, 31, 0.10), 0 2px 6px rgba(20, 23, 31, 0.06);
  --shadow-lg: 0 20px 48px rgba(20, 23, 31, 0.16);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  /* Left nav hugs its labels instead of a fixed pixel column. */
  --rail-width: fit-content(18rem);
  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
  --dur-fast: 120ms;
  --dur-med: 200ms;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #10131a;
  --surface: #181d27;
  --surface-subtle: #13161e;
  --surface-raised: #1e2430;
  --border: #2c3342;
  --border-strong: #414b5e;
  --text: #eef1f7;
  --text-muted: #9ba5b6;
  --text-faint: #6f7994;
  --accent: #C74A22;
  --accent-soft: rgba(224, 122, 85, 0.16);
  --accent-strong: #F0A888;
  --green: #4fc189;
  --green-soft: rgba(79, 193, 137, 0.15);
  --red: #ff6f6f;
  --red-soft: rgba(255, 111, 111, 0.15);
  --amber: #ecb04a;
  --amber-soft: rgba(236, 176, 74, 0.15);
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.24);
  --shadow-sm: 0 6px 16px rgba(0, 0, 0, 0.30);
  --shadow-md: 0 12px 28px rgba(0, 0, 0, 0.34);
  --shadow-lg: 0 24px 56px rgba(0, 0, 0, 0.42);
  color-scheme: dark;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

a { color: var(--accent); }

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  transform: translateY(-160%);
  background: var(--accent);
  color: #fff;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
}

.skip-link:focus { transform: translateY(0); }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

[hidden] { display: none !important; }

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

.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  align-content: center;
  padding: 24px;
  background: var(--bg);
  overflow: auto;
}

.login-bg-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.setup-waiting {
  position: fixed;
  inset: 0;
  z-index: 35;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
}

.setup-waiting-card {
  width: min(100%, 480px);
  display: grid;
  gap: 14px;
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.setup-waiting-card .brand-mark {
  width: 155px;
  height: 29px;
}

.setup-waiting-card h1,
.setup-waiting-card p {
  margin: 0;
}

.setup-waiting-card > p:not(.eyebrow) {
  color: var(--text-muted);
  font-size: 15px;
}

.setup-waiting-actions,
.workspace-access-resolution-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.login-card {
  position: relative;
  z-index: 1;
  width: min(100%, 380px);
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 28px;
}

.login-mode {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 18px 0 4px;
}

.login-mode .button {
  min-height: 36px;
  padding: 7px 8px;
  font-size: 12px;
}

.login-mode .button.active {
  border-color: var(--accent);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.login-mode .button[aria-pressed="true"] {
  border-color: var(--accent);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.social-auth {
  display: grid;
  gap: 10px;
  margin: 16px 0 14px;
}

.social-auth-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.social-auth-divider::before,
.social-auth-divider::after {
  content: "";
  height: 1px;
  background: var(--border);
}

.social-auth-buttons {
  display: grid;
  gap: 8px;
}

.social-auth-button {
  width: 100%;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.social-auth-button:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
}

.social-auth-mark {
  width: 22px;
  min-width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 800;
}

/* Onboarding wizard — light theme aligned with marketing / auth surfaces */
.onboarding-page {
  --ob-bg: #faf7f4;
  --ob-surface: #ffffff;
  --ob-surface-2: #f4efea;
  --ob-text: #202124;
  --ob-muted: #5f6368;
  --ob-faint: #80868b;
  --ob-line: #dadce0;
  --ob-blue: #C74A22;
  --ob-blue-soft: #FBEFEA;
  --ob-green: #188038;
  --ob-green-soft: #e6f4ea;
  --ob-amber: #b06000;
  --ob-amber-soft: #fef7e0;
  --ob-radius: 18px;
  position: fixed;
  inset: 0;
  z-index: 35;
  overflow-x: clip;
  overflow-y: auto;
  background:
    radial-gradient(1100px 520px at 50% -10%, var(--ob-blue-soft), transparent 70%),
    var(--ob-bg);
  color: var(--ob-text);
}

.onboarding-bg-canvas {
  display: none;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  background: transparent;
  opacity: 0.45;
}

.onboarding-shell {
  position: relative;
  z-index: 1;
  min-height: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
}

.onboarding-topbar {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(218, 220, 224, 0.72);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  min-width: 0;
}

.onboarding-brand {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0;
  color: var(--ob-text);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-decoration: none;
}

.onboarding-main {
  min-height: calc(100vh - 72px);
  padding: clamp(18px, 3vw, 40px);
  display: grid;
  align-content: start;
  gap: 16px;
  min-width: 0;
  overflow-x: clip;
}

.onboarding-wizard {
  width: min(100%, 1080px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  gap: clamp(16px, 2.5vw, 32px);
  align-items: start;
  min-width: 0;
}

.onboarding-step-card {
  border: 1px solid var(--ob-line);
  border-radius: 24px;
  padding: clamp(20px, 3vw, 36px);
  background: var(--ob-surface);
  box-shadow: 0 30px 80px rgba(60, 64, 67, 0.10);
  min-width: 0;
  overflow-x: clip;
}

.wizard-step-meta {
  margin-bottom: 6px;
  color: var(--ob-blue);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.wizard-step-title {
  margin: 0 0 8px;
  color: var(--ob-text);
  font-size: clamp(22px, 3vw, 30px);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.wizard-step-desc,
.wizard-lede {
  max-width: 640px;
  margin: 0 0 18px;
  color: var(--ob-muted);
  font-size: 15px;
  line-height: 1.55;
}

.wizard-form {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

.wizard-field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.wizard-form .field {
  display: grid;
  gap: 6px;
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--ob-muted);
}

.wizard-form .field input,
.wizard-form .field select {
  min-width: 0;
  height: 46px;
  padding: 0 12px;
  border: 1px solid var(--ob-line);
  border-radius: 12px;
  background: var(--ob-surface);
  color: var(--ob-text);
  font: inherit;
}

.wizard-form .field input:focus,
.wizard-form .field select:focus {
  outline: none;
  border-color: var(--ob-blue);
  box-shadow: 0 0 0 3px var(--ob-blue-soft);
}

.wizard-priorities {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--ob-line);
  border-radius: 12px;
  background: var(--ob-surface-2);
}

.wizard-priorities legend {
  padding: 0 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ob-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.wizard-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border: 1px solid var(--ob-line);
  border-radius: 999px;
  background: var(--ob-surface);
  font-size: 13px;
  color: var(--ob-text);
  cursor: pointer;
}

.wizard-check:has(input:checked) {
  border-color: var(--ob-blue);
  background: var(--ob-blue-soft);
  color: var(--ob-blue);
}

.wizard-form-actions {
  display: flex;
  gap: 10px;
}

.wizard-status-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.wizard-status-pill {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.wizard-status-pill.ready {
  color: var(--ob-green);
  background: var(--ob-green-soft);
  border: 1px solid rgba(24, 128, 56, 0.28);
}

.wizard-status-pill.todo {
  color: var(--ob-blue);
  background: var(--ob-blue-soft);
  border: 1px solid rgba(199, 74, 34, 0.28);
}

.wizard-status-detail {
  color: var(--ob-muted);
  font-size: 12px;
}

.wizard-guided {
  display: grid;
  gap: 4px;
  margin-bottom: 18px;
}

.wizard-guided-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.wizard-hint {
  margin: 10px 0 0;
  color: var(--ob-faint);
  font-size: 13px;
}

.wizard-optional-badge {
  justify-self: start;
  margin-bottom: 4px;
  padding: 3px 10px;
  border: 1px solid var(--ob-line);
  border-radius: 999px;
  background: var(--ob-surface-2);
  color: var(--ob-faint);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.wizard-warning {
  margin: 0 0 18px;
  padding: 14px 16px;
  border: 1px solid rgba(176, 96, 0, 0.28);
  border-radius: 12px;
  background: var(--ob-amber-soft);
  color: var(--ob-amber);
  font-size: 13px;
}

.wizard-warning ul {
  margin: 8px 0;
  padding-left: 18px;
}

.wizard-warning p {
  margin: 6px 0 0;
  color: var(--ob-muted);
}

.wizard-footer-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--ob-line);
  min-width: 0;
}

.wizard-footer-nav > div {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
}

.onboarding-section-title {
  margin-bottom: 8px;
  color: var(--ob-faint);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.onboarding-readiness {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  align-content: start;
  padding: 16px;
  border: 1px solid var(--ob-line);
  border-radius: var(--ob-radius);
  background: var(--ob-surface);
  box-shadow: 0 8px 28px rgba(60, 64, 67, 0.06);
  min-width: 0;
  overflow-x: clip;
}

.onboarding-readiness .onboarding-section-title {
  grid-column: 1 / -1;
}

.onboarding-readiness-row {
  min-height: 34px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  color: var(--ob-text);
  font-size: 13px;
  min-width: 0;
}

.onboarding-readiness-row > span:not(.onboarding-dot) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.onboarding-readiness-row small {
  color: var(--ob-faint);
  font-weight: 700;
  white-space: nowrap;
  justify-self: end;
}

.onboarding-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #d0d5dd;
}

.onboarding-dot.ready { background: var(--ob-green); }
.onboarding-dot.todo { background: var(--ob-blue); }

.onboarding-dashboard-preview {
  display: grid;
  gap: 10px;
}

.onboarding-research {
  display: grid;
  gap: 10px;
}

.onboarding-research-card {
  border: 1px solid var(--ob-line);
  border-radius: 12px;
  padding: 12px;
  background: var(--ob-surface-2);
  color: var(--ob-text);
}

.onboarding-research-card strong {
  display: block;
  font-size: 13px;
  margin-bottom: 4px;
}

.onboarding-research-card small {
  color: var(--ob-muted);
}

.onboarding-research-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.onboarding-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.onboarding-preview {
  min-height: 104px;
  display: grid;
  align-content: start;
  gap: 7px;
  padding: 12px;
  border: 1px solid var(--ob-line);
  border-radius: 12px;
  background: var(--ob-surface);
  color: var(--ob-text);
  text-align: left;
  cursor: pointer;
}

.onboarding-preview strong {
  font-size: 13px;
}

.onboarding-preview span {
  color: var(--ob-muted);
  font-size: 12px;
}

.onboarding-preview.selected,
.onboarding-preview:hover {
  border-color: var(--ob-blue);
  background: var(--ob-blue-soft);
  box-shadow: 0 0 0 2px rgba(199, 74, 34, 0.12);
}

.login-brand,
.rail-brand {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0;
  color: var(--text);
  font-weight: 800;
  letter-spacing: 0;
  text-decoration: none;
}

.brand-mark {
  /* Box tracks the artwork's real 5.3395:1 aspect; height is the fixed dimension. */
  width: 160px;
  height: 30px;
  display: inline-block;
  flex-shrink: 0;
  border: none;
  border-radius: 0;
  /* Two-tone wordmark: painted as an image, not a mask, so the accent X survives.
     Ink follows the theme the way currentColor used to. */
  background-color: transparent;
  background-image: url("/assets/axwel-wordmark-dark.svg?v=cp5");
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  -webkit-mask: none;
  mask: none;
}

[data-theme="dark"] .brand-mark {
  background-image: url("/assets/axwel-wordmark-white.svg?v=cp5");
}

/* Wordmark replaces the adjacent text label; keep text for accessibility. */
.login-brand > span:not(.brand-mark),
.rail-brand > span:not(.brand-mark),
.onboarding-brand > span:not(.brand-mark) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.muted {
  color: var(--text-muted);
  margin: 0;
}

.field {
  display: grid;
  gap: 6px;
  color: var(--text-muted);
  font-size: 12px;
  margin: 18px 0;
}

.field input,
.search-box input,
.window-select,
.compact-select,
textarea {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  background: var(--surface);
}

.field input {
  min-height: 42px;
  padding: 8px 10px;
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

.field input[type="date"],
.field input[type="datetime-local"],
input[type="date"],
input[type="datetime-local"] {
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

.field.compact {
  margin: 0;
}

.field textarea {
  min-height: 86px;
  padding: 9px 10px;
  resize: vertical;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 168px), 1fr));
  gap: 8px;
}

.form-error {
  color: var(--red);
  margin: 0 0 12px;
  font-size: 13px;
}

.field-help {
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 12px;
}

.async-status {
  min-height: 1.45em;
  margin: 0 0 12px;
  color: var(--text-muted);
  font-size: 13px;
}

button[aria-busy="true"],
button:disabled[aria-busy="true"] {
  cursor: progress;
}

.app-shell {
  min-height: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: var(--rail-width) minmax(0, 1fr);
  overflow-x: clip;
}

.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.rail-brand {
  padding: 4px 8px;
  font-size: 18px;
}

.rail-nav {
  display: grid;
  gap: 4px;
}

.nav-item,
.mobile-nav button {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  max-width: 100%;
  min-width: 100%;
  min-height: 42px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  text-align: left;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}

.nav-item > .nav-label {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-item:hover {
  background: var(--surface-subtle);
  color: var(--text);
}

.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}

.nav-item svg,
.icon-button svg,
.search-icon svg,
.mobile-nav svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.75;
  flex: 0 0 auto;
}

.nav-badge {
  min-width: 20px;
  height: 20px;
  margin-left: auto;
  border-radius: 10px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  padding: 0 6px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
}

.rail-footer {
  margin-top: auto;
  padding: 8px 2px 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.rail-collapse-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  flex: 0 0 auto;
}

.rail-collapse-btn:hover {
  background: var(--surface-subtle);
  color: var(--text);
}

.rail-collapse-btn svg {
  width: 16px;
  height: 16px;
  stroke-width: 1.75;
}

.rail-collapse-icon-expand {
  display: none;
}

.app-shell.is-rail-collapsed {
  --rail-width: var(--rail-collapsed-width, 9rem);
}

.app-shell.is-rail-collapsed .rail {
  padding-left: 8px;
  padding-right: 8px;
  overflow: hidden;
}

.app-shell.is-rail-collapsed .rail-brand {
  justify-content: center;
  padding: 4px 0;
}

.app-shell.is-rail-collapsed .brand-mark {
  width: 72px;
  height: 16px;
}

.app-shell.is-rail-collapsed .nav-item {
  justify-content: center;
  gap: 0;
  padding-left: 6px;
  padding-right: 6px;
}

.app-shell.is-rail-collapsed .nav-item > .nav-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell.is-rail-collapsed .nav-badge {
  display: none;
}

.app-shell.is-rail-collapsed .rail-footer {
  justify-content: center;
}

.app-shell.is-rail-collapsed .rail-collapse-icon-collapse {
  display: none;
}

.app-shell.is-rail-collapsed .rail-collapse-icon-expand {
  display: inline-grid;
}

.legacy-link {
  color: var(--text-muted);
  font-size: 13px;
  text-decoration: none;
}

.workspace-shell {
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow-x: clip;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 74px;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 24px;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
}

.topbar > div:first-child {
  min-width: 0;
  flex: 1 1 140px;
}

.topbar-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.topbar-title-row h1 {
  min-width: 0;
  flex: 0 1 auto;
}

#live-camera-select {
  flex: 0 1 auto;
  max-width: 240px;
  min-width: 0;
}

.eyebrow {
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 { font-size: 22px; line-height: 1.15; }
h2 { font-size: 18px; line-height: 1.2; }
h3 { font-size: 14px; line-height: 1.25; }

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
  flex: 1 1 280px;
}

.whoami {
  max-width: 220px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.2;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.whoami strong {
  color: var(--text);
  font-weight: 600;
}

.search-box {
  min-width: 0;
  flex: 1 1 160px;
  max-width: 320px;
  height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
}

.window-select,
.compact-select {
  min-height: 38px;
  padding: 0 10px;
}

.button,
.icon-button,
.text-button,
.segment {
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}

.button {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 0 12px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  vertical-align: middle;
}

.button.primary {
  width: 100%;
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-xs);
}

.button.primary:hover {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
  box-shadow: var(--shadow-sm);
}

.button.primary:active {
  transform: translateY(1px);
}

.button.secondary {
  background: var(--surface);
}

.button.secondary:hover,
.icon-button:hover {
  background: var(--surface-subtle);
}

.text-button:hover {
  color: var(--accent-strong);
  text-decoration: underline;
}

.button.danger {
  color: var(--red);
  border-color: color-mix(in srgb, var(--red) 35%, var(--border));
}

.icon-button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  display: inline-grid;
  place-items: center;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-weight: 700;
  padding: 4px 0;
}

.subnav {
  display: inline-flex;
  gap: 4px;
  box-sizing: border-box;
  width: max-content;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.subnav.has-overflow:not(.at-end) {
  box-shadow: inset -28px 0 18px -22px color-mix(in srgb, var(--accent) 70%, transparent);
}

.subnav.has-overflow:not(.at-start) {
  border-left-color: color-mix(in srgb, var(--accent) 65%, var(--border));
}

.subnav.has-overflow:not(.at-start):not(.at-end) {
  box-shadow:
    inset 28px 0 18px -22px color-mix(in srgb, var(--accent) 70%, transparent),
    inset -28px 0 18px -22px color-mix(in srgb, var(--accent) 70%, transparent);
}

.subnav-item {
  flex: 0 0 auto;
  min-height: 34px;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 0 12px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-weight: 800;
  white-space: nowrap;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}

.subnav-item.active {
  background: var(--surface-subtle);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--border);
}

.subnav-item[aria-selected="true"] {
  background: var(--surface-subtle);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--border);
}

.subroute-panel {
  display: none;
  min-width: 0;
  max-width: 100%;
}

.subroute-panel.active {
  display: block;
  animation: panelIn 150ms var(--ease);
}

.workspace {
  min-width: 0;
  padding: 20px 24px 34px;
}

.workspace-panel {
  display: none;
  min-width: 0;
  max-width: 100%;
}

.workspace-panel.active {
  display: grid;
  gap: 16px;
  animation: panelIn 150ms var(--ease);
}

.workspace-panel.active > .subnav {
  justify-self: stretch;
  width: 100%;
}

.shell-state-banner,
.wallboard-statusbar,
.posture-notice {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}

.shell-state-banner {
  position: sticky;
  top: 0;
  z-index: 28;
  min-height: 48px;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
}

.shell-state-banner[hidden],
.wallboard-statusbar[hidden] {
  display: none;
}

.demo-shell-indicator {
  border-color: color-mix(in srgb, var(--accent) 60%, var(--border));
  background: color-mix(in srgb, var(--accent-soft) 70%, var(--surface));
}

.trial-readonly-banner {
  justify-content: space-between;
  text-align: left;
  border-color: color-mix(in srgb, var(--orange) 55%, var(--border));
  background: color-mix(in srgb, var(--orange) 10%, var(--surface));
}

.trial-readonly-banner > div {
  display: grid;
  gap: 2px;
}

.posture-notice {
  display: flex;
  align-items: flex-start;
  gap: 8px 14px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border-color: color-mix(in srgb, var(--orange) 45%, var(--border));
  background: color-mix(in srgb, var(--orange) 8%, var(--surface));
}

.posture-notice[hidden] {
  display: none;
}

#recording-cloud-notice:not([hidden]) {
  margin: 0 0 14px;
}

.posture-notice strong {
  flex: 0 0 auto;
}

.wallboard-statusbar:not([hidden]) {
  position: sticky;
  top: 0;
  z-index: 25;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  align-items: center;
  gap: 24px;
  min-height: 92px;
  padding: 16px clamp(24px, 3vw, 52px);
  border-width: 0 0 1px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(12px);
}

.wallboard-statusbar strong {
  display: block;
  margin-top: 3px;
  font-size: clamp(24px, 3vw, 38px);
}

.wallboard-refresh-state {
  display: grid;
  gap: 4px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.wallboard-refresh-state #wallboard-health {
  color: var(--green);
  font-weight: 800;
}

.wallboard-refresh-state #wallboard-health.degraded {
  color: var(--orange);
}

.wallboard-safe-actions {
  display: flex;
  gap: 8px;
}

.workspace-access-resolution {
  min-height: min(560px, calc(100vh - 180px));
  display: grid;
  place-items: center;
}

.workspace-access-resolution-card {
  width: min(100%, 520px);
  display: grid;
  gap: 12px;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.workspace-access-resolution-card h2,
.workspace-access-resolution-card p {
  margin: 0;
}

.workspace-access-resolution-card > p:not(.eyebrow) {
  color: var(--text-muted);
  font-size: 15px;
}

.command-grid,
.workspace-grid {
  display: grid;
  gap: 16px;
  min-width: 0;
  max-width: 100%;
}

.command-grid {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
}

.workspace-grid.two-col {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 420px);
}

.workspace-grid.wide-left {
  grid-template-columns: minmax(0, 1.45fr) minmax(310px, 0.55fr);
}

.workspace-grid.wide-right {
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
}

.admin-agent-inspector {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.admin-agent-inspector #admin-agent-detail {
  min-width: 0;
}

.agent-inspector {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.agent-inspector-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.agent-inspector-head > div:first-of-type {
  min-width: 0;
  flex: 1 1 auto;
}

.agent-inspector-kicker {
  margin: 0 0 4px;
}

#admin-agent-detail-title {
  margin: 0;
  font-size: 20px;
  line-height: 1.25;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.agent-inspector-head .pill {
  margin-top: 4px;
}

.agent-inspector-back {
  display: none;
}

.agent-inspector-tabs {
  width: 100%;
}

.agent-inspector-panel {
  min-width: 0;
}

.agent-status-reason {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  margin: 0 0 14px;
  border: 1px solid var(--amber);
  border-left-width: 3px;
  border-radius: var(--radius-md);
  background: var(--amber-soft);
}

.agent-status-reason strong {
  font-size: 13px;
  color: var(--amber);
}

.agent-status-reason ul {
  margin: 0;
  padding-left: 1.15em;
  display: grid;
  gap: 8px;
}

.agent-status-reason-title {
  display: block;
  font-weight: 600;
}

.agent-status-reason-detail {
  display: block;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
}

.agent-inspector .drawer-section,
.agent-inspector .mini-form {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.agent-inspector .drawer-section:first-child,
.agent-inspector .mini-form:first-child,
.agent-inspector-panel > .kv-grid:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.agent-inspector .drawer-section h3,
.agent-inspector .mini-form h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.agent-shell {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.agent-shell-term {
  margin: 0;
  min-height: 280px;
  max-height: 420px;
  overflow: auto;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: #0b1220;
  color: #d7e0ea;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.agent-shell-term:focus {
  outline: 2px solid var(--accent, #3b82f6);
  outline-offset: 1px;
}

.kv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px 16px;
  margin-top: 4px;
}

.kv-grid > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.kv-grid .k {
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.kv-grid .v {
  color: var(--text);
  font-weight: 600;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.live-control-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.live-control-group:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.live-control-group h4 {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.live-ptz-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.panel,
.command-primary,
.command-side > .panel {
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
}

.panel,
.command-primary {
  padding: 16px;
  min-width: 0;
  max-width: 100%;
}

.progressive-panel > summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  color: var(--text);
  font-weight: 750;
  list-style: none;
}

.progressive-panel > summary::-webkit-details-marker {
  display: none;
}

.progressive-panel > summary::after {
  content: "+";
  color: var(--accent);
  font-size: 1.25rem;
}

.progressive-panel[open] > summary::after {
  content: "−";
}

.progressive-panel > summary small {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
}

.progressive-panel[open] > summary {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.progressive-panel-body {
  min-width: 0;
  padding-top: 14px;
}

.progressive-panel-body > .panel {
  padding: 0;
  box-shadow: none;
}

.command-side {
  display: grid;
  align-content: start;
  gap: 16px;
  min-width: 0;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
  min-width: 0;
}

.section-head > :first-child {
  min-width: 0;
  flex: 1 1 auto;
}

.section-head .muted {
  overflow-wrap: break-word;
}

.section-head .compact-select,
.section-head > .compact-select {
  flex: 0 1 auto;
  max-width: 100%;
  min-width: 0;
}

.section-head > .tool-row,
.section-head > .filter-row {
  flex: 0 1 auto;
  justify-content: flex-end;
  max-width: 100%;
}

.section-head.compact {
  align-items: center;
  margin: 14px 0 8px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
  min-width: 0;
}

.metric-grid.small {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.metric {
  min-width: 0;
  min-height: 92px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
  box-shadow: var(--shadow-xs);
}

.metric .label {
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric .value {
  margin-top: 8px;
  color: var(--text);
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric .sub {
  margin-top: 8px;
  color: var(--text-faint);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Admin > Settings status facts are labels, paths, and sentences — not KPI
   numbers. Do not inherit .metric nowrap+ellipsis; those tiles clip timezone
   names, dashboard presets, data-dir paths, and status copy. */
.settings-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 10px;
  margin-bottom: 16px;
  min-width: 0;
}

.settings-status-grid .settings-status-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  padding: 12px 14px;
}

.settings-status-grid .settings-status-card .label,
.settings-status-grid .settings-status-card .value,
.settings-status-grid .settings-status-card .sub {
  overflow: visible;
  text-overflow: unset;
  white-space: normal;
}

.settings-status-grid .settings-status-card .value {
  margin-top: 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.settings-status-grid .settings-status-card .sub {
  margin-top: 0;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.settings-status-grid .settings-status-card .settings-status-action {
  align-self: flex-start;
  margin-top: 2px;
  font-size: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 700;
}

.pill.neutral { background: var(--surface-subtle); color: var(--text-muted); }
.pill.good { background: var(--green-soft); color: var(--green); }
.pill.warn { background: var(--amber-soft); color: var(--amber); }
.pill.risk { background: var(--red-soft); color: var(--red); }
.pill.info { background: var(--accent-soft); color: var(--accent); }

.pill.good::before,
.pill.warn::before,
.pill.risk::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  margin-right: 5px;
}

.action-list,
.stack-list,
.data-list {
  display: grid;
  gap: 8px;
}

.data-list.compact {
  gap: 6px;
}

.list-continuation {
  min-height: 36px;
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.82rem;
}

.list-continuation .button {
  min-height: 36px;
  flex: 0 0 auto;
}

@media (max-width: 600px) {
  .progressive-panel > summary {
    min-height: 48px;
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .progressive-panel > summary small {
    width: calc(100% - 24px);
    margin: -6px 24px 0 0;
  }

  .list-continuation {
    align-items: flex-start;
    flex-direction: column;
  }
}

.mobile-more-drawer {
  display: grid;
  gap: 16px;
}

.row,
.action-row,
.empty-state,
.detail-empty {
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
  box-shadow: var(--shadow-xs);
}

.row,
.action-row {
  width: 100%;
  display: grid;
  gap: 5px;
  padding: 11px 12px;
  color: var(--text);
  text-align: left;
  transition: background var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}

button.row {
  cursor: pointer;
}

button.row:hover,
.action-row:hover {
  background: var(--surface-raised);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.row-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.row-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
  flex: 1 1 auto;
}

.row-status {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
  max-width: 100%;
}

.row-sub {
  color: var(--text-muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.blocked-feature-why {
  color: var(--text);
  font-size: 13px;
  line-height: 1.4;
}

.blocked-feature-next {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.4;
}

.row.active {
  box-shadow: inset 0 0 0 2px var(--accent);
  background: color-mix(in srgb, var(--accent-soft, #FBEFEA) 50%, var(--surface-subtle));
}

.visitor-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.visitor-card-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.visitor-card-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
  flex: 1 1 auto;
}

.visitor-thumb {
  position: relative;
  flex: 0 0 72px;
  width: 72px;
  height: 72px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--media-bg);
  color: rgba(255, 255, 255, 0.82);
}

.visitor-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.visitor-thumb-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.visitor-thumb-fallback svg {
  width: 28px;
  height: 28px;
}

.visitor-card:hover {
  background: var(--surface-raised);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.visitor-card-actions .button {
  white-space: nowrap;
}

.visitor-detail-media {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.visitor-journey-player video,
.visitor-detail-still img {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--media-bg);
}

.visitor-journey-player .clip-media-error {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  padding: 12px;
  text-align: center;
  border-radius: var(--radius-sm);
  background: var(--media-bg);
}

.visitor-journey-player .clip-media-error[hidden] {
  display: none;
}

/* Import error/warning detail lines. Warnings render on a clean import too,
   so they need to read as advisory rather than as a failure. */
.import-detail-error,
.import-detail-warning {
  margin-top: 4px;
}

.cost-cockpit-unpriced {
  color: var(--amber);
  margin-top: 6px;
}

.import-detail-error { color: var(--red); }
.import-detail-warning { color: var(--amber); }

.import-detail {
  display: block;
  margin-left: 8px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  color: var(--text);
}

.check-row input {
  flex: 0 0 auto;
}

.check-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.consent-brand-heading {
  margin: 0 0 8px;
  font-size: 0.95rem;
  color: var(--text);
}

.consent-brand-heading strong {
  letter-spacing: 0.04em;
  color: var(--accent, var(--text));
}

.consent-optional-note {
  margin: 0 0 12px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.check-row.consent-check {
  align-items: flex-start;
}

.check-row.consent-check input {
  margin-top: 3px;
}

.row-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  color: var(--text-faint);
  font-size: 12px;
}

.intelligence-catalog-row {
  grid-template-columns: 112px minmax(0, 1fr);
  align-items: stretch;
  gap: 12px;
  padding: 10px;
}

.intelligence-catalog-image {
  display: block;
  width: 112px;
  height: 100%;
  min-height: 112px;
  border-radius: calc(var(--radius-md) - 2px);
  background: var(--surface-raised);
  box-shadow: var(--shadow-xs);
  object-fit: cover;
}

.intelligence-catalog-copy {
  display: grid;
  min-width: 0;
  gap: 5px;
}

@media (max-width: 560px) {
  .intelligence-catalog-row {
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 10px;
  }

  .intelligence-catalog-image {
    width: 88px;
    min-height: 88px;
  }
}

.empty-state,
.detail-empty {
  padding: 22px;
  color: var(--text-muted);
  text-align: center;
}

.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  max-width: 100%;
  min-width: 0;
  border-radius: 7px;
  padding: 2px;
  background: var(--surface-subtle);
  box-shadow: var(--shadow-xs);
}

.segment {
  flex: 0 0 auto;
  min-height: 32px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  padding: 0 10px;
  font-weight: 700;
  white-space: nowrap;
}

.segment.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-xs);
}

.camera-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.camera-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.camera-card {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto;
  align-content: start;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface-subtle);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}

.camera-card:hover {
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.camera-preview {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  min-height: 128px;
  border-radius: var(--radius-sm);
  background: var(--media-bg);
  color: #fff;
  overflow: hidden;
}

.camera-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.camera-preview.is-audio-mic {
  background: #0b1220;
}

.camera-preview-audio-logo {
  width: min(58%, 220px) !important;
  height: auto !important;
  object-fit: contain;
}

.camera-preview-fallback {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.82);
}

.camera-preview-retry-hint {
  position: absolute;
  right: 8px;
  bottom: 8px;
  left: 8px;
  margin: 0;
  font-size: 12px;
  line-height: 1.3;
  text-align: center;
  color: rgba(255, 255, 255, 0.88);
  pointer-events: none;
}

.camera-card-body {
  padding: 0 2px 2px;
}

.filter-row,
.tool-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-row > .field.grow,
.tool-row > .field.grow {
  flex: 1 1 180px;
  min-width: 0;
}

.aiops-filter-row {
  margin-bottom: 12px;
}

.aiops-filter-row input {
  min-width: 0;
  flex: 1 1 180px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
}

.filter-row > input[type="date"] {
  flex: 0 1 150px;
  width: auto;
  max-width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
}

.row.transaction-row {
  display: flex;
  align-items: stretch;
  gap: 12px;
}

.transaction-row-body {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  gap: 5px;
}

.transaction-clip {
  flex: 0 0 148px;
  width: 148px;
  max-width: 40%;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--media-bg);
  color: inherit;
  cursor: pointer;
  overflow: hidden;
}

.transaction-clip video {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--media-bg);
}

.transaction-clip-pending {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  padding: 8px;
  text-align: center;
  font-size: 12px;
  color: var(--text-dim);
}

.filter-row > #calls-custom-range:not([hidden]) {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.filter-row > #calls-custom-range input[type="date"] {
  flex: 0 1 150px;
  width: auto;
  max-width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
}

.calls-sync-error,
.calls-sync-log .row-sub {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.calls-sync-error {
  margin: 8px 0;
}

.calls-sync-log {
  max-height: 180px;
  overflow: auto;
  min-width: 0;
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.calls-sync-log .calls-sync-log-error {
  color: var(--red);
}

.intelligence-goal-field {
  margin-bottom: 12px;
}

.intelligence-goal-field textarea {
  width: 100%;
}

.intelligence-field {
  min-width: 150px;
  flex: 1 1 180px;
}

.intelligence-field input,
.intelligence-field .compact-select {
  width: 100%;
  min-width: 0;
}

.tool-stack,
.mini-form {
  display: grid;
  gap: 10px;
}

.ai-intelligence-panel {
  margin: 0 0 12px;
  padding: 8px 12px;
  gap: 6px;
  border: 1px solid color-mix(in srgb, var(--border) 80%, var(--accent, #C74A22) 20%);
  border-radius: var(--radius-md, 10px);
  background: color-mix(in srgb, var(--surface) 88%, var(--accent, #C74A22) 12%);
}

.ai-intelligence-panel .section-head {
  align-items: center;
  gap: 8px;
  margin: 0;
}

.ai-intelligence-panel .section-head h3 {
  margin: 0;
}

.ai-intelligence-panel .section-head .muted {
  margin: 2px 0 0;
}

.ai-intelligence-panel .check-row {
  min-height: 0;
}

.ai-intelligence-panel .row-sub {
  margin: 0;
}

.storage-usage {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.storage-usage-track {
  height: 10px;
  min-width: 0;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-raised, #fff) 70%, var(--border));
  border: 1px solid var(--border);
}

.storage-usage-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--accent, #C74A22);
}

.storage-usage-fill.has-usage {
  min-width: 2px;
}

.storage-usage-fill.good {
  background: var(--green);
}

.storage-usage-fill.warn {
  background: var(--amber);
}

.storage-usage-fill.risk {
  background: var(--red);
}

.storage-usage-legend {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.4;
}

.remote-storage-setup {
  margin: 8px 0 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 10px);
  background: var(--surface);
}

.remote-storage-setup-disclosure {
  border: none;
  background: transparent;
}

.remote-storage-setup-summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.remote-storage-setup-summary .section-head {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
}

.remote-storage-setup-summary::-webkit-details-marker {
  display: none;
}

.remote-storage-setup-summary::after {
  content: '';
  width: 0.45em;
  height: 0.45em;
  margin-top: 8px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg);
  transition: transform var(--dur-fast, 140ms) var(--ease, ease);
  flex: 0 0 auto;
}

.remote-storage-setup-disclosure[open] > .remote-storage-setup-summary::after {
  transform: rotate(225deg);
}

.remote-storage-setup-body {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.remote-storage-setup .section-head {
  margin: 0 0 8px;
}

.remote-storage-setup-summary .section-head {
  margin: 0;
}

.remote-storage-setup .section-head h3 {
  margin: 0;
}

.remote-storage-setup .section-head .muted {
  margin: 2px 0 0;
}

.remote-storage-setup .field-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
}

.remote-storage-setup .drawer-actions {
  margin-top: 4px;
}

.offsite-result-ok {
  color: var(--ok, #2f7d4a);
}

.offsite-result-error {
  color: var(--danger, #b42318);
}

.route-focus-target {
  outline: 2px solid color-mix(in srgb, var(--accent, #C74A22) 70%, white);
  outline-offset: 3px;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent, #C74A22) 22%, transparent);
  transition: box-shadow 180ms ease, outline-color 180ms ease;
}

.nest-setup-guide {
  display: grid;
  gap: 8px;
  margin: 0 0 12px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
}

.nest-setup-guide p,
.nest-setup-guide ol {
  margin: 0;
}

.nest-setup-guide ol {
  padding-left: 1.2rem;
}

.nest-setup-guide a {
  color: var(--accent, #C74A22);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.nest-setup-guide code {
  font-size: 11px;
}

.nest-advanced {
  display: grid;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
}

.nest-advanced summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.nest-advanced[open] summary {
  margin-bottom: 4px;
}

.v4-intercom-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
}

.v4-intercom-status {
  display: grid;
  gap: 2px;
  min-height: 42px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
}

.v4-intercom-status small {
  color: var(--text-muted);
}

.v4-intercom-events {
  display: grid;
  gap: 6px;
}

.v4-intercom-event {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--border);
  font-size: 13px;
}

.v4-intercom-event small {
  flex: 0 0 auto;
  color: var(--text-muted);
}

.mini-form .field {
  margin: 0;
}

.mini-form .field input,
.mini-form .field select,
.mini-form .field textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
}

.field input[type="checkbox"],
.field input[type="radio"],
.mini-form .field input[type="checkbox"],
.mini-form .field input[type="radio"] {
  width: auto;
  min-width: 0;
  max-width: none;
  min-height: 0;
  height: auto;
  padding: 0;
  border: none;
  background: transparent;
  accent-color: var(--accent, #C74A22);
}

.account-permission-grid {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.account-permission-row {
  display: grid;
  grid-template-columns: minmax(92px, 1fr) repeat(3, minmax(54px, 74px));
  align-items: center;
  gap: 6px;
  min-height: 30px;
  font-size: 12px;
}

.account-permission-row.header {
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.account-permission-row label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: var(--text-muted);
}

.account-permission-row input {
  flex: 0 0 auto;
}

.account-users-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.account-users-actions .button,
.button.inline {
  width: auto;
}

.invite-link-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 8px;
}

.invite-link-row input {
  min-width: 0;
}

.video-review-rerun-form {
  align-content: start;
}

.video-review-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.video-review-form-grid .field.wide,
.video-review-rerun-form .drawer-actions,
.video-review-rerun-form .check-row {
  grid-column: 1 / -1;
}

.video-review-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
}

.video-review-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 12px;
}

.video-review-table th,
.video-review-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.video-review-table th {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.video-review-table tr:last-child td {
  border-bottom: 0;
}

.video-review-panel-block {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.video-review-provider-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.video-review-check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
}

.video-review-check {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.video-review-inline-media {
  display: grid;
  gap: 10px;
}

.video-review-clip-media {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.video-review-clip-media h4 {
  margin: 0;
  font-size: 13px;
}

.video-review-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.video-review-media-grid figure {
  display: grid;
  gap: 6px;
  min-width: 0;
  margin: 0;
}

.video-review-video,
.video-review-frame-player img {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  background: #000;
  object-fit: contain;
}

.video-review-frame-player {
  display: grid;
  gap: 8px;
}

.video-review-frame-controls {
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr) auto;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
}

.video-review-frame-controls input[type="range"] {
  width: 100%;
}

.video-review-timeline-markers {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.video-review-marker {
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
}

.video-review-marker.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.video-review-score {
  display: grid;
  grid-template-columns: 110px minmax(90px, 1fr) 42px;
  gap: 8px;
  align-items: center;
  color: var(--text-muted);
  font-size: 12px;
}

.video-review-score-bar {
  height: 8px;
  border-radius: 4px;
  background: var(--surface);
  overflow: hidden;
}

.video-review-score-bar span {
  display: block;
  height: 100%;
  background: var(--accent);
}

.video-review-warnings {
  display: grid;
  gap: 6px;
}

.video-review-warning {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.video-review-raw {
  max-height: 340px;
  overflow: auto;
}

/* In-development notice.
   Used where a subsystem is functional in the product but has not completed
   its live end-to-end verification, so an operator must not treat it as a
   proven channel yet. Amber rather than red: the feature works, its guarantees
   are what is unproven. */
.dev-notice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  margin-bottom: 12px;
  border: 1px solid var(--amber);
  border-left-width: 3px;
  border-radius: var(--radius-sm);
  background: var(--amber-soft);
  color: var(--text);
  font-size: 12.5px;
  line-height: 1.45;
}

.dev-notice-icon {
  flex: 0 0 auto;
  font-size: 14px;
  line-height: 1.3;
}

.dev-notice-body { min-width: 0; }

.dev-notice-title {
  display: block;
  font-weight: 600;
  color: var(--amber);
  margin-bottom: 2px;
}

.dev-notice p {
  margin: 0;
  overflow-wrap: anywhere;
}

.inline-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.live-stage,
.zone-stage {
  position: relative;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-height: 360px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--media-bg);
  color: #fff;
  box-shadow: var(--shadow-xs);
  user-select: none;
}

.live-stage video,
.live-stage img,
.zone-stage img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}

.live-stage {
  touch-action: none;
}

.live-stage.is-zoomed {
  cursor: grab;
}

.live-stage.is-panning {
  cursor: grabbing;
}

.live-stage video,
.live-stage img.live-stage-snapshot {
  transform-origin: 0 0;
}

.live-stage.is-zoomed video,
.live-stage.is-zoomed img.live-stage-snapshot {
  will-change: transform;
}

.live-zoom-indicator {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 4;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  letter-spacing: 0.02em;
}

.live-stage-wrap {
  position: relative;
  width: 100%;
}

.live-region-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

.live-region-overlay.is-drawing {
  pointer-events: auto;
  cursor: none;
}

.live-region-frame {
  position: absolute;
  inset: 0;
  z-index: 1;
  touch-action: none;
}

.live-region-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.live-region-hint {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  z-index: 2;
  margin: 0;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 12px;
  pointer-events: none;
}

.zone-stage img {
  pointer-events: none;
}

/* `display: block` above is an author rule and so beats the UA stylesheet's
   `[hidden] { display: none }` — without this, setting .hidden on the snapshot
   (when the live stream takes over, or when the snapshot itself failed to load
   and would otherwise show a broken-image glyph) had no visual effect. */
.live-stage video[hidden],
.live-stage img[hidden],
.zone-stage img[hidden] {
  display: none;
}

/* Failure/diagnostic message layered over the stage. */
.live-stage.is-audio-mic {
  background: #0b1220;
}

.live-audio-mic-logo-layer {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  z-index: 2;
}

.live-audio-mic-logo,
.live-stage img.live-audio-mic-logo {
  width: min(48%, 280px);
  height: auto;
  object-fit: contain;
}

.live-stage.is-audio-mic video {
  opacity: 0.08;
}

.live-stage-status {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  text-align: center;
  background: rgba(0, 0, 0, 0.55);
  pointer-events: none;
}

.live-stage-status .empty-state {
  min-height: 0;
  max-width: 46ch;
}

.live-stage .live-stream-pending,
.live-stage .live-stream-ready {
  position: absolute;
  inset: 0;
  transition: opacity var(--dur-fast) var(--ease);
}

.live-stage .live-stream-pending {
  opacity: 0;
}

.live-stage .live-stream-ready {
  opacity: 1;
}

.live-stage .empty-state,
.zone-stage .empty-state {
  min-height: 360px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
}

/* Recording coverage bar under Live Tools. These rules used to live only in
   the legacy `styles.css` sheet, which the v4 dashboard never loads — without
   them the hour labels collapse into one concatenated string. */
.live-timeline-container {
  width: 100%;
  min-width: 0;
  padding: 8px 0 0;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}

.live-playback-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 13px;
}

#live-speed-btn {
  min-width: 48px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.live-timeline-range {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.live-timeline-track {
  padding: 16px 0 16px;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  cursor: grab;
}

.live-timeline-track.is-scrubbing {
  cursor: grabbing;
}

.live-timeline-bar {
  position: relative;
  height: 56px;
  background: var(--surface-subtle);
  border-radius: var(--radius-sm);
  cursor: grab;
  user-select: none;
  border: 1px solid var(--border);
  overflow: visible;
  touch-action: none;
}

.live-timeline-bar.is-scrubbing {
  cursor: grabbing;
}

.live-timeline-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.tl-grid-line {
  position: absolute;
  top: 0;
  width: 1px;
  height: 100%;
  background: color-mix(in srgb, var(--text) 12%, transparent);
}

.live-timeline-segments,
.live-timeline-events {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.live-timeline-bar .tl-seg {
  position: absolute;
  top: 0;
  height: 100%;
  border-radius: 2px;
  opacity: 0.7;
  min-width: 2px;
}
.live-timeline-bar .tl-seg.src-server { background: #22c55e; }
.live-timeline-bar .tl-seg.src-agent { background: #3b82f6; }
.live-timeline-bar .tl-seg.src-gap_sync { background: #f59e0b; }
.live-timeline-bar .tl-seg.src-backfill { background: #a855f7; }

.live-timeline-bar .tl-seg.is-target {
  opacity: 1;
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--text) 55%, transparent);
}

.live-timeline-bar .tl-evt {
  position: absolute;
  bottom: 0;
  width: 6px;
  height: 16px;
  background: #f8fafc;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.55);
  border-radius: 1px 1px 0 0;
  pointer-events: none;
  z-index: 2;
  transition: transform 150ms ease, opacity 150ms ease;
  transform-origin: bottom center;
}
.live-timeline-bar .tl-evt:hover,
.live-timeline-bar .tl-evt:focus,
.live-timeline-bar .tl-evt.is-target {
  transform: scaleX(1.8) scaleY(1.3);
  opacity: 1;
  outline: none;
  z-index: 3;
}

.live-timeline-bar .tl-evt.has-person {
  height: 22px;
  background: color-mix(in srgb, var(--red) 85%, transparent);
  box-shadow: none;
}

.live-timeline-bar .tl-evt.is-transaction {
  top: 0;
  bottom: auto;
  height: 18px;
  background: #eab308;
  box-shadow: 0 0 0 1px rgba(113, 63, 18, 0.45);
  border-radius: 0 0 1px 1px;
  transform-origin: top center;
}

.live-timeline-bar .tl-evt.is-visitor {
  height: 8px;
  min-width: 6px;
  border-radius: 2px;
  background: color-mix(in srgb, #64748b 80%, transparent);
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.35);
  transform-origin: center left;
  pointer-events: auto;
  cursor: pointer;
}
.live-timeline-bar .tl-evt.is-visitor.is-seen {
  background: color-mix(in srgb, #38bdf8 75%, transparent);
  box-shadow: 0 0 0 1px rgba(8, 47, 73, 0.4);
}
.live-timeline-bar .tl-evt.is-visitor.is-known {
  background: color-mix(in srgb, #22d3ee 85%, transparent);
  box-shadow: 0 0 0 1px rgba(8, 51, 68, 0.45);
}
.live-timeline-bar .tl-evt.is-visitor:hover,
.live-timeline-bar .tl-evt.is-visitor:focus,
.live-timeline-bar .tl-evt.is-visitor.is-target {
  transform: none;
  opacity: 1;
  z-index: 4;
}
.live-timeline-bar .tl-evt.is-visitor.is-unknown.is-target,
.live-timeline-bar .tl-evt.is-visitor.is-unknown:hover {
  background: #64748b;
  box-shadow: 0 0 0 2px color-mix(in srgb, #64748b 50%, var(--text) 25%);
}
.live-timeline-bar .tl-evt.is-visitor.is-seen.is-target,
.live-timeline-bar .tl-evt.is-visitor.is-seen:hover {
  background: #38bdf8;
  box-shadow: 0 0 0 2px color-mix(in srgb, #38bdf8 50%, var(--text) 25%);
}
.live-timeline-bar .tl-evt.is-visitor.is-known.is-target,
.live-timeline-bar .tl-evt.is-visitor.is-known:hover {
  background: #22d3ee;
  box-shadow: 0 0 0 2px color-mix(in srgb, #22d3ee 50%, var(--text) 25%);
}

.live-timeline-bar .tl-evt.region-match {
  height: 26px;
  width: 7px;
  background: var(--amber);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--amber) 55%, transparent);
}

.live-timeline-playhead {
  position: absolute;
  top: 0;
  width: 3px;
  height: 100%;
  margin-left: -1px;
  background: var(--text);
  z-index: 10;
  pointer-events: none;
  display: none;
}
.live-timeline-playhead::before,
.live-timeline-playhead::after {
  content: '';
  position: absolute;
  left: 50%;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--text);
  border: 2px solid var(--surface);
  box-shadow: 0 1px 4px color-mix(in srgb, #000 35%, transparent);
  transform: translateX(-50%);
}
.live-timeline-playhead::before {
  top: -9px;
}
.live-timeline-playhead::after {
  bottom: -9px;
}

.live-timeline-hover {
  position: absolute;
  top: 0;
  width: 2px;
  height: 100%;
  margin-left: -1px;
  background: color-mix(in srgb, var(--text) 45%, transparent);
  z-index: 8;
  pointer-events: none;
}

.live-timeline-scrub-tip {
  position: absolute;
  left: 50%;
  top: 6px;
  transform: translateX(-50%);
  padding: 4px 8px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  white-space: nowrap;
  pointer-events: none;
  z-index: 20;
  box-shadow: var(--shadow-sm);
}

.live-timeline-now-marker {
  position: absolute;
  top: 0;
  width: 2px;
  height: 100%;
  background: var(--accent);
  z-index: 5;
  pointer-events: none;
}
.live-timeline-now-marker::after {
  content: 'NOW';
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 8px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.5px;
}

.live-timeline-empty {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 11px;
  color: var(--text-muted);
  z-index: 3;
  pointer-events: none;
}

.live-timeline-hours {
  position: relative;
  height: 18px;
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
  overflow: visible;
  pointer-events: none;
}

.live-timeline-hour {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.live-timeline-zoom {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.live-zoom-btn {
  font-size: 12px;
  padding: 6px 12px;
  min-height: 36px;
  background: var(--surface-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}
.live-zoom-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.live-timeline-zoom-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 4px;
}
.live-timeline-legend {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-left: 8px;
  font-size: 11px;
  color: var(--text-muted);
}
.live-timeline-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.live-timeline-legend-swatch {
  display: inline-block;
  width: 12px;
  height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}
.live-timeline-legend-swatch.is-recorded {
  background: #22c55e;
}
.live-timeline-legend-swatch.is-person {
  width: 6px;
  height: 12px;
  border-radius: 1px;
  background: color-mix(in srgb, var(--red) 85%, transparent);
}
.live-timeline-legend-swatch.is-clip {
  width: 6px;
  height: 10px;
  border-radius: 1px;
  background: #f8fafc;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.55);
}
.live-timeline-legend-swatch.is-sale {
  width: 6px;
  height: 10px;
  border-radius: 1px;
  background: #eab308;
  box-shadow: 0 0 0 1px rgba(113, 63, 18, 0.45);
}
.live-timeline-legend-swatch.is-visitor {
  width: 14px;
  height: 6px;
  border-radius: 2px;
  background: #64748b;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.35);
}
.live-timeline-legend-swatch.is-visitor.is-known {
  background: #22d3ee;
  box-shadow: 0 0 0 1px rgba(8, 51, 68, 0.45);
}
.live-timeline-legend-swatch.is-visitor.is-unknown {
  background: #64748b;
}
.live-timeline-identity {
  margin-top: 10px;
}
.live-timeline-identity-card {
  max-width: 360px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}
.live-timeline-identity-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.live-timeline-identity-head strong {
  font-size: 14px;
}
.live-timeline-identity-close {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
.live-timeline-identity-hint {
  margin: 6px 0 10px;
  font-size: 12px;
  color: var(--text-muted);
}
.live-timeline-identity-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 650;
  color: var(--text-muted);
}
.live-timeline-identity-label input {
  font-weight: 500;
  color: var(--text);
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-subtle);
}
.live-timeline-identity-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.live-timeline-region-status {
  font-size: 11px;
  font-weight: 650;
  color: var(--amber);
}
.live-timeline-scrub-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: auto;
}

@media (max-width: 720px), (pointer: coarse) {
  .live-timeline-track {
    padding: 16px 0 18px;
  }

  .live-timeline-bar {
    height: 64px;
  }

  .live-timeline-playhead::before,
  .live-timeline-playhead::after {
    width: 22px;
    height: 22px;
  }

  .live-timeline-playhead::before {
    top: -11px;
  }

  .live-timeline-playhead::after {
    bottom: -11px;
  }

  .live-zoom-btn {
    min-height: 44px;
    padding: 8px 16px;
    font-size: 13px;
  }

  .live-timeline-scrub-hint {
    flex: 1 1 100%;
    margin-left: 0;
  }
}

.zone-overlay {
  position: absolute;
  border: 2px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 5px;
  overflow: visible;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  box-sizing: border-box;
  touch-action: none;
}

.zone-overlay.selected,
.zone-overlay.draft {
  border-color: var(--amber);
  background: color-mix(in srgb, var(--amber) 32%, transparent);
  cursor: move;
}

.zone-overlay.draft {
  border-style: dashed;
}

.zone-overlay-label {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.zone-stage-snapshot {
  pointer-events: none;
}

.zone-stage-frame {
  position: absolute;
  inset: 0;
  z-index: 1;
  cursor: crosshair;
  touch-action: none;
}

.zone-stage-hint {
  position: absolute;
  left: 8px;
  right: 96px;
  bottom: 8px;
  z-index: 3;
  margin: 0;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.55);
  color: rgba(255, 255, 255, 0.9);
  font-size: 12px;
  line-height: 1.35;
  pointer-events: none;
}

.zone-stage-refresh {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 4;
}

.zone-stage .zone-stage-status {
  position: absolute;
  top: 44px;
  left: 8px;
  right: 8px;
  display: block;
  padding: 8px 10px;
  text-align: center;
  background: rgba(0, 0, 0, 0.62);
  border-radius: var(--radius-sm);
  pointer-events: none;
  z-index: 3;
}

.zone-stage .zone-stage-status[hidden] {
  display: none;
}

.zone-handle {
  position: absolute;
  width: 10px;
  height: 10px;
  background: #fff;
  border: 2px solid var(--amber);
  border-radius: 1px;
  z-index: 2;
  box-sizing: border-box;
}

.zone-handle-nw { left: 0; top: 0; transform: translate(-50%, -50%); cursor: nwse-resize; }
.zone-handle-n  { left: 50%; top: 0; transform: translate(-50%, -50%); cursor: ns-resize; }
.zone-handle-ne { right: 0; top: 0; transform: translate(50%, -50%); cursor: nesw-resize; }
.zone-handle-e  { right: 0; top: 50%; transform: translate(50%, -50%); cursor: ew-resize; }
.zone-handle-se { right: 0; bottom: 0; transform: translate(50%, 50%); cursor: nwse-resize; }
.zone-handle-s  { left: 50%; bottom: 0; transform: translate(-50%, 50%); cursor: ns-resize; }
.zone-handle-sw { left: 0; bottom: 0; transform: translate(-50%, 50%); cursor: nesw-resize; }
.zone-handle-w  { left: 0; top: 50%; transform: translate(-50%, -50%); cursor: ew-resize; }

.muted.tiny,
.tiny {
  font-size: 12px;
  line-height: 1.4;
}

.zones-workspace .zone-list {
  margin-top: 12px;
}

.zone-list-row {
  border: 1px solid transparent;
}

.zone-list-row.selected {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  background: color-mix(in srgb, var(--accent-soft) 70%, var(--surface));
  box-shadow: inset 3px 0 0 var(--accent);
}

.zone-editor-panel {
  display: flex;
  flex-direction: column;
  max-height: min(78vh, 920px);
  min-height: 420px;
}

.zone-editor-panel > .section-head {
  flex: 0 0 auto;
}

.zone-editor-form {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  align-content: start;
  gap: 14px;
  padding-right: 2px;
}

.zone-editor-section {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
}

.zone-editor-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.zone-editor-section-head .row-title {
  display: block;
}

.zone-editor-section-head .muted {
  margin-top: 4px;
}

.zone-settings-disclosure,
.zone-check-group {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.zone-settings-disclosure > summary,
.zone-check-group-summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  font-weight: 600;
  color: var(--text);
}

.zone-settings-disclosure > summary::-webkit-details-marker,
.zone-check-group-summary::-webkit-details-marker {
  display: none;
}

.zone-settings-disclosure > summary::after,
.zone-check-group-summary::after {
  content: '';
  width: 0.45em;
  height: 0.45em;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg);
  transition: transform var(--dur-fast) var(--ease);
  flex: 0 0 auto;
}

.zone-settings-disclosure[open] > summary::after,
.zone-check-group[open] > .zone-check-group-summary::after {
  transform: rotate(225deg);
}

.zone-settings-body,
.zone-check-group-body {
  display: grid;
  gap: 8px;
  padding: 0 12px 12px;
}

.zone-check-toolbar {
  display: grid;
  gap: 8px;
}

.zone-check-filter input {
  width: 100%;
}

.zone-check-presets {
  margin: 0;
}

.zone-check-groups {
  display: grid;
  gap: 8px;
}

.zone-check-group.has-enabled {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
}

.zone-check-group-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.zone-check-group-title {
  font-size: 13px;
}

.zone-check-group-hint {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.zone-check-group-count {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 8px;
}

.zone-check-group.has-enabled .zone-check-group-count {
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}

.zone-check-row {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
}

.zone-check-row.is-enabled {
  background: var(--surface);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}

.zone-check-main {
  align-items: flex-start;
}

.zone-check-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.zone-check-label {
  font-weight: 600;
  color: var(--text);
}

.zone-check-desc {
  font-size: 12px;
  color: var(--text-muted);
}

.zone-check-options {
  display: none;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  padding-left: 26px;
}

.zone-check-row.is-enabled .zone-check-options {
  display: grid;
}

.zone-check-mirror {
  min-height: 0;
}

.zone-editor-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin-top: 2px;
  padding: 12px 0 2px;
  background: linear-gradient(to bottom, transparent, var(--surface) 28%);
}

.zone-editor-actions .button.primary {
  width: auto;
  flex: 1 1 140px;
}

.zone-check-presets .button.small,
.zone-editor-actions .button.small,
.empty-state .button.small {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.empty-state.compact {
  min-height: 0;
  padding: 12px;
  font-size: 13px;
}

@media (max-width: 960px) {
  .zone-editor-panel {
    max-height: none;
  }
}

.clip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
  gap: 10px;
}

.clip-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}

.clip-card:hover {
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.clip-card .row-main,
.clip-card .row-sub,
.clip-card .row-meta,
.clip-card .tool-row,
.clip-card .detail-empty {
  min-width: 0;
}

.clip-card .row-sub,
.clip-card .row-meta {
  overflow-wrap: anywhere;
}

.clip-card video {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-sm);
  background: var(--media-bg);
}

.clip-card .clip-media {
  min-width: 0;
}

.clip-card .clip-media-error {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  padding: 12px;
  text-align: center;
  border-radius: var(--radius-sm);
  background: var(--media-bg);
}

.clip-card .clip-media-error[hidden] {
  display: none;
}

/* Keep long detection/export failures inside the card instead of widening the grid. */
.clip-card-error {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  color: var(--red);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
}

body.modal-open,
body.overlay-open {
  overflow: hidden;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 29;
  background: rgba(8, 12, 20, 0.48);
  backdrop-filter: blur(2px);
}

.app-shell [inert] {
  pointer-events: none;
  user-select: none;
}

.detail-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 30;
  width: min(520px, 100vw);
  height: 100vh;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  animation: drawerIn var(--dur-med) var(--ease);
}

.drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid var(--border);
}

.drawer-head > div:first-child {
  min-width: 0;
  flex: 1 1 auto;
}

#drawer-title {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.drawer-body {
  overflow-x: hidden;
  overflow-y: auto;
  padding: 18px;
  min-width: 0;
}

.drawer-body video {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: auto;
}

.checkout-footage {
  display: grid;
  gap: 12px;
  min-width: 0;
  max-width: 100%;
}

.checkout-footage .clip-media {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--media-bg);
}

.checkout-footage .clip-media video {
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: var(--media-bg);
}

.checkout-footage .clip-media-error,
.checkout-footage .clip-media > .detail-empty {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  margin: 0;
  padding: 12px;
  text-align: center;
  background: var(--media-bg);
  box-shadow: none;
}

.checkout-footage .clip-media-error[hidden] {
  display: none;
}

.checkout-footage .row-sub {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.checkout-footage .tool-row {
  margin: 0;
}

.drawer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.drawer-actions.row-actions {
  margin-top: 8px;
}

.drawer-actions .button.primary {
  width: auto;
}

.drawer-evidence-image {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  border-radius: var(--radius-md);
  background: var(--media-bg);
  box-shadow: var(--shadow-xs);
}

.ai-action-grid {
  display: grid;
  gap: 10px;
}

.ai-action-grid > .button {
  width: 100%;
}

.artifact-row {
  align-content: start;
}

.artifact-readout {
  display: grid;
  gap: 12px;
  margin: 16px 0;
}

.artifact-section {
  display: grid;
  gap: 6px;
}

.artifact-section p,
.artifact-section ul {
  margin: 0;
  color: var(--text);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.artifact-section ul {
  padding-left: 18px;
}

.artifact-section li + li {
  margin-top: 4px;
}

.artifact-section pre {
  max-height: 280px;
  overflow: auto;
  margin: 0;
  padding: 10px;
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  box-shadow: var(--shadow-xs);
}

.artifact-feedback-history {
  display: grid;
  gap: 4px;
  color: var(--text-muted);
  font-size: 12px;
}

.drawer-grid {
  display: grid;
  grid-template-columns: minmax(0, 130px) minmax(0, 1fr);
  gap: 8px 12px;
  margin-top: 12px;
  font-size: 13px;
}

.drawer-grid .k {
  color: var(--text-muted);
}

.drawer-grid .v {
  color: var(--text);
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.drawer-grid .drawer-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.4;
  word-break: break-all;
}

.quick-links,
.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.quick-links a,
.admin-card {
  display: grid;
  gap: 6px;
  min-height: 74px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}

.quick-links a:hover,
.admin-card:hover {
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.mobile-nav {
  display: none;
}

.toast-region {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  display: grid;
  gap: 10px;
  width: min(420px, calc(100vw - 24px));
}

.toast {
  max-width: none;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.4;
  animation: toastIn var(--dur-med) var(--ease);
}

.toast-error {
  border-color: var(--red);
  background: var(--red-soft);
  color: var(--text);
  box-shadow: var(--shadow-md), 0 0 0 1px color-mix(in srgb, var(--red) 35%, transparent);
}

.toast-title {
  display: block;
  font-weight: 650;
  margin-bottom: 4px;
}

.toast-error .toast-title {
  color: var(--red);
}

.toast-body {
  display: block;
}

.toast-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.toast-action {
  appearance: none;
  border: 1px solid currentColor;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: inherit;
  font: inherit;
  font-weight: 600;
  font-size: 13px;
  padding: 6px 10px;
  cursor: pointer;
  text-decoration: none;
}

.toast-error .toast-action {
  border-color: var(--red);
  color: var(--red);
}

.toast-action:hover,
.toast-action:focus-visible {
  background: var(--surface-raised);
}

@keyframes drawerIn {
  from { transform: translateX(24px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes moreSheetIn {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes toastIn {
  from { transform: translateY(6px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes panelIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 1180px) {
  .command-grid,
  .workspace-grid.two-col,
  .workspace-grid.wide-left,
  .workspace-grid.wide-right {
    grid-template-columns: 1fr;
  }

  .workspace-grid.wide-right.agent-detail-open > .panel:first-child {
    display: none;
  }

  .agent-inspector-back {
    display: inline-flex;
  }

  .metric-grid,
  .metric-grid.small {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }

  .topbar {
    gap: 12px;
    padding: 12px 16px;
  }

  .search-box {
    max-width: none;
  }
}

@media (max-width: 860px) {
  .shell-state-banner,
  .trial-readonly-banner,
  .posture-notice {
    align-items: stretch;
    flex-direction: column;
    text-align: left;
  }

  .trial-readonly-banner .button {
    width: 100%;
  }

  .wallboard-statusbar:not([hidden]) {
    position: relative;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 16px 18px;
  }

  .wallboard-safe-actions .button {
    flex: 1 1 0;
    min-height: 44px;
  }

  .onboarding-topbar {
    height: auto;
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
    padding: 12px 14px;
  }

  .onboarding-stepper {
    width: 100%;
    max-width: 100%;
    justify-content: flex-start;
    gap: 10px 14px;
    padding: 8px 12px;
    border-radius: 16px;
  }

  .stepper-step:not(:last-child)::after {
    display: none;
  }

  .onboarding-header-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .onboarding-main {
    padding: 14px 12px;
  }

  .onboarding-wizard {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .onboarding-step-card {
    padding: 16px;
    border-radius: 18px;
  }

  .onboarding-readiness {
    order: 2;
    padding: 12px;
  }

  .onboarding-preview-grid {
    grid-template-columns: 1fr;
  }

  .wizard-guided-actions .button,
  .wizard-form-actions .button,
  .wizard-footer-nav .button {
    min-height: 44px;
  }

  .app-shell {
    grid-template-columns: 1fr;
    padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px));
  }

  .rail {
    display: none;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
    justify-content: flex-start;
    gap: 10px;
    padding: 12px 14px;
  }

  /* Desktop flex-basis values are widths; in a column topbar they become
     preferred heights and open a large empty band under the title. */
  .topbar > div:first-child {
    flex: 0 0 auto;
  }

  .topbar-title-row {
    flex-direction: column;
    align-items: stretch;
  }

  #live-camera-select {
    width: 100%;
    max-width: none;
  }

  .topbar-actions {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    align-content: start;
    gap: 8px;
    width: 100%;
  }

  .search-box {
    min-width: 0;
    max-width: none;
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .window-select {
    display: block;
    grid-column: 1;
    grid-row: 2;
    justify-self: start;
    width: auto;
    min-width: 0;
  }

  #logout-btn {
    display: none;
  }

  .whoami {
    grid-column: 2;
    grid-row: 2;
    max-width: none;
    justify-self: start;
    text-align: left;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    font-size: 12px;
    line-height: 1.3;
  }

  #theme-toggle {
    grid-column: 3;
    grid-row: 2;
  }

  #refresh-button {
    grid-column: 4;
    grid-row: 2;
  }

  .workspace {
    padding: 14px;
    padding-bottom: calc(28px + 68px + env(safe-area-inset-bottom, 0px));
    overflow-x: clip;
  }

  .workspace-grid,
  .command-grid,
  .workspace-grid.two-col,
  .workspace-grid.wide-left,
  .workspace-grid.wide-right {
    min-width: 0;
  }

  .section-head {
    flex-direction: column;
    align-items: stretch;
  }

  .section-head > .compact-select,
  .section-head .compact-select,
  .section-head > .tool-row,
  .section-head > .filter-row {
    width: 100%;
  }

  #workspace-visitors .filter-row .compact-select,
  #workspace-transactions .filter-row .compact-select {
    flex: 1 1 140px;
    width: auto;
    min-width: 0;
  }

  .row.transaction-row {
    flex-wrap: wrap;
  }

  .transaction-clip {
    flex: 1 1 100%;
    width: 100%;
    max-width: 220px;
  }

  .subnav {
    width: 100%;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
  }

  .subnav-item {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 0 14px;
  }

  .live-stage,
  .zone-stage {
    width: 100%;
    max-width: 100%;
    min-height: 0;
    height: auto;
    aspect-ratio: 16 / 9;
  }

  #cameras-live-panel .tool-row .button {
    flex: 1 1 calc(50% - 8px);
    min-width: calc(50% - 8px);
  }

  #cameras-live-panel .tool-row .icon-button {
    width: auto;
    height: auto;
    min-width: 44px;
    min-height: 44px;
    flex: 1 1 calc(25% - 8px);
  }

  #cameras-live-panel .tool-row[aria-label="PTZ controls"] .button {
    flex: 1 1 calc(50% - 8px);
    min-width: calc(50% - 8px);
  }

  .panel,
  .command-primary {
    padding: 14px;
  }

  .toast-region {
    left: 12px;
    right: 12px;
    bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    width: auto;
  }

  .mobile-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    height: auto;
    min-height: 64px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    background: var(--surface);
    border-top: 1px solid var(--border);
  }

  .mobile-nav button {
    display: grid;
    place-items: center;
    gap: 2px;
    min-height: 56px;
    font-size: 11px;
    font-weight: 700;
  }

  .mobile-nav button.active {
    color: var(--accent);
  }

  .detail-drawer {
    width: 100vw;
  }

  /* Shared dense controls: touch-friendly across every workspace */
  .tool-row .button,
  .filter-row > .button,
  .drawer-actions .button,
  .account-users-actions .button,
  .camera-actions .button,
  .call-card-actions .button {
    min-height: 44px;
  }

  .data-list .row > .drawer-actions,
  .row > .drawer-actions.row-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .data-list .row > .drawer-actions .button,
  .row > .drawer-actions.row-actions .button {
    width: 100%;
    min-width: 0;
  }

  .visitor-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .visitor-card-actions .button {
    width: 100%;
    min-height: 44px;
  }

  .filter-row > .field,
  .filter-row > .field.compact,
  .tool-row > .field,
  .tool-row > .field.compact {
    flex: 1 1 140px;
    min-width: 0;
  }

  .aiops-filter-row input,
  .intelligence-field {
    min-width: 0;
    flex: 1 1 100%;
  }

  .filter-row > input[type="date"],
  .filter-row > #calls-custom-range input[type="date"] {
    flex: 1 1 calc(50% - 8px);
    min-width: calc(50% - 8px);
  }

  .call-card-actions audio {
    flex: 1 1 100%;
    min-width: 0;
    min-height: 48px;
    height: 48px;
  }

  .check-row {
    align-items: flex-start;
    min-height: 0;
  }

  .check-row input {
    margin-top: 3px;
  }
}

.demo-tutorial-root {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 90;
  max-width: min(420px, calc(100vw - 24px));
  font-size: 14px;
}

.demo-tutorial-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-contrast, #fff);
  font-weight: 800;
  box-shadow: var(--shadow);
}

.demo-tutorial-panel {
  width: min(420px, calc(100vw - 24px));
  max-height: min(680px, calc(100vh - 92px));
  margin-top: 10px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
}

.demo-tutorial-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  gap: 10px;
  align-items: start;
  padding: 14px;
  border-bottom: 1px solid var(--border);
}

.demo-tutorial-header strong {
  display: block;
  font-size: 15px;
}

.demo-tutorial-header span,
.demo-tutorial-step p,
.demo-tutorial-status {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.45;
}

.demo-tutorial-route-row,
.demo-tutorial-actions,
.demo-tutorial-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 12px 14px;
}

.demo-tutorial-route-row select,
.demo-tutorial-form input {
  min-width: 0;
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--input-bg, var(--surface));
  color: var(--text);
  padding: 0 10px;
}

.demo-tutorial-step {
  padding: 2px 14px 10px;
}

.demo-tutorial-step h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.25;
}

.demo-tutorial-image,
.demo-tutorial-video {
  margin: 0 14px 12px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-2);
}

.demo-tutorial-image[hidden],
.demo-tutorial-video[hidden] {
  display: none;
}

.demo-tutorial-image img,
.demo-tutorial-video video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.demo-tutorial-actions {
  grid-template-columns: repeat(3, 1fr);
}

.demo-tutorial-actions button,
.demo-tutorial-form button,
.demo-tutorial-chip {
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  font-weight: 700;
}

.demo-tutorial-status {
  min-height: 20px;
  padding: 0 14px 8px;
  margin-top: 0;
}

.demo-tutorial-root.audio-unavailable .demo-tutorial-status {
  color: var(--danger);
}

.demo-tutorial-transcript {
  display: grid;
  gap: 8px;
  max-height: 170px;
  overflow: auto;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.demo-tutorial-message {
  display: grid;
  gap: 3px;
  min-width: 0;
  line-height: 1.4;
}

.demo-tutorial-message strong {
  font-size: 11px;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--muted);
}

.demo-tutorial-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 14px 0;
}

.demo-tutorial-chip {
  padding: 0 10px;
  font-size: 12px;
}

.demo-tutorial-highlight {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

@media (max-width: 680px) {
  .demo-tutorial-root {
    left: auto;
    right: 12px;
    bottom: 76px;
    max-width: min(420px, calc(100vw - 24px));
  }

  .demo-tutorial-root.open {
    left: 12px;
    right: 12px;
    max-width: none;
  }

  .demo-tutorial-panel {
    width: 100%;
    max-height: calc(100vh - 136px);
  }
}

@media (max-width: 560px) {
  .onboarding-readiness {
    grid-template-columns: 1fr;
  }

  .onboarding-stepper {
    gap: 8px 12px;
    padding: 8px 10px;
  }

  .stepper-step {
    font-size: 11px;
    letter-spacing: 0.04em;
  }

  .wizard-footer-nav {
    gap: 12px;
  }

  .wizard-footer-nav > div:last-child {
    margin-left: auto;
  }

  .onboarding-page .wizard-footer-nav .button,
  .onboarding-page .wizard-guided-actions .button {
    padding: 0 14px;
  }

  .wizard-field-grid {
    grid-template-columns: 1fr;
  }

  .metric-grid,
  .metric-grid.small {
    grid-template-columns: 1fr;
  }

  .section-head {
    flex-direction: column;
    align-items: stretch;
  }

  .segmented,
  .camera-actions,
  .filter-row,
  .tool-row {
    width: 100%;
  }

  .segmented {
    display: flex;
    flex-wrap: wrap;
  }

  .segment {
    flex: 1 1 auto;
    min-height: 40px;
  }

  .camera-actions .button {
    flex: 1;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .inline-fields {
    grid-template-columns: 1fr;
  }

  .filter-row > .field,
  .filter-row > .field.compact,
  .filter-row > .field.grow,
  .tool-row > .field,
  .tool-row > .field.compact,
  .tool-row > .field.grow {
    flex: 1 1 100%;
  }

  .filter-row > .button,
  .tool-row > .button {
    flex: 1 1 auto;
    width: 100%;
  }

  .drawer-actions .button {
    flex: 1 1 calc(50% - 8px);
    min-width: calc(50% - 8px);
  }

  .drawer-actions .button:only-child,
  .drawer-actions .button.primary {
    flex: 1 1 100%;
    min-width: 0;
    width: 100%;
  }

  .drawer-grid {
    grid-template-columns: 1fr;
    gap: 2px 0;
  }

  .drawer-grid .k {
    margin-top: 10px;
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .drawer-grid .k:first-child {
    margin-top: 0;
  }

  .drawer-body .row-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-width: 100%;
  }

  .row-title {
    white-space: normal;
  }

  .invite-link-row {
    grid-template-columns: 1fr;
  }

  .account-permission-row {
    grid-template-columns: minmax(0, 1fr) repeat(3, minmax(44px, 56px));
  }

  .video-review-form-grid {
    grid-template-columns: 1fr;
  }

  .whoami {
    max-width: none;
    text-align: left;
    white-space: normal;
  }
}

/* Teach AXWEL panel (per-tenant learning summary) */
.teach-headline {
  font-size: 15px;
  color: var(--text);
  margin: 4px 0 14px;
}
.teach-headline strong { color: var(--accent); }
.teach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.teach-stat {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.teach-stat-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
}
.teach-stat-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-top: 4px;
}
.teach-stat-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ==========================================
   AXWEL FIRST-RUN SETUP WIZARD & COPILOT STYLES
   ========================================== */

/* Soft constellation canvas on light surfaces */
.onboarding-bg-canvas {
  display: block !important;
  background: transparent;
}

/* Stepper styles */
.onboarding-stepper {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  max-width: 100%;
  min-width: 0;
  background: var(--ob-surface-2, #F4EFEA);
  padding: 8px 20px;
  border-radius: 999px;
  border: 1px solid var(--ob-line, #dadce0);
  box-sizing: border-box;
}

.stepper-step {
  font-size: 12px;
  font-weight: 700;
  color: var(--ob-faint, #80868b);
  position: relative;
  cursor: pointer;
  transition: color 0.25s ease;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.stepper-step.active {
  color: var(--ob-blue, #C74A22);
}

.stepper-step.completed {
  color: var(--ob-green, #188038);
}

.stepper-step:not(:last-child)::after {
  content: "→";
  position: absolute;
  right: -16px;
  color: var(--ob-line, #dadce0);
  pointer-events: none;
}

/* Header Action Buttons */
.onboarding-header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Marketing-aligned controls inside the wizard */
.onboarding-page .button {
  border-radius: 999px;
  min-height: 42px;
  padding: 0 18px;
  font-weight: 600;
  width: auto;
}

.onboarding-page .button.primary {
  border-color: var(--ob-blue, #C74A22);
  background: var(--ob-blue, #C74A22);
  color: #fff;
  box-shadow: none;
}

.onboarding-page .button.primary:hover {
  border-color: #1558b0;
  background: #1558b0;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.2);
}

.onboarding-page .button.secondary {
  border-color: var(--ob-line, #dadce0);
  background: #fff;
  color: var(--ob-text, #202124);
}

.onboarding-page .button.secondary:hover {
  background: var(--ob-surface-2, #F4EFEA);
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.12);
}

.onboarding-page .wizard-form-actions .button.primary,
.onboarding-page .wizard-guided-actions .button.primary {
  width: auto;
}

.onboarding-page .brand-mark {
  width: 139px;
  height: 26px;
  border: none;
  border-radius: 0;
  position: relative;
  /* Onboarding renders on a light surface regardless of the dashboard theme, so it
     pins the dark-ink wordmark rather than inheriting the [data-theme] swap above. */
  background-color: transparent;
  background-image: url("/assets/axwel-wordmark-dark.svg?v=cp5");
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  -webkit-mask: none;
  mask: none;
}

.onboarding-page .brand-mark::before,
.onboarding-page .brand-mark::after {
  content: none;
  display: none;
}

/* Interactive readiness row enhancements */
.onboarding-readiness-row.interactive {
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 10px;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  border: 1px solid transparent;
}

.onboarding-readiness-row.interactive:hover {
  background: var(--ob-surface-2, #F4EFEA);
  border-color: var(--ob-line, #dadce0);
  transform: translateX(2px);
}

.onboarding-readiness-row.interactive.active-step {
  background: var(--ob-blue-soft, #FBEFEA);
  border-color: rgba(199, 74, 34, 0.28);
}

.onboarding-readiness-row.interactive.active-step small {
  color: var(--ob-blue, #C74A22);
}

.onboarding-readiness-row .onboarding-dot.ready {
  background: var(--ob-green, #188038);
}

.onboarding-readiness-row .onboarding-dot.todo {
  background: var(--ob-blue, #C74A22);
}

/* In-workspace feature setup (Transactions / Calls first-run) */
.feature-setup {
  display: grid;
  gap: 16px;
  max-width: 760px;
  margin: 0 auto;
  padding: 8px 0 24px;
}

.feature-setup[hidden] {
  display: none !important;
}

.feature-setup-card {
  display: grid;
  gap: 18px;
  padding: clamp(18px, 3vw, 28px);
}

.feature-setup-chrome {
  display: grid;
  gap: 12px;
}

.feature-setup-stepper {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-subtle, var(--surface));
}

.feature-setup-step {
  position: relative;
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  cursor: pointer;
}

.feature-setup-step:not(:last-child)::after {
  content: "→";
  position: absolute;
  right: -14px;
  color: var(--border);
  pointer-events: none;
}

.feature-setup-step.active {
  color: var(--accent, #C74A22);
}

.feature-setup-step.done {
  color: var(--ok, #188038);
}

.feature-setup-step:disabled {
  cursor: default;
}

.feature-setup-title {
  margin: 0;
  font-size: clamp(22px, 3vw, 30px);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.feature-setup-desc {
  margin: 0;
  max-width: 640px;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.55;
}

.feature-setup-guide {
  display: grid;
  gap: 8px;
  margin: 0 0 4px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
}

.feature-setup-guide ol {
  margin: 0;
  padding-left: 1.2rem;
}

.tx-method-picker,
.tx-connect-panel {
  display: grid;
  gap: 12px;
}

.tx-method-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.tx-method-card {
  display: grid;
  gap: 6px;
  text-align: left;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-subtle, var(--surface));
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.tx-method-card:hover,
.tx-method-card:focus-visible {
  border-color: var(--accent, #C74A22);
  outline: none;
}

.tx-method-card-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.tx-method-card-blurb {
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-muted);
}

.tx-connect-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.tx-code-block,
pre.tx-code-block,
code.tx-code-block {
  display: block;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-subtle, var(--surface));
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.tx-secret-box {
  display: grid;
  gap: 8px;
}

.feature-setup-mount {
  display: grid;
  gap: 14px;
}

.feature-setup-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}

.feature-setup-footer .drawer-actions,
.feature-setup-footer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}

.feature-setup-status-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

@media (max-width: 720px) {
  .feature-setup {
    max-width: none;
    padding-inline: 0;
  }

  .feature-setup-stepper {
    border-radius: 16px;
  }

  .feature-setup-step:not(:last-child)::after {
    display: none;
  }
}

/* Calls review cards: transcript, sentiment, missed disposition */
.call-card-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.call-card.call-card-flagged {
  border-left: 3px solid var(--red);
}

.call-card.call-card-missed {
  border-left: 3px solid var(--amber);
}

.call-card.call-card-flagged.call-card-missed {
  border-left-color: var(--red);
}

.call-disposition {
  font-size: 12px;
  font-weight: 700;
  color: var(--amber);
}

.call-reason {
  font-size: 12px;
  line-height: 1.45;
  color: var(--text);
}

.call-reason.muted {
  color: var(--text-muted);
}

.call-transcript-block {
  display: grid;
  gap: 6px;
  margin-top: 4px;
}

.call-transcription {
  display: none;
  max-height: 220px;
  overflow: auto;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--surface-raised, var(--surface));
  border: 1px solid var(--border);
  font-size: 13px;
  line-height: 1.5;
}

.call-transcription.open {
  display: block;
}

.call-transcript-turns {
  display: grid;
  gap: 6px;
}

.call-transcript-turn {
  display: grid;
  gap: 2px;
  width: 100%;
  padding: 6px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.call-transcript-turn:hover,
.call-transcript-turn:focus-visible {
  background: var(--surface-subtle);
  outline: none;
}

.call-transcript-speaker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.call-transcript-text,
.call-transcript-plain {
  color: var(--text);
  white-space: pre-wrap;
}

.call-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.call-card-actions audio {
  flex: 1 1 220px;
  min-width: 180px;
  max-width: 100%;
  min-height: 40px;
}

.call-card-actions .button.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.employee-candidate-row .row-main {
  align-items: flex-start;
  justify-content: flex-start;
}

.employee-candidate-thumb {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface-raised);
  flex: 0 0 48px;
}

.employee-candidate-thumb.empty {
  display: inline-block;
}
