/*
 * MY-AIGENCY · Voice Discovery Console
 * Design System Stylesheet — implements the approved Claude Design specification
 * across Desktop (1440px) and Mobile (390px) viewports.
 */

:root {
  /* Surfaces */
  --bg: #F5F6F8;
  --surface: #FFFFFF;
  --surface-subtle: #F9FAFB;
  --surface-tint: #FCFCFD;
  --surface-selected: #F8F9FF;
  --surface-pill: #F2F4F7;

  /* Ink */
  --ink: #101828;
  --ink-secondary: #344054;
  --ink-body: #475467;
  --ink-muted: #667085;
  --ink-disabled: #98A2B3;

  /* Borders */
  --border: #E3E6EB;
  --border-subtle: #EAECF0;
  --border-input: #D0D5DD;

  /* Brand & Semantic */
  --accent: #2546D8;
  --accent-hover: #1A34A8;
  --accent-soft: #EEF2FF;

  --ok: #067647;
  --ok-dot: #17B26A;
  --ok-sep: #079455;
  --ok-bg: #ECFDF3;
  --ok-border: #ABEFC6;

  --live: #93370D;
  --live-dot: #EF6820;
  --live-bg: #FEF0E7;
  --live-border: #F9DBAF;
  --live-cta: #B93815;
  --live-cta-hover: #9A2E10;

  --whisper-ink: #7A2E0E;
  --whisper-label: #B54708;
  --whisper-bg: #FFFAEB;
  --whisper-border: #FEDF89;
  --whisper-dot: #F79009;

  --danger: #B42318;
  --danger-hover: #912018;
  --danger-bg: #FEF3F2;
  --danger-border: #FECDCA;
  --danger-input: #F04438;
  --danger-ring: #FEE4E2;

  /* Radii */
  --radius-xs: 7px;
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 20px;
  --radius-sheet: 22px;

  /* Shadows */
  --shadow-card: 0 12px 32px -12px rgba(16, 24, 40, 0.12);
  --shadow-seg: 0 1px 3px rgba(16, 24, 40, 0.12);
  --shadow-seg-sm: 0 1px 2px rgba(16, 24, 40, 0.08);
  --shadow-sheet: 0 -12px 32px rgba(16, 24, 40, 0.18);
  --shadow-modal: 0 24px 48px -12px rgba(16, 24, 40, 0.24);

  /* Typography */
  --font-sans: "Geist", -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

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

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
  max-width: 100%;
  overflow-x: clip;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent);
  text-decoration: none;
}

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

.mono {
  font-family: var(--font-mono);
}

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

/* ── Shared Inputs, Controls & Focus States ──────────────────────────────── */

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="search"],
select,
textarea {
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-md);
  padding: 0 12px;
  height: 46px;
  width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

select {
  height: 44px;
}

textarea {
  height: auto;
  padding: 10px 12px;
  line-height: 1.5;
  resize: vertical;
}

textarea.code-editor {
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.55;
  min-height: 280px;
  background: var(--surface-subtle);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 70, 216, 0.14);
}

input.input-error,
input[aria-invalid="true"] {
  border-color: var(--danger-input);
  box-shadow: 0 0 0 3px var(--danger-ring);
}

input:disabled,
select:disabled,
textarea:disabled {
  background: var(--surface-subtle);
  border-color: var(--border);
  color: var(--ink-disabled);
  cursor: not-allowed;
}

input[type="range"] {
  accent-color: var(--accent);
  width: 100%;
  cursor: pointer;
}

button {
  font: inherit;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

/* ── Reusable Buttons ────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-input);
  background: var(--surface);
  color: var(--ink-secondary);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease, transform 0.05s ease;
}

.btn:hover:not(:disabled) {
  background: var(--surface-subtle);
  border-color: var(--ink-disabled);
  color: var(--ink);
  text-decoration: none;
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.55;
  background: var(--surface-subtle);
  border-color: var(--border);
  color: var(--ink-disabled);
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #FFFFFF;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #FFFFFF;
}

.btn-live {
  background: var(--live-cta);
  border-color: var(--live-cta);
  color: #FFFFFF;
}

.btn-live:hover:not(:disabled) {
  background: var(--live-cta-hover);
  border-color: var(--live-cta-hover);
  color: #FFFFFF;
}

.btn-dark {
  background: var(--ink);
  border-color: var(--ink);
  color: #FFFFFF;
}

.btn-dark:hover:not(:disabled) {
  background: #1D2939;
  border-color: #1D2939;
  color: #FFFFFF;
}

.btn-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #FFFFFF;
}

.btn-danger:hover:not(:disabled) {
  background: var(--danger-hover);
  border-color: var(--danger-hover);
  color: #FFFFFF;
}

.btn-dashed {
  background: transparent;
  border: 1px dashed var(--border-input);
  color: var(--ink-secondary);
  font-weight: 500;
}

.btn-dashed:hover:not(:disabled) {
  background: var(--surface-subtle);
  border-color: var(--accent);
  color: var(--accent);
}

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--ink-body);
  font-weight: 500;
}

.btn-sm {
  height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.btn-xs {
  height: 32px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
}

.btn-lg {
  height: 52px;
  padding: 0 20px;
  border-radius: var(--radius-lg);
  font-size: 15px;
}

/* ── Brand Waveform Mark ─────────────────────────────────────────────────── */

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-mark.brand-mark-lg {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
}

.brand-mark.brand-mark-sm {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
}

/* ── Status Pills & Banners ──────────────────────────────────────────────── */

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid var(--border);
  background: var(--surface-pill);
  color: var(--ink-secondary);
}

.status-pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink-disabled);
  flex-shrink: 0;
}

.status-pill.ready {
  background: var(--ok-bg);
  border-color: var(--ok-border);
  color: var(--ok);
}

.status-pill.ready .dot {
  background: var(--ok-dot);
}

.status-pill.live {
  background: var(--live-bg);
  border-color: var(--live-border);
  color: var(--live);
}

.status-pill.live .dot {
  background: var(--live-dot);
  animation: pulse-dot 1.6s ease-in-out infinite;
}

.status-pill.bad {
  background: var(--danger-bg);
  border-color: var(--danger-border);
  color: var(--danger);
}

.status-pill.bad .dot {
  background: var(--danger-input);
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.82); }
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-secondary);
  background: var(--surface-pill);
  border-radius: 999px;
  padding: 4px 10px;
  white-space: nowrap;
}

.badge-ok {
  color: var(--ok);
  background: var(--ok-bg);
  border: 1px solid var(--ok-border);
  font-weight: 700;
}

.badge-live {
  color: var(--live);
  background: var(--live-bg);
  border: 1px solid var(--live-border);
  font-weight: 700;
}

