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

:root {
  --glass-blur: 16px;
}

html,
html[data-theme="gohub"] {
  --bg: #08090c;
  --surface-1: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.06);
  --surface-3: rgba(255, 255, 255, 0.09);
  --surface-soft: rgba(255, 255, 255, 0.04);
  --line-soft: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.07);
  --glass-border-focus: rgba(255, 255, 255, 0.12);

  --text: #f2eeeb;
  --text-secondary: #a6a1a0;
  --text-muted: #6b6971;

  --brand: #f2a900;
  --brand-dim: #c98a00;
  --brand-ink: #08090c;
  --brand-soft: rgba(242, 169, 0, 0.08);
  --brand-soft-strong: rgba(242, 169, 0, 0.12);
  --brand-soft-border: rgba(242, 169, 0, 0.2);
  --brand-shadow: 0 10px 24px rgba(242, 169, 0, 0.18);

  --success: #889868;
  --success-soft: rgba(136, 152, 104, 0.12);
  --success-soft-border: rgba(136, 152, 104, 0.18);
  --warning: #c89040;
  --warning-soft: rgba(200, 144, 64, 0.1);
  --warning-soft-border: rgba(200, 144, 64, 0.22);
  --danger: #904838;
  --danger-soft: rgba(144, 72, 56, 0.1);
  --danger-soft-border: rgba(144, 72, 56, 0.18);

  --overlay-bg: rgba(8, 9, 12, 0.92);
  --overlay-solid: #101217;
  --shadow-panel: 0 24px 60px rgba(0, 0, 0, 0.45);
  --scrollbar-thumb: rgba(166, 161, 160, 0.2);
  --scrollbar-thumb-hover: rgba(166, 161, 160, 0.35);

  --font-body: 'Geist', system-ui, -apple-system, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, monospace;
  --radius: 0.5rem;
  --radius-md: 0.375rem;
  --radius-sm: 0.25rem;
}

html[data-theme="signal"] {
  --bg: #080c12;
  --surface-1: rgba(255, 255, 255, 0.028);
  --surface-2: rgba(255, 255, 255, 0.055);
  --surface-3: rgba(255, 255, 255, 0.085);
  --surface-soft: rgba(255, 255, 255, 0.035);
  --line-soft: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.07);
  --glass-border-focus: rgba(255, 255, 255, 0.13);

  --text: #c8d8e8;
  --text-secondary: #88a0b2;
  --text-muted: #516576;

  --brand: #00c2a8;
  --brand-dim: #00927f;
  --brand-ink: #031312;
  --brand-soft: rgba(0, 194, 168, 0.09);
  --brand-soft-strong: rgba(0, 194, 168, 0.14);
  --brand-soft-border: rgba(0, 194, 168, 0.22);
  --brand-shadow: 0 10px 24px rgba(0, 194, 168, 0.2);

  --success: #78c8b8;
  --success-soft: rgba(120, 200, 184, 0.12);
  --success-soft-border: rgba(120, 200, 184, 0.18);
  --warning: #a09080;
  --warning-soft: rgba(160, 144, 128, 0.12);
  --warning-soft-border: rgba(160, 144, 128, 0.22);
  --danger: #905868;
  --danger-soft: rgba(144, 88, 104, 0.12);
  --danger-soft-border: rgba(144, 88, 104, 0.2);

  --overlay-bg: rgba(8, 12, 18, 0.92);
  --overlay-solid: #10151c;
  --shadow-panel: 0 24px 60px rgba(0, 0, 0, 0.5);
  --scrollbar-thumb: rgba(136, 160, 178, 0.2);
  --scrollbar-thumb-hover: rgba(136, 160, 178, 0.35);

  --font-body: 'Outfit', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Geist Mono', ui-monospace, monospace;
  --radius: 0.55rem;
  --radius-md: 0.45rem;
  --radius-sm: 0.35rem;
}

html[data-theme="frost"] {
  --bg: #f2f2f5;
  --surface-1: rgba(255, 255, 255, 0.76);
  --surface-2: rgba(255, 255, 255, 0.9);
  --surface-3: rgba(255, 255, 255, 0.98);
  --surface-soft: rgba(255, 255, 255, 0.92);
  --line-soft: rgba(0, 0, 0, 0.06);
  --glass-border: rgba(0, 0, 0, 0.08);
  --glass-border-focus: rgba(0, 0, 0, 0.14);

  --text: #0c0c12;
  --text-secondary: #505560;
  --text-muted: #7a7f8b;

  --brand: #0c0c12;
  --brand-dim: #232630;
  --brand-ink: #f6f6f8;
  --brand-soft: rgba(12, 12, 18, 0.06);
  --brand-soft-strong: rgba(12, 12, 18, 0.09);
  --brand-soft-border: rgba(12, 12, 18, 0.12);
  --brand-shadow: 0 10px 24px rgba(12, 12, 18, 0.14);

  --success: #5a6a60;
  --success-soft: rgba(90, 106, 96, 0.12);
  --success-soft-border: rgba(90, 106, 96, 0.18);
  --warning: #8a7a68;
  --warning-soft: rgba(138, 122, 104, 0.12);
  --warning-soft-border: rgba(138, 122, 104, 0.2);
  --danger: #7a4a50;
  --danger-soft: rgba(122, 74, 80, 0.1);
  --danger-soft-border: rgba(122, 74, 80, 0.16);

  --overlay-bg: rgba(246, 246, 248, 0.94);
  --overlay-solid: #ffffff;
  --shadow-panel: 0 24px 60px rgba(0, 0, 0, 0.16);
  --scrollbar-thumb: rgba(80, 85, 96, 0.22);
  --scrollbar-thumb-hover: rgba(80, 85, 96, 0.38);

  --font-body: 'Outfit', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Geist Mono', ui-monospace, monospace;
  --radius: 1rem;
  --radius-md: 0.875rem;
  --radius-sm: 0.75rem;
}

html[data-theme="royal"] {
  --bg: #0e1232;
  --surface-1: rgba(155, 172, 216, 0.07);
  --surface-2: rgba(155, 172, 216, 0.11);
  --surface-3: rgba(155, 172, 216, 0.15);
  --surface-soft: rgba(155, 172, 216, 0.08);
  --line-soft: rgba(155, 172, 216, 0.12);
  --glass-border: rgba(155, 172, 216, 0.1);
  --glass-border-focus: rgba(155, 172, 216, 0.16);

  --text: #f4f1ec;
  --text-secondary: #a3abc4;
  --text-muted: #6f7a97;

  --brand: #f98513;
  --brand-dim: #d16c05;
  --brand-ink: #0e1232;
  --brand-soft: rgba(249, 133, 19, 0.08);
  --brand-soft-strong: rgba(249, 133, 19, 0.12);
  --brand-soft-border: rgba(249, 133, 19, 0.2);
  --brand-shadow: 0 10px 24px rgba(249, 133, 19, 0.2);

  --success: #8a90c0;
  --success-soft: rgba(138, 144, 192, 0.12);
  --success-soft-border: rgba(138, 144, 192, 0.18);
  --warning: #c89050;
  --warning-soft: rgba(200, 144, 80, 0.12);
  --warning-soft-border: rgba(200, 144, 80, 0.2);
  --danger: #904050;
  --danger-soft: rgba(144, 64, 80, 0.12);
  --danger-soft-border: rgba(144, 64, 80, 0.18);

  --overlay-bg: rgba(12, 16, 40, 0.92);
  --overlay-solid: #151a3f;
  --shadow-panel: 0 24px 60px rgba(0, 0, 0, 0.48);
  --scrollbar-thumb: rgba(163, 171, 196, 0.24);
  --scrollbar-thumb-hover: rgba(163, 171, 196, 0.38);

  --font-body: 'Outfit', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Geist Mono', ui-monospace, monospace;
  --radius: 0.625rem;
  --radius-md: 0.5rem;
  --radius-sm: 0.4rem;
}

html[data-theme="ember"] {
  --bg: #1a1214;
  --surface-1: rgba(237, 255, 197, 0.04);
  --surface-2: rgba(237, 255, 197, 0.07);
  --surface-3: rgba(237, 255, 197, 0.11);
  --surface-soft: rgba(237, 255, 197, 0.045);
  --line-soft: rgba(237, 255, 197, 0.08);
  --glass-border: rgba(237, 255, 197, 0.06);
  --glass-border-focus: rgba(237, 255, 197, 0.12);

  --text: #edffc5;
  --text-secondary: #b9c395;
  --text-muted: #6b5c5f;

  --brand: #edffc5;
  --brand-dim: #bfd08a;
  --brand-ink: #1a1214;
  --brand-soft: rgba(237, 255, 197, 0.08);
  --brand-soft-strong: rgba(237, 255, 197, 0.12);
  --brand-soft-border: rgba(237, 255, 197, 0.18);
  --brand-shadow: 0 10px 24px rgba(237, 255, 197, 0.18);

  --success: #b8d94a;
  --success-soft: rgba(184, 217, 74, 0.12);
  --success-soft-border: rgba(184, 217, 74, 0.18);
  --warning: #c47040;
  --warning-soft: rgba(196, 112, 64, 0.12);
  --warning-soft-border: rgba(196, 112, 64, 0.22);
  --danger: #dc2011;
  --danger-soft: rgba(220, 32, 17, 0.1);
  --danger-soft-border: rgba(220, 32, 17, 0.18);

  --overlay-bg: rgba(26, 18, 20, 0.93);
  --overlay-solid: #24181b;
  --shadow-panel: 0 24px 60px rgba(0, 0, 0, 0.5);
  --scrollbar-thumb: rgba(185, 195, 149, 0.22);
  --scrollbar-thumb-hover: rgba(185, 195, 149, 0.36);

  --font-body: 'Outfit', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Geist Mono', ui-monospace, monospace;
  --radius: 0.45rem;
  --radius-md: 0.35rem;
  --radius-sm: 0.25rem;
}

