
/* ═══════════════════════════════════════════
   UNDRIFT — DESIGN SYSTEM
   Part A: Tokens, Themes, Layout, Components
═══════════════════════════════════════════ */

/* ── TOKENS ── */
:root {
  --brand:          #1A6BFF;
  --brand-hover:    #0F55D4;
  --brand-subtle:   #EBF1FF;
  --brand-border:   #C0D4FF;
  --success:        #16A34A;
  --success-subtle: #F0FDF4;
  --success-border: #BBF7D0;
  --warning:        #D97706;
  --warning-subtle: #FFFBEB;
  --warning-border: #FDE68A;
  --danger:         #DC2626;
  --danger-subtle:  #FEF2F2;
  --danger-border:  #FECACA;
  --yellow:         #EAB308;
  --yellow-subtle:  #FEFCE8;
  --yellow-border:  #FEF08A;
  --purple:         #7C3AED;
  --purple-subtle:  #F5F3FF;
  --purple-border:  #DDD6FE;
  --teal:           #0891b2;
  --teal-subtle:    #ecfeff;
  --teal-border:    #a5f3fc;
  --cf-gradient:    linear-gradient(135deg, #3569FC 0%, #A991F6 100%);
  --cf-primary:     #3569FC;
  --cf-secondary:   #A991F6;
  --cf-subtle:      #f5f3ff;
  --cf-border:      #e9d5ff;
  --radius-sm: 6px;
  --radius:    8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --topbar-h:  52px;
  --left-panel-w: 264px;
  --statusbar-h: 56px; /* safe default — overwritten immediately by observeStatusbar() */
}

/* ── LIGHT THEME ── */
[data-theme="light"] {
  --bg:        #F4F6F9;
  --surface:   #FFFFFF;
  --surface-2: #F8F9FB;
  --surface-3: #EFF1F5;
  --border:    #E4E7EC;
  --border-2:  #CDD2DA;
  --text-1:    #0F1928;
  --text-2:    #3D4A5C;
  --text-3:    #6B7A8D;
  --text-4:    #9BA5B2;
  --shadow-sm: 0 1px 3px rgba(15,25,40,.07), 0 1px 2px rgba(15,25,40,.04);
  --shadow:    0 4px 16px rgba(15,25,40,.08), 0 1px 4px rgba(15,25,40,.05);
  --brand-name-color: #0E1927;
}

/* ── DARK THEME ── */
[data-theme="dark"] {
  --bg:        #0D1117;
  --surface:   #161B22;
  --surface-2: #1C2330;
  --surface-3: #212B3C;
  --border:    #2A3444;
  --border-2:  #374356;
  --text-1:    #E6EDF3;
  --text-2:    #B0BDCC;
  --text-3:    #8899AA;
  --text-4:    #6B7A8D;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.35);
  --shadow:    0 4px 16px rgba(0,0,0,.45);
  --brand-name-color: #E6EDF3;
  --brand:          #7eb8ff;
  --brand-lightblue: #7eb8ff;
  --brand-subtle:   #0f2040;
  --brand-border:   #1e3a6e;
  --cf-gradient:    linear-gradient(135deg, #60a5fa 0%, #c084fc 100%);
  --cf-primary:     #60a5fa;
  --cf-secondary:   #c084fc;
  --cf-subtle:      #1e1b4b;
  --cf-border:      #4c1d95;
  --brand-hover:    #a8d0ff;
  --success-subtle: #052e16;
  --success-border: #14532d;
  --warning-subtle: #1c1200;
  --warning-border: #713f12;
  --danger-subtle:  #1c0a0a;
  --danger-border:  #7f1d1d;
  --yellow-subtle:  #1c1600;
  --yellow-border:  #854d0e;
  --purple-subtle:  #1a0a2e;
  --purple-border:  #3b1a6e;
  --teal:           #22d3ee;
  --teal-subtle:    #082f49;
  --teal-border:    #164e63;
}

input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }

[data-theme="dark"] [data-theme="dark"] .act-btn.btn-flag:hover,
[data-theme="dark"] .t-cap-btn.tcb-flag:hover {
  border-color: #92400e; color: #fbbf24; background: #1c1000;
}
[data-theme="dark"] .act-btn.btn-decision:hover,
[data-theme="dark"] .t-cap-btn.tcb-decision:hover {
  border-color: #164e63; color: #22d3ee; background: #082f49;
}
[data-theme="dark"] .t-cap-btn { border-color: rgba(255,255,255,0.18); color: var(--text-2); }

/* ── DECISION TEAL DARK MODE ── */
[data-theme="dark"] .fc-label.lbl-decision {
  color: #22d3ee;
}
[data-theme="dark"] .feed-card.fc-decision {
  border-left-color: #22d3ee;
}

/* ── DARK MODE BRAND LIGHTBLUE OVERRIDES ── */
[data-theme="dark"] .tab.active    { color: var(--brand-lightblue); border-bottom-color: var(--brand-lightblue); }
/* rp-tab active colors handled per-bucket below */
[data-theme="dark"] .sens-pill     { color: var(--brand-lightblue); border-color: var(--brand-lightblue); }
[data-theme="dark"] .info-box strong { color: var(--brand-lightblue); }
[data-theme="dark"] a              { color: var(--brand-lightblue); }
/* ── DARK MODE PRIMARY BUTTON OVERRIDE ── */
[data-theme="dark"] .btn-primary { background: #1A6BFF; color: #fff; }
[data-theme="dark"] .btn-primary:hover { background: #0F55D4; }
[data-theme="dark"] .rpt-btn-primary { background: #1A6BFF; color: #fff; }
[data-theme="dark"] .rpt-btn-primary:hover { background: #0F55D4; }

/* ── DARK MODE STATUS COLOR OVERRIDES ── */
/* Consistent green/amber/red across chips, pills, elapsed, live pill, end button */

/* chips */

/* elapsed/timer pills */
/* elapsed pill dark mode handled by rgba alpha — no override needed */

/* Live pill */
[data-theme="dark"] .pill-live { color: #4ade80; background: rgba(22,163,74,0.2); border-color: rgba(22,163,74,0.6); }
[data-theme="dark"] .pill-live .dot { background: #4ade80; }

/* End session button hover */
[data-theme="dark"] .btn-end-session:hover { background: rgba(248,113,113,0.15); border-color: rgba(248,113,113,0.35); color: #f87171; }
[data-theme="dark"] .dot-decision { background: #22d3ee; }
[data-theme="dark"] .rp-tab[data-rp="decisions"].active { color: #22d3ee; }

/* ── BROWSER COMPATIBILITY BANNER ── */
#compat-banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  background: var(--warning);
  border-bottom: 2px solid var(--warning-border);
  z-index: 10000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
.compat-banner-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
}
.compat-banner-icon {
  width: 18px; height: 18px;
  flex-shrink: 0;
  stroke: #fff;
}
.compat-banner-text {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  line-height: 1.45;
}
.compat-banner-link {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}
.compat-banner-link:hover { opacity: .85; }
.compat-banner-dismiss {
  flex-shrink: 0;
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.35);
  color: #fff;
  padding: 5px 13px;
  border-radius: var(--radius);
  font-size: 12px; font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s;
  white-space: nowrap;
}
.compat-banner-dismiss:hover { background: rgba(255,255,255,0.32); }

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; font-size: 14px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text-1);
  font-size: 13px;
  line-height: 1.5;
  transition: background .2s, color .2s;
}
/* Mode-specific scroll behavior */
body[data-mode="setup"]     { min-height: 100vh; overflow-y: auto; }
body[data-mode="dashboard"] { height: 100vh; overflow: hidden; }
body[data-mode="report"]    { min-height: 100vh; overflow-y: auto; }

/* ═══════════════════════════════════════════
   SHARED COMPONENTS
═══════════════════════════════════════════ */

/* ── BRAND ── */
.brand { display: flex; align-items: center; gap: 9px; }
.brand-icon {
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.brand-icon img { width: 30px; height: 30px; display: block; border-radius: var(--radius-sm); }
.brand-name  { font-size: 1.75rem; font-weight: 700; letter-spacing: -.01em; color: var(--brand-name-color); line-height: 1.1; }
.brand-sub   { font-size: 9px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: #9333ea; border-top: 1px solid rgba(147,51,234,0.35); padding-top: 2px; margin-top: 2px; line-height: 1; }
[data-theme="dark"] .brand-sub { color: #C084FC; border-top-color: rgba(192,132,252,0.35); }

/* ── THEME TOGGLE ── */
.theme-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 11px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer; font-size: 12px; color: var(--text-3);
  box-shadow: var(--shadow-sm);
  transition: all .15s; font-family: inherit; user-select: none;
}
.theme-btn:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-subtle); }
.theme-btn:active { background: var(--brand); color: #fff; border-color: var(--brand); }
.theme-btn:active svg { stroke: #fff; }

/* ── CARD ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 1rem;
}
.card-head {
  padding: 1.5rem 1.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.card-head h2 {
  font-size: 18px; font-weight: 600;
  letter-spacing: -.02em; color: var(--text-1);
  margin-bottom: 3px;
}
.card-head p { font-size: 13px; color: var(--text-3); }
.card-body { padding: 1.5rem 1.75rem; }

/* ── TABS ── */
.tabs {
  display: flex;
  padding: 0 1.75rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.tab {
  padding: .7rem 1rem;
  font-size: 13px; font-weight: 500;
  color: var(--text-3);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .15s, border-color .15s;
  white-space: nowrap; user-select: none;
}
.tab:hover { color: var(--text-2); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.panel { display: none; }
.panel.active { display: block; }

/* ── FORM FIELDS ── */
.field { margin-bottom: 1.1rem; }
.field > label {
  display: block;
  font-size: 12px; font-weight: 500;
  color: var(--text-2); margin-bottom: 5px;
}
.field input[type=text],
.field input[type=number],
.field textarea,
.field select {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-1);
  padding: 8px 11px;
  font-family: inherit; font-size: 13px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  appearance: none;
}
.field input:hover, .field textarea:hover, .field select:hover { border-color: var(--border-2); }
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(26,107,255,.1);
}
.field textarea { resize: vertical; min-height: 72px; line-height: 1.6; }
.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236B7A8D' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px; cursor: pointer;
}
.field select option { background: var(--surface); color: var(--text-1); }
.row-2 { display: grid; grid-template-columns: 160px 80px 1fr; gap: 12px; }

/* ── DIVIDERS ── */
.divider {
  font-size: 11px; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-4);
  display: flex; align-items: center; gap: 10px;
  margin: 1.4rem 0 .9rem;
}
.divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ── AGENDA ROW BUILDER ── */
.col-heads {
  display: grid;
  grid-template-columns: 1fr 68px 108px 32px;
  gap: 8px; padding: 0 2px; margin-bottom: 5px;
}
.col-heads span {
  font-size: 11px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .05em; color: var(--text-4);
}
.agenda-rows { margin-bottom: 6px; }
.a-row {
  display: grid;
  grid-template-columns: 1fr 68px 108px 32px;
  gap: 8px; align-items: center; margin-bottom: 6px;
}
.a-row input[type=number] { text-align: center; }
.a-row input, .a-row select, .o-row input {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-1);
  padding: 6px 9px;
  font-family: inherit; font-size: 13px;
  outline: none;
  width: 100%;
  transition: border-color .15s;
}
.a-row input:focus, .a-row select:focus, .o-row input:focus { border-color: var(--brand); }
.a-row select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236B7A8D' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 10px;
  padding-right: 24px; cursor: pointer;
}
.a-row select option { background: var(--surface); color: var(--text-1); }
.outcome-rows { margin-bottom: 6px; }
.o-row {
  display: grid; grid-template-columns: 1fr 32px;
  gap: 8px; align-items: center; margin-bottom: 6px;
}

/* ── BUTTONS ── */
.btn-rm {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-4);
  cursor: pointer; font-size: 16px; line-height: 1;
  transition: all .15s; flex-shrink: 0;
}
.btn-rm:hover { border-color: var(--danger-border); color: var(--danger); background: var(--danger-subtle); }

.btn-ghost {
  width: 100%; padding: 8px;
  background: transparent;
  border: 1px dashed var(--border-2);
  border-radius: var(--radius);
  color: var(--text-3); font-family: inherit; font-size: 12px; font-weight: 500;
  cursor: pointer; transition: all .15s; margin-bottom: .75rem;
}
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-subtle); }

.btn-primary {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; padding: 10px 20px;
  background: var(--brand); color: #fff;
  border: none; border-radius: var(--radius);
  font-family: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all .15s; letter-spacing: -.01em;
}
.btn-primary:hover { background: var(--brand-hover); }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary svg { width: 15px; height: 15px; stroke: #fff; fill: none; stroke-width: 2; stroke-linecap: round; }

.btn-secondary {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; padding: 9px 20px;
  background: var(--surface); color: var(--text-2);
  border: 1px solid var(--border-2); border-radius: var(--radius);
  font-family: inherit; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all .15s;
}
.btn-secondary:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-subtle); }
.btn-secondary svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }

