:root {
  color-scheme: light;
  --bg: #eef2f7;
  --bg-accent: #e5ebf4;
  --surface: #ffffff;
  --surface-strong: #ffffff;
  --surface-subtle: #f7f9fc;
  --surface-tinted: #f3f6fb;
  --border: #d8e0eb;
  --border-strong: #bac8da;
  --text: #243044;
  --text-strong: #182235;
  --muted: #718096;
  --muted-strong: #56657a;
  --primary: #2453b8;
  --primary-strong: #173f91;
  --primary-soft: #e9effc;
  --primary-rgb: 36, 83, 184;
  --accent: #5f7fe0;
  --bg-gradient-start: #f8fafc;
  --focus-ring: rgba(36, 83, 184, 0.22);
  --nav-active-border: #cbd8f2;
  --success: #10724d;
  --success-soft: #e8f6f0;
  --warning: #8b5b05;
  --warning-soft: #fff4dc;
  --danger: #a8324e;
  --danger-soft: #fff0f4;
  --shadow: 0 12px 28px rgba(15, 23, 42, 0.055);
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --font-ui: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --text-xs: 12px;
  --text-sm: 13px;
  --text-base: 14px;
  --text-md: 15px;
  --text-lg: 17px;
  --text-xl: 21px;
  --text-2xl: 26px;
}