html[data-theme="crown"] {
  --bg: #1b1b1b;
  --surface-1: rgba(255, 241, 226, 0.04);
  --surface-2: rgba(255, 241, 226, 0.07);
  --surface-3: rgba(255, 241, 226, 0.11);
  --surface-soft: rgba(255, 241, 226, 0.05);
  --line-soft: rgba(255, 241, 226, 0.07);
  --glass-border: rgba(255, 241, 226, 0.06);
  --glass-border-focus: rgba(255, 241, 226, 0.1);

  --text: #fff1e2;
  --text-secondary: #d7c5b6;
  --text-muted: #877a72;

  --brand: #b76e2d;
  --brand-dim: #93571f;
  --brand-ink: #fff1e2;
  --brand-soft: rgba(183, 110, 45, 0.1);
  --brand-soft-strong: rgba(183, 110, 45, 0.14);
  --brand-soft-border: rgba(183, 110, 45, 0.22);
  --brand-shadow: 0 10px 24px rgba(183, 110, 45, 0.2);

  --success: #d4b896;
  --success-soft: rgba(212, 184, 150, 0.12);
  --success-soft-border: rgba(212, 184, 150, 0.18);
  --warning: #8a5c34;
  --warning-soft: rgba(138, 92, 52, 0.12);
  --warning-soft-border: rgba(138, 92, 52, 0.22);
  --danger: #a04520;
  --danger-soft: rgba(160, 69, 32, 0.12);
  --danger-soft-border: rgba(160, 69, 32, 0.18);

  --overlay-bg: rgba(27, 27, 27, 0.94);
  --overlay-solid: #24211f;
  --shadow-panel: 0 24px 60px rgba(0, 0, 0, 0.48);
  --scrollbar-thumb: rgba(215, 197, 182, 0.22);
  --scrollbar-thumb-hover: rgba(215, 197, 182, 0.36);

  --font-body: 'Outfit', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Geist Mono', ui-monospace, monospace;
  --radius: 0.6rem;
  --radius-md: 0.5rem;
  --radius-sm: 0.375rem;
}

html[data-theme="velvet"] {
  --bg: #1a2028;
  --surface-1: rgba(85, 102, 110, 0.08);
  --surface-2: rgba(85, 102, 110, 0.12);
  --surface-3: rgba(85, 102, 110, 0.16);
  --surface-soft: rgba(85, 102, 110, 0.09);
  --line-soft: rgba(85, 102, 110, 0.12);
  --glass-border: rgba(85, 102, 110, 0.12);
  --glass-border-focus: rgba(85, 102, 110, 0.2);

  --text: #d8dce0;
  --text-secondary: #acb5bc;
  --text-muted: #67757d;

  --brand: #e22227;
  --brand-dim: #b3161a;
  --brand-ink: #f7f1f2;
  --brand-soft: rgba(226, 34, 39, 0.08);
  --brand-soft-strong: rgba(226, 34, 39, 0.13);
  --brand-soft-border: rgba(226, 34, 39, 0.2);
  --brand-shadow: 0 10px 24px rgba(226, 34, 39, 0.2);

  --success: #6a9caa;
  --success-soft: rgba(106, 156, 170, 0.12);
  --success-soft-border: rgba(106, 156, 170, 0.18);
  --warning: #8c5a6a;
  --warning-soft: rgba(140, 90, 106, 0.12);
  --warning-soft-border: rgba(140, 90, 106, 0.22);
  --danger: #6c0102;
  --danger-soft: rgba(108, 1, 2, 0.14);
  --danger-soft-border: rgba(108, 1, 2, 0.2);

  --overlay-bg: rgba(26, 32, 40, 0.94);
  --overlay-solid: #202731;
  --shadow-panel: 0 24px 60px rgba(0, 0, 0, 0.48);
  --scrollbar-thumb: rgba(172, 181, 188, 0.22);
  --scrollbar-thumb-hover: rgba(172, 181, 188, 0.36);

  --font-body: 'Outfit', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Geist Mono', ui-monospace, monospace;
  --radius: 0.5rem;
  --radius-md: 0.4rem;
  --radius-sm: 0.3rem;
}

html, body { height: 100%; }
body {
  font-family: var(--font-body);
  letter-spacing: -0.011em;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  touch-action: manipulation;
}

/* -- Screens -- */
.screen {
  display: none;
  flex-direction: column;
  flex: 1;
  padding: 20px;
  padding-top: max(20px, env(safe-area-inset-top));
  padding-bottom: max(20px, env(safe-area-inset-bottom));
  overflow-y: auto;
}
.screen.active { display: flex; animation: fade-in 0.3s ease-out; }

/* -- Animations -- */
@keyframes fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes stagger-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* -- Glass card -- */
.glass-card {
  background: var(--surface-1);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  transition: background 150ms ease, border-color 150ms ease;
}
.glass-card:active {
  background: var(--surface-2);
  border-color: var(--glass-border-focus);
}

/* -- Login -- */
#login-screen {
  justify-content: center;
  align-items: center;
  gap: 16px;
}
.login-brand {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.04em;
}
.login-sub {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-top: -8px;
}
#login-screen input {
  width: 100%;
  max-width: 320px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  background: var(--surface-1);
  backdrop-filter: blur(var(--glass-blur));
  color: var(--text);
  font-family: inherit;
  font-size: 16px;
  text-align: center;
  transition: border-color 150ms ease;
}
#login-screen input:focus {
  border-color: var(--brand);
  outline: none;
}
.login-btn {
  width: 100%;
  max-width: 320px;
  padding: 12px 16px;
  border-radius: 9999px;
  border: none;
  background: var(--brand);
  color: var(--brand-ink);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 150ms ease, transform 150ms ease;
  -webkit-tap-highlight-color: transparent;
}
.login-btn:active {
  background: var(--brand-dim);
  transform: scale(0.98);
}
#login-error {
  color: var(--danger);
  font-size: 13px;
  min-height: 20px;
}