.badge-idle {
  color: var(--ink-secondary);
  background: var(--surface-pill);
  border: 1px solid var(--border);
}

.badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge-ok .dot { background: var(--ok-dot); }
.badge-live .dot { background: var(--live-dot); }
.badge-idle .dot { background: var(--ink-disabled); }

.inline-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  line-height: 1.45;
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  color: var(--ink-secondary);
}

.inline-banner svg {
  flex-shrink: 0;
  margin-top: 1px;
}

.inline-banner.warn {
  background: var(--live-bg);
  border-color: var(--live-border);
  color: var(--live);
}

.inline-banner.bad {
  background: var(--danger-bg);
  border-color: var(--danger-border);
  color: var(--danger);
}

.inline-banner.ok {
  background: var(--ok-bg);
  border-color: var(--ok-border);
  color: var(--ok);
}

/* ── Toggle Switch (Login Remember Me) ───────────────────────────────────── */

.toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--ink-secondary);
  cursor: pointer;
  min-height: 44px;
  position: relative;
  user-select: none;
}

.toggle-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.toggle-track {
  position: relative;
  width: 40px;
  height: 24px;
  border-radius: 999px;
  background: var(--border-input);
  flex-shrink: 0;
  transition: background-color 0.16s ease;
}

.toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.2);
  transition: transform 0.16s ease;
}

.toggle-label input:checked + .toggle-track {
  background: var(--accent);
}

.toggle-label input:checked + .toggle-track .toggle-thumb {
  transform: translateX(16px);
}

.toggle-label input:focus-visible + .toggle-track {
  box-shadow: 0 0 0 3px rgba(37, 70, 216, 0.22);
}

/* ══════════════════════════════════════════════════════════════════════════ */
/* LOGIN PAGE (Desktop Screen 01 + Mobile Screen 06)                         */
/* ══════════════════════════════════════════════════════════════════════════ */

body.login-page {
  background: var(--bg);
}

.login-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 32px 20px;
  position: relative;
}

.login-host-chip {
  position: absolute;
  top: 28px;
  right: 32px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-body);
}

.login-host-chip .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok-dot);
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-card);
  padding: 40px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}

.login-brand-names {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.login-brand-wordmark {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.15;
}

.login-brand-sub {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-body);
  letter-spacing: 0.02em;
}

.login-title {
  margin: 6px 0 0;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.login-subtitle {
  margin: 0;
  font-size: 14px;
  color: var(--ink-body);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 0;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.form-field label,
.field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-secondary);
}

.field-label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.field-help {
  font-size: 12px;
  color: var(--ink-muted);
}

.login-form input[type="email"],
.login-form input[type="text"],
.login-form input[type="password"] {
  height: 48px;
  padding: 0 14px;
  font-size: 15px;
}

.login-forgot-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  background: none;
  border: 0;
  padding: 0;
  white-space: nowrap;
}

.login-forgot-link:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.login-mobile-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.login-mobile-row .login-forgot-mobile {
  display: none;
}

.login-submit-btn {
  height: 50px;
  width: 100%;
  border-radius: var(--radius-lg);
  font-size: 16px;
  font-weight: 600;
}

.login-footer-note {
  margin: 0;
  font-size: 13px;
  color: var(--ink-muted);
  text-align: center;
}

.login-footer-host-mobile {
  display: none;
}

/* Mobile Login (<= 639px — Screen 06) */
@media (max-width: 639px) {
  body.login-page {
    background: var(--surface);
  }

  .login-host-chip {
    display: none;
  }

  .login-shell {
    min-height: 100dvh;
    padding: 48px 24px 28px;
    justify-content: flex-start;
    align-items: stretch;
    gap: 0;
    background: var(--surface);
  }

  .login-card {
    max-width: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    flex: 1;
    gap: 24px;
  }

  .login-brand {
    align-items: flex-start;
    text-align: left;
  }

  .login-brand-names {
    flex-direction: row;
    align-items: baseline;
    gap: 8px;
  }

  .login-brand-wordmark {
    font-size: 18px;
  }

  .login-title {
    margin-top: 4px;
    font-size: 30px;
    line-height: 1.1;
  }

  .login-subtitle {
    font-size: 15px;
  }

  .login-form {
    flex: 1;
    gap: 18px;
  }

  .login-form input[type="email"],
  .login-form input[type="text"],
  .login-form input[type="password"] {
    height: 54px;
    padding: 0 16px;
    border-radius: var(--radius-lg);
    font-size: 16px;
  }

  .login-forgot-desktop,
  .remember-suffix {
    display: none;
  }

  .login-mobile-row .login-forgot-mobile {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    font-size: 14px;
    padding: 10px 0;
  }

  .login-submit-wrap {
    margin-top: auto;
    padding-top: 24px;
  }

  .login-submit-btn {
    height: 56px;
    border-radius: 14px;
    font-size: 17px;
  }

  .login-footer-note {
    margin-top: 16px;
  }

  .login-footer-desktop-suffix {
    display: none;
  }

  .login-footer-host-mobile {
    display: block;
    margin-top: 2px;
    font-family: var(--font-mono);
  }
}

/* ══════════════════════════════════════════════════════════════════════════ */
/* CONSOLE SHELL — DESKTOP TOP BAR (Screens 02, 03, 04, 05)                  */
/* ══════════════════════════════════════════════════════════════════════════ */

.console-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar-desktop {
  height: 68px;
  flex-shrink: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 30;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.topbar-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.topbar-brand-title {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.04em;
  color: var(--ink);
}

.topbar-brand-sub {
  font-size: 12px;
  color: var(--ink-body);
}

.topbar-divider {
  width: 1px;
  height: 32px;
  background: var(--border);
  flex-shrink: 0;
}

.client-picker-group {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.client-picker-btn {
  height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  background: var(--surface);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-md);
  color: var(--ink);
  min-width: 310px;
  max-width: 400px;
  text-align: left;
  transition: border-color 0.14s ease, background-color 0.14s ease;
}

.client-picker-btn:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--surface-selected);
}

.client-picker-btn:disabled {
  background: var(--surface-subtle);
  border-color: var(--border);
  color: var(--ink-secondary);
}

.client-picker-labels {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  flex: 1;
  min-width: 0;
}

