/* ═══════════════════════════════════════════════════════════════════
   Transcript Vault — Premium UI Stylesheet
   Dark editorial theme with warm amber accents, glass cards, and
   deliberate typographic hierarchy. No emoji icons, no purple gradients.
   ═══════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600&display=swap');

:root {
  --bg-base: #13110f;
  --bg-surface: #1c1916;
  --bg-elevated: #25201c;
  --bg-hover: #2e2823;
  --bg-glass: rgba(28, 25, 22, 0.72);

  --text-primary: #f5f1eb;
  --text-secondary: #b3a89e;
  --text-muted: #7a6f64;
  --text-faint: #504841;

  --accent: #e8a849;
  --accent-soft: rgba(232, 168, 73, 0.15);
  --accent-glow: rgba(232, 168, 73, 0.30);
  --accent-dim: #b8842a;

  --danger: #e85d5d;
  --danger-soft: rgba(232, 93, 93, 0.12);
  --success: #6db870;
  --success-soft: rgba(109, 184, 112, 0.12);
  --info: #6db4e8;
  --info-soft: rgba(109, 180, 232, 0.12);
  --warning: #e8c449;
  --warning-soft: rgba(232, 196, 73, 0.12);

  --border: rgba(245, 241, 235, 0.08);
  --border-strong: rgba(245, 241, 235, 0.16);
  --border-accent: rgba(232, 168, 73, 0.25);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 22px;

  --shadow-soft: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.40);
  --shadow-glow: 0 0 24px var(--accent-soft);

  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-med: 280ms cubic-bezier(0.4, 0, 0.2, 1);

  /* System font stack that looks great even without web fonts.
     Inter is listed first so it loads if available; otherwise
     SF Pro / Segoe / Roboto / system-ui cover every major OS. */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display',
               'SF Pro Text', system-ui, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-serif: 'Fraunces', 'New York', 'Iowan Old Style', 'Apple Garamond',
                Georgia, 'Times New Roman', serif;

  --max-w: 1440px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
*::selection { background: var(--accent-soft); color: var(--accent); }

html { color-scheme: dark; -webkit-font-smoothing: antialiased; scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 15px;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Background texture — subtle grain + radial accent */
body::before {
  content: '';
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse 800px 600px at 20% -5%, rgba(232, 168, 73, 0.06), transparent 60%),
    radial-gradient(ellipse 600px 400px at 85% 10%, rgba(109, 180, 232, 0.04), transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* ─── Layout Shell ─────────────────────────────────────────────────── */

.app {
  display: grid;
  grid-template-columns: 320px 1fr;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ─── Sidebar ──────────────────────────────────────────────────────── */

.sidebar {
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}

.sidebar__brand {
  padding: 22px 24px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.brand-mark {
  width: 38px; height: 38px;
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, var(--accent), var(--accent-dim));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 18px;
  color: var(--bg-base);
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-title {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}
.brand-sub {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-top: 1px;
}

.sidebar__section {
  padding: 16px 20px 8px;
}
.sidebar__label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-faint);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar__label .count {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0;
  background: var(--bg-elevated);
  padding: 2px 8px;
  border-radius: 20px;
  color: var(--text-secondary);
}

.transcript-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 12px 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
.transcript-list::-webkit-scrollbar { width: 6px; }
.transcript-list::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }

.transcript-item {
  padding: 14px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-fast);
  margin-bottom: 4px;
  position: relative;
}
.transcript-item:hover { background: var(--bg-elevated); }
.transcript-item--active {
  background: var(--bg-elevated);
}
.transcript-item--active::before {
  content: '';
  position: absolute;
  left: 0; top: 14px; bottom: 14px;
  width: 3px;
  background: var(--accent);
  border-radius: 2px;
}

.ti-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.35;
  margin-bottom: 5px;
}
.ti-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 11px;
  color: var(--text-muted);
}
.ti-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-faint); flex-shrink: 0; }
.ti-source { font-style: italic; color: var(--text-faint); font-size: 10px; }

.sidebar__footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: var(--text-muted);
}
.sidebar__footer .pulse {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } }

/* ─── Main Content ─────────────────────────────────────────────────── */

.main {
  overflow-y: auto;
  height: 100vh;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
.main::-webkit-scrollbar { width: 8px; }
.main::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }

/* Top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 18px 32px 14px;
}

.topbar__row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}
.topbar__title-block { min-width: 0; flex: 1; }
.topbar__breadcrumb {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-faint);
  margin-bottom: 6px;
}
.topbar__title {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  line-height: 1.25;
}
.topbar__subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 5px;
  display: flex; gap: 12px; align-items: center;
}
.topbar__subtitle .chip-source {
  font-style: italic;
}

/* Search bar */
.search-wrap {
  position: relative;
  width: 340px;
  flex-shrink: 0;
}
.search-input {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 9px 16px 9px 38px;
  color: var(--text-primary);
  font-size: 13px;
  font-family: var(--font-sans);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.search-input:focus {
  outline: none;
  border-color: var(--border-accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.search-input::placeholder { color: var(--text-faint); }
.search-icon {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 2px;
  margin-top: 16px;
  border-bottom: 1px solid var(--border);
}
.tab {
  padding: 10px 18px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
  transition: color var(--transition-fast);
  background: none;
  border: none;
  font-family: var(--font-sans);
  display: flex;
  align-items: center;
  gap: 8px;
}
.tab:hover { color: var(--text-secondary); }
.tab--active { color: var(--text-primary); }
.tab--active::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px 2px 0 0;
}
.tab .tab-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 10px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  letter-spacing: 0;
}
.tab--active .tab-badge { background: var(--accent-soft); color: var(--accent); }

/* Content padding */
.content { padding: 28px 32px 80px; max-width: var(--max-w); }

/* ─── Stats Strip ──────────────────────────────────────────────────── */

.stats-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 28px;
}
.stat-cell {
  background: var(--bg-surface);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-value {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.stat-value--accent { color: var(--accent); }
.stat-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-faint);
}

/* ─── Cards ────────────────────────────────────────────────────────── */

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.card__header {
  padding: 18px 22px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border);
}
.card__title {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}
.card__body { padding: 20px 22px; }
.card + .card { margin-top: 20px; }

/* ─── Summary Tab ──────────────────────────────────────────────────── */

.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 1100px) { .summary-grid { grid-template-columns: 1fr; } }

.summary-prose {
  font-size: 14px;
  line-height: 1.75;
  color: var(--text-secondary);
}
.summary-prose h1, .summary-prose h2, .summary-prose h3 {
  font-family: var(--font-serif);
  color: var(--text-primary);
  font-weight: 500;
  margin-top: 28px;
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}
.summary-prose h1 { font-size: 20px; }
.summary-prose h2 { font-size: 17px; }
.summary-prose h3 { font-size: 15px; }
.summary-prose h1:first-child, .summary-prose h2:first-child { margin-top: 0; }
.summary-prose p { margin-bottom: 12px; }
.summary-prose ul { list-style: none; padding: 0; margin: 8px 0 12px; }
.summary-prose li {
  padding-left: 18px;
  position: relative;
  margin-bottom: 6px;
}
.summary-prose li::before {
  content: '';
  position: absolute;
  left: 0; top: 11px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.6;
}
.summary-prose strong { color: var(--text-primary); font-weight: 600; }
.summary-prose em { color: var(--accent); font-style: italic; }
.summary-prose code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 12px;
  background: var(--bg-elevated);
  padding: 2px 6px;
  border-radius: 4px;
}
.summary-prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 13px;
}
.summary-prose th, .summary-prose td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.summary-prose th {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.summary-prose td { color: var(--text-secondary); }
.summary-prose hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 24px 0;
}

/* Theme pulse section */
.theme-rail { display: flex; flex-direction: column; gap: 12px; }
.theme-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}
.theme-card:hover {
  border-color: var(--border-accent);
  background: var(--bg-hover);
}
.theme-card__head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
}
.theme-card__num {
  font-family: var(--font-serif);
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
}
.theme-card__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}
.theme-card__freq {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.theme-card__body {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ─── Leads Tab ────────────────────────────────────────────────────── */

.leads-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.filter-chip {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex; align-items: center; gap: 6px;
  font-family: var(--font-sans);
}
.filter-chip:hover { color: var(--text-secondary); border-color: var(--border-strong); }
.filter-chip--active {
  background: var(--accent-soft);
  border-color: var(--border-accent);
  color: var(--accent);
}
.filter-chip__count {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-faint);
}
.filter-chip--active .filter-chip__count { color: var(--accent-dim); }

.lead-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px;
}

.lead-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  transition: border-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
  display: flex;
  flex-direction: column;
}
.lead-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-card);
  transform: translateY(-1px);
}