/* -- Record screen -- */
#record-screen {
  justify-content: space-between;
  align-items: center;
  position: relative;
}
.record-top { width: 100%; }
.record-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 36px;
  margin-bottom: 14px;
  padding-right: 56px;
}
.record-title {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.record-mode-pill {
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: 9999px;
  border: 1px solid var(--glass-border);
  background: var(--surface-1);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.record-mode-pill.quote {
  color: var(--brand-ink);
  background: var(--brand);
  border-color: var(--brand);
}
.record-signal-note {
  margin-bottom: 12px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--warning);
}
.record-signal-note:empty {
  display: none;
}
.record-centre {
  position: relative;
  width: min(calc(100vw - 24px), 360px);
  height: min(calc(100vw - 24px), 360px);
  align-self: center;
  flex-shrink: 0;
}
.record-bottom { display: flex; flex-direction: column; align-items: center; gap: 16px; padding-bottom: 12px; }

.timer {
  font-family: var(--font-mono);
  font-size: 2.5rem;
  font-weight: 300;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.05em;
  color: var(--text);
  text-align: center;
}

/* -- Visualiser -- */
#visualiser {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* -- Record button — fills entire canvas area; all state shown on canvas -- */
.record-btn {
  position: absolute;
  inset: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  z-index: 1;
  border-radius: 0;
}
.record-btn:active { opacity: 0.75; }

/* -- Global menu button -- */
.menu-btn {
  position: fixed;
  top: max(20px, env(safe-area-inset-top));
  right: 16px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 9999px;
  transition: color 150ms ease, background 150ms ease;
  z-index: 50;
  -webkit-tap-highlight-color: transparent;
}
.menu-btn.visible { display: flex; }
.menu-btn:active { color: var(--text-secondary); background: var(--surface-1); }

/* -- Menu scrim -- */
.menu-scrim {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.menu-scrim.open {
  opacity: 1;
  pointer-events: auto;
}

/* -- Menu panel (slides from right) -- */
.menu-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 240px;
  max-width: 70vw;
  background: var(--overlay-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-left: 1px solid var(--glass-border);
  z-index: 100;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  padding: max(64px, calc(env(safe-area-inset-top) + 48px)) 20px 40px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.menu-panel.open {
  transform: translateX(0);
}

.menu-close {
  position: absolute;
  top: max(16px, env(safe-area-inset-top));
  right: 16px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 9999px;
  transition: color 150ms ease, background 150ms ease;
  -webkit-tap-highlight-color: transparent;
}
.menu-close:active { color: var(--text-secondary); background: var(--surface-1); }

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 150ms ease;
  -webkit-tap-highlight-color: transparent;
  text-align: left;
  width: 100%;
}
.menu-item:active {
  background: var(--surface-2);
  color: var(--text);
}
.menu-item svg {
  flex-shrink: 0;
  color: var(--text-muted);
}

/* -- Record actions row -- */
.record-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.record-actions.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* -- Action buttons -- */
.action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 9999px;
  border: 1px solid var(--glass-border);
  background: var(--surface-1);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.action-btn:active { transform: scale(0.96); }
.action-btn:disabled {
  opacity: 0.35;
  pointer-events: none;
}

/* Send button -- prominent gold fill when enabled */
.action-send {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--brand-ink);
  font-weight: 600;
  padding: 12px 36px;
  box-shadow: var(--brand-shadow);
}
.action-send:active:not(:disabled) {
  background: var(--brand-dim);
  border-color: var(--brand-dim);
}
.action-send:disabled {
  background: var(--surface-2);
  border-color: var(--glass-border);
  color: var(--text-muted);
  box-shadow: none;
}
.action-send.sending {
  background: var(--surface-2);
  border-color: var(--glass-border);
  color: var(--text-secondary);
  box-shadow: none;
  pointer-events: none;
}

/* Delete button -- subtle, danger on hover/active */
.action-delete {
  color: var(--text-muted);
  background: var(--surface-1);
}
.action-delete:active {
  color: var(--danger);
  border-color: var(--danger-soft-border);
  background: var(--danger-soft);
}

/* -- Toast -- */
.toast {
  position: fixed;
  bottom: max(32px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 10px 20px;
  border-radius: 9999px;
  background: var(--surface-2);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 100;
  white-space: nowrap;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* -- Confirm overlay -- */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  animation: fade-in 0.15s ease-out;
}
.confirm-dialog {
  background: var(--overlay-solid);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  max-width: 280px;
  width: 90%;
}
.confirm-dialog p {
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 20px;
  color: var(--text);
}
.confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.confirm-actions button {
  padding: 10px 24px;
  border-radius: 9999px;
  border: 1px solid var(--glass-border);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 150ms ease;
  -webkit-tap-highlight-color: transparent;
}
.confirm-actions .confirm-cancel {
  background: var(--surface-1);
  color: var(--text);
}
.confirm-actions .confirm-discard {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

/* -- List screen header + search -- */
.list-header {
  display: flex;
  align-items: center;
  padding: 4px 0 14px;
  gap: 8px;
}
.list-header h2 { flex: 1; text-align: center; font-size: 1.125rem; font-weight: 600; }
.select-count { flex: 1; text-align: center; font-size: .875rem; font-weight: 500; color: var(--text-secondary); }

.icon-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 150ms ease;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.icon-btn:active { background: var(--surface-2); }
.icon-btn-delete { color: var(--text-muted); transition: color 200ms ease, background 150ms ease; }
.icon-btn-delete.has-selection { color: var(--danger); }

.list-search-wrap { position: relative; margin-bottom: 14px; }
.list-search-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); pointer-events: none;
}
.list-search {
  width: 100%;
  background: var(--surface-1);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 10px 12px 10px 36px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.list-search::placeholder { color: var(--text-muted); }
.list-search:focus { border-color: var(--glass-border-focus); }

/* Select mode cards */
.recording-card { display: flex; align-items: center; gap: 12px; }
.card-body { flex: 1; min-width: 0; }
.recording-card.selected {
  background: var(--brand-soft);
  border-color: var(--brand-soft-border);
}
.select-check {
  width: 20px; height: 20px;
  border: 1.5px solid var(--glass-border-focus);
  border-radius: 50%;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: all 150ms ease;
  color: var(--brand-ink);
}
.recording-card.selected .select-check { background: var(--brand); border-color: var(--brand); }

/* FAB — New Recording */
.list-fab {
  position: fixed;
  bottom: max(24px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  display: none;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  background: var(--brand);
  color: var(--brand-ink);
  border: none;
  border-radius: 9999px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  z-index: 90;
  white-space: nowrap;
  box-shadow: 0 4px 24px var(--brand-soft-border);
  -webkit-tap-highlight-color: transparent;
}
.list-fab.visible { display: flex; }
.list-fab:active { background: var(--brand-dim); transform: translateX(-50%) scale(0.97); }

/* Bottom padding so the last card isn't hidden behind the FAB */
#recordings-list { padding-bottom: 80px; }

.hidden { display: none !important; }

/* -- Nav elements -- */
.nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0 16px;
}
.nav-bar h2 { font-size: 1.125rem; font-weight: 600; }
.nav-btn {
  background: var(--surface-1);
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  color: var(--text);
  padding: 8px 16px;
  border-radius: 9999px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 150ms ease;
}
.nav-btn:active { background: var(--surface-2); transform: scale(0.98); }

/* -- Recording cards -- */
.recording-card {
  background: var(--surface-1);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 150ms ease;
  animation: stagger-in 0.25s ease-out both;
}
.recording-card:nth-child(1) { animation-delay: 0ms; }
.recording-card:nth-child(2) { animation-delay: 50ms; }
.recording-card:nth-child(3) { animation-delay: 100ms; }
.recording-card:nth-child(4) { animation-delay: 150ms; }
.recording-card:nth-child(5) { animation-delay: 200ms; }
.recording-card:active {
  background: var(--surface-2);
  border-color: var(--glass-border-focus);
}
.card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
/* -- Drive button (detail view) -- */
.drive-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  background: var(--surface-1);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: all 150ms ease;
  -webkit-tap-highlight-color: transparent;
  margin-top: 10px;
  margin-bottom: 10px;
}
.drive-btn:active {
  background: var(--surface-2);
  border-color: var(--glass-border-focus);
  color: var(--text);
}
.card-label { font-weight: 600; font-size: 14px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-meta { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* -- Badges -- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border: 1px solid transparent;
  flex-shrink: 0;
  transition: all 0.3s ease;
}
.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: all 0.3s ease;
}
.badge-complete { background: var(--success-soft); color: var(--success); border-color: var(--success-soft-border); }
.badge-complete::before { background: var(--success); }
.badge-processing { background: var(--warning-soft); color: var(--warning); border-color: var(--warning-soft-border); }
.badge-processing::before { background: var(--warning); animation: pulse-dot 2.4s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
.badge-error { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-soft-border); }
.badge-error::before { background: var(--danger); }

@keyframes pulse-dot {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

.empty-state { text-align: center; color: var(--text-muted); padding: 60px 20px; font-size: 14px; line-height: 1.6; }

/* -- Detail screen -- */
#detail-screen { gap: 12px; }
.detail-header { display: flex; align-items: center; gap: 10px; padding-bottom: 4px; }
.back-btn {
  background: var(--surface-1);
  border: 1px solid var(--glass-border);
  color: var(--text);
  width: 36px;
  height: 36px;
  border-radius: 9999px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 150ms ease;
  flex-shrink: 0;
}
.back-btn:active { background: var(--surface-2); transform: scale(0.95); }
.detail-title { font-size: 1rem; font-weight: 600; }

/* -- Custom audio player -- */
.player {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--surface-1);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
}
.player-shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.04) 50%, transparent 100%);
  background-size: 200% 100%;
  animation: shimmer 1.8s ease-in-out infinite;
  pointer-events: none;
  transition: opacity 0.5s ease;
}
.player.ready .player-shimmer { opacity: 0; }

.player-play {
  background: none;
  border: none;
  color: var(--brand);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  border-radius: 50%;
  transition: background 150ms ease, opacity 150ms ease;
  -webkit-tap-highlight-color: transparent;
}
.player-play:active { background: var(--surface-2); }
.player.buffering .player-play { animation: pulse-dot 1.2s ease infinite; }

.player-time {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
  min-width: 28px;
}
#player-total { text-align: right; }

.player-track {
  flex: 1;
  height: 40px;
  display: flex;
  align-items: center;
  position: relative;
  cursor: pointer;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}
.player-track::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--surface-3);
  border-radius: 2px;
}
.player-buffered {
  position: absolute;
  left: 0;
  width: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  pointer-events: none;
  transition: width 0.3s ease;
}
.player-fill {
  position: absolute;
  left: 0;
  width: 0;
  height: 3px;
  background: var(--brand);
  border-radius: 2px;
  pointer-events: none;
}
.player-thumb {
  position: absolute;
  left: 0;
  width: 14px;
  height: 14px;
  background: var(--brand);
  border-radius: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  box-shadow: 0 0 8px var(--brand-soft-border);
  transition: transform 0.15s ease;
}
.player.seeking .player-thumb { transform: translateX(-50%) scale(1.4); }
#detail-audio { display: none; }