:root[data-theme="light"][data-palette="atelier-blue"] { color-scheme: light; --bg: #eef2f7; --bg-accent: #e5ebf4; --surface: #ffffff; --surface-strong: #ffffff; --surface-subtle: #f7f9fc; --surface-tinted: #f3f6fb; --border: #d8e0eb; --border-strong: #bac8da; --text: #243044; --text-strong: #182235; --muted: #718096; --muted-strong: #56657a; --primary: #2453b8; --primary-strong: #173f91; --primary-soft: #e9effc; --primary-rgb: 36, 83, 184; --accent: #5f7fe0; --bg-gradient-start: #f8fafc; --focus-ring: rgba(36, 83, 184, 0.22); --nav-active-border: #cbd8f2; }
:root[data-theme="light"][data-palette="indigo-slate"] { color-scheme: light; --bg: #eef2ff; --bg-accent: #e0e7ff; --surface: #ffffff; --surface-strong: #ffffff; --surface-subtle: #f8fafc; --surface-tinted: #eef2ff; --border: #d8def0; --border-strong: #b8c2dc; --text: #263044; --text-strong: #161f33; --muted: #667085; --muted-strong: #4b5565; --primary: #4f46e5; --primary-strong: #3730a3; --primary-soft: #eef2ff; --primary-rgb: 79, 70, 229; --accent: #7c3aed; --bg-gradient-start: #f8fafc; --focus-ring: rgba(79, 70, 229, 0.22); --nav-active-border: #c7d2fe; }
:root[data-theme="light"][data-palette="emerald-mint"] { color-scheme: light; --bg: #edf8f2; --bg-accent: #dcfce7; --surface: #ffffff; --surface-strong: #ffffff; --surface-subtle: #f1fbf6; --surface-tinted: #ecfdf5; --border: #cfe9dc; --border-strong: #9fd2bb; --text: #20362f; --text-strong: #13251f; --muted: #64776f; --muted-strong: #48635a; --primary: #047857; --primary-strong: #065f46; --primary-soft: #dff8eb; --primary-rgb: 4, 120, 87; --accent: #10b981; --bg-gradient-start: #f8fffb; --focus-ring: rgba(4, 120, 87, 0.22); --nav-active-border: #a7f3d0; }
:root[data-theme="light"][data-palette="teal-cyan"] { color-scheme: light; --bg: #eaf7f7; --bg-accent: #ccfbf1; --surface: #ffffff; --surface-strong: #ffffff; --surface-subtle: #f0fdfa; --surface-tinted: #ecfeff; --border: #c6e7e5; --border-strong: #91d1d2; --text: #203638; --text-strong: #102527; --muted: #60777a; --muted-strong: #456367; --primary: #0f766e; --primary-strong: #115e59; --primary-soft: #dff8f6; --primary-rgb: 15, 118, 110; --accent: #0891b2; --bg-gradient-start: #f7ffff; --focus-ring: rgba(15, 118, 110, 0.22); --nav-active-border: #99f6e4; }
:root[data-theme="light"][data-palette="violet-plum"] { color-scheme: light; --bg: #f4effb; --bg-accent: #f3e8ff; --surface: #ffffff; --surface-strong: #ffffff; --surface-subtle: #faf5ff; --surface-tinted: #f5f3ff; --border: #e2d7f0; --border-strong: #c8b4df; --text: #30263d; --text-strong: #21162e; --muted: #74677f; --muted-strong: #5d4c6e; --primary: #6d28d9; --primary-strong: #581c87; --primary-soft: #f0e7ff; --primary-rgb: 109, 40, 217; --accent: #a21caf; --bg-gradient-start: #fdfaff; --focus-ring: rgba(109, 40, 217, 0.22); --nav-active-border: #ddd6fe; }
:root[data-theme="light"][data-palette="rose-warm"] { color-scheme: light; --bg: #f9eef0; --bg-accent: #ffe4e6; --surface: #ffffff; --surface-strong: #ffffff; --surface-subtle: #fff7ed; --surface-tinted: #fff1f2; --border: #efd3d8; --border-strong: #dfabb5; --text: #3c252c; --text-strong: #2c151b; --muted: #7c6570; --muted-strong: #684c57; --primary: #be123c; --primary-strong: #9f1239; --primary-soft: #ffe4e9; --primary-rgb: 190, 18, 60; --accent: #f97316; --bg-gradient-start: #fffbf7; --focus-ring: rgba(190, 18, 60, 0.22); --nav-active-border: #fecdd3; }
:root[data-theme="light"][data-palette="amber-sand"] { color-scheme: light; --bg: #f6f0df; --bg-accent: #fef3c7; --surface: #ffffff; --surface-strong: #ffffff; --surface-subtle: #fffbeb; --surface-tinted: #fef7df; --border: #e7d9b8; --border-strong: #d1b77a; --text: #382f1e; --text-strong: #241d10; --muted: #74694f; --muted-strong: #5d5035; --primary: #b45309; --primary-strong: #92400e; --primary-soft: #fef0c3; --primary-rgb: 180, 83, 9; --accent: #d97706; --bg-gradient-start: #fffdf7; --focus-ring: rgba(180, 83, 9, 0.22); --nav-active-border: #fde68a; }
:root[data-theme="light"][data-palette="graphite"] { color-scheme: light; --bg: #eef1f5; --bg-accent: #e2e8f0; --surface: #ffffff; --surface-strong: #ffffff; --surface-subtle: #f8fafc; --surface-tinted: #f1f5f9; --border: #d7dde6; --border-strong: #b7c1ce; --text: #252b35; --text-strong: #151a22; --muted: #697386; --muted-strong: #4b5563; --primary: #374151; --primary-strong: #111827; --primary-soft: #e8edf3; --primary-rgb: 55, 65, 81; --accent: #64748b; --bg-gradient-start: #f9fafb; --focus-ring: rgba(55, 65, 81, 0.24); --nav-active-border: #cbd5e1; }
:root[data-theme="light"][data-palette="sky-navy"] { color-scheme: light; --bg: #eaf5fb; --bg-accent: #e0f2fe; --surface: #ffffff; --surface-strong: #ffffff; --surface-subtle: #f0f9ff; --surface-tinted: #eaf6ff; --border: #c9e0ed; --border-strong: #9fc5da; --text: #203342; --text-strong: #102434; --muted: #607586; --muted-strong: #455f73; --primary: #0369a1; --primary-strong: #075985; --primary-soft: #dff1fc; --primary-rgb: 3, 105, 161; --accent: #0284c7; --bg-gradient-start: #f8fdff; --focus-ring: rgba(3, 105, 161, 0.22); --nav-active-border: #bae6fd; }
:root[data-theme="light"][data-palette="forest"] { color-scheme: light; --bg: #eef5e7; --bg-accent: #dcfce7; --surface: #ffffff; --surface-strong: #ffffff; --surface-subtle: #f7fee7; --surface-tinted: #f0fdf4; --border: #d1e6c4; --border-strong: #a7cd92; --text: #25351f; --text-strong: #172412; --muted: #68795f; --muted-strong: #516346; --primary: #166534; --primary-strong: #14532d; --primary-soft: #e3f6d5; --primary-rgb: 22, 101, 52; --accent: #65a30d; --bg-gradient-start: #fbfff8; --focus-ring: rgba(22, 101, 52, 0.22); --nav-active-border: #bbf7d0; }
:root[data-theme="light"][data-palette="copper-clay"] { color-scheme: light; --bg: #f8eee7; --bg-accent: #fed7aa; --surface: #ffffff; --surface-strong: #ffffff; --surface-subtle: #fff7ed; --surface-tinted: #ffedd5; --border: #ead0bd; --border-strong: #d8a47f; --text: #3b2a20; --text-strong: #28170e; --muted: #7a6658; --muted-strong: #604a3c; --primary: #a9471b; --primary-strong: #7c2d12; --primary-soft: #fde7d5; --primary-rgb: 169, 71, 27; --accent: #c2410c; --bg-gradient-start: #fffbf7; --focus-ring: rgba(169, 71, 27, 0.22); --nav-active-border: #fed7aa; }
:root[data-theme="light"][data-palette="lavender-fog"] { color-scheme: light; --bg: #f1eff8; --bg-accent: #ede9fe; --surface: #ffffff; --surface-strong: #ffffff; --surface-subtle: #f8f7ff; --surface-tinted: #f5f3ff; --border: #ddd7ee; --border-strong: #c4b5df; --text: #302c3d; --text-strong: #1e1a2e; --muted: #716a82; --muted-strong: #5a516d; --primary: #7c3aed; --primary-strong: #5b21b6; --primary-soft: #efe8ff; --primary-rgb: 124, 58, 237; --accent: #8b5cf6; --bg-gradient-start: #fbfaff; --focus-ring: rgba(124, 58, 237, 0.22); --nav-active-border: #ddd6fe; }
:root[data-theme="light"][data-palette="ocean-glass"] { color-scheme: light; --bg: #eaf8fb; --bg-accent: #cffafe; --surface: #ffffff; --surface-strong: #ffffff; --surface-subtle: #f0fdff; --surface-tinted: #ecfeff; --border: #c5e8ee; --border-strong: #8fd1dd; --text: #1f373d; --text-strong: #10262d; --muted: #5f7780; --muted-strong: #45646e; --primary: #0e7490; --primary-strong: #155e75; --primary-soft: #dff7fb; --primary-rgb: 14, 116, 144; --accent: #06b6d4; --bg-gradient-start: #f8feff; --focus-ring: rgba(14, 116, 144, 0.22); --nav-active-border: #a5f3fc; }
:root[data-theme="light"][data-palette="coral-peach"] { color-scheme: light; --bg: #fbf0ee; --bg-accent: #ffe4e6; --surface: #ffffff; --surface-strong: #ffffff; --surface-subtle: #fff7f5; --surface-tinted: #fff1f2; --border: #efd4d0; --border-strong: #e0aaa3; --text: #3d2826; --text-strong: #2d1715; --muted: #806963; --muted-strong: #684f49; --primary: #e11d48; --primary-strong: #be123c; --primary-soft: #ffe4e8; --primary-rgb: 225, 29, 72; --accent: #fb7185; --bg-gradient-start: #fffafa; --focus-ring: rgba(225, 29, 72, 0.22); --nav-active-border: #fecdd3; }
:root[data-theme="light"][data-palette="raspberry-orchid"] { color-scheme: light; --bg: #faeef6; --bg-accent: #fce7f3; --surface: #ffffff; --surface-strong: #ffffff; --surface-subtle: #fff7fb; --surface-tinted: #fdf2f8; --border: #efd2e4; --border-strong: #dda7c9; --text: #3d2433; --text-strong: #2c1422; --muted: #7f6574; --muted-strong: #674c5d; --primary: #be185d; --primary-strong: #9d174d; --primary-soft: #fce2f1; --primary-rgb: 190, 24, 93; --accent: #c026d3; --bg-gradient-start: #fffbfd; --focus-ring: rgba(190, 24, 93, 0.22); --nav-active-border: #fbcfe8; }
:root[data-theme="dark"][data-palette] { color-scheme: dark; --bg: #0f172a; --bg-accent: #111827; --surface: #182235; --surface-strong: #1f2a3d; --surface-subtle: #121c2f; --surface-tinted: #1d2940; --border: #334155; --border-strong: #475569; --text: #e5edf7; --text-strong: #f8fafc; --muted: #aab8ca; --muted-strong: #c4cfdd; --primary-soft: rgba(var(--primary-rgb), 0.24); --success: #6ee7b7; --success-soft: rgba(16, 185, 129, 0.16); --warning: #fbbf24; --warning-soft: rgba(245, 158, 11, 0.16); --danger: #fda4af; --danger-soft: rgba(244, 63, 94, 0.16); --shadow: 0 18px 38px rgba(0, 0, 0, 0.32); --bg-gradient-start: #111827; }
:root[data-theme="dark"][data-palette="atelier-blue"] { --primary: #8fb3ff; --primary-strong: #c7d7ff; --primary-rgb: 143, 179, 255; --accent: #9fb6ff; --focus-ring: rgba(143, 179, 255, 0.34); --nav-active-border: rgba(143, 179, 255, 0.46); }
:root[data-theme="dark"][data-palette="indigo-slate"] { --primary: #a5b4fc; --primary-strong: #c7d2fe; --primary-rgb: 165, 180, 252; --accent: #c4b5fd; --focus-ring: rgba(165, 180, 252, 0.34); --nav-active-border: rgba(165, 180, 252, 0.46); }
:root[data-theme="dark"][data-palette="emerald-mint"] { --primary: #6ee7b7; --primary-strong: #a7f3d0; --primary-rgb: 110, 231, 183; --accent: #34d399; --focus-ring: rgba(110, 231, 183, 0.32); --nav-active-border: rgba(110, 231, 183, 0.44); }
:root[data-theme="dark"][data-palette="teal-cyan"] { --primary: #5eead4; --primary-strong: #99f6e4; --primary-rgb: 94, 234, 212; --accent: #67e8f9; --focus-ring: rgba(94, 234, 212, 0.32); --nav-active-border: rgba(94, 234, 212, 0.44); }
:root[data-theme="dark"][data-palette="violet-plum"] { --primary: #c4b5fd; --primary-strong: #ddd6fe; --primary-rgb: 196, 181, 253; --accent: #f0abfc; --focus-ring: rgba(196, 181, 253, 0.34); --nav-active-border: rgba(196, 181, 253, 0.46); }
:root[data-theme="dark"][data-palette="rose-warm"] { --primary: #fda4af; --primary-strong: #fecdd3; --primary-rgb: 253, 164, 175; --accent: #fdba74; --focus-ring: rgba(253, 164, 175, 0.34); --nav-active-border: rgba(253, 164, 175, 0.46); }
:root[data-theme="dark"][data-palette="amber-sand"] { --primary: #fcd34d; --primary-strong: #fde68a; --primary-rgb: 252, 211, 77; --accent: #fbbf24; --focus-ring: rgba(252, 211, 77, 0.32); --nav-active-border: rgba(252, 211, 77, 0.44); }
:root[data-theme="dark"][data-palette="graphite"] { --primary: #cbd5e1; --primary-strong: #f1f5f9; --primary-rgb: 203, 213, 225; --accent: #94a3b8; --focus-ring: rgba(203, 213, 225, 0.28); --nav-active-border: rgba(203, 213, 225, 0.4); }
:root[data-theme="dark"][data-palette="sky-navy"] { --primary: #7dd3fc; --primary-strong: #bae6fd; --primary-rgb: 125, 211, 252; --accent: #38bdf8; --focus-ring: rgba(125, 211, 252, 0.32); --nav-active-border: rgba(125, 211, 252, 0.44); }
:root[data-theme="dark"][data-palette="forest"] { --primary: #86efac; --primary-strong: #bbf7d0; --primary-rgb: 134, 239, 172; --accent: #bef264; --focus-ring: rgba(134, 239, 172, 0.32); --nav-active-border: rgba(134, 239, 172, 0.44); }
:root[data-theme="dark"][data-palette="copper-clay"] { --primary: #fdba74; --primary-strong: #fed7aa; --primary-rgb: 253, 186, 116; --accent: #fb923c; --focus-ring: rgba(253, 186, 116, 0.32); --nav-active-border: rgba(253, 186, 116, 0.44); }
:root[data-theme="dark"][data-palette="lavender-fog"] { --primary: #c4b5fd; --primary-strong: #ddd6fe; --primary-rgb: 196, 181, 253; --accent: #a78bfa; --focus-ring: rgba(196, 181, 253, 0.34); --nav-active-border: rgba(196, 181, 253, 0.46); }
:root[data-theme="dark"][data-palette="ocean-glass"] { --primary: #67e8f9; --primary-strong: #a5f3fc; --primary-rgb: 103, 232, 249; --accent: #22d3ee; --focus-ring: rgba(103, 232, 249, 0.32); --nav-active-border: rgba(103, 232, 249, 0.44); }
:root[data-theme="dark"][data-palette="coral-peach"] { --primary: #fb7185; --primary-strong: #fecdd3; --primary-rgb: 251, 113, 133; --accent: #fda4af; --focus-ring: rgba(251, 113, 133, 0.34); --nav-active-border: rgba(251, 113, 133, 0.46); }
:root[data-theme="dark"][data-palette="raspberry-orchid"] { --primary: #f9a8d4; --primary-strong: #fbcfe8; --primary-rgb: 249, 168, 212; --accent: #e879f9; --focus-ring: rgba(249, 168, 212, 0.34); --nav-active-border: rgba(249, 168, 212, 0.46); }

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font-ui);
  font-size: var(--text-base);
  line-height: 1.5;
  color: var(--text);
  background: linear-gradient(180deg, var(--bg-gradient-start) 0%, var(--bg) 100%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input, select, textarea { font: inherit; }
button {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  background: var(--primary);
  color: #fff;
  font-size: var(--text-sm);
  font-weight: 700;
  line-height: 1.25;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
}
button:hover { background: var(--primary-strong); }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .marc-chat-shell:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}
button:disabled { opacity: 0.62; cursor: not-allowed; }
.secondary-button,
.secondary-button.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.secondary-button:hover,
.secondary-button.active:hover {
  background: var(--primary-strong);
  color: #fff;
  border-color: var(--primary-strong);
}
input, select, textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: var(--surface-strong);
  color: var(--text);
  line-height: 1.45;
}
textarea { min-height: 112px; resize: vertical; }
label { display: flex; flex-direction: column; gap: 6px; color: var(--muted-strong); font-size: var(--text-sm); font-weight: 700; }

h1, h2, h3, h4, p { margin-top: 0; }
h1, h2, h3, h4, strong { color: var(--text-strong); }
h1 { font-size: var(--text-2xl); line-height: 1.14; margin-bottom: 12px; letter-spacing: -0.02em; }
h2 { font-size: var(--text-xl); line-height: 1.2; margin: 0; letter-spacing: -0.015em; }
h3 { font-size: var(--text-lg); line-height: 1.25; margin: 0 0 6px; letter-spacing: -0.01em; }
h4 { font-size: var(--text-md); line-height: 1.3; margin: 0 0 6px; }
p { margin-bottom: 10px; }
small, .small { font-size: var(--text-xs); line-height: 1.45; }

.app-shell { max-width: 1480px; margin: 0 auto; padding: 24px; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  min-width: 0;
}
.auth-layout { min-height: calc(100vh - 48px); display: grid; place-items: center; }
.login-card { width: min(100%, 440px); padding: 28px; }
.workspace-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 20px; min-height: calc(100vh - 48px); }
.workspace-main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.workspace-content-shell { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; align-items: start; min-width: 0; }
#viewRoot { min-width: 0; flex: 1 1 auto; }
#viewRoot > .split-layout,
#viewRoot > .two-column { min-height: calc(100vh - 172px); }
.sidebar { padding: 22px; display: flex; flex-direction: column; justify-content: space-between; }
.topbar { padding: 22px 24px; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.topbar-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.brand-row { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand-row.compact { margin-bottom: 28px; }
.brand-mark {
  position: relative;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 30% 24%, rgba(255, 255, 255, 0.28), transparent 30%),
    linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22), 0 10px 22px rgba(var(--primary-rgb), 0.2);
}
.brand-mark::before,
.brand-mark::after {
  content: '';
  position: absolute;
  left: 13px;
  right: 13px;
  top: 20px;
  height: 1.5px;
  background: rgba(255, 255, 255, 0.72);
  transform-origin: center;
}
.brand-mark::before { transform: rotate(28deg); }
.brand-mark::after { transform: rotate(-28deg); }
.brand-node {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.14);
}
.brand-node-center {
  width: 8px;
  height: 8px;
  left: 17px;
  top: 17px;
}
.brand-node-center::after {
  content: '✦';
  position: absolute;
  left: -5px;
  top: -8px;
  color: #fff;
  font-size: 9px;
  line-height: 1;
}
.brand-node-top { left: 18px; top: 9px; }
.brand-node-left { left: 10px; top: 25px; }
.brand-node-right { right: 10px; top: 25px; }
.eyebrow { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 800; }
.muted { color: var(--muted); }
.message { min-height: 20px; color: var(--danger); }
.login-form, .stack { display: flex; flex-direction: column; gap: 14px; }
.sidebar-footer { display: flex; flex-direction: column; gap: 10px; }
.user-badge { padding: 12px 14px; border-radius: var(--radius-md); background: var(--primary-soft); color: var(--primary-strong); font-weight: 800; }
.nav-list { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  width: 100%; text-align: left; background: transparent; color: var(--text);
  padding: 8px 10px; border: 1px solid transparent; border-radius: var(--radius-sm);
}
.nav-item:hover { background: var(--surface-tinted); color: var(--muted-strong); }
.nav-item.active { background: var(--primary-soft); color: var(--muted-strong); border-color: var(--nav-active-border); }
.nav-item span { display: block; font-size: 11px; color: var(--muted); font-weight: 600; margin-top: 1px; line-height: 1.25; }
.hidden { display: none !important; }
.grid { display: grid; gap: 16px; min-width: 0; }
.kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi-card, .panel, .empty-state, .error-state, .loading-state { padding: 20px; }
.kpi-value { font-size: var(--text-2xl); font-weight: 800; margin: 6px 0 4px; letter-spacing: -0.025em; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); min-width: 0; }
.panel-header, .detail-header, .list-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-width: 0; }
.detail-header > div { flex: 1 1 auto; min-width: 0; }
.detail-header > button {
  flex: 0 0 auto;
  align-self: flex-start;
  min-width: 132px;
  max-width: 220px;
  white-space: nowrap;
  text-align: center;
}
.activity-list, .linked-list, .timeline, .approvals-queue { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.activity-item, .linked-item, .timeline-item, .record-card, .approval-card {
  background: var(--surface-subtle); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 15px; min-width: 0;
}
.task-meta-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
  margin-top: 12px;
}
.task-meta-item {
  min-width: 0;
  padding-top: 9px;
  border-top: 1px solid var(--border);
}
.task-meta-item-wide {
  grid-column: 1 / -1;
}
.task-meta-item strong,
.task-meta-item code {
  display: block;
  margin-top: 4px;
  color: var(--text-strong);
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.35;
}
.two-column, .split-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; min-width: 0; align-items: stretch; }
.lead-workspace-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
.record-list { display: flex; flex-direction: column; gap: 10px; max-height: 680px; overflow: auto; padding-right: 4px; min-width: 0; }
.account-list-panel,
.account-detail-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: calc(100vh - 172px);
  max-height: calc(100vh - 96px);
}
.lead-list-panel {
  display: flex;
  flex-direction: column;
  height: auto;
  min-height: 0;
  max-height: none;
  align-self: start;
  overflow: hidden;
}
.lead-detail-panel {
  display: flex;
  flex-direction: column;
  height: auto;
  min-height: 0;
  max-height: none;
  align-self: start;
}
.lead-list-panel .list-toolbar,
.account-list-panel .list-toolbar { flex: 0 0 auto; }
.lead-list-toolbar,
.account-list-toolbar {
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  padding-bottom: 14px;
  background: var(--surface);
  position: relative;
  z-index: 2;
}
.lead-search-label,
.account-search-label {
  width: 100%;
}
.lead-search-label input,
.account-search-label input {
  width: 100%;
}
.lead-list-panel .record-list {
  padding-top: 8px;
}
.lead-list-panel .record-list,
.account-list-panel .record-list,
.account-detail-panel > .stack {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow: auto;
}
.lead-list-panel .record-list {
  min-height: 0;
  scrollbar-gutter: stable;
  overflow-y: auto;
}
.lead-detail-panel > .stack {
  flex: 0 0 auto;
  min-height: 0;
  max-height: none;
  overflow: visible;
}
.lead-detail-panel > .detail-header,
.account-detail-panel > .detail-header {
  flex: 0 0 auto;
  margin-bottom: 14px;
}
.lead-detail-header {
  align-items: flex-start;
}
.lead-detail-heading {
  flex: 1 1 auto;
  min-width: 0;
}
.lead-detail-status-pill {
  flex: 0 0 auto;
  max-width: 160px;
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
  justify-content: center;
  text-align: center;
}
.lead-detail-panel .form-grid {
  grid-template-columns: 1fr;
}
.lead-detail-panel .form-grid label,
.lead-detail-panel .form-grid .full-width {
  grid-column: 1 / -1;
}
.lead-detail-panel input,
.lead-detail-panel select,
.lead-detail-panel textarea {
  min-height: 42px;
}
.lead-detail-panel textarea {
  min-height: 120px;
}
.lead-detail-info-card,
.account-detail-info-card {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
}
.lead-detail-info-grid,
.account-detail-info-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.lead-detail-info-item,
.account-detail-info-item {
  display: grid;
  grid-template-columns: minmax(92px, 0.34fr) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  min-width: 0;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}
.lead-detail-info-item:last-child,
.account-detail-info-item:last-child {
  border-bottom: 0;
}
.lead-detail-info-item .eyebrow,
.account-detail-info-item .eyebrow {
  line-height: 1.25;
  overflow-wrap: normal;
  word-break: normal;
}
.lead-detail-info-item strong,
.lead-detail-info-item code,
.account-detail-info-item strong,
.account-detail-info-item code {
  display: block;
  color: var(--text-strong);
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.35;
}
.lead-detail-actions,
.account-detail-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 18px 0 20px;
  align-items: stretch;
}
.lead-detail-action-button,
.account-detail-action-button {
  width: 100%;
  justify-content: center;
  min-height: 46px;
  text-align: center;
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.lead-detail-action-button:hover,
.account-detail-action-button:hover {
  background: var(--primary-strong);
  border-color: var(--primary-strong);
  color: #fff;
}
.lead-detail-panel > .empty-state,
.account-detail-panel > .empty-state {
  flex: 1 1 auto;
  display: grid;
  place-items: center;
}
.record-card.active { border-color: var(--border-strong); background: var(--primary-soft); }
.record-card {
  width: 100%;
  display: block;
  text-align: left;
  color: var(--text);
  font-weight: 500;
}
.record-card:hover { background: var(--surface-tinted); color: var(--text); }
.record-card strong { color: var(--text-strong); }
.meta-row, .pill-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; min-width: 0; }
.pill, .status-pill {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: fit-content;
  max-width: 100%;
  min-height: 30px;
  padding: 6px 11px;
  border-radius: 999px;
  background: var(--surface-tinted);
  border: 1px solid var(--border);
  color: var(--muted-strong);
  font-size: var(--text-xs);
  font-weight: 650;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}
.status-pill.success { background: var(--success-soft); border-color: #bddfce; color: var(--success); }
.status-pill.warning { background: var(--warning-soft); border-color: #ead49e; color: var(--warning); }
.status-pill.danger { background: var(--danger-soft); border-color: #efbdc9; color: var(--danger); }
.pill-owner { background: #eef3fb; border-color: var(--nav-active-border); color: #36547f; }
.pill-source { background: #f4f1fb; border-color: #d8cff0; color: #5d4c83; }
.pill-contact { background: #edf7f4; border-color: #c4ded6; color: #3d6a5e; }
.pill-budget { background: #f7f3e8; border-color: #ded2af; color: #705f35; }
.pill-timeframe { background: #eef5f8; border-color: #c7dbe4; color: #3f6474; }
.pill-thread { background: #f4eef6; border-color: #dac9e1; color: #694978; }
.lead-source-email { background: #eef3fb; border-color: var(--nav-active-border); color: #36547f; }
.lead-source-whatsapp { background: #edf7f4; border-color: #c4ded6; color: #3d6a5e; }
.lead-source-telegram { background: #eef5f8; border-color: #c7dbe4; color: #3f6474; }
.lead-source-import { background: #f4eef6; border-color: #dac9e1; color: #694978; }
.lead-source-manual { background: #f5f2ea; border-color: #ded4bc; color: #66583b; }
.status-pill.lead-status-new { background: #eaf2ff; border-color: #b9cdec; color: #244f87; }
.status-pill.lead-status-qualifying { background: #eef5f8; border-color: #c7dbe4; color: #3f6474; }
.status-pill.lead-status-qualified { background: #edf7f4; border-color: #c4ded6; color: #3d6a5e; }
.status-pill.lead-status-converted { background: #eaf5ed; border-color: #bddfce; color: #3f765c; }
.status-pill.lead-status-disqualified { background: #f8eeee; border-color: #e6c9c9; color: #844f4f; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid .full-width { grid-column: 1 / -1; }
.banner, .loading-state, .empty-state, .error-state { border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--surface); }
.banner { padding: 14px 16px; margin-bottom: 16px; }
.error-state { border-color: #efbdc9; background: var(--danger-soft); color: var(--danger); }
.empty-state, .loading-state { text-align: center; color: var(--muted); }
.link-button { min-height: 0; background: transparent; color: var(--primary); padding: 0; border: 0; border-radius: 0; font-weight: 800; }
.link-button:hover { background: transparent; color: var(--primary-strong); text-decoration: underline; }

.lead-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-auto-rows: max-content;
  align-items: start;
  justify-items: start;
  row-gap: 9px;
  height: auto;
  min-height: max-content;
  padding: 16px;
  overflow: visible;
  line-height: 1.42;
  white-space: normal;
  cursor: pointer;
}
.lead-card > * {
  position: static;
  max-width: 100%;
  min-width: 0;
}
.lead-title-row { display: block; margin: 0; min-width: 0; }
.lead-card-title {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.35;
  color: var(--text-strong);
  font-weight: 800;
}
.lead-status-pill { display: inline-flex; max-width: 100%; text-align: center; justify-content: center; white-space: nowrap; word-break: normal; overflow-wrap: normal; }
.lead-contact-line {
  display: block;
  min-height: 0;
  overflow: hidden;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.4;
}
.lead-meta-row { display: flex; align-items: flex-start; gap: 8px; margin-top: 0; }
.lead-meta-pill {
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  overflow: hidden;
  text-overflow: clip;
  justify-content: flex-start;
}
.lead-next-action,
.lead-detail-summary {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}
.lead-next-action {
  display: block;
  overflow: hidden;
  color: var(--muted-strong);
  line-height: 1.45;
}
.lead-next-action span { color: var(--text-strong); font-weight: 800; }

.account-card {
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 9px;
  min-height: 138px;
  padding: 18px;
  overflow: hidden;
  align-content: start;
  cursor: pointer;
}
.account-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: center;
  gap: 10px;
  margin: 0;
}
.account-card-title,
.account-detail-title,
.contact-card-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.account-card-title {
  display: -webkit-box;
  white-space: normal;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.25;
}
.account-count-pill { justify-self: end; max-width: 150px; text-align: center; justify-content: center; }
.account-subtitle-line,
.contact-subtitle-line,
.account-detail-summary {
  overflow: hidden;
  text-overflow: ellipsis;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.account-subtitle-line,
.contact-subtitle-line {
  white-space: nowrap;
  line-height: 1.35;
}
.account-meta-row { align-items: center; gap: 6px; margin-top: 0; }
.account-meta-pill {
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  justify-content: flex-start;
}
.account-detail-title { display: block; max-width: 100%; white-space: normal; overflow-wrap: anywhere; word-break: break-word; }
.account-detail-summary { display: -webkit-box; white-space: normal; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.contact-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 88px;
  justify-content: center;
  text-align: left;
  color: var(--text);
}
.contact-card-title { display: block; white-space: nowrap; }
.linked-item.active,
.contact-card.active { border-color: var(--border-strong); background: var(--primary-soft); }

@media (max-width: 520px) {
  .lead-card, .account-card { min-height: auto; align-content: start; }
  .lead-title-row, .account-title-row { grid-template-columns: 1fr; align-items: start; }
  .lead-status-pill, .account-count-pill { justify-self: start; max-width: 100%; }
  .lead-card-title, .lead-contact-line, .account-subtitle-line, .contact-subtitle-line, .contact-card-title { white-space: normal; }
  .lead-meta-pill, .account-meta-pill { max-width: 100%; }
  .lead-detail-actions, .account-detail-actions { grid-template-columns: 1fr; }
  .lead-detail-info-item, .account-detail-info-item { grid-template-columns: 1fr; gap: 4px; }
  .task-meta-list { grid-template-columns: 1fr; }
}

.approvals-route { gap: 16px; }
.approvals-panel { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.approvals-handoff-card { display: flex; flex-direction: column; gap: 16px; border-color: var(--nav-active-border); background: var(--surface-subtle); }
.approvals-handoff-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.approvals-handoff-note, .approvals-handoff-error { padding: 12px 14px; border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--surface-strong); }
.approvals-handoff-note { color: var(--text); }
.approvals-handoff-error { border-color: #efbdc9; background: var(--danger-soft); color: var(--danger); }
.approvals-handoff-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.approvals-handoff-summary-card { padding: 14px; border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--surface-strong); display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.approvals-handoff-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.approvals-handoff-summary-wide { grid-column: 1 / -1; }
.approvals-trace-summary-card, .approvals-linked-events-card, .approvals-audit-summary-card, .approvals-event-coverage-card, .approvals-worker-recommendation-card { gap: 14px; }
.approvals-trace-check-list, .approvals-audit-summary-list { display: flex; flex-direction: column; gap: 10px; }
.approvals-trace-check-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 10px; border-top: 1px solid var(--border); min-width: 0; }
.approvals-trace-check-row:first-child { padding-top: 0; border-top: none; }
.approvals-linked-events-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.approvals-linked-event-item { padding: 12px; border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--surface-strong); display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.approvals-audit-summary-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding-top: 10px; border-top: 1px solid var(--border); min-width: 0; }
.approvals-audit-summary-row:first-child { padding-top: 0; border-top: none; }
.approvals-audit-summary-empty { padding: 12px; border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--surface-strong); color: var(--muted); }
.approvals-bullet-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.approvals-bullet-list li { color: var(--text); }
.approval-card { display: flex; flex-direction: column; gap: 14px; }
.approval-card-outbound { border-color: var(--nav-active-border); background: var(--surface-tinted); }
.approval-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.approval-review-context, .approval-preview { padding: 14px; border-radius: var(--radius-md); background: var(--surface-strong); border: 1px solid var(--border); min-width: 0; }
.approval-review-context { border-color: var(--nav-active-border); background: #f8faff; }
.approval-review-context-grid { margin-top: 10px; }
.approval-review-context-wide { grid-column: 1 / -1; }
.approval-preview p { margin: 8px 0 0; color: var(--text); }
.approvals-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.marc-chat-shell { display: flex; flex-direction: column; gap: 12px; height: calc(100vh - 172px); min-height: 0; max-height: calc(100vh - 96px); position: sticky; top: 20px; width: 100%; max-width: 100%; overflow: hidden; align-self: start; }
.marc-chat-shell.marc-shell-focused { box-shadow: 0 0 0 3px var(--focus-ring), var(--shadow); border-color: var(--nav-active-border); }
.marc-chat-shell.collapsed { min-height: 0; }
.marc-chat-header { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; min-width: 0; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.marc-shell-controls-host, .marc-shell-controls, .marc-shell-focus-button, .marc-shell-resize-buttons, .marc-shell-toggle { display: none !important; }
.marc-chat-thread { display: flex; flex-direction: column; gap: 10px; flex: 1 1 auto; min-width: 0; min-height: 0; max-height: none; overflow: auto; padding-right: 2px; }
.marc-message { border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-subtle); padding: 12px 13px; min-width: 0; }
.marc-message.subtle { background: var(--surface-strong); }
.marc-context-card, .marc-context-card-outbound, .marc-empty-state-card { border-color: var(--border); background: var(--surface-strong); }
.marc-message-operator { margin-left: auto; border-color: var(--border); background: var(--surface-strong); color: var(--text); }
.marc-message-local-note { border-style: dashed; }
.marc-context-preview-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.marc-context-preview-item { border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-strong); padding: 12px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.marc-context-preview-item-wide { grid-column: 1 / -1; }
.marc-message.compact { padding: 14px; }
.marc-empty-state-actions, .marc-return-selection-actions, .marc-context-switch-guard-actions, .marc-composer-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.marc-simple-actions { justify-content: flex-end; margin-top: 6px; }
.marc-simple-actions button:not([hidden]):not(.hidden) { min-width: 96px; }
.marc-simple-actions .marc-voice-button:not([hidden]):not(.hidden) { min-width: 42px; width: 42px; padding: 8px; }
.marc-voice-button { color: var(--primary-strong); border-color: var(--nav-active-border); background: var(--primary-soft); display: inline-grid; place-items: center; }
.marc-voice-button svg { width: 18px; height: 18px; fill: currentColor; }
.marc-voice-button:not(:disabled):hover { color: #fff; background: var(--primary); border-color: var(--primary); }
.marc-voice-button.recording { color: #fff; background: var(--danger); border-color: var(--danger); box-shadow: 0 0 0 4px var(--danger-soft); }
.marc-simple-empty-message { display: grid; place-items: center; min-height: 120px; text-align: center; }
.marc-empty-state-pill { border-color: var(--border); background: var(--surface-strong); }
.marc-empty-state-load-button, .marc-return-selection-button, .marc-clear-return-button { align-self: flex-start; }
.marc-chat-composer { display: flex; flex: 0 0 auto; flex-direction: column; gap: 10px; padding-top: 12px; border-top: 1px solid var(--border); background: var(--surface-strong); }
.marc-composer-context-header { display: none !important; }
.marc-composer-status-stack { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.marc-source-badge { background: var(--surface-subtle); color: var(--muted-strong); border: 1px solid var(--border); }
.marc-context-history { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border-strong); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; min-width: 0; }
.marc-context-history-label, .marc-context-history-detail, .marc-context-history-reopen { flex: 0 0 auto; }
.marc-context-history-value { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 160px; }
.marc-draft-hint-active { color: var(--danger); font-weight: 800; }
.marc-composer-mode-hint-typing { color: var(--warning); font-weight: 800; }
.marc-composer-mode-hint-panel { color: var(--primary); font-weight: 800; }
.marc-composer-mode-hint-idle { color: var(--muted); font-weight: 700; }
.marc-copy-hint-active, #marcComposerCopyTimestamp { color: var(--success); font-weight: 800; }
#marcComposerShortcutHint, #marcComposerCopyHint, #marcComposerCopyTimestamp { display: none !important; }
.marc-context-switch-guard { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; border: 1px solid #efbdc9; border-radius: var(--radius-md); background: var(--danger-soft); color: var(--danger); }
.marc-import-thread-button:not(:disabled),
.marc-export-thread-button:not(:disabled),
.marc-clear-thread-button:not(:disabled) {
  border-color: var(--primary);
  color: #fff;
  background: var(--primary);
}
.marc-import-thread-button:not(:disabled):hover,
.marc-export-thread-button:not(:disabled):hover,
.marc-clear-thread-button:not(:disabled):hover {
  border-color: var(--primary-strong);
  color: #fff;
  background: var(--primary-strong);
}
.marc-composer-footer { min-height: 16px; }
.marc-chat-composer textarea { min-height: 110px; max-height: 160px; opacity: 1; }
.marc-chat-shell.collapsed .marc-chat-composer { display: flex; }
.marc-chat-composer textarea:disabled, .marc-chat-composer button:disabled { opacity: 0.7; cursor: not-allowed; }
#marcComposerSendButton:not(:disabled) { background: var(--success); border-color: var(--success); color: #fff; }
.marc-crm-capture-button:not(:disabled) { background: var(--primary); border-color: var(--primary); color: #fff; }
.marc-crm-capture-button:not(:disabled):hover { background: var(--primary-strong); }

/* Overflow and readability hardening across generated cards/tables/content. */
.card, .panel, .record-card, .approval-card, .activity-item, .linked-item, .timeline-item,
.marc-message, .marc-context-preview-item, .approvals-linked-event-item, .approvals-handoff-summary-card,
.approval-preview, .approval-review-context, .banner, .empty-state, .error-state, .loading-state {
  overflow-wrap: anywhere;
  word-break: break-word;
}
.card *, .panel *, #viewRoot * { min-width: 0; }
pre, code { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text-strong); }
table { width: 100%; border-collapse: collapse; table-layout: fixed; }
th, td { overflow-wrap: anywhere; vertical-align: top; }
button { white-space: normal; }
#viewRoot .detail-header > button,
#viewRoot .detail-header > .meta-row button {
  flex: 0 0 auto;
  width: auto;
  min-width: max-content;
  max-width: none;
  min-height: 40px;
  padding: 9px 16px;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
  text-align: center;
}
#viewRoot .detail-header > .meta-row {
  flex: 0 0 auto;
  align-items: center;
  margin-top: 0;
}
.pill, .status-pill { white-space: nowrap; word-break: normal; overflow-wrap: normal; }

@media (max-width: 1500px) {
  .workspace-content-shell { grid-template-columns: 1fr; }
  .marc-chat-shell { position: static; top: auto; height: auto; max-height: none; min-height: auto; }
}

@media (max-width: 1180px) {
  .workspace-layout, .two-column, .split-layout, .kpi-grid { grid-template-columns: 1fr; }
  .sidebar { order: 2; }
  .marc-chat-shell { position: static; height: auto; max-height: none; min-height: auto; width: 100% !important; }
  .lead-list-panel, .lead-detail-panel, .account-list-panel, .account-detail-panel { height: auto; min-height: auto; max-height: none; }
  .lead-detail-panel > .stack, .account-detail-panel > .stack { overflow: visible; }
  .marc-context-preview-grid, .approval-card-grid, .approvals-handoff-grid, .approvals-linked-events-grid, .approvals-audit-summary-row { grid-template-columns: 1fr; }
  .marc-composer-context-header, .topbar { flex-direction: column; align-items: flex-start; }
  .marc-composer-status-stack { align-items: flex-start; }
  .marc-context-switch-guard-actions, .marc-composer-actions { flex-direction: column; }
}

@media (max-width: 720px) {
  .app-shell { padding: 14px; }
  .form-grid, .approvals-handoff-summary, .approvals-handoff-summary-grid { grid-template-columns: 1fr; }
  .topbar-actions, .approvals-actions { width: 100%; }
  .topbar-actions button, .approvals-actions button, .marc-composer-actions button { width: 100%; }
  .detail-header { align-items: stretch; }
  .detail-header > button { width: 100%; max-width: none; white-space: normal; }
  .detail-header > .pill, .settings-minimum-pill { width: 100%; min-width: 0; white-space: normal; }
}

.market-signals-section {
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 16px;
  padding: 18px 16px;
  margin-top: 18px;
  background: rgba(239, 246, 255, 0.45);
}

.account-detail-info-card + .market-signals-section {
  margin-top: 22px;
}

.market-signals-section > .detail-header {
  display: grid;
  grid-template-columns: 1fr;
  justify-items: start;
  align-items: start;
  gap: 12px;
}

.market-signals-section > .detail-header > div {
  width: 100%;
}

#viewRoot .market-signals-section > .detail-header > button {
  width: auto;
  max-width: 100%;
  justify-self: start;
}

.market-signals-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.market-signal-item {
  border-top: 1px solid rgba(148, 163, 184, 0.35);
  margin-top: 10px;
  padding-top: 10px;
}

.market-next-best-action {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(240, 253, 244, 0.7);
}

.settings-panel {
  max-width: 920px;
}

.settings-panel input[type="checkbox"] {
  margin-right: 8px;
}

.analytics-panel {
  display: grid;
  gap: 18px;
}

.analytics-kpi-grid,
.analytics-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.analytics-section,
.analytics-kpi-card {
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 16px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.72);
}

.analytics-kpi-card span {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
}

.analytics-kpi-card strong {
  display: block;
  font-size: 1.7rem;
  margin-top: 6px;
}

.analytics-chart-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin: 10px 0;
}

.analytics-chart-row .analytics-bar {
  grid-column: 1 / -1;
}

.analytics-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.25);
  overflow: hidden;
}

.analytics-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #22c55e);
}

.ai-model-settings-panel select {
  min-width: 100%;
}

.ai-profile-notes {
  display: grid;
  gap: 6px;
}

.detail-header > .pill,
.settings-minimum-pill {
  flex: 0 0 auto;
  align-self: flex-start;
  justify-content: center;
  min-width: max-content;
  padding: 8px 14px;
  white-space: nowrap;
  text-align: center;
}

.nba-panel {
  display: grid;
  gap: 18px;
}

.nba-filters {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  align-items: end;
}

.nba-layout {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
}

.nba-list {
  display: grid;
  gap: 10px;
}

.nba-item {
  text-align: left;
  color: var(--text);
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 14px;
  padding: 14px;
}

.nba-item:hover {
  color: var(--text);
  background: var(--surface-tinted);
  border-color: #b8c7dc;
}

.nba-item:hover strong,
.nba-item.active strong {
  color: var(--text-strong);
}

.nba-item:hover .muted,
.nba-item.active .muted {
  color: var(--muted-strong);
}

.nba-item.active {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.nba-detail {
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 16px;
  padding: 16px;
  background: rgba(248, 250, 252, 0.9);
  align-self: start;
  position: sticky;
  top: 16px;
}

.nba-score-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.priority-critical { background: rgba(220, 38, 38, 0.12); color: #991b1b; }
.priority-high { background: rgba(234, 88, 12, 0.12); color: #9a3412; }
.priority-medium { background: rgba(202, 138, 4, 0.12); color: #854d0e; }
.priority-low { background: rgba(22, 163, 74, 0.12); color: #166534; }

@media (max-width: 900px) {
  .nba-layout {
    grid-template-columns: 1fr;
  }
  .nba-detail {
    position: static;
  }
}

.market-analytics-panel {
  display: grid;
  gap: 18px;
}

.market-analytics-panel .priority-high,
.market-analytics-panel .priority-medium,
.market-analytics-panel .priority-low {
  text-transform: capitalize;
}

/* Final action-control hardening: keep header actions compact without clipping labels. */
#viewRoot .detail-header > button.secondary-button,
#viewRoot .detail-header > .meta-row button.secondary-button {
  flex: 0 0 auto;
  width: auto;
  min-width: max-content;
  max-width: none;
  white-space: nowrap;
  overflow: visible;
  overflow-wrap: normal;
  word-break: normal;
}

#viewRoot .market-signals-section > .detail-header > button.secondary-button {
  max-width: 100%;
}

@media (max-width: 720px) {
  #viewRoot .detail-header > button.secondary-button,
  #viewRoot .detail-header > .meta-row button.secondary-button {
    width: auto;
    max-width: 100%;
    white-space: nowrap;
  }
}

/* NBA detail pills need to wrap inside the narrow inspector instead of overflowing into Marc. */
.nba-detail .meta-row {
  align-items: flex-start;
  overflow: hidden;
}

.nba-detail .pill {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
  text-align: left;
  justify-content: flex-start;
}

.nba-detail .safety-pill {
  display: flex;
  width: 100%;
}

.activity-summary {
  display: block;
  color: var(--text-strong);
  font-weight: 500;
  line-height: 1.45;
}

.activity-summary-label {
  font-weight: 800;
}

.activity-summary-detail {
  font-weight: 500;
}

.quote-review-task-card {
  display: grid;
  gap: 12px;
}

.quote-review-task-card > .detail-header {
  margin-bottom: 0;
}

.quote-review-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 8px;
  margin-top: 0;
}

.quote-review-meta-grid .pill,
.quote-review-action-row .pill,
.quote-review-triage-header > .pill {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
}

.quote-review-action-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-top: 0;
}

.quote-review-action-row button {
  justify-self: end;
}

.quote-review-triage-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: start;
  gap: 10px;
}

@media (max-width: 900px) {
  .quote-review-action-row {
    grid-template-columns: 1fr;
  }

  .quote-review-action-row button {
    justify-self: start;
  }
}

.quote-review-action-row {
  grid-template-columns: 1fr;
  justify-items: start;
}

.quote-review-action-row .quote-review-card-action {
  justify-self: start;
}

.quote-review-card-action {
  min-width: 136px;
  max-width: 220px;
  padding-inline: 18px;
}

.quote-review-action-row .quote-review-card-action + .quote-review-card-action {
  margin-top: 0;
}

.approval-review-context > .detail-header {
  align-items: flex-start;
}

.approval-review-context .quote-review-card-action {
  align-self: flex-start;
  justify-self: end;
}


.ui-theme-settings-panel { gap: 16px; }
.ui-theme-palette-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.ui-theme-palette-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
  cursor: pointer;
  color: var(--text);
}
.ui-theme-palette-card input,
.ui-theme-mode-option input { position: absolute; opacity: 0; pointer-events: none; }
.ui-theme-palette-card.active { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 2px var(--focus-ring); }
.ui-theme-card-header { display: flex; justify-content: space-between; gap: 6px; align-items: flex-start; }
.ui-theme-card-header > span:first-child { display: flex; flex-direction: column; gap: 2px; }
.ui-theme-card-header strong { font-size: var(--text-xs); line-height: 1.2; }
.ui-theme-card-header .muted { font-size: 11px; line-height: 1.25; }
.ui-theme-active-indicator { flex: 0 0 auto; font-size: 11px; font-weight: 800; color: var(--primary-strong); }
.ui-theme-swatches { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.ui-theme-swatches span { min-height: 20px; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.ui-theme-mode-control { display: inline-flex; width: fit-content; max-width: 100%; padding: 4px; gap: 4px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-subtle); }
.ui-theme-mode-option { min-width: 98px; display: grid; place-items: center; padding: 9px 14px; border-radius: var(--radius-sm); cursor: pointer; color: var(--muted-strong); font-weight: 800; }
.ui-theme-mode-label { display: inline-flex; align-items: center; gap: 7px; }
.ui-theme-mode-icon { width: 15px; height: 15px; border-radius: 999px; border: 2px solid currentColor; display: inline-block; position: relative; }
.ui-theme-mode-icon.light { color: var(--primary); background: color-mix(in srgb, var(--primary) 16%, transparent); }
.ui-theme-mode-icon.light::after { content: ''; position: absolute; inset: 4px; border-radius: inherit; background: currentColor; opacity: 0.72; }
.ui-theme-mode-icon.dark { color: var(--primary-strong); background: currentColor; box-shadow: inset -5px 0 0 var(--surface-subtle); }
.ui-theme-mode-option.active { background: var(--primary); color: #fff; }
.ui-theme-mode-option.active .ui-theme-mode-icon { color: currentColor; }
:root[data-theme="dark"] button { color: #0f172a; }
:root[data-theme="dark"] .secondary-button,
:root[data-theme="dark"] .secondary-button.active { color: var(--text); }
:root[data-theme="dark"] .ui-theme-mode-icon.dark { box-shadow: inset -5px 0 0 var(--surface); }
:root[data-theme="dark"] .ui-theme-mode-option.active { color: #0f172a; }
:root[data-theme="dark"] .nav-item {
  color: var(--text);
}
:root[data-theme="dark"] .nav-item:hover {
  color: var(--text-strong);
}
:root[data-theme="dark"] .nav-item.active,
:root[data-theme="dark"] .user-badge,
:root[data-theme="dark"] .ui-theme-active-indicator { color: var(--primary-strong); }
:root[data-theme="dark"] .nav-item span {
  color: var(--muted-strong);
}
:root[data-theme="dark"] .brand-mark { color: #0f172a; }
:root[data-theme="dark"] .pill,
:root[data-theme="dark"] .status-pill { background: var(--surface-tinted); border-color: var(--border); color: var(--text); }
:root[data-theme="dark"] .approval-review-context { background: var(--surface-tinted); border-color: var(--nav-active-border); color: var(--text); }

:root[data-theme="dark"] .market-signals-section,
:root[data-theme="dark"] .analytics-section,
:root[data-theme="dark"] .analytics-kpi-card,
:root[data-theme="dark"] .nba-detail {
  background: var(--surface-subtle);
  border-color: var(--border);
  color: var(--text);
}

:root[data-theme="dark"] .analytics-kpi-card span,
:root[data-theme="dark"] .nba-item .muted,
:root[data-theme="dark"] .nba-detail .muted {
  color: var(--muted-strong);
}

:root[data-theme="dark"] .analytics-kpi-card strong,
:root[data-theme="dark"] .nba-item strong,
:root[data-theme="dark"] .nba-detail strong {
  color: var(--text-strong);
}

:root[data-theme="dark"] .market-next-best-action,
:root[data-theme="dark"] .nba-item {
  background: var(--surface-tinted);
  border-color: var(--border);
  color: var(--text);
}

:root[data-theme="dark"] .nba-item:hover,
:root[data-theme="dark"] .nba-item.active {
  background: var(--surface-strong);
  border-color: var(--border-strong);
  color: var(--text);
}

:root[data-theme="dark"] .priority-critical { background: var(--danger-soft); color: var(--danger); }
:root[data-theme="dark"] .priority-high { background: var(--warning-soft); color: var(--warning); }
:root[data-theme="dark"] .priority-medium { background: var(--warning-soft); color: var(--warning); }
:root[data-theme="dark"] .priority-low { background: var(--success-soft); color: var(--success); }
.nav-category {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 8px;
  padding: 7px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface-subtle) 72%, transparent);
}
.nav-category-toggle {
  min-height: 28px;
  width: 100%;
  padding: 4px 7px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-strong);
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.075em;
  font-weight: 900;
  box-shadow: none;
}
.nav-category-toggle:hover { background: var(--surface-tinted); color: var(--text-strong); }
.nav-category-toggle::before { content: '▸'; margin-right: 6px; font-size: 10px; transform: translateY(-1px); color: currentColor; opacity: 0.72; }
.nav-category.expanded .nav-category-toggle::before { content: '▾'; }
.nav-category-toggle span:first-child { flex: 1 1 auto; }
.nav-category-items { display: flex; flex-direction: column; gap: 3px; margin-left: 14px; padding-left: 10px; }
.nav-category-items[hidden] { display: none; }
.nav-item > div { color: var(--muted-strong); font-weight: 800; font-size: 14px; line-height: 1.25; }
.nav-item-planned { cursor: default; border-style: dashed; color: var(--muted-strong); }
.nav-item-planned > div { color: var(--muted-strong); }
.nav-item-planned span:not(.planned-badge) { color: var(--muted); }
.planned-badge { display: inline-flex !important; margin: 0 0 0 5px !important; padding: 1px 5px; border-radius: 999px; background: var(--surface-tinted); color: var(--muted-strong); font-size: 10px !important; vertical-align: middle; }
.opportunity-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr); gap: 16px; align-items: start; }
.opportunity-region-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.opportunity-region-card { text-align: left; border: 1px solid rgba(148, 163, 184, 0.3); border-radius: 16px; padding: 14px; background: rgba(255, 255, 255, 0.72); color: var(--text); }
.opportunity-region-card:hover, .opportunity-region-card.active { border-color: var(--nav-active-border); box-shadow: var(--shadow); }
.opportunity-region-card.heat-high { background: linear-gradient(135deg, rgba(34, 197, 94, 0.18), rgba(255, 255, 255, 0.76)); }
.opportunity-region-card.heat-medium { background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(255, 255, 255, 0.76)); }
.opportunity-region-card.heat-low { background: linear-gradient(135deg, rgba(59, 130, 246, 0.14), rgba(255, 255, 255, 0.76)); }
.opportunity-region-card.heat-data_gap { background: linear-gradient(135deg, rgba(148, 163, 184, 0.18), rgba(255, 255, 255, 0.76)); }
.opportunity-score { font-size: 2rem; font-weight: 900; margin: 8px 0; color: var(--text-strong); }
.opportunity-focus-card .nba-filters { grid-template-columns: 1fr; margin-top: 12px; }
:root[data-theme="dark"] .nav-category { background: color-mix(in srgb, var(--surface-subtle) 76%, transparent); border-color: rgba(148, 163, 184, 0.2); }
:root[data-theme="dark"] .nav-category-toggle { color: var(--text-strong); }
:root[data-theme="dark"] .nav-category-toggle:hover { background: var(--surface-tinted); color: var(--text-strong); }
:root[data-theme="dark"] .nav-item > div { color: var(--muted-strong); }
:root[data-theme="dark"] .nav-item-planned { background: transparent; border-color: rgba(148, 163, 184, 0.18); color: var(--muted-strong); }
:root[data-theme="dark"] .planned-badge { background: rgba(148, 163, 184, 0.14); color: var(--muted-strong); }
:root[data-theme="dark"] .opportunity-region-card { background: rgba(15, 23, 42, 0.76); border-color: rgba(148, 163, 184, 0.22); }
:root[data-theme="dark"] .opportunity-region-card.heat-high { background: linear-gradient(135deg, rgba(34, 197, 94, 0.24), rgba(15, 23, 42, 0.76)); }
:root[data-theme="dark"] .opportunity-region-card.heat-medium { background: linear-gradient(135deg, rgba(245, 158, 11, 0.24), rgba(15, 23, 42, 0.76)); }
:root[data-theme="dark"] .opportunity-region-card.heat-low { background: linear-gradient(135deg, rgba(59, 130, 246, 0.22), rgba(15, 23, 42, 0.76)); }
:root[data-theme="dark"] .opportunity-region-card.heat-data_gap { background: linear-gradient(135deg, rgba(148, 163, 184, 0.2), rgba(15, 23, 42, 0.76)); }
@media (max-width: 980px) { .opportunity-layout { grid-template-columns: 1fr; } }


/* Opportunity map visual */
.opportunity-map-visual {
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, color-mix(in srgb, var(--surface-subtle) 90%, transparent), color-mix(in srgb, var(--surface) 96%, transparent));
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
.opportunity-map-base {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface-subtle) 86%, white 14%);
  min-height: 300px;
}
.opportunity-map-base img {
  display: block;
  width: 100%;
  height: auto;
  opacity: 0.72;
  filter: grayscale(0.72) saturate(0.24) contrast(0.9) brightness(1.08);
  mix-blend-mode: multiply;
}
.opportunity-map-overlay { position: absolute; inset: 0; pointer-events: none; }
.opportunity-map-marker {
  position: absolute;
  transform: translate(-50%, -50%);
  border: 2px solid color-mix(in srgb, var(--surface) 88%, white 12%);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.12);
  pointer-events: auto;
  white-space: nowrap;
}
.opportunity-map-marker span { position: relative; z-index: 1; }
.opportunity-map-marker::before {
  content: '';
  position: absolute;
  inset: -7px;
  border-radius: inherit;
  background: currentColor;
  opacity: 0.11;
}
.opportunity-map-marker em {
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-strong);
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  text-shadow: 0 1px 0 var(--surface), 0 -1px 0 var(--surface), 1px 0 0 var(--surface), -1px 0 0 var(--surface);
}
.opportunity-map-marker:hover,
.opportunity-map-marker.active { transform: translate(-50%, -50%) scale(1.08); z-index: 2; }
.opportunity-map-marker.heat-high,
.opportunity-map-legend i.heat-high { background: color-mix(in srgb, var(--success) 72%, var(--surface) 28%); color: color-mix(in srgb, var(--success) 72%, var(--surface) 28%); }
.opportunity-map-marker.heat-medium,
.opportunity-map-legend i.heat-medium { background: color-mix(in srgb, var(--warning) 68%, var(--surface) 32%); color: color-mix(in srgb, var(--warning) 68%, var(--surface) 32%); }
.opportunity-map-marker.heat-low,
.opportunity-map-legend i.heat-low { background: color-mix(in srgb, var(--primary) 68%, var(--surface) 32%); color: color-mix(in srgb, var(--primary) 68%, var(--surface) 32%); }
.opportunity-map-marker.heat-data_gap { background: var(--muted); color: var(--muted); }
.opportunity-map-marker span { color: #fff; }
.opportunity-map-legend { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin-top: 10px; font-size: var(--text-xs); color: var(--muted-strong); }
.opportunity-map-legend span { display: inline-flex; align-items: center; gap: 6px; }
.opportunity-map-legend i { width: 9px; height: 9px; border-radius: 999px; display: inline-block; }
:root[data-theme="dark"] .opportunity-map-visual { background: linear-gradient(135deg, rgba(15, 23, 42, 0.82), rgba(30, 41, 59, 0.62)); border-color: rgba(148, 163, 184, 0.22); }
:root[data-theme="dark"] .opportunity-map-base { background: rgba(226, 232, 240, 0.9); border-color: rgba(148, 163, 184, 0.2); }
:root[data-theme="dark"] .opportunity-map-base img { opacity: 0.68; filter: grayscale(0.82) saturate(0.22) contrast(0.88) brightness(1.02); mix-blend-mode: multiply; }
:root[data-theme="dark"] .opportunity-map-marker { border-color: rgba(15, 23, 42, 0.78); }
:root[data-theme="dark"] .opportunity-map-marker em { color: #0f172a; text-shadow: 0 1px 0 rgba(255,255,255,0.92), 0 -1px 0 rgba(255,255,255,0.92), 1px 0 0 rgba(255,255,255,0.92), -1px 0 0 rgba(255,255,255,0.92); }
@media (max-width: 720px) { .opportunity-map-base { min-height: 220px; } .opportunity-map-marker em { display: none; } }

.workload-summary-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.workload-kpi-card { min-height: 142px; }
.workload-coverage-note { margin: 16px 0; }
.workload-owner-table { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.workload-owner-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(180px, 1.6fr) repeat(4, minmax(70px, 0.55fr)) minmax(160px, 1.2fr);
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
  color: var(--text);
  text-align: left;
}
.workload-owner-row:hover { background: var(--surface-tinted); color: var(--text); }
.workload-owner-row.active { border-color: var(--nav-active-border); background: var(--primary-soft); }
.workload-owner-heading { background: transparent; border: none; padding: 0 14px; color: var(--muted); font-size: var(--text-xs); font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; }
.workload-owner-heading:hover { background: transparent; color: var(--muted); }
.workload-owner-row span { min-width: 0; overflow-wrap: anywhere; }
.workload-owner-row small { display: block; color: var(--muted); font-weight: 700; margin-top: 3px; }
.workload-task-list { margin-top: 14px; }
.workload-task-card { display: flex; flex-direction: column; gap: 12px; }
.workload-task-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 12px; }
.workload-task-grid > div { padding-top: 9px; border-top: 1px solid var(--border); min-width: 0; }
.workload-task-grid .eyebrow { display: block; margin-bottom: 3px; }
.workload-risk-row, .workload-link-row { gap: 8px; }
.workload-link-button { min-height: 34px; padding: 7px 10px; }
.workload-approval-backlink { margin-top: 2px; }

@media (max-width: 1180px) {
  .workload-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workload-owner-row { grid-template-columns: minmax(160px, 1.4fr) repeat(4, minmax(60px, 0.55fr)) minmax(140px, 1fr); }
  .workload-task-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .workload-summary-grid, .workload-task-grid { grid-template-columns: 1fr; }
  .workload-owner-heading { display: none; }
  .workload-owner-row { grid-template-columns: 1fr 1fr; }
  .workload-owner-row span:first-child, .workload-owner-row span:last-child { grid-column: 1 / -1; }
}

.account-intelligence-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.58fr) minmax(0, 1.42fr);
  gap: 16px;
  align-items: stretch;
  min-width: 0;
}
.account-intelligence-list-panel,
.account-intelligence-detail-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: calc(100vh - 172px);
  max-height: calc(100vh - 96px);
  overflow: hidden;
}
.account-intelligence-record-list,
.account-intelligence-detail-panel .account-intelligence-card-grid {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
}
.account-intelligence-record-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.account-intelligence-row {
  width: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  color: var(--text);
  text-align: left;
  box-shadow: none;
  cursor: pointer;
}
.account-intelligence-row:hover { background: var(--surface-tinted); color: var(--text); border-color: var(--border-strong); }
.account-intelligence-row.active { background: var(--primary-soft); border-color: var(--nav-active-border); }
.account-intelligence-row,
.account-intelligence-row * {
  opacity: 1 !important;
  visibility: visible !important;
}
.account-intelligence-row-name,
.account-intelligence-row-detail,
.account-intelligence-row-status {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-intelligence-row-name {
  color: var(--text-strong) !important;
  font-size: var(--text-sm);
  font-weight: 850;
  line-height: 1.25;
}
.account-intelligence-row-detail {
  color: var(--muted) !important;
  font-size: var(--text-xs);
  font-weight: 650;
  line-height: 1.25;
}
.account-intelligence-row-status {
  color: var(--muted-strong) !important;
  font-size: var(--text-xs);
  font-weight: 800;
  line-height: 1.25;
}
.account-intelligence-row-status.danger { color: var(--danger) !important; }
.account-intelligence-row-status.warning { color: var(--warning) !important; }
.account-intelligence-row-status.success { color: var(--success) !important; }
.account-intelligence-header {
  align-items: flex-start;
  flex-wrap: wrap;
  justify-content: flex-start;
  margin-bottom: 10px;
}
.account-intelligence-header > div { flex: 1 1 280px; }
.account-intelligence-header > .status-pill {
  flex: 0 0 auto;
  inline-size: auto;
  width: auto;
  min-width: max-content;
  max-width: none;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: keep-all;
  text-align: center;
}
.account-intelligence-safety-note {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-tinted);
  color: var(--muted-strong);
  font-weight: 700;
}
.account-intelligence-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  margin: 12px 0 14px;
}
.account-intelligence-actions .secondary-button { min-height: 34px; padding: 7px 10px; }
.account-intelligence-filter-label { margin-top: -4px; }
.account-intelligence-card-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  padding-right: 4px;
}
.account-intelligence-card { display: flex; flex-direction: column; gap: 10px; }
.account-intelligence-card-wide { grid-column: 1 / -1; }
.account-intelligence-card,
.account-intelligence-card * { min-width: 0; }
.account-intelligence-card .meta-row,
.account-intelligence-header .meta-row { align-items: flex-start; }
.account-intelligence-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}
.account-intelligence-metric {
  min-width: 0;
  padding-top: 9px;
  border-top: 1px solid var(--border);
}
.account-intelligence-metric .eyebrow,
.account-intelligence-metric strong,
.account-intelligence-metric small { display: block; overflow-wrap: anywhere; }
.account-intelligence-timeline,
.account-intelligence-timeline .timeline-item { max-width: 100%; overflow-x: hidden; }
.account-intelligence-timeline .timeline-item { overflow-wrap: anywhere; word-break: normal; }
.account-intelligence-provenance {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

@media (max-width: 1180px) {
  .account-intelligence-grid { grid-template-columns: 1fr; }
  .account-intelligence-list-panel,
  .account-intelligence-detail-panel { height: auto; min-height: auto; max-height: none; }
  .account-intelligence-record-list,
  .account-intelligence-detail-panel .account-intelligence-card-grid { overflow: visible; }
}

@media (max-width: 720px) {
  .account-intelligence-card-grid,
  .account-intelligence-metrics { grid-template-columns: 1fr; }
  .account-intelligence-list-card .account-title-row { grid-template-columns: 1fr; }
  .account-intelligence-list-card .status-pill { justify-self: start; max-width: 100%; }
}

.account-timeline-layout,
.account-timeline-layout * {
  min-width: 0;
  box-sizing: border-box;
}
.account-timeline-layout {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 100%;
  overflow-x: hidden;
}
.account-timeline-selector-panel,
.account-timeline-controls-panel,
.account-timeline-events-panel,
.account-timeline-coverage-panel {
  overflow-x: hidden;
}
.account-timeline-selector-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(180px, 0.6fr) minmax(220px, 0.8fr);
  gap: 12px;
  align-items: end;
}
.account-timeline-selector-grid h3 {
  margin: 2px 0 4px;
  overflow-wrap: anywhere;
}
.account-timeline-warning {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--warning) 45%, var(--border));
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--warning) 10%, var(--surface));
  color: var(--text-strong);
  overflow-wrap: anywhere;
}
.account-timeline-summary-row,
.account-timeline-nav-actions,
.account-timeline-coverage-pills,
.account-timeline-row-meta,
.account-timeline-gap-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 100%;
}
.account-timeline-summary-row { margin-top: 12px; }
.account-timeline-nav-actions { margin-top: 12px; }
.account-timeline-nav-actions .secondary-button,
.account-timeline-controls .secondary-button { min-height: 36px; padding: 7px 10px; }
.account-timeline-controls {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) minmax(150px, 0.35fr) auto;
  gap: 10px;
  align-items: end;
}
.account-timeline-coverage-pills { margin-top: 12px; }
.account-timeline-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.32fr);
  gap: 14px;
  align-items: start;
  max-width: 100%;
}
.account-timeline-events-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.account-timeline-group {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
  overflow: hidden;
}
.account-timeline-group-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-tinted);
  color: var(--muted-strong);
  font-size: var(--text-xs);
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.account-timeline-rows {
  display: flex;
  flex-direction: column;
}
.account-timeline-row {
  display: grid;
  grid-template-columns: minmax(92px, 0.18fr) minmax(0, 1fr) minmax(96px, auto);
  gap: 12px;
  align-items: start;
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.account-timeline-row:last-child { border-bottom: 0; }
.account-timeline-row:hover { background: var(--surface-tinted); }
.account-timeline-row-time {
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 750;
  overflow-wrap: anywhere;
}
.account-timeline-row-main {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.account-timeline-row-titleline {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}
.account-timeline-row-titleline strong,
.account-timeline-row-main p,
.account-timeline-row-meta .pill,
.account-timeline-coverage-list span,
.account-timeline-gap-list span {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: normal;
}
.account-timeline-row-main p {
  margin: 0;
  color: var(--text);
  font-size: var(--text-sm);
  line-height: 1.35;
}
.account-timeline-row-action {
  display: flex;
  justify-content: flex-end;
}
.account-timeline-row-link {
  white-space: normal;
  text-align: right;
  max-width: 120px;
}
.account-timeline-coverage-panel {
  position: sticky;
  top: 12px;
}
.account-timeline-coverage-panel h3 { margin-bottom: 6px; }
.account-timeline-coverage-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 12px 0;
}
.account-timeline-coverage-list span {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  color: var(--muted-strong);
}
.account-timeline-coverage-list strong { color: var(--text-strong); }

@media (max-width: 1180px) {
  .account-timeline-selector-grid,
  .account-timeline-main-grid { grid-template-columns: 1fr; }
  .account-timeline-coverage-panel { position: static; }
}

@media (max-width: 720px) {
  .account-timeline-controls { grid-template-columns: 1fr; }
  .account-timeline-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .account-timeline-row-action { justify-content: flex-start; }
  .account-timeline-row-link { text-align: left; max-width: 100%; }
  .account-timeline-group-header { align-items: flex-start; flex-direction: column; }
}

/* Pipeline Kanbans */
.pipeline-kanban-hero,
.pipeline-kanban-controls-panel,
.pipeline-kanban-coverage-note,
.pipeline-kanban-board,
.pipeline-kanban-column,
.pipeline-kanban-card {
  min-width: 0;
}

.pipeline-kanban-hero h2 {
  margin: 0 0 4px;
  color: var(--text-strong);
  font-size: var(--text-2xl);
}

.pipeline-kanban-safety {
  margin-top: 14px;
  padding: 11px 13px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--surface-tinted), var(--primary-soft));
  color: var(--text-strong);
  font-weight: 750;
  overflow-wrap: anywhere;
}

.pipeline-kanban-kpis,
.pipeline-kanban-card-pills {
  margin-top: 10px;
}

.pipeline-kanban-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.pipeline-kanban-filters {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(150px, 0.8fr) minmax(220px, 1.4fr);
  gap: 12px;
  align-items: end;
  min-width: 0;
}

.pipeline-kanban-filters label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  color: var(--muted-strong);
  font-size: var(--text-sm);
  font-weight: 750;
}

.pipeline-kanban-filters input,
.pipeline-kanban-filters select {
  min-width: 0;
  width: 100%;
}

.pipeline-kanban-board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(260px, 340px);
  gap: 14px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 2px 12px;
  max-width: 100%;
  scrollbar-color: var(--border-strong) transparent;
}

.pipeline-kanban-column {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface) 88%, var(--surface-tinted));
  box-shadow: var(--shadow);
  max-width: 340px;
}

.pipeline-kanban-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.pipeline-kanban-column-header h3 {
  margin: 0;
  color: var(--text-strong);
  font-size: var(--text-md);
  overflow-wrap: anywhere;
}

.pipeline-kanban-column-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.pipeline-kanban-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-strong);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.055);
}

.pipeline-kanban-card-title {
  color: var(--text-strong);
  font-weight: 850;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.pipeline-kanban-card-subtitle,
.pipeline-kanban-card-note,
.pipeline-kanban-card .muted,
.pipeline-kanban-empty {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: normal;
}

.pipeline-kanban-card-subtitle {
  color: var(--muted-strong);
  font-size: var(--text-sm);
  font-weight: 700;
}

.pipeline-kanban-card-note {
  color: var(--text);
  font-size: var(--text-sm);
  line-height: 1.35;
}

.pipeline-kanban-card-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

.pipeline-kanban-card-meta-grid > div {
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
}

.pipeline-kanban-card-meta-grid strong,
.pipeline-kanban-card-actions,
.pipeline-kanban-card-actions button,
.pipeline-kanban-card-pills .pill,
.pipeline-kanban-card-pills .status-pill {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  white-space: normal;
}

.pipeline-kanban-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.pipeline-kanban-action {
  min-height: 34px;
  padding: 7px 10px;
  text-align: left;
}

.pipeline-kanban-coverage-note p {
  margin: 6px 0 0;
  overflow-wrap: anywhere;
}

@media (max-width: 980px) {
  .pipeline-kanban-filters { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .pipeline-kanban-board {
    grid-auto-columns: minmax(250px, 86vw);
    gap: 10px;
  }
  .pipeline-kanban-column { max-width: none; }
  .pipeline-kanban-card-meta-grid { grid-template-columns: 1fr; }
}

.buying-signals-panel,
.buying-signals-panel * {
  min-width: 0;
}

.buying-signal-safety-strip {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface-tinted) 72%, var(--surface));
  color: var(--text);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.buying-signal-filters {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 10px;
  align-items: end;
}

.buying-signal-filters label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: var(--muted-strong);
  font-size: var(--text-sm);
  font-weight: 750;
}

.buying-signal-filters input,
.buying-signal-filters select {
  width: 100%;
  min-width: 0;
}

.buying-signals-layout {
  align-items: start;
}

.buying-signal-list,
.buying-signal-detail {
  min-width: 0;
}

.buying-signal-item {
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
}

.buying-signal-row-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
}

.buying-signal-row-head strong,
.buying-signal-title,
.buying-signal-item p,
.buying-signal-detail p,
.buying-signal-detail h4,
.buying-signal-detail h5 {
  overflow-wrap: anywhere;
}

.buying-signal-score {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 32px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--surface-subtle);
  border: 1px solid var(--border-strong);
  color: var(--text-strong);
  font-weight: 900;
}

.buying-signal-title {
  color: var(--text-strong);
  font-weight: 850;
  line-height: 1.25;
}

.buying-signal-chipline,
.buying-signal-nav-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.buying-signal-chipline .pill,
.buying-signal-nav-actions button,
.buying-signal-detail .pill,
.buying-signal-safety-strip .pill {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

@media (max-width: 1120px) {
  .buying-signal-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .buying-signal-filters { grid-template-columns: 1fr; }
  .buying-signal-row-head { flex-direction: column; }
}

.workload-owner-toggle { display: inline-flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.workload-owner-toggle .secondary-button { min-width: 52px; padding-inline: 14px; }
.workload-owner-toggle .secondary-button.active { background: var(--primary); border-color: var(--primary); color: #fff; }

.account-directory-panel { gap: 16px; }
.account-directory-panel > .detail-header { margin-bottom: 0; }
.account-directory-panel .account-directory-kpi-grid { margin-bottom: 0; }
.account-directory-column {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-strong);
  padding: 20px;
  box-shadow: none;
}
.account-directory-layout { align-items: stretch; }
.account-directory-layout .account-list-panel,
.account-directory-layout .account-detail-panel {
  min-height: calc(100vh - 260px);
  max-height: calc(100vh - 132px);
}
.account-directory-layout .account-card {
  min-height: auto;
  padding: 14px 15px;
  gap: 10px;
  border-radius: 18px;
}
.account-directory-layout .account-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
}
.account-directory-layout .account-card-title {
  display: block;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  -webkit-line-clamp: unset;
  line-height: 1.22;
}
.account-directory-layout .account-subtitle-line {
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.account-directory-layout .account-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}
.account-directory-layout .account-count-pill,
.account-directory-layout .account-meta-pill {
  justify-self: start;
  max-width: 100%;
  white-space: nowrap;
}
@media (max-width: 1180px) {
  .account-directory-layout .account-list-panel,
  .account-directory-layout .account-detail-panel { min-height: auto; max-height: none; }
}

.account-directory-layout { grid-template-columns: minmax(280px, 0.58fr) minmax(0, 1.42fr); }
.account-intelligence-kpi-grid { margin-bottom: 16px; }
@media (max-width: 1180px) { .account-directory-layout { grid-template-columns: 1fr; } }

.account-intelligence-panel { gap: 16px; }
.account-intelligence-panel > .detail-header { margin-bottom: 0; }
.account-intelligence-panel .account-intelligence-kpi-grid { margin-bottom: 0; }
.account-intelligence-filter-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 260px);
  gap: 12px;
  align-items: end;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-strong);
}
.account-intelligence-column {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-strong);
  padding: 20px;
  box-shadow: none;
}
.account-intelligence-column-heading { margin-bottom: 14px; }
.account-intelligence-column-heading h3 { margin-bottom: 4px; }
.account-intelligence-panel .account-intelligence-grid {
  grid-template-columns: minmax(280px, 0.58fr) minmax(0, 1.42fr);
  align-items: stretch;
}
.account-intelligence-panel .account-intelligence-list-panel,
.account-intelligence-panel .account-intelligence-detail-panel {
  min-height: calc(100vh - 300px);
  max-height: calc(100vh - 132px);
}
.account-intelligence-panel .account-intelligence-record-list { gap: 8px; }
.account-intelligence-panel .account-intelligence-row {
  padding: 13px 14px;
  border-radius: 18px;
  background: var(--surface-subtle);
}
.account-intelligence-panel .account-intelligence-row.active {
  background: var(--primary-soft);
  border-color: var(--nav-active-border);
}
.account-intelligence-panel .account-intelligence-card-grid { gap: 12px; padding-right: 4px; }
@media (max-width: 1180px) {
  .account-intelligence-panel .account-intelligence-grid,
  .account-intelligence-filter-bar { grid-template-columns: 1fr; }
  .account-intelligence-panel .account-intelligence-list-panel,
  .account-intelligence-panel .account-intelligence-detail-panel { min-height: auto; max-height: none; }
}

