:root,
:root[data-theme="light"] {
  color-scheme: light;

  /* Alongtail design tokens */
  --canvas-bg: #f0eeeb;
  --surface-primary: #ffffff;
  --surface-secondary: #f8f8f8;
  --surface-tertiary: #f3f4f6;
  --surface-elevated: rgba(255, 255, 255, 0.92);
  --text-primary: #2c2c2e;
  --text-secondary: #8e8e93;
  --text-tertiary: #aeaeb2;
  --text-quaternary: #c7c7cc;
  --border-primary: rgba(0, 0, 0, 0.06);
  --border-secondary: rgba(0, 0, 0, 0.03);
  --border-focus: rgba(88, 126, 194, 0.35);
  --accent-blue: #587ec2;
  --accent-blue-hover: #4d70b3;
  --accent-blue-light: rgba(88, 126, 194, 0.06);
  --accent-blue-medium: rgba(88, 126, 194, 0.12);
  --accent-green: #5fa97e;
  --accent-green-light: rgba(95, 169, 126, 0.08);
  --accent-orange: #d4915a;
  --accent-orange-light: rgba(212, 145, 90, 0.09);
  --accent-purple: #9678b6;
  --accent-purple-light: rgba(150, 120, 182, 0.08);
  --accent-red: #c96b68;
  --accent-red-light: rgba(201, 107, 104, 0.08);
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.07);
  --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.08);
  --transition-fast: 100ms ease-out;
  --transition-base: 150ms ease-out;
  --transition-smooth: 200ms cubic-bezier(0.25, 0.1, 0.25, 1);
  --video-surface: #111317;
  --video-surface-deep: #0c0e11;
  --video-text: #f3f4f6;
  --video-muted: #9fa6b3;

  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  font-size: 13px;
  line-height: 1.5;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body,
main {
  width: 100%;
  min-width: 320px;
  min-height: 100%;
}

body {
  background: var(--canvas-bg);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }
button,
input,
select { font: inherit; }
button { color: inherit; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { border-radius: var(--radius-xs); background: rgba(0, 0, 0, 0.1); }
::-webkit-scrollbar-thumb:hover { background: rgba(0, 0, 0, 0.15); }

:focus-visible { outline: 2px solid var(--accent-blue); outline-offset: 2px; }
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-blue-light);
}

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