/* -- Sections -- */
.section {
  background: var(--surface-1);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 14px 16px;
  animation: fade-in 0.3s ease-out both;
}
.section + .section { margin-top: 10px; }
.section h3 {
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

.summary-text { font-size: 14px; line-height: 1.6; color: var(--text-secondary); }
.notes-text { font-size: 14px; line-height: 1.6; color: var(--text-muted); }

.quote-total-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}
.quote-total-label {
  font-size: 14px;
  font-weight: 600;
}
.quote-total-note {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-muted);
}
.quote-total-value {
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--brand);
  white-space: nowrap;
}
.quote-total-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
}
.quote-intent-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 14px;
}
.quote-intent-badge,
.quote-review-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: var(--surface-soft);
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.quote-intent-note {
  font-size: 12px;
  color: var(--text-muted);
}
.quote-review-ready {
  color: var(--success);
  border-color: var(--success-soft-border);
  background: var(--success-soft);
}
.quote-review-manual_review,
.quote-review-draft {
  color: var(--warning);
  border-color: var(--warning-soft-border);
  background: var(--warning-soft);
}
.quote-scope-grid,
.quote-ref-list {
  display: grid;
  gap: 8px;
}
.quote-scope-card,
.quote-ref-card {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-soft);
  background: var(--surface-soft);
}
.quote-ref-card {
  cursor: pointer;
}
.quote-scope-card {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
}
.quote-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.quote-item {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  border: 1px solid transparent;
  cursor: pointer;
}
.quote-item:active,
.quote-ref-card:active {
  border-color: var(--glass-border-focus);
  background: rgba(255, 255, 255, 0.045);
}
.quote-item-label {
  font-size: 13px;
  font-weight: 500;
}
.quote-item-rationale,
.quote-item-ref,
.quote-ref-label,
.quote-ref-detail {
  font-size: 12px;
  line-height: 1.5;
}
.quote-item-rationale,
.quote-ref-label {
  margin-top: 6px;
  color: var(--text-secondary);
}
.quote-item-ref,
.quote-ref-detail {
  margin-top: 4px;
  color: var(--text-muted);
}
.quote-item-meta,
.quote-item-total {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}
.quote-item-total {
  color: var(--text-secondary);
  white-space: nowrap;
}
.quote-subsection {
  margin-top: 14px;
}
.quote-subtitle {
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.quote-version-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.quote-version-chip,
.quote-assumption-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--surface-soft);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.quote-version-chip.current {
  color: var(--brand);
  border-color: var(--brand-soft-border);
  background: var(--brand-soft);
}
.quote-actions {
  margin-top: 14px;
  display: flex;
  gap: 10px;
}
.quote-actions-wrap {
  flex-wrap: wrap;
}
.quote-action-btn {
  flex: 1;
  justify-content: center;
  text-decoration: none;
  color: var(--text);
  min-width: 132px;
}
.quote-evidence-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.quote-evidence-btn {
  padding: 5px 8px;
  border-radius: 999px;
  border: 1px solid var(--brand-soft-border);
  background: var(--brand-soft);
  color: var(--brand);
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
}
.quote-evidence-btn:active {
  background: var(--brand-soft-strong);
}
.quote-editor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.quote-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.quote-field span {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.quote-field-wide {
  grid-column: 1 / -1;
}
.quote-input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--surface-soft);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  line-height: 1.35;
}
.quote-input:focus {
  outline: none;
  border-color: var(--glass-border-focus);
  box-shadow: 0 0 0 1px var(--line-soft);
}
.quote-textarea {
  resize: vertical;
  min-height: 72px;
}
.quote-assumption-card {
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-soft);
  background: var(--surface-soft);
}
.quote-assumption-card + .quote-assumption-card {
  margin-top: 8px;
}
.quote-assumption-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
}
.quote-assumption-default {
  color: var(--warning);
  border-color: var(--warning-soft-border);
  background: var(--warning-soft);
}
.quote-assumption-user {
  color: var(--success);
  border-color: var(--success-soft-border);
  background: var(--success-soft);
}

/* -- Transcript -- */
.transcript-line {
  margin-bottom: 8px;
  line-height: 1.5;
  font-size: 13px;
  color: var(--text-secondary);
}
.transcript-line .speaker { color: var(--brand); font-weight: 600; }
.transcript-line .time {
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-size: 11px;
  margin-right: 6px;
}

/* -- Task items -- */
.task-item {
  border-left: 2px solid var(--brand);
  padding: 8px 12px;
  margin-bottom: 8px;
  background: var(--surface-1);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.task-item:last-child { margin-bottom: 0; }
.task-action { font-size: 13px; font-weight: 500; }
.task-meta {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  margin-top: 3px;
}
.task-verbatim {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 3px;
}
.task-priority-high { border-left-color: var(--danger); }
.task-priority-medium { border-left-color: var(--brand); }
.task-priority-low { border-left-color: var(--text-muted); }

/* -- About screen -- */
#settings-screen,
#about-screen { gap: 12px; }
.settings-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.settings-row {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}
.settings-label {
  font-size: 14px;
  font-weight: 500;
}
.settings-help {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-muted);
}
.settings-help code {
  font-family: var(--font-mono);
  font-size: 11px;
}
.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.settings-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: var(--surface-soft);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
}
.settings-link-btn:focus,
.settings-link-btn:hover {
  border-color: var(--glass-border-focus);
}
.settings-select-wrap {
  display: block;
}
.settings-select {
  margin-top: 10px;
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: var(--surface-soft);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  padding: 12px 14px;
  outline: none;
}
.settings-select:focus {
  border-color: var(--glass-border-focus);
}
.switch {
  position: relative;
  width: 54px;
  height: 32px;
  flex-shrink: 0;
}
.switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
}
.switch-slider {
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  background: var(--surface-3);
  border: 1px solid var(--glass-border);
  transition: background 150ms ease, border-color 150ms ease;
}
.switch-slider::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--text);
  transition: transform 180ms ease;
}
.switch input:checked + .switch-slider {
  background: var(--brand-soft-strong);
  border-color: var(--brand-soft-border);
}
.switch input:checked + .switch-slider::after {
  transform: translateX(22px);
  background: var(--brand);
}
.about-header { display: flex; align-items: center; gap: 10px; padding-bottom: 4px; }
.about-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 0;
}
.about-card {
  padding: 32px 24px;
  text-align: center;
  max-width: 360px;
  width: 100%;
}
.about-card:active {
  /* Override glass-card :active — about card is not interactive */
  background: var(--surface-1);
  border-color: var(--glass-border);
}
.about-brand {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--brand);
  margin-bottom: 4px;
}
.about-sub {
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 24px;
}
.about-body {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.about-body:last-of-type { margin-bottom: 24px; }
.about-version {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.5;
}

/* -- Scrollbar -- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-thumb-hover); }

@media (max-width: 420px) {
  .quote-editor-grid {
    grid-template-columns: 1fr;
  }

  .quote-total-row,
  .quote-item,
  .quote-actions {
    flex-direction: column;
  }

  .quote-total-stack,
  .quote-item-total {
    align-items: flex-start;
  }
}

/* ── Library card improvements ── */
.card-top-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.card-total {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--brand);
  white-space: nowrap;
}
.card-mode {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.card-mode-quote { color: var(--brand); }

/* ── Detail screen gap override ── */
#detail-screen { gap: 8px; }

/* ── Detail hero ── */
.detail-hero {
  background: var(--surface-1);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 18px 20px 16px;
  animation: fade-in 0.3s ease-out both;
}
.detail-hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 6px;
}
.detail-hero-total {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 300;
  color: var(--brand);
  letter-spacing: -0.02em;
  line-height: 1;
}
.detail-hero-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}
.detail-hero-version {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}
.detail-hero-scope {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-secondary);
  margin-top: 6px;
  margin-bottom: 14px;
}
.detail-hero-actions {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
}
.detail-hero-title-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.detail-hero-mode {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
.detail-hero-dur {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
}
.hero-btn-primary {
  flex: 1;
  min-width: 0;
  padding: 10px 18px;
  border-radius: 9999px;
  border: none;
  background: var(--brand);
  color: var(--brand-ink);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 150ms ease;
  -webkit-tap-highlight-color: transparent;
}
.hero-btn-primary:active { background: var(--brand-dim); }
.hero-btn-secondary {
  padding: 10px 16px;
  border-radius: 9999px;
  border: 1px solid var(--glass-border);
  background: var(--surface-1);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 150ms ease;
  -webkit-tap-highlight-color: transparent;
}
.hero-btn-secondary:active { background: var(--surface-2); }
.hero-btn-secondary.active {
  background: var(--brand-soft);
  border-color: var(--brand-soft-border);
  color: var(--brand);
}
.hero-btn-more {
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 9999px;
  border: 1px solid var(--glass-border);
  background: var(--surface-1);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 150ms ease;
  -webkit-tap-highlight-color: transparent;
}
.hero-btn-more:active { background: var(--surface-2); color: var(--text); }
.hero-more-panel {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--glass-border);
}
.hero-more-panel.hidden { display: none; }
.hero-more-item {
  display: flex;
  align-items: center;
  padding: 10px 4px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: all 150ms ease;
  -webkit-tap-highlight-color: transparent;
}
.hero-more-item:active { background: var(--surface-2); color: var(--text); }

/* ── Missing inputs alert ── */
.missing-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--warning-soft);
  border: 1px solid var(--warning-soft-border);
  color: var(--warning);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
  animation: fade-in 0.25s ease-out both;
}
.missing-alert svg { flex-shrink: 0; margin-top: 1px; }