.client-picker-micro {
  font-size: 11px;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.client-picker-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-spacer {
  flex: 1;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.avatar-user {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--ink);
  color: #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}

.topbar-user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.topbar-user-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.topbar-user-role {
  font-size: 12px;
  color: var(--ink-muted);
}

.btn-signout {
  height: 40px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-body);
  font-size: 14px;
  font-weight: 500;
}

/* ── Mobile Headers (hidden on desktop) ──────────────────────────────────── */

.topbar-mobile,
.subview-header-mobile,
.mobile-bottom-nav,
.mobile-config-nav,
.mobile-live-banner-card,
.mobile-signout-row {
  display: none;
}

/* ══════════════════════════════════════════════════════════════════════════ */
/* CONSOLE MAIN WORKSPACE                                                    */
/* ══════════════════════════════════════════════════════════════════════════ */

.console-main {
  flex: 1;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 28px 32px 36px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ── Compact Quick Launch Strip (shown on Briefs / History / Settings) ──── */

.quick-launch-strip {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 12px 12px 20px;
  flex-wrap: wrap;
}

.ql-strip-kicker {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-body);
}

.ql-strip-callee {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.ql-strip-callee span {
  font-weight: 400;
  color: var(--ink-body);
}

.ql-strip-meta {
  font-size: 13px;
  color: var(--ink-body);
}

/* ── Ready State: 2-Column Hero Grid (Screen 02: 7fr / 5fr) ──────────────── */

.hero-grid {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: 24px;
  align-items: stretch;
}

.panel-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.ql-card {
  padding: 28px;
  gap: 22px;
}

.ql-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.ql-head-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ql-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.ql-dry-status {
  font-size: 13px;
  color: var(--ink-muted);
}

/* Callee Hero Strip */
.callee-box {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: var(--surface-subtle);
  border: 1px solid var(--border-subtle);
}

.avatar-callee {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
}

.avatar-callee-lg {
  width: 72px;
  height: 72px;
  font-size: 22px;
}

.avatar-callee-sm {
  width: 40px;
  height: 40px;
  font-size: 14px;
}

.callee-identity {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.micro-kicker {
  font-size: 12px;
  color: var(--ink-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.callee-name {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.callee-company {
  font-size: 14px;
  color: var(--ink-body);
}

.callee-dial-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  text-align: right;
  flex-shrink: 0;
}

.callee-dial-label {
  font-size: 12px;
  color: var(--ink-muted);
}

.callee-dial-target {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
}

.callee-dial-note {
  font-size: 12px;
  color: var(--ink-body);
}

/* Call Mode Segmented Radio (Desktop) */
.mode-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mode-track {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 4px;
  background: var(--surface-pill);
  border-radius: var(--radius-lg);
}

.mode-option {
  min-width: 0;
  max-width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 9px;
  border: 0;
  background: transparent;
  color: var(--ink-body);
  text-align: left;
  transition: background-color 0.14s ease, box-shadow 0.14s ease, color 0.14s ease;
}

.mode-option .mode-radio-dot {
  display: none;
}

.mode-option-copy {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.mode-option-title {
  font-size: 14px;
  font-weight: 600;
}

.mode-option-sub {
  font-size: 12px;
  opacity: 0.88;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mode-option[aria-checked="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-seg);
}

/* 3-Column Metadata Cards */
.meta-dl {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.meta-cell {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.meta-cell dt {
  font-size: 12px;
  color: var(--ink-muted);
  font-weight: 600;
  white-space: nowrap; /* "Agent Persona" must never wrap onto two lines */
  flex-shrink: 0;
}

.meta-cell dd {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.meta-primary {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  word-break: break-word;
}

.meta-primary.mono {
  font-size: 14px;
  font-weight: 500;
}

.meta-secondary {
  font-size: 12px;
  color: var(--ink-body);
  line-height: 1.35;
}

.meta-brief-file {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
  word-break: normal;
  overflow-wrap: anywhere;
}

.meta-brief-ok {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--ok);
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Optional Phone Override & Transport Disclosure */
.ql-options-disclosure {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--surface-tint);
}

.ql-options-disclosure summary {
  padding: 9px 14px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-body);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ql-options-disclosure summary::-webkit-details-marker {
  display: none;
}

.ql-options-body {
  padding: 0 14px 14px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 12px;
}

/* Quick Launch Bottom Action Buttons */
.ql-actions {
  display: flex;
  gap: 12px;
  margin-top: auto;
}

.ql-actions .btn-dry {
  flex: 1;
  height: 52px;
  border-radius: var(--radius-lg);
  font-size: 15px;
}

.ql-actions .btn-place {
  flex: 2;
  height: 52px;
  border-radius: var(--radius-lg);
  font-size: 16px;
}

/* Dry-run output box */
.dry-run-panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--surface-subtle);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dry-run-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.dry-run-head-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  min-width: 0;
  flex: 1 1 180px;
}

.dry-run-head .badge {
  white-space: normal;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  border-radius: 12px;
}

.dry-run-meta {
  font-size: 12px;
  color: var(--ink-body);
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: normal;
}

.dry-run-dismiss {
  flex-shrink: 0;
}

.dry-checks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12.5px;
}

.dry-checks li.ok { color: var(--ok); }
.dry-checks li.bad { color: var(--danger); }
.dry-checks li.warn { color: var(--live); }

.dry-pre {
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 11.5px;
  max-height: 200px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── Live Call & Coaching Idle Card (Right column on Screen 02) ──────────── */

.idle-live-card {
  overflow: hidden;
}

.idle-live-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
}

.idle-live-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.idle-clock {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 500;
  color: var(--ink-disabled);
}

.idle-live-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 32px;
  text-align: center;
  background: var(--surface-tint);
}

.idle-mic-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--surface-pill);
  color: var(--ink-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.idle-empty-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.idle-empty-copy {
  margin: 0;
  max-width: 300px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-body);
}

.idle-live-footer {
  padding: 16px 24px 20px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.idle-live-footer label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-disabled);
}

.idle-note-row {
  display: flex;
  gap: 8px;
}

.idle-send-btn {
  width: 44px;
  height: 44px;
  padding: 0;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════════════════════ */
/* ACTIVE LIVE CALL VIEW (Desktop Screen 03 + Mobile Screen 08)              */
/* ══════════════════════════════════════════════════════════════════════════ */

body.in-live-call .console-main {
  padding-block: 20px 24px;
}

.live-view-grid {
  display: grid;
  grid-template-columns: minmax(0, min(30%, 380px)) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 24px;
  height: calc(100dvh - 112px);
  min-height: 560px;
}

.live-aside {
  padding: 24px;
  gap: 20px;
  min-height: 0;
  overflow-y: auto;
}

.live-aside > * {
  flex-shrink: 0;
}

.live-aside-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.live-status-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--live);
  background: var(--live-bg);
  border: 1px solid var(--live-border);
  border-radius: 999px;
  padding: 4px 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.live-status-tag .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--live-dot);
  animation: pulse-dot 1.6s ease-in-out infinite;
}

.live-callee-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 0 4px;
  text-align: center;
}

.live-clock-hero {
  font-family: var(--font-mono);
  font-size: 44px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-top: 8px;
  color: var(--ink);
}