h1,
h2,
p { margin-top: 0; }
h1 { margin-bottom: 4px; font-size: 22px; font-weight: 600; letter-spacing: -0.3px; line-height: 1.3; }
h2 { margin-bottom: 0; font-size: 15px; font-weight: 600; letter-spacing: -0.1px; line-height: 1.3; }
.muted { color: var(--text-secondary); line-height: 1.5; }
.eyebrow,
.sidebar-eyebrow {
  margin: 0 0 6px;
  color: var(--text-tertiary);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Shared Alongtail-style controls */
label {
  display: grid;
  gap: 5px;
  color: var(--text-tertiary);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

input,
select {
  width: 100%;
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  outline: none;
  background: var(--surface-primary);
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.4;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

input::placeholder { color: var(--text-quaternary); }
input:focus,
select:focus { border-color: var(--accent-blue); box-shadow: 0 0 0 3px var(--accent-blue-light); }

.primary-button,
.secondary-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 28px;
  min-height: 28px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.primary-button:active,
.secondary-button:active,
.danger-button:active { transform: scale(0.97); }
.primary-button { background: var(--accent-blue); color: white; }
.primary-button:hover:not(:disabled) { background: var(--accent-blue-hover); }
.secondary-button { background: rgba(0, 0, 0, 0.05); color: var(--text-primary); }
.secondary-button:hover:not(:disabled) { background: rgba(0, 0, 0, 0.08); }
.danger-button { background: var(--accent-red-light); color: var(--accent-red); }
.danger-button:hover:not(:disabled) { background: rgba(201, 107, 104, 0.15); }
.primary-button.compact,
.compact-action { height: 24px; min-height: 24px; padding: 0 8px; font-size: 11px; }

.text-button,
.recording-link,
.close-button,
.icon-text-button,
.editor-back-button,
.editor-ghost-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: color var(--transition-fast), background var(--transition-fast);
}

.text-button:hover,
.recording-link:hover,
.icon-text-button:hover,
.editor-back-button:hover,
.editor-ghost-button:hover { color: var(--text-primary); }
.danger-text { color: var(--accent-red); }
button:disabled { cursor: not-allowed; opacity: 0.5; }

/* Sign-in and desktop approval */
.login-page,
.device-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 18px;
  background: var(--canvas-bg);
}

.login-card,
.device-card {
  width: min(340px, 100%);
  padding: 32px;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  background: var(--surface-primary);
  box-shadow: var(--shadow-lg);
}

.device-card { width: min(390px, 100%); }
.login-header { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.brand-logo,
.login-logo { display: block; object-fit: contain; }
.login-title { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: 0; }
.login-subtitle { margin: 0 0 20px; color: var(--text-tertiary); font-size: 13px; }
.login-field { margin-bottom: 12px; }
.login-field.password-field { margin-bottom: 16px; }
.login-field input { min-height: 30px; }
.login-error { margin: -8px 0 12px; color: var(--accent-green); font-size: 12px; }
.login-error.error { color: var(--accent-red); }
.login-error:empty { display: none; }
.login-card .login-button { width: 100%; }
.login-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0;
  color: var(--text-tertiary);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.login-divider::before,
.login-divider::after { content: ""; flex: 1; height: 1px; background: var(--border-primary); }
.login-links { display: flex; justify-content: space-between; gap: 12px; margin-top: 16px; }
.login-link { padding: 0; border: 0; background: none; color: var(--text-tertiary); cursor: pointer; font-size: 12px; }
.login-link:hover { color: var(--text-primary); text-decoration: underline; }
.device-card .eyebrow { margin-top: 18px; }
.device-card h2 { margin: 0 0 6px; }
.device-card .muted { margin: 0; }
.device-actions { display: flex; gap: 8px; margin-top: 20px; }
.device-actions button { flex: 1; }

/* Dashboard shell */
.topbar,
.recording-topbar,
.settings-topbar,
.editor-topbar {
  height: 44px;
  border-bottom: 1px solid var(--border-secondary);
  background: var(--surface-primary);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px 0 16px;
}

.brand { display: flex; align-items: center; gap: 7px; color: var(--text-primary); font-size: 14px; font-weight: 600; letter-spacing: -0.2px; text-decoration: none; }
.brand-logo { width: 24px; height: 24px; }
.brand small {
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  background: var(--surface-secondary);
  color: var(--text-tertiary);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.account { display: flex; align-items: center; gap: 8px; color: var(--text-secondary); font-size: 11px; }
.role-pill,
.status,
.recording-ready-pill,
.local-processing-badge,
.transcript-state,
.coming-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
}
.role-pill { background: var(--surface-secondary); color: var(--text-secondary); text-transform: capitalize; }

.dashboard-content {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 24px 0 64px;
}
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.page-heading .muted { margin: 4px 0 0; }
.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.summary-grid article,
.panel {
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  background: var(--surface-primary);
  box-shadow: var(--shadow-xs);
}
.summary-grid article { padding: 12px 14px; }
.summary-grid span { display: block; margin-bottom: 6px; color: var(--text-tertiary); font-size: 10px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.summary-grid strong { font-size: 18px; font-weight: 600; letter-spacing: -0.2px; }
.panel { margin-top: 12px; padding: 16px; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.filters { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 10px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { padding: 8px 10px; border-bottom: 1px solid var(--border-primary); color: var(--text-tertiary); font-size: 10px; font-weight: 600; letter-spacing: 0.04em; text-align: left; text-transform: uppercase; }
td { padding: 11px 10px; border-bottom: 1px solid var(--border-secondary); color: var(--text-secondary); vertical-align: middle; }
tbody tr { transition: background var(--transition-fast); }
tbody tr:hover { background: var(--surface-secondary); }
tr:last-child td { border-bottom: 0; }
td:first-child { min-width: 250px; }
td small { display: block; margin-top: 3px; color: var(--text-tertiary); }
.recording-link { max-width: 310px; overflow: hidden; color: var(--text-primary); font-weight: 500; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.status-complete { background: var(--accent-green-light); color: var(--accent-green); }
.status-failed,
.status-cancelled { background: var(--accent-red-light); color: var(--accent-red); }
.status-uploading,
.status-pending { background: var(--accent-orange-light); color: var(--accent-orange); }
.status-admin { background: var(--accent-blue-light); color: var(--accent-blue); }
.status-user { background: var(--surface-secondary); color: var(--text-secondary); }
.empty-state { min-height: 180px; display: grid; place-items: center; align-content: center; gap: 6px; padding: 48px 24px; color: var(--text-tertiary); text-align: center; }
.empty-state strong { color: var(--text-primary); font-size: 15px; font-weight: 600; }

/* Settings and modal sheets */
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.admin-grid .panel { margin-top: 12px; }
.inline-form { display: flex; align-items: end; gap: 8px; margin-top: 14px; }
.inline-form label { width: 130px; }
.user-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.user-form button,
.user-form .form-message { align-self: end; }
.settings-page { min-height: 100vh; background: var(--canvas-bg); color: var(--text-primary); }
.settings-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 12px;
}
.settings-brand { justify-self: center; }
.settings-account { justify-self: end; }
.settings-page-content { width: min(920px, calc(100% - 48px)); margin: 0 auto; padding: 28px 0 64px; }
.settings-page-heading { margin-bottom: 18px; }
.settings-page-heading h1 { margin: 2px 0 4px; font-size: 24px; letter-spacing: -0.35px; }
.settings-page-heading .muted { margin: 0; }
.settings-page-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.settings-section {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  background: var(--surface-primary);
  box-shadow: var(--shadow-xs);
}
.settings-section:first-child,
.settings-section#adminSettings { grid-column: 1 / -1; }
.settings-row { display: flex; align-items: end; flex-wrap: wrap; gap: 8px; }
.settings-row label:not(.checkbox-setting) { min-width: 190px; }
.profile-form .settings-row label { flex: 1; }
.profile-form .form-message { margin-top: 8px; }
.password-settings-row label { flex-basis: 190px; }
.checkbox-setting {
  min-height: 30px;
  display: flex;
  grid-auto-flow: column;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  background: var(--surface-primary);
  color: var(--text-secondary);
}
.checkbox-setting input { width: auto; min-height: 0; }
.transcription-preference { width: fit-content; margin-top: 14px; }
.meeting-list { display: grid; gap: 4px; margin-top: 12px; }
.meeting-list a { display: flex; justify-content: space-between; gap: 12px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--surface-secondary); color: var(--text-primary); text-decoration: none; }
.meeting-list a:hover { background: var(--surface-tertiary); }
.meeting-list small { color: var(--text-tertiary); }
.member-list { display: grid; gap: 1px; margin-top: 14px; border: 1px solid var(--border-primary); border-radius: var(--radius-md); overflow: hidden; }
.member-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 9px 10px; background: var(--surface-primary); }
.member-row + .member-row { border-top: 1px solid var(--border-secondary); }
.member-row strong,
.member-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-row small { margin-top: 2px; color: var(--text-tertiary); font-size: 10px; }
.member-role { min-height: 24px; padding: 2px 7px; font-size: 10px; }
.settings-section hr { margin: 20px 0; border: 0; border-top: 1px solid var(--border-secondary); }
.settings-footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border-secondary); }
.settings-footer .muted { margin: 0; font-size: 11px; }
.settings-footer .muted strong { color: var(--text-secondary); font-weight: 500; }
.form-message { min-height: 16px; margin: 0; color: var(--accent-green); font-size: 11px; }
.form-message.error { color: var(--accent-red); }

dialog {
  width: min(760px, calc(100% - 32px));
  max-height: calc(100vh - 48px);
  padding: 20px;
  overflow: auto;
  border: 1px solid var(--border-primary);
  border-radius: 14px;
  background: var(--surface-primary);
  color: var(--text-primary);
  box-shadow: var(--shadow-xl);
  animation: sheet-up var(--transition-smooth);
}
dialog::backdrop { background: rgba(0, 0, 0, 0.4); backdrop-filter: blur(4px); }
@keyframes sheet-up { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.dialog-heading { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.close-button { display: grid; place-items: center; width: 28px; height: 28px; border-radius: var(--radius-md); color: var(--text-tertiary); font-size: 21px; font-weight: 400; }
.close-button:hover { background: var(--surface-secondary); color: var(--text-primary); }
dialog video { width: 100%; max-height: 420px; border-radius: var(--radius-md); background: var(--video-surface); }
.metadata { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 8px 15px; margin: 18px 0; font-size: 11px; }
.metadata dt { color: var(--text-tertiary); font-weight: 600; }
.metadata dd { margin: 0; overflow-wrap: anywhere; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* Recording detail */
.recording-page { min-height: 100vh; background: var(--canvas-bg); color: var(--text-primary); }
.recording-topbar,
.editor-topbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 12px; }
.recording-topbar { position: sticky; top: 0; z-index: 20; }
.recording-brand { justify-self: center; }
.icon-text-button { justify-self: start; display: inline-flex; align-items: center; gap: 6px; padding: 5px 7px; border-radius: var(--radius-sm); }
.icon-text-button:hover { background: var(--surface-secondary); }
.icon-text-button span:first-child { font-size: 17px; font-weight: 400; }
.recording-topbar-actions { justify-self: end; display: flex; align-items: center; gap: 8px; }
.recording-heading { min-height: 82px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 24px; border-bottom: 1px solid var(--border-secondary); background: var(--surface-primary); }
.recording-heading h1 { margin: 0 0 4px; font-size: 20px; }
.recording-heading p { margin: 0; color: var(--text-secondary); font-size: 11px; }
.heading-separator { margin: 0 6px; color: var(--text-quaternary); }
.recording-ready-pill { flex: none; background: var(--surface-secondary); color: var(--text-secondary); }
.recording-ready-pill.ready { background: var(--accent-green-light); color: var(--accent-green); }
.recording-ready-pill.failed { background: var(--accent-red-light); color: var(--accent-red); }
.recording-workspace { min-height: calc(100vh - 127px); display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(340px, 0.9fr); }
.recording-preview-column { min-width: 0; display: flex; flex-direction: column; padding: clamp(20px, 3vw, 40px); background: var(--canvas-bg); }
.recording-video-stage { position: relative; flex: 1; min-height: 420px; display: grid; place-items: center; overflow: hidden; border-radius: var(--radius-lg); background: var(--video-surface); box-shadow: var(--shadow-md); }
.recording-video-stage video { width: 100%; height: 100%; max-height: calc(100vh - 245px); object-fit: contain; background: var(--video-surface-deep); }
.recording-loading { width: min(390px, calc(100% - 42px)); color: var(--video-text); text-align: center; }
.recording-loading strong { display: block; margin-top: 18px; color: white; font-size: 15px; font-weight: 600; }
.recording-loading p { margin: 7px auto 0; color: var(--video-muted); font-size: 11px; line-height: 1.5; }
.processing-orbit { width: 52px; height: 52px; margin: auto; padding: 6px; border: 1px solid rgba(255, 255, 255, 0.13); border-radius: 50%; }
.processing-orbit::before { content: ""; display: block; width: 100%; height: 100%; border: 3px solid rgba(255, 255, 255, 0.14); border-top-color: var(--accent-blue); border-radius: 50%; animation: argus-spin 1s linear infinite; }
.processing-orbit span { display: none; }
@keyframes argus-spin { to { transform: rotate(360deg); } }
.recording-footnote { display: flex; justify-content: space-between; gap: 18px; padding: 12px 3px 0; color: var(--text-tertiary); font-size: 10px; }
.privacy-dot { width: 6px; height: 6px; display: inline-block; margin-right: 6px; border-radius: 50%; background: var(--accent-green); box-shadow: 0 0 0 3px var(--accent-green-light); }
.recording-sidebar { min-width: 0; border-left: 1px solid var(--border-secondary); background: var(--surface-primary); }
.sidebar-tabs { height: 44px; display: flex; gap: 22px; padding: 0 20px; border-bottom: 1px solid var(--border-secondary); }
.sidebar-tab { position: relative; padding: 0 1px; border: 0; background: none; color: var(--text-secondary); cursor: pointer; font-size: 12px; font-weight: 500; }
.sidebar-tab.active { color: var(--accent-blue); }
.sidebar-tab.active::after { content: ""; position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; border-radius: 2px 2px 0 0; background: var(--accent-blue); }
.sidebar-pane { padding: 18px 20px 28px; }
.pane-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.pane-heading h2 { margin-top: 7px; }
.local-processing-badge { background: var(--accent-blue-light); color: var(--accent-blue); }
.transcript-state { background: var(--surface-secondary); color: var(--text-secondary); }
.transcript-state.complete { background: var(--accent-green-light); color: var(--accent-green); }
.transcript-state.failed,
.transcript-state.disabled { background: var(--accent-red-light); color: var(--accent-red); }
.pane-description { margin: 10px 0 18px; color: var(--text-secondary); font-size: 11px; line-height: 1.5; }
.transcript-web-loading { display: flex; gap: 10px; padding: 12px; border: 1px solid var(--border-primary); border-radius: var(--radius-md); background: var(--surface-secondary); }
.small-spinner { flex: none; width: 16px; height: 16px; border: 2px solid var(--accent-blue-medium); border-top-color: var(--accent-blue); border-radius: 50%; animation: argus-spin 0.85s linear infinite; }
.transcript-web-loading strong { display: block; font-size: 11px; font-weight: 600; }
.transcript-web-loading p { margin: 3px 0 0; color: var(--text-tertiary); font-size: 10px; line-height: 1.45; }
.web-transcript-segments { max-height: calc(100vh - 280px); overflow-y: auto; padding-right: 4px; }
.web-transcript-segment { width: 100%; display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 8px; padding: 8px 6px; border: 0; border-bottom: 1px solid var(--border-secondary); border-radius: var(--radius-sm); background: transparent; cursor: pointer; text-align: left; }
.web-transcript-segment:hover { background: var(--surface-secondary); }
.web-transcript-segment time { color: var(--accent-blue); font-size: 10px; font-weight: 500; }
.web-transcript-segment span,
.web-transcript-full { color: var(--text-primary); font-size: 11px; line-height: 1.55; }
.web-transcript-full { white-space: pre-wrap; }
.transcript-web-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding-top: 14px; }
.edit-launch-card { width: 100%; min-height: 76px; display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 11px; margin-top: 16px; padding: 12px 14px; border: 1px solid var(--border-primary); border-radius: var(--radius-md); background: var(--surface-primary); box-shadow: var(--shadow-xs); cursor: pointer; text-align: left; transition: border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast); }
.edit-launch-card:hover { border-color: var(--border-focus); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.edit-launch-icon,
.quick-edit-icon { display: grid; place-items: center; border-radius: var(--radius-sm); background: var(--surface-secondary); color: var(--text-secondary); }
.edit-launch-icon { width: 38px; height: 38px; color: var(--accent-blue); font-size: 16px; }
.edit-launch-card strong,
.edit-launch-card small,
.quick-edit-row strong,
.quick-edit-row small { display: block; }
.edit-launch-card strong { font-size: 12px; font-weight: 600; }
.edit-launch-card small { margin-top: 3px; color: var(--text-tertiary); font-size: 10px; line-height: 1.35; }
.edit-launch-arrow { color: var(--text-tertiary); font-size: 20px; font-weight: 300; }
.quick-edit-list { margin-top: 14px; border-top: 1px solid var(--border-secondary); }
.quick-edit-row { min-height: 56px; display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 10px; border-bottom: 1px solid var(--border-secondary); }
.quick-edit-icon { width: 32px; height: 32px; color: var(--text-tertiary); font-size: 10px; }
.quick-edit-row strong { color: var(--text-secondary); font-size: 11px; font-weight: 500; }
.quick-edit-row small { margin-top: 2px; color: var(--text-tertiary); font-size: 9px; }
.coming-pill { background: var(--accent-purple-light); color: var(--accent-purple); font-size: 9px; }
.take-action-section { margin-top: 24px; }
.action-list-button { width: 100%; min-height: 46px; display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 8px; padding: 0 6px; border: 0; border-top: 1px solid var(--border-secondary); background: transparent; cursor: pointer; text-align: left; }
.action-list-button:last-child { border-bottom: 1px solid var(--border-secondary); }
.action-list-button:hover { background: var(--surface-secondary); }
.action-list-button strong { font-size: 11px; font-weight: 500; }
.action-list-danger { color: var(--accent-red); }
.recording-page-message { min-height: 0; margin: 0; padding: 0 24px 12px; color: var(--accent-red); font-size: 11px; }

/* Browser editor */
.browser-editor { height: 100vh; display: grid; grid-template-rows: 44px minmax(0, 1fr) 170px; overflow: hidden; background: var(--surface-primary); color: var(--text-primary); }
.editor-topbar { grid-template-columns: auto minmax(0, 1fr) auto; position: relative; z-index: 10; }
.editor-back-button { width: 28px; height: 28px; border-radius: var(--radius-sm); font-size: 18px; }
.editor-back-button:hover { background: var(--surface-secondary); }
.editor-topbar > strong { overflow: hidden; font-size: 13px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.editor-topbar-actions { display: flex; align-items: center; gap: 6px; }
.autosave-status { display: inline-flex; align-items: center; gap: 6px; margin-right: 6px; color: var(--text-tertiary); font-size: 10px; }
.autosave-status i { width: 6px; height: 6px; border: 1.5px solid var(--accent-blue); border-radius: 50%; }
.autosave-status.saving i { border-top-color: transparent; animation: argus-spin 0.7s linear infinite; }
.autosave-status.saved i { border: 0; background: var(--accent-green); }
.editor-ghost-button { padding: 6px 8px; border-radius: var(--radius-sm); font-size: 11px; }
.editor-ghost-button:hover { background: var(--surface-secondary); }
.editor-finish-button { font-size: 11px; }
.editor-main { min-height: 0; display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(310px, 0.9fr) 70px; }
.editor-video-column { min-width: 0; display: grid; place-items: center; padding: 24px; background: var(--video-surface-deep); }
.editor-video-stage { width: 100%; height: 100%; display: grid; place-items: center; overflow: hidden; }
.editor-video-stage video { width: 100%; height: 100%; object-fit: contain; }
.editor-transcript-column { min-width: 0; overflow: hidden; border-left: 1px solid var(--border-secondary); background: var(--surface-primary); }
.editor-tip { min-height: 72px; display: grid; grid-template-columns: 52px 1fr auto; gap: 10px; padding: 12px; border-bottom: 1px solid var(--border-primary); background: var(--accent-blue-light); }
.tip-illustration { border-radius: var(--radius-sm); background: repeating-linear-gradient(to bottom, var(--accent-blue-medium) 0 5px, transparent 5px 11px), var(--surface-primary); }
.editor-tip strong { font-size: 10px; font-weight: 600; }
.editor-tip p { margin: 4px 0 0; color: var(--text-secondary); font-size: 9px; line-height: 1.45; }
.editor-tip button { align-self: start; border: 0; background: none; color: var(--text-secondary); cursor: pointer; font-size: 16px; }
.editor-transcript-heading { height: 40px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 14px; border-bottom: 1px solid var(--border-secondary); font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.editor-transcript-heading small { color: var(--text-tertiary); font-size: 9px; font-weight: 500; text-transform: none; letter-spacing: 0; }
.editor-transcript-segments { height: calc(100% - 112px); overflow-y: auto; padding: 8px 10px 20px; }
.editor-tool-rail { display: flex; flex-direction: column; border-left: 1px solid var(--border-secondary); background: var(--surface-secondary); }
.editor-tool-rail button { min-height: 72px; display: grid; place-items: center; align-content: center; gap: 5px; padding: 6px; border: 0; border-bottom: 1px solid var(--border-secondary); background: transparent; color: var(--text-secondary); font-size: 9px; cursor: pointer; }
.editor-tool-rail button span { font-size: 17px; }
.editor-tool-rail button.active { color: var(--accent-blue); background: var(--accent-blue-light); }
.editor-timeline-panel { position: relative; z-index: 5; padding: 12px 16px 14px; border-top: 1px solid var(--border-primary); background: var(--surface-primary); }
.timeline-toolbar-web { height: 38px; display: grid; grid-template-columns: 1fr auto auto; align-items: start; gap: 14px; }
.timeline-toolbar-web strong,
.timeline-toolbar-web span { display: block; }
.timeline-toolbar-web strong { font-size: 10px; font-weight: 600; }
.timeline-toolbar-web > div:first-child span { margin-top: 2px; color: var(--text-tertiary); font-size: 9px; }
.trim-readout { display: flex; align-items: center; gap: 6px; color: var(--text-tertiary); font-size: 9px; }
.trim-readout output { padding: 4px 6px; border-radius: var(--radius-sm); background: var(--surface-secondary); color: var(--text-primary); font-weight: 600; }
.web-timeline-ruler { height: 20px; display: flex; justify-content: space-between; padding: 0 4px; color: var(--text-tertiary); font-size: 8px; }
.web-trim-track { position: relative; height: 54px; border-radius: var(--radius-md); background: var(--surface-tertiary); }
.web-trim-kept { position: absolute; inset: 0; overflow: hidden; border: 2px solid var(--accent-blue); border-radius: var(--radius-md); background: var(--accent-blue-light); }
.trim-handle { position: absolute; top: 11px; bottom: 11px; width: 4px; border-radius: 2px; background: var(--accent-blue); }
.trim-handle.left { left: 6px; }
.trim-handle.right { right: 6px; }
.timeline-wave { position: absolute; inset: 14px 18px; opacity: 0.45; background: repeating-linear-gradient(90deg, var(--accent-blue) 0 2px, transparent 2px 6px); mask-image: linear-gradient(to bottom, transparent 0, #000 35%, #000 65%, transparent 100%); }
.web-trim-track input[type="range"] { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; background: transparent; pointer-events: none; appearance: none; }
.web-trim-track input[type="range"]::-webkit-slider-thumb { width: 18px; height: 54px; border: 0; border-radius: var(--radius-sm); background: transparent; cursor: ew-resize; pointer-events: auto; appearance: none; }
.web-trim-track #trimEndInput { z-index: 3; }
.editor-export-message { min-height: 14px; margin: 5px 0 0; color: var(--text-secondary); font-size: 9px; }
.editor-export-message.error { color: var(--accent-red); }

@media (max-width: 980px) {
  .recording-workspace { grid-template-columns: 1fr; }
  .recording-sidebar { border-top: 1px solid var(--border-secondary); border-left: 0; }
  .recording-video-stage { min-height: min(58vw, 560px); }
  .recording-video-stage video { max-height: none; }
  .web-transcript-segments { max-height: 420px; }
  .editor-main { grid-template-columns: 1fr 320px; }
  .editor-tool-rail { display: none; }
  .autosave-status { display: none; }
}

@media (max-width: 820px) {
  .summary-grid,
  .filters { grid-template-columns: 1fr 1fr; }
  .admin-grid { grid-template-columns: 1fr; }
  .user-form { grid-template-columns: 1fr; }
  .settings-page-grid { grid-template-columns: 1fr; }
  .settings-section:first-child,
  .settings-section#adminSettings { grid-column: auto; }
  .settings-row { align-items: stretch; flex-direction: column; }
  .settings-row > * { width: 100%; }
}

@media (max-width: 700px) {
  .recording-topbar { grid-template-columns: auto 1fr auto; padding: 0 8px; }
  .recording-brand { justify-self: start; margin-left: 6px; }
  .recording-brand span,
  .icon-text-button span:last-child,
  #recordingSettingsButton { display: none; }
  .recording-heading { align-items: flex-start; flex-direction: column; padding: 14px 16px; }
  .recording-workspace { min-height: auto; }
  .recording-preview-column { padding: 16px; }
  .recording-video-stage { min-height: 55vw; }
  .sidebar-pane { padding: 18px 16px 26px; }
  .browser-editor { height: auto; min-height: 100vh; grid-template-rows: 44px auto auto; overflow: visible; }
  .editor-topbar { padding: 0 8px; }
  .editor-topbar-actions { gap: 3px; }
  .editor-main { grid-template-columns: 1fr; }
  .editor-video-column { min-height: 48vw; padding: 12px; }
  .editor-transcript-column { min-height: 320px; border-top: 1px solid var(--border-secondary); border-left: 0; }
  .editor-transcript-segments { height: 220px; }
  .editor-timeline-panel { padding: 12px; }
  .timeline-toolbar-web { height: auto; grid-template-columns: 1fr auto; }
  .timeline-toolbar-web > div:first-child { display: none; }
}

@media (max-width: 560px) {
  .topbar { padding: 0 10px 0 12px; }
  .account > span:first-child,
  .role-pill { display: none; }
  .settings-topbar { grid-template-columns: auto 1fr auto; padding: 0 8px; }
  .settings-brand { justify-self: start; margin-left: 6px; }
  .settings-brand small,
  .settings-brand span { display: none; }
  .settings-account { min-width: 28px; }
  .settings-page-content { width: min(100% - 24px, 920px); padding-top: 20px; }
  .settings-section { padding: 15px; }
  .settings-footer { align-items: flex-start; flex-direction: column; }
  .dashboard-content { width: min(100% - 24px, 1180px); padding-top: 18px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .summary-grid,
  .filters { grid-template-columns: 1fr; }
  .summary-grid { gap: 8px; }
  .panel { padding: 12px; }
  .login-card,
  .device-card { padding: 28px; }
  .device-actions,
  .dialog-actions { flex-direction: column; }
  .metadata { grid-template-columns: 1fr; }
  .metadata dd { margin-bottom: 5px; }
  .member-row { grid-template-columns: minmax(0, 1fr) auto; }
  .member-row .danger-text { grid-column: 2; }
}

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