/* ── Accordion sections ── */
.accordion-section {
  background: var(--surface-1);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  overflow: hidden;
  animation: stagger-in 0.25s ease-out both;
}
.accordion-section + .accordion-section,
.accordion-section + .drive-btn,
.detail-hero + .accordion-section,
.detail-hero + .missing-alert,
.missing-alert + .accordion-section {
  margin-top: 8px;
}
.accordion-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  width: 100%;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
  transition: background 150ms ease;
}
.accordion-header:active { background: var(--surface-2); }
.accordion-title { flex: 1; font-size: 13px; font-weight: 600; }
.accordion-chip {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  flex-shrink: 0;
}
.accordion-chevron {
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform 0.22s ease;
}
.accordion-header.open .accordion-chevron { transform: rotate(180deg); }
.accordion-body {
  display: grid;
  grid-template-rows: 0fr;
  overflow: hidden;
  transition: grid-template-rows 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
.accordion-body.open { grid-template-rows: 1fr; }
.accordion-inner {
  min-height: 0;
  padding: 12px 16px 14px;
  border-top: 1px solid var(--glass-border);
}

/* Drive link spacing inside detail */
.drive-btn { margin-top: 8px; margin-bottom: 0; }

/* ── Edit mode: hide form fields unless detail-editing class is active ── */
.quote-editor-grid { display: none !important; }
#detail-content.detail-editing .quote-editor-grid { display: grid !important; }

/* -- Field shell additions -- */
.list-brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 14px;
}
.list-brand-mark {
  font-family: var(--font-mono);
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--text);
}
.list-brand-mark span {
  color: var(--brand);
}
.list-brand-sub {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.record-shell-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}
.record-header-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.record-kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand);
}
.record-header-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.record-help {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-muted);
}

.detail-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.detail-subtitle {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.new-job-sheet {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(env(safe-area-inset-bottom) + 18px);
  z-index: 95;
  display: none;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border-radius: 22px;
  background: var(--overlay-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border-focus);
  box-shadow: var(--shadow-panel);
}
.new-job-sheet.active {
  display: flex;
  animation: fade-in 0.18s ease-out;
}
.new-job-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.new-job-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--glass-border);
  background: var(--surface-1);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: all 150ms ease;
}
.new-job-option:active {
  background: var(--surface-2);
  border-color: var(--glass-border-focus);
  transform: scale(0.99);
}
.new-job-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: var(--brand-soft);
  color: var(--brand);
  flex-shrink: 0;
}
.new-job-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.new-job-label {
  font-size: 14px;
  font-weight: 600;
}
.new-job-desc {
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-muted);
}
.new-job-cancel {
  width: 100%;
  padding: 12px;
  border-radius: 9999px;
  border: 1px solid var(--glass-border);
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
}
.new-job-cancel:active {
  background: var(--surface-2);
}

.field-detail {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 96px;
}
.field-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}
.field-tabs::-webkit-scrollbar {
  display: none;
}
.field-tab {
  padding: 8px 14px;
  border-radius: 9999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
}
.field-tab.active {
  color: var(--brand);
  border-color: var(--brand-soft-border);
  background: var(--brand-soft);
}
.field-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.field-panel.hidden {
  display: none;
}
.field-card {
  background: var(--surface-1);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.field-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.field-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.field-card-kicker {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.field-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.field-stat {
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  border: 1px solid var(--line-soft);
}
.field-stat-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.field-stat-value {
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
}
.field-inline-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.field-inline-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line-soft);
}
.field-inline-row:first-child {
  padding-top: 0;
  border-top: none;
}
.field-inline-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  flex-shrink: 0;
}
.field-inline-value {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  text-align: right;
}
.field-deliverables,
.field-evidence-list,
.field-gap-list,
.field-notes-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.field-deliverable,
.field-evidence,
.field-gap,
.field-note {
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  border: 1px solid var(--line-soft);
}
.field-deliverable {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.field-deliverable-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.field-deliverable-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.field-deliverable-meta,
.field-evidence-meta,
.field-gap-meta,
.field-note-meta {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-muted);
}
.field-deliverable-value {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--brand);
  white-space: nowrap;
}
.field-evidence {
  cursor: pointer;
}
.field-evidence:hover {
  border-color: var(--glass-border-focus);
}
.field-evidence-tag,
.field-gap-tag,
.field-note-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 6px;
}
.field-gap {
  background: var(--danger-soft);
  border-color: var(--danger-soft-border);
}
.field-gap-tag {
  color: var(--danger);
}
.field-note {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}
.field-note-time {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}
.field-note-copy {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
}
.field-note-copy strong {
  color: var(--text);
}

