:root {
  --ink: #152629;
  --ink-soft: #53666a;
  --muted: #829396;
  --line: #d8e4e0;
  --canvas: #f1f6f4;
  --surface: #ffffff;
  --accent: #d96249;
  --accent-soft: #fff0eb;
  --success: #2563eb;
  --danger: #bd4d4b;
  --radius: 12px;
  --shadow: 0 12px 32px rgba(27, 54, 52, 0.07);
  font-family: "Aptos", "Segoe UI Variable", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: radial-gradient(circle at 92% -10%, #ffffff 0, transparent 35%), var(--canvas); }
[data-test-only] { display: none !important; }
body.test-mode .test-only-button { display: inline-flex !important; }
body.test-mode .test-only-banner { display: flex !important; }
button, input { font: inherit; }
button { cursor: pointer; }

.app-shell { min-height: 100dvh; display: grid; grid-template-columns: 244px minmax(0, 1fr); }
.mode-badge { display: inline-flex; align-items: center; min-height: 28px; padding: 0 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-soft); background: var(--surface); font-size: 11px; white-space: nowrap; }
.sidebar { background: #111827; border-right: 1px solid #202c42; padding: 28px 17px 18px; display: flex; flex-direction: column; color: #f8fafc; }
.brand-lockup, .user-row, .detail-person, .topbar, .panel-heading, .section-title-row, .action-row, .detail-status-row { display: flex; align-items: center; }
.brand-lockup { gap: 11px; padding: 0 10px 28px; }
.brand-lockup strong { display: block; color: #f8fafc; font-size: 15px; letter-spacing: .04em; }
.brand-lockup span { display: block; color: #94a3b8; font-size: 11px; margin-top: 3px; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; background: var(--accent); font-weight: 800; font-size: 16px; }
.eyebrow, .metric-label, .tiny-label { color: var(--muted); font-size: 10px; letter-spacing: .13em; text-transform: uppercase; }
.workspace-switcher { padding: 0 10px 26px; }
.workspace-switcher .eyebrow { display: block; margin-bottom: 8px; }
.sidebar .eyebrow { color: #7183a0; }
.workspace-button { width: 100%; border: 0; background: transparent; color: #f8fafc; display: flex; justify-content: space-between; padding: 0; font-size: 12px; text-align: left; }
.chevron { color: #7183a0; font-size: 16px; line-height: 10px; }
.nav-stack { display: grid; gap: 5px; }
.nav-item { border: 0; border-radius: 10px; background: transparent; color: #a9b7cc; display: grid; grid-template-columns: 25px 1fr auto; align-items: center; gap: 8px; padding: 11px 10px; font-size: 13px; text-align: left; }
.nav-item:hover, .nav-item.active { background: #f1f5ff; color: #111827; }
.nav-item.active { font-weight: 700; }
.nav-symbol { width: 23px; height: 23px; border: 1px solid #40516c; border-radius: 7px; display: grid; place-items: center; color: #a9b7cc; font-size: 10px; font-weight: 700; }
.nav-item.active .nav-symbol { border-color: var(--accent); color: var(--accent); background: #fff0eb; }
.nav-count { color: #7183a0; font-size: 11px; }
.nav-item.active .nav-count, .nav-count.alert { color: var(--accent); font-weight: 700; }
.sidebar-footer { margin-top: auto; padding: 18px 10px 0; border-top: 1px solid #26344d; }
.sync-status { display: flex; align-items: center; gap: 7px; color: #8db4ff; font-size: 11px; margin-bottom: 18px; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); }
.user-row { gap: 9px; }
.avatar { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; background: #e7edf0; color: #53626d; font-weight: 800; }
.avatar.small { width: 29px; height: 29px; border-radius: 9px; font-size: 11px; }
.user-row strong { display: block; color: #f8fafc; font-size: 12px; }
.user-row span { display: block; color: #94a3b8; font-size: 10px; margin-top: 2px; }
.sidebar .quiet-button { color: #94a3b8; }
.quiet-button { border: 0; background: transparent; color: var(--muted); padding: 4px 7px; font-weight: 700; letter-spacing: 2px; margin-left: auto; }
.quiet-button:hover { color: var(--ink); }

.main-content { width: 100%; max-width: 1680px; min-width: 0; margin: 0 auto; padding: 38px clamp(20px, 4vw, 64px) 72px; }
.topbar { justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.breadcrumb { color: var(--muted); font-size: 11px; margin: 0 0 10px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(28px, 3vw, 36px); letter-spacing: -.055em; line-height: 1.08; }
h2 { font-size: 17px; letter-spacing: -.025em; }
h3 { font-size: 12px; letter-spacing: .01em; }
.topbar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.last-sync { color: var(--muted); font-size: 11px; }
.intake-banner { display: flex; align-items: center; gap: 10px; border: 1px solid #f0d2ca; background: #fff9f7; border-radius: 10px; padding: 10px 12px; margin: -10px 0 18px; color: var(--ink-soft); font-size: 11px; }
.intake-banner strong { color: var(--ink); font-size: 11px; }
.intake-badge { color: var(--accent); border: 1px solid #efc8be; background: #fff; border-radius: 6px; padding: 4px 6px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.data-panel { padding: 18px 20px; margin-bottom: 18px; }
.data-panel-actions { display: flex; align-items: center; gap: 8px; }
.connector-panel { padding: 18px 20px; margin-bottom: 18px; }
.connector-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.connector-heading .eyebrow { display: block; margin-bottom: 6px; }
.connector-heading-actions { display: flex; align-items: center; gap: 14px; }
.connector-summary { color: var(--muted); font-size: 10px; white-space: nowrap; }
.connector-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.connector-card { border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; min-width: 0; }
.connector-card.active { border-color: #f0c9be; background: #fffaf8; }
.connector-card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.connector-card strong { font-size: 12px; }
.connector-card small { display: block; color: var(--muted); font-size: 10px; margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.connector-status { color: var(--muted); font-size: 9px; white-space: nowrap; }
.connector-status.active { color: var(--success); font-weight: 700; }
.connector-form { border-top: 1px solid var(--line); margin-top: 15px; padding-top: 15px; }
.connector-form-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.connector-form-heading strong { font-size: 12px; }
.connector-form-heading span { color: var(--muted); font-size: 10px; }
.connector-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.connector-form-grid label { color: var(--muted); font-size: 10px; }
.connector-form-grid .wide-field { grid-column: span 2; }
.connector-form-grid input, .connector-form-grid select { display: block; width: 100%; border: 1px solid var(--line); border-radius: 8px; background: #fbfcfc; color: var(--ink); outline: 0; padding: 9px 10px; margin-top: 5px; font-size: 11px; }
.connector-form-grid input:focus, .connector-form-grid select:focus { border-color: #d9a597; box-shadow: 0 0 0 3px var(--accent-soft); }
.form-help { display: block; color: var(--muted); font-size: 9px; margin-top: 4px; }
.connector-form-actions { display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin-top: 12px; }
.connector-check { border: 0; border-top: 1px solid var(--line); background: transparent; color: var(--accent); padding: 8px 0 0; margin-top: 8px; width: 100%; text-align: left; font-size: 10px; font-weight: 700; }
.connector-check:hover { text-decoration: underline; }
.primary-button, .secondary-button, .complete-button { border: 0; border-radius: 9px; font-weight: 700; transition: transform .15s ease, background .15s ease; }
.primary-button:active, .secondary-button:active, .complete-button:active { transform: translateY(1px) scale(.98); }
.primary-button { background: #111827; color: #fff; padding: 11px 15px; font-size: 12px; }
.primary-button:hover { background: #26344d; }
.primary-button.compact { padding: 10px 14px; white-space: nowrap; }
.metric-grid { display: grid; grid-template-columns: 1.35fr repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.metric-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 21px 22px 18px; min-height: 128px; }
.metric-card.emphasis { border-color: #efc4b8; background: #fffaf8; }
.metric-card strong { display: block; margin-top: 13px; font-size: 32px; letter-spacing: -.07em; }
.metric-card .danger-number { color: var(--danger); }
.metric-note { display: block; color: var(--muted); font-size: 11px; margin-top: 5px; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.06fr) minmax(420px, .94fr); gap: 24px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.inbox-panel { min-height: 680px; padding: 28px; }
.panel-heading { justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.queue-actions { display: flex; align-items: center; gap: 12px; }
.panel-heading .eyebrow { display: block; margin-bottom: 7px; }
.text-button { border: 0; padding: 0; background: transparent; color: var(--accent); font-size: 11px; font-weight: 700; }
.text-button:hover { text-decoration: underline; }
.toolbar { border-bottom: 1px solid var(--line); padding-bottom: 17px; }
.search-field { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 9px; padding: 0 12px; height: 42px; background: #f8fbfa; }
.search-symbol { color: var(--muted); font-size: 20px; line-height: 1; }
.search-field input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 12px; }
.search-field:focus-within { border-color: #d9a597; box-shadow: 0 0 0 3px var(--accent-soft); }
.filter-row { display: flex; gap: 5px; margin-top: 11px; }
.filter-button { border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--muted); padding: 6px 9px; font-size: 11px; }
.filter-button span { margin-left: 4px; color: inherit; }
.filter-button:hover, .filter-button.active { border-color: #f0d2ca; color: var(--accent); background: var(--accent-soft); font-weight: 700; }
.lead-list { display: grid; }
.lead-row { border: 1px solid transparent; border-bottom-color: #edf2f0; display: grid; grid-template-columns: 40px minmax(0, 1fr) 116px; gap: 13px; align-items: center; padding: 16px 12px; margin: 2px 0; border-radius: 11px; text-align: left; cursor: pointer; }
.lead-row:hover, .lead-row.selected { background: #f8fbfa; border-color: #dce9e5; }
.lead-row.selected { background: #fff8f5; border-color: #f1cfc5; box-shadow: inset 3px 0 0 var(--accent), 0 5px 16px rgba(27, 54, 52, .05); }
.lead-main { min-width: 0; }
.lead-title { display: flex; align-items: center; gap: 8px; }
.lead-title strong { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lead-company { display: block; color: var(--ink-soft); font-size: 12px; margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lead-preview { display: block; color: var(--muted); font-size: 12px; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lead-meta { text-align: right; align-self: start; display: grid; justify-items: end; gap: 7px; }
.lead-time { color: var(--muted); font-size: 10px; white-space: nowrap; }
.lead-time.urgent { color: var(--accent); font-weight: 700; }
.status-pill { border-radius: 999px; padding: 4px 7px; color: var(--ink-soft); background: #eef1f2; font-size: 10px; white-space: nowrap; }
.status-pill.urgent { color: var(--accent); background: var(--accent-soft); }
.status-pill.done { color: var(--success); background: #eff6ff; }
.empty-state { min-height: 280px; display: grid; place-content: center; justify-items: center; gap: 7px; color: var(--muted); text-align: center; }
.empty-state strong { color: var(--ink); font-size: 13px; }
.empty-state span { font-size: 11px; }
.empty-mark { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--accent); font-weight: 800; }
.hidden { display: none !important; }
.modal-backdrop { position: fixed; z-index: 20; inset: 0; display: grid; place-items: center; padding: 14px; background: rgba(31, 41, 51, .36); }
.import-modal { width: min(860px, 100%); max-height: min(760px, calc(100dvh - 28px)); overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 24px 80px rgba(31, 41, 51, .18); padding: 22px; }
.import-modal-heading, .import-modal-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.import-modal-heading { border-bottom: 1px solid var(--line); padding-bottom: 15px; }
.import-modal-heading .eyebrow { display: block; margin-bottom: 6px; }
.modal-close { margin-left: 0; font-size: 20px; line-height: 1; }
.import-file-name { color: var(--ink-soft); font-size: 11px; margin: 13px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.import-summary { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 16px; }
.import-summary span { border: 1px solid var(--line); border-radius: 999px; color: var(--ink-soft); background: #fbfcfc; padding: 5px 8px; font-size: 10px; }
.import-summary .summary-ready { color: var(--success); border-color: #cce8da; background: #f4fbf7; }
.import-summary .summary-warning { color: var(--accent); border-color: #f0d2ca; background: var(--accent-soft); }
.import-mapping { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.mapping-field { color: var(--muted); font-size: 10px; }
.mapping-field select { display: block; width: 100%; margin-top: 5px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcfc; color: var(--ink); outline: 0; padding: 8px 9px; font-size: 11px; }
.mapping-field select:focus { border-color: #d9a597; box-shadow: 0 0 0 3px var(--accent-soft); }
.mapping-required { color: var(--accent); }
.csv-preview-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 9px; }
.csv-preview-table { width: 100%; min-width: 680px; border-collapse: collapse; font-size: 10px; }
.csv-preview-table th, .csv-preview-table td { border-bottom: 1px solid var(--line); padding: 9px 10px; text-align: left; vertical-align: top; }
.csv-preview-table th { color: var(--muted); background: #fbfcfc; font-weight: 600; white-space: nowrap; }
.csv-preview-table td { color: var(--ink-soft); max-width: 280px; }
.csv-preview-table tr:last-child td { border-bottom: 0; }
.csv-row-status { font-weight: 700; white-space: nowrap; }
.csv-row-status.ready { color: var(--success); }
.csv-row-status.duplicate, .csv-row-status.invalid { color: var(--accent); }
.import-error { min-height: 18px; color: var(--accent); font-size: 10px; line-height: 1.6; margin: 10px 0 0; }
.import-modal-actions { justify-content: flex-end; border-top: 1px solid var(--line); margin-top: 14px; padding-top: 14px; }

.detail-panel { padding: 28px; position: sticky; top: 18px; }
.detail-header { display: flex; justify-content: space-between; gap: 12px; }
.detail-person { gap: 11px; }
.detail-person .eyebrow { display: block; margin-bottom: 5px; }
.detail-person h2 { margin-bottom: 4px; }
.muted { color: var(--muted); font-size: 10px; }
.detail-status-row { justify-content: space-between; margin: 20px 0 22px; }
.detail-id { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 10px; }
.detail-section { border-top: 1px solid var(--line); padding: 18px 0; }
.section-title-row { justify-content: space-between; gap: 10px; margin-bottom: 13px; }
.tiny-label { letter-spacing: .04em; text-transform: none; }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 12px; }
.info-grid span { display: block; color: var(--muted); font-size: 10px; margin-bottom: 5px; }
.info-grid strong { display: block; color: var(--ink-soft); font-size: 12px; font-weight: 600; }
.owner-field { position: relative; }
.owner-field label { display: block; color: var(--muted); font-size: 10px; margin-bottom: 5px; }
.owner-field input, .wide-input { width: 100%; border: 1px solid var(--line); border-radius: 8px; background: #fbfcfc; color: var(--ink); outline: 0; padding: 8px 9px; font-size: 11px; }
.owner-field input:focus, .wide-input:focus { border-color: #d9a597; box-shadow: 0 0 0 3px var(--accent-soft); }
.owner-suggestions { position: absolute; z-index: 5; top: calc(100% + 3px); left: 0; right: 0; padding: 4px; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: var(--shadow); }
.owner-suggestions button { display: block; width: 100%; border: 0; border-radius: 6px; background: transparent; color: var(--ink-soft); padding: 8px 9px; text-align: left; font-size: 11px; }
.owner-suggestions button:hover { background: var(--accent-soft); color: var(--accent); }
blockquote { margin: 0; color: var(--ink-soft); background: #fafbfb; border-left: 3px solid #dae0e3; padding: 13px 13px 13px 15px; font-size: 12px; line-height: 1.75; }
.draft-label { color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 4px 7px; font-size: 10px; }
.ai-section > p { color: var(--ink-soft); font-size: 11px; line-height: 1.7; }
.tag-row { display: flex; flex-wrap: wrap; gap: 5px; margin: 11px 0; }
.tag-row span { color: var(--ink-soft); border: 1px solid var(--line); border-radius: 6px; padding: 4px 6px; font-size: 10px; }
.draft-box { color: var(--ink-soft); background: #fff9f7; border: 1px solid #f2ded8; border-radius: 9px; padding: 12px; font-size: 11px; line-height: 1.75; }
.secondary-button { color: var(--accent); border: 1px solid #efc8be; background: #fff; padding: 9px 11px; font-size: 11px; margin-top: 10px; }
.secondary-button:hover { background: var(--accent-soft); }
.field-label { display: block; color: var(--muted); font-size: 10px; margin-bottom: 6px; }
.action-row { gap: 8px; }
.action-row input { min-width: 0; width: 100%; border: 1px solid var(--line); border-radius: 8px; outline: 0; padding: 10px 11px; color: var(--ink); font-size: 11px; }
.action-row input:focus { border-color: #d9a597; box-shadow: 0 0 0 3px var(--accent-soft); }
.follow-up-label { margin-top: 12px; }
.activity-list { display: grid; gap: 10px; }
.activity-empty { color: var(--muted); font-size: 10px; padding: 4px 0; }
.activity-item { border-left: 2px solid #e8d2cc; padding-left: 10px; }
.activity-item-top { display: flex; align-items: baseline; justify-content: space-between; gap: 9px; }
.activity-item strong { color: var(--ink-soft); font-size: 11px; }
.activity-item time { color: var(--muted); font-size: 9px; white-space: nowrap; }
.activity-item p { color: var(--muted); font-size: 10px; line-height: 1.6; margin-top: 4px; }
.owner-panel { padding: 18px 20px; margin-bottom: 18px; }
.panel-hint { margin: -4px 0 13px; color: var(--muted); font-size: 11px; }
.owner-form { display: flex; gap: 8px; max-width: 430px; }
.owner-form input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 8px; outline: 0; padding: 9px 10px; color: var(--ink); font-size: 11px; }
.owner-form input:focus { border-color: #d9a597; box-shadow: 0 0 0 3px var(--accent-soft); }
.owner-list { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.owner-chip { border: 1px solid var(--line); border-radius: 999px; color: var(--ink-soft); background: #fbfcfc; padding: 6px 10px; font-size: 10px; }
.complete-button { width: 100%; color: var(--success); background: #eff6ff; padding: 12px; font-size: 12px; }
.complete-button:hover { background: #dbeafe; }
.toast { position: fixed; right: 22px; bottom: 22px; background: var(--ink); color: #fff; border-radius: 9px; padding: 11px 14px; box-shadow: var(--shadow); font-size: 12px; }

@media (max-width: 1050px) {
  .app-shell { grid-template-columns: 196px minmax(0, 1fr); }
  .content-grid { grid-template-columns: 1fr; }
  .detail-panel { position: static; }
}
@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); padding: 15px 16px; }
  .brand-lockup { padding: 0 0 14px; }
  .workspace-switcher, .sidebar-footer { display: none; }
  .nav-stack { display: flex; gap: 4px; overflow-x: auto; }
  .nav-item { flex: 1 0 auto; grid-template-columns: 25px auto auto; }
  .main-content { padding: 24px 14px 40px; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .topbar-actions { width: 100%; justify-content: space-between; }
  .focus-bar { align-items: flex-start; flex-direction: column; gap: 16px; padding: 18px; }
  .focus-actions { width: 100%; justify-content: space-between; }
  .focus-hint { white-space: normal; }
  .import-mapping { grid-template-columns: 1fr; }
  .intake-banner { align-items: flex-start; flex-wrap: wrap; gap: 6px 9px; }
  .connector-panel { padding: 15px; }
  .data-panel { padding: 15px; }
  .data-panel-actions { flex-wrap: wrap; justify-content: flex-end; }
  .connector-list { grid-template-columns: 1fr 1fr; }
  .connector-form-heading { display: block; }
  .connector-form-heading span { display: block; margin-top: 5px; line-height: 1.5; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric-card { min-height: 108px; padding: 15px; }
  .metric-card strong { font-size: 24px; }
  .inbox-panel, .detail-panel { padding: 18px 15px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* Priority layout: keep the daily work above configuration panels. */
.main-content { display: flex; flex-direction: column; }
.main-content > .topbar { order: 1; }
.main-content > .intake-banner { order: 2; }
.main-content > .focus-bar { order: 3; }
.main-content > .metric-grid { order: 4; }
.main-content > .content-grid { order: 5; }
.main-content > .data-panel,
.main-content > .connector-panel,
.main-content > .owner-panel { order: 6; }

.focus-bar { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 21px 24px; margin-bottom: 20px; border: 1px solid #263a61; border-radius: 14px; background: #111827; color: #f8fafc; box-shadow: 0 14px 30px rgba(15, 23, 42, .18); }
.focus-copy { display: grid; gap: 5px; }
.focus-kicker { color: #8db4ff; font-size: 10px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.focus-copy strong { font-size: 18px; letter-spacing: -.025em; }
.focus-description { color: #a9b7cc; font-size: 11px; }
.focus-description span { color: #9fc0ff; font-weight: 800; }
.focus-actions { display: flex; align-items: center; gap: 14px; }
.focus-hint { color: #94a3b8; font-size: 10px; white-space: nowrap; }
.focus-button { border: 0; border-radius: 9px; background: var(--accent); color: #fff; padding: 10px 13px; font-size: 11px; font-weight: 800; white-space: nowrap; transition: transform .15s ease, background .15s ease; }
.focus-button:hover { background: #e9785d; }
.focus-button:active { transform: translateY(1px) scale(.98); }

.brand-mark { box-shadow: 0 7px 16px rgba(217, 98, 73, .2); }
.nav-item { position: relative; }
.nav-item.active::before { content: ""; position: absolute; left: -17px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.topbar-actions .quiet-button,
.data-panel-actions .quiet-button { border: 1px solid var(--line); border-radius: 8px; background: rgba(255, 255, 255, .72); color: var(--ink-soft); padding: 8px 10px; letter-spacing: 0; font-size: 11px; }
.topbar-actions .quiet-button:hover,
.data-panel-actions .quiet-button:hover { border-color: #edc0b4; background: var(--accent-soft); color: var(--accent); }
.mode-badge { border-color: #c7ddd6; color: var(--success); background: #f4fbf7; font-weight: 700; }
.last-sync { padding-left: 2px; }
.intake-banner { box-shadow: 0 4px 16px rgba(217, 98, 73, .06); }
.metric-card { position: relative; overflow: hidden; }
.metric-card::after { content: ""; position: absolute; right: 0; bottom: 0; width: 56px; height: 3px; background: var(--line); }
.metric-card.emphasis::after { background: var(--accent); }
.metric-card strong { color: var(--ink); }
.panel-heading, .connector-heading { align-items: flex-start; }
.search-field { background: #f8fbfa; }
.lead-row { transition: background .15s ease, padding .15s ease, box-shadow .15s ease; }
.lead-row:hover { background: #f8fbfa; }
.lead-row.selected { background: #fff8f5; }
.detail-panel { box-shadow: 0 16px 38px rgba(27, 54, 52, .1); }
.detail-status-row { padding-bottom: 3px; }
.draft-box { background: #fffaf8; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(217, 98, 73, .25); outline-offset: 2px; }
.quiet-button:focus-visible, .text-button:focus-visible { outline-offset: 4px; }
.sidebar .nav-item:focus-visible { outline-color: #f5b29f; }
.brand-mark { box-shadow: 0 7px 16px rgba(217, 98, 73, .22); }
.nav-item { position: relative; }
.nav-item.active::before { content: ""; position: absolute; left: -17px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.topbar-actions .quiet-button,
.data-panel-actions .quiet-button { border: 1px solid var(--line); border-radius: 8px; background: rgba(255, 255, 255, .72); color: var(--ink-soft); padding: 8px 10px; letter-spacing: 0; font-size: 11px; }
.topbar-actions .quiet-button:hover,
.data-panel-actions .quiet-button:hover { border-color: #edc0b4; background: var(--accent-soft); color: var(--accent); }
.mode-badge { border-color: #c7ddd6; color: var(--success); background: #f4fbf7; font-weight: 700; }
.intake-banner { box-shadow: 0 4px 16px rgba(217, 98, 73, .06); }
.metric-card { position: relative; overflow: hidden; }
.metric-card::after { content: ""; position: absolute; right: 0; bottom: 0; width: 56px; height: 3px; background: var(--line); }
.metric-card.emphasis::after { background: var(--accent); }
.metric-card strong { color: var(--ink); }
.panel-heading, .connector-heading { align-items: flex-start; }
.lead-row { transition: background .15s ease, padding .15s ease, box-shadow .15s ease; }
.detail-panel { box-shadow: 0 16px 38px rgba(27, 54, 52, .1); }
.next-action-section { margin: 0 -8px; padding: 18px 16px; border: 1px solid #cbdcfb; border-radius: 12px; background: #f5f8ff; }
.next-action-section + .activity-section { margin-top: 8px; }
.next-action-section .section-title-row { margin-bottom: 15px; }
.complete-button { margin-top: 2px; box-shadow: 0 7px 16px rgba(37, 99, 235, .12); }
.inbox-panel, .detail-panel { scrollbar-color: #c8d5e8 transparent; scrollbar-width: thin; }

@media (min-width: 1060px) {
  .inbox-panel, .detail-panel { max-height: calc(100dvh - 352px); overflow: auto; }
}

/* Codex-inspired neutral and blue product theme. */
:root {
  --ink: #111827;
  --ink-soft: #4b5563;
  --muted: #7b8798;
  --line: #e2e8f0;
  --canvas: #f5f7fa;
  --surface: #ffffff;
  --accent: #2563eb;
  --accent-soft: #eff6ff;
  --success: #2563eb;
  --danger: #dc4c5a;
  --shadow: 0 16px 38px rgba(15, 23, 42, .08);
  font-family: Inter, "Segoe UI Variable", "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
}

body { background: #f5f7fa; color: var(--ink); }
.sidebar { background: #111827; border-right-color: #202c42; color: #f8fafc; }
.brand-lockup strong, .user-row strong { color: #f8fafc; }
.brand-lockup span, .user-row span, .sidebar .quiet-button { color: #94a3b8; }
.sidebar .eyebrow { color: #7183a0; }
.workspace-button { color: #f8fafc; }
.chevron { color: #7183a0; }
.nav-item { color: #a9b7cc; }
.nav-item:hover, .nav-item.active { background: #f1f5ff; color: #111827; }
.nav-symbol { border-color: #40516c; color: #a9b7cc; }
.nav-item.active .nav-symbol { border-color: #2563eb; color: #2563eb; background: #eff6ff; }
.nav-count { color: #7183a0; }
.nav-item.active .nav-count, .nav-count.alert { color: #2563eb; }
.sidebar-footer { border-top-color: #26344d; }
.sync-status { color: #8db4ff; }
.status-dot { background: #2563eb; }
.primary-button { background: #111827; }
.primary-button:hover { background: #26344d; }
.mode-badge { border-color: #c7d7f7; color: #2563eb; background: #eff6ff; }
.intake-banner { border-color: #cbdcfb; background: #f7faff; }
.intake-badge { color: #2563eb; border-color: #bfd3fb; background: #fff; }
.metric-card.emphasis { border-color: #bfd3fb; background: #f8fbff; }
.metric-card::after { background: #dbe5f3; }
.metric-card.emphasis::after { background: #2563eb; }
.search-field { background: #fbfdff; }
.search-field:focus-within, .owner-field input:focus, .wide-input:focus, .action-row input:focus, .owner-form input:focus, .connector-form-grid input:focus, .connector-form-grid select:focus, .mapping-field select:focus { border-color: #7da6f7; box-shadow: 0 0 0 3px #eff6ff; }
.filter-button:hover, .filter-button.active { border-color: #bfd3fb; color: #2563eb; background: #eff6ff; }
.lead-row:hover { background: #f8fbff; border-color: #d7e3f7; }
.lead-row.selected { background: #f4f8ff; border-color: #bcd2fa; box-shadow: inset 3px 0 0 #2563eb, 0 5px 16px rgba(37, 99, 235, .08); }
.status-pill.urgent { color: #2563eb; background: #eff6ff; }
.status-pill.done { color: #2563eb; background: #eff6ff; }
.next-action-section { border-color: #cbdcfb; background: #f5f8ff; }
.complete-button { color: #2563eb; background: #eff6ff; box-shadow: 0 7px 16px rgba(37, 99, 235, .12); }
.complete-button:hover { background: #dbeafe; }
.focus-bar { border-color: #263a61; background: #111827; box-shadow: 0 14px 30px rgba(15, 23, 42, .18); }
.focus-kicker { color: #8db4ff; }
.focus-description { color: #a9b7cc; }
.focus-description span { color: #9fc0ff; }
.focus-hint { color: #94a3b8; }
.focus-button { background: #2563eb; }
.focus-button:hover { background: #3b82f6; }
.draft-box { background: #f8fbff; border-color: #d7e3f7; }
.secondary-button { color: #2563eb; border-color: #bfd3fb; }
.secondary-button:hover { background: #eff6ff; }
.activity-item { border-left-color: #bfd3fb; }
.topbar-actions .quiet-button:hover, .data-panel-actions .quiet-button:hover { border-color: #bfd3fb; background: #eff6ff; color: #2563eb; }
.connector-card.active { border-color: #bfd3fb; background: #f8fbff; }
.connector-status.active { color: #2563eb; }
.import-summary .summary-ready { color: #2563eb; border-color: #c7d7f7; background: #f4f8ff; }
.import-summary .summary-warning { color: #2563eb; border-color: #bfd3fb; background: #eff6ff; }
.csv-row-status.ready { color: #2563eb; }
.csv-row-status.duplicate, .csv-row-status.invalid { color: #dc4c5a; }
.info-grid > div { padding: 12px; border: 1px solid #e2e8f0; border-radius: 10px; background: #fbfdff; }
.info-grid span, .owner-field label, .field-label { font-size: 11px; }
.info-grid strong { color: #334155; font-size: 13px; }
.owner-field input, .wide-input, .action-row input, .owner-form input { min-height: 40px; padding: 9px 11px; font-size: 12px; background: #fff; }
.action-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
.action-row .primary-button { min-height: 40px; }
.detail-person h2 { font-size: 19px; }
button:focus-visible, input:focus-visible, select:focus-visible { outline-color: rgba(37, 99, 235, .3); }

/* Typography system: local UI fonts, restrained tracking, clear data hierarchy. */
:root {
  --font-ui: "Segoe UI Variable", "Noto Sans SC", "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-family: var(--font-ui);
  font-optical-sizing: auto;
}

body {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 450;
  letter-spacing: -0.006em;
  text-rendering: optimizeLegibility;
}

button, input, select, textarea { font: inherit; }

h1, h2, h3, strong { font-family: var(--font-ui); }
h1 { font-weight: 700; letter-spacing: -0.042em; }
h2 { font-weight: 650; letter-spacing: -0.026em; }
h3 { font-weight: 650; letter-spacing: -0.014em; }

.eyebrow, .metric-label, .tiny-label, .focus-kicker {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .065em;
}

.breadcrumb, .last-sync, .connector-summary, .panel-hint, .metric-note,
.muted, .lead-company, .lead-preview, .focus-description, .focus-hint {
  font-size: 12px;
  line-height: 1.5;
}

.lead-title strong { font-size: 14px; font-weight: 650; letter-spacing: -0.014em; }
.lead-time, .detail-id { font-size: 11px; letter-spacing: .015em; }
.detail-id { font-family: var(--font-mono); }
.info-grid span, .owner-field label, .field-label { font-size: 11px; font-weight: 550; letter-spacing: .01em; }
.info-grid strong { font-size: 13px; font-weight: 600; letter-spacing: -0.008em; }
.owner-field input, .wide-input, .action-row input, .owner-form input { font-size: 13px; }
.primary-button, .secondary-button, .quiet-button, .filter-button, .focus-button { font-weight: 600; }
.status-pill, .mode-badge, .intake-badge { font-weight: 600; }
.topbar { justify-content: flex-end; }
.main-content > .knowledge-panel { order: 6; }
.queue-description { margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.5; }
body[data-lead-view="today"] .inbox-panel { border-color: #bfd3fb; box-shadow: 0 14px 30px rgba(37, 99, 235, .08); }
body[data-lead-view="unassigned"] .inbox-panel { border-color: #d6dee9; }

/* Knowledge base and RAG citation surfaces. */
.knowledge-panel { scroll-margin-top: 24px; }
.knowledge-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; padding: 16px; border: 1px solid #dbe5f3; border-radius: 12px; background: #f8fbff; }
.knowledge-form label { color: var(--muted); font-size: 11px; }
.knowledge-form .wide-field { grid-column: span 2; }
.knowledge-form input, .knowledge-form textarea { display: block; width: 100%; margin-top: 6px; border: 1px solid var(--line); border-radius: 8px; outline: 0; background: #fff; color: var(--ink); padding: 10px 11px; font-size: 13px; }
.knowledge-form textarea { min-height: 92px; resize: vertical; line-height: 1.6; }
.knowledge-form input:focus, .knowledge-form textarea:focus { border-color: #7da6f7; box-shadow: 0 0 0 3px #eff6ff; }
.knowledge-form-actions { grid-column: span 2; display: flex; justify-content: flex-end; gap: 10px; }
.knowledge-list { display: grid; gap: 10px; margin-top: 14px; }
.knowledge-card { padding: 15px 16px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.knowledge-card-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.knowledge-card-heading > div:first-child { display: grid; gap: 4px; min-width: 0; }
.knowledge-card-heading strong { color: var(--ink); font-size: 13px; font-weight: 650; }
.knowledge-card-heading span { color: var(--muted); font-size: 10px; }
.knowledge-card-actions { display: flex; gap: 8px; flex: none; }
.knowledge-card-actions .text-button { padding: 0; font-size: 11px; }
.danger-text { color: var(--danger) !important; }
.knowledge-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.knowledge-tags span { padding: 4px 7px; border: 1px solid #dbe5f3; border-radius: 6px; color: #2563eb; background: #f4f8ff; font-size: 10px; }
.knowledge-card p { margin-top: 11px; color: var(--ink-soft); font-size: 12px; line-height: 1.65; white-space: pre-wrap; }
.knowledge-empty { color: var(--muted); font-size: 11px; line-height: 1.55; }
.knowledge-empty-card { padding: 18px; border: 1px dashed #cbd8e8; border-radius: 10px; background: #fbfdff; text-align: center; }
.knowledge-citations { margin-top: 12px; padding: 12px; border: 1px solid #cbdcfb; border-radius: 10px; background: #f5f8ff; }
.citation-heading { display: flex; justify-content: space-between; gap: 8px; color: #2563eb; font-size: 10px; font-weight: 650; }
.citation-list { display: grid; gap: 8px; margin-top: 9px; }
.citation-item { display: grid; gap: 3px; padding-left: 9px; border-left: 2px solid #9fc0ff; }
.citation-item strong { color: var(--ink); font-size: 11px; font-weight: 650; }
.citation-item span { color: var(--ink-soft); font-size: 11px; line-height: 1.55; }

@media (max-width: 760px) {
  .knowledge-form { grid-template-columns: 1fr; }
  .knowledge-form .wide-field, .knowledge-form-actions { grid-column: auto; }
  .knowledge-card-heading { display: block; }
  .knowledge-card-actions { margin-top: 10px; }
}

/* Keep the knowledge base as a separate product surface from the inbox. */
body[data-active-nav="inbox"] .main-content > .knowledge-panel { display: none; }
body[data-active-nav="knowledge"] .main-content > .topbar,
body[data-active-nav="knowledge"] .main-content > .data-panel,
body[data-active-nav="knowledge"] .main-content > .connector-panel,
body[data-active-nav="knowledge"] .main-content > .owner-panel,
body[data-active-nav="knowledge"] .main-content > .metric-grid,
body[data-active-nav="knowledge"] .main-content > .content-grid { display: none; }
body[data-active-nav="knowledge"] .main-content { padding-top: 44px; }
body[data-active-nav="knowledge"] .main-content > .knowledge-panel { display: block; order: 1; width: min(100%, 1120px); margin: 0 auto; padding: 30px 32px 34px; border-radius: 16px; box-shadow: 0 20px 46px rgba(15, 23, 42, .08); }
body[data-active-nav="knowledge"] .knowledge-panel .connector-heading { margin-bottom: 10px; }
body[data-active-nav="knowledge"] .knowledge-panel .eyebrow { margin-bottom: 9px; font-size: 12px; letter-spacing: .09em; }
body[data-active-nav="knowledge"] .knowledge-panel .connector-heading h2 { font-size: 28px; line-height: 1.15; letter-spacing: -.04em; }
body[data-active-nav="knowledge"] .knowledge-panel .connector-summary { font-size: 12px; }
body[data-active-nav="knowledge"] .knowledge-panel > .panel-hint { max-width: 780px; margin: 0; font-size: 13px; line-height: 1.7; }
body[data-active-nav="knowledge"] .knowledge-form { gap: 18px 16px; margin-top: 26px; padding: 23px; border-radius: 14px; }
body[data-active-nav="knowledge"] .knowledge-form label { font-size: 12px; line-height: 1.4; }
body[data-active-nav="knowledge"] .knowledge-form input,
body[data-active-nav="knowledge"] .knowledge-form textarea { margin-top: 8px; min-height: 44px; padding: 11px 13px; font-size: 14px; line-height: 1.5; }
body[data-active-nav="knowledge"] .knowledge-form textarea { min-height: 124px; }
body[data-active-nav="knowledge"] .knowledge-list { gap: 12px; margin-top: 22px; }
body[data-active-nav="knowledge"] .knowledge-card { padding: 20px 22px; border-radius: 12px; }
body[data-active-nav="knowledge"] .knowledge-card-heading strong { font-size: 15px; }
body[data-active-nav="knowledge"] .knowledge-card-heading span { font-size: 11px; }
body[data-active-nav="knowledge"] .knowledge-card-actions .text-button { font-size: 12px; }
body[data-active-nav="knowledge"] .knowledge-card p { margin-top: 13px; font-size: 13px; line-height: 1.75; }
body[data-active-nav="knowledge"] .knowledge-tags span { padding: 5px 8px; font-size: 11px; }

@media (max-width: 760px) {
  body[data-active-nav="knowledge"] .main-content { padding-top: 24px; }
  body[data-active-nav="knowledge"] .main-content > .knowledge-panel { padding: 23px 18px 26px; border-radius: 14px; }
  body[data-active-nav="knowledge"] .knowledge-panel .connector-heading { display: block; }
  body[data-active-nav="knowledge"] .knowledge-panel .connector-summary { display: block; margin-top: 8px; }
  body[data-active-nav="knowledge"] .knowledge-panel .connector-heading h2 { font-size: 24px; }
  body[data-active-nav="knowledge"] .knowledge-form { padding: 17px; }
}
