:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-2: #f0f3f7;
  --text: #18202c;
  --text-muted: #616d7e;
  --border: #e2e7ef;
  --accent: #07c160;
  --accent-hover: #06ad56;
  --accent-soft: rgba(7, 193, 96, 0.12);
  --blue: #2563eb;
  --blue-soft: rgba(37, 99, 235, 0.12);
  --warn: #d97706;
  --warn-soft: rgba(217, 119, 6, 0.12);
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, 0.12);
  --shadow: 0 4px 18px rgba(15, 23, 42, 0.06);
  --radius: 12px;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

[data-theme="dark"] {
  --bg: #0f141b;
  --surface: #171e28;
  --surface-2: #1f2835;
  --text: #e6edf5;
  --text-muted: #95a3b8;
  --border: #2a3545;
  --accent: #10d06b;
  --accent-hover: #0eb85e;
  --accent-soft: rgba(16, 208, 107, 0.15);
  --blue: #60a5fa;
  --blue-soft: rgba(96, 165, 250, 0.14);
  --warn: #f59e0b;
  --warn-soft: rgba(245, 158, 11, 0.15);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.16);
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

.app-shell {
  display: grid;
  grid-template-columns: 232px 1fr;
  min-height: 100vh;
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 8px 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #049a4c);
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.brand-title { font-weight: 700; font-size: 15px; }
.brand-sub { font-size: 11px; color: var(--text-muted); }

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  transition: all 0.15s ease;
}