.chat-fab {
  position: fixed;
  right: 18px;
  bottom: calc(env(safe-area-inset-bottom) + 18px);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: var(--brand);
  color: var(--brand-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--brand-shadow);
  cursor: pointer;
  z-index: 80;
}
.chat-fab:active {
  transform: scale(0.96);
}
.chat-panel {
  position: fixed;
  right: 16px;
  bottom: calc(env(safe-area-inset-bottom) + 80px);
  width: min(360px, calc(100vw - 24px));
  max-height: min(66vh, 560px);
  z-index: 85;
  display: none;
  flex-direction: column;
  background: var(--overlay-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border-focus);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-panel);
}
.chat-panel.active {
  display: flex;
  animation: fade-in 0.18s ease-out;
}
.chat-panel.fullscreen {
  inset: max(env(safe-area-inset-top), 12px) 12px max(env(safe-area-inset-bottom), 12px) 12px;
  width: auto;
  max-height: none;
  bottom: auto;
  right: auto;
  border-radius: 24px;
}
.chat-panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--glass-border);
}
.chat-panel-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.chat-panel-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.chat-panel-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.chat-panel-spacer {
  flex: 1;
}
.chat-panel-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: transparent;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.chat-panel-btn:active {
  background: var(--surface-2);
}
.chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
}
.chat-message {
  max-width: 92%;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid var(--line-soft);
  background: var(--surface-soft);
  color: var(--text);
}
.chat-message.user {
  align-self: flex-end;
  background: var(--brand-soft-strong);
  border-color: var(--brand-soft-border);
}
.chat-message.system {
  align-self: center;
  width: 100%;
  max-width: 100%;
  background: transparent;
  border-style: dashed;
  color: var(--text-secondary);
}
.chat-message-role {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 6px;
}
.chat-message.user .chat-message-role {
  color: var(--text);
}
.chat-message.system .chat-message-role {
  color: var(--text-muted);
}
.chat-message-body {
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
}
.chat-citations,
.chat-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.chat-citation,
.chat-action {
  padding: 6px 10px;
  border-radius: 9999px;
  border: 1px solid var(--glass-border);
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
}
.chat-citation {
  color: var(--brand);
  border-color: var(--brand-soft-border);
  background: var(--brand-soft);
}
.chat-action {
  color: var(--text);
}
.chat-message-meta {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}
.chat-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--glass-border);
}
.chat-input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--glass-border);
  background: var(--surface-soft);
  color: var(--text);
  border-radius: 9999px;
  padding: 11px 14px;
  font: inherit;
}
.chat-input:focus {
  outline: none;
  border-color: var(--glass-border-focus);
}
.chat-send {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: var(--brand);
  color: var(--brand-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.chat-send:disabled {
  opacity: 0.35;
  pointer-events: none;
}
.chat-empty {
  padding: 18px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
}

@media (max-width: 420px) {
  .field-stat-grid {
    grid-template-columns: 1fr;
  }

  .field-inline-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .field-inline-value {
    text-align: left;
  }

  .chat-panel {
    width: calc(100vw - 20px);
    right: 10px;
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   SCREEN TRANSITIONS — transform/opacity only, GPU-composited
   ═══════════════════════════════════════════════════════════════════════ */

.screen.transitioning {
  display: flex !important;
  position: absolute;
  inset: 0;
  z-index: 1;
}
.screen.active { z-index: 2; }

@keyframes slide-in-right {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes slide-out-left {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(-40px); }
}
@keyframes slide-in-left {
  from { opacity: 0; transform: translateX(-40px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes slide-out-right {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(40px); }
}
@keyframes slide-up {
  from { opacity: 0; transform: translateY(100%); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slide-down {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(100%); }
}

.screen.anim-slide-in-right  { animation: slide-in-right  0.32s cubic-bezier(0.22, 1, 0.36, 1) both; }
.screen.anim-slide-out-left  { animation: slide-out-left   0.32s cubic-bezier(0.22, 1, 0.36, 1) both; }
.screen.anim-slide-in-left   { animation: slide-in-left   0.32s cubic-bezier(0.22, 1, 0.36, 1) both; }
.screen.anim-slide-out-right { animation: slide-out-right  0.32s cubic-bezier(0.22, 1, 0.36, 1) both; }

/* ═══════════════════════════════════════════════════════════════════════
   CHAT ZONE — Detail screen restructure
   ═══════════════════════════════════════════════════════════════════════ */

#detail-screen.has-chat {
  padding-bottom: 0;
  overflow: hidden;
}

#detail-screen.has-chat #detail-content {
  flex: 0 0 auto;
  max-height: 40vh;
  overflow-y: auto;
  padding-bottom: 8px;
}

.chat-zone {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  border-top: 1px solid var(--glass-border);
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
  animation: slide-up 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.chat-context {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px 8px;
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
}

.chat-context-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  flex-shrink: 0;
  animation: pulse-dot 2.4s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
.chat-context-dot.inactive {
  background: var(--text-muted);
  animation: none;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.chat-context-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-context-label strong {
  color: var(--brand);
  font-weight: 700;
}

.chat-pills {
  display: flex;
  gap: 6px;
  padding: 8px 16px 6px;
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.chat-pills::-webkit-scrollbar { display: none; }

.chat-pill {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 9999px;
  border: 1px solid var(--glass-border);
  background: var(--surface-1);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}
.chat-pill:active {
  background: var(--brand-soft);
  border-color: var(--brand-soft-border);
  color: var(--brand);
  transform: scale(0.96);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 10px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(128, 128, 128, 0.08) transparent;
}

.chat-msg {
  max-width: 85%;
  padding: 9px 13px;
  font-size: 13px;
  line-height: 1.55;
  animation: chat-msg-in 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes chat-msg-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.chat-msg.system {
  align-self: center;
  max-width: 90%;
  padding: 4px 12px;
  background: transparent;
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  display: flex;
  align-items: center;
  gap: 6px;
}
.chat-msg.system::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}

.chat-msg.user {
  align-self: flex-end;
  background: color-mix(in srgb, var(--brand) 18%, var(--surface-1));
  border: 1px solid var(--brand-soft-border);
  border-radius: var(--radius) var(--radius) 4px var(--radius);
  color: var(--text);
}

.chat-msg.assistant {
  align-self: flex-start;
  background: var(--surface-1);
  border: 1px solid var(--glass-border);
  border-radius: 4px var(--radius) var(--radius) var(--radius);
  color: var(--text);
}

.chat-msg-name {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 2px;
  color: var(--brand);
  font-family: var(--font-mono);
}
.chat-msg.user .chat-msg-name {
  color: var(--text-muted);
  text-align: right;
}

.chat-msg-content {
  white-space: pre-wrap;
  word-break: break-word;
}
.chat-msg-content.revealing {
  animation: reveal-text 0.6s steps(30) both;
  overflow: hidden;
}
@keyframes reveal-text {
  from { max-height: 0; opacity: 0.4; }
  to   { max-height: 600px; opacity: 1; }
}

.chat-citations {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
  opacity: 0;
  animation: chat-msg-in 0.25s ease-out 0.2s both;
}

.chat-citation {
  padding: 3px 8px;
  border-radius: 9999px;
  background: var(--brand-soft);
  border: 1px solid var(--brand-soft-border);
  color: var(--brand);
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: var(--font-mono);
  -webkit-tap-highlight-color: transparent;
}
.chat-citation:active {
  background: var(--brand-soft-strong);
  transform: scale(0.96);
}

.chat-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
  opacity: 0;
  animation: chat-msg-in 0.25s ease-out 0.4s both;
}

.chat-action-card {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: var(--surface-1);
  transition: all 0.25s ease;
}

.chat-action-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.chat-action-reason {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 8px;
}

.chat-action-btns {
  display: flex;
  gap: 8px;
}

.chat-action-confirm {
  flex: 1;
  padding: 8px 14px;
  border-radius: 9999px;
  border: none;
  background: var(--brand);
  color: var(--brand-ink);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.chat-action-confirm:active { background: var(--brand-dim); transform: scale(0.97); }
.chat-action-confirm:disabled { opacity: 0.5; pointer-events: none; }

.chat-action-dismiss {
  padding: 8px 14px;
  border-radius: 9999px;
  border: 1px solid var(--glass-border);
  background: var(--surface-1);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.chat-action-dismiss:active { background: var(--surface-2); }

.chat-action-card.confirming { border-color: var(--brand-soft-border); }
.chat-action-card.confirmed {
  border-color: var(--success-soft-border);
  background: var(--success-soft);
}
.chat-action-card.dismissed { opacity: 0.4; pointer-events: none; }

.chat-action-result {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--success);
}
.chat-action-result svg { flex-shrink: 0; }

.chat-typing {
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 16px;
  background: var(--surface-1);
  border: 1px solid var(--glass-border);
  border-radius: 4px var(--radius) var(--radius) var(--radius);
  animation: chat-msg-in 0.2s ease-out both;
}

.chat-typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: typing-bounce 1.4s ease-in-out infinite;
}
.chat-typing-dot:nth-child(2) { animation-delay: 0.16s; }
.chat-typing-dot:nth-child(3) { animation-delay: 0.32s; }

@keyframes typing-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-5px); opacity: 1; }
}

.chat-error {
  align-self: center;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  border: 1px solid var(--danger-soft-border);
  color: var(--danger);
  font-size: 12px;
  font-weight: 500;
  animation: chat-msg-in 0.2s ease-out both;
}

.chat-error-retry {
  padding: 4px 10px;
  border-radius: 9999px;
  border: 1px solid var(--danger-soft-border);
  background: transparent;
  color: var(--danger);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.chat-error-retry:active { background: var(--danger-soft); }

.chat-input-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  padding-bottom: max(8px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--glass-border);
  background: color-mix(in srgb, var(--bg) 95%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  flex-shrink: 0;
}

.chat-input {
  flex: 1;
  padding: 10px 14px;
  border-radius: 9999px;
  border: 1px solid var(--glass-border);
  background: var(--surface-1);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
}
.chat-input::placeholder { color: var(--text-muted); }
.chat-input:focus { border-color: var(--glass-border-focus); }

.chat-send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--brand);
  color: var(--brand-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.chat-send-btn:active { background: var(--brand-dim); transform: scale(0.92); }
.chat-send-btn:disabled {
  background: var(--surface-2);
  color: var(--text-muted);
  pointer-events: none;
}
.chat-send-btn svg { width: 16px; height: 16px; }

.chat-fab {
  position: fixed;
  bottom: max(80px, calc(env(safe-area-inset-bottom) + 72px));
  right: 16px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: var(--brand);
  color: var(--brand-ink);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 60;
  box-shadow: 0 4px 20px var(--brand-soft-border);
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  -webkit-tap-highlight-color: transparent;
}
.chat-fab.visible { display: flex; }
.chat-fab:active { transform: scale(0.92); }
.chat-fab svg { width: 20px; height: 20px; }
.chat-fab-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  display: none;
}
.chat-fab.has-session .chat-fab-dot { display: block; }

.chat-skeleton {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chat-skeleton-line {
  height: 14px;
  border-radius: 7px;
  background: linear-gradient(90deg, var(--surface-1) 0%, var(--surface-2) 50%, var(--surface-1) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.8s ease-in-out infinite;
}
.chat-skeleton-line:nth-child(1) { width: 65%; }
.chat-skeleton-line:nth-child(2) { width: 80%; align-self: flex-end; }
.chat-skeleton-line:nth-child(3) { width: 55%; }

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.toast.show {
  animation: toast-in 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ═══════════════════════════════════════════════════════════════════════
   REDUCED MOTION
   ═══════════════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .chat-msg-content.revealing { animation: none; max-height: none; opacity: 1; }
  .chat-zone { animation: none; }
  .screen.anim-slide-in-right,
  .screen.anim-slide-out-left,
  .screen.anim-slide-in-left,
  .screen.anim-slide-out-right { animation: none; }
}

/* Concept v4 job shell */

#recordings-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 120px;
}

.job-list-card {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 12px;
  padding: 14px;
  background: var(--surface-1);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.job-list-card.selected {
  border-color: var(--brand-soft-border);
  background: var(--brand-soft);
}

.job-list-card .select-check {
  position: absolute;
  right: 12px;
  top: 12px;
}

.job-list-rail {
  width: 3px;
  border-radius: 999px;
  background: var(--brand);
  flex-shrink: 0;
}

.job-list-card.delivered .job-list-rail {
  background: rgba(128, 128, 128, 0.35);
}

.job-list-card.quoted .job-list-rail {
  background: var(--warning);
}

.job-list-body {
  flex: 1;
  min-width: 0;
}

.job-list-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.job-list-ref,
.job-list-total {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.job-list-total {
  color: var(--brand);
  white-space: nowrap;
}

.job-list-empty {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.job-list-subtitle {
  margin-top: 6px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.job-list-bottom {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.job-list-status {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
}

.job-list-status.quoted,
.job-list-status.processing {
  background: var(--warning-soft);
  color: var(--warning);
}

.job-list-status.onsite {
  background: var(--brand-soft);
  color: var(--brand);
}

.job-list-status.delivered {
  background: var(--surface-2);
  color: var(--text-muted);
}

.job-list-status.error {
  background: var(--danger-soft);
  color: var(--danger);
}

.job-list-count {
  margin-left: auto;
  font-size: 0.74rem;
  color: var(--text-muted);
}

.job-shell {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 100px;
}

.job-hero,
.job-card,
.job-section,
.job-detail-row {
  position: relative;
  background: var(--surface-1);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
}

.job-hero {
  padding: 16px 16px 14px;
}

.job-hero-title {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
  line-height: 1.3;
}

.job-hero-brief {
  display: flex;
  align-items: center;
  gap: 10px;
}

.job-total {
  font-family: var(--font-mono);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.03em;
  line-height: 1;
}

.job-badge-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.job-badge {
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: var(--surface-1);
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

.job-badge.subtle {
  border-color: var(--brand-soft-border);
  background: var(--brand-soft);
  color: var(--brand);
}

.job-gap-chip {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--warning-soft-border);
  background: var(--warning-soft);
  color: var(--warning);
  font-size: 0.56rem;
  font-weight: 600;
  cursor: pointer;
}

.job-health {
  padding: 6px 0 10px;
  flex-shrink: 0;
}

.job-health-bar {
  display: flex;
  gap: 2px;
  height: 6px;
  border-radius: 1px;
  overflow: hidden;
  margin-bottom: 5px;
}

.job-health-seg.confirmed,
.job-health-legend .dot.confirmed {
  background: var(--success);
}

.job-health-seg.assumed,
.job-health-legend .dot.assumed {
  background: var(--warning);
}

.job-health-seg.gap,
.job-health-legend .dot.gap {
  background: var(--danger);
}

.job-health-legend {
  display: flex;
  gap: 12px;
  font-size: 0.56rem;
  color: var(--text-muted);
}

.job-health-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.job-health-legend .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.job-hero-actions,
.job-action-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.job-primary-btn,
.job-secondary-btn,
.job-secondary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

.job-primary-btn {
  flex: 1;
  background: var(--brand);
  color: var(--brand-ink);
}

.job-primary-btn svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.job-secondary-btn,
.job-secondary-link {
  padding: 11px 13px;
  background: none;
  border-color: var(--glass-border);
  color: var(--text-secondary);
  font-size: 0.7rem;
  font-weight: 500;
}

.job-secondary-btn.active {
  border-color: var(--brand-soft-border);
  background: var(--brand-soft);
  color: var(--brand);
}

.job-menu-btn {
  width: 42px;
  min-width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.job-menu {
  position: absolute;
  top: 118px;
  right: 16px;
  z-index: 12;
  min-width: 170px;
  display: none;
  flex-direction: column;
  background: color-mix(in srgb, var(--bg) 96%, transparent);
  backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border-focus);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-panel);
  overflow: hidden;
}

.job-menu.active {
  display: flex;
}

.job-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: none;
  background: transparent;
  color: var(--text);
  text-align: left;
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.1s;
}

.job-menu-item:active {
  background: var(--surface-1);
}

.job-menu-item svg {
  width: 14px;
  height: 14px;
  stroke: var(--text-secondary);
  fill: none;
  stroke-width: 1.8;
  flex-shrink: 0;
}

.job-menu-item + .job-menu-item {
  border-top: 1px solid var(--glass-border);
}

.job-menu-sep {
  height: 0;
  border-top: 1px solid var(--glass-border-focus);
  margin: 0;
}

.job-menu-item.archive {
  color: var(--danger);
}

.job-menu-item.archive svg {
  stroke: var(--danger);
}

.job-tabs {
  display: flex;
  gap: 6px;
  padding: 2px 0 10px;
  flex-shrink: 0;
}

.job-tab {
  padding: 6px 16px;
  border: 1px solid transparent;
  background: none;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.56rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 20px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.job-tab:hover {
  color: var(--text-secondary);
}

.job-tab.active {
  color: var(--brand);
  border-color: var(--brand-soft-border);
  background: var(--brand-soft);
}

.job-tab-gap-count {
  font-size: 0.5rem;
  color: var(--danger);
  margin-left: 2px;
}

.job-panel.hidden {
  display: none;
}

.job-card {
  padding: 12px 14px;
}

.job-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.job-card-type,
.job-card-link {
  font-family: var(--font-mono);
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.job-card-type {
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text-muted);
}

.job-card-type.summary {
  color: var(--brand);
  background: var(--brand-soft);
}

.job-card-type.items {
  color: var(--warning);
  background: var(--warning-soft);
}

.job-card-link {
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.job-card-body {
  font-size: 0.7rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.job-card-body strong {
  color: var(--text);
  font-weight: 600;
}

.job-card-list,
.job-deliverables,
.job-evidence-compact-list,
.job-gap-compact-list,
.job-notes-list,
.job-detail-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.job-card-item,
.job-deliverable,
.job-evidence-compact,
.job-gap-compact,
.job-timeline-note,
.job-timeline-evidence,
.job-timeline-gap,
.job-soil-card,
.job-soil-option,
.job-version-card {
  background: var(--surface-soft);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
}

.job-version-banner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--warning-soft-border);
  border-radius: var(--radius-sm);
  background: var(--warning-soft);
  color: var(--text);
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.job-version-banner-copy {
  font-size: 0.86rem;
  line-height: 1.45;
}

.job-version-banner-action {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--warning);
}

.job-card-item {
  padding: 5px 0;
  border-top: 1px solid var(--glass-border);
  background: none;
  border-radius: 0;
}

.job-card-item:first-child {
  border-top: none;
}

.job-card-item-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.job-card-item-name,
.job-version-name,
.job-soil-name,
.job-soil-option-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
}

.job-deliverable-title {
  font-size: 0.7rem;
  color: var(--text);
  line-height: 1.5;
}

.job-deliverable-meta {
  font-size: 0.62rem;
  color: var(--text-muted);
}

.job-card-item-price,
.job-version-total {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--brand);
  font-weight: 600;
  white-space: nowrap;
}

.job-card-item-meta,
.job-soil-meta,
.job-soil-option-meta,
.job-version-meta,
.job-detail-sub {
  margin-top: 4px;
  font-size: 0.62rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.job-detail-text {
  min-height: 20px;
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--text);
}

.job-detail-placeholder {
  color: var(--text-muted);
}

.job-detail-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 8px 14px 2px;
}

.job-section,
.job-detail-row {
  padding: 12px 14px;
}

.job-section + .job-section {
  margin-top: 0;
  border-top: none;
}

.job-detail-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.job-detail-row + .job-detail-row {
  border-top: 1px solid var(--glass-border);
}

.job-detail-row:first-child {
  padding-top: 4px;
}

.job-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.job-section-head .count {
  font-size: 0.5rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-secondary);
}

.job-deliverable {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 0;
  border-top: 1px solid var(--glass-border);
}

.job-deliverable:first-of-type {
  border-top: none;
}

.job-deliverable-check {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid var(--success);
  color: var(--success);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.job-deliverable-check svg,
.job-timeline-evidence .play,
.job-gap-action svg {
  width: 12px;
  height: 12px;
}

.job-evidence-compact,
.job-timeline-evidence {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-left: 3px solid var(--success);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  cursor: pointer;
  text-align: left;
  color: inherit;
  transition: all 0.15s;
  position: relative;
  overflow: hidden;
}

.job-evidence-compact:hover,
.job-timeline-evidence:hover {
  background: var(--surface-2);
}

.job-evidence-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--brand);
  width: 0;
  transition: width linear;
}

.job-evidence-compact .tag,
.job-timeline-evidence-label {
  font-family: var(--font-mono);
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--success);
  flex-shrink: 0;
}

.job-gap-compact .tag,
.job-timeline-gap-tag {
  font-family: var(--font-mono);
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--danger);
  flex-shrink: 0;
}

.job-evidence-compact .play,
.job-timeline-evidence .play {
  font-family: var(--font-mono);
  font-size: 0.5rem;
  font-weight: 600;
  color: var(--brand);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  flex-shrink: 0;
  margin-left: auto;
}

.job-evidence-compact .text,
.job-gap-compact .text,
.job-timeline-evidence-text,
.job-timeline-gap-text,
.job-timeline-text {
  font-size: 0.68rem;
  line-height: 1.5;
  color: var(--text-secondary);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.job-gap-compact,
.job-timeline-gap {
  padding: 8px 12px;
  border-left: 3px solid var(--danger);
  border-color: var(--danger-soft-border);
  border-left-color: var(--danger);
  background: var(--danger-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  cursor: pointer;
  transition: all 0.2s;
}

.job-gap-compact {
  display: flex;
  align-items: center;
  gap: 8px;
}

.job-gap-compact .text {
  flex: 1;
  font-size: 0.68rem;
  color: var(--text-secondary);
}

.resolve-quick {
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  border: none;
  background: none;
  color: var(--brand);
  font-family: var(--font-mono);
  font-size: 0.5rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  flex-shrink: 0;
}

.job-gap-compact.resolved {
  border-left-color: var(--success);
  background: var(--success-soft);
  opacity: 0.6;
}

.job-gap-compact.resolved .tag {
  color: var(--success);
}

.job-gap-compact.resolved .resolve-quick {
  display: none;
}

.job-notes-shell {
  position: relative;
  padding-left: 54px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.job-notes-shell::before {
  content: "";
  position: absolute;
  left: 48px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--glass-border);
  pointer-events: none;
}

.job-notes-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.job-add-note {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--glass-border-focus);
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.7rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s;
}

.job-add-note:hover {
  border-color: var(--brand-soft-border);
  color: var(--brand);
  background: var(--brand-soft);
}

.job-add-note svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  flex-shrink: 0;
}

.job-timeline-note {
  padding: 4px 0;
  position: relative;
}

.job-timeline-gap {
  margin: 4px 0;
  position: relative;
}

.job-timeline-evidence {
  margin: 4px 0;
  position: relative;
}

.job-timeline-note::before {
  content: none;
}

.job-timeline-gap::before {
  content: none;
}

.job-timeline-evidence::before {
  content: none;
}

.job-timeline-ts {
  position: absolute;
  left: -54px;
  top: 5px;
  width: 46px;
  text-align: right;
  padding-right: 8px;
  font-family: var(--font-mono);
  font-size: 0.5rem;
  color: var(--text-muted);
}

.job-timeline-ts .ts-date {
  display: block;
  font-size: 0.5rem;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

.job-timeline-ts .ts-time-minor {
  display: block;
  font-size: 0.44rem;
  color: var(--text-muted);
  margin-top: 1px;
}

.job-timeline-text {
  font-size: 0.75rem;
  line-height: 1.7;
  color: var(--text);
}

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

.job-timeline-note-manual .job-timeline-text {
  border-left: 2px solid var(--brand);
  padding-left: 8px;
}

.job-timeline-gap.focus,
.job-gap-compact.focus {
  box-shadow: 0 0 0 1px var(--brand-soft-border);
}

.job-timeline-gap.open .job-timeline-gap-resolve {
  display: block;
}

.job-timeline-gap-resolve {
  display: none;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--glass-border);
}

.job-timeline-gap-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.job-gap-action {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: var(--surface-1);
  color: var(--text);
  font: inherit;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s;
}

.job-gap-action svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  flex-shrink: 0;
}

.job-gap-action.primary {
  background: var(--brand-soft);
  border-color: var(--brand-soft-border);
  color: var(--brand);
}

.job-gap-action.reject {
  color: var(--danger);
  border-color: var(--danger-soft-border);
}

.job-gap-action:active {
  transform: scale(0.97);
}

.job-detail-label {
  font-family: var(--font-mono);
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.job-detail-value {
  display: flex;
  align-items: center;
  gap: 10px;
}

.job-detail-input {
  width: 100%;
  padding: 2px 0;
  border: none;
  border-bottom: 1px dashed var(--glass-border);
  border-radius: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 0.75rem;
  outline: none;
  transition: border-color 0.15s;
}

.job-detail-input:focus {
  border-bottom-color: var(--brand);
}

.job-detail-input::placeholder {
  color: var(--text-muted);
  font-style: italic;
}

.job-detail-link {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--brand-soft-border);
  background: var(--brand-soft);
  color: var(--brand);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.56rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.15s;
}

.job-detail-link:hover {
  background: color-mix(in srgb, var(--brand) 15%, transparent);
}

.job-soil-card,
.job-soil-option {
  width: 100%;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  color: inherit;
  cursor: pointer;
}

.job-soil-card {
  margin-top: 4px;
}

.job-soil-copy,
.job-soil-option-copy,
.job-version-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.job-soil-option.active,
.job-version-card.active {
  border-color: var(--brand-soft-border);
  background: var(--brand-soft);
}

.job-soil-option-top,
.job-version-card {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.job-version-card {
  width: 100%;
  padding: 14px;
  color: inherit;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.job-version-card.latest:not(.active) {
  border-color: var(--glass-border-focus);
}

.job-version-card:disabled {
  cursor: default;
}

.job-detail-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.job-soil-rank {
  min-width: 60px;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand);
}

.job-sheet {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  top: 96px;
  z-index: 90;
  display: none;
  flex-direction: column;
  background: color-mix(in srgb, var(--bg) 96%, transparent);
  backdrop-filter: blur(28px);
  border: 1px solid var(--glass-border-focus);
  border-radius: calc(var(--radius) + 8px);
  box-shadow: var(--shadow-panel);
  overflow: hidden;
}

.job-sheet.active {
  display: flex;
}

.job-sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--glass-border);
}