/* Button visited states - explicitly match normal state */
.theme-btn:visited { 
  background: var(--surface); 
  border-color: var(--border); 
  color: var(--brand);
}
.theme-btn:visited:hover { 
  border-color: var(--brand); 
  color: var(--brand); 
  background: var(--brand-subtle); 
}
.theme-btn:visited:active { 
  background: var(--brand); 
  color: #fff; 
  border-color: var(--brand); 
}
.theme-btn:visited:active svg { 
  stroke: #fff; 
}
.btn-ghost:visited { 
  background: var(--surface-2); 
  border-color: var(--border-2); 
  color: var(--text-2); 
}
.btn-primary:visited { 
  background: var(--brand); 
  color: #fff; 
  border-color: var(--brand); 
}
.btn-secondary:visited { 
  background: var(--surface-2); 
  border-color: var(--border-2); 
  color: var(--text-2); 
}
a.theme-btn:visited,
a.btn-ghost:visited,
a.btn-primary:visited,
a.btn-secondary:visited {
  text-decoration: none;
}

.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 1rem; }

/* ── SLIDER ── */
.slider-field { margin-bottom: 1.1rem; }
.slider-field > label { display: block; font-size: 12px; font-weight: 500; color: var(--text-2); margin-bottom: 8px; }
.slider-track { display: flex; align-items: center; gap: 12px; }
.slider-track input[type=range] { flex: 1; height: 4px; accent-color: var(--brand); cursor: pointer; }
.slider-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-4); margin-top: 5px; }
.sens-pill {
  font-size: 12px; font-weight: 600; color: var(--brand);
  background: var(--brand-subtle); border: 1px solid var(--brand-border);
  border-radius: 999px; padding: 2px 10px;
  min-width: 72px; text-align: center; white-space: nowrap;
}

/* ── INFO BOX ── */
.info-box {
  background: var(--brand-subtle); border: 1px solid var(--brand-border);
  border-radius: var(--radius); padding: 10px 14px;
  font-size: 12px; color: var(--text-2);
  margin-bottom: 1rem; line-height: 1.6;
}
.info-box strong { color: var(--brand); }

/* ── CO-FACILITATOR VOICE ──
   The consistent visual identity for all Undrift-generated messages.
   Used on: welcome screen, post-parse response, pre-launch preflight,
   report offboarding moment. Never appears in .md / PDF exports. */
.cf-voice {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--cf-subtle);
  border: 1px solid var(--cf-border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin-bottom: 1rem;
  position: relative;
  overflow: hidden;
}
.cf-voice::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--cf-gradient);
  z-index: 2;
}
.cf-voice::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--cf-gradient);
  opacity: 0.03;
  pointer-events: none;
  z-index: 0;
}
.cf-voice > * {
  position: relative;
  z-index: 1;
}
.cf-voice-mark {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  background: var(--cf-gradient);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cf-voice-mark svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: #fff;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.cf-voice-text {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.65;
  font-style: italic;
}
.cf-voice-text strong {
  font-style: normal;
  color: var(--brand);
}
/* Report variant — body takes full width for divider + footer layout */
.cf-voice-report { align-items: flex-start; }
.cf-voice-body { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.cf-voice-divider { height: 1px; background: var(--cf-gradient); opacity: 0.3; margin: 10px 0; }
.cf-voice-footer { display: flex; align-items: center; justify-content: flex-start; gap: 10px; }
.cf-voice-dl-label { font-size: 12px; color: var(--text-2); font-style: italic; }
.cf-voice-dl-btns { display: flex; gap: 6px; flex-shrink: 0; }
.cf-voice-dl-btns .rpt-btn-secondary { display: flex; align-items: center; gap: 4px; padding: 4px 11px; font-weight: 600; font-size: 11px; }
.cf-voice-dl-btns .rpt-btn-secondary svg { width: 12px; height: 12px; flex-shrink: 0; }
.cf-feedback-link { color: var(--brand); text-decoration: none; font-style: normal; pointer-events: auto; cursor: pointer; }
.cf-feedback-link:visited { color: var(--brand); }
.cf-feedback-link:hover, .cf-feedback-link:active { color: var(--brand-hover); }

/* Welcome / ToS screen */
#welcome-screen {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
  padding: 2rem 1rem;
}
#welcome-screen.active { display: flex; }
.welcome-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2.25rem 2rem;
  max-width: 520px;
  width: 100%;
  box-shadow: var(--shadow);
}
.welcome-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 1.5rem;
}
.welcome-brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.welcome-brand-icon svg {
  width: 20px; height: 20px;
  fill: none; stroke: #fff;
  stroke-width: 2; stroke-linecap: round;
}
.welcome-brand-name {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: -.02em;
  line-height: 1.2;
}
.welcome-bullets {
  list-style: none;
  padding: 0;
  margin: 1rem 0 1.5rem;
}
.welcome-bullets li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.55;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.welcome-bullets li:last-child { border-bottom: none; }
.welcome-bullets li::before {
  content: '';
  flex-shrink: 0;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--brand);
  margin-top: 6px;
}
.tos-accept {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 1.25rem;
  cursor: pointer;
}
.tos-accept input[type=checkbox] {
  accent-color: var(--brand);
  width: 15px; height: 15px;
  flex-shrink: 0;
  margin-top: 2px;
  cursor: pointer;
}
.tos-accept-label {
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.6;
  cursor: pointer;
}
.tos-accept-label a {
  color: var(--brand);
  text-decoration: none;
}
.tos-accept-label a:hover { text-decoration: underline; }
.tos-accept.checked {
  border-color: var(--brand-border);
  background: var(--brand-subtle);
}

/* Date picker */
#f-date-display { cursor: pointer; caret-color: transparent; }
#f-date-display:hover { border-color: var(--border-2); }
#f-date-display:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(26,107,255,.1); }
#f-date-icon:hover svg { stroke: var(--brand); }

/* ── UPLOAD ZONE ── */
.upload-zone {
  border: 2px dashed var(--border-2); border-radius: var(--radius-lg);
  padding: 2.5rem 1.5rem; text-align: center;
  cursor: pointer; transition: all .15s;
  margin-bottom: 1rem; background: var(--surface-2);
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--brand); background: var(--brand-subtle);
}
.upload-icon {
  width: 44px; height: 44px;
  background: var(--surface-3); border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px; transition: all .15s;
}
.upload-zone:hover .upload-icon, .upload-zone.drag-over .upload-icon {
  background: var(--brand-subtle); border-color: var(--brand-border);
}
.upload-icon svg { width: 18px; height: 18px; stroke: var(--text-3); fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; transition: stroke .15s; }
.upload-zone:hover .upload-icon svg { stroke: var(--brand); }
.upload-zone h3 { font-size: 14px; font-weight: 600; color: var(--text-1); margin-bottom: 4px; }
.upload-zone p  { font-size: 12px; color: var(--text-3); }
.upload-zone .hint { font-size: 11px; color: var(--text-4); margin-top: 5px; }

.file-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  background: var(--success-subtle); border: 1px solid var(--success-border);
  border-radius: var(--radius); margin-bottom: 1rem;
}
.file-chip svg { width: 15px; height: 15px; stroke: var(--success); fill: none; stroke-width: 1.5; stroke-linecap: round; flex-shrink: 0; }
.file-chip span { font-size: 12px; color: var(--text-1); flex: 1; font-weight: 500; }
.chip-clear { background: transparent; border: none; color: var(--text-4); cursor: pointer; font-size: 18px; line-height: 1; padding: 0 2px; transition: color .15s; }
.chip-clear:hover { color: var(--danger); }

/* ── STATUS LINE ── */
.status { font-size: 12px; color: var(--text-3); min-height: 20px; margin-bottom: .5rem; }
.status.ok  { color: var(--success); }
.status.err { color: var(--danger); }
.status.loading { color: var(--brand); }

/* ── PREVIEW TABLE ── */
.pv-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-4); margin-bottom: 6px; }
.pv-wrap {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 4px 10px;
  max-height: 180px; overflow-y: auto; margin-bottom: 1rem;
}
.pv-wrap::-webkit-scrollbar { width: 4px; }
.pv-wrap::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 2px; }
.pv-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.pv-table tr { border-bottom: 1px solid var(--border); }
.pv-table tr:last-child { border-bottom: none; }
.pv-table td { padding: 6px 4px; color: var(--text-2); }
.pv-table td:first-child { color: var(--text-1); font-weight: 500; width: 60%; }
.pv-table td:last-child  { color: var(--text-3); text-align: right; }
#s-objectives td { text-align: left; color: var(--text-2); font-weight: 400; width: 100%; }

/* ── PASTE AREA ── */
.paste-area textarea { min-height: 150px; font-size: 12px; line-height: 1.7; }

/* ── SPINNER ── */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 14px; height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block; vertical-align: middle;
}

/* ═══════════════════════════════════════════
   SETUP SCREEN
═══════════════════════════════════════════ */
#setup-screen {
  display: none;
  min-height: 100vh;
  align-items: flex-start; justify-content: center;
  padding: 2rem 1rem 4rem;
}
#setup-screen.active { display: flex; }
.setup-wrapper { width: 100%; max-width: 680px; }
.setup-topbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.5rem;
}