.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.sidebar-footer {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.account-status-mini {
  font-size: 12px;
  color: var(--text-muted);
  padding: 0 4px;
}

.sidebar-actions {
  display: flex;
  justify-content: space-between;
  gap: 6px;
}

.main-area {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 16px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.page-title { margin: 0; font-size: 20px; font-weight: 700; }
.page-subtitle { margin: 2px 0 0; font-size: 13px; color: var(--text-muted); }
.topbar-right { display: flex; gap: 8px; align-items: center; }

.view-container {
  padding: 24px 28px 96px;
  max-width: 1360px;
  width: 100%;
  margin: 0 auto;
}

/* Cards & Grid */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.card-title { margin: 0; font-size: 15px; font-weight: 600; }
.muted { color: var(--text-muted); font-size: 12px; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  background: var(--surface-2);
  color: var(--text);
}
.btn:hover:not(:disabled) { filter: brightness(0.96); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); filter: none; }
.btn-outline { background: transparent; border-color: var(--border); }
.btn-outline:hover:not(:disabled) { background: var(--surface-2); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 6px; }

/* Form controls */
input[type="text"],
input[type="number"],
input[type="date"],
input[type="time"],
select,
textarea {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 8px 11px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; font-weight: 600; color: var(--text-muted); }

/* Badges & Pills */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--text-muted);
}
.badge-ok { background: var(--accent-soft); color: var(--accent); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-err { background: var(--danger-soft); color: var(--danger); }
.badge-blue { background: var(--blue-soft); color: var(--blue); }

.pill-group {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pill {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}
.pill:hover { border-color: var(--accent); color: var(--text); }
.pill.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

/* Segmented tabs */
.seg-tabs {
  display: inline-flex;
  background: var(--surface-2);
  padding: 4px;
  border-radius: 10px;
  gap: 4px;
}
.seg-tab {
  border: none;
  background: transparent;
  color: var(--text-muted);
  padding: 7px 16px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.seg-tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
th { font-size: 12px; color: var(--text-muted); font-weight: 600; }
tr:last-child td { border-bottom: none; }

/* Export contact selector */
.export-layout {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 18px;
  align-items: start;
}

.chat-list {
  border: 1px solid var(--border);
  border-radius: 10px;
  max-height: 460px;
  overflow-y: auto;
  background: var(--bg);
}

.chat-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s;
}
.chat-item:last-child { border-bottom: none; }
.chat-item:hover { background: var(--surface-2); }
.chat-item.selected { background: var(--accent-soft); }
.chat-item-main { flex: 1; min-width: 0; }
.chat-item-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-item-sub {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 120px;
  overflow-y: auto;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 500;
}
.chip button {
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 0;
  font-size: 13px;
}

/* Records & Analyzer */
.records-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 18px;
  align-items: start;
}
.record-list {
  border: 1px solid var(--border);
  border-radius: 10px;
  max-height: 620px;
  overflow-y: auto;
}
.record-item {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.record-item:hover { background: var(--surface-2); }
.record-item.active { background: var(--accent-soft); }

.md-viewer {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  max-height: 620px;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.65;
}
.md-h1 { font-size: 17px; font-weight: 700; margin: 4px 0 12px; }
.md-h2 { font-size: 15px; font-weight: 700; margin: 16px 0 6px; color: var(--blue); }
.md-h3 {
  font-size: 13px;
  font-weight: 700;
  margin: 12px 0 6px;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--surface-2);
  display: inline-block;
}
.md-msg { padding: 3px 0; word-break: break-word; }
.md-msg-self { color: var(--accent); font-weight: 600; }
.md-msg-time { color: var(--text-muted); font-family: var(--font-mono); font-size: 12px; margin-right: 6px; }
.md-note {
  background: var(--warn-soft);
  color: var(--warn);
  padding: 4px 10px;
  border-radius: 6px;
  margin: 6px 0;
  font-size: 12px;
}

.kpi-card {
  background: var(--surface-2);
  border-radius: 10px;
  padding: 14px 16px;
}
.kpi-label { font-size: 12px; color: var(--text-muted); }
.kpi-value { font-size: 22px; font-weight: 700; margin-top: 4px; }

.bar-chart { display: flex; flex-direction: column; gap: 8px; }
.bar-row {
  display: grid;
  grid-template-columns: 110px 1fr 78px;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}
.bar-track {
  height: 10px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #22c55e);
}

/* Job Drawer */
.job-drawer {
  position: fixed;
  right: 22px;
  bottom: 18px;
  width: min(640px, calc(100vw - 44px));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.22);
  z-index: 60;
  overflow: hidden;
}
.job-drawer.collapsed .job-drawer-body { display: none; }
.job-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.job-drawer-title { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.job-drawer-controls { display: flex; align-items: center; gap: 4px; }
.job-drawer-body { padding: 12px 14px; }
.job-summary {
  padding: 8px 12px;
  border-radius: 8px;
  margin-bottom: 10px;
  font-size: 13px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 500;
}
.job-summary.error { background: var(--danger-soft); color: var(--danger); }
.job-log {
  margin: 0;
  background: #0d1117;
  color: #d1d9e0;
  border-radius: 8px;
  padding: 10px 12px;
  height: 220px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.status-dot.running { animation: pulse 1.2s infinite; }
.status-dot.error { background: var(--danger); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* Modal & Toast */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 24, 0.55);
  display: grid;
  place-items: center;
  z-index: 80;
  padding: 20px;
}
.modal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  width: min(560px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.28);
}

.toast-container {
  position: fixed;
  top: 18px;
  right: 22px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: var(--text);
  color: var(--surface);
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  box-shadow: var(--shadow);
}
.toast.error { background: var(--danger); color: #fff; }
.toast.ok { background: var(--accent); color: #fff; }

.hidden { display: none !important; }
.loading-box { padding: 48px; text-align: center; color: var(--text-muted); }

/* Toggle switch */
.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
}

@media (max-width: 960px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .export-layout, .records-layout, .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* Web Deliverables & AI Handoff */
.job-deliverables {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  padding: 10px 12px;
  margin-bottom: 10px;
}
.deliverable-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.deliverable-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
}
.deliverable-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.deliverable-info {
  min-width: 0;
  flex: 1;
}
.deliverable-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}
.deliverable-name {
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tag-pill {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  background: var(--surface-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.tag-pill.primary {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: transparent;
}
.deliverable-sub {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.deliverable-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.record-item-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.record-item-row:last-child { border-bottom: none; }
.record-item-row:hover { background: var(--surface-2); }
.record-item-row.active { background: var(--accent-soft); }
.record-item-row input[type="checkbox"] {
  margin-top: 3px;
  cursor: pointer;
  flex-shrink: 0;
}
.record-item-body { flex: 1; min-width: 0; }

.bulk-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
}

.ai-slice-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  padding: 12px 14px;
}
.ai-slice-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.ai-slice-preview {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  max-height: 130px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text-muted);
}
.btn.copied {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}

.deliverable-item input[type="checkbox"] {
  cursor: pointer;
  flex-shrink: 0;
}
.record-summary {
  font-size: 12px;
  color: var(--text);
  opacity: 0.85;
  margin-top: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}
.variant-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 6px;
}
details.advanced-box {
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 8px 12px;
}
details.advanced-box summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