.lead-card__top {
  padding: 16px 18px 14px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}
.lead-id-block { min-width: 0; flex: 1; }
.lead-name {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  line-height: 1.2;
}
.lead-lead-name {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.lead-badges {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.badge {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 9px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.badge--urgent  { background: var(--danger-soft);  color: var(--danger); }
.badge--high    { background: var(--accent-soft);  color: var(--accent); }
.badge--medium  { background: var(--info-soft);    color: var(--info); }
.badge--low     { background: rgba(122,111,100,0.15); color: var(--text-muted); }
.badge--booked   { background: var(--success-soft); color: var(--success); }
.badge--potential{ background: var(--warning-soft);  color: var(--warning); }
.badge--cool     { background: rgba(122,111,100,0.10); color: var(--text-faint); }
.badge--won-auction { background: var(--accent-soft); color: var(--accent); border: 1px solid var(--border-accent); }

.lead-card__body {
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.lead-row {
  display: flex;
  gap: 8px;
  font-size: 12px;
  align-items: baseline;
}
.lead-row__label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  width: 64px;
  flex-shrink: 0;
  padding-top: 1px;
}
.lead-row__value {
  color: var(--text-secondary);
  font-size: 12.5px;
  line-height: 1.5;
}
.lead-row__value--price {
  font-family: var(--font-serif);
  font-size: 15px;
  color: var(--accent);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.lead-row__value--price-low { color: var(--text-muted); font-size: 13px; }

.lead-tags { display: flex; gap: 5px; flex-wrap: wrap; padding-top: 4px; }
.tag {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 8px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.lead-card__footer {
  padding: 12px 18px;
  background: rgba(0,0,0,0.18);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.lead-next-action {
  font-size: 11.5px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1; min-width: 0;
}
.lead-next-action::before {
  content: '→';
  color: var(--accent);
  font-weight: 600;
  flex-shrink: 0;
}
.lead-edit-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--font-sans);
  white-space: nowrap;
}
.lead-edit-btn:hover { color: var(--accent); border-color: var(--border-accent); }

/* ─── Editor Modal ─────────────────────────────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 40px;
  opacity: 0;
  transition: opacity var(--transition-med);
}
.modal-overlay--open { display: flex; opacity: 1; }

.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 580px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-card);
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
.modal::-webkit-scrollbar { width: 6px; }
.modal::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }

.modal__header {
  padding: 22px 26px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal__title {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.modal__close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast), background var(--transition-fast);
}
.modal__close:hover { color: var(--text-primary); background: var(--bg-elevated); }

.modal__body { padding: 22px 26px; }

.field-group { margin-bottom: 18px; }
.field-group:last-child { margin-bottom: 0; }
.field-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-faint);
  margin-bottom: 6px;
  display: block;
}
.field-input, .field-select, .field-textarea {
  width: 100%;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 13px;
  font-family: var(--font-sans);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.field-input:focus, .field-select:focus, .field-textarea:focus {
  outline: none;
  border-color: var(--border-accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field-textarea {
  resize: vertical;
  min-height: 72px;
  line-height: 1.5;
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.modal__footer {
  padding: 16px 26px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.btn {
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  font-family: var(--font-sans);
  transition: all var(--transition-fast);
}
.btn--ghost {
  background: none;
  border-color: var(--border);
  color: var(--text-muted);
}
.btn--ghost:hover { color: var(--text-primary); border-color: var(--border-strong); }
.btn--primary {
  background: var(--accent);
  color: var(--bg-base);
  font-weight: 600;
}
.btn--primary:hover { background: var(--accent-dim); }
.btn--danger {
  background: none;
  border-color: var(--danger-soft);
  color: var(--danger);
}
.btn--danger:hover { background: var(--danger-soft); }

.save-status {
  font-size: 11px;
  color: var(--text-faint);
  font-style: italic;
}
.save-status--ok { color: var(--success); font-style: normal; }
.save-status--saving { color: var(--warning); }
.save-status--err { color: var(--danger); }

/* ─── Notes Tab ────────────────────────────────────────────────────── */

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

.note-item {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--text-faint);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color var(--transition-fast);
}
.note-item:hover { border-color: var(--border-strong); }
.note-item--strategy   { border-left-color: var(--info); }
.note-item--finding    { border-left-color: var(--accent); }
.note-item--decision   { border-left-color: var(--success); }
.note-item--action     { border-left-color: var(--warning); }
.note-item--risk       { border-left-color: var(--danger); }
.note-item--observation{ border-left-color: var(--text-faint); }

.note-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.note-type-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}
.note-actions { display: flex; gap: 6px; }
.note-mini-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 3px 8px;
  font-size: 10px;
  color: var(--text-muted);
  cursor: pointer;
  font-family: var(--font-sans);
  transition: all var(--transition-fast);
}
.note-mini-btn:hover { color: var(--text-primary); border-color: var(--border-strong); }
.note-mini-btn--del:hover { color: var(--danger); border-color: var(--danger-soft); }

.note-content {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.65;
  white-space: pre-wrap;
}
.note-content[contenteditable="true"] {
  outline: none;
  border-bottom: 1px dashed var(--accent);
  padding-bottom: 2px;
}

/* ─── Transcript Tab ───────────────────────────────────────────────── */

.transcript-viewer {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  font-size: 14px;
  line-height: 1.85;
  color: var(--text-secondary);
  font-family: var(--font-serif);
  letter-spacing: 0.005em;
  max-height: 70vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
.transcript-viewer::-webkit-scrollbar { width: 6px; }
.transcript-viewer::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }

.chunk {
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px dashed var(--border);
  position: relative;
}
.chunk:last-child { border-bottom: none; }
.chunk__num {
  position: absolute;
  left: -8px; top: 0;
  transform: translateX(-100%);
  font-size: 10px;
  font-weight: 600;
  color: var(--text-faint);
  font-family: var(--font-sans);
  letter-spacing: 0.1em;
  padding-top: 4px;
}
.chunk__text { color: var(--text-secondary); }
.chunk__text mark { background: var(--accent-soft); color: var(--accent); padding: 1px 3px; border-radius: 3px; }

.chunk-nav {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ─── AI Chat Tab ──────────────────────────────────────────────────── */

.chat-wrap {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 720px;
}
.chat-messages { display: flex; flex-direction: column; gap: 14px; }
.chat-msg {
  max-width: 85%;
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  font-size: 13px;
  line-height: 1.65;
}
.chat-msg--user {
  align-self: flex-end;
  background: var(--accent-soft);
  border: 1px solid var(--border-accent);
  color: var(--text-primary);
}
.chat-msg--ai {
  align-self: flex-start;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.chat-msg--ai strong { color: var(--text-primary); }

.chat-input-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
.chat-input {
  flex: 1;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: var(--text-primary);
  font-size: 13px;
  font-family: var(--font-sans);
  resize: vertical;
  min-height: 44px;
  max-height: 120px;
}
.chat-input:focus {
  outline: none;
  border-color: var(--border-accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.chat-send {
  background: var(--accent);
  color: var(--bg-base);
  border: none;
  border-radius: var(--radius-md);
  padding: 0 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  height: 44px;
  transition: background var(--transition-fast);
  font-family: var(--font-sans);
}
.chat-send:hover { background: var(--accent-dim); }
.chat-send:disabled { opacity: 0.4; cursor: not-allowed; }

.context-pills {
  display: flex; flex-wrap: wrap; gap: 6px;
  font-size: 10px;
}
.context-pill {
  background: var(--bg-elevated);
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: 10px;
}

/* ─── Annotations ──────────────────────────────────────────────────── */

.annotation-rail {
  border-left: 2px solid var(--accent-soft);
  margin-left: 12px;
  padding-left: 14px;
  display: flex; flex-direction: column; gap: 8px;
}
.annotation {
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--accent-soft);
  border: 1px solid var(--border-accent);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  line-height: 1.5;
}
.annotation__author {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 3px;
}

/* ─── Annotations Tab ──────────────────────────────────────────────── */

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-faint);
  font-size: 14px;
  font-style: italic;
}

/* ─── Toast ────────────────────────────────────────────────────────── */

.toast {
  position: fixed;
  bottom: 28px; right: 28px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 12px 20px;
  font-size: 13px;
  color: var(--text-primary);
  box-shadow: var(--shadow-card);
  z-index: 2000;
  transform: translateY(100px);
  opacity: 0;
  transition: transform var(--transition-med), opacity var(--transition-med);
  display: flex; align-items: center; gap: 10px;
}
.toast--show {
  transform: translateY(0);
  opacity: 1;
}
.toast--ok { border-color: var(--success); }
.toast--err { border-color: var(--danger); }
.toast__dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.toast--ok .toast__dot { background: var(--success); }
.toast--err .toast__dot { background: var(--danger); }

/* ─── Responsive ───────────────────────────────────────────────────── */

/* Smooth touch scrolling everywhere */
.transcript-list, .main, .transcript-viewer, .modal {
  -webkit-overflow-scrolling: touch;
}

/* Large tablets and narrow desktops */
@media (max-width: 1100px) {
  .lead-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
  .summary-grid { grid-template-columns: 1fr; }
  /* Collapse to single column at this width — phones in landscape are ~1100px */
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
  }
  .sidebar {
    position: relative;
    height: auto;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid var(--border);
    overflow: visible;
  }
  .sidebar.collapsed {
    height: auto;
  }
  .sidebar.collapsed .transcript-list,
  .sidebar.collapsed .sidebar__section,
  .sidebar.collapsed .sidebar__footer {
    display: none;
  }
  /* Main becomes normal flow — no inner scroll container */
  .main {
    height: auto;
    min-height: auto;
    overflow-y: visible;
    overflow-x: hidden;
  }
  .transcript-viewer {
    max-height: none;
    overflow-y: visible;
  }
  .content {
    max-width: 100%;
  }
}

/* Tablets and mobile */
@media (max-width: 900px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    min-height: 100vh;
    overflow-x: hidden;
    max-width: 100vw;
  }

  /* On mobile, .main is a normal block in the document flow.
     The entire page scrolls via the <body>, not .main.
     This eliminates the inner-scroll-fights-outer-scroll issue.
     The .topbar and .tabs remain position:sticky so they follow the user
     down the page as one continuous scroll. */
  .main {
    height: auto;
    min-height: auto;
    overflow-y: visible;
    overflow-x: hidden;
    max-width: 100%;
  }

  /* Transcript viewer grows naturally; outer scroll absorbs it.
     max-height + overflow removed to prevent nested scroll fighting. */
  .transcript-viewer {
    max-height: none;
    overflow-y: visible;
  }

  /* Collapsible sidebar — becomes a top bar with toggle */
  .sidebar {
    position: relative;
    height: auto;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid var(--border);
    overflow: visible;
    overflow-x: hidden;
    max-width: 100%;
  }

  .sidebar.collapsed {
    height: auto;
  }

  .sidebar.collapsed .transcript-list,
  .sidebar.collapsed .sidebar__section,
  .sidebar.collapsed .sidebar__footer {
    display: none;
  }

  /* Show toggle button only on mobile */
  .sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    cursor: pointer;
    background: none;
    border: none;
    width: 100%;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 500;
  }
  .sidebar-toggle__icon {
    font-size: 18px;
    color: var(--text-muted);
    transition: transform var(--transition-fast);
  }
  .sidebar.collapsed .sidebar-toggle__icon {
    transform: rotate(180deg);
  }

  /* When expanded, limit transcript list height */
  .sidebar:not(.collapsed) .transcript-list {
    max-height: 240px;
  }

  /* Topbar adjustments */
  .topbar {
    padding: 14px 16px 10px;
  }
  .topbar__row {
    flex-direction: column;
    gap: 12px;
  }
  .search-wrap {
    width: 100%;
    max-width: none;
  }
  .topbar__title {
    font-size: 18px;
  }
  .topbar__subtitle {
    font-size: 12px;
    flex-wrap: wrap;
    gap: 8px;
  }

  /* Content padding */
  .content {
    padding: 16px 16px 100px;
    max-width: 100%;
  }

  /* Tabs — scrollable horizontally, bigger touch targets */
  .tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-top: 12px;
    margin-left: -16px;
    margin-right: -16px;
    padding-left: 16px;
    padding-right: 16px;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tab {
    white-space: nowrap;
    padding: 12px 16px 14px;
    font-size: 14px;
    min-height: 44px;
  }

  /* Stats strip — 2 columns on mobile */
  .stats-strip {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    margin-bottom: 20px;
  }
  .stat-value { font-size: 22px; }
  .stat-cell { padding: 14px 16px; }

  /* Cards */
  .card__header { padding: 14px 16px 12px; }
  .card__body { padding: 16px; }
  .card + .card { margin-top: 16px; }

  /* Summary prose */
  .summary-prose { font-size: 13.5px; line-height: 1.7; }
  .summary-prose h1 { font-size: 18px; }
  .summary-prose h2 { font-size: 16px; }
  .summary-prose h3 { font-size: 14px; }
  .summary-prose table { font-size: 12px; }
  .summary-prose th, .summary-prose td { padding: 6px 8px; }

  /* Make tables horizontally scrollable on mobile */
  .summary-prose .md-table-wrap,
  .md-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Lead grid — single column on mobile */
  .lead-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .lead-card__top { padding: 14px 16px 12px; }
  .lead-card__body { padding: 12px 16px; }
  .lead-card__footer { padding: 10px 16px; }

  /* Leads toolbar — bigger touch targets */
  .leads-toolbar { gap: 8px; margin-bottom: 16px; }
  .filter-chip {
    padding: 8px 16px;
    font-size: 13px;
    min-height: 36px;
  }

  /* Notes — bigger touch targets */
  .note-item { padding: 14px 16px; }
  .note-mini-btn {
    padding: 6px 12px;
    font-size: 12px;
    min-height: 32px;
  }

  /* Action items */
  .action-item-card { padding: 12px 14px; }
  .action-item__actions { gap: 6px; }
  .mini-btn {
    padding: 8px 14px;
    font-size: 13px;
    min-height: 36px;
  }
  .action-filters { gap: 6px; margin-bottom: 14px; }

  /* Chat */
  .chat-wrap { gap: 12px; }
  .chat-msg { padding: 12px 16px; font-size: 13px; max-width: 92%; }
  .chat-input-row { gap: 8px; }
  .chat-input { padding: 10px 14px; font-size: 14px; min-height: 44px; }
  .chat-send { padding: 0 16px; min-width: 44px; }

  /* Modals — full-screen on mobile */
  .modal-overlay {
    padding: 0;
    align-items: stretch;
  }
  .modal {
    max-width: none;
    max-height: none;
    height: 100%;
    border-radius: 0;
    border: none;
  }
  .modal__header { padding: 16px 20px 14px; }
  .modal__body { padding: 16px 20px; }
  .modal__footer { padding: 14px 20px 20px; }
  .field-row { grid-template-columns: 1fr; gap: 12px; }

  /* FAB — adjusted for safe area */
  .action-fab {
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    right: calc(20px + env(safe-area-inset-right, 0px));
    width: 52px;
    height: 52px;
  }
  .action-menu {
    bottom: calc(82px + env(safe-area-inset-bottom, 0px));
    right: calc(20px + env(safe-area-inset-right, 0px));
  }

  /* Toast — centered on mobile */
  .toast {
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    right: 50%;
    transform: translate(50%, 100px);
    max-width: calc(100vw - 32px);
  }
  .toast--show { transform: translate(50%, 0); }

  /* Transcript turns */
  .turn {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 10px 12px;
  }
  .turn__speaker {
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 2px;
  }

  /* Transcript viewer */
  .transcript-viewer {
    padding: 16px 14px;
  }

  /* Chunk nav */
  .chunk-nav {
    flex-wrap: wrap;
    gap: 6px;
  }

  /* Mention dropdown */
  .mention-dropdown {
    width: calc(100vw - 32px);
    max-width: 320px;
  }
}