.job-sheet-title {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
}

.job-sheet-close {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
}

.job-sheet-subtitle {
  padding: 0 16px 10px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.job-sheet-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.job-sheet-footer {
  margin: 0 14px 14px;
  min-height: 44px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--glass-border-focus);
  background: var(--surface-soft);
  color: var(--text-secondary);
  font: inherit;
  cursor: pointer;
}

.job-modal {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.4);
}

.job-modal-card {
  width: min(100%, 420px);
  padding: 16px;
  border-radius: calc(var(--radius) + 8px);
  border: 1px solid var(--glass-border-focus);
  background: color-mix(in srgb, var(--bg) 96%, transparent);
  backdrop-filter: blur(24px);
  box-shadow: var(--shadow-panel);
}

.job-modal-title {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
}

.job-modal-body {
  margin-top: 8px;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

.job-modal-textarea {
  width: 100%;
  min-height: 120px;
  margin-top: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: var(--surface-soft);
  color: var(--text);
  font: inherit;
  resize: vertical;
}

.job-modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.chat-panel {
  bottom: 42px;
  right: 8px;
  width: 62%;
  max-height: 62%;
  border-radius: 16px;
  transform-origin: bottom right;
  animation: chat-open 0.2s ease-out;
}

@keyframes chat-open {
  from { opacity: 0; transform: scale(0.88) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.chat-panel.fullscreen {
  inset: max(env(safe-area-inset-top), 12px) 12px 12px 12px;
  width: auto;
  max-height: none;
  border-radius: calc(var(--radius) + 8px);
}

.chat-panel-head {
  padding: 8px 12px;
  border-bottom: 1px solid var(--glass-border);
}

.chat-panel-sub {
  letter-spacing: 0.08em;
  font-size: 0.6rem;
}

.chat-panel-name {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand);
}

.chat-panel .chat-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand);
  margin-right: 5px;
  animation: chat-blink 1.5s ease-in-out infinite;
}