.live-dl {
  margin: 0;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.live-dl-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.live-dl-row:last-child {
  border-bottom: 0;
}

.live-dl-row dt {
  font-size: 13px;
  color: var(--ink-muted);
  flex-shrink: 0;
}

.live-dl-row dd {
  margin: 0;
  font-size: 13px;
  text-align: right;
  word-break: normal;
  overflow-wrap: anywhere;
}

.live-saving-note {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--ink-body);
}

.btn-end-call-lg {
  margin-top: auto;
  height: 56px;
  border-radius: var(--radius-lg);
  font-size: 16px;
  font-weight: 600;
  width: 100%;
}

.live-aside .btn-end-call-lg {
  min-height: 56px;
  height: auto;
  padding: 10px 12px;
  white-space: normal;
}

/* Transcript Panel (Right) */
.live-transcript-card {
  overflow: hidden;
  min-height: 0;
}

.live-tx-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.live-tx-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.tx-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  color: var(--ink-body);
  flex-wrap: wrap;
}

.tx-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tx-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.tx-swatch-callee { background: var(--ink); }
.tx-swatch-agent { background: var(--accent); }
.tx-swatch-note { background: #DC6803; }

.live-tx-stream {
  list-style: none;
  margin: 0;
  padding: 20px 24px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tx-row {
  display: grid;
  grid-template-columns: 56px 116px minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
}

.tx-row.tx-row-note,
.tx-row.tx-row-typing {
  align-items: center;
}

.tx-time {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-muted);
}

.tx-speaker {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tx-speaker.agent { color: var(--accent); }
.tx-speaker.callee { color: var(--ink); }
.tx-speaker.note { color: var(--whisper-label); }
.tx-speaker.meta { color: var(--ink-muted); font-weight: 600; }

.tx-body {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
}

.tx-body-meta {
  font-size: 12.5px;
  color: var(--ink-muted);
  font-family: var(--font-mono);
}

.tx-whisper-pill {
  margin: 0;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: var(--whisper-bg);
  border: 1px solid var(--whisper-border);
  font-size: 14px;
  line-height: 1.5;
  color: var(--whisper-ink);
  display: flex;
  align-items: center;
  gap: 8px;
}

.tx-whisper-status {
  margin-left: auto;
  font-size: 12px;
  color: var(--live);
  font-weight: 600;
  flex-shrink: 0;
}

.tx-typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--ink-muted);
  font-size: 14px;
}

.tx-typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink-disabled);
}

/* Rehearsal Callee Bar (visible only during simulation) */
.rehearsal-composer {
  padding: 12px 24px;
  border-top: 1px solid var(--border-subtle);
  background: var(--surface);
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 10px;
}

.rehearsal-composer input {
  min-width: 0;
}

.rehearsal-composer .btn {
  flex-shrink: 0;
}

.rehearsal-tag {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 8px;
  border-radius: 999px;
  flex-shrink: 0;
}

/* Live Whisper Coaching Footer */
.live-coach-footer {
  padding: 16px 24px 20px;
  border-top: 1px solid var(--border-subtle);
  background: var(--surface-tint);
  display: flex;
  flex-shrink: 0;
  flex-direction: column;
  gap: 10px;
}

.coach-bar-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.coach-bar-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-secondary);
}

.coach-bar-hint {
  font-size: 12px;
  color: var(--ink-muted);
}

.nudge-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-wrap: wrap;
}

.chip-btn {
  height: 32px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid var(--border-input);
  background: var(--surface);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-secondary);
  transition: border-color 0.14s ease, color 0.14s ease, background-color 0.14s ease;
}

.chip-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--surface-selected);
}

.chip-btn.active {
  border-color: var(--live-border);
  background: var(--live-bg);
  color: var(--live);
  font-weight: 600;
}

.coach-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.coach-input-row textarea {
  flex: 1;
  min-width: 0;
  min-height: 50px;
  max-height: 120px;
  padding: 12px 14px;
  font-size: 15px;
  line-height: 24px;
  resize: none;
  overflow-wrap: anywhere;
}

.coach-input-row .btn-send-note {
  flex-shrink: 0;
  height: 48px;
  padding: 0 18px;
  font-size: 14.5px;
  white-space: nowrap;
}

.coach-shortcut-hint {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--ink-muted);
  white-space: nowrap;
}

.coach-feedback {
  font-size: 13px;
  font-weight: 500;
  padding: 7px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--surface);
  color: var(--ink-body);
}

.coach-feedback.ok {
  border-color: var(--ok-border, #abefc6);
  background: var(--ok-bg, #ecfdf3);
  color: var(--ok, #067647);
}

.coach-feedback.bad {
  border-color: var(--live-border, #fecdca);
  background: var(--live-bg, #fef3f2);
  color: var(--live, #b42318);
}

input.input-invalid {
  border-color: var(--live, #b42318) !important;
}

/* Mobile-only Live Header (hidden on desktop) */
.live-mobile-header,
.live-mobile-end-wrap {
  display: none;
}

/* ══════════════════════════════════════════════════════════════════════════ */
/* CONFIGURATION CARD & TABS (Screens 02, 04, 05)                            */
/* ══════════════════════════════════════════════════════════════════════════ */

.config-card {
  overflow: hidden;
}

.config-tab-bar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.config-tabs {
  display: flex;
  gap: 4px;
}

.config-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 18px 14px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-body);
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  transition: color 0.14s ease, border-color 0.14s ease;
}

.config-tab:hover {
  color: var(--ink);
}

.config-tab.active {
  font-weight: 600;
  color: var(--ink);
  border-bottom-color: var(--accent);
}

.tab-count {
  font-size: 12px;
  background: var(--surface-pill);
  color: var(--ink-secondary);
  border-radius: 999px;
  padding: 2px 8px;
  font-weight: 600;
}

.config-tab.active .tab-count {
  background: var(--accent-soft);
  color: var(--accent);
}

.config-tab-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
}

.saved-meta {
  font-size: 12px;
  color: var(--ink-muted);
  margin-right: 4px;
}

/* Segmented Filter (History: All / Live / Test) */
.seg-pills {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface-pill);
  border-radius: var(--radius-md);
}

.seg-pill {
  height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius-xs);
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-body);
}

.seg-pill.active,
.seg-pill[aria-pressed="true"],
.seg-pill[aria-checked="true"] {
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  box-shadow: var(--shadow-seg-sm);
}

/* ── Tab 1: Client & Persona 3-Column Layout (Screen 02) ─────────────────── */

.persona-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.persona-col {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-right: 1px solid var(--border-subtle);
  min-width: 0;
}

.persona-col:last-child {
  border-right: 0;
}

.col-kicker {
  margin: 0;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-body);
}

.persona-contact-row {
  display: grid;
  gap: 16px;
}