/* Phone — narrow screens */
@media (max-width: 480px) {
  .topbar__title { font-size: 16px; }
  .content { padding: 12px 12px 100px; }
  .topbar { padding: 12px 12px 8px; }

  /* Stats — fewer columns on tiny screens */
  .stats-strip {
    grid-template-columns: repeat(2, 1fr);
  }
  .stat-value { font-size: 20px; }
  .stat-cell { padding: 12px 14px; }

  /* Brand smaller */
  .brand-mark { width: 32px; height: 32px; font-size: 15px; }
  .brand-title { font-size: 15px; }
  .brand-sub { font-size: 10px; }

  /* Tabs even tighter */
  .tab {
    padding: 10px 12px 12px;
    font-size: 13px;
  }

  /* Edit button */
  .link-btn { padding: 4px 8px; font-size: 12px; }

  /* Lead card tighter */
  .lead-name { font-size: 15px; }
  .lead-row__label { width: 56px; }
  .lead-row__value { font-size: 12px; }

  /* Sidebar toggle bigger touch target */
  .sidebar-toggle {
    min-height: 48px;
    padding: 14px 16px;
  }
}

/* Desktop: hide the sidebar toggle button's collapse behavior */
@media (min-width: 1101px) {
  .sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding: 22px 24px 16px;
    border-bottom: 1px solid var(--border);
    cursor: default;
    pointer-events: none;
  }
  .sidebar-toggle .sidebar-toggle__icon { display: none; }
  /* On desktop, sidebar is never collapsed — override the HTML default */
  .sidebar.collapsed .transcript-list,
  .sidebar.collapsed .sidebar__footer {
    display: block;
  }
  .sidebar.collapsed .sidebar__section {
    display: block;
  }
  .sidebar .transcript-list,
  .sidebar:not(.collapsed) .transcript-list { max-height: none; }
}