.account-timeline-context-divider {
  margin: 16px 0;
  border-top: 1px solid var(--border);
}
.account-timeline-selector-panel .account-timeline-controls {
  margin-top: 0;
}
.account-timeline-selector-panel .account-timeline-coverage-pills {
  margin-top: 12px;
}
.account-timeline-controls-panel { display: none; }

/* Account Intelligence restore: make list rows real readable cards, not empty chrome bars. */
.account-intelligence-panel .account-intelligence-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 5px !important;
  min-height: 84px !important;
  padding: 14px 16px !important;
  border-radius: 18px !important;
  background: var(--surface-strong) !important;
  color: var(--text) !important;
  box-shadow: none !important;
}
.account-intelligence-panel .account-intelligence-row:hover {
  background: var(--surface-tinted) !important;
  color: var(--text) !important;
}
.account-intelligence-panel .account-intelligence-row.active {
  background: var(--primary-soft) !important;
  border-color: var(--nav-active-border) !important;
}
.account-intelligence-panel .account-intelligence-row-name,
.account-intelligence-panel .account-intelligence-row-detail,
.account-intelligence-panel .account-intelligence-row-status {
  display: block !important;
  height: auto !important;
  min-height: 0 !important;
  opacity: 1 !important;
  visibility: visible !important;
  text-indent: 0 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
.account-intelligence-panel .account-intelligence-row-name {
  color: var(--text-strong) !important;
  font-size: var(--text-sm) !important;
  font-weight: 850 !important;
}
.account-intelligence-panel .account-intelligence-row-detail {
  color: var(--muted-strong) !important;
  font-size: var(--text-xs) !important;
  font-weight: 650 !important;
}
.account-intelligence-panel .account-intelligence-row-status {
  color: var(--muted-strong) !important;
  font-size: var(--text-xs) !important;
  font-weight: 800 !important;
}
.account-intelligence-panel .account-intelligence-row-status.danger { color: var(--danger) !important; }
.account-intelligence-panel .account-intelligence-row-status.warning { color: var(--warning) !important; }
.account-intelligence-panel .account-intelligence-row-status.success { color: var(--success) !important; }
