/* ── n8n brand — Geomanist + design tokens ─────────────────────────────── */
@font-face { font-family: 'Geomanist'; src: url('/fonts/Geomanist-Light.otf') format('opentype'); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: 'Geomanist'; src: url('/fonts/Geomanist-Regular.otf') format('opentype'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Geomanist'; src: url('/fonts/Geomanist-Book.otf') format('opentype'); font-weight: 500; font-style: normal; font-display: swap; }

:root {
  /* Brand */
  --n8n: #EA4B71;
  --n8n-dark: #C73E5E;
  --n8n-tint: rgba(234, 75, 113, 0.10);
  --n8n-tint-strong: rgba(234, 75, 113, 0.18);
  /* Light theme (default) */
  --bg: #fafafa;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --surface-3: #f3f4f6;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --text: #0f0f0f;
  --text-muted: #6b7280;
  --text-faint: #9ca3af;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08);
}

[data-theme="dark"] {
  --bg: #0a0a0a;
  --surface: #181818;
  --surface-2: #141414;
  --surface-3: #232323;
  --border: #2a2a2a;
  --border-strong: #3a3a3a;
  --text: #f4f4f5;
  --text-muted: #a1a1aa;
  --text-faint: #71717a;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.4);
  --shadow-md: 0 4px 12px rgba(0,0,0,.5);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html,
body { overflow-x: clip; }
body { font-family: 'Geomanist', -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif; background: var(--bg); color: var(--text); font-size: 13px; letter-spacing: -0.005em; -webkit-font-smoothing: antialiased; }

/* Top brand accent line */
.brand-bar { height: 3px; background: linear-gradient(90deg, var(--n8n) 0%, var(--n8n-dark) 50%, var(--n8n) 100%); position: sticky; top: 0; z-index: 101; }

/* Header — matches Odin's two-row app menu: brand controls above, nav below. */
.header { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 3px; z-index: 100; }
.header-top { max-width: 1280px; height: 64px; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.header-logo { display: flex; align-items: center; gap: 12px; flex: 0 1 auto; min-width: 0; }
.header-logo img,
.header-logo .n8n-logo { height: 24px; width: auto; color: var(--text); display: block; }
.header-divider { width: 1px; height: 20px; background: var(--border-strong); }
.header h1 { font-size: 15px; font-weight: 500; color: var(--text); white-space: nowrap; letter-spacing: 0; overflow: hidden; text-overflow: ellipsis; max-width: min(46vw, 360px); }
.header h1 span { color: var(--text-muted); font-weight: 400; }
.theme-toggle { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--border); background: transparent; color: var(--text-muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: all .12s; font-size: 14px; }
.theme-toggle:hover { background: var(--surface-2); color: var(--text); }
.header-link { font-size: 11px; color: var(--text-muted); background: transparent; border: 1px solid var(--border); padding: 0 8px; border-radius: 6px; cursor: pointer; font-family: inherit; transition: all .12s; height: 32px; display: inline-flex; align-items: center; gap: 6px; line-height: 1; }
.header-link:hover { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }
.header-link-icon { width: 14px; height: 14px; border: 1.5px solid currentColor; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 800; font-family: ui-sans-serif, system-ui, sans-serif; line-height: 1; }
.header-beta { padding: 2px 5px; border-radius: 4px; background: #fef3c7; color: #92400e; font-size: 9px; font-weight: 750; text-transform: uppercase; letter-spacing: .04em; }
.user-chip { padding: 5px 12px; background: var(--n8n-tint); color: var(--n8n-dark); border-radius: 18px; font-size: 12px; font-weight: 600; display: flex; gap: 5px; align-items: center; height: 28px; }
.header-right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* Controls */
/* ── Toolbar ──────────────────────────────────────────────────────────────
   Every filter element shares the same height (28px), border-radius (8px),
   and font (12px / 500). Three visual idioms only:
   1. Segmented toggle — light grey tray, white active pill (csm-toggle)
   2. Pill button       — outlined, rounded-full (tier-btn)
   3. Field             — label + select/input (filter-field, search-wrap)
*/
.controls { background: var(--surface); border-bottom: 1px solid var(--border); padding: 10px 24px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; position: sticky; top: 110px; z-index: 99; }

/* Segmented toggle */
.csm-toggle { display: inline-flex; background: #f3f4f6; border-radius: 8px; padding: 3px; gap: 2px; }
.csm-btn { height: 22px; border: none; background: transparent; padding: 0 12px; border-radius: 6px; font-size: 12px; font-weight: 500; cursor: pointer; color: #6b7280; transition: all .15s; white-space: nowrap; }
.csm-btn:hover { color: #111; }
.csm-btn.active { background: #fff; color: #111; box-shadow: 0 1px 3px rgba(0,0,0,.12); font-weight: 600; }
.csm-btn[data-csm="MY"].active { background: #fef3c7; color: #92400e; }

/* Tier pill buttons */
.tier-group { display: inline-flex; gap: 4px; }
.tier-btn { height: 28px; background: #fff; border: 1.5px solid #e5e7eb; padding: 0 12px; border-radius: 14px; font-size: 12px; font-weight: 600; color: #6b7280; cursor: pointer; transition: all .12s; }
.tier-btn:hover { border-color: #c7d2fe; color: #111; }
.tier-btn.active-T0 { background: #fef3c7; border-color: #f59e0b; color: #92400e; }
.tier-btn.active-T1 { background: #dbeafe; border-color: #3b82f6; color: #1e40af; }
.tier-btn.active-T2 { background: #f3f4f6; border-color: #9ca3af; color: #374151; }
.tier-btn.active-T3 { background: #fef2f2; border-color: #fca5a5; color: #991b1b; }
.tier-btn.active-ALL { background: #111; border-color: #111; color: #fff; }

/* Field (label + select/input) */
.filter-field { display: inline-flex; align-items: center; gap: 6px; height: 28px; }
.filter-label { font-size: 11px; color: #9ca3af; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.filter-select { height: 28px; border: 1.5px solid #e5e7eb; border-radius: 8px; padding: 0 28px 0 10px; font-size: 12px; font-weight: 500; color: #374151; background: #fff url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3e%3cpath fill='none' stroke='%236b7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' d='M1 1l4 4 4-4'/%3e%3c/svg%3e") no-repeat right 10px center; appearance: none; cursor: pointer; outline: none; transition: border .12s; max-width: 220px; }
.filter-select:hover { border-color: #c7d2fe; }
.filter-select:focus { border-color: #6366f1; }

.search-wrap { display: inline-flex; align-items: center; }
.search-wrap input { height: 28px; border: 1.5px solid #e5e7eb; border-radius: 8px; padding: 0 12px 0 30px; font-size: 12px; font-weight: 500; width: 240px; outline: none; transition: border .12s; background: #fff url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2'%3e%3ccircle cx='11' cy='11' r='8'/%3e%3cpath d='m21 21-4.3-4.3'/%3e%3c/svg%3e") no-repeat 10px center; }
.search-wrap input:hover { border-color: #c7d2fe; }
.search-wrap input:focus { border-color: #6366f1; }

/* Table */
/* Content wrappers — mirror max-w-7xl mx-auto px-6 py-8 from sales-enablement-app */
.table-wrap { max-width: 1280px; margin: 0 auto; padding: 24px 24px 32px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow-sm); }
thead th { background: #f9fafb; padding: 8px 10px; text-align: left; font-size: 11px; font-weight: 600; color: #6b7280; text-transform: uppercase; letter-spacing: .04em; cursor: pointer; user-select: none; border-bottom: 1px solid #e5e7eb; white-space: nowrap; }
thead th:hover { background: #f1f5f9; color: #374151; }
thead th.th-icon { text-align: center; }
thead th .sort-icon { margin-left: 4px; opacity: .4; }
thead th.sorted .sort-icon { opacity: 1; color: #6366f1; }
tbody tr { border-bottom: 1px solid #f3f4f6; transition: background .1s; cursor: pointer; }
tbody tr:hover { background: #fafbff; }
tbody tr.expanded { background: #f9fafb; }
tbody tr.has-prio { background: #fffbeb; }
tbody tr.has-prio:hover { background: #fef3c7; }
tbody td { padding: 7px 10px; vertical-align: middle; }

.badge { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 20px; border-radius: 4px; font-size: 11px; font-weight: 700; }
.badge-T0 { background: #fef3c7; color: #92400e; }
.badge-T1 { background: #dbeafe; color: #1e40af; }
.badge-T2 { background: #f3f4f6; color: #374151; }
.badge-T3 { background: #fef2f2; color: #991b1b; }

.score-cell { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.score-bar-bg { width: 50px; height: 5px; background: #e5e7eb; border-radius: 3px; flex-shrink: 0; }
.score-bar-fill { height: 100%; border-radius: 3px; transition: width .25s ease; }
.score-num { font-size: 12px; font-weight: 700; color: #111; min-width: 26px; }

.csm-chip { display: inline-block; padding: 2px 7px; border-radius: 4px; font-size: 11px; font-weight: 500; white-space: nowrap; }
.csm-chip-named { background: #eff6ff; color: #2563eb; }
.csm-chip-scaled { background: #f5f3ff; color: #7c3aed; }
.csm-chip-none { background: #f9fafb; color: #9ca3af; }

.perf { font-size: 11px; padding: 2px 6px; border-radius: 4px; font-weight: 500; }
.perf-Champion { background: #d1fae5; color: #065f46; }
.perf-Expansion { background: #dbeafe; color: #1e40af; }
.perf-Healthy { background: #f0fdf4; color: #166534; }
.perf-Risk { background: #fef2f2; color: #991b1b; }
.perf-Underutilizing { background: #fef3c7; color: #78350f; }
.perf-Unknown { background: #f9fafb; color: #9ca3af; }

.f500 { font-size: 10px; background: #fef9c3; color: #713f12; padding: 1px 5px; border-radius: 3px; font-weight: 700; margin-left: 4px; }

.prio-cell { text-align: center; }
.prio-star { font-size: 16px; color: #d1d5db; cursor: pointer; user-select: none; transition: color .12s, transform .12s; }
.prio-star:hover { transform: scale(1.2); }
.prio-star.on { color: #f59e0b; }

.perf-flag { display: inline-block; margin-left: 4px; font-size: 10px; padding: 1px 5px; border-radius: 3px; font-weight: 600; vertical-align: middle; }
.flag-no-usage { background: #fef2f2; color: #991b1b; border: 1px solid #fca5a5; }
.flag-rampup { background: #ecfdf5; color: #047857; border: 1px solid #6ee7b7; }

.status-cell { min-width: 150px; }
.status-select { height: 26px; font-family: inherit; font-size: 11px; font-weight: 500; padding: 0 24px 0 10px; border: 1px solid #e5e7eb; border-radius: 13px; background: #fff url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 10 6'%3e%3cpath fill='none' stroke='%239ca3af' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' d='M1 1l4 4 4-4'/%3e%3c/svg%3e") no-repeat right 9px center; appearance: none; cursor: pointer; max-width: 150px; width: 100%; color: #374151; transition: all .12s; outline: none; }
.status-select option { font-family: 'Geomanist', -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif; }
.status-select:hover { border-color: #c7d2fe; }
.status-select:focus { border-color: #6366f1; }
.status-select.empty { color: #9ca3af; font-style: italic; }
/* Color-coded status backgrounds when set */
.status-select[data-status="Reached out"]            { background-color: #fef3c7; border-color: #fcd34d; color: #92400e; }
.status-select[data-status="In conversation"]        { background-color: #dbeafe; border-color: #93c5fd; color: #1e40af; }
.status-select[data-status="Yes – running case study"] { background-color: #d1fae5; border-color: #6ee7b7; color: #065f46; }
.status-select[data-status="Declined"]               { background-color: #fef2f2; border-color: #fca5a5; color: #991b1b; }
.status-select[data-status="Not a fit"]              { background-color: #f9fafb; border-color: #d1d5db; color: #6b7280; }

.expand-row td { padding: 0; }
.expand-inner { padding: 14px 16px; background: #f9fafb; border-top: 1px solid #e5e7eb; display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.expand-left, .expand-right { display: flex; flex-direction: column; gap: 10px; }
.reasoning { font-size: 12px; color: #374151; line-height: 1.55; }
.sub-scores { display: flex; gap: 14px; flex-wrap: wrap; padding: 8px 10px; background: #fff; border-radius: 6px; border: 1px solid #e5e7eb; }
.sub { font-size: 11px; color: #6b7280; }
.sub b { color: #111; }
.sub.csm-dim b { color: #b45309; }
.meta-row { display: flex; gap: 16px; flex-wrap: wrap; font-size: 11px; color: #6b7280; }
.meta-row span b { color: #374151; }

.notes-area { width: 100%; min-height: 60px; padding: 8px; border: 1px solid #e5e7eb; border-radius: 6px; font-size: 12px; font-family: inherit; resize: vertical; }
.notes-area:focus { outline: none; border-color: #6366f1; }
.interest-input { width: 100%; padding: 6px 8px; border: 1px solid #e5e7eb; border-radius: 6px; font-size: 12px; font-family: inherit; }
.interest-input:focus { outline: none; border-color: #6366f1; }
.label { font-size: 11px; font-weight: 600; color: #6b7280; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.last-edited { font-size: 11px; color: #9ca3af; }
.save-btn { padding: 6px 14px; background: #111; color: #fff; border: none; border-radius: 6px; font-size: 12px; font-weight: 600; cursor: pointer; }
.save-btn:hover { background: #374151; }
.save-btn:disabled { background: #d1d5db; cursor: default; }
.save-btn.saved { background: #059669; }

.co { font-weight: 600; color: #111; }
.domain { font-size: 11px; color: #9ca3af; font-weight: 400; }
.usage { font-size: 11px; color: #374151; white-space: nowrap; }
.empty { text-align: center; padding: 60px; color: #9ca3af; font-size: 14px; }
.footer { text-align: center; padding: 16px; font-size: 11px; color: #d1d5db; }

/* Modal */
.modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); z-index: 1000; align-items: center; justify-content: center; padding: 20px; }
.modal.show { display: flex; }
.modal-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 24px; max-width: 460px; width: 100%; max-height: 80vh; overflow-y: auto; box-shadow: 0 25px 50px -12px rgba(0,0,0,.25); }
.modal-card h2 { font-size: 18px; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 6px; }
.muted { color: #6b7280; font-size: 12px; margin-bottom: 14px; }
.csm-list { display: flex; flex-direction: column; gap: 4px; }
.csm-list-section { margin-top: 12px; }
.csm-list-section h3 { font-size: 11px; font-weight: 700; color: #9ca3af; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.csm-list button { padding: 9px 12px; background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 7px; font-size: 13px; cursor: pointer; text-align: left; transition: all .12s; }
.csm-list button:hover { background: #eff6ff; border-color: #93c5fd; }

/* ── Chat agent ───────────────────────────────────────────────────────────── */
.chat-fab { position: fixed; right: 20px; bottom: 20px; width: 52px; height: 52px; border-radius: 26px; border: none; background: #EA4B71; color: #fff; font-size: 22px; cursor: pointer; box-shadow: 0 6px 18px rgba(234, 75, 113, 0.35); z-index: 200; transition: transform .15s, background .15s; }
.chat-fab:hover { background: #C73E5E; transform: translateY(-2px); }
.chat-fab.hidden { display: none; }

.chat-panel { position: fixed; right: 20px; bottom: 20px; width: 400px; max-width: calc(100vw - 40px); height: 70vh; max-height: 720px; background: #fff; border-radius: 14px; box-shadow: 0 16px 48px rgba(15,23,42,.18); display: flex; flex-direction: column; z-index: 201; transform: translateY(20px) scale(.96); opacity: 0; pointer-events: none; transition: transform .18s, opacity .18s; }
.chat-panel.show { transform: none; opacity: 1; pointer-events: auto; }

.chat-head { padding: 14px 16px; border-bottom: 1px solid #e5e7eb; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.chat-title { font-size: 14px; font-weight: 700; color: #111; }
.chat-sub { font-size: 11px; color: #9ca3af; margin-top: 2px; }
.chat-close { background: transparent; border: none; cursor: pointer; font-size: 18px; color: #9ca3af; padding: 4px 8px; border-radius: 5px; }
.chat-close:hover { background: #f3f4f6; color: #111; }

.chat-body { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.chat-empty { color: #9ca3af; font-size: 12px; line-height: 1.6; }
.chat-empty ul { margin-top: 6px; padding-left: 16px; }
.chat-empty li { margin-bottom: 3px; }

.msg { max-width: 90%; padding: 8px 12px; border-radius: 10px; font-size: 13px; line-height: 1.5; word-wrap: break-word; }
.msg.user { align-self: flex-end; background: #EA4B71; color: #fff; border-bottom-right-radius: 3px; }
.msg.assistant { align-self: flex-start; background: #f3f4f6; color: #111; border-bottom-left-radius: 3px; }
.msg.error { align-self: stretch; background: #fef2f2; color: #991b1b; border: 1px solid #fca5a5; }
.msg p { margin: 0; }
.msg p + p { margin-top: 6px; }
.msg ul, .msg ol { margin: 4px 0 4px 18px; }
.msg li { margin-bottom: 2px; }
.msg code { background: rgba(0,0,0,.06); padding: 1px 4px; border-radius: 3px; font-size: 12px; }
.msg.user code { background: rgba(255,255,255,.2); }
.msg table { font-size: 11px; border-collapse: collapse; margin: 6px 0; }
.msg th, .msg td { padding: 3px 6px; border: 1px solid rgba(0,0,0,.1); text-align: left; }
.msg.user table th, .msg.user table td { border-color: rgba(255,255,255,.25); }

.tool-events { display: flex; flex-direction: column; gap: 3px; align-self: flex-start; max-width: 90%; }
.tool-event { font-size: 11px; color: #6b7280; background: #f9fafb; border: 1px solid #e5e7eb; padding: 4px 8px; border-radius: 5px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.tool-event b { color: #4338ca; }

.chat-thinking { align-self: flex-start; color: #9ca3af; font-size: 12px; padding: 4px 0; display: flex; gap: 4px; align-items: center; }
.chat-thinking .dot { width: 4px; height: 4px; background: #9ca3af; border-radius: 50%; animation: pulse 1.4s infinite ease-in-out; }
.chat-thinking .dot:nth-child(2) { animation-delay: .2s; }
.chat-thinking .dot:nth-child(3) { animation-delay: .4s; }
@keyframes pulse { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }

.chat-form { padding: 10px 12px; border-top: 1px solid #e5e7eb; display: flex; gap: 6px; align-items: flex-end; }
.chat-form textarea { flex: 1; resize: none; border: 1px solid #e5e7eb; border-radius: 8px; padding: 8px 10px; font-size: 13px; font-family: inherit; outline: none; max-height: 120px; }
.chat-form textarea:focus { border-color: #EA4B71; }
.chat-send { width: 34px; height: 34px; border: none; border-radius: 8px; background: #EA4B71; color: #fff; font-size: 16px; cursor: pointer; flex-shrink: 0; }
.chat-send:hover { background: #C73E5E; }
.chat-send:disabled { background: #d1d5db; cursor: default; }

.chat-disabled-banner { background: #fef3c7; color: #92400e; padding: 8px 12px; font-size: 12px; border-radius: 6px; margin: 0 4px; }

/* ── Ask Saga workspace ──────────────────────────────────────────────────── */
.agent-shell { height: calc(100vh - 110px); min-height: 520px; display: grid; grid-template-columns: 280px minmax(0, 1fr); background: var(--surface); transition: grid-template-columns .2s ease; position: relative; }
.agent-shell.agent-rail-closed { grid-template-columns: 0 minmax(0, 1fr); }
.agent-rail { min-width: 0; border-right: 1px solid var(--border); background: color-mix(in srgb, var(--surface-2) 68%, var(--surface)); overflow: hidden; display: flex; flex-direction: column; }
.agent-rail-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; min-width: 280px; }
.agent-new-btn { flex: 1; height: 32px; border: 0; background: transparent; color: var(--text-muted); border-radius: 6px; cursor: pointer; font-size: 12px; font-weight: 650; display: inline-flex; align-items: center; justify-content: flex-start; gap: 7px; padding: 0 9px; transition: background .12s, color .12s; }
.agent-new-btn:hover { background: var(--surface-3); color: var(--text); }
.agent-new-btn.active { background: var(--n8n-tint); color: var(--n8n-dark); }
.agent-icon-btn { width: 32px; height: 32px; border: 0; background: transparent; color: var(--text-faint); border-radius: 6px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font: inherit; font-size: 16px; line-height: 1; transition: background .12s, color .12s; }
.agent-icon-btn:hover { background: var(--surface-3); color: var(--text); }
.agent-history { min-height: 0; display: flex; flex-direction: column; gap: 7px; flex: 1; padding: 0 10px 14px; min-width: 280px; }
.agent-history-list { display: flex; flex-direction: column; gap: 12px; min-height: 0; overflow-y: auto; padding: 0 2px 2px; }
.agent-history-group { display: flex; flex-direction: column; gap: 2px; }
.agent-history-group-label { color: var(--text-faint); font-size: 10px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; padding: 7px 8px 4px; }
.agent-history-item { width: 100%; border: 0; background: transparent; color: var(--text); border-radius: 7px; padding: 8px 9px; text-align: left; cursor: pointer; display: grid; gap: 2px; transition: background .12s, color .12s; }
.agent-history-item:hover { background: var(--surface-3); }
.agent-history-item.active { background: var(--n8n-tint); color: var(--n8n-dark); }
.agent-history-item span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 550; }
.agent-history-item small, .agent-history-empty { color: var(--text-muted); font-size: 11px; }
.agent-history-item.active small { color: color-mix(in srgb, var(--n8n-dark) 70%, var(--text-muted)); }
.agent-history-empty { padding: 10px 8px; line-height: 1.45; }
.agent-rail-label { color: var(--text-faint); font-size: 10px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; padding: 4px 8px 2px; }
.agent-main { min-width: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; background: var(--surface); }
.agent-shell.agent-rail-closed .agent-main { grid-template-rows: auto auto minmax(0, 1fr) auto; }
.agent-mini-toolbar { display: none; align-items: center; gap: 2px; padding: 8px 12px 0; }
.agent-shell.agent-rail-closed .agent-mini-toolbar { display: flex; }
.agent-mobile-bar { display: none; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.agent-mobile-new { border: 0; background: transparent; color: var(--n8n); border-radius: 6px; cursor: pointer; padding: 6px 8px; font: inherit; font-size: 12px; font-weight: 650; display: inline-flex; align-items: center; gap: 5px; }
.agent-mobile-new:hover { background: var(--n8n-tint); }
.agent-mobile-new.active { background: var(--n8n-tint); color: var(--n8n-dark); }
.agent-panel-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.agent-shell.agent-rail-closed .agent-panel-head { border-top: 0; }
.agent-panel-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.agent-panel-mark { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; background: var(--n8n-tint); color: var(--n8n); flex-shrink: 0; font-size: 14px; }
.agent-panel-name { color: var(--text); font-size: 13px; font-weight: 700; line-height: 1.2; }
.agent-panel-sub { color: var(--text-muted); font-size: 11px; line-height: 1.25; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: min(62vw, 560px); }
.agent-thread { min-height: 0; overflow-y: auto; padding: 30px 32px 18px; background: var(--surface); }
.agent-empty { max-width: 720px; margin: 8vh auto 0; text-align: center; color: var(--text-muted); }
.agent-mark { width: 38px; height: 38px; border-radius: 19px; margin: 0 auto 14px; display: grid; place-items: center; background: #fff1f5; color: var(--n8n); border: 1px solid rgba(234, 75, 113, .25); font-size: 18px; }
.agent-empty h2 { color: var(--text); font-size: 24px; margin-bottom: 8px; letter-spacing: 0; }
.agent-empty p { font-size: 14px; line-height: 1.55; margin: 0 auto 18px; max-width: 560px; }
.agent-message-list { max-width: 860px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.agent-msg { display: flex; flex-direction: column; gap: 6px; max-width: 78%; }
.agent-msg.user { align-self: flex-end; }
.agent-msg.assistant { align-self: flex-start; max-width: min(94%, 920px); }
.agent-msg-bubble { border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; font-size: 13px; line-height: 1.55; background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.agent-msg.user .agent-msg-bubble { background: var(--n8n); border-color: var(--n8n); color: #fff; }
.agent-msg-bubble h3,
.agent-msg-bubble h4,
.agent-msg-bubble h5 { color: var(--text); margin: 10px 0 6px; line-height: 1.25; letter-spacing: 0; }
.agent-msg-bubble h3 { font-size: 15px; }
.agent-msg-bubble h4,
.agent-msg-bubble h5 { font-size: 14px; }
.agent-msg-bubble p { margin: 0; }
.agent-msg-bubble p + p { margin-top: 8px; }
.agent-msg-bubble a { color: var(--n8n-dark); font-weight: 700; text-decoration: none; }
.agent-msg-bubble a:hover { text-decoration: underline; }
.agent-msg-bubble ul,
.agent-msg-bubble ol { margin: 6px 0 0 18px; padding: 0; }
.agent-msg-bubble li { margin-bottom: 4px; }
.agent-msg-bubble code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.agent-table-wrap { margin: 9px -4px 2px; max-width: 100%; overflow-x: auto; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.agent-table-wrap table { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 12px; line-height: 1.35; }
.agent-table-wrap th { background: var(--surface-2); color: var(--text-muted); font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .035em; text-align: left; }
.agent-table-wrap th, .agent-table-wrap td { padding: 8px 9px; border-bottom: 1px solid var(--border); vertical-align: top; }
.agent-table-wrap th[data-agent-sort-col] { cursor: pointer; user-select: none; }
.agent-sort-btn { width: 100%; border: 0; padding: 0; margin: 0; background: transparent; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: left; cursor: pointer; }
.agent-sort-icon { opacity: .38; font-size: 11px; }
.agent-table-wrap th.sorted { color: var(--text); }
.agent-table-wrap th.sorted .agent-sort-icon { opacity: 1; color: var(--n8n); }
.agent-table-wrap tbody tr:last-child td { border-bottom: none; }
.agent-table-wrap tbody tr:hover { background: rgba(234, 75, 113, .045); }
.agent-table-wrap td:first-child a { white-space: nowrap; }
.agent-table-wrap .agent-action-pill { vertical-align: middle; }
.agent-thinking { width: 54px; border: 1px solid var(--border); border-radius: 8px; padding: 11px 12px; background: var(--surface); display: flex; gap: 4px; }
.agent-thinking span { width: 6px; height: 6px; border-radius: 50%; background: var(--text-muted); animation: pulse 1.3s infinite ease-in-out; }
.agent-thinking span:nth-child(2) { animation-delay: .18s; }
.agent-thinking span:nth-child(3) { animation-delay: .36s; }
.agent-input-dock { background: linear-gradient(to top, var(--surface) 76%, color-mix(in srgb, var(--surface) 0%, transparent)); padding: 16px 28px 18px; }
.agent-form { max-width: 860px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) 40px; align-items: end; gap: 8px; border: 1px solid var(--border); border-radius: 10px; padding: 6px; background: var(--surface); box-shadow: var(--shadow-sm); }
.agent-form:focus-within { border-color: rgba(234, 75, 113, .50); box-shadow: 0 0 0 3px rgba(234, 75, 113, .09); }
.agent-form textarea { width: 100%; min-height: 34px; max-height: 140px; resize: none; border: 0; border-radius: 7px; padding: 8px 8px; background: transparent; color: var(--text); font: inherit; font-size: 13px; line-height: 1.45; outline: none; }
.agent-form textarea:focus { box-shadow: none; }
.agent-send { width: 40px; height: 40px; border: none; border-radius: 8px; background: var(--n8n); color: #fff; cursor: pointer; font-size: 18px; font-weight: 700; }
.agent-send:disabled { background: #d1d5db; cursor: default; }
.agent-disclaimer { max-width: 860px; margin: 7px auto 0; color: var(--text-muted); font-size: 11px; }

/* ── Tabs ─────────────────────────────────────────────────────────────────── */
/* Tabs in header — compact Odin-style nav row. */
.tabs { max-width: 1280px; margin: 0 auto; padding: 0 24px; display: flex; gap: 4px; align-items: stretch; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { background: transparent; border: none; padding: 10px 12px; font-size: 13px; font-weight: 500; color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .12s, border-color .12s; letter-spacing: 0; display: inline-flex; align-items: center; white-space: nowrap; flex: 0 0 auto; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--n8n); font-weight: 600; }

.view { display: none; }
.view.active { display: block; }
/* triage controls already sticky at 53; tabs push it: override */
.view-triage .controls { top: 110px; }

/* ── Pipeline / Kanban ────────────────────────────────────────────────────── */
.pipeline-controls { max-width: 1280px; margin: 0 auto; padding: 24px 24px 0; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.pipeline-mode-btn { border: none; background: transparent; padding: 5px 12px; border-radius: 6px; font-size: 12px; font-weight: 500; cursor: pointer; color: #6b7280; transition: all .15s; white-space: nowrap; }
.pipeline-mode-btn.active { background: #fff; color: #111; box-shadow: 0 1px 3px rgba(0,0,0,.12); font-weight: 600; }

.pipeline-stats { display: flex; gap: 10px; margin-left: auto; }
.pipeline-stats .stat-pill { background: #fff; border: 1px solid #e5e7eb; border-radius: 7px; padding: 5px 11px; font-size: 11px; color: #6b7280; }
.pipeline-stats .stat-pill b { color: #111; font-weight: 700; font-size: 13px; margin-right: 3px; }
.pipeline-stats .stat-pill.pct { color: #059669; }
.pipeline-stats .stat-pill.pct b { color: #047857; }

.kanban { padding: 16px 24px 24px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; min-height: calc(100vh - 200px); }
.kanban-col { background: #f3f4f6; border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 200px; }
.kanban-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 8px; border-bottom: 2px solid; margin-bottom: 4px; }
.kanban-col[data-stage="reached_out"] .kanban-head { border-color: #f59e0b; }
.kanban-col[data-stage="in_conversation"] .kanban-head { border-color: #3b82f6; }
.kanban-col[data-stage="won"] .kanban-head { border-color: #10b981; }
.kanban-col[data-stage="lost"] .kanban-head { border-color: #9ca3af; }
.kanban-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #374151; }
.kanban-count { font-size: 11px; color: #6b7280; background: #fff; border-radius: 10px; padding: 2px 8px; font-weight: 600; }

.kard { background: #fff; border-radius: 8px; padding: 10px; border: 1px solid #e5e7eb; cursor: pointer; transition: all .12s; position: relative; display: flex; flex-direction: column; }
.kard:hover { border-color: #c7d2fe; box-shadow: 0 2px 8px rgba(99,102,241,.08); }
.kard.has-prio { border-left: 3px solid #f59e0b; padding-left: 9px; }
.kard-row1 { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; }
.kard-co { font-size: 13px; font-weight: 600; color: #111; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kard-row2 { display: flex; align-items: center; gap: 6px; font-size: 11px; color: #6b7280; flex-wrap: wrap; }
.kard-csm { font-weight: 500; color: #4338ca; }
.kard-meta { display: flex; align-items: center; gap: 6px; font-size: 11px; color: #9ca3af; margin-top: 6px; padding-top: 6px; border-top: 1px solid #f3f4f6; }
.kard-meta .stage-age.stale { color: #b45309; font-weight: 600; }
.kard-meta .stage-age.fresh { color: #059669; }
.kard-notes { font-size: 11px; color: #6b7280; margin-top: 4px; line-height: 1.4; max-height: 32px; overflow: hidden; }

.kard-contact { font-size: 11px; color: #4338ca; margin-top: 4px; font-weight: 500; }

.published-library { max-width: 1280px; margin: 16px auto 32px; padding: 0 24px; overflow-x: auto; }
.published-table { width: 100%; min-width: 860px; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; box-shadow: var(--shadow-sm); }
.published-table th { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); color: var(--text-muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.published-table td { padding: 12px; border-bottom: 1px solid var(--border); color: var(--text); font-size: 12.5px; vertical-align: top; }
.published-table tr:last-child td { border-bottom: none; }
.published-table tbody tr { cursor: pointer; }
.published-table tbody tr:hover td { background: #fafbff; }
.published-link { color: var(--n8n-dark); font-weight: 700; text-decoration: none; line-height: 1.3; }
.published-link:hover { text-decoration: underline; }
.published-desc { color: var(--text-muted); font-size: 11.5px; line-height: 1.35; margin-top: 4px; max-width: 560px; }

/* ── Dashboard view ───────────────────────────────────────────────────────── */
.dash-wrap { max-width: 1280px; margin: 0 auto; padding: 32px 24px; display: flex; flex-direction: column; gap: 32px; }
.dash-section { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 24px; box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s; }
.dash-section:hover { border-color: rgba(234, 75, 113, 0.4); }
.dash-h { font-size: 14px; font-weight: 700; color: #111; margin-bottom: 16px; display: flex; align-items: baseline; gap: 10px; }
.dash-h-sub { font-size: 11px; font-weight: 500; color: #9ca3af; text-transform: none; letter-spacing: 0; }

/* KPIs */
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.kpi { background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 10px; padding: 14px 16px; }
.kpi-value { font-size: 26px; font-weight: 700; color: #111; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi-label { font-size: 11px; color: #6b7280; text-transform: uppercase; letter-spacing: .04em; margin-top: 4px; font-weight: 600; }
.kpi.tone-primary { background: #fef2f4; border-color: #fbcad4; }
.kpi.tone-primary .kpi-value { color: #C73E5E; }
.kpi.tone-amber { background: #fffbeb; border-color: #fde68a; }
.kpi.tone-amber .kpi-value { color: #92400e; }
.kpi.tone-green { background: #f0fdf4; border-color: #bbf7d0; }
.kpi.tone-green .kpi-value { color: #166534; }
.kpi.tone-red { background: #fef2f2; border-color: #fecaca; }
.kpi.tone-red .kpi-value { color: #991b1b; }

/* Funnel */
.funnel { display: flex; flex-direction: column; gap: 10px; }
.funnel-row { display: grid; grid-template-columns: 180px 1fr 50px; gap: 12px; align-items: center; font-size: 12px; }
.funnel-label { font-weight: 600; color: #374151; }
.funnel-bar-wrap { background: #f3f4f6; border-radius: 6px; height: 18px; overflow: hidden; }
.funnel-bar { height: 100%; border-radius: 6px; min-width: 4px; transition: width .3s ease; }
.funnel-bar.tone-neutral { background: #9ca3af; }
.funnel-bar.tone-amber { background: #f59e0b; }
.funnel-bar.tone-blue { background: #3b82f6; }
.funnel-bar.tone-green { background: #10b981; }
.funnel-bar.tone-red { background: #ef4444; }
.funnel-count { text-align: right; font-weight: 700; color: #111; font-variant-numeric: tabular-nums; }

/* Leaderboard */
.leaderboard { width: 100%; border-collapse: collapse; font-size: 13px; }
.leaderboard th { text-align: left; padding: 8px 12px; font-size: 11px; font-weight: 600; color: #6b7280; text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid #e5e7eb; }
.leaderboard th.rank, .leaderboard th.points { text-align: center; }
.leaderboard td { padding: 10px 12px; border-bottom: 1px solid #f3f4f6; }
.leaderboard td.rank { text-align: center; font-weight: 700; color: #6b7280; width: 50px; font-size: 14px; }
.leaderboard td.points { text-align: center; font-weight: 700; color: #C73E5E; font-variant-numeric: tabular-nums; font-size: 15px; }
.leaderboard tr:last-child td { border-bottom: none; }
.leaderboard .empty-row { text-align: center; padding: 24px; color: #9ca3af; }

/* ── Dark mode overrides ──────────────────────────────────────────────────
   80/20: only flip surfaces, borders, and text. Semantic accent colors
   (tier badges, status pills, perf chips) carry through with their tints.
*/
[data-theme="dark"] body { background: var(--bg); color: var(--text); }

[data-theme="dark"] .controls,
[data-theme="dark"] .tabs,
[data-theme="dark"] .header { background: var(--surface); border-color: var(--border); }
[data-theme="dark"] .header-beta { background: rgba(245, 158, 11, .20); color: #fbbf24; }
[data-theme="dark"] .controls { background: var(--surface); }
[data-theme="dark"] table { background: var(--surface); box-shadow: var(--shadow-sm); }
[data-theme="dark"] thead th { background: var(--surface-2); color: var(--text-muted); border-color: var(--border); }
[data-theme="dark"] thead th:hover { background: var(--surface-3); color: var(--text); }
[data-theme="dark"] tbody tr { border-color: var(--border); }
[data-theme="dark"] tbody tr:hover { background: var(--surface-2); }
[data-theme="dark"] tbody tr.expanded { background: var(--surface-2); }
[data-theme="dark"] tbody tr.has-prio { background: rgba(245, 158, 11, .08); }
[data-theme="dark"] tbody tr.has-prio:hover { background: rgba(245, 158, 11, .14); }
[data-theme="dark"] .co { color: var(--text); }
[data-theme="dark"] .domain { color: var(--text-faint); }
[data-theme="dark"] .usage { color: var(--text); }
[data-theme="dark"] .score-num { color: var(--text); }
[data-theme="dark"] .score-bar-bg { background: var(--surface-3); }
[data-theme="dark"] .footer { color: var(--text-faint); }

/* Toolbar */
[data-theme="dark"] .csm-toggle { background: var(--surface-2); }
[data-theme="dark"] .csm-btn { color: var(--text-muted); }
[data-theme="dark"] .csm-btn:hover { color: var(--text); }
[data-theme="dark"] .csm-btn.active { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.4); }
[data-theme="dark"] .pipeline-mode-btn { color: var(--text-muted); }
[data-theme="dark"] .pipeline-mode-btn:hover { color: var(--text); }
[data-theme="dark"] .pipeline-mode-btn.active { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.4); }
[data-theme="dark"] .tier-btn { background: var(--surface); border-color: var(--border); color: var(--text-muted); }
[data-theme="dark"] .tier-btn:hover { border-color: var(--n8n); color: var(--text); }
[data-theme="dark"] .filter-select, [data-theme="dark"] .search-wrap input { background-color: var(--surface); border-color: var(--border); color: var(--text); }
[data-theme="dark"] .filter-select:hover, [data-theme="dark"] .search-wrap input:hover { border-color: var(--n8n); }
[data-theme="dark"] .status-select { background-color: var(--surface); border-color: var(--border); color: var(--text); }

/* Tabs (n8n underline pattern) */
[data-theme="dark"] .tab { color: var(--text-muted); }
[data-theme="dark"] .tab:hover { color: var(--text); }
[data-theme="dark"] .tab.active { color: var(--text); border-bottom-color: var(--n8n); }

/* Expand panel */
[data-theme="dark"] .expand-row td > .expand-inner { background: var(--surface-2); border-color: var(--border); }
[data-theme="dark"] .expand-inner { background: var(--surface-2); border-top-color: var(--border); }
[data-theme="dark"] .reasoning { color: var(--text); }
[data-theme="dark"] .sub-scores { background: var(--surface); border-color: var(--border); }
[data-theme="dark"] .sub { color: var(--text-muted); }
[data-theme="dark"] .sub b { color: var(--text); }
[data-theme="dark"] .meta-row { color: var(--text-muted); }
[data-theme="dark"] .meta-row span b { color: var(--text); }
[data-theme="dark"] .label { color: var(--text-muted); }
[data-theme="dark"] .notes-area, [data-theme="dark"] .interest-input { background: var(--surface); border-color: var(--border); color: var(--text); }
[data-theme="dark"] .notes-area:focus, [data-theme="dark"] .interest-input:focus { border-color: var(--n8n); }
[data-theme="dark"] .last-edited { color: var(--text-faint); }
[data-theme="dark"] .save-btn { background: var(--n8n); }
[data-theme="dark"] .save-btn:hover { background: var(--n8n-dark); }
[data-theme="dark"] .save-btn:disabled { background: var(--surface-3); color: var(--text-faint); }

/* Modal */
[data-theme="dark"] .modal { background: rgba(0,0,0,.8); }
[data-theme="dark"] .modal-card { background: var(--surface); }
[data-theme="dark"] .modal-card h2 { color: var(--text); }
[data-theme="dark"] .muted { color: var(--text-muted); }
[data-theme="dark"] .csm-list-section h3 { color: var(--text-faint); }
[data-theme="dark"] .csm-list button { background: var(--surface-2); border-color: var(--border); color: var(--text); }
[data-theme="dark"] .csm-list button:hover { background: var(--surface-3); border-color: var(--n8n); }

/* Kanban */
[data-theme="dark"] .kanban-col { background: var(--surface-2); }
[data-theme="dark"] .kanban-title { color: var(--text); }
[data-theme="dark"] .kanban-count { background: var(--surface); color: var(--text-muted); }
[data-theme="dark"] .kard { background: var(--surface); border-color: var(--border); }
[data-theme="dark"] .kard:hover { border-color: var(--n8n); box-shadow: 0 2px 8px rgba(234,75,113,.15); }
[data-theme="dark"] .kard-co { color: var(--text); }
[data-theme="dark"] .kard-row2 span:not(.kard-csm) { color: var(--text-muted); }
[data-theme="dark"] .kard-meta { border-top-color: var(--border); }
[data-theme="dark"] .published-table { background: var(--surface); border-color: var(--border); }
[data-theme="dark"] .published-table th { background: var(--surface-2); border-color: var(--border); color: var(--text-muted); }
[data-theme="dark"] .published-table td { border-color: var(--border); color: var(--text); }
[data-theme="dark"] .published-table tbody tr:hover td { background: var(--surface-2); }
[data-theme="dark"] .published-link { color: #ffb3c4; }

/* Dashboard */
[data-theme="dark"] .dash-section { background: var(--surface); border-color: var(--border); box-shadow: var(--shadow-sm); }
[data-theme="dark"] .dash-h { color: var(--text); }
[data-theme="dark"] .kpi { background: var(--surface-2); border-color: var(--border); }
[data-theme="dark"] .kpi-value { color: var(--text); }
[data-theme="dark"] .kpi-label { color: var(--text-muted); }
[data-theme="dark"] .funnel-bar-wrap { background: var(--surface-3); }
[data-theme="dark"] .funnel-label { color: var(--text); }
[data-theme="dark"] .funnel-count { color: var(--text); }
[data-theme="dark"] .leaderboard th { color: var(--text-muted); border-color: var(--border); }
[data-theme="dark"] .leaderboard td { border-color: var(--border); color: var(--text); }
[data-theme="dark"] .leaderboard td.points { color: var(--n8n); }

/* Chat */
[data-theme="dark"] .chat-panel { background: var(--surface); }
[data-theme="dark"] .chat-head { border-color: var(--border); }
[data-theme="dark"] .chat-title { color: var(--text); }
[data-theme="dark"] .chat-empty { color: var(--text-muted); }
[data-theme="dark"] .msg.assistant { background: var(--surface-2); color: var(--text); }
[data-theme="dark"] .tool-event { background: var(--surface-2); border-color: var(--border); color: var(--text-muted); }
[data-theme="dark"] .chat-form { border-color: var(--border); }
[data-theme="dark"] .chat-form textarea { background: var(--surface-2); border-color: var(--border); color: var(--text); }

/* Health flags carry through */
[data-theme="dark"] .flag-no-usage { background: rgba(248,113,113,.12); color: #fca5a5; border-color: rgba(248,113,113,.3); }
[data-theme="dark"] .flag-rampup { background: rgba(52,211,153,.12); color: #6ee7b7; border-color: rgba(52,211,153,.3); }

/* User chip in dark mode */
[data-theme="dark"] .user-chip { background: var(--n8n-tint); color: #ffb3c4; }

/* ── UI improvements branch ───────────────────────────────────────────── */

/* #3 — Score column: drop the bar, tint the cell */
.score-cell { display: none; }   /* legacy */
td.score-tier-T0 { background: rgba(245, 158, 11, .08); }
td.score-tier-T1 { background: rgba(59, 130, 246, .06); }
td.score-tier-T2 { background: transparent; }
td.score-tier-T3 { background: rgba(248, 113, 113, .04); }
td[class*="score-tier-"] .score-num { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* #5 — Right-align numeric cells */
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* #6 — Health dot replaces text label */
.health-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: middle; cursor: help; }
.health-dot-Champion      { background: #10b981; }
.health-dot-Expansion     { background: #3b82f6; }
.health-dot-Healthy       { background: #6ee7b7; }
.health-dot-Risk          { background: #ef4444; }
.health-dot-Underutilizing{ background: #f59e0b; }
.health-dot-Unknown       { background: #d1d5db; }
.health-flag { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-left: 4px; vertical-align: middle; }
.health-flag.flag-no-usage { background: #ef4444; box-shadow: 0 0 0 2px rgba(239,68,68,.18); }
.health-flag.flag-rampup   { background: #10b981; box-shadow: 0 0 0 2px rgba(16,185,129,.18); }

/* #7 — Quiet empty state for the in-row status select */
.status-select.empty { border-color: transparent; background-color: transparent; color: var(--text-faint); font-style: italic; background-image: none; padding-right: 10px; }
.status-select.empty:hover { border-color: var(--border); color: var(--text-muted); background-color: var(--surface); }
.status-select.empty option:first-child { color: var(--text-faint); font-style: italic; }

/* Reset the empty option label */
.status-cell { min-width: 130px; }

/* #2 — Dashboard funnel: split Unreviewed callout + comparable bars */
.funnel { display: grid; grid-template-columns: 240px 1fr; gap: 20px; align-items: stretch; }
.funnel-callout { background: linear-gradient(135deg, var(--surface-2) 0%, var(--surface-3) 100%); border: 1px solid var(--border); border-radius: 10px; padding: 16px; display: flex; flex-direction: column; justify-content: center; }
.funnel-callout-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.funnel-callout-value { font-size: 36px; font-weight: 700; color: var(--text); line-height: 1; margin: 4px 0; font-variant-numeric: tabular-nums; }
.funnel-callout-sub { font-size: 11px; color: var(--text-faint); }
.funnel-bars { display: flex; flex-direction: column; gap: 10px; }
@media (max-width: 800px) { .funnel { grid-template-columns: 1fr; } }

/* #10 — Hero KPI row */
.kpi-hero-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 14px; }
.kpi-hero { padding: 22px 20px; }
.kpi-hero .kpi-value { font-size: 36px; }
.kpi-hero .kpi-label { font-size: 12px; }

/* #9 — Compact kanban: hide notes preview by default, reveal on hover */
.kard-notes { max-height: 0; overflow: hidden; opacity: 0; transition: max-height .2s, opacity .2s, margin .2s; margin: 0; }
.kard:hover .kard-notes,
.kard.expanded .kard-notes { max-height: 60px; opacity: 1; margin-top: 4px; }

/* #11 — Chat fab clear of horizontal scrollbar */
.chat-fab { bottom: 32px; right: 32px; }
.chat-panel { bottom: 32px; right: 32px; }

/* ── Round 2: admin gating, tier override, multi-dd, health chip ───────── */

/* Multi-select dropdown (tier filter) */
.multi-dd { position: relative; }
.multi-dd-btn { height: 28px; border: 1.5px solid var(--border); border-radius: 8px; padding: 0 28px 0 10px; font-size: 12px; font-weight: 500; color: var(--text); background: var(--surface) url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3e%3cpath fill='none' stroke='%236b7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' d='M1 1l4 4 4-4'/%3e%3c/svg%3e") no-repeat right 10px center; cursor: pointer; min-width: 110px; text-align: left; transition: border .12s; }
.multi-dd-btn:hover { border-color: var(--n8n); }
.multi-dd.open .multi-dd-btn { border-color: var(--n8n); }
.multi-dd-arrow { display: none; }
.multi-dd-panel { display: none; position: absolute; top: 32px; left: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 6px; z-index: 50; box-shadow: var(--shadow-md); min-width: 130px; }
.multi-dd.open .multi-dd-panel { display: flex; flex-direction: column; gap: 2px; }
.multi-dd-panel label { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 5px; font-size: 12px; font-weight: 500; color: var(--text); cursor: pointer; }
.multi-dd-panel label:hover { background: var(--surface-2); }
.multi-dd-panel input[type="checkbox"] { accent-color: var(--n8n); }

/* Tier select replacing the static badge */
.tier-cell { padding: 7px 6px !important; }
.tier-select { height: 22px; width: 56px; border: none; border-radius: 4px; padding: 0 18px 0 8px; font-size: 11px; font-weight: 700; cursor: pointer; appearance: none; background-position: right 4px center; background-repeat: no-repeat; background-size: 8px; transition: box-shadow .12s; }
.tier-select:hover { box-shadow: 0 0 0 2px rgba(99,102,241,.2); }
.tier-select-T0 { background-color: #fef3c7; color: #92400e; background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 10 6'%3e%3cpath fill='none' stroke='%2392400e' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' d='M1 1l4 4 4-4'/%3e%3c/svg%3e"); }
.tier-select-T1 { background-color: #dbeafe; color: #1e40af; background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 10 6'%3e%3cpath fill='none' stroke='%231e40af' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' d='M1 1l4 4 4-4'/%3e%3c/svg%3e"); }
.tier-select-T2 { background-color: #f3f4f6; color: #374151; background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 10 6'%3e%3cpath fill='none' stroke='%23374151' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' d='M1 1l4 4 4-4'/%3e%3c/svg%3e"); }
.tier-select-T3 { background-color: #fef2f2; color: #991b1b; background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 10 6'%3e%3cpath fill='none' stroke='%23991b1b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' d='M1 1l4 4 4-4'/%3e%3c/svg%3e"); }
.tier-select.overridden { box-shadow: 0 0 0 1.5px var(--n8n); }
.tier-select.overridden::after { content: '✱'; }

/* Health chip with text — compact pill (~70px) */
.health-chip { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 11px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.health-chip-Champion       { background: #d1fae5; color: #065f46; }
.health-chip-Expansion      { background: #dbeafe; color: #1e40af; }
.health-chip-Healthy        { background: #f0fdf4; color: #166534; }
.health-chip-Risk           { background: #fef2f2; color: #991b1b; }
.health-chip-Underutilizing { background: #fef3c7; color: #78350f; }
.health-chip-Unknown        { background: #f9fafb; color: #6b7280; }
.health-flag-chip { display: inline-block; margin-left: 4px; height: 20px; line-height: 20px; padding: 0 7px; border-radius: 10px; font-size: 10px; font-weight: 600; vertical-align: middle; }
.health-flag-chip.flag-no-usage { background: #fef2f2; color: #991b1b; border: 1px solid #fca5a5; }
.health-flag-chip.flag-rampup   { background: #ecfdf5; color: #047857; border: 1px solid #6ee7b7; }

/* Status pill colors for the new statuses (in-row select) */
.status-select[data-status="On hold"]            { background-color: #f3f4f6; border-color: #d1d5db; color: #4b5563; }
.status-select[data-status="Interview booked"]   { background-color: #ede9fe; border-color: #c4b5fd; color: #5b21b6; }
.status-select[data-status="In production"]      { background-color: #dbeafe; border-color: #93c5fd; color: #1e40af; }
.status-select[data-status="Customer review"]    { background-color: #fef3c7; border-color: #fde68a; color: #92400e; }
.status-select[data-status="Published"]          { background-color: #d1fae5; border-color: #6ee7b7; color: #065f46; }

/* Dark-mode tweaks for new components */
[data-theme="dark"] .multi-dd-btn { background-color: var(--surface); color: var(--text); border-color: var(--border); }
[data-theme="dark"] .multi-dd-panel { background: var(--surface); border-color: var(--border); }
[data-theme="dark"] .multi-dd-panel label:hover { background: var(--surface-2); }
[data-theme="dark"] .tier-select-T2 { background-color: #2a2a2a; color: #e5e7eb; }

/* ── Round 3 ─────────────────────────────────────────────────────────── */

/* Dashboard stays in the Odin-style grouped nav row. */
.tab-far-right { margin-left: 0; }

/* #4 Empty status: minimal text-only, no inflated select frame */
.status-select.empty { height: 18px !important; font-size: 10px; line-height: 18px; padding: 0 6px !important; border: none !important; background: transparent !important; color: var(--text-faint); font-style: italic; }
.status-select.empty:hover { color: var(--text-muted); background: var(--surface-2) !important; }

/* New status colors for the row select (aligned with kanban) */
.status-select[data-status="To reach out"]    { background-color: #f3f4f6; border-color: #d1d5db; color: #4b5563; }
.status-select[data-status="Rejected"]        { background-color: #fef2f2; border-color: #fca5a5; color: #991b1b; }

/* Tier badge — non-admin sees static badge with optional override marker */
.badge.overridden { box-shadow: 0 0 0 1.5px var(--n8n); }

/* Tier reset glyph (admin) */
.tier-reset { display: inline-block; margin-left: 4px; font-size: 13px; color: var(--text-faint); cursor: pointer; user-select: none; transition: color .12s; }
.tier-reset:hover { color: var(--n8n); }

/* Pipeline 3-row swimlanes */
.kanban { max-width: 1280px; margin: 0 auto; display: flex; flex-direction: column; gap: 24px; padding: 24px; }
.lane { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px; box-shadow: var(--shadow-sm); }
.lane-head { margin-bottom: 10px; display: flex; align-items: baseline; gap: 10px; }
.lane-title { font-size: 13px; font-weight: 700; color: var(--text); }
.lane-subtitle { font-size: 11px; color: var(--text-muted); }
/* All cards same horizontal width across every lane (auto-flow stops). */
.lane-cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.lane-empty { font-size: 11px; color: var(--text-faint); padding: 8px; text-align: center; font-style: italic; }
.lane-outreach   .kanban-head { border-color: #f59e0b; }
.lane-production .kanban-head { border-color: #10b981; }
.lane-paused     .kanban-head { border-color: #9ca3af; }

[data-theme="dark"] .lane { background: var(--surface); border-color: var(--border); }

/* ── Round 4: Comment, ARR, animations, narrower Health ────────────── */

/* Health column: tighter padding + max-width on chip */
.td-health { max-width: 130px; }
.health-chip { font-size: 10px; padding: 0 7px; height: 20px; max-width: 90px; overflow: hidden; text-overflow: ellipsis; }
.health-flag-chip { font-size: 9px; padding: 0 5px; height: 18px; line-height: 18px; }

/* Comment column — inline editable input that flows to Pipeline + activity feed */
.comment-cell { min-width: 180px; max-width: 240px; }
.comment-input { width: 100%; height: 26px; border: 1px solid transparent; border-radius: 6px; padding: 0 8px; font-size: 12px; font-family: inherit; background: transparent; color: var(--text); outline: none; transition: all .15s; }
.comment-input::placeholder { color: var(--text-faint); font-style: italic; }
.comment-input:hover { border-color: var(--border); background: var(--surface-2); }
.comment-input:focus { border-color: var(--n8n); background: var(--surface); box-shadow: 0 0 0 3px var(--n8n-tint); }
.comment-input.saving { border-color: var(--text-faint); }
.comment-input.saved { border-color: #10b981; background: rgba(16,185,129,.06); animation: pop-flash .8s ease; }
[data-theme="dark"] .comment-input { color: var(--text); }
[data-theme="dark"] .comment-input:hover { background: var(--surface-2); border-color: var(--border); }

/* Animations */
@keyframes pop-flash {
  0%   { transform: scale(1); }
  20%  { transform: scale(1.02); }
  100% { transform: scale(1); }
}
@keyframes star-bounce {
  0%   { transform: scale(1) rotate(0deg); }
  30%  { transform: scale(1.4) rotate(12deg); }
  60%  { transform: scale(0.9) rotate(-6deg); }
  100% { transform: scale(1) rotate(0deg); }
}
.prio-star { transition: color .15s, transform .15s; }
.prio-star.animate { animation: star-bounce .35s ease; }

/* Status chip click animation */
.status-select { transition: transform .15s, background-color .15s; }
.status-select.changing { transform: scale(1.05); }

/* Tier select micro-animation */
.tier-select { transition: transform .15s, box-shadow .15s; }
.tier-select.changing { transform: scale(1.05); }

/* Recent activity feed */
.activity-feed { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow-y: auto; }
.activity-item { padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; }
.activity-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; }
.activity-co { font-weight: 600; color: var(--text); }
.activity-status { font-size: 10px; padding: 1px 6px; border-radius: 3px; background: var(--n8n-tint); color: var(--n8n-dark); font-weight: 600; }
.activity-by { color: var(--text-faint); font-size: 11px; margin-left: auto; }
.activity-comment { margin-top: 5px; font-size: 12px; color: var(--text-muted); font-style: italic; line-height: 1.4; }
.activity-loading, .activity-empty { padding: 20px; text-align: center; color: var(--text-faint); font-size: 12px; }

/* Kanban comment line */
.kard-comment { font-size: 11px; color: var(--n8n-dark); margin-top: 4px; line-height: 1.35; font-weight: 500; }
[data-theme="dark"] .kard-comment { color: #ffb3c4; }

/* ── sales-enablement-app alignment ─────────────────────────────────── */

/* Eyebrow label (text-[10px] uppercase tracking-[0.2em] semibold n8n) */
.eyebrow { display: inline-block; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.2em; color: var(--n8n); }

/* Section heading rhythm — match h2 letter-spacing -0.018em */
.dash-h { font-size: 15px; font-weight: 600; color: var(--text); letter-spacing: -0.018em; margin-bottom: 18px; }
.dash-h-sub { font-size: 11px; font-weight: 400; color: var(--text-muted); text-transform: none; letter-spacing: 0; }

/* KPI cards — tighter to the n8n style: rounded-xl, lighter border tint */
.kpi { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; transition: border-color .15s; }
.kpi:hover { border-color: rgba(234, 75, 113, 0.3); }
.kpi-hero { padding: 24px; }
.kpi-hero .kpi-value { font-size: 32px; font-weight: 700; letter-spacing: -0.02em; }

/* Stat pill (Pipeline header) — rounded-md, n8n hover */
.stat-pill { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 6px 12px; font-size: 12px; color: var(--text-muted); transition: border-color .15s; }
.stat-pill:hover { border-color: rgba(234, 75, 113, 0.3); }

/* Tier badge → rounded-md */
.badge { border-radius: 6px; }

/* Empty state — dashed border, p-10 centered */
.empty { border: 1px dashed var(--border-strong); border-radius: 8px; padding: 40px 20px; margin: 16px 24px; text-align: center; color: var(--text-faint); font-size: 13px; }

/* Filter inputs — match n8n form pattern: rounded-md focus ring */
.filter-select:focus, .search-wrap input:focus, .multi-dd-btn:focus { box-shadow: 0 0 0 3px rgba(234, 75, 113, 0.2); border-color: var(--n8n); }

/* Subtler n8n hover on inputs */
.filter-select:hover, .search-wrap input:hover, .multi-dd-btn:hover { border-color: rgba(234, 75, 113, 0.4); }

/* Activity feed item — match card pattern */
.activity-item { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; transition: border-color .15s; }
.activity-item:hover { border-color: rgba(234, 75, 113, 0.3); }

/* Theme-toggle: match icon-button pattern */
.theme-toggle { width: 32px; height: 32px; border-radius: 6px; }

/* Tighten letter-spacing on all body text */
body { letter-spacing: -0.005em; }

/* ── Advanced filters ─────────────────────────────────────────────── */
.adv-filter-btn { display: inline-flex; align-items: center; gap: 6px; height: 28px; border: 1.5px solid var(--border); background: var(--surface); padding: 0 12px; border-radius: 8px; font-size: 12px; font-weight: 500; color: var(--text-muted); cursor: pointer; transition: all .12s; }
.adv-filter-btn:hover { border-color: rgba(234,75,113,.4); color: var(--text); }
.adv-filter-btn.has-filters { border-color: var(--n8n); color: var(--n8n-dark); background: var(--n8n-tint); }
.adv-filter-count { display: inline-flex; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--n8n); color: #fff; font-size: 10px; font-weight: 700; align-items: center; justify-content: center; }

.modal-close { background: transparent; border: none; cursor: pointer; font-size: 16px; color: var(--text-muted); padding: 4px 8px; border-radius: 6px; }
.modal-close:hover { background: var(--surface-2); color: var(--text); }
.adv-head { display: flex; align-items: center; justify-content: space-between; }
.adv-modal-card { max-width: 560px; }

.adv-row { padding: 14px 0; border-bottom: 1px solid var(--border); }
.adv-row:last-of-type { border-bottom: none; }
.adv-label { font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.adv-checkbox-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 16px; }
.adv-checkbox-grid label, .adv-toggles label { display: flex; align-items: center; gap: 8px; font-size: 12px; cursor: pointer; color: var(--text); }
.adv-checkbox-grid input[type="checkbox"], .adv-toggles input[type="checkbox"] { accent-color: var(--n8n); }
.adv-input { width: 100%; height: 32px; border: 1.5px solid var(--border); border-radius: 8px; padding: 0 10px; font-size: 12px; font-family: inherit; background: var(--surface); color: var(--text); outline: none; transition: border-color .12s; }
.adv-input:focus { border-color: var(--n8n); box-shadow: 0 0 0 3px var(--n8n-tint); }
.adv-toggles { display: flex; flex-direction: column; gap: 8px; }

.adv-actions { display: flex; gap: 8px; justify-content: flex-end; padding-top: 16px; }
.btn-primary { height: 32px; padding: 0 16px; border: none; border-radius: 8px; background: var(--n8n); color: #fff; font-size: 13px; font-weight: 600; cursor: pointer; transition: background .12s; }
.btn-primary:hover { background: var(--n8n-dark); }
.btn-secondary { height: 32px; padding: 0 16px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text-muted); font-size: 13px; font-weight: 500; cursor: pointer; transition: all .12s; }
.btn-secondary:hover { color: var(--text); border-color: var(--border-strong); }

[data-theme="dark"] .adv-filter-btn { background: var(--surface); border-color: var(--border); color: var(--text-muted); }
[data-theme="dark"] .adv-filter-btn.has-filters { background: var(--n8n-tint); border-color: var(--n8n); color: #ffb3c4; }
[data-theme="dark"] .btn-secondary { background: var(--surface); border-color: var(--border); color: var(--text-muted); }

/* ── Account detail modal ───────────────────────────────────────────── */
.account-modal-card { max-width: 720px; padding: 28px; }
.account-modal-body { display: flex; flex-direction: column; gap: 18px; }

.amod-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.amod-head-left { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; line-height: 1; }
.amod-head-left .prio-star { display: inline-grid; place-items: center; width: 22px; height: 22px; flex: none; font-size: 22px; line-height: 1; }
.amod-co { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; color: var(--text); margin: 0; }
.amod-head-tier { display: inline-flex; align-items: center; flex: none; }
.amod-head-meta { display: flex; align-items: center; gap: 10px; }
.amod-tier-select { height: 24px; min-width: 56px; padding: 0 22px 0 10px; font-size: 12px; font-weight: 700; cursor: pointer; appearance: none; background-position: right 6px center; background-repeat: no-repeat; background-size: 8px; border: none; border-radius: 4px; }
.amod-tier-select.tier-select-T0 { background-color: #fef3c7; color: #92400e; background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 10 6'%3e%3cpath fill='none' stroke='%2392400e' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' d='M1 1l4 4 4-4'/%3e%3c/svg%3e"); }
.amod-tier-select.tier-select-T1 { background-color: #dbeafe; color: #1e40af; background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 10 6'%3e%3cpath fill='none' stroke='%231e40af' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' d='M1 1l4 4 4-4'/%3e%3c/svg%3e"); }
.amod-tier-select.tier-select-T2 { background-color: #f3f4f6; color: #374151; background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 10 6'%3e%3cpath fill='none' stroke='%23374151' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' d='M1 1l4 4 4-4'/%3e%3c/svg%3e"); }
.amod-tier-select.tier-select-T3 { background-color: #fef2f2; color: #991b1b; background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 10 6'%3e%3cpath fill='none' stroke='%23991b1b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' d='M1 1l4 4 4-4'/%3e%3c/svg%3e"); }
.amod-score { font-size: 22px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.amod-subhead { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.amod-subhead a { color: var(--n8n-dark); text-decoration: none; }
.amod-subhead a:hover { text-decoration: underline; }

.amod-section { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 16px 18px; }
.amod-section-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); margin-bottom: 10px; }

.amod-section .reasoning { font-size: 12.5px; color: var(--text); line-height: 1.6; margin-top: 10px; }
.amod-section .sub-scores { background: var(--surface); }

.amod-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 24px; }
.amod-grid > div { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; font-size: 12px; }
.amod-k { color: var(--text-muted); font-weight: 500; }
.amod-v { color: var(--text); font-weight: 600; text-align: right; }
.amod-v a { color: var(--n8n-dark); text-decoration: none; }
.amod-v a:hover { text-decoration: underline; }

/* CSM workspace */
.amod-workspace { background: var(--surface); border-color: var(--border-strong); }
.amod-status-row { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; }
.amod-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.amod-field-label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.amod-field .status-select { width: 200px; }
.amod-field .notes-area { min-height: 80px; }
.amod-field .interest-input,
.amod-field .notes-area { background: var(--surface-2); }
.amod-prio-toggle { flex-direction: row; align-items: center; gap: 6px; cursor: pointer; margin-top: 22px; font-size: 12px; }
.amod-prio-toggle input { accent-color: var(--n8n); }
.amod-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 6px; }
.amod-actions .save-btn { padding: 8px 20px; }

/* Activity */
.amod-activity-list { display: flex; flex-direction: column; gap: 6px; }
.amod-act-row { display: block; font-size: 12px; padding: 5px 0; border-bottom: 1px solid var(--border); }
.amod-act-row:last-child { border-bottom: none; }
.amod-act-main {
  min-width: 0;
  display: grid;
  gap: 4px;
  line-height: 1.4;
}
.amod-act-left,
.amod-act-right {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 6px;
  color: var(--text-muted);
  font-size: 12px;
}
.amod-act-left { flex-wrap: wrap; }
.amod-act-right {
  flex-wrap: wrap;
}
.amod-act-kind {
  flex: none;
  padding: 1px 6px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
}
.amod-act-by { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--text-muted); }
.amod-act-left .amod-act-by::before,
.amod-act-left .amod-act-ai::before,
.amod-act-left .amod-act-when::before {
  content: "·";
  margin-right: 6px;
  color: var(--text-faint);
  font-weight: 500;
}
.amod-act-status { display: inline-flex; align-items: center; max-width: 100%; font-size: 11px; padding: 0 5px; border-radius: 4px; background: var(--surface-2); color: var(--text-muted); font-weight: 600; white-space: nowrap; }
.amod-act-comment { color: var(--text-muted); font-style: normal; }
.amod-act-meta { color: var(--text-muted); font-size: 12px; }
.amod-act-meta b { color: var(--text); font-weight: 600; }
.amod-act-body { min-width: 0; color: var(--text-muted); }

.amod-act-ai { display: inline-flex; align-items: center; flex: none; font-size: 10px; padding: 1px 6px; border-radius: 5px; background: var(--surface-2); color: var(--text-muted); font-weight: 700; border: 1px solid var(--border); white-space: nowrap; }
[data-theme="dark"] .amod-act-ai { color: var(--text-muted); }

.amod-act-actions { display: inline-flex; gap: 4px; margin-left: 4px; opacity: 0; transition: opacity .12s ease; }
.amod-act-row:hover .amod-act-actions,
.amod-act-row:focus-within .amod-act-actions { opacity: 1; }
.amod-act-btn { background: transparent; border: 1px solid transparent; border-radius: 4px; padding: 2px 6px; font-size: 12px; color: var(--text-muted); cursor: pointer; line-height: 1; }
.amod-act-btn:hover { background: var(--surface-2); border-color: var(--border); color: var(--text); }
.amod-act-btn-del:hover { color: #dc2626; border-color: #fecaca; background: #fef2f2; }
[data-theme="dark"] .amod-act-btn-del:hover { background: rgba(220,38,38,.12); border-color: rgba(220,38,38,.3); color: #fca5a5; }

.amod-act-edit-input { width: 100%; background: var(--surface); border: 1px solid var(--n8n); border-radius: 6px; padding: 8px 10px; font-size: 13px; font-family: inherit; color: var(--text); outline: none; box-shadow: 0 0 0 3px var(--n8n-tint); resize: vertical; min-height: 50px; box-sizing: border-box; }
.amod-act-edit-actions { display: flex; gap: 6px; margin-top: 6px; }
.amod-act-edit-actions button { padding: 4px 12px; font-size: 12px; font-weight: 600; border-radius: 5px; cursor: pointer; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); }
.amod-act-edit-actions .amod-act-save { background: var(--n8n); border-color: var(--n8n); color: #fff; }
.amod-act-edit-actions .amod-act-save:hover { background: var(--n8n-dark); }
.amod-act-when { color: var(--text-faint); font-size: 11px; white-space: nowrap; }
.amod-activity-empty { padding: 12px; text-align: center; color: var(--text-faint); font-size: 12px; }

/* --- Single-scroll modal: owner subhead --- */
.amod-subhead-owner { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.amod-owner { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.amod-owner-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint); }
.amod-subhead-meta { font-size: 12px; color: var(--text-muted); }

/* --- Journey timeline --- */
.amod-journey-toggle { background: none; border: none; color: var(--n8n-dark); font-family: inherit; font-size: 11px; font-weight: 600; cursor: pointer; padding: 2px 0; }
.amod-journey-toggle:hover { text-decoration: underline; }
.amod-act-row:not(.amod-act-milestone) { opacity: .68; }
.amod-act-row:not(.amod-act-milestone):hover { opacity: 1; }

/* --- Reference accordions --- */
.amod-accordions { margin-top: 0; }
.amod-acc { border-bottom: 1px solid var(--border); }
.amod-acc-sum { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 13px 2px; font-size: 13px; font-weight: 600; color: var(--text); }
.amod-acc-sum::-webkit-details-marker { display: none; }
.amod-acc-chev { display: inline-block; transition: transform .15s; color: var(--text-faint); font-size: 15px; line-height: 1; }
.amod-acc[open] > .amod-acc-sum .amod-acc-chev { transform: rotate(90deg); }
.amod-acc-tag { font-size: 11px; font-weight: 500; color: var(--text-faint); }
.amod-acc-sum-tags { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.amod-acc-body { padding: 2px 2px 18px; }

/* --- Case study section --- */
.amod-section { margin-top: 18px; }
.amod-section-title { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 12px; }
.amod-published-case { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); padding: 10px 12px; margin-bottom: 14px; }
.amod-published-case div { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.amod-published-case span { color: var(--text-faint); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.amod-published-case a { color: var(--n8n-dark); font-size: 13px; font-weight: 700; line-height: 1.3; text-decoration: none; }
.amod-published-case a:hover { text-decoration: underline; }
.amod-published-case small { color: var(--text-muted); font-size: 11px; }
.amod-published-case-btn { flex: none; border: 1px solid var(--n8n); border-radius: 7px; background: var(--surface); padding: 6px 11px; }
[data-theme="dark"] .amod-published-case { background: var(--surface-2); border-color: var(--border); }
[data-theme="dark"] .amod-published-case a { color: #ffb3c4; }

/* --- Grouped case-study status control --- */
.amod-cs-control { display: grid; gap: 12px; align-items: stretch; }
.amod-cs-current { border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); padding: 10px 12px; display: flex; align-items: center; gap: 10px; min-width: 0; }
.amod-cs-current span { color: var(--text-faint); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.amod-cs-current b { color: var(--text); font-size: 13px; line-height: 1.3; margin-right: auto; }
.amod-cs-groups { display: grid; grid-template-columns: 1fr; gap: 10px; min-width: 0; }
.amod-cs-group { min-width: 0; }
.amod-cs-group-title { color: var(--text-muted); font-size: 11px; font-weight: 700; margin-bottom: 6px; }
.amod-cs-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
.amod-cs-group:last-child .amod-cs-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.amod-cs-choice { font-family: inherit; font-size: 11px; font-weight: 600; min-height: 30px; padding: 5px 7px; border-radius: 7px; border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); cursor: pointer; white-space: normal; line-height: 1.2; text-align: center; transition: all .12s; }
.amod-cs-choice:hover { border-color: var(--n8n); color: var(--n8n-dark); background: var(--n8n-tint); }
.amod-cs-choice.current { background: var(--n8n); border-color: var(--n8n); color: #fff; font-weight: 700; }
.amod-cs-choice[data-value="On hold"].current { background: #f59e0b; border-color: #f59e0b; }
.amod-cs-choice[data-value="Rejected"].current { background: #ef4444; border-color: #ef4444; }
.amod-cs-clear { align-self: flex-start; font-family: inherit; font-size: 11px; color: var(--text-faint); background: none; border: none; cursor: pointer; padding: 2px 0; }
.amod-cs-clear:hover { color: var(--text); text-decoration: underline; }
@media (max-width: 780px) {
  .amod-cs-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .amod-cs-current { align-items: flex-start; flex-direction: column; gap: 4px; }
  .amod-cs-current b { margin-right: 0; }
}
.amod-hint-inline { display: none; }

/* --- Header logo verdict pill --- */
.amod-logo-pill { display: inline-flex; align-items: center; gap: 5px; font-family: inherit; font-size: 11px; font-weight: 600; padding: 4px 11px; border-radius: 999px; border: 1px solid transparent; cursor: pointer; }
.amod-logo-pill-ico { font-weight: 700; }
.amod-logo-pill:hover { filter: brightness(.97); }
.amod-logo-pill.v-granted { background: #dcfce7; color: #166534; }
.amod-logo-pill.v-restricted { background: #fef3c7; color: #92400e; }
.amod-logo-pill.v-denied { background: #fee2e2; color: #991b1b; }
.amod-logo-pill.v-notspec, .amod-logo-pill.v-none { background: var(--surface-3); color: var(--text-muted); }
[data-theme="dark"] .amod-logo-pill.v-granted { background: rgba(34,197,94,.16); color: #4ade80; }
[data-theme="dark"] .amod-logo-pill.v-restricted { background: rgba(251,191,36,.16); color: #fbbf24; }
[data-theme="dark"] .amod-logo-pill.v-denied { background: rgba(239,68,68,.16); color: #f87171; }

/* --- Prominent Logo rights card --- */
.amod-acc-card { border: 1px solid var(--border-strong); border-radius: 9px; margin: 12px 0 0; background: var(--surface-2); }
.amod-acc-card[open] { background: var(--surface); }
.amod-acc-card > .amod-acc-sum { padding: 11px 13px; }
.amod-acc-card .amod-acc-body { padding: 0 13px 13px; }
.amod-acc-logo-title { font-weight: 700; }
.amod-acc-logo-tag { padding: 2px 10px; border-radius: 999px; font-weight: 600; }
.amod-acc-tag-verified { padding: 2px 9px; border-radius: 999px; font-weight: 600; background: #dcfce7; color: #166534; }
.amod-acc-tag-unverified { padding: 2px 9px; border-radius: 999px; font-weight: 600; background: var(--surface-3); color: var(--text-muted); }
[data-theme="dark"] .amod-acc-tag-verified { background: rgba(34,197,94,.16); color: #4ade80; }
.amod-cs-sum-tag-outreach { background: var(--n8n-tint); color: var(--n8n-dark); }
.amod-cs-sum-tag-production { background: #dcfce7; color: #166534; }
.amod-cs-sum-tag-off { background: #fef3c7; color: #92400e; }
.amod-cs-sum-tag-none { background: var(--surface-3); color: var(--text-muted); }
.amod-acc-logo.v-granted .amod-acc-logo-tag { background: #dcfce7; color: #166534; }
.amod-acc-logo.v-restricted .amod-acc-logo-tag { background: #fef3c7; color: #92400e; }
.amod-acc-logo.v-denied .amod-acc-logo-tag { background: #fee2e2; color: #991b1b; }
.amod-acc-logo.v-notspec .amod-acc-logo-tag, .amod-acc-logo.v-none .amod-acc-logo-tag { background: var(--surface-3); color: var(--text-muted); }
[data-theme="dark"] .amod-acc-logo.v-granted .amod-acc-logo-tag { background: rgba(34,197,94,.16); color: #4ade80; }
[data-theme="dark"] .amod-acc-logo.v-restricted .amod-acc-logo-tag { background: rgba(251,191,36,.16); color: #fbbf24; }
[data-theme="dark"] .amod-acc-logo.v-denied .amod-acc-logo-tag { background: rgba(239,68,68,.16); color: #f87171; }

/* --- About account snapshot --- */
.amod-about-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.amod-about-summary > div { min-width: 0; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); padding: 9px 10px; }
.amod-about-summary span,
.amod-about-grid span { display: block; color: var(--text-faint); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 5px; }
.amod-about-summary b { display: block; color: var(--text); font-size: 13px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.amod-about-summary em { display: block; color: var(--text-muted); font-size: 11.5px; font-style: normal; line-height: 1.3; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.amod-about-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px; border-top: 1px solid var(--border); padding-top: 12px; }
.amod-about-grid > div { min-width: 0; display: flex; align-items: baseline; justify-content: space-between; gap: 14px; font-size: 12.5px; }
.amod-about-grid span { margin-bottom: 0; flex: none; }
.amod-about-grid b { color: var(--text); font-size: 12.5px; font-weight: 600; min-width: 0; overflow: hidden; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.amod-about-grid a { color: var(--n8n-dark); text-decoration: none; }
.amod-about-grid a:hover { text-decoration: underline; }
@media (max-width: 780px) {
  .amod-about-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 440px) {
  .amod-about-summary,
  .amod-about-grid { grid-template-columns: 1fr; }
}

/* --- Journey moved to bottom --- */

/* --- Dev modal-focus mode (?lk=…&focus=1): show only the modal --- */
body.modal-focus > *:not(#account-modal) { display: none !important; }
body.modal-focus #account-modal .modal-close { display: none; }

/* Modal close X positioned within card */
.modal-close { position: absolute; top: 14px; right: 14px; }
.account-modal-card { position: relative; }

[data-theme="dark"] .amod-section { background: var(--surface-2); border-color: var(--border); }
[data-theme="dark"] .amod-workspace { background: var(--surface); }
[data-theme="dark"] .amod-tier-select.tier-select-T2 { background-color: #2a2a2a; color: #e5e7eb; }

/* ── Account modal — redesigned workspace ───────────────────────────── */

.amod-section-title { display: flex; align-items: center; gap: 10px; }
.amod-autosave-hint { font-size: 10px; font-weight: 500; color: var(--text-faint); text-transform: none; letter-spacing: 0; }
.amod-hint { font-weight: 400; color: var(--text-faint); text-transform: none; letter-spacing: 0; }

/* Status stepper — visual pipeline */
.amod-stepper { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 14px; margin-bottom: 14px; }
.amod-stepper-main { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.amod-step { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; background: transparent; border: 1.5px solid var(--border); border-radius: 8px; cursor: pointer; transition: all .12s; font-family: inherit; font-size: 10px; color: var(--text-muted); position: relative; }
.amod-step:hover { border-color: var(--n8n); color: var(--text); }
.amod-step.reached { border-color: var(--n8n); color: var(--n8n-dark); background: var(--n8n-tint); }
.amod-step.current { border-color: var(--n8n); color: #fff; background: var(--n8n); font-weight: 600; box-shadow: 0 2px 8px rgba(234,75,113,.3); }
.amod-step-num { font-size: 10px; font-weight: 700; opacity: .7; }
.amod-step.current .amod-step-num { opacity: 1; }
.amod-step-label { font-size: 9.5px; line-height: 1.2; text-align: center; font-weight: 600; }
.amod-step.current .amod-step-label, .amod-step.reached .amod-step-label { font-weight: 600; }
@media (max-width: 700px) { .amod-stepper-main { grid-template-columns: repeat(4, 1fr); } }

.amod-stepper-offtrack { display: flex; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); justify-content: flex-end; }
.amod-step-offtrack { padding: 4px 10px; font-size: 11px; flex-direction: row; gap: 4px; }
.amod-step-offtrack[data-value="On hold"].current { background: #f59e0b; border-color: #f59e0b; color: #fff; box-shadow: 0 2px 8px rgba(245,158,11,.3); }
.amod-step-offtrack[data-value="Rejected"].current { background: #ef4444; border-color: #ef4444; color: #fff; box-shadow: 0 2px 8px rgba(239,68,68,.3); }
.amod-step-offtrack[data-value=""].current { background: var(--text-muted); border-color: var(--text-muted); color: #fff; }

/* AI insight card — distinctly AI */
.amod-ai-insight { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: linear-gradient(135deg, rgba(234,75,113,.06) 0%, rgba(234,75,113,.02) 100%); border: 1px solid rgba(234,75,113,.2); border-left: 3px solid var(--n8n); border-radius: 8px; margin-bottom: 14px; font-size: 12.5px; }
.amod-ai-icon { font-size: 18px; flex-shrink: 0; }
.amod-ai-text { color: var(--text); flex: 1; line-height: 1.5; }
.amod-ai-text b { color: var(--n8n-dark); font-weight: 600; }
.amod-ai-draft-btn { padding: 5px 12px; font-size: 11px; font-weight: 600; border: 1px solid var(--n8n); background: transparent; color: var(--n8n-dark); border-radius: 6px; cursor: pointer; flex-shrink: 0; transition: all .12s; }
.amod-ai-draft-btn:hover { background: var(--n8n); color: #fff; }
[data-theme="dark"] .amod-ai-text b { color: #ffb3c4; }
[data-theme="dark"] .amod-ai-draft-btn { color: #ffb3c4; }
[data-theme="dark"] .amod-ai-draft-btn:hover { color: #fff; }

/* 2-column field grid */
.amod-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 14px; }
@media (max-width: 600px) { .amod-grid-2 { grid-template-columns: 1fr; } }

/* Flat input (no chrome until focus/hover) */
.amod-input-flat { background: var(--surface-2); border: 1px solid transparent; border-radius: 6px; padding: 8px 10px; font-size: 13px; font-family: inherit; color: var(--text); width: 100%; outline: none; transition: all .12s; }
.amod-input-flat:hover { background: var(--surface-2); border-color: var(--border); }
.amod-input-flat:focus { background: var(--surface); border-color: var(--n8n); box-shadow: 0 0 0 3px var(--n8n-tint); }
textarea.amod-input-flat { min-height: 80px; resize: vertical; line-height: 1.5; }

/* Toggle pill (priority) */
.amod-toggle-pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; cursor: pointer; font-size: 12px; font-weight: 500; transition: all .12s; user-select: none; }
.amod-toggle-pill:hover { border-color: var(--n8n); }
.amod-toggle-pill input { accent-color: var(--n8n); margin: 0; }
.amod-toggle-pill:has(input:checked) { background: #fef3c7; border-color: #f59e0b; color: #92400e; font-weight: 600; }
[data-theme="dark"] .amod-toggle-pill:has(input:checked) { background: rgba(245,158,11,.15); color: #fcd34d; }

/* Comment post row (Slack-like) */
.amod-comment-row { display: flex; gap: 8px; align-items: stretch; }
.amod-comment-post { flex: 1; }
.amod-post-btn { padding: 0 18px; background: var(--n8n); color: #fff; border: none; border-radius: 6px; font-size: 12px; font-weight: 600; cursor: pointer; transition: background .12s; flex-shrink: 0; }
.amod-post-btn:hover:not(:disabled) { background: var(--n8n-dark); }
.amod-post-btn:disabled { background: var(--surface-3); color: var(--text-faint); cursor: default; }

/* Inline save status */
.amod-save-status { font-size: 11px; color: var(--text-faint); margin-top: 4px; transition: color .15s; }
.amod-save-status.saved { color: #10b981; }

/* ── Tabbed modal layout ────────────────────────────────────────────── */
.account-modal-body { gap: 0; }

.amod-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 16px 0 18px; }
.amod-tab { background: transparent; border: none; padding: 8px 14px; font-size: 13px; font-family: inherit; font-weight: 500; color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .12s, border-color .12s; }
.amod-tab:hover { color: var(--text); }
.amod-tab.active { color: var(--text); border-bottom-color: var(--n8n); font-weight: 600; }

.amod-tab-panel { display: flex; flex-direction: column; }
.amod-tab-panel[hidden] { display: none; }

.amod-info-block + .amod-info-block { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border); }

.amod-acc-subhead { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 10px; }
.amod-acc-subhead-divided { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.amod-scoreline { display: flex; flex-wrap: wrap; gap: 16px; font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; margin-bottom: 8px; }
.amod-scoreline b { color: var(--text); font-weight: 600; }

.amod-reasoning { font-size: 12.5px; color: var(--text-muted); line-height: 1.55; font-style: italic; }

.amod-group-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); margin-bottom: 10px; }

/* Stepper inside tabs — no card chrome */
.amod-tab-panel .amod-stepper { background: transparent; border: none; padding: 0; margin-bottom: 20px; }

/* Prominent "post an update" */
.amod-post-field { margin-top: 14px; margin-bottom: 22px; }
.amod-field-label-lg { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 10px; letter-spacing: 0; text-transform: none; }
.amod-input-lg { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; font-size: 15px; font-family: inherit; color: var(--text); width: 100%; outline: none; transition: all .12s; box-sizing: border-box; }
.amod-input-lg:hover { border-color: var(--border-strong); }
.amod-input-lg:focus { border-color: var(--n8n); box-shadow: 0 0 0 3px var(--n8n-tint); }
.amod-post-area { min-height: 110px; resize: vertical; line-height: 1.5; }
.amod-post-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.amod-post-btn-lg { padding: 10px 22px; font-size: 14px; font-weight: 600; border-radius: 8px; height: auto; }
.amod-hint-inline { font-size: 11px; color: var(--text-faint); }

/* ── Auth overlay (production only) ─────────────────────────────────── */
#auth-overlay { position: fixed; inset: 0; z-index: 9999; background: var(--bg); display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 36px 32px; max-width: 380px; width: 100%; box-shadow: 0 8px 30px rgba(0,0,0,.08); }
.auth-logo { display: flex; justify-content: center; margin-bottom: 20px; }
.auth-logo svg { height: 32px; }
.auth-card h1 { text-align: center; font-size: 18px; font-weight: 700; margin: 0 0 6px; color: var(--text); }
.auth-sub { text-align: center; font-size: 13px; color: var(--text-muted); margin: 0 0 24px; }
.auth-sub b { color: var(--text); font-weight: 600; }
.auth-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); font: inherit; font-size: 14px; font-weight: 500; color: var(--text); cursor: pointer; transition: background .12s; }
.auth-btn:hover { background: var(--surface-3); }
.auth-error { margin: 16px 0 0; font-size: 13px; color: #dc2626; text-align: center; }
.auth-footer { margin: 24px 0 0; font-size: 11px; color: var(--text-faint); text-align: center; }

/* ── CSM override visuals ─────────────────────────────────────────── */
.csm-chip-overridden { box-shadow: inset 0 0 0 1.5px var(--n8n); }
.amod-csm-select { padding: 4px 8px; font-size: 12px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); font-family: inherit; cursor: pointer; max-width: 220px; }
.amod-csm-select.overridden { border-color: var(--n8n); box-shadow: 0 0 0 1.5px var(--n8n-tint); }
.amod-csm-reset { display: inline-block; margin-left: 6px; padding: 2px 6px; border-radius: 4px; font-size: 13px; color: var(--text-muted); cursor: pointer; }
.amod-csm-reset:hover { background: var(--surface-2); color: var(--text); }

/* ── How-to-use view ──────────────────────────────────────────────── */
.howto-wrap { max-width: 820px; margin: 0 auto; padding: 32px 24px 80px; }
.howto-h1 { font-size: 22px; font-weight: 700; color: var(--text); margin: 0 0 6px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; letter-spacing: -0.018em; }
.howto-sub { color: var(--text-muted); font-size: 14px; margin: 0 0 28px; }
.howto-section-h { font-size: 16px; font-weight: 600; color: var(--text); margin: 40px 0 4px; letter-spacing: -0.015em; }
.howto-section-sub { color: var(--text-muted); font-size: 13px; margin: 0 0 12px; }
.howto-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px 24px; margin: 14px 0; box-shadow: var(--shadow-sm); transition: border-color .15s; }
.howto-card:hover { border-color: rgba(234, 75, 113, 0.3); }
.howto-card h2 { font-size: 16px; font-weight: 600; color: var(--text); margin: 0 0 6px; display: flex; align-items: center; gap: 8px; letter-spacing: -0.015em; }
.howto-card h3 { font-size: 13px; font-weight: 600; color: var(--text); margin: 18px 0 6px; }
.howto-card p { margin: 6px 0; color: var(--text); font-size: 13.5px; line-height: 1.55; }
.howto-card ul, .howto-card ol { margin: 6px 0; padding-left: 20px; color: var(--text); font-size: 13.5px; }
.howto-card li { margin: 3px 0; line-height: 1.55; }
.howto-card-sub { color: var(--text-muted); font-size: 12.5px; margin: 0 0 10px; }
.howto-emoji { font-size: 20px; }
.howto-card a { color: var(--n8n); text-decoration: none; }
.howto-card a:hover { text-decoration: underline; }
.howto-card code { background: var(--surface-2); color: var(--text); padding: 1px 6px; border-radius: 4px; font-size: 12px; font-family: 'SF Mono', ui-monospace, monospace; border: 1px solid var(--border); }
.howto-pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; vertical-align: middle; }
.howto-pill.recommended { background: rgba(34, 197, 94, 0.12); color: #16a34a; }
.howto-pill.advanced { background: rgba(245, 158, 11, 0.15); color: #b45309; }
.howto-pill.beta { background: var(--n8n-tint); color: var(--n8n-dark); }
.howto-pill.admin { background: rgba(139, 92, 246, 0.15); color: #6d28d9; }
.howto-examples { background: var(--surface-2); border-left: 3px solid var(--n8n); padding: 10px 14px; margin: 10px 0; border-radius: 0 6px 6px 0; font-size: 13px; color: var(--text); }
.howto-examples b { display: block; margin-bottom: 5px; color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.howto-examples i { color: var(--text); font-style: italic; }
.howto-caveat { background: rgba(245, 158, 11, 0.08); border-left: 3px solid #f59e0b; padding: 10px 14px; margin: 12px 0; border-radius: 0 6px 6px 0; font-size: 13px; color: var(--text); }
.howto-caveat b { display: block; margin-bottom: 4px; color: #b45309; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 700; }
.howto-card.beta-callout { background: var(--n8n-tint); border-color: var(--n8n); }
.howto-table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 8px 0; }
.howto-table th, .howto-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); color: var(--text); }
.howto-table th { font-weight: 600; color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; }
[data-theme="dark"] .howto-pill.recommended { background: rgba(34, 197, 94, 0.2); color: #4ade80; }
[data-theme="dark"] .howto-pill.advanced { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
[data-theme="dark"] .howto-pill.admin { background: rgba(139, 92, 246, 0.25); color: #c4b5fd; }
[data-theme="dark"] .howto-caveat b { color: #fbbf24; }
[data-theme="dark"] .howto-caveat { background: rgba(245, 158, 11, 0.08); }

/* ── Logo Rights ───────────────────────────────────────────────────────── */
.view-logo {
  position: relative;
  overflow-x: clip;
}
.view-logo .table-wrap {
  max-width: none;
  margin: 0;
  padding: 0 0 32px;
  overscroll-behavior-x: contain;
}
.logo-controls { gap: 12px; }

.logo-banner { max-width: 1280px; margin: 16px auto 0; padding: 10px 16px; background: var(--n8n-tint); border: 1px solid var(--n8n); border-radius: 10px; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 12.5px; color: var(--text); }
.logo-banner[hidden] { display: none; }
.logo-banner b { color: var(--n8n-dark); }
.logo-banner-btn { background: var(--surface); border: 1px solid var(--n8n); color: var(--n8n-dark); font-family: inherit; font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.logo-banner-btn:hover { background: var(--n8n); color: #fff; }

#logo-table thead th:not(.sortable) { cursor: default; }
#logo-table thead th:not(.sortable):hover { background: #f9fafb; color: #6b7280; }
#logo-table {
  min-width: 1940px;
  border-collapse: separate;
  border-spacing: 0;
  overflow: visible;
}
#logo-table thead th:first-child,
#logo-table tbody td:first-child {
  left: 0;
  min-width: 180px;
  max-width: 220px;
  background: var(--surface);
  box-shadow: 1px 0 0 var(--border), 10px 0 18px rgba(15, 23, 42, .06);
}
#logo-table tbody td:first-child {
  position: sticky;
  z-index: 3;
}
#logo-table tbody tr:hover td:first-child {
  background: #fafbff;
}
#logo-table thead th {
  position: relative;
  z-index: 6;
}
#logo-table thead th:first-child {
  position: sticky;
  left: 0;
  z-index: 7;
  background: #f9fafb;
}
.logo-th-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  vertical-align: middle;
}
.logo-th-text {
  display: inline-flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.05;
}
.logo-th-filter-btn {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-left: 5px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  vertical-align: middle;
}
.logo-th-filter-btn svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linejoin: round;
}
.logo-th-filter-btn:hover {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text);
}
.logo-th-filter-btn.active {
  border-color: var(--n8n);
  background: var(--n8n-tint);
  color: var(--n8n);
}
.logo-column-filter-popover {
  position: fixed;
  z-index: 500;
  width: 280px;
}
.logo-column-filter-popover[hidden] {
  display: none;
}
.logo-column-filter-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 18px 44px rgba(15, 23, 42, .18);
  padding: 10px;
}
.logo-column-filter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.logo-column-filter-head b {
  color: var(--text);
  font-size: 13px;
}
.logo-column-filter-close {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}
.logo-column-filter-close:hover {
  background: var(--surface-2);
  color: var(--text);
}
.logo-column-filter-input {
  width: 100%;
}
.logo-column-filter-range {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.logo-column-filter-options {
  display: grid;
  gap: 2px;
  max-height: 220px;
  overflow-y: auto;
}
.logo-column-filter-options label {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  padding: 3px 4px;
  border-radius: 6px;
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
}
.logo-column-filter-options label:hover {
  background: var(--surface-2);
}
.logo-column-filter-options input[type="checkbox"] {
  accent-color: var(--n8n);
  flex: 0 0 auto;
}
.logo-column-filter-options span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.logo-column-filter-empty {
  color: var(--text-muted);
  font-size: 12px;
  padding: 6px 2px;
}
.logo-column-filter-actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px solid var(--border);
  margin-top: 10px;
  padding-top: 10px;
}
.logo-column-filter-actions .btn-secondary {
  flex: 1;
}
.logo-doc-cell { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-muted); }
.logo-sf-link { color: var(--n8n-dark); text-decoration: none; font-weight: 500; }
.logo-sf-link:hover { text-decoration: underline; }
.logo-verified-tick { color: #16a34a; font-weight: 700; margin-left: 6px; }
.logo-verification { font-size: 12px; font-weight: 600; white-space: nowrap; }
.logo-verification-yes { color: #166534; }
.logo-verification-no { color: #92400e; }

#logo-table .logo-sf-link { color: var(--text-muted); font-weight: 500; }
#logo-table .logo-sf-link:hover { color: var(--text); }
#logo-table .logo-proof-btn { appearance: none; border: 0; background: transparent; color: var(--text); font: inherit; padding: 0; display: inline-flex; flex-direction: column; align-items: flex-start; gap: 1px; cursor: pointer; text-align: left; max-width: 120px; }
#logo-table .logo-proof-btn span { font-size: 12px; font-weight: 600; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
#logo-table .logo-proof-btn em { color: var(--text-faint); font-size: 10.5px; font-style: normal; font-weight: 500; line-height: 1.1; }
#logo-table .logo-proof-btn:hover span { text-decoration: underline; }
#logo-table .logo-proof-btn:hover em { color: var(--text-muted); }
#logo-table .logo-verification,
#logo-table .logo-verification-yes,
#logo-table .logo-verification-no { color: var(--text-muted); font-weight: 500; }
#logo-table .logo-verification-yes { display: inline-flex; align-items: center; gap: 4px; }
#logo-table .logo-verified-tick { color: var(--text-faint); }
#logo-table .logo-case-study-status-cell { min-width: 165px; }
#logo-table .logo-case-study-status-cell .status-select { max-width: 165px; }
#logo-table .logo-industry-cell {
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
}
#logo-table .logo-plan-pill {
  display: inline-flex;
  align-items: center;
  max-width: 110px;
  height: 22px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}
#logo-table .logo-quota-cell { min-width: 86px; }

/* Status pills used in supporting logo-rights surfaces, not the main table. */
.logo-pill { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.logo-pill-granted { background: #dcfce7; color: #166534; }
.logo-pill-restricted { background: #fef3c7; color: #92400e; }
.logo-pill-denied { background: #fee2e2; color: #991b1b; }
.logo-pill-notspec { background: var(--surface-3); color: var(--text-muted); }
.logo-pill-none { background: transparent; border: 1px dashed var(--border-strong); color: var(--text-faint); }
.logo-pill-overridden { outline: 1px dashed var(--n8n); outline-offset: 1px; }

/* Degree-1 action-class table pills (the primary lens) */
.logo-pill-usable     { background: #dcfce7; color: #166534; }
.logo-pill-consent    { background: #fef9c3; color: #854d0e; }
.logo-pill-verify     { background: #dbeafe; color: #1e40af; }
.logo-pill-chase      { background: #ffedd5; color: #9a3412; }
.logo-pill-not_usable { background: #fee2e2; color: #991b1b; }
[data-theme="dark"] .logo-pill-usable     { background: rgba(34,197,94,.16); color: #4ade80; }
[data-theme="dark"] .logo-pill-consent    { background: rgba(234,179,8,.16); color: #facc15; }
[data-theme="dark"] .logo-pill-verify     { background: rgba(59,130,246,.18); color: #60a5fa; }
[data-theme="dark"] .logo-pill-chase      { background: rgba(249,115,22,.18); color: #fb923c; }
[data-theme="dark"] .logo-pill-not_usable { background: rgba(239,68,68,.16); color: #f87171; }

[data-theme="dark"] #logo-table thead th:not(.sortable):hover { background: var(--surface-2); color: var(--text-muted); }
[data-theme="dark"] #logo-table thead th:first-child { background: var(--surface-2); }
[data-theme="dark"] #logo-table tbody td:first-child { background: var(--surface); box-shadow: 1px 0 0 var(--border), 10px 0 18px rgba(0,0,0,.28); }
[data-theme="dark"] #logo-table tbody tr:hover td:first-child { background: var(--surface-2); }
[data-theme="dark"] .logo-column-filter-card { box-shadow: 0 18px 44px rgba(0,0,0,.42); }
[data-theme="dark"] .logo-pill-granted { background: rgba(34,197,94,.16); color: #4ade80; }
[data-theme="dark"] .logo-pill-restricted { background: rgba(245,158,11,.16); color: #fbbf24; }
[data-theme="dark"] .logo-pill-denied { background: rgba(239,68,68,.16); color: #f87171; }
[data-theme="dark"] .logo-banner-btn { background: var(--surface); }
[data-theme="dark"] .logo-verification-yes { color: #4ade80; }
[data-theme="dark"] .logo-verification-no { color: #fbbf24; }

/* Modal logo panel — contract-audit layout: status → clause → source → notes → actions */
/* 1) Status row */
.amod-logo-statusrow { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 4px; }
.amod-logo-verdict-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; padding: 5px 13px; border-radius: 999px; }
.amod-logo-verdict-pill-ico { font-weight: 700; }
.amod-logo-verdict-pill.v-granted { background: #dcfce7; color: #166534; }
.amod-logo-verdict-pill.v-restricted { background: #fef3c7; color: #92400e; }
.amod-logo-verdict-pill.v-denied { background: #fee2e2; color: #991b1b; }
.amod-logo-verdict-pill.v-notspec,
.amod-logo-verdict-pill.v-none { background: var(--surface-3); color: var(--text-muted); }
/* Action-class verdict pill (modal header + decision card) */
.amod-logo-pill.v-usable, .amod-logo-verdict-pill.v-usable { background: #dcfce7; color: #166534; }
.amod-logo-pill.v-consent, .amod-logo-verdict-pill.v-consent { background: #fef9c3; color: #854d0e; }
.amod-logo-pill.v-verify, .amod-logo-verdict-pill.v-verify { background: #dbeafe; color: #1e40af; }
.amod-logo-pill.v-chase, .amod-logo-verdict-pill.v-chase { background: #ffedd5; color: #9a3412; }
.amod-logo-pill.v-not_usable, .amod-logo-verdict-pill.v-not_usable { background: #fee2e2; color: #991b1b; }
[data-theme="dark"] .amod-logo-pill.v-usable, [data-theme="dark"] .amod-logo-verdict-pill.v-usable { background: rgba(34,197,94,.16); color: #4ade80; }
[data-theme="dark"] .amod-logo-pill.v-consent, [data-theme="dark"] .amod-logo-verdict-pill.v-consent { background: rgba(234,179,8,.16); color: #facc15; }
[data-theme="dark"] .amod-logo-pill.v-verify, [data-theme="dark"] .amod-logo-verdict-pill.v-verify { background: rgba(59,130,246,.18); color: #60a5fa; }
[data-theme="dark"] .amod-logo-pill.v-chase, [data-theme="dark"] .amod-logo-verdict-pill.v-chase { background: rgba(249,115,22,.18); color: #fb923c; }
[data-theme="dark"] .amod-logo-pill.v-not_usable, [data-theme="dark"] .amod-logo-verdict-pill.v-not_usable { background: rgba(239,68,68,.16); color: #f87171; }
/* Decision-card sub-elements for the 5-class lens */
.amod-logo-detailrow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0 2px; }
.amod-logo-detailed { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.amod-logo-flag { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 2px 7px; border-radius: 999px; background: var(--surface-3); color: var(--text-muted); }
.amod-logo-conf { font-size: 13px; color: var(--text-muted); }
.amod-logo-vpill { font-size: 12px; font-weight: 700; padding: 4px 11px; border-radius: 999px; }
.amod-logo-vpill.unverified { background: #fdf0e3; color: #9a5b1d; }
.amod-logo-vpill.verified { background: #dcfce7; color: #166534; }
.amod-logo-decision { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(220px, .8fr); gap: 12px; align-items: stretch; }
.amod-logo-decision-main, .amod-logo-next { border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); padding: 13px 14px; }
.amod-logo-decision-main p { margin: 9px 0 0; color: var(--text); font-size: 13px; line-height: 1.45; }
.amod-logo-next span, .amod-logo-facts span { display: block; color: var(--text-faint); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 5px; }
.amod-logo-next b { display: block; color: var(--text); font-size: 13px; line-height: 1.4; }
.amod-logo-facts { margin-top: 12px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.amod-logo-facts div { border: 1px solid var(--border); border-radius: 9px; padding: 9px 11px; background: var(--surface); min-width: 0; }
.amod-logo-facts b { display: block; color: var(--text); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.amod-logo-facts b.ok { color: #166534; }
.amod-logo-facts b.warn { color: #92400e; }
.amod-logo-proof-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .12s, background .12s;
}
.amod-logo-proof-btn:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
}
.amod-logo-evidence { margin-top: 10px; border-top: 1px solid var(--border); padding-top: 8px; }
.amod-logo-overview .amod-logo-evidence { border-top: 0; padding-top: 0; }
.amod-logo-evidence > summary { cursor: pointer; color: var(--text-muted); font-size: 12px; font-weight: 700; list-style: none; }
.amod-logo-evidence > summary::-webkit-details-marker { display: none; }
.amod-logo-evidence > summary::before { content: '›'; display: inline-block; margin-right: 6px; color: var(--text-faint); transition: transform .12s; }
.amod-logo-evidence[open] > summary::before { transform: rotate(90deg); }
.amod-logo-evidence[open] > summary { margin-bottom: 6px; }
@media (max-width: 780px) {
  .amod-logo-decision { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .logo-column-filter-popover {
    left: 10px !important;
    width: calc(100vw - 20px);
  }
}
@media (max-width: 520px) {
  .amod-logo-facts { grid-template-columns: 1fr; }
}

/* 2) Section blocks (verbatim clause, restrictions) */
.amod-logo-sec { margin-top: 14px; }
.amod-logo-sec-label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 8px; }
.amod-logo-quote { font-size: 14px; line-height: 1.6; color: var(--text); background: var(--surface-2); border-left: 3px solid var(--border-strong); border-radius: 0 6px 6px 0; padding: 12px 16px; margin: 0; }
.amod-logo-clauseref { color: var(--text-faint); font-size: 13px; white-space: nowrap; }
.amod-logo-restr { font-size: 13px; line-height: 1.45; color: var(--text); display: grid; gap: 8px; }
.amod-logo-note-group { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.amod-logo-note-group-compact { padding: 9px 12px; }
.amod-logo-note-label { color: var(--text-muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.amod-logo-bullets { margin: 0; padding-left: 16px; display: flex; flex-direction: column; gap: 3px; }
.amod-logo-bullets li { padding-left: 1px; }
.amod-logo-more { color: var(--text-faint); font-style: italic; }

.amod-logo-public { margin-top: 8px; }
.amod-logo-public-list { display: flex; flex-direction: column; gap: 8px; }
.amod-logo-public-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 14px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); color: inherit; text-decoration: none; }
.amod-logo-public-row:hover { border-color: var(--border-strong); background: var(--surface); }
.amod-logo-public-main { min-width: 0; display: flex; align-items: baseline; gap: 8px; }
.amod-logo-public-main b { font-size: 13px; color: var(--text); }
.amod-logo-public-main span { color: var(--text-muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.amod-logo-public-detail { grid-column: 1; color: var(--text-muted); font-size: 12.5px; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.amod-logo-public-open { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--n8n-dark); font-size: 12px; font-weight: 700; white-space: nowrap; }
@media (max-width: 680px) {
  .amod-logo-public-row { grid-template-columns: 1fr; }
  .amod-logo-public-open { grid-column: 1; grid-row: auto; }
  .amod-logo-public-detail { white-space: normal; }
}

/* 3) Source metadata — aligned key/value rows */
.amod-logo-meta { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.amod-logo-metarow { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13.5px; }
.amod-logo-metak { display: inline-flex; align-items: center; gap: 9px; color: var(--text-muted); flex: none; }
.amod-logo-ico { color: var(--text-faint); flex: none; }
.amod-logo-metav { color: var(--text); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.amod-logo-sflink { color: var(--n8n-dark); text-decoration: none; font-weight: 500; white-space: nowrap; flex: none; }
.amod-logo-sflink:hover { text-decoration: underline; }

/* 4) Action row */
.amod-logo-foot { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.amod-logo-actions { display: flex; align-items: center; gap: 10px; }
.amod-logo-btn { display: inline-flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--border); color: var(--text); font-family: inherit; font-size: 13px; font-weight: 600; padding: 8px 15px; border-radius: 9px; cursor: pointer; transition: all .12s; white-space: nowrap; }
.amod-logo-btn:hover { border-color: var(--border-strong); background: var(--surface-2); }
.amod-logo-btn.active { border-color: #16a34a; color: #166534; background: #dcfce7; }
.amod-logo-prov { margin-left: auto; font-size: 12px; color: var(--text-faint); text-align: right; }
.amod-logo-editor { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.amod-logo-editor[hidden] { display: none; }
.amod-logo-override { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; font-family: inherit; font-size: 13px; color: var(--text); cursor: pointer; }
.amod-logo-note { display: block; width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; font-size: 13px; font-family: inherit; color: var(--text); outline: none; box-sizing: border-box; resize: vertical; transition: all .12s; }
.amod-logo-note:hover { border-color: var(--border-strong); }
.amod-logo-note:focus { border-color: var(--n8n); box-shadow: 0 0 0 3px var(--n8n-tint); }

[data-theme="dark"] .amod-logo-verdict-pill.v-granted { background: rgba(34,197,94,.16); color: #4ade80; }
[data-theme="dark"] .amod-logo-verdict-pill.v-restricted { background: rgba(245,158,11,.16); color: #fbbf24; }
[data-theme="dark"] .amod-logo-verdict-pill.v-denied { background: rgba(239,68,68,.16); color: #f87171; }
[data-theme="dark"] .amod-logo-vpill.unverified { background: rgba(245,158,11,.12); color: #fbbf24; }
[data-theme="dark"] .amod-logo-vpill.verified { background: rgba(34,197,94,.16); color: #4ade80; }
[data-theme="dark"] .amod-logo-btn.active { background: rgba(34,197,94,.16); color: #4ade80; border-color: #16a34a; }

/* ── Account modal v2 — decision workspace ───────────────────────────── */
.account-modal-card {
  width: min(1120px, calc(100vw - 48px));
  max-width: 1120px;
  max-height: calc(100vh - 56px);
  padding: 0;
  overflow: auto;
}
.account-modal-body { gap: 0; }
.account-modal-card .modal-close { top: 16px; right: 18px; z-index: 3; }

.account-modal-body > .amod-head {
  padding: 20px 24px 8px;
  align-items: flex-start;
}
.account-modal-body > .amod-subhead-owner {
  margin: 0;
  padding: 0 24px 18px;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}
.amod-owner-strip {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  grid-column: 2;
  grid-row: 1 / span 2;
}
.amod-owner-pill {
  min-width: 136px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
}
.amod-owner-pill span,
.amod-fact-grid span {
  display: block;
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.amod-owner-pill b {
  display: block;
  margin-top: 3px;
  color: var(--text);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.amod-subhead-meta {
  grid-column: 1;
  font-size: 13px;
  line-height: 1.4;
}

.amod-body-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(340px, .95fr);
  gap: 18px;
  padding: 18px 24px 24px;
  background: var(--surface-2);
}
.amod-main-col,
.amod-side-col {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.amod-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
}
.amod-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.amod-card-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
}
.amod-card-head h2 {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
.amod-card-head p {
  margin: 3px 0 0;
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.35;
}
.amod-secondary-btn {
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.amod-secondary-btn:hover { border-color: var(--border-strong); background: var(--surface-2); }

.amod-logo-summary-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.amod-logo-card-note {
  margin: 10px 0 0;
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.45;
}
.amod-brand-logo {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}
.amod-brand-logo[hidden] { display: none; }
.amod-brand-logo-variants {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.amod-brand-logo-variants.has-one-variant {
  grid-template-columns: 1fr;
}
.amod-brand-logo-swatch {
  min-width: 0;
  display: grid;
  gap: 6px;
}
.amod-brand-logo-swatch[hidden] {
  display: none;
}
.amod-brand-logo-swatch-head {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.amod-brand-logo-swatch-label {
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}
.amod-brand-export-group {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.amod-brand-export {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  min-height: 19px;
  padding: 0 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 9.5px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
}
.amod-brand-export:hover {
  border-color: rgba(234,75,113,.42);
  color: var(--n8n-dark);
  background: var(--n8n-tint);
  text-decoration: none;
}
.amod-brand-export.is-disabled {
  cursor: not-allowed;
  opacity: .42;
}
.amod-brand-logo-canvas {
  height: 58px;
  padding: 8px 10px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.amod-brand-logo-canvas-light {
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(15,23,42,.04);
}
.amod-brand-logo-canvas-dark {
  border-color: rgba(255,255,255,.14);
  background: #111827;
}
.amod-brand-logo-img {
  display: block;
  max-width: 100%;
  max-height: 42px;
  object-fit: contain;
}
.amod-brand-logo-copy {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.amod-brand-logo-copy span {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.amod-brand-logo-copy b {
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}
.amod-brand-logo.is-loading .amod-brand-logo-mark {
  border-radius: 6px;
  background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2));
  background-size: 220% 100%;
  animation: logoPreviewPulse 1.1s ease-in-out infinite;
}
.amod-brand-logo.is-loading .amod-brand-logo-mark {
  width: 112px;
  height: 42px;
}
@keyframes logoPreviewPulse {
  0% { background-position: 0 0; }
  100% { background-position: -220% 0; }
}
@media (max-width: 520px) {
  .amod-brand-logo-variants { grid-template-columns: 1fr; }
  .amod-brand-logo-copy { align-items: flex-start; flex-direction: column; gap: 2px; }
}
.amod-logo-human-note {
  margin: 10px 0 0;
  padding: 10px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.4;
}
.amod-logo-human-note b {
  display: block;
  margin-bottom: 3px;
  color: var(--text);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.amod-logo-editor {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.amod-logo-editor-grid {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  gap: 14px;
}
.amod-logo-editor-main {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.amod-logo-editor-main .amod-field { margin: 0; }
.amod-logo-editor-proof .amod-logo-evidence { margin-top: 0; padding-top: 0; border-top: 0; }

.logo-decision-modal-card {
  max-width: 640px;
  max-height: calc(100vh - 40px);
}
.logo-proof-modal-card {
  max-width: 760px;
  max-height: calc(100vh - 40px);
}
.logo-proof-context {
  margin: 4px 0 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--text-muted);
  font-size: 13px;
}
.logo-proof-details {
  display: grid;
  gap: 12px;
}
.logo-proof-details .amod-logo-sec {
  margin-top: 0;
}
.logo-proof-details .amod-logo-meta {
  margin-top: 0;
}
.logo-proof-empty {
  padding: 18px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  text-align: center;
}
.logo-decision-picker {
  display: grid;
  gap: 12px;
  margin-top: 8px;
}
.logo-decision-context {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-muted);
  font-size: 12.5px;
}
.logo-decision-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.logo-decision-option {
  width: 100%;
  min-height: 70px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.logo-decision-option:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
}
.logo-decision-option.selected {
  border-color: var(--n8n);
  background: var(--n8n-tint);
  box-shadow: 0 0 0 2px rgba(234,75,113,.12);
}
.logo-decision-option-title {
  display: block;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
}
.logo-decision-option-sub {
  display: block;
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 11.5px;
  line-height: 1.3;
}
.logo-decision-verify {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}
.logo-decision-verify input { accent-color: var(--n8n); }
.logo-decision-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.amod-case-card { padding: 14px; }
.amod-case-head { margin-bottom: 12px; }
.amod-case-flow { padding: 2px 4px 0; }
.amod-case-groups {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  margin-bottom: 8px;
  color: var(--text-faint);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}
.amod-case-group-spacer { grid-column: 1; }
.amod-case-group-outreach { grid-column: 2 / span 4; }
.amod-case-group-production { grid-column: 6 / span 4; }
.amod-case-rail {
  position: relative;
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  margin: 0 4px;
}
.amod-case-rail::before,
.amod-case-rail::after {
  content: "";
  position: absolute;
  top: 5px;
  height: 2px;
  border-radius: 999px;
}
.amod-case-rail::before {
  left: 6%;
  right: 6%;
  background: var(--border);
}
.amod-case-rail::after {
  left: var(--case-progress-start, 16.7%);
  right: calc(100% - var(--case-progress));
  background: var(--n8n);
}
.amod-case-divider {
  position: absolute;
  z-index: 2;
  left: 55.55%;
  top: -3px;
  width: 1px;
  height: 17px;
  background: var(--border-strong);
}
.amod-case-stage {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 5px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-faint);
  font: inherit;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.1;
  text-align: center;
  cursor: pointer;
}
.amod-case-stage span {
  max-width: 58px;
}
.amod-case-stage::before {
  content: "";
  width: 10px;
  height: 10px;
  border: 2px solid var(--border-strong);
  border-radius: 50%;
  background: var(--surface);
  box-sizing: border-box;
}
.amod-case-stage.done::before {
  border-color: var(--n8n);
  background: var(--n8n);
}
.amod-case-stage.current {
  color: var(--text);
  font-weight: 800;
}
.amod-case-stage.current::before {
  width: 16px;
  height: 16px;
  margin-top: -3px;
  border: 3px solid var(--n8n-tint);
  background: var(--n8n);
  box-shadow: 0 0 0 1px var(--n8n-tint);
}
.amod-case-stage:hover span { color: var(--text); text-decoration: underline; }
.amod-case-offtrack {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.amod-case-offtrack > span {
  margin-right: 2px;
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}
.amod-case-offbtn {
  flex: 0 0 auto;
  min-width: 82px;
  min-height: 24px;
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.amod-case-offbtn:hover { border-color: var(--border-strong); background: var(--surface-2); }
.amod-case-offbtn.current { border-color: var(--n8n); background: var(--n8n-tint); color: var(--n8n-dark); }

.amod-team-card .amod-post-area {
  min-height: 116px;
  margin: 0;
  font-size: 14px;
}
.amod-team-card .amod-post-actions { margin-top: 10px; }
.amod-activity-card {
  background: var(--surface-2);
}
.amod-activity-card .amod-card-head { margin-bottom: 8px; }

.amod-fact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}
.amod-fact-grid > div {
  min-width: 0;
  min-height: 64px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
}
.amod-fact-grid > .amod-fact-primary {
  grid-column: 1 / -1;
  min-height: 76px;
  background: var(--surface);
}
.amod-fact-grid span { margin-bottom: 5px; }
.amod-fact-grid b {
  display: block;
  color: var(--text);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.amod-fact-grid > .amod-fact-primary b {
  font-size: 22px;
  line-height: 1.1;
}
.amod-story-score {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}
.amod-score-ring {
  width: 68px;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at center, var(--surface) 0 56%, transparent 57%),
    conic-gradient(var(--n8n) calc(var(--score) * 1%), var(--surface-3) 0);
}
.amod-score-ring b {
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
}
.amod-story-score p {
  margin: 0;
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.4;
}
.amod-story-breakdown {
  margin-top: 10px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

@media (max-width: 980px) {
  .account-modal-body > .amod-subhead-owner,
  .amod-body-grid {
    grid-template-columns: 1fr;
  }
  .amod-owner-strip {
    grid-column: 1;
    grid-row: auto;
    justify-content: flex-start;
  }
}
@media (max-width: 600px) {
  .header-top { padding: 0 14px; gap: 10px; }
  .header-logo { gap: 9px; }
  .header-logo .n8n-logo { height: 22px; }
  .header h1 { max-width: 42vw; font-size: 14px; }
  .header h1 span { display: none; }
  .tabs { padding: 0 14px; }
  .tab { padding: 10px 10px; }
  .user-chip { display: none; }
  .agent-empty { margin-top: 4vh; }
  .agent-msg { max-width: 94%; }
  .agent-input-dock { padding: 12px 12px 14px; }
  .account-modal-card { width: calc(100vw - 20px); max-height: calc(100vh - 20px); }
  .account-modal-body > .amod-head,
  .account-modal-body > .amod-subhead-owner,
  .amod-body-grid { padding-left: 14px; padding-right: 14px; }
  .amod-logo-editor-grid,
  .logo-decision-options,
  .amod-fact-grid,
  .amod-story-score { grid-template-columns: 1fr; }
  .amod-case-groups { display: none; }
  .amod-case-rail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .amod-case-rail::before,
  .amod-case-rail::after,
  .amod-case-divider { display: none; }
  .amod-case-stage {
    border: 1px solid var(--border);
    border-radius: 7px;
    padding: 7px 8px;
  }
  .amod-case-stage::before { display: none; }
  .amod-case-stage.current { border-color: var(--n8n); background: var(--n8n-tint); color: var(--n8n-dark); }
  .amod-act-by,
  .amod-act-when { display: none; }
  .amod-act-body { flex-basis: 100%; }
}

@media (max-width: 720px) {
  .agent-shell,
  .agent-shell.agent-rail-open,
  .agent-shell.agent-rail-closed { display: block; height: calc(100vh - 110px); min-height: 520px; }
  .agent-shell.agent-rail-open::before { content: ""; position: fixed; left: 0; right: 0; top: 110px; bottom: 0; background: rgba(15, 15, 15, .34); z-index: 130; }
  .agent-rail { position: fixed; left: 0; top: 110px; bottom: 0; z-index: 140; width: 280px; border-right: 1px solid var(--border); box-shadow: 18px 0 40px rgba(15, 23, 42, .16); transform: translateX(-100%); transition: transform .2s ease; }
  .agent-shell.agent-rail-open .agent-rail { transform: translateX(0); }
  .agent-main { height: 100%; min-height: 0; grid-template-rows: auto auto minmax(0, 1fr) auto; }
  .agent-mobile-bar { display: flex; }
  .agent-mini-toolbar { display: none !important; }
  .agent-panel-head { padding: 12px 14px; }
  .agent-panel-sub { max-width: calc(100vw - 86px); white-space: normal; }
  .agent-thread { padding: 22px 14px 14px; }
  .agent-message-list { gap: 12px; }
}

/* Unmatched contracts list (modal) */
.logo-unmatched-list { display: flex; flex-direction: column; gap: 10px; max-height: 56vh; overflow-y: auto; }
.logo-unmatched-row { border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; }
.logo-unmatched-name { font-size: 13px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.logo-unmatched-meta { font-size: 11.5px; color: var(--text-faint); margin: 3px 0 6px; }

/* Admin */
.admin-wrap { max-width: 1180px; margin: 0 auto; padding: 24px 28px 48px; }
.admin-subtabs { display: inline-flex; align-items: center; gap: 3px; padding: 3px; margin-bottom: 14px; background: var(--surface-3); border: 1px solid var(--border); border-radius: 8px; }
.admin-subtab { height: 28px; border: none; border-radius: 6px; padding: 0 12px; background: transparent; color: var(--text-muted); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.admin-subtab:hover { color: var(--text); }
.admin-subtab.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.admin-panel { display: none; }
.admin-panel.active { display: grid; gap: 14px; }
.admin-users-summary { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; color: var(--text-muted); font-size: 12px; }
.admin-users-summary span { border: 1px solid var(--border); border-radius: 999px; padding: 5px 9px; background: var(--surface-2); }
.admin-users-summary b { color: var(--text); }
.admin-users-table-wrap { overflow-x: auto; }
.admin-users-table { min-width: 900px; font-size: 12px; }
.admin-users-table th { cursor: default; }
.admin-users-table tr.saving { opacity: .65; }
.admin-user-email { color: var(--text); font-weight: 800; margin-bottom: 3px; }
.admin-user-meta { color: var(--text-faint); font-size: 11px; }
.admin-user-role,
.admin-user-input { width: 100%; min-width: 130px; height: 30px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); color: var(--text); padding: 0 9px; font: inherit; font-size: 12px; outline: none; }
.admin-user-role { min-width: 108px; }
.admin-user-role:disabled { opacity: .55; cursor: not-allowed; }
.admin-user-input:focus,
.admin-user-role:focus { border-color: rgba(234, 75, 113, .65); box-shadow: 0 0 0 3px rgba(234, 75, 113, .10); }
.admin-user-count { color: var(--text); font-weight: 800; font-variant-numeric: tabular-nums; }
.admin-agent-controls { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.admin-agent-list { display: grid; gap: 10px; }
.admin-agent-card { border: 1px solid var(--border); border-radius: 8px; background: var(--surface); overflow: hidden; }
.admin-agent-card[open] { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.admin-agent-card summary { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; gap: 10px 16px; align-items: center; padding: 12px 14px; cursor: pointer; list-style: none; }
.admin-agent-card summary::-webkit-details-marker { display: none; }
.admin-agent-card summary::before { content: '›'; color: var(--text-faint); font-size: 20px; line-height: 1; transform: rotate(0deg); transition: transform .12s; }
.admin-agent-card[open] summary::before { transform: rotate(90deg); }
.admin-agent-card-main { display: grid; gap: 4px; min-width: 0; }
.admin-agent-title { color: var(--text); font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-agent-question { color: var(--text-muted); font-size: 12px; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-agent-meta { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; justify-content: flex-end; color: var(--text-faint); font-size: 11px; }
.admin-agent-meta span { border: 1px solid var(--border); border-radius: 999px; padding: 4px 7px; background: var(--surface-2); }
.admin-agent-thread { display: grid; gap: 10px; padding: 0 14px 14px 36px; }
.admin-agent-message { max-width: 900px; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; background: var(--surface-2); }
.admin-agent-message.user { border-color: rgba(234, 75, 113, .28); background: rgba(234, 75, 113, .06); }
.admin-agent-message.assistant { margin-left: 22px; }
.admin-agent-message-head { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 6px; color: var(--text-faint); font-size: 11px; }
.admin-agent-message-head b { color: var(--text); font-size: 12px; }
.admin-agent-message-body { color: var(--text); font-size: 13px; line-height: 1.5; }
.admin-agent-message-body p { margin: 0 0 8px; }
.admin-agent-message-body p:last-child,
.admin-agent-message-body ul:last-child,
.admin-agent-message-body ol:last-child { margin-bottom: 0; }
.admin-agent-message-body table { max-width: 100%; }
.admin-agent-tools { margin-top: 8px; color: var(--text-faint); font-size: 11px; }

/* Admin */
.admin-panel-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.admin-panel-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
@media (max-width: 720px) {
  .admin-panel-head { display: grid; grid-template-columns: 1fr; }
  .admin-agent-card summary { grid-template-columns: 14px minmax(0, 1fr); }
  .admin-agent-meta { grid-column: 2; justify-content: flex-start; }
  .admin-agent-thread { padding-left: 14px; }
  .admin-agent-message.assistant { margin-left: 0; }
}