#cfgGreeting { min-height: 85px; }
#cfgGuardrails { min-height: 127px; }
#cfgClosingLine { min-height: 68px; }

#cfgGreeting,
#cfgGuardrails,
#cfgClosingLine {
  overflow-wrap: anywhere;
  resize: none;
}

.greeting-preview {
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--surface-tint);
  overflow-wrap: anywhere;
}

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

.slider-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.slider-readout {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-body);
}

.barge-seg {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  background: var(--surface-pill);
  border-radius: var(--radius-md);
}

.barge-seg .seg-pill {
  height: 36px;
}

.advanced-drawer {
  border-top: 1px solid var(--border-subtle);
  background: var(--surface-tint);
}

.advanced-drawer summary {
  padding: 14px 24px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-body);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.advanced-drawer summary::-webkit-details-marker {
  display: none;
}

.advanced-drawer-body {
  padding: 0 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.span-all {
  grid-column: 1 / -1;
}

/* ── Tab 2: Knowledge Base / Briefs Split View (Screen 04) ───────────────── */

.briefs-split {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  min-height: 540px;
}

.briefs-left {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  border-right: 1px solid var(--border-subtle);
  min-width: 0;
}

.brief-dropzone {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border: 1.5px dashed var(--border-input);
  border-radius: var(--radius-lg);
  background: var(--surface-tint);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.brief-dropzone.dragover {
  border-color: var(--accent);
  background: var(--surface-selected);
}

.dropzone-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dropzone-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.dropzone-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.dropzone-sub {
  font-size: 13px;
  color: var(--ink-body);
}

.table-card {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table thead tr {
  background: var(--surface-subtle);
  text-align: left;
}

.data-table th {
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-body);
  white-space: nowrap;
}

.data-table td {
  padding: 14px 16px;
  border-top: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.data-table tbody tr {
  cursor: pointer;
  transition: background-color 0.12s ease;
}

.data-table tbody tr:hover {
  background: var(--surface-subtle);
}

.data-table tbody tr.row-active {
  background: var(--surface-selected);
}

.brief-editor-box {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  background: var(--surface-tint);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.brief-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.briefs-right {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--surface-tint);
  min-width: 0;
}

.lookup-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.lookup-sub {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--ink-body);
}

.lookup-form {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.lookup-form input {
  flex: 1;
  min-width: 0;
}

.lookup-submit-btn {
  flex-shrink: 0;
  height: 44px;
  padding: 0 16px;
}

.lookup-results {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lookup-match {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lookup-match-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.lookup-match-heading {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.lookup-score {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-body);
}

.lookup-score.high {
  color: var(--ok);
  font-weight: 600;
}

.lookup-excerpt {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-body);
}

/* ── Tab 3: Call History & Decisions Split View (Screen 05) ──────────────── */

.history-split {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  min-height: 540px;
}

.history-left {
  padding: 20px 24px;
  border-right: 1px solid var(--border-subtle);
  overflow-x: auto;
  min-width: 0;
}

.history-table th {
  padding: 10px 12px;
  background: transparent;
  border-bottom: 1px solid var(--border-subtle);
}

.history-table td {
  padding: 14px 12px;
  border-top: 0;
  border-bottom: 1px solid var(--border-subtle);
}

.history-file-btns {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.history-right {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--surface-tint);
  overflow-y: auto;
  min-width: 0;
}

.inspector-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.inspector-title {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 500;
}

.inspector-meta {
  font-size: 12px;
  color: var(--ink-body);
}

.decision-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.decision-kicker {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-body);
}

.decision-kicker.ok { color: var(--ok); }
.decision-kicker.warn { color: var(--whisper-label); }

.decision-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  line-height: 1.5;
}

.decision-row svg {
  flex-shrink: 0;
  margin-top: 3px;
}

.decision-ts {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-muted);
  white-space: nowrap;
}

.open-q-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--whisper-dot);
  margin-top: 7px;
  flex-shrink: 0;
}

.followup-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 14px;
  line-height: 1.45;
  cursor: pointer;
}

.followup-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.raw-md-viewer {
  margin: 0;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 480px;
  overflow: auto;
}

/* ── Tab 4: App Settings ─────────────────────────────────────────────────── */

.settings-pane {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

/* ══════════════════════════════════════════════════════════════════════════ */
/* DIALOGS & SHEETS (Switch Client Screen 09, Confirm Call, New Client)      */
/* ══════════════════════════════════════════════════════════════════════════ */

dialog.modal-dialog {
  padding: 0;
  border: 0;
  background: transparent;
  max-width: 480px;
  width: calc(100% - 32px);
  overflow: visible;
}

dialog.modal-dialog::backdrop {
  background: rgba(16, 24, 40, 0.45);
  backdrop-filter: blur(2px);
}

.modal-sheet {
  background: var(--surface);
  border-radius: var(--radius-2xl);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-modal);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sheet-handle {
  display: none;
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sheet-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

.sheet-close {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 0;
  background: transparent;
  color: var(--ink-body);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sheet-close:hover {
  background: var(--surface-pill);
  color: var(--ink);
}

.sheet-search {
  position: relative;
}

.sheet-search svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-muted);
  pointer-events: none;
}

.sheet-search input {
  height: 48px;
  padding-left: 42px;
  border-radius: var(--radius-lg);
  font-size: 15px;
}

.client-listbox {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 340px;
  overflow-y: auto;
}

.client-option-btn {
  width: 100%;
  min-height: 68px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  transition: border-color 0.14s ease, background-color 0.14s ease;
}

.client-option-btn:hover {
  background: var(--surface-subtle);
}

.client-option-btn.selected {
  border: 2px solid var(--accent);
  background: var(--surface-selected);
}

.client-option-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.client-option-name {
  font-size: 15px;
  font-weight: 600;
}

.client-option-sub {
  font-size: 13px;
  color: var(--ink-body);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
}

.confirm-check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--ink-secondary);
  cursor: pointer;
  min-height: 40px;
}

.confirm-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--danger);
}

/* ══════════════════════════════════════════════════════════════════════════ */
/* CONSOLE UI FIX PASS: back-to-console, test line, test numbers, toast       */
/* ══════════════════════════════════════════════════════════════════════════ */

.btn-back-console {
  width: 100%;
  height: 44px;
  justify-content: flex-start;
  padding: 0 14px;
  margin-top: auto;
  color: var(--ink);
  border-color: var(--border-input);
}

.btn-back-console + .live-back-hint {
  margin: -6px 0 0;
}

.btn-back-console ~ .btn-end-call-lg {
  margin-top: 0;
}

.live-return-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--live-border);
  background: var(--live-bg);
  color: var(--live);
  border-radius: var(--radius-lg);
  font-size: 14px;
  font-weight: 600;
  min-width: 0;
}