@keyframes chat-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}

/* -- Voice input bar (Telegram-style) -- */
.vi-bar {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 6px 14px 8px;
  flex-shrink: 0;
  border-top: 1px solid var(--glass-border);
  position: relative;
  overflow: visible;
  min-height: 50px;
}

.vi-text {
  flex: 1;
  background: var(--surface-1);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 9px 14px;
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: var(--text);
  outline: none;
}

.vi-text::placeholder {
  color: var(--text-muted);
}

.vi-mic {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  margin-left: 8px;
  background: var(--brand);
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  z-index: 2;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

.vi-mic svg {
  width: 16px;
  height: 16px;
  stroke: var(--brand-ink);
  fill: none;
  stroke-width: 2;
}

.vi-send {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  margin-left: 8px;
  background: var(--brand);
}

.vi-send svg {
  width: 15px;
  height: 15px;
  stroke: var(--brand-ink);
  fill: none;
  stroke-width: 2.5;
}

.vi-bar.has-text .vi-mic { display: none; }
.vi-bar.has-text .vi-send { display: flex; }

.vi-rec-layer {
  position: absolute;
  left: 0;
  right: 54px;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  padding: 0 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s;
  z-index: 1;
}

.vi-bar[data-vi="recording"] .vi-rec-layer,
.vi-bar[data-vi="locked"] .vi-rec-layer {
  opacity: 1;
  pointer-events: auto;
}

.vi-bar[data-vi="recording"] .vi-text,
.vi-bar[data-vi="locked"] .vi-text {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-10px);
}

.vi-rec-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  animation: vi-blink 1s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes vi-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}

.vi-timer {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  margin-left: 10px;
  min-width: 38px;
  letter-spacing: 0.02em;
}

.vi-slide-hint {
  flex: 1;
  text-align: center;
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

.vi-bar[data-vi="recording"] .vi-mic {
  width: 54px;
  height: 54px;
  margin-right: -8px;
  margin-top: -8px;
  margin-bottom: -8px;
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--brand) 12%, transparent),
              0 0 24px color-mix(in srgb, var(--brand) 18%, transparent);
}

.vi-bar[data-vi="recording"] .vi-mic svg {
  width: 22px;
  height: 22px;
}

.vi-locked-actions {
  display: none;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.vi-bar[data-vi="locked"] .vi-locked-actions {
  display: flex;
}

.vi-bar[data-vi="locked"] .vi-mic {
  display: none;
}

.vi-cancel-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent);
  background: var(--danger-soft);
  cursor: pointer;
}

.vi-cancel-btn svg {
  width: 13px;
  height: 13px;
  stroke: var(--danger);
  fill: none;
  stroke-width: 2.5;
}

.vi-submit-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: var(--brand);
  cursor: pointer;
}

.vi-submit-btn svg {
  width: 16px;
  height: 16px;
  stroke: var(--brand-ink);
  fill: none;
  stroke-width: 2.5;
}

/* -- Dual-mode FAB (chat/mic toggle) -- */
.chat-fab.dual-mode {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-fab.dual-mode:active {
  transform: scale(0.88);
}

.chat-fab.dual-mode.hidden-fab {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.5);
}

/* -- Compact recording bubble -- */
.job-rec-bubble {
  position: fixed;
  bottom: max(76px, calc(env(safe-area-inset-bottom) + 68px));
  right: 16px;
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: color-mix(in srgb, var(--bg) 96%, transparent);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border-focus);
  border-radius: 24px;
  box-shadow: var(--shadow-panel);
  z-index: 40;
  animation: chat-open 0.2s ease-out;
}

.job-rec-bubble.active {
  display: flex;
}

.job-rec-bubble .rec-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  animation: vi-blink 1s ease-in-out infinite;
}

.job-rec-bubble .rec-timer {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  min-width: 32px;
}

.job-rec-bubble .rec-cancel,
.job-rec-bubble .rec-send {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
}

.job-rec-bubble .rec-cancel {
  background: var(--danger-soft);
  border: 1px solid var(--danger-soft-border);
}

.job-rec-bubble .rec-cancel svg {
  width: 12px;
  height: 12px;
  stroke: var(--danger);
  fill: none;
  stroke-width: 2.5;
}

.job-rec-bubble .rec-send {
  background: var(--brand);
}

.job-rec-bubble .rec-send svg {
  width: 12px;
  height: 12px;
  stroke: var(--brand-ink);
  fill: none;
  stroke-width: 2.5;
}

/* -- Detail screen scope description dim text -- */
.job-deliverable-copy .dim {
  font-size: 0.62rem;
  color: var(--text-muted);
}

@media (max-width: 420px) {
  .job-list-top,
  .job-card-item-top,
  .job-version-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .job-badge-row {
    margin-left: 0;
  }

  .job-hero-brief {
    flex-direction: column;
    align-items: flex-start;
  }

  .job-tabs {
    gap: 4px;
  }

  .job-tab {
    font-size: 0.5rem;
  }

  .job-timeline-gap-actions,
  .job-modal-actions {
    flex-direction: column;
  }
}