/* ── LEGAL PAGE LAYOUT (cloned from setup-) ── */
#legal-screen {
  display: flex;
  min-height: 100vh;
  align-items: flex-start; justify-content: center;
  padding: 2rem 1rem 4rem;
}

/* Preflight card */
#success-card { display: none; }
#success-card.active { display: block; }
.summary-grid {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 1rem;
}
.s-row { display: flex; justify-content: space-between; align-items: baseline; padding: 9px 14px; border-bottom: 1px solid var(--border); font-size: 13px; }
.s-row:last-child { border-bottom: none; }
.s-key { color: var(--text-3); font-size: 12px; }
.s-val { color: var(--text-1); font-weight: 500; }

/* ═══════════════════════════════════════════
   DASHBOARD — TOP BAR
═══════════════════════════════════════════ */
#dashboard-screen { display: none; }
#dashboard-screen.active { display: flex; flex-direction: column; width: 100%; height: 100vh; overflow: hidden; }

.topbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 1rem; gap: 10px;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}
.meeting-info { flex: 1; min-width: 0; }
.meeting-title { font-size: 13px; font-weight: 600; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meeting-meta  { font-size: 11px; color: var(--text-4); margin-top: 1px; }

.status-pill {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 600; flex-shrink: 0; transition: all .3s;
}
.status-pill .dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.pill-live    { background: rgba(22,163,74,0.2); color: var(--success); border: 1px solid rgba(22,163,74,0.6); }
.pill-live .dot { background: var(--success); animation: blink 1.8s infinite; }
.pill-warning { background: var(--warning-subtle); color: var(--warning); border: 1px solid var(--warning-border); }
.pill-warning .dot { background: var(--warning); }
.pill-over    { background: var(--danger-subtle);  color: var(--danger);  border: 1px solid var(--danger-border); }
.pill-over .dot { background: var(--danger); animation: blink 1s infinite; }
@keyframes blink { 0%,100%{opacity:1;} 50%{opacity:.3;} }

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

.sens-control  { display: flex; align-items: center; gap: 7px; flex-shrink: 0; }
.sens-label    { font-size: 10px; color: var(--text-4); white-space: nowrap; }
.sens-slider   { width: 72px; height: 4px; accent-color: var(--brand); cursor: pointer; flex-shrink: 0; }
.sens-value    { font-size: 10px; font-weight: 600; color: var(--brand); width: 56px; text-align: left; }

.btn-end-session {
  display: flex; align-items: center; gap: 5px;
  padding: 6px 12px;
  background: var(--danger-subtle); border: 1px solid var(--danger-border);
  color: var(--danger); border-radius: var(--radius);
  font-family: inherit; font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all .15s;
}
.btn-end-session:hover { background: #fee2e2; border-color: var(--danger); }
.btn-end-session svg   { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }

/* ── STATUS BAR ── */
.statusbar {
  position: fixed; top: var(--topbar-h); left: 0; right: 0;
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 10px 1rem; z-index: 90;
}
.agenda-track { display: flex; gap: 3px; height: 5px; border-radius: 3px; overflow: hidden; margin-bottom: 7px; }
.track-seg    { flex: 1; border-radius: 2px; transition: background .4s; }
.seg-done     { background: var(--success); }
.seg-active   { background: var(--brand); animation: pulse-seg 2s infinite; }
.seg-pending  { background: var(--surface-3); }
@keyframes pulse-seg { 0%,100%{opacity:1;} 50%{opacity:.55;} }

.status-meta        { display: flex; align-items: center; position: relative; }
.status-meta-left   { display: flex; align-items: center; flex: 1; min-width: 0; }
.status-meta-center { position: absolute; left: calc(50% + (var(--left-panel-w) - 420px) / 2); transform: translateX(-50%); display: flex; align-items: center; pointer-events: none; }
.status-meta-center .status-pill { pointer-events: auto; }
.status-meta-right  { display: flex; align-items: center; gap: 6px; flex-shrink: 0; margin-left: auto; }
.current-item { font-size: 13px; font-weight: 600; color: var(--text-1); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* M5 analyzing indicator */
#m5-indicator { display: none; align-items: center; gap: 5px; font-size: 11px; color: var(--brand); }
#m5-indicator svg { animation: spin 1s linear infinite; }

/* ── LAYOUT GRID ── */
.layout {
  position: fixed;
  top: calc(var(--topbar-h) + var(--statusbar-h));
  left: 0; right: 0; bottom: 0;
  display: grid;
  grid-template-columns: var(--left-panel-w) 1fr 420px;
  overflow: hidden;
  min-height: 0;
}

/* ── SIDEBAR ── */
.left-panel {
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; overflow: hidden; min-height: 0;
}
.lp-head {
  padding: 9px 12px; border-top: 1px solid var(--border-2); border-bottom: 1px solid var(--border-2);
  font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--text-2); background: var(--surface-2);
  display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
}
.lp-head span { font-size: 11px; color: var(--text-3); font-weight: 500; letter-spacing: 0; text-transform: none; }
.lp-head-agenda { color: var(--text-1); background: var(--surface-3); border-top: 2px solid var(--brand); }
.obj-panel { display: flex; flex-direction: column; border-top: 1px solid var(--border-2); }
.obj-list { overflow-y: hidden; transition: max-height 0.3s ease; max-height: 0; }
.obj-list.open { overflow-y: auto; max-height: 260px; }
.obj-list::-webkit-scrollbar { width: 4px; }
.obj-list::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 2px; }
.obj-item { display: flex; align-items: flex-start; gap: 8px; padding: 6px 12px;
  font-size: 12px; color: var(--text-2); line-height: 1.4; cursor: pointer;
  border-bottom: 1px solid var(--border); transition: background 0.15s; }
.obj-item:last-child { border-bottom: none; }
.obj-item:hover:not(.obj-done) { background: var(--surface-2); }
.obj-item input[type="checkbox"] { display: none; }
.obj-check-icon { flex-shrink: 0; margin-top: 1px; }
.obj-item.obj-done { opacity: .55; pointer-events: none; cursor: default; }
.obj-item.obj-done span { text-decoration: line-through; color: var(--text-4); }
.obj-item.obj-done .obj-check-icon { background: var(--success); border-color: var(--success); opacity: 0.65; }
.obj-item.obj-done .obj-check-icon svg { display: block; }
.obj-head { cursor: pointer; user-select: none; border-top: none; }
.obj-head:hover { background: var(--surface-3); }

.agenda-list { flex: 1; overflow-y: auto; padding: 6px; }
.agenda-list::-webkit-scrollbar { width: 4px; }
.agenda-list::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 2px; }
.sb-timer { display: flex; align-items: center; gap: 6px; }
.sb-datetime-pill { font-size: 11px; font-variant-numeric: tabular-nums; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--brand); background: var(--brand-subtle); color: var(--brand); white-space: nowrap; font-weight: 500; }
.sb-elapsed-pill { font-variant-numeric: tabular-nums; font-weight: 500; font-size: 11px; padding: 3px 9px; border-radius: 999px; transition: background 0.4s, border-color 0.4s, color 0.4s; border: 1px solid; }
.sb-pill-green { background: rgba(22,163,74,0.2);  border-color: rgba(22,163,74,0.6);  color: var(--success); }
.sb-pill-amber { background: rgba(217,119,6,0.2);  border-color: rgba(217,119,6,0.6);  color: var(--warning); }
.sb-pill-red   { background: rgba(220,38,38,0.2);  border-color: rgba(220,38,38,0.6);  color: var(--danger); }

.a-item {
  padding: 8px 10px; border-radius: var(--radius);
  margin-bottom: 2px;
  border: 1px solid transparent; transition: all .15s;
}
.a-item:hover:not(.a-active) { background: var(--surface-2); }
.a-item.a-done   { opacity: .5; }
.a-item.a-active { background: var(--brand-subtle); border-color: var(--brand-border); }
.a-item .a-item-head { display: flex; align-items: flex-start; gap: 7px; }
.a-item-name { font-size: 12px; font-weight: 500; color: var(--text-1); line-height: 1.35; flex: 1; }
.a-item.a-done .a-item-name { text-decoration: line-through; color: var(--text-4); }
.a-item-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; padding-left: 21px; }
.a-item-type { font-size: 10px; color: var(--text-4); }

.check-icon {
  width: 14px; height: 14px; border-radius: 50%;
  border: 1.5px solid var(--border-2);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 1px; transition: all .15s;
}
.a-item.a-done .check-icon { background: var(--success); border-color: var(--success); }
.check-icon svg { width: 8px; height: 8px; stroke: #fff; fill: none; stroke-width: 2.5; stroke-linecap: round; display: none; }
.a-item.a-done .check-icon svg { display: block; }

/* Item timing row */
.a-item-timing { display: flex; align-items: center; gap: 5px; margin-top: 4px; padding-left: 21px; }
.a-item-timing.timing-pill { justify-content: center; padding-left: 0; margin-top: 6px; }
.a-item-alloc  { font-size: 10px; color: var(--text-4); font-variant-numeric: tabular-nums; }
.a-item-elapsed { font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; border-radius: 999px; padding: 4px 10px; border: 1px solid transparent; }
.elapsed-ok      { background: rgba(22,163,74,0.2);  color: var(--success); border-color: rgba(22,163,74,0.6); }
.elapsed-warn    { background: rgba(217,119,6,0.2);  color: var(--warning); border-color: rgba(217,119,6,0.6); }
.elapsed-over    { background: rgba(220,38,38,0.2);  color: var(--danger);  border-color: rgba(220,38,38,0.6); }
.elapsed-active  { background: rgba(22,163,74,0.2);  color: var(--success); border-color: rgba(22,163,74,0.6); }

/* ── CENTER: MAIN FEED ── */
.main { display: flex; flex-direction: column; overflow: hidden; background: var(--bg); min-height: 0; }

/* Feed header */
.feed-header { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px 4px; flex-shrink: 0; }
.feed-header-left  { display: flex; align-items: center; gap: 8px; }
.feed-title { font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text-4); }
.flag-counter {
  display: none; align-items: center; gap: 4px; font-size: 10px; font-weight: 700;
  color: var(--warning); background: var(--warning-subtle); border: 1px solid var(--warning-border);
  border-radius: 999px; padding: 1px 7px;
}
.flag-counter.show { display: flex; }
.flag-counter svg  { width: 10px; height: 10px; stroke: currentColor; fill: none; stroke-width: 2.5; stroke-linecap: round; }
.feed-header-right { display: flex; align-items: center; gap: 6px; }
.feed-ctrl-btn {
  font-size: 11px; color: var(--text-4); background: transparent;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 2px 8px; cursor: pointer; font-family: inherit; transition: all .15s;
}
.feed-ctrl-btn:hover  { color: var(--text-2); border-color: var(--border-2); }
.feed-ctrl-btn.active { color: var(--brand); border-color: var(--brand-border); background: var(--brand-subtle); }
.audio-btn {
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer; transition: all .15s; color: var(--text-4);
}
.audio-btn:hover { border-color: var(--border-2); color: var(--text-2); }
.audio-btn.on    { color: var(--brand); border-color: var(--brand-border); background: var(--brand-subtle); }
.audio-btn svg   { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }

/* Filter pills */
.feed-filters { display: flex; gap: 4px; padding: 0 12px 6px; flex-shrink: 0; flex-wrap: wrap; }
.filter-pill {
  font-size: 10px; font-weight: 600; padding: 2px 9px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-4);
  cursor: pointer; transition: all .15s; user-select: none;
}
.filter-pill:hover  { border-color: var(--border-2); color: var(--text-2); }
.filter-pill.active { background: var(--text-1); color: var(--surface); border-color: var(--text-1); }

/* Feed area */
.feed-area { flex: 1; overflow-y: auto; padding: 6px 12px 12px; display: flex; flex-direction: column; gap: 7px; min-height: 0; }
.feed-area::-webkit-scrollbar { width: 4px; }
.feed-area::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 2px; }

/* Empty state */
.feed-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 2rem; color: var(--text-4); gap: 10px; }
.feed-empty-icon { width: 44px; height: 44px; border: 1.5px solid var(--border); border-radius: var(--radius-lg); display: flex; align-items: center; justify-content: center; }
.feed-empty-icon svg { width: 20px; height: 20px; stroke: var(--text-4); fill: none; stroke-width: 1.5; stroke-linecap: round; }
.feed-empty p      { font-size: 12px; line-height: 1.6; max-width: 200px; }
.feed-empty strong { display: block; font-size: 13px; color: var(--text-3); font-weight: 600; margin-bottom: 4px; }