.live-return-bar[hidden] {
  display: none;
}

.live-return-bar > span:not(.dot) {
  min-width: 0;
  overflow-wrap: anywhere;
}

.live-return-bar .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--live-dot);
  flex-shrink: 0;
  animation: pulse-dot 1.6s ease-in-out infinite;
}

.test-line-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.test-line-row[hidden] {
  display: none;
}

.live-override-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.live-override-row[hidden] {
  display: none;
}

.btn-add-test {
  min-height: 44px;
  padding: 0 12px;
  white-space: nowrap;
  flex-shrink: 0;
}

.test-line-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 8px;
  min-width: 0;
}

.test-line-controls select {
  flex: 1 1 180px;
  min-width: 0;
  text-overflow: ellipsis;
}

.btn-icon {
  width: 44px;
  height: 44px;
  padding: 0;
  flex-shrink: 0;
}

.btn-danger-ghost {
  color: var(--danger);
}

.tn-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  max-height: 240px;
  overflow-y: auto;
}

.tn-empty {
  padding: 14px;
  text-align: center;
}

.tn-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  min-width: 0;
}

.tn-row:last-child {
  border-bottom: 0;
}

.tn-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.tn-label {
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tn-number {
  font-size: 13px;
  color: var(--ink-body);
}

.tn-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.tn-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dry-summary {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 600;
}

.dry-summary.bad {
  color: var(--danger);
}

.call-toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 24px;
  z-index: 80;
  width: min(560px, calc(100% - 32px));
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--danger-border);
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
  box-shadow: var(--shadow-modal);
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.call-toast.toast-ok {
  border-color: var(--border);
  background: var(--surface);
  color: var(--ok);
}

.call-toast[hidden] {
  display: none;
}

.call-toast > span {
  flex: 1;
  min-width: 0;
}

.call-toast-close {
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 22px;
  line-height: 1;
  padding: 0 4px;
}

/* ══════════════════════════════════════════════════════════════════════════ */
/* RESPONSIVE — TABLET & MOBILE (<= 959px · Screens 07, 08, 09, 10, 11, 12)  */
/* ══════════════════════════════════════════════════════════════════════════ */

.mobile-panel-actions,
.mobile-history-filters,
.briefs-mobile-list,
.history-mobile-list {
  display: none;
}

@media (max-width: 1240px) {
  .topbar-brand-sub {
    display: none;
  }

  .topbar-desktop {
    padding: 0 20px;
    gap: 12px;
  }

  .client-picker-btn {
    min-width: 180px;
    max-width: 300px;
  }
}

@media (max-width: 1080px) {
  .topbar-desktop {
    padding: 0 16px;
    gap: 8px;
  }

  .topbar-divider,
  .topbar-user-meta,
  .btn-new-client-label {
    display: none;
  }

  .topbar-desktop #statusSep,
  .topbar-desktop #statusDetail {
    display: none !important;
  }

  #btnNewClientTop {
    width: 44px;
    padding: 0;
    flex-shrink: 0;
  }

  .client-picker-group {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 320px;
    gap: 8px;
  }

  .client-picker-btn {
    min-width: 0;
    flex: 1 1 0;
    max-width: none;
    padding: 0 10px;
  }

  .topbar-spacer {
    flex: 0 1 auto;
    min-width: 0;
  }

  .status-pill {
    flex-shrink: 0;
  }

  .btn-signout {
    padding: 0 10px;
    white-space: nowrap;
    flex-shrink: 0;
  }
}