/* Contacts Insights & WeChat Bubble Reader */
.contacts-layout {
  display: grid;
  grid-template-columns: 310px 1fr;
  gap: 18px;
  align-items: start;
}
.contact-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s;
}
.contact-row:last-child { border-bottom: none; }
.contact-row:hover { background: var(--surface-2); }
.contact-row.active { background: var(--accent-soft); }
.star-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 2px 4px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.star-btn.pinned { color: #eab308; }

.chat-timeline {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  max-height: 600px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chat-day-divider {
  align-self: center;
  margin: 8px 0 4px;
  padding: 3px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
}
.bubble-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 78%;
}
.bubble-row.self {
  align-self: flex-end;
  align-items: flex-end;
}
.bubble-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.bubble {
  padding: 9px 13px;
  border-radius: 14px;
  border-top-left-radius: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 13.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}
.bubble-row.self .bubble {
  border-top-left-radius: 14px;
  border-top-right-radius: 4px;
  background: var(--accent-soft);
  border-color: var(--accent);
}
.daily-chart-wrap {
  position: relative;
  width: 100%;
  overflow-x: auto;
}
.chart-tooltip {
  position: fixed;
  pointer-events: none;
  z-index: 90;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  font-size: 12px;
  white-space: nowrap;
}
.ratio-bar {
  height: 8px;
  border-radius: 999px;
  background: #60a5fa;
  overflow: hidden;
  display: flex;
  margin-top: 6px;
}
.ratio-bar-me {
  background: var(--accent);
  height: 100%;
}

/* Login Gate & Cloud Mode Extensions */
.login-gate {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 100;
}
.login-card {
  width: min(400px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  box-shadow: var(--shadow);
}
input[type="password"] {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 9px 12px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
}
input[type="password"]:focus { border-color: var(--accent); }

.code-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  margin: 0;
}

.heatmap-wrap {
  overflow-x: auto;
}
.heatmap-grid {
  display: grid;
  grid-template-columns: 44px repeat(24, minmax(18px, 1fr));
  gap: 3px;
  align-items: center;
  min-width: 560px;
}
.heatmap-cell {
  height: 22px;
  border-radius: 4px;
  background: var(--surface-2);
  border: 1px solid rgba(128, 128, 128, 0.08);
  transition: transform 0.1s;
}
.heatmap-cell:hover { transform: scale(1.12); }
.heatmap-hdr {
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
  font-family: var(--font-mono);
}

.search-hit-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--surface);
}
.ctx-line {
  font-size: 12px;
  color: var(--text-muted);
  padding: 2px 8px;
  border-left: 2px solid var(--border);
  margin: 2px 0;
}
.ctx-line.hit {
  color: var(--text);
  border-left-color: var(--accent);
  background: var(--accent-soft);
  border-radius: 0 6px 6px 0;
  padding: 4px 8px;
  font-weight: 500;
}

.mcp-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 18px;
  align-items: start;
}

@media (max-width: 960px) {
  .contacts-layout, .records-layout, .export-layout, .mcp-layout {
    grid-template-columns: 1fr;
  }
}