/* Feed cards */
@keyframes slideIn { from{opacity:0;transform:translateY(-8px);} to{opacity:1;transform:none;} }
.feed-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  animation: slideIn .2s ease; transition: opacity .2s, transform .2s;
  flex-shrink: 0;
}
.feed-card.dismissed { opacity: 0; transform: translateX(12px); pointer-events: none; }
.feed-card.fc-flag     { border-left: 3px solid var(--warning); }
.feed-card.fc-drift    { border-left: 3px solid var(--danger); }
.feed-card.fc-time     { border-left: 3px solid var(--purple); }
.feed-card.fc-redirect { 
  border: 1px solid var(--cf-border);
  background: var(--surface);
  position: relative;
}
.feed-card.fc-redirect::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--cf-gradient);
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
  z-index: 1;
}
.feed-card.fc-redirect .fc-inner {
  position: relative;
  z-index: 2;
}
.feed-card.fc-decision { border-left: 3px solid #0891b2; }
.feed-card.fc-action   { border-left: 3px solid var(--brand); }
.feed-card.fc-parked   { border-left: 3px solid var(--purple); }
.feed-card.fc-note     { border-left: 3px solid var(--border-2); }
.feed-card.fc-complete { border-left: 3px solid var(--success); }
.feed-card.fc-decision { border-left: 3px solid #0891b2; }
.feed-card.fc-note     { border-left: 3px solid var(--border-2); }
.feed-card.fc-complete { border-left: 3px solid var(--success); }

.fc-inner   { padding: 11px 13px 9px; }
.fc-top     { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.fc-label   { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; display: flex; align-items: center; gap: 5px; }
.fc-label svg { width: 11px; height: 11px; stroke: currentColor; fill: none; stroke-width: 2.5; stroke-linecap: round; flex-shrink: 0; }
.fc-label.lbl-flag     { color: var(--warning); }
.fc-label.lbl-drift    { color: var(--danger); }
.fc-label.lbl-time     { color: var(--purple); }
.fc-label.lbl-redirect { 
  color: #fff; 
  gap: 6px; 
  background: var(--cf-gradient);
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
  position: relative;
  z-index: 2;
}
.fc-label.lbl-redirect svg { 
  width: 18px; 
  height: 18px; 
  stroke: none;
  fill: #fff;
  flex-shrink: 0;
}
.fc-label.lbl-decision { color: #0891b2; }
.fc-label.lbl-action   { color: var(--brand); }
.fc-label.lbl-parked   { color: var(--purple); }
.fc-label.lbl-note     { color: var(--text-4); }
.fc-label.lbl-complete { color: var(--success); }
.fc-dismiss { width: 20px; height: 20px; border-radius: 50%; background: transparent; border: none; color: var(--text-4); cursor: pointer; font-size: 14px; line-height: 1; display: flex; align-items: center; justify-content: center; transition: all .15s; flex-shrink: 0; }
.fc-dismiss:hover { background: var(--surface-3); color: var(--text-2); }
.fc-text    { font-size: 13px; color: var(--text-1); line-height: 1.55; margin-bottom: 8px; }
.fc-redirect .fc-text { 
  font-style: italic; 
  color: var(--text-2); 
  background: var(--surface-2); 
  border-radius: var(--radius); 
  padding: 8px 10px; 
  border: 1px solid var(--border); 
  position: relative;
  z-index: 2;
}
.fc-footer  { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.fc-ts      { font-size: 10px; color: var(--text-4); }
.fc-actions { display: flex; gap: 5px; }
.fc-act-btn { font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-3); cursor: pointer; font-family: inherit; transition: all .15s; white-space: nowrap; }
.fc-act-btn.btn-park { color: var(--purple); border-color: var(--purple-border); background: var(--purple-subtle); }
.fc-act-btn.btn-copy { color: var(--brand);  border-color: var(--brand-border);  background: var(--brand-subtle); }
.fc-severity { font-size: 9px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 1px 6px; border-radius: 999px; margin-left: 6px; }

/* ── ACTION BAR ── */
.action-bar {
  border-top: 1px solid var(--border); padding: 8px 10px;
  background: var(--surface); display: flex; align-items: center;
  justify-content: space-between; flex-shrink: 0;
}
.action-bar-left  { display: flex; align-items: center; gap: 5px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.action-bar-left::-webkit-scrollbar { display: none; }
.action-bar-right { display: flex; align-items: center; flex-shrink: 0; padding-left: 12px; }
.action-bar::-webkit-scrollbar { display: none; }
.act-btn {
  display: flex; align-items: center; gap: 5px; padding: 6px 10px;
  border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text-2);
  font-family: inherit; font-size: 11px; font-weight: 600;
  cursor: pointer; transition: all .15s; white-space: nowrap; user-select: none;
}

.act-btn:hover  { border-color: var(--border-2); background: var(--surface-3); }
.act-btn:active { transform: scale(.97); }
.act-btn.btn-complete:hover  { border-color: var(--success-border); color: var(--success); background: var(--success-subtle); }
.act-btn.btn-flag:hover      { border-color: #fca5a5;               color: #dc2626;        background: #fef2f2; }
.act-btn.btn-parking:hover   { border-color: var(--purple-border);  color: var(--purple);  background: var(--purple-subtle); }
.act-btn.btn-action:hover    { border-color: var(--brand-border);   color: var(--brand);   background: var(--brand-subtle); }
.act-btn.btn-decision:hover  { border-color: #a5f3fc;               color: #0891b2;        background: #ecfeff; }
.act-btn.btn-timecheck:hover, 
.act-btn.btn-timecheck:active,
.act-btn.btn-timecheck.active { border-color: var(--yellow-border); color: var(--yellow); background: var(--yellow-subtle); }
.act-btn.btn-redirect:hover  { border-color: var(--brand-border);   color: var(--brand);   background: var(--brand-subtle); }
@keyframes btnFlash { 0%{transform:scale(1);} 40%{transform:scale(.93);} 70%{transform:scale(1.04);} 100%{transform:scale(1);} }
.act-btn.flashing { animation: btnFlash .25s ease; }

/* ── STT BAR ── */
.stt-bar {
  display: none; padding: 5px 12px;
  background: var(--danger-subtle); border-top: 1px solid var(--danger-border);
  align-items: center; gap: 8px; flex-shrink: 0;
}
.stt-bar.show { display: flex; }
.stt-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--danger); flex-shrink: 0; animation: blink 1.2s infinite; }
.stt-listening { font-size: 11px; font-weight: 600; color: var(--danger); }
.stt-interim   { font-size: 11px; color: var(--text-3); font-style: italic; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stt-lang-select { font-size: 11px; background: transparent; border: none; color: var(--text-3); font-family: inherit; cursor: pointer; outline: none; }

/* ── TRANSCRIPT PANEL ── */
.transcript-panel { flex-shrink: 0; max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.transcript-panel.open { max-height: 180px; }
.transcript-head { display: flex; align-items: center; padding: 6px 12px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--surface); position: relative; overflow: hidden; }
.transcript-head-left  { display: flex; align-items: center; flex-shrink: 0; z-index: 1; }
.transcript-head-center { position: absolute; left: 0; right: 0; top: 0; bottom: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.transcript-head-right { display: flex; align-items: center; flex-shrink: 0; margin-left: auto; z-index: 1; }
.transcript-head-label { font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text-4); display: flex; align-items: center; gap: 6px; }
.transcript-head-label span { font-weight: 400; text-transform: none; letter-spacing: 0; font-size: 10px; }
.transcript-controls { display: flex; align-items: center; gap: 6px; }

.sentiment-bar { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; transition: background 0.25s ease; }
.sentiment-bar span { font-size: 12px; font-weight: 600; letter-spacing: 0.02em; transition: color 0.25s ease; position: relative; z-index: 1; }
.sentiment-neutral  { background: linear-gradient(to right, transparent, rgba(107,122,141,0.18) 25%, rgba(107,122,141,0.18) 75%, transparent); }
.sentiment-neutral span  { color: var(--text-3); }
.sentiment-positive { background: linear-gradient(to right, transparent, rgba(22,163,74,0.2) 25%, rgba(22,163,74,0.2) 75%, transparent); }
.sentiment-positive span { color: var(--success); }
.sentiment-adrift   { background: linear-gradient(to right, transparent, rgba(217,119,6,0.2) 25%, rgba(217,119,6,0.2) 75%, transparent); }
.sentiment-adrift span   { color: var(--warning); }
.btn-transcript-clear { font-size: 11px; color: var(--text-4); background: transparent; border: none; cursor: pointer; padding: 2px 6px; border-radius: var(--radius-sm); transition: all .15s; font-family: inherit; }
.btn-transcript-clear:hover { color: var(--danger); background: var(--danger-subtle); }
.btn-transcript-toggle { font-size: 11px; color: var(--text-3); background: transparent; border: 1px solid var(--border); cursor: pointer; padding: 2px 8px; border-radius: var(--radius-sm); transition: all .15s; font-family: inherit; }
.transcript-scroll { overflow-y: auto; height: 140px; padding: 6px 12px; }
.transcript-scroll::-webkit-scrollbar { width: 4px; }
.transcript-scroll::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 2px; }
.transcript-line { display: flex; flex-direction: column; margin-bottom: 6px; font-size: 12px; line-height: 1.5; animation: slideIn .15s ease; border-top: 1px solid transparent; border-bottom: 1px solid transparent; border-radius: 3px; padding: 2px 4px; transition: background .12s, border-color .12s; }
.transcript-line:hover { background: var(--brand-subtle); border-top-color: var(--brand-border); border-bottom-color: var(--brand-border); }
.t-line-top { display: flex; gap: 8px; align-items: flex-start; }
.transcript-line:hover .t-capture-btns { opacity: 1; pointer-events: auto; }
.t-capture-btns { display: flex; gap: 4px; justify-content: flex-end; opacity: 0; pointer-events: none; transition: opacity .15s; margin-top: 4px; flex-wrap: wrap; }
.t-cap-btn { display: flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 999px; border: 1.5px solid var(--border-2); background: var(--surface-2); color: var(--text-2); cursor: pointer; font-family: inherit; transition: all .15s; white-space: nowrap; }

.t-cap-btn.tcb-action:hover   { border-color: var(--brand-border);   color: var(--brand);   background: var(--brand-subtle); }
.t-cap-btn.tcb-decision:hover { border-color: #a5f3fc;               color: #0891b2;        background: #ecfeff; }
.t-cap-btn.tcb-parking:hover  { border-color: var(--purple-border);  color: var(--purple);  background: var(--purple-subtle); }
.t-cap-btn.tcb-note:hover     { border-color: var(--border-2);       color: var(--text-2);  background: var(--surface-3); }
.t-cap-btn.tcb-flag:hover     { border-color: #fcd34d;               color: #d97706;        background: #fffbeb; }
.t-ts   { color: var(--text-4); font-size: 10px; white-space: nowrap; margin-top: 2px; font-variant-numeric: tabular-nums; }
.t-text { color: var(--text-1); flex: 1; }
.transcript-empty { font-size: 12px; color: var(--text-4); padding: 8px 0; text-align: center; }

/* ── INPUT BAR ── */
.input-bar { border-top: 1px solid var(--border); padding: 10px 12px; background: var(--surface); display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.input-bar input { flex: 1; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 7px 11px; font-family: inherit; font-size: 12px; color: var(--text-1); outline: none; transition: border-color .15s; }
.input-bar input::placeholder { color: var(--text-4); }
.input-bar input:focus { border-color: var(--brand); }

.mic-btn { width: 34px; height: 34px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface-2); color: var(--text-3); cursor: pointer; transition: all .15s; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.mic-btn:hover  { border-color: var(--brand); color: var(--brand); background: var(--brand-subtle); }
.mic-btn.mic-on { background: var(--danger-subtle); border-color: var(--danger-border); color: var(--danger); animation: mic-pulse 2s infinite; }
.mic-btn svg    { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@keyframes mic-pulse { 0%,100%{box-shadow:0 0 0 0 rgba(220,38,38,.3);} 50%{box-shadow:0 0 0 5px rgba(220,38,38,0);} }

.transcript-btn { width: 34px; height: 34px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface-2); color: var(--text-3); cursor: pointer; transition: all .15s; display: flex; align-items: center; justify-content: center; flex-shrink: 0; position: relative; }
.transcript-btn:hover  { border-color: var(--brand); color: var(--brand); background: var(--brand-subtle); }
.transcript-btn.active { border-color: var(--brand-border); color: var(--brand); background: var(--brand-subtle); }
.transcript-btn svg    { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }
.t-count-badge { position: absolute; top: -4px; right: -4px; width: 14px; height: 14px; background: var(--brand); color: #fff; border-radius: 999px; font-size: 9px; font-weight: 700; display: none; align-items: center; justify-content: center; }
.t-count-badge.show { display: flex; }

.send-btn { width: 34px; height: 34px; border-radius: var(--radius); border: none; background: var(--brand); color: #fff; cursor: pointer; transition: background .15s; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.send-btn:hover { background: var(--brand-hover); }
.send-btn svg   { width: 14px; height: 14px; stroke: #fff; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
[data-theme="dark"] .send-btn { background: #1A6BFF; }
[data-theme="dark"] .send-btn:hover { background: #0F55D4; }

/* ── RIGHT PANEL ── */
.right-panel { background: var(--surface); border-left: 1px solid var(--border); display: flex; flex-direction: column; overflow: hidden; min-height: 0; }
.rp-tabs { display: flex; flex-shrink: 0; }
.rp-tab { width: 105px; flex-shrink: 0; padding: 9px 4px; text-align: center; font-size: 11px; font-weight: 500; color: var(--text-3); cursor: pointer; background: var(--bg); border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); transition: color .15s, background .15s; user-select: none; display: flex; align-items: center; justify-content: center; gap: 5px; }
.rp-tab:last-child { border-right: none; }
.rp-tab:hover { color: var(--text-2); }
.rp-tab.active { background: var(--surface); border-bottom: 1px solid var(--surface); border-right: 1px solid var(--border); }
.rp-tab[data-rp="actions"].active   { color: var(--brand); }
.rp-tab[data-rp="decisions"].active { color: #0891b2; }
.rp-tab[data-rp="parking"].active   { color: var(--purple); }
.rp-tab[data-rp="notes"].active     { color: var(--text-2); }
.rp-tab .badge { display: none; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; font-size: 10px; font-weight: 700; color: #fff; }
.rp-tab .badge.show { display: inline-flex; }
.rp-tab[data-rp="actions"]   .badge { background: var(--brand); color: #fff; }
.rp-tab[data-rp="decisions"] .badge { background: #22d3ee; color: #fff; }
.rp-tab[data-rp="parking"]   .badge { background: var(--purple); color: #fff; }
.rp-tab[data-rp="notes"]     .badge { background: var(--text-3); color: #fff; }
.rp-panel { display: none; flex: 1; flex-direction: column; overflow: hidden; min-height: 0; }
.rp-panel.active { display: flex; }
.rp-list { flex: 1; overflow-y: auto; padding: 8px; }
.rp-list::-webkit-scrollbar { width: 4px; }
.rp-list::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 2px; }
.bucket-item { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 5px; font-size: 12px; animation: slideIn .15s ease; }
.bucket-dot  { width: 7px; height: 7px; border-radius: 50%; margin-top: 4px; flex-shrink: 0; }
.dot-decision { background: #0891b2; }
.dot-action  { background: var(--brand); }
.dot-parking { background: var(--purple); }
.dot-note    { background: var(--text-4); }
.bucket-text { flex: 1; color: var(--text-1); line-height: 1.4; }
.bucket-meta { font-size: 10px; color: var(--text-4); margin-top: 3px; }
.bucket-empty { padding: 2rem 1rem; text-align: center; font-size: 12px; color: var(--text-4); line-height: 1.6; }
.rp-footer { border-top: 1px solid var(--border); padding: 8px; flex-shrink: 0; }
.rp-add-input { width: 100%; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 7px 10px; font-family: inherit; font-size: 12px; color: var(--text-1); outline: none; transition: border-color .15s; }
.rp-add-input::placeholder { color: var(--text-4); }
.rp-add-input:focus { border-color: var(--brand); }

/* ── MODALS ── */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(15,25,40,.45); z-index: 200; align-items: center; justify-content: center; }
.modal-overlay.show { display: flex; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: var(--shadow); padding: 1.5rem; width: 100%; max-width: 360px; animation: modalIn .2s ease; }
@keyframes modalIn { from{opacity:0;transform:scale(.96);} to{opacity:1;transform:none;} }
.modal h3 { font-size: 16px; font-weight: 600; color: var(--text-1); margin-bottom: 6px; }
.modal p  { font-size: 13px; color: var(--text-3); margin-bottom: 1.25rem; line-height: 1.6; }
.modal-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn-modal-cancel  { padding: 9px; background: var(--surface-2); border: 1px solid var(--border-2); border-radius: var(--radius); font-family: inherit; font-size: 13px; font-weight: 500; color: var(--text-2); cursor: pointer; transition: all .15s; }
.btn-modal-confirm { padding: 9px; background: var(--danger); border: none; border-radius: var(--radius); font-family: inherit; font-size: 13px; font-weight: 600; color: #fff; cursor: pointer; transition: background .15s; }
.btn-modal-confirm:hover { background: #b91c1c; }

/* Capture sheet */
.capture-modal { display: none; position: fixed; inset: 0; background: rgba(15,25,40,.45); z-index: 200; align-items: flex-end; justify-content: center; }
.capture-modal.show { display: flex; }
.capture-sheet { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl) var(--radius-xl) 0 0; box-shadow: var(--shadow); width: 100%; max-width: 760px; padding: 1.25rem 1.5rem 1.5rem; animation: sheetUp .2s ease; }
@keyframes sheetUp { from{transform:translateY(40px);opacity:0;} to{transform:none;opacity:1;} }
.sheet-title { font-size: 14px; font-weight: 600; color: var(--text-1); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.sheet-title svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }
.sheet-input { width: 100%; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 9px 12px; font-family: inherit; font-size: 13px; color: var(--text-1); outline: none; transition: border-color .15s; margin-bottom: 10px; resize: none; min-height: 64px; line-height: 1.5; }
.sheet-input:focus { border-color: var(--brand); }
.sheet-btns    { display: flex; gap: 8px; justify-content: flex-end; }
.sheet-cancel  { padding: 7px 16px; background: var(--surface-2); border: 1px solid var(--border-2); border-radius: var(--radius); font-family: inherit; font-size: 12px; font-weight: 500; color: var(--text-2); cursor: pointer; transition: all .15s; }
.sheet-confirm { padding: 7px 16px; background: var(--brand); border: none; border-radius: var(--radius); font-family: inherit; font-size: 12px; font-weight: 600; color: #fff; cursor: pointer; transition: background .15s; }
.sheet-confirm:hover { background: var(--brand-hover); }

/* ── APP FOOTER ── */
.app-footer {
  position: fixed; bottom: 0; left: 0; right: 0; height: 36px;
  background: var(--surface); border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: var(--text-4); z-index: 150;
  letter-spacing: .01em; gap: 16px;
}
.app-footer a { color: var(--text-4); text-decoration: none; transition: color 0.2s; }
.app-footer a:visited { color: var(--text-4); }
.app-footer a:hover, .app-footer a:active { color: var(--text-2); }
[data-theme="dark"] .app-footer a:hover { color: var(--text-1); }
[data-theme="light"] .app-footer a:hover { color: var(--text-1); }

/* Time check toast */
.timecheck-toast { display: none; position: fixed; bottom: 100px; left: 300px; background: var(--yellow-subtle); border: 1px solid var(--yellow-border); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 12px 18px; z-index: 250; min-width: 280px; max-width: 400px; }
.timecheck-toast.show { display: block; }

/* ── TIME WARNING TOAST ── */
.time-warning-toast {
  position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--surface); border: 1px solid var(--warning); border-left: 3px solid var(--warning);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 14px 20px; z-index: 300;
  min-width: 320px; max-width: 450px; color: var(--text-1);
  opacity: 0; transition: opacity 0.3s ease, transform 0.3s ease;
}
.time-warning-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.time-warning-toast svg { color: var(--warning); flex-shrink: 0; }

/* ── DURATION ERROR TOAST ── */
.duration-error-toast {
  position: absolute; top: 0; left: calc(100% + 12px);
  background: var(--danger-subtle); border: 1px solid var(--danger-border);
  border-left: 3px solid var(--danger); border-radius: var(--radius);
  padding: 10px 14px; color: var(--danger); font-size: 13px;
  display: flex; align-items: center; gap: 8px; z-index: 100;
  box-shadow: var(--shadow); min-width: 270px; white-space: normal;
}
.duration-error-toast svg {
  width: 18px; height: 18px; flex-shrink: 0; stroke: var(--danger);
}

.toast-row  { display: flex; justify-content: space-between; align-items: baseline; padding: 4px 0; font-size: 13px; }
.toast-row.toast-row-stack { flex-direction: column; gap: 2px; }
.toast-row.toast-row-stack .toast-val { font-size: 13px; color: var(--text-1); font-weight: 600; }
.toast-key  { color: var(--text-3); font-size: 12px; }
.toast-val  { font-weight: 600; color: var(--text-1); }
.toast-val.ok   { color: var(--success); }
.toast-val.warn { color: var(--warning); }
.toast-val.over { color: var(--danger); }
.toast-close:hover { background: var(--surface-3); border-color: var(--brand); color: var(--brand); }
[data-theme="dark"] .toast-close:hover { background: rgba(26,107,255,0.12); border-color: var(--brand); color: #60a5fa; }

/* ═══════════════════════════════════════════
   REPORT SCREEN
═══════════════════════════════════════════ */
#report-screen { display: none; min-height: 100vh; background: var(--bg); align-items: flex-start; justify-content: center; padding: 2rem 1rem 4rem; }
#report-screen.active { display: flex; }
.rpt-wrapper { width: 100%; max-width: 800px; }

/* Report topbar uses shared .topbar class */
.rpt-btn-primary   { display: flex; align-items: center; gap: 5px; padding: 7px 16px; background: var(--brand); color: #fff; border: none; border-radius: var(--radius); font-family: inherit; font-size: 12px; font-weight: 600; cursor: pointer; transition: background .15s; }
.rpt-btn-primary:hover { background: var(--brand-hover); }
.rpt-btn-secondary { padding: 6px 14px; background: var(--surface); color: var(--text-2); border: 1px solid var(--border-2); border-radius: var(--radius); font-family: inherit; font-size: 12px; font-weight: 500; cursor: pointer; transition: all .15s; }
.rpt-btn-secondary:hover { border-color: var(--brand); color: var(--brand); }

.rpt-body { padding: 0.5rem 0 2rem; }
.rpt-hero { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 0.75rem; padding-bottom: 0; }
.rpt-hero-title { font-size: 22px; font-weight: 700; color: var(--text-1); letter-spacing: -.02em; margin-bottom: 5px; }
.rpt-hero-meta  { font-size: 13px; color: var(--text-3); margin-bottom: 2px; }
.rpt-grade-wrap { text-align: center; flex-shrink: 0; }
.rpt-title { font-size: 13px; font-weight: 700; color: var(--text-3); margin-bottom: 6px; text-align: center; letter-spacing: 0.04em; text-transform: uppercase; }
.rpt-grade { width: 64px; height: 64px; border-radius: var(--radius-lg); display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 800; margin: 0 auto 4px; }
.grade-a { background: var(--success-subtle); color: var(--success); border: 2px solid var(--success-border); }
.grade-b { background: var(--brand-subtle);   color: var(--brand);   border: 2px solid var(--brand-border); }
.grade-c { background: var(--warning-subtle); color: var(--warning); border: 2px solid var(--warning-border); }
.grade-d { background: var(--danger-subtle);  color: var(--danger);  border: 2px solid var(--danger-border); }
.rpt-grade-label { font-size: 14px; font-weight: 700; color: var(--text-2); text-align: center; }
.grade-a + .rpt-grade-label { color: var(--success); }
.grade-b + .rpt-grade-label { color: var(--brand); }
.grade-c + .rpt-grade-label { color: var(--warning); }
.grade-d + .rpt-grade-label { color: var(--danger); }

.rpt-section-label { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text-4); display: flex; align-items: center; gap: 8px; margin: 0.5rem 0 .75rem; }
.rpt-section-label::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.rpt-count { font-size: 10px; font-weight: 700; background: var(--surface-3); color: var(--text-3); border-radius: 999px; padding: 1px 7px; text-transform: none; letter-spacing: 0; }

.rpt-scorecard { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.sc-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 12px 14px; border-top: 3px solid var(--border); }
.sc-card.sc-ok   { border-top-color: var(--success); }
.sc-card.sc-warn { border-top-color: var(--warning); }
.sc-card.sc-over { border-top-color: var(--danger); }
.sc-label     { font-size: 11px; color: var(--text-3); margin-bottom: 5px; }
.sc-primary   { font-size: 20px; font-weight: 700; color: var(--text-1); letter-spacing: -.02em; margin-bottom: 2px; }
.sc-secondary { font-size: 11px; color: var(--text-4); }

.rpt-table-wrap { overflow-x: auto; }
.rpt-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rpt-table th { text-align: left; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-4); padding: 6px 10px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.rpt-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); color: var(--text-2); }
.rpt-table tr:last-child td { border-bottom: none; }
.rpt-table tbody tr:hover td { background: var(--surface-2); }
.rpt-num   { color: var(--text-4); font-size: 11px; width: 28px; }
.rpt-topic { color: var(--text-1); font-weight: 500; }
.rpt-type  { color: var(--text-4); font-size: 12px; }
.rpt-ok    { color: var(--success); font-weight: 600; }
.rpt-over  { color: var(--danger);  font-weight: 600; }

.rpt-badge  { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 999px; letter-spacing: .03em; }
.badge-done    { background: var(--success-subtle); color: var(--success); border: 1px solid var(--success-border); }
.badge-partial { background: var(--warning-subtle); color: var(--warning); border: 1px solid var(--warning-border); }
.badge-skipped { background: var(--surface-3);      color: var(--text-4);  border: 1px solid var(--border); }

.rpt-list-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.rpt-list-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--text-1); }
.rpt-list-item:last-child { border-bottom: none; }
.rpt-list-dot  { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; margin-top: 5px; }
.rpt-empty { font-size: 13px; color: var(--text-4); padding: 10px 0; font-style: italic; }

/* ── PRINT / PDF EXPORT ── */
/* ── FEEDBACK FORM — PRIORITY GRID ── */
.priority-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 4px;
}
.priority-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  background: var(--surface);
  transition: all .15s;
  user-select: none;
}
.priority-opt input { display: none; }
.priority-opt:hover { border-color: var(--border-2); background: var(--surface-2); }
.priority-opt.selected { background: var(--brand-subtle); border-color: var(--brand); color: var(--brand); font-weight: 600; }
.p-critical.selected { background: var(--danger-subtle); border-color: var(--danger); color: var(--danger); }
.p-high.selected    { background: #fff7ed; border-color: #fb923c; color: #ea580c; }
.p-medium.selected  { background: var(--yellow-subtle); border-color: var(--yellow-border); color: #a16207; }
.p-low.selected     { background: var(--success-subtle); border-color: var(--success-border); color: var(--success); }

/* ── FEEDBACK FORM — FIELD ERROR MESSAGE ── */
.error-msg {
  display: none;
  font-size: 12px;
  color: var(--danger);
  font-weight: 500;
  margin-top: 4px;
}
.field.has-error .error-msg { display: block; }

/* ── FEEDBACK FORM — REQ ASTERISK ── */
.req { color: var(--danger); margin-left: 2px; }

/* ── LEGAL PAGE CLASSES ── */
/* These are also defined inline in terms/privacy but kept here for completeness */
.legal-topbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.5rem;
}
.legal-wrapper { width: 100%; max-width: 720px; }
.legal-section { margin-bottom: 2rem; }
.legal-section h2 { font-size: 18px; font-weight: 700; color: var(--text-1); margin-bottom: .75rem; padding-bottom: .5rem; border-bottom: 1px solid var(--border); }
.legal-section h3 { font-size: 15px; font-weight: 600; color: var(--text-1); margin: 1.25rem 0 .5rem; }
.legal-section p  { font-size: 14px; color: var(--text-2); line-height: 1.75; margin-bottom: .75rem; }
.legal-section ul { padding-left: 1.25rem; margin-bottom: .75rem; }
.legal-section ul li { font-size: 14px; color: var(--text-2); line-height: 1.7; margin-bottom: .35rem; }
.legal-section a  { color: var(--brand); }
.legal-meta { display: grid; grid-template-columns: auto 1fr; gap: 4px 1.5rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 2rem; font-size: 13px; }
.legal-meta dt { font-weight: 600; color: var(--text-2); white-space: nowrap; }
.legal-meta dd  { color: var(--text-3); margin: 0; }
.section-divider { height: 1px; background: var(--border); margin: 3rem 0; }
.addendum-header { background: linear-gradient(135deg, #3569FC, #A991F6); border-radius: var(--radius-lg); padding: 2rem; margin: 2rem 0 1.5rem; color: #fff; }
.addendum-header h2 { font-size: 22px; font-weight: 700; margin-bottom: 4px; color: #fff; }
.addendum-header p  { font-size: 13px; color: rgba(255,255,255,.8); margin: 0; }
.callout { background: var(--brand-subtle); border: 1px solid var(--brand-border); border-left: 3px solid var(--brand); border-radius: var(--radius); padding: 1rem 1.25rem; margin: 1.5rem 0; }
.callout.warn  { background: #fffbeb; border-color: #fde68a; border-left-color: #d97706; }
.callout.green { background: var(--success-subtle); border-color: var(--success-border); border-left-color: var(--success); }
.callout-label { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text-3); margin-bottom: 6px; }
.callout p { font-size: 13px; color: var(--text-2); line-height: 1.65; margin: 0; }
.caps { font-size: 13px; font-weight: 500; color: var(--text-2); line-height: 1.7; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 1rem 0; }
.data-table th { text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-4); padding: 8px 12px; border-bottom: 2px solid var(--border); }
.data-table td { padding: 9px 12px; border-bottom: 1px solid var(--border); color: var(--text-2); font-size: 13px; }
.toc { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 2rem; }
.toc-label { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text-4); margin-bottom: .75rem; }
.toc ol { padding-left: 1.25rem; margin: 0; }
.toc ol li { font-size: 13px; margin-bottom: .3rem; }
[data-theme="dark"] .callout      { background: rgba(26,107,255,.08); border-color: rgba(26,107,255,.25); }
[data-theme="dark"] .callout.warn { background: rgba(217,119,6,.10); border-color: rgba(251,191,36,.20); border-left-color: #d97706; }
[data-theme="dark"] .callout.green{ background: rgba(22,163,74,.10); border-color: rgba(74,222,128,.20); border-left-color: #16a34a; }

@media print {
  /* Hide all screen-only chrome */
  .topbar,
  .setup-topbar,
  .cf-voice,
  .nav-bar,
  #dashboard,
  #welcome-screen,
  #setup-screen { display: none !important; }

  /* Reset body for clean print */
  body { background: #fff !important; color: #000 !important; }
  body[data-mode="report"] { min-height: unset; overflow: visible; }

  /* Full-width report body */
  .rpt-body { max-width: 100% !important; padding: 0 !important; margin: 0 !important; }

  /* Ensure content doesn't break awkwardly across pages */
  .rpt-hero, .rpt-scorecard, .rpt-table-wrap,
  .rpt-list-card, .rpt-section-label { page-break-inside: avoid; }

  /* Ensure links print as plain text */
  a { color: inherit !important; text-decoration: none !important; }

  /* Score cards side by side on paper */
  .rpt-scorecard { display: grid !important; grid-template-columns: repeat(4, 1fr) !important; }
}

/* ── FEEDBACK FORM STYLES ── */
.field { margin-bottom: 1.25rem; }
.field:last-child { margin-bottom: 0; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; letter-spacing: .01em; }
.field label .req { color: var(--danger); margin-left: 2px; }
.field input[type=text], .field input[type=number], .field input[type=email], .field textarea { width: 100%; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 9px 12px; font-family: inherit; font-size: 13px; color: var(--text-1); outline: none; transition: border-color .15s, box-shadow .15s; resize: vertical; }
.field input:hover, .field textarea:hover { border-color: var(--border-2); }
.field input:focus, .field textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(26,107,255,.1); }
.field textarea { min-height: 90px; line-height: 1.6; }
.field .hint { font-size: 11px; color: var(--text-4); margin-top: 4px; }
.radio-group, .radio-opt, .radio-opt:hover, .check-opt:hover { border-color: var(--border-2); }
.radio-opt.selected, .check-opt.selected { background: var(--brand-subtle); border-color: var(--brand-border); }
.radio-opt input, .check-opt input { accent-color: var(--brand); width: 14px; height: 14px; flex-shrink: 0; }
.radio-opt span, .check-opt span { font-size: 13px; color: var(--text-2); }
.radio-opt.selected span, .check-opt.selected span { color: var(--brand); font-weight: 500; }
.priority-opt:hover { border-color: var(--border-2); }
.priority-opt input { accent-color: var(--brand); width: 14px; height: 14px; flex-shrink: 0; }
.priority-opt span { font-size: 13px; color: var(--text-2); }
.priority-opt.p-critical.selected { background: #fef2f2; border-color: #fecaca; }
.priority-opt.p-critical.selected span { color: var(--danger); font-weight: 500; }
.priority-opt.p-high.selected { background: #fffbeb; border-color: #fde68a; }
.priority-opt.p-high.selected span { color: var(--warning); font-weight: 500; }
.priority-opt.p-medium.selected { background: var(--brand-subtle); border-color: var(--brand-border); }
.priority-opt.p-medium.selected span { color: var(--brand); font-weight: 500; }
.priority-opt.p-low.selected { background: var(--surface-2); border-color: var(--border-2); }
.priority-opt.p-low.selected span { color: var(--text-2); font-weight: 500; }
.divider { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text-4); display: flex; align-items: center; gap: 10px; margin: 1.5rem 0 1rem; }
.divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.btn-submit {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  height: 44px; padding: 0 20px;
  background: var(--brand); color: #fff;
  border: none; border-radius: var(--radius);
  font-size: 14px; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: background .15s;
  width: 100%;
}
.btn-submit:hover { background: #0F55D4; }
.btn-submit:visited { background: #1A6BFF; color: #fff; }
.btn-submit:active { background: #1A6BFF; color: #fff; }
.btn-submit:disabled { opacity: .5; cursor: not-allowed; }
.btn-submit svg { width: 16px; height: 16px; stroke: #fff; fill: none; stroke-width: 2; stroke-linecap: round; }
.success-card {
  display: none;
  flex-direction: column !important;
  align-items: center;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
}
.success-card.show { display: flex; }
.success-icon {
  width: 56px; height: 56px;
  min-width: 56px; min-height: 56px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--success-subtle);
  border: 2px solid var(--success-border);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1.25rem;
}
.success-icon svg { width: 22px; height: 22px; stroke: var(--success); fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.success-card h2 { font-size: 20px; font-weight: 700; color: var(--text-1); margin-bottom: 10px; }
.success-card p { font-size: 14px; color: var(--text-3); line-height: 1.65; margin-bottom: 1.75rem; max-width: 420px; margin-left: auto; margin-right: auto; }
/* Submit another — same weight as btn-submit, centered */
.btn-another {
  display: flex; align-items: center; justify-content: center;
  height: 44px; padding: 0 28px;
  background: var(--brand); color: #fff;
  border: none; border-radius: var(--radius);
  font-size: 14px; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: background .15s;
  margin: 0 auto; /* center it */
}
.btn-another:hover { background: #0F55D4; color: #fff; }
.field.has-error input, .field.has-error textarea { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(220,38,38,.1); }
.validation-banner {
  display: none;
  align-items: center;
  gap: 10px;
  background: var(--danger-subtle);
  border: 1px solid var(--danger-border);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 1rem;
}
.validation-banner.show { display: flex; }
.validation-banner-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--danger);
  flex: 1;
}
.field.has-error .validation-banner.show { display: block; }

/* ── ANIMATIONS ── */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ═══════════════════════════════════════════
   MOBILE LAYOUT — feature/mobile-poc
   Breakpoint: < 768px
   Strategy: accordion single-column, one
   section visible at a time. Desktop layout
   is completely untouched above this block.
═══════════════════════════════════════════ */

@media (max-width: 767px) {

  /* ── RESET DESKTOP LAYOUT ── */

  /* Dashboard fills viewport as a fixed flex column on mobile */
  #dashboard-screen.active {
    display: flex !important;
    flex-direction: column;
    height: 100vh !important;
    height: 100dvh !important; /* dynamic viewport on mobile browsers */
    overflow: hidden !important;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
  }

  body[data-mode="dashboard"] {
    overflow: hidden;
  }

  /* Hide the desktop layout grid entirely — accordion replaces it */
  .layout {
    display: none !important;
  }

  /* ── TOPBAR + NOW BAR — fixed at top, flex children handle spacing ── */

  /* ── TOPBAR — slim mobile version ── */
  /* Hide wordmark — icon + session name is enough on mobile */
  .topbar .brand-name { display: none; }

  /* Swap hamburger and Live pill: hamburger right, pill left of it */
  #status-pill { order: 2; }
  .mobile-hamburger { order: 3; }
  .topbar {
    padding: 0 12px;
    gap: 8px;
  }

  /* Hide desktop-only topbar elements */
  .topbar-divider,
  .sens-control,
  .btn-end-session,
  .topbar .theme-btn,
  .topbar a.theme-btn {
    display: none !important;
  }

  /* Session name stays, truncated */
  .meeting-info {
    flex: 1;
    min-width: 0;
  }
  .meeting-title {
    font-size: 13px;
  }
  .meeting-meta {
    display: none;
  }

  /* Hamburger button — shown on mobile */
  .mobile-hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    background: var(--surface-2);
    border: 1px solid var(--border);
    cursor: pointer;
    flex-shrink: 0;
  }
  .mobile-hamburger svg {
    width: 16px;
    height: 16px;
    stroke: var(--text-2);
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
  }

  /* ── STATUS PILL — keep visible in topbar ── */
  #status-pill {
    flex-shrink: 0;
  }

  /* ── HIDE DESKTOP STATUSBAR ── */
  /* The Now Bar replaces it on mobile */
  .statusbar {
    display: none;
  }

  /* ── NOW BAR ── */
  .now-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: var(--topbar-h);
    left: 0; right: 0;
    height: var(--now-bar-h, 36px);
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    padding: 0 12px;
    z-index: 90;
    gap: 8px;
  }
  .now-bar-item {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex: 1;
  }
  .now-bar-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--brand);
    flex-shrink: 0;
  }
  .now-bar-text {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .now-bar-timer {
    font-size: 11px;
    font-weight: 600;
    font-family: monospace;
    color: var(--brand);
    background: var(--brand-subtle);
    border: 1px solid var(--brand-border);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
  }
  .now-bar-timer.warn  { color: var(--warning); background: var(--warning-subtle); border-color: var(--warning-border); }
  .now-bar-timer.over  { color: var(--danger);  background: var(--danger-subtle);  border-color: var(--danger-border);  }

  /* ── HIDE DESKTOP SIDEBAR ── */
  .left-panel {
    display: none;
  }

  /* ── HIDE DESKTOP RIGHT PANEL ── */
  .right-panel,
  .transcript-panel,
  
  /* ── HIDE DESKTOP MAIN PANEL ELEMENTS ── */
  /* The .main column still exists in the grid but we hide
     all its children — the accordion replaces them on mobile */
  .feed-header,
  .feed-filters,
  .feed-area,
  .transcript-head,
  .action-bar,
  .input-bar {
    display: none !important;
  }

  /* Hide the main column itself so accordion gets full width */
  .main {
    display: none;
  }

  /* ── ACCORDION WRAPPER ── */
  /* Takes all remaining space between now bar and STT bar */
  .mobile-accordion {
    display: flex;
    flex-direction: column;
    width: 100%;
    flex: 1;
    overflow-y: auto;
    background: var(--bg);
    /* top offset = topbar + now bar */
    margin-top: calc(var(--topbar-h) + 36px);
  }

  /* ── ACCORDION SECTION ── */
  .acc-section {
    border-bottom: 1px solid var(--border);
    background: var(--surface);
  }

  /* Section header — always visible, tap to expand */
  .acc-header {
    display: flex;
    align-items: center;
    height: 48px;
    padding: 0 14px;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    background: var(--surface);
    transition: background .1s;
  }
  .acc-header:active {
    background: var(--surface-2);
  }
  .acc-section.open > .acc-header {
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
  }

  .acc-header-icon {
    width: 28px;
    height: 28px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }
  .acc-header-icon svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
  }
  .acc-icon-agenda      { background: var(--brand-subtle);   color: var(--brand); }
  .acc-icon-objectives  { background: var(--purple-subtle);  color: var(--purple); }
  .acc-icon-feed        { background: var(--danger-subtle);  color: var(--danger); }
  .acc-icon-transcript  { background: var(--success-subtle); color: var(--success); }

  .acc-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-1);
    flex: 1;
  }

  /* Badge — hidden by default, shown by JS when relevant */
  .acc-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    font-family: monospace;
    flex-shrink: 0;
    display: none;
  }
  .acc-badge:not(:empty) {
    display: inline-block;
  }
  /* Hide transcript badge when zero */
  #acc-badge-transcript:empty,
  #acc-badge-transcript[data-zero="true"] {
    display: none;
  }
  .badge-warn    { background: var(--warning-subtle); color: var(--warning); border: 1px solid var(--warning-border); }
  .badge-danger  { background: var(--danger-subtle);  color: var(--danger);  border: 1px solid var(--danger-border); }
  .badge-neutral { background: var(--surface-3);      color: var(--text-3);  border: 1px solid var(--border); }
  .badge-success { background: var(--success-subtle); color: var(--success); border: 1px solid var(--success-border); }

  /* Chevron */
  .acc-chevron {
    width: 16px;
    height: 16px;
    stroke: var(--text-4);
    fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
    flex-shrink: 0;
    transition: transform 150ms ease;
  }
  .acc-section.open > .acc-header .acc-chevron {
    transform: rotate(180deg);
  }

  /* Section body — animated with grid-template-rows trick (Safari 16+)
     Safari <16 fallback: max-height transition — no animation, but opens/closes correctly */
  .acc-body {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 280ms cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--surface);
    will-change: grid-template-rows;
    /* Safari <16 fallback */
    max-height: 0;
    overflow: hidden;
  }
  .acc-body-inner {
    overflow: hidden;
    min-height: 0; /* critical — allows grid to collapse to 0 */
    display: flex;
    flex-direction: column;
  }
  .acc-section.open > .acc-body {
    grid-template-rows: 1fr;
    /* Safari <16 fallback */
    max-height: 55vh;
  }
  .acc-section.open > .acc-body .acc-body-inner {
    overflow-y: auto;
    max-height: 55vh;
  }
  /* Empty states — padding only, NO min-height — prevents open animation jerk */
  .acc-body-inner .feed-empty,
  .acc-body-inner .transcript-empty,
  .acc-body-inner .agenda-list:empty,
  .acc-body-inner .obj-list:empty {
    padding: 24px 16px;
  }
  .acc-body .feed-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    text-align: center;
    /* NO min-height — was causing open animation jerk */
  }
  .acc-body .feed-empty-icon { margin-bottom: 10px; }
  .acc-body .feed-empty strong {
    font-size: 13px;
    color: var(--text-2);
    display: block;
    margin-bottom: 4px;
  }
  .acc-body .feed-empty p {
    font-size: 11px;
    color: var(--text-4);
    line-height: 1.5;
  }

  /* ── MAIN FEED AREA — full width on mobile ── */
  .main {
    width: 100%;
    flex: 1;
    min-height: 0;
    border: none;
  }

  /* Feed header — simplified */
  .feed-header {
    padding: 8px 12px;
  }
  .feed-header-right .audio-btn,
  .feed-header-right .feed-ctrl-btn {
    font-size: 11px;
    padding: 4px 8px;
  }

  /* Feed cards — bigger tap targets */
  .feed-card {
    padding: 10px 12px;
  }

  /* ── STT BAR — pinned to bottom as flex child ── */
  .stt-bar,
  .stt-bar.show {
    display: flex !important;
    position: relative !important;
    height: 52px !important;
    min-height: 52px !important;
    flex-shrink: 0;
    width: 100%;
    padding: 0 14px;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    box-sizing: border-box;
    z-index: auto;
  }

  /* ── MOBILE STT BAR — flex child, always visible ── */
  .mobile-stt-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 52px;
    flex-shrink: 0;
    padding: 0 14px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    width: 100%;
  }
  /* Reuse desktop stt-bar child styles */
  .mobile-stt-bar .stt-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--danger); flex-shrink: 0;
    animation: blink 1.2s infinite;
  }
  .mobile-stt-bar .stt-listening {
    font-size: 11px; font-weight: 600; color: var(--danger);
  }
  .mobile-stt-bar .stt-interim {
    font-size: 11px; color: var(--text-3); font-style: italic;
    flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .mobile-stt-bar .stt-lang-select {
    font-size: 11px; background: transparent; border: none;
    color: var(--text-3); font-family: inherit; cursor: pointer; outline: none;
  }

  /* ── MOBILE TRANSCRIPT LINES ── */
  .mobile-t-line {
    border-bottom: 1px solid var(--border);
  }
  .mobile-t-line:last-child { border-bottom: none; }

  .mobile-t-line-main {
    display: flex;
    align-items: flex-start;
    padding: 9px 14px;
    gap: 7px;
    cursor: pointer;
    user-select: none;
    transition: background .1s;
  }
  .mobile-t-line-main:active,
  .mobile-t-line.expanded .mobile-t-line-main {
    background: var(--surface-2);
  }
  .mobile-t-ts {
    font-size: 10px;
    color: var(--text-4);
    flex-shrink: 0;
    margin-top: 1px;
    font-family: monospace;
  }
  .mobile-t-text {
    font-size: 12px;
    color: var(--text-2);
    flex: 1;
    line-height: 1.45;
  }
  .mobile-t-chevron {
    font-size: 14px;
    color: var(--text-4);
    flex-shrink: 0;
    transition: transform .15s ease;
    margin-top: -1px;
  }

  /* Action buttons row */
  .mobile-t-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 6px 14px 10px;
    background: var(--surface-2);
    border-top: 1px solid var(--border);
  }
  .mobile-t-btn {
    height: 32px;
    padding: 0 10px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-2);
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    transition: all .1s;
  }
  .mobile-t-btn:active {
    background: var(--brand-subtle);
    border-color: var(--brand-border);
    color: var(--brand);
  }
  /* Match desktop transcript capture button colors — all CSS variables, theme-aware */
  .mobile-t-flag     { color: var(--warning);  border-color: var(--warning-border); background: var(--warning-subtle); }
  .mobile-t-action   { color: var(--brand);    border-color: var(--brand-border);   background: var(--brand-subtle); }
  .mobile-t-decision { color: var(--teal);     border-color: var(--teal-border);    background: var(--teal-subtle); }
  .mobile-t-parking  { color: var(--purple);   border-color: var(--purple-border);  background: var(--purple-subtle); }
  .mobile-t-note     { color: var(--text-2);   border-color: var(--border-2);       background: var(--surface-3); }

  /* ── MOBILE MIC TOGGLE BUTTON ── */
  .mobile-mic-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--brand-subtle);
    border: 1.5px solid var(--brand-border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all .15s;
  }
  .mobile-mic-btn:active {
    opacity: .8;
    transform: scale(.95);
  }
  .mobile-mic-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-3);
    flex: 1;
  }
  /* Interim text shown when mic is active */
  .mobile-stt-bar .stt-interim {
    font-size: 11px;
    color: var(--text-3);
    font-style: italic;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* ── HAMBURGER MENU OVERLAY ── */
  .mobile-menu {
    position: fixed;
    inset: 0;
    background: rgba(14,25,39,.96);
    z-index: 200;
    flex-direction: column;
    display: flex;
    /* Slide up and out by default */
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 280ms cubic-bezier(0.4, 0, 0.2, 1),
                opacity   200ms ease;
  }
  .mobile-menu.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
  }
  .mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,.08);
  }
  .mobile-menu-title {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255,255,255,.9);
  }
  .mobile-menu-close {
    width: 32px;
    height: 32px;
    border-radius: var(--radius);
    background: rgba(255,255,255,.08);
    border: none;
    color: rgba(255,255,255,.6);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .mobile-menu-items {
    flex: 1;
    padding: 8px 0;
    overflow-y: auto;
  }
  .mobile-menu-item {
    display: flex;
    align-items: center;
    padding: 13px 20px;
    gap: 14px;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
  }
  .mobile-menu-item:active {
    background: rgba(255,255,255,.04);
  }
  .mobile-menu-item-icon {
    width: 34px;
    height: 34px;
    border-radius: var(--radius);
    background: rgba(255,255,255,.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
  }
  .mobile-menu-item-label {
    font-size: 14px;
    color: rgba(255,255,255,.8);
    flex: 1;
  }
  .mobile-menu-divider {
    height: 1px;
    background: rgba(255,255,255,.06);
    margin: 4px 0;
  }
  /* Sensitivity segmented control in menu */
  .mobile-sens-wrap {
    padding: 12px 20px 16px;
    border-top: 1px solid rgba(255,255,255,.08);
  }
  .mobile-sens-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: rgba(255,255,255,.4);
    margin-bottom: 8px;
  }
  .mobile-sens-seg {
    display: flex;
    background: rgba(255,255,255,.06);
    border-radius: var(--radius);
    padding: 3px;
    gap: 3px;
  }
  .mobile-sens-opt {
    flex: 1;
    height: 32px;
    border-radius: var(--radius-sm);
    border: none;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255,255,255,.4);
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    transition: all .15s;
  }
  .mobile-sens-opt.active {
    background: var(--brand);
    color: white;
  }
  /* End session in menu */
  .mobile-menu-end {
    margin: 0 20px 28px;
    height: 48px;
    border-radius: var(--radius);
    background: var(--danger-subtle);
    border: 1.5px solid var(--danger-border);
    color: var(--danger);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background .15s, border-color .15s;
  }
  .mobile-menu-end:active {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
  }
  .mobile-menu-end svg {
    width: 15px;
    height: 15px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    flex-shrink: 0;
  }

  /* ── REPORT SCREEN — mobile ── */
  #report-screen {
    padding: 1rem 0.75rem 2rem;
    align-items: stretch;
  }
  .rpt-body { width: 100%; }
  .rpt-scorecard {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .rpt-tabs {
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  .rpt-hero { padding: 1.5rem 1rem; }
  .rpt-grade {
    font-size: 28px; /* reset — desktop 24px was fine, mobile just needs box to fit */
    width: 56px;
    height: 56px;
  }

  /* ── SETUP SCREEN — mobile ── */
  #setup-screen { padding: 1rem 0.75rem 3rem; }
  .setup-topbar { margin-bottom: 1rem; }
  .setup-wrapper { max-width: 100%; }
  /* Make tab labels smaller on mobile */
  .tab-nav { gap: 0; }
  .tab-btn { font-size: 12px; padding: 8px 10px; }
  /* Form fields full width */
  .form-row { flex-direction: column; gap: 0; }
  .field { margin-bottom: 12px; }
  /* Launch button full width */
  .launch-btn { width: 100%; }

} /* end @media (max-width: 767px) */

/* ── MOBILE-ONLY ELEMENTS (hidden on desktop) ── */
/* Hide on desktop only — shown inside @media (max-width: 767px) above */
@media (min-width: 768px) {
  .mobile-hamburger,
  .now-bar,
  .mobile-accordion,
  .mobile-menu,
  .mobile-stt-bar {
    display: none !important;
  }
}


/* ════════════════════════════════════════════════════════
   TOOLTIP SYSTEM — floating body-level div, desktop only
   Pseudo-elements can't escape overflow:hidden parents,
   so we use a single shared #undrift-tooltip div on <body>
   ════════════════════════════════════════════════════════ */

#undrift-tooltip {
  position: fixed;
  z-index: 99999;
  pointer-events: none;
  max-width: 220px;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 11.5px;
  font-family: inherit;
  line-height: 1.45;
  text-align: center;
  white-space: normal;
  word-break: normal;
  opacity: 0;
  transition: opacity 0.13s ease, transform 0.13s ease;
  background: #111c2d;
  color: #e2e8f0;
  box-shadow: 0 4px 16px rgba(0,0,0,0.28), 0 1px 4px rgba(0,0,0,0.14);
}
#undrift-tooltip.tip-visible {
  opacity: 1;
}
/* Arrow pseudo — position tracks element center via JS-set --arrow-left */
#undrift-tooltip::before {
  content: '';
  position: absolute;
  left: var(--arrow-left, 50%);
  transform: translateX(-50%);
  border: 5px solid transparent;
}
#undrift-tooltip.tip-above::before {
  top: 100%;
  border-top-color: #111c2d;
}
#undrift-tooltip.tip-below::before {
  bottom: 100%;
  border-bottom-color: #111c2d;
}
/* Light theme */
[data-theme="light"] #undrift-tooltip {
  background: #1e293b;
  color: #f1f5f9;
}
[data-theme="light"] #undrift-tooltip.tip-above::before { border-top-color: #1e293b; }
[data-theme="light"] #undrift-tooltip.tip-below::before { border-bottom-color: #1e293b; }

/* Hide on mobile/tablet */
@media (max-width: 1024px) {
  #undrift-tooltip { display: none !important; }
}