@media (max-width: 1120px) {
  .console-main {
    padding: 20px;
  }

  .hero-grid {
    grid-template-columns: 1fr;
  }

  .persona-columns {
    grid-template-columns: 1fr;
  }

  .persona-col {
    border-right: 0;
    border-bottom: 1px solid var(--border-subtle);
  }

  .persona-col:last-child {
    border-bottom: 0;
  }

  .briefs-split,
  .history-split {
    grid-template-columns: 1fr;
  }

  .briefs-left,
  .history-left {
    border-right: 0;
    border-bottom: 1px solid var(--border-subtle);
  }

  .settings-grid,
  .advanced-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 767px) {
  html {
    scroll-padding-top: 150px;
    scroll-padding-bottom: 96px;
  }

  html:has(body.mobile-subview) {
    scroll-padding-bottom: 168px;
  }

  .topbar-desktop,
  .quick-launch-strip,
  .idle-live-card,
  .config-tab-bar {
    display: none !important;
  }

  /* Mobile Primary Header (Screen 07) */
  .topbar-mobile {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 14px 16px;
    position: sticky;
    top: 0;
    z-index: 30;
  }

  .topbar-mobile-row {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .mobile-user-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 0;
    background: transparent;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .mobile-user-btn .avatar-user {
    width: 34px;
    height: 34px;
    font-size: 12px;
  }

  .mobile-client-picker {
    width: 100%;
    min-height: 56px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 14px;
    border: 1px solid var(--border-input);
    border-radius: var(--radius-lg);
    background: var(--surface);
    color: var(--ink);
    text-align: left;
  }

  /* Mobile Configuration Subview Header (Screens 10, 11, 12) */
  body.mobile-subview .topbar-mobile {
    display: none;
  }

  body.mobile-subview .subview-header-mobile {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 8px 16px 12px;
    position: sticky;
    top: 0;
    z-index: 30;
  }

  .subview-top-row {
    display: flex;
    align-items: center;
    gap: 4px;
  }

  .mobile-back-btn {
    width: 44px;
    height: 44px;
    margin-left: -10px;
    border: 0;
    background: transparent;
    color: var(--ink-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .subview-title {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.2;
  }

  .subview-sub {
    font-size: 12px;
    color: var(--ink-body);
  }

  .mobile-seg-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    padding: 4px;
    background: var(--surface-pill);
    border-radius: var(--radius-lg);
  }

  .mobile-seg-tab {
    height: 40px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    font-size: 14px;
    font-weight: 500;
    color: var(--ink-body);
  }

  .mobile-seg-tab.active {
    background: var(--surface);
    color: var(--ink);
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.1);
  }

  /* Console Main padding for fixed bottom bar */
  .console-main {
    padding: 16px 16px 116px;
    gap: 16px;
  }

  body.mobile-subview .console-main {
    padding-bottom: 168px;
  }

  body.mobile-subview .config-card {
    /* Keep the page as the sticky action bar's scroll container. */
    overflow: visible;
  }

  body.mobile-subview .mobile-panel-actions {
    display: flex;
    gap: 10px;
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(80px + env(safe-area-inset-bottom));
    z-index: 35;
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 12px 16px;
    box-shadow: 0 -4px 12px rgba(16, 24, 40, 0.06);
  }

  .mobile-panel-actions .btn {
    flex: 1;
    min-height: 44px;
  }

  .mobile-history-filters {
    display: flex;
    margin-bottom: 12px;
  }

  .briefs-desktop-table,
  .history-table {
    display: none;
  }

  .briefs-mobile-list,
  .history-mobile-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .available-briefs {
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
  }

  .available-briefs summary {
    min-height: 44px;
    padding: 12px;
    cursor: pointer;
    font-weight: 600;
  }

  .available-briefs .briefs-mobile-list {
    padding: 0 12px 12px;
  }

  .lookup-submit-btn {
    width: 48px;
    height: 48px;
    padding: 0;
  }

  .lookup-submit-btn span {
    display: none;
  }

  .mobile-row-card {
    display: grid;
    gap: 8px;
    min-width: 0;
    overflow-wrap: anywhere;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
  }

  .mobile-row-card.row-active {
    background: var(--surface-selected);
  }

  .mobile-row-head,
  .mobile-row-actions,
  .brief-dropzone,
  .brief-editor-head,
  .inspector-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .mobile-row-actions .btn {
    flex: 1 0 auto;
    min-height: 44px;
  }

  /* On mobile Home view (Quick Launch), hide Config card and show Configuration List Card (Screen 07) */
  body:not(.mobile-subview):not(.in-live-call) .config-card {
    display: none;
  }

  body.mobile-subview .hero-grid,
  body.mobile-subview .mobile-live-banner-card,
  body.mobile-subview .mobile-config-nav,
  body.mobile-subview .mobile-signout-row {
    display: none !important;
  }

  /* Quick Launch Mobile Refinements (Screen 07) */
  .ql-card {
    padding: 18px;
    gap: 16px;
  }

  .ql-title {
    font-size: 18px;
  }

  .ql-dry-status {
    display: none;
  }

  .callee-box {
    padding: 0;
    background: transparent;
    border: 0;
    gap: 12px;
  }

  .avatar-callee {
    width: 48px;
    height: 48px;
    font-size: 16px;
  }

  .callee-box .micro-kicker,
  .callee-dial-info {
    display: none;
  }

  .callee-name {
    font-size: 19px;
  }

  /* Mobile Radio Cards (Screen 07) */
  .mode-block .field-label {
    display: none;
  }

  .mode-track {
    grid-template-columns: minmax(0, 1fr);
    min-width: 0;
    gap: 8px;
    padding: 0;
    background: transparent;
  }

  .mode-option {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    min-height: 60px;
    padding: 10px 14px;
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--border-input);
    color: var(--ink);
  }

  .mode-option[aria-checked="true"] {
    background: var(--surface-selected);
    border: 2px solid var(--accent);
    box-shadow: none;
  }

  .mode-option .mode-radio-dot {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 2px solid var(--border-input);
    background: var(--surface);
  }

  .mode-option[aria-checked="true"] .mode-radio-dot {
    border: 6px solid var(--accent);
  }

  .mode-option-title {
    font-size: 15px;
  }

  .mode-option-sub {
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.3;
    font-size: 13px;
    color: var(--ink-body);
    opacity: 1;
  }

  /* Mobile Stacked Metadata Box (Screen 07) */
  .meta-dl {
    grid-template-columns: 1fr;
    gap: 0;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
  }

  .meta-cell {
    border: 0;
    border-radius: 0;
    border-bottom: 1px solid var(--border-subtle);
    padding: 12px 14px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  .meta-cell:last-child {
    border-bottom: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }

  .meta-cell:not(:last-child) dd {
    text-align: right;
    align-items: flex-end;
  }

  .meta-cell:last-child dd {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  /* Mobile Quick Launch shows Dry Run full-width; Place Call lives in fixed bottom bar */
  .ql-actions .btn-place {
    display: none;
  }

  /* Compact Live Status Card (Screen 07) */
  .mobile-live-banner-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 16px 18px;
    text-align: left;
    width: 100%;
  }

  .mobile-live-banner-card .idle-mic-circle {
    width: 40px;
    height: 40px;
  }

  /* Configuration List Card (Screen 07) */
  .mobile-config-nav {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    overflow: hidden;
  }

  .mobile-config-nav-kicker {
    padding: 14px 18px 6px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ink-body);
  }

  .mobile-config-item {
    min-height: 60px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    border: 0;
    border-bottom: 1px solid var(--border-subtle);
    background: transparent;
    color: var(--ink);
    text-align: left;
    width: 100%;
  }

  .mobile-config-item:last-child {
    border-bottom: 0;
  }

  .mobile-config-item-copy {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 1px;
  }

  .mobile-config-item-title {
    font-size: 15px;
    font-weight: 600;
  }

  .mobile-config-item-sub {
    font-size: 13px;
    color: var(--ink-body);
  }

  .mobile-signout-row {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 44px;
    font-size: 14px;
    color: var(--ink-body);
    gap: 6px;
  }

  .mobile-signout-row button,
  .mobile-signout-row a {
    border: 0;
    background: none;
    color: var(--accent);
    font-weight: 600;
    min-height: 44px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
  }

  .btn {
    min-height: 44px;
  }

  .btn-xs,
  .btn-sm,
  .chip-btn,
  .seg-pill {
    min-width: 44px;
    min-height: 44px;
    height: auto;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .dry-run-panel details summary {
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 6px 0;
  }

  .rehearsal-composer {
    padding: 12px 16px;
    gap: 8px;
  }

  .rehearsal-tag {
    display: none;
  }

  .rehearsal-composer input {
    flex: 1;
    min-width: 0;
  }

  .rehearsal-composer .btn {
    min-height: 44px;
    flex-shrink: 0;
  }

  .mobile-user-btn,
  .sheet-close {
    width: 44px;
    height: 44px;
  }

  .mobile-seg-tab {
    min-height: 44px;
    height: auto;
  }

  .ql-options-disclosure summary,
  .advanced-drawer summary {
    min-height: 44px;
  }

  .ql-options-disclosure summary {
    flex-wrap: wrap;
    column-gap: 8px;
    row-gap: 2px;
  }

  .call-toast-close {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Mobile Fixed Bottom Action Bar (Screen 07) */
  .mobile-bottom-nav {
    display: grid;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 10px 16px calc(16px + env(safe-area-inset-bottom));
    grid-template-columns: 1fr 1.65fr 1fr;
    gap: 10px;
    align-items: center;
  }

  body.in-live-call .mobile-bottom-nav {
    display: none;
  }

  .mobile-nav-btn {
    min-height: 52px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: 0;
    background: transparent;
    color: var(--ink-secondary);
    font-size: 12px;
    font-weight: 600;
    padding: 0;
  }

  .mobile-nav-cta {
    height: 54px;
    border-radius: var(--radius-xl);
    font-size: 15px;
    font-weight: 600;
    width: 100%;
  }

  /* Mobile Live Call Full-Screen (Screen 08) */
  body.in-live-call .topbar-mobile,
  body.in-live-call .subview-header-mobile,
  body.in-live-call .mobile-live-banner-card,
  body.in-live-call .mobile-config-nav,
  body.in-live-call .mobile-signout-row {
    display: none !important;
  }

  body.in-live-call .console-main {
    padding: 0;
    gap: 0;
    min-height: 100dvh;
    background: var(--surface);
  }

  .live-view-grid {
    grid-template-columns: 1fr;
    gap: 0;
    height: max(460px, 100dvh);
    min-height: 0;
  }

  .live-aside {
    display: none;
  }

  .live-transcript-card {
    border: 0;
    border-radius: 0;
    min-height: 0;
  }

  .live-tx-head {
    display: none;
  }

  .live-mobile-header {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--surface);
  }

  .live-mobile-top {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .live-mobile-clock {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 24px;
    font-weight: 500;
  }

  .live-mobile-callee {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .live-tx-stream {
    padding: 16px;
    gap: 12px;
    background: var(--surface-tint);
  }

  /* Mobile Chat Bubbles (Screen 08) */
  .tx-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 84%;
  }

  .tx-row.tx-row-agent {
    align-self: flex-end;
    align-items: flex-end;
  }

  .tx-row.tx-row-callee {
    align-self: flex-start;
    align-items: flex-start;
  }

  .tx-row.tx-row-note,
  .tx-row.tx-row-meta {
    align-self: stretch;
    max-width: 100%;
  }

  .tx-row-agent .tx-body {
    padding: 10px 14px;
    border-radius: 16px 16px 4px 16px;
    background: var(--accent-soft);
    font-size: 15px;
    line-height: 1.45;
  }

  .tx-row-callee .tx-body {
    padding: 10px 14px;
    border-radius: 16px 16px 16px 4px;
    background: var(--surface-pill);
    font-size: 15px;
    line-height: 1.45;
  }

  .live-coach-footer {
    padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
    background: var(--surface);
  }

  .coach-bar-label,
  .coach-bar-hint,
  .coach-shortcut-hint,
  .send-note-label {
    display: none;
  }

  .coach-input-row textarea {
    border-radius: var(--radius-lg);
    font-size: 16px;
  }

  .coach-input-row .btn-send-note {
    width: 48px;
    padding: 0;
    border-radius: var(--radius-lg);
  }

  .nudge-chips {
    margin-left: 0;
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .nudge-chips .chip-btn {
    flex-shrink: 0;
    white-space: nowrap;
  }

  .live-mobile-end-wrap {
    display: block;
    margin-top: 2px;
  }

  /* Mobile Bottom Sheet for Switch Client (Screen 09) */
  dialog.modal-dialog.sheet-dialog {
    margin: auto 0 0 0;
    max-width: 100%;
    width: 100%;
  }

  dialog.modal-dialog.sheet-dialog .modal-sheet {
    border-radius: var(--radius-sheet) var(--radius-sheet) 0 0;
    border-bottom: 0;
    box-shadow: var(--shadow-sheet);
    padding: 10px 16px calc(24px + env(safe-area-inset-bottom));
  }

  dialog.modal-dialog.sheet-dialog .sheet-handle {
    display: block;
    align-self: center;
    width: 40px;
    height: 5px;
    border-radius: 999px;
    background: var(--border-input);
  }

  /* Mobile Inputs prevent iOS auto-zoom */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="tel"],
  input[type="number"],
  input[type="search"],
  select {
    height: 50px;
    border-radius: var(--radius-lg);
    font-size: 16px;
  }

  textarea {
    font-size: 16px;
  }

  .persona-contact-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .settings-grid,
  .advanced-grid {
    grid-template-columns: 1fr;
  }

  .persona-col,
  .briefs-left,
  .briefs-right,
  .history-left,
  .history-right,
  .settings-pane {
    padding: 16px;
  }
}

/* ── Mobile overflow hardening (status badge / client picker / live header) ─ */
@media (max-width: 767px) {
  .topbar-mobile,
  .topbar-mobile-row {
    min-width: 0;
    max-width: 100%;
  }

  .topbar-mobile-row .status-pill {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 46%;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .topbar-mobile-row .status-pill > span:not(.dot) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
  }

  .mobile-client-picker {
    box-sizing: border-box;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
  }

  .mobile-client-picker .client-picker-labels {
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
  }

  .mobile-client-picker .client-picker-name {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-client-picker > svg {
    flex-shrink: 0;
  }

  .live-mobile-callee {
    min-width: 0;
  }

  .live-mobile-callee > div {
    min-width: 0;
  }

  .live-mobile-callee > div > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .live-mobile-callee > .badge {
    flex-shrink: 0;
    max-width: 40%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* keep the labelled meta-row ("Agent Persona") on one line; let the value wrap/shrink */
  .meta-cell dt {
    white-space: nowrap;
    flex-shrink: 0;
  }

  .meta-cell dd {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .call-toast {
    bottom: calc(96px + env(safe-area-inset-bottom));
  }

  body.mobile-subview .call-toast {
    bottom: calc(160px + env(safe-area-inset-bottom));
  }

  .live-return-bar {
    flex-wrap: wrap;
  }
}

/* ── Coaching v2.2: Live Listen, Consent, Join Call & Super-Admin Codes ─── */

.live-audio-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: var(--surface-tint);
}

.live-consent-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.live-control-btn {
  width: 100%;
  justify-content: center;
  min-height: 44px;
  gap: 8px;
}

.live-control-btn.listening {
  background: var(--ok-bg, #ecfdf3);
  border-color: var(--ok, #067647);
  color: var(--ok, #067647);
}

.join-call-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.join-active-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border-radius: var(--radius-md, 10px);
  border: 1px solid var(--border-subtle);
  background: var(--surface);
}

.join-status-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.join-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.join-instruction-row {
  display: flex;
  gap: 6px;
}

.join-instruction-row input {
  flex: 1;
  min-width: 0;
}

.coaching-codes-card {
  margin-top: 24px;
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: var(--surface-tint);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.coaching-codes-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.secret-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.secret-input-row input {
  flex: 1;
  min-width: 0;
}

.coaching-codes-card, .coaching-codes-card .form-field, .live-audio-controls {
  min-width: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 767px) {
  .coaching-codes-card :is(button, input, select),
  .live-audio-controls :is(button, input) {
    min-height: 44px;
    min-width: 44px;
  }
}

.call-memory {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  text-align: left;
}
.call-memory summary, .call-memory label, .call-memory button {
  min-height: 44px;
  cursor: pointer;
}
.call-memory summary { padding-block: 12px; }
.call-memory label { display: flex; align-items: center; gap: 8px; }