/* Safe area insets for iPhone */
@supports (padding: env(safe-area-inset-top)) {
  .topbar {
    padding-top: calc(14px + env(safe-area-inset-top, 0px));
  }
  .content {
    padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px));
  }
}

/* Prevent text selection on UI buttons (avoids accidental select on tap) */
button, .tab, .filter-chip, .transcript-item, .theme-card, .lead-card {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
}

/* Allow text selection in content areas */
.summary-prose, .note-content, .transcript-viewer, .chat-msg, .turn__text {
  user-select: text;
  -webkit-user-select: text;
  -webkit-touch-callout: default;
}

/* Prevent iOS zoom on input focus */
@media (max-width: 900px) {
  .field-input, .field-select, .field-textarea,
  .search-input, .chat-input {
    font-size: 16px;
  }
}
@media (max-width: 480px) {
  .field-input, .field-select, .field-textarea,
  .search-input, .chat-input {
    font-size: 16px;
  }
}

/* Sticky bottom tab bar as alternative mobile nav (hidden by default) */
.mobile-tab-bar {
  display: none;
}

/* Focus-visible for accessibility */
button:focus-visible, a:focus-visible, input:focus-visible,
textarea:focus-visible, select:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ─── Transcript turns (speaker-labeled) ───────────────────────────── */
.chunk__turns {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.turn {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 14px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border-left: 3px solid transparent;
  background: var(--bg-surface);
  transition: background var(--transition-fast);
}
.turn:hover { background: var(--bg-elevated); }
.turn__speaker {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  align-self: start;
  padding-top: 2px;
}
.turn__text {
  margin: 0;
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-secondary);
}
.speaker--chris { border-left-color: var(--accent); }
.speaker--chris .turn__speaker { color: var(--accent); }
.speaker--taza { border-left-color: var(--info, #6ea8fe); }
.speaker--taza .turn__speaker { color: var(--info, #6ea8fe); }
.speaker--other { border-left-color: var(--text-faint); }
.speaker--other .turn__speaker { color: var(--text-muted); }

/* ─── Chat context bar & @-mention dropdown ───────────────────────── */
.chat-context-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 6px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--border);
}
.mention-dropdown {
  position: absolute;
  z-index: 500;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  max-height: 240px;
  overflow-y: auto;
  width: 320px;
  display: none;
}
.mention-item {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mention-item:last-child { border-bottom: none; }
.mention-item:hover { background: var(--bg-hover); }
.mention-item .md-kind { font-size: 13px; color: var(--text-primary); font-weight: 500; }
.mention-item .md-sub { font-size: 11px; color: var(--text-muted); }
.md-table-wrap { overflow-x: auto; margin: 16px 0; }
.md-table { width: 100%; border-collapse: collapse; font-size: 13px; background: var(--bg-surface); border-radius: var(--radius-md); overflow: hidden; }
.md-table th { background: var(--bg-elevated); color: var(--text-primary); text-align: left; font-weight: 600; padding: 9px 12px; border-bottom: 1px solid var(--border-strong); white-space: nowrap; }
.md-table td { padding: 8px 12px; border-bottom: 1px solid var(--border); color: var(--text-secondary); vertical-align: top; }
.md-table tr:last-child td { border-bottom: none; }
.md-table tbody tr:hover { background: var(--bg-elevated); }


/* ─── Link button (inline edit triggers) ─────────────────────────── */
.link-btn {
  background: none; border: none; color: var(--accent); cursor: pointer;
  font-size: 11px; font-weight: 600; padding: 2px 6px; border-radius: 6px;
  text-decoration: underline; text-underline-offset: 2px; letter-spacing: 0.02em;
}
.link-btn:hover { background: var(--accent-soft); }

/* ─── Lead card quick actions ─────────────────────────────────────── */
.lead-card__quick {
  display: flex; gap: 8px; padding: 10px 16px 14px; border-top: 1px solid var(--border);
  margin-top: 4px;
}
.quick-btn {
  flex: 1; background: var(--bg-surface); border: 1px solid var(--border);
  color: var(--text-secondary); border-radius: var(--radius-sm); padding: 6px 8px;
  font-size: 11px; font-weight: 600; cursor: pointer; transition: all var(--transition-fast);
}
.quick-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* ─── Note lead tag ───────────────────────────────────────────────── */
.note-lead-tag {
  font-size: 10px; color: var(--accent); background: var(--accent-soft);
  padding: 2px 7px; border-radius: 10px; font-weight: 600; margin-left: 6px;
}

/* ─── Action FAB + menu ───────────────────────────────────────────── */
.action-fab {
  position: fixed; bottom: 28px; right: 28px; z-index: 1500;
  width: 58px; height: 58px; border-radius: 50%;
  background: var(--accent); color: #1a1205; border: none; cursor: pointer;
  box-shadow: 0 8px 24px rgba(232,168,73,0.4); display: flex; align-items: center; justify-content: center;
  transition: transform var(--transition-med), box-shadow var(--transition-med);
}
.action-fab:hover { transform: scale(1.06); }
.action-fab--active { transform: rotate(45deg); }
.action-menu {
  position: fixed; bottom: 98px; right: 28px; z-index: 1500;
  background: var(--bg-elevated); border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-card);
  padding: 8px; min-width: 230px; display: none; flex-direction: column; gap: 4px;
}
.action-menu--open { display: flex; animation: fabpop 0.16s ease; }
@keyframes fabpop { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.action-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: none; border: none; color: var(--text-primary); cursor: pointer;
  padding: 10px 12px; border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 500;
  transition: background var(--transition-fast);
}
.action-item:hover { background: var(--bg-hover); }
.ai-ico { font-size: 15px; width: 20px; text-align: center; }

/* ─── Wide modal (summary editor) ─────────────────────────────────── */
.modal--wide { max-width: 760px; }
#se-modal-body .field-textarea { font-size: 13px; line-height: 1.6; }

/* ─── Action Items tab ────────────────────────────────────────────── */
.action-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.action-items-list { display: flex; flex-direction: column; gap: 12px; }
.action-item-card {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-left-width: 4px; border-radius: var(--radius-md);
  padding: 14px 16px; transition: var(--transition);
}
.action-item-card.action-item--open { border-left-color: var(--accent); }
.action-item-card.action-item--in_progress { border-left-color: var(--warning); }
.action-item-card.action-item--done { border-left-color: var(--success); opacity: 0.62; }
.action-item__top { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.ai-priority {
  font-size: 11px; font-weight: 800; letter-spacing: 0.04em;
  padding: 2px 8px; border-radius: 999px;
}
.ai-priority--P0 { background: color-mix(in srgb, var(--danger) 22%, transparent); color: var(--danger); }
.ai-priority--P1 { background: color-mix(in srgb, var(--warning) 22%, transparent); color: var(--warning); }
.ai-priority--P2 { background: color-mix(in srgb, var(--accent) 20%, transparent); color: var(--accent); }
.ai-title { font-size: 15px; font-weight: 600; color: var(--text); flex: 1; }
.ai-title--done { text-decoration: line-through; }
.ai-src {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-muted); background: var(--bg-elevated);
  border: 1px solid var(--border); padding: 1px 7px; border-radius: 999px;
}
.action-item__meta {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  font-size: 12.5px; color: var(--text-muted); margin-bottom: 10px;
}
.ai-owner { color: var(--text); }
.ai-status { font-weight: 600; }
.ai-status--open { color: var(--accent); }
.ai-status--in_progress { color: var(--warning); }
.ai-status--done { color: var(--success); }
.ai-notes { flex-basis: 100%; color: var(--text-muted); font-style: italic; }
.action-item__actions { display: flex; gap: 8px; }
.mini-btn {
  font-size: 12px; padding: 5px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg-elevated);
  color: var(--text); cursor: pointer; transition: var(--transition);
}
.mini-btn:hover { background: color-mix(in srgb, var(--accent) 14%, var(--bg-elevated)); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.mini-btn--del { color: var(--danger); }
.mini-btn--del:hover { background: color-mix(in srgb, var(--danger) 16%, transparent); border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); }
