/* Shared styles for Flipper */

:root {
  --bg: #f5f7fa;
  --bg-card: #ffffff;
  --bg-sidebar: #ffffff;
  --bg-topbar: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --bg-input: #f0f2f5;
  --border: #e2e8f0;
  --border-light: #edf2f7;
  --text: #1a202c;
  --text-secondary: #718096;
  --text-muted: #a0aec0;
  --primary: #667eea;
  --primary-light: #ebf0ff;
  --primary-dark: #5a67d8;
  --green: #48bb78;
  --green-bg: #f0fff4;
  --green-border: #c6f6d5;
  --orange: #ed8936;
  --orange-bg: #fffaf0;
  --orange-border: #feebc8;
  --blue: #4299e1;
  --blue-bg: #ebf8ff;
  --blue-border: #bee3f8;
  --red: #fc8181;
  --red-bg: #fff5f5;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --radius: 8px;
  --radius-lg: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Top bar ── */
#topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px;
  height: 52px;
  background: var(--bg-topbar);
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(102,126,234,0.3);
  position: relative;
  z-index: 100;
}

#topbar .app-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #fff;
  flex-shrink: 0;
  margin-right: 4px;
}

#topbar label {
  font-size: 11px;
  color: rgba(255,255,255,0.7);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── Body row ── */
#body-row {
  flex: 1;
  display: flex;
  overflow: hidden;
  min-height: 0;
}

/* ── Sidebar ── */
#sidebar {
  width: 240px;
  min-width: 240px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#sidebar-header {
  padding: 12px 14px 8px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-input);
  border-radius: 8px;
  padding: 3px;
}
.filter-tab {
  flex: 1;
  padding: 5px 0;
  border-radius: 6px;
  border: none;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  background: transparent;
  color: var(--text-muted);
  transition: all 0.15s ease;
  text-align: center;
}
.filter-tab:hover { color: var(--text-secondary); }
.filter-tab.active { background: #fff; color: var(--primary); box-shadow: var(--shadow-sm); }

#project-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px 8px;
}

.project-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
  border-radius: var(--radius);
  border-left: none;
  transition: all 0.12s ease;
  margin-bottom: 2px;
}
.project-item:hover { background: var(--bg-input); color: var(--text); }
.project-item.active { background: var(--primary-light); color: var(--primary-dark); font-weight: 600; }
.project-item.hidden { display: none; }

.project-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; color: var(--text-muted); font-weight: 400; }

.project-link {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.1s;
  opacity: 0;
}
.project-item:hover .project-link { opacity: 1; color: var(--primary); }

.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--border);
}
.status-dot.approve  { background: var(--green); }
.status-dot.suggest  { background: var(--orange); }
.status-dot.solved   { background: var(--blue); }

#sidebar-footer {
  border-top: 1px solid var(--border-light);
  padding: 10px 14px;
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
#sidebar-footer span { display: flex; align-items: center; gap: 4px; }
#sidebar-footer .dot { width: 6px; height: 6px; border-radius: 50%; }

/* ── Main ── */
#main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* Toolbar */
#toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.project-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.review-status-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.review-status-badge.none    { background: var(--bg-input); color: var(--text-muted); }
.review-status-badge.approve { background: var(--green-bg); color: #276749; border: 1px solid var(--green-border); }
.review-status-badge.suggest { background: var(--orange-bg); color: #9c4221; border: 1px solid var(--orange-border); }
.review-status-badge.solved  { background: var(--blue-bg); color: #2b6cb0; border: 1px solid var(--blue-border); }

.view-toggle {
  display: flex;
  gap: 2px;
  background: var(--bg-input);
  border-radius: var(--radius);
  padding: 3px;
}
.view-toggle button {
  padding: 4px 10px;
  border-radius: 6px;
  border: none;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  background: transparent;
  color: var(--text-muted);
  transition: all 0.15s ease;
}
.view-toggle button.active { background: #fff; color: var(--text); box-shadow: var(--shadow-sm); }

#compare-toggle button[data-compare="on"].active {
  background: var(--primary);
  color: #fff;
}

.version-select {
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  outline: none;
}
.version-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(102,126,234,0.15); }
.version-vs { font-size: 10px; color: var(--text-muted); font-weight: 600; }

.btn {
  padding: 5px 12px;
  border-radius: 6px;
  border: none;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.btn:hover  { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0); }
.btn-approve { background: var(--green); color: #fff; }
.btn-suggest { background: var(--orange); color: #fff; }
.btn-neutral { background: var(--bg-input); color: var(--text-secondary); border: 1px solid var(--border); }

/* ── Preview ── */
#preview-area {
  flex: 1;
  display: flex;
  overflow: hidden;
  position: relative;
  min-height: 0;
  background: var(--bg);
}

.pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.pane-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 5px 12px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}
.pane-label em { color: var(--primary); font-style: normal; font-weight: 600; }

.iframe-scaler {
  flex: 1;
  overflow: hidden;
  position: relative;
  background: #fff;
}
.iframe-scaler iframe {
  position: absolute;
  top: 0; left: 0;
  width: 1440px;
  height: 100%;
  border: none;
  transform-origin: top left;
}

#blocked-overlay {
  display: none;
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 70px;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  flex-direction: row;
  gap: 16px;
  z-index: 10;
  border-bottom: 1px solid var(--border);
}
#blocked-overlay.visible { display: flex; }
#blocked-overlay p { font-size: 13px; color: var(--text-secondary); }
#blocked-link {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: var(--primary);
  border: none;
  border-radius: var(--radius);
  padding: 8px 20px;
  text-decoration: none;
}
#blocked-link:hover { background: var(--primary-dark); }

.divider {
  width: 5px;
  background: var(--border-light);
  cursor: col-resize;
  flex-shrink: 0;
  transition: background 0.15s;
}
.divider:hover, .divider.dragging { background: var(--primary); }

/* ── Notes panel ── */
#notes-panel {
  border-top: 1px solid var(--border);
  background: var(--bg-card);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

#notes-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px 6px;
  border-bottom: 1px solid var(--border-light);
}

.notes-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  flex: 1;
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(0,0,0,0.15);
  border-radius: 10px;
  padding: 3px;
}

/* ── Home button (standalone pill) ── */
.topbar-home-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 10px;
  background: rgba(255,255,255,0.08);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  margin-right: 6px;
}
.topbar-home-btn:hover { color: #fff; background: rgba(255,255,255,0.15); }
.topbar-home-btn.active { color: #fff; background: rgba(255,255,255,0.25); box-shadow: 0 1px 4px rgba(0,0,0,0.15); }
.topbar-home-btn svg { opacity: 0.8; }
.topbar-home-btn.active svg { opacity: 1; }

/* ── Flow arrow-chain (Searcher → … → Email) ── */
.topbar-flow {
  display: flex;
  align-items: center;
  margin-left: auto;
  flex: 1;
  min-width: 0;
}

.topbar-flow-btn {
  --arrow-d: 12px;           /* arrow triangle depth */
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 1 1 0;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  padding: 8px 14px 8px 18px;
  background: rgba(255,255,255,0.06);
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
  white-space: nowrap;
  margin-left: -1px;
  clip-path: polygon(
    0 0,
    calc(100% - var(--arrow-d)) 0,
    100% 50%,
    calc(100% - var(--arrow-d)) 100%,
    0 100%,
    var(--arrow-d) 50%
  );
}
.topbar-flow-btn .flow-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-flow-btn svg { opacity: 0.7; flex-shrink: 0; width: 15px; height: 15px; }

/* first item: flat left edge with slight rounding feel */
.topbar-flow-btn.first {
  padding-left: 14px;
  border-radius: 8px 0 0 8px;
  clip-path: polygon(
    0 0,
    calc(100% - var(--arrow-d)) 0,
    100% 50%,
    calc(100% - var(--arrow-d)) 100%,
    0 100%
  );
}

/* last item: flat right edge */
.topbar-flow-btn.last {
  padding-right: 16px;
  border-radius: 0 8px 8px 0;
  clip-path: polygon(
    0 0,
    100% 0,
    100% 100%,
    0 100%,
    var(--arrow-d) 50%
  );
}

.topbar-flow-btn:hover {
  color: #fff;
  background: rgba(255,255,255,0.14);
}

.topbar-flow-btn.active {
  color: #fff;
  background: rgba(255,255,255,0.28);
}
.topbar-flow-btn.active svg { opacity: 1; }

/* ── Tool group buttons (Pipeline / Standards / Office) ── */
.topbar-nav-tools { margin-left: 8px; flex-shrink: 0; gap: 2px; padding: 2px; }
.topbar-nav-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  padding: 5px 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.topbar-nav-btn svg { width: 13px; height: 13px; opacity: 0.7; }
.topbar-nav-btn:hover { color: #fff; background: rgba(255,255,255,0.1); }
.topbar-nav-btn.active { color: #fff; background: rgba(255,255,255,0.22); }
.topbar-nav-btn.active svg { opacity: 1; }

.nav-scrape-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,0.95);
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(255,255,255,0.2);
  margin-right: 8px;
  text-decoration: none;
  transition: background 0.2s ease;
}
.nav-scrape-indicator:hover { background: rgba(255,255,255,0.3); color: #fff; }
.nav-scrape-indicator.hidden { display: none; }
.nav-scrape-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  animation: scrape-pulse 1s ease-in-out infinite;
}
@keyframes scrape-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Toast */
.toast {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  padding: 12px 28px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 8px;
}
.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast.approve {
  background: #fff;
  color: #276749;
  border: 1px solid var(--green-border);
}
.toast.suggest {
  background: #fff;
  color: #9c4221;
  border: 1px solid var(--orange-border);
}
.toast .toast-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}
.toast.approve .toast-icon { background: var(--green); color: #fff; }
.toast.suggest .toast-icon { background: var(--orange); color: #fff; }

#notes-body {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 10px 16px;
}
.notes-input-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

#notes-textarea {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  line-height: 1.5;
  padding: 8px 12px;
  resize: none;
  height: 70px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
#notes-textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(102,126,234,0.12); }
#notes-textarea::placeholder { color: var(--text-muted); }

.notes-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#solved-history { margin-top: 10px; border-top: 1px solid var(--border-light); padding-top: 8px; }
.solved-history-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px; font-weight: 600; }
.solved-history-item {
  background: var(--green-bg); border: 1px solid var(--green-border); border-radius: var(--radius);
  padding: 8px 12px; margin-bottom: 4px; font-size: 12px; color: #276749; line-height: 1.5;
}
.solved-history-item .solved-badge {
  display: inline-block; font-size: 9px; background: var(--green); color: #fff; padding: 2px 6px;
  border-radius: 10px; margin-right: 6px; font-weight: 700; text-transform: uppercase;
}

.action-btn {
  border: none;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 700;
  padding: 14px 24px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  letter-spacing: 0.02em;
}
.action-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.action-btn:active { transform: translateY(0); }
.action-btn.approve { background: var(--green); color: #fff; }
.action-btn.suggest { background: var(--orange); color: #fff; }
.action-btn.approve.active { outline: 3px solid var(--green); outline-offset: 2px; }
.action-btn.suggest.active { outline: 3px solid var(--orange); outline-offset: 2px; }

/* Empty state */
#empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  gap: 12px;
}
#empty-state p { font-size: 14px; }
#empty-state svg { opacity: 0.3; }

/* ── Searcher Section ── */
#gmaps-section {
  display: none;
  flex: 1;
  overflow: hidden;
}
#gmaps-section.visible { display: flex; }
#review-section { display: none; flex: 1; overflow: hidden; min-height: 0; }
#review-section.visible { display: flex !important; }

#gmaps-sidebar {
  width: 300px;
  min-width: 300px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.gmaps-sidebar-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.gmaps-controls-scroll {
  flex-shrink: 0;
  overflow-y: auto;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 60vh;
}
.gmaps-field { display: flex; flex-direction: column; gap: 5px; }
.gmaps-field label {
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}
.gmaps-field input, .gmaps-field select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
  padding: 8px 10px;
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.gmaps-field input:focus, .gmaps-field select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(102,126,234,0.12); }
.gmaps-field input::placeholder { color: var(--text-muted); }
.gmaps-field .hint { font-size: 10px; color: var(--text-muted); }

.gmaps-row { display: flex; gap: 8px; }
.gmaps-row .gmaps-field { flex: 1; }

.gmaps-checkbox {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--text-secondary); cursor: pointer;
}
.gmaps-checkbox input { accent-color: var(--primary); cursor: pointer; width: 16px; height: 16px; }

.gmaps-parsed {
  background: var(--green-bg);
  border: 1px solid var(--green-border);
  border-radius: var(--radius);
  padding: 8px 10px;
  font-size: 11px;
  color: #276749;
  line-height: 1.5;
}
.gmaps-parsed.error { background: var(--red-bg); border-color: #fed7d7; color: #c53030; }

#gmaps-start-btn {
  background: var(--bg-topbar);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 700;
  padding: 12px 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(102,126,234,0.3);
}
#gmaps-start-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(102,126,234,0.4); }
#gmaps-start-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

#gmaps-status-bar {
  font-size: 12px;
  color: var(--text-muted);
  min-height: 20px;
  font-weight: 500;
}
#gmaps-status-bar.running { color: var(--orange); }
#gmaps-status-bar.done { color: var(--green); }
#gmaps-status-bar.error { color: var(--red); }

#gmaps-main {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}
.gmaps-main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.gmaps-main-header h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.gmaps-main-header h2 span {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 13px;
}

#gmaps-result-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}
.gmaps-result-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.15s ease;
}
.gmaps-result-item:hover { border-color: var(--primary); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.gmaps-result-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.gmaps-result-info { flex: 1; min-width: 0; }
.gmaps-result-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.gmaps-result-meta {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-top: 4px;
}
.gmaps-result-meta a { color: var(--primary); text-decoration: none; font-weight: 500; }
.gmaps-result-meta a:hover { text-decoration: underline; }
.gmaps-result-score {
  font-size: 15px;
  font-weight: 700;
  color: var(--orange);
  white-space: nowrap;
  background: var(--orange-bg);
  border-radius: 6px;
  padding: 4px 8px;
}
.gmaps-result-count {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 400;
}
.gmaps-empty {
  color: var(--text-muted);
  font-size: 14px;
  text-align: center;
  padding: 60px 20px;
}

/* ── Home Section ── */
#home-section {
  display: none;
  flex: 1;
  overflow-y: auto;
  background: var(--bg);
}
#home-section.visible { display: block; }

.home-scroll {
  max-width: 960px;
  margin: 0 auto;
  padding: 36px 28px 60px;
}
.home-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 32px;
  gap: 20px;
}
.home-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}
.home-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
}
.home-stats-row {
  display: flex;
  gap: 10px;
}
.home-stat-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}
.home-stat-pill .stat-dot {
  width: 8px; height: 8px; border-radius: 50%;
}

.home-cards-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.home-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 36px;
}
.home-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.home-card:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 24px rgba(102,126,234,0.12);
  transform: translateY(-3px);
}
.home-card-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.review-icon { background: linear-gradient(135deg, #ebf0ff, #d6e0ff); color: var(--primary); }
.gmaps-icon  { background: linear-gradient(135deg, #fef3e2, #fde4b8); color: var(--orange); }
.weber-icon  { background: linear-gradient(135deg, #e8fcf3, #c8f7e5); color: var(--green); }
.generator-icon { background: linear-gradient(135deg, #e7f5ff, #c7e9ff); color: #0b7285; }

.home-card-body h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.home-card-body p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.home-card-stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.card-stat {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
}
.card-stat.green  { background: var(--green-bg);  color: #276749; }
.card-stat.orange { background: var(--orange-bg); color: #9c4221; }
.card-stat.blue   { background: var(--blue-bg);   color: #2a69ac; }
.card-stat.gray   { background: var(--bg-input);  color: var(--text-secondary); }

.home-card-arrow {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  transition: all 0.2s ease;
}
.home-card:hover .home-card-arrow {
  color: var(--primary);
  transform: translateY(-50%) translateX(4px);
}

.home-projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.home-todo-box {
  margin-top: 12px;
  margin-bottom: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.home-todo-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.home-todo-list {
  margin: 0 0 10px 18px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.6;
}

.home-todo-metrics {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--bg-input);
  color: var(--text);
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.home-todo-link {
  display: inline-block;
  margin-top: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
}

.home-todo-link:hover {
  text-decoration: underline;
}
.home-project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.home-project-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}
.home-project-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.home-project-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.home-project-verdict {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 4px;
}

/* ── Home Kanban ── */
.home-kanban {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 36px;
}
.home-kanban-col {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  min-height: 140px;
  display: flex;
  flex-direction: column;
}
.home-kanban-col-header {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 12px;
}
.home-kanban-dot {
  width: 10px; height: 10px; border-radius: 50%;
}
.home-kanban-dot.gray   { background: var(--text-muted); }
.home-kanban-dot.orange { background: var(--orange); }
.home-kanban-dot.green  { background: var(--green); }
.home-kanban-dot.blue   { background: var(--blue); }
.home-kanban-cards {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  max-height: 180px;
}
.home-kanban-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.home-kanban-card:hover {
  background: var(--bg-card-hover, var(--bg-input));
  border-color: var(--primary);
}
.home-kanban-empty {
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  padding: 20px 0;
}

/* ── Pixel Office Section ── */
#office-section {
  display: none;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
  background: #1a1c2e;
  position: relative;
}
#office-section.visible { display: flex; }

#office-topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 20px;
  background: rgba(0,0,0,0.3);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.office-title {
  font-size: 14px;
  font-weight: 700;
  color: #e2e8f0;
  letter-spacing: 0.04em;
}
.office-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  margin-left: auto;
}
.legend-dot {
  width: 8px; height: 8px; border-radius: 50%; margin-left: 8px;
}
.legend-dot:first-child { margin-left: 0; }

#office-canvas {
  flex: 1;
  width: 100%;
  cursor: default;
  image-rendering: pixelated;
}

.office-tooltip {
  position: absolute;
  background: rgba(26,28,46,0.95);
  color: #e2e8f0;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 50;
  max-width: 220px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.office-tooltip.visible { opacity: 1; }
.office-tooltip-name { font-weight: 700; font-size: 13px; margin-bottom: 4px; }
.office-tooltip-status { font-size: 11px; opacity: 0.7; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Monitor Cards ── */
.monitor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin-bottom: 36px;
}
.monitor-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.monitor-card:hover {
  border-color: var(--primary);
  box-shadow: 0 6px 20px rgba(102,126,234,0.10);
  transform: translateY(-2px);
}
.monitor-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
}
.monitor-card-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.monitor-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  flex: 1;
}
.monitor-light {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--border);
}
.monitor-light.ok { background: var(--green); }
.monitor-light.running { background: var(--green); animation: scrape-pulse 1s ease-in-out infinite; }
.monitor-light.warn { background: var(--orange); }
.monitor-light.idle { background: var(--border); }
.monitor-light.error { background: var(--red); }
.monitor-card-metrics {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.monitor-metric {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.monitor-metric-val {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}
.monitor-metric-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 600;
}

/* ── Time Range Tabs ── */
.home-range-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-input);
  border-radius: 8px;
  padding: 3px;
}
.range-tab {
  padding: 5px 14px;
  border-radius: 6px;
  border: none;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  color: var(--text-muted);
  transition: all 0.15s ease;
}
.range-tab:hover { color: var(--text-secondary); }
.range-tab.active { background: #fff; color: var(--primary); box-shadow: var(--shadow-sm); }

/* ── Memo Section ── */
.memo-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 36px;
}
.memo-input-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.memo-input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}
.memo-input:focus { border-color: var(--primary); }
.memo-input::placeholder { color: var(--text-muted); }
.memo-tag-select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  outline: none;
}
.memo-add-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.memo-add-btn:hover { background: var(--primary-dark); }
.memo-list { display: flex; flex-direction: column; gap: 6px; }
.memo-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  padding: 16px 0;
}
.memo-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius);
  background: var(--bg);
  border: 1px solid var(--border-light);
}
.memo-item-content {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.memo-item-text {
  font-size: 13px;
  color: var(--text);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.memo-item-date {
  font-size: 10px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.memo-item-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.memo-item-actions button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-muted);
  padding: 2px 4px;
  border-radius: 4px;
  transition: all 0.12s;
}
.memo-item-actions button:hover { color: var(--text); background: var(--bg-input); }
.memo-tag-badge {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 4px;
  flex-shrink: 0;
}
.memo-tag-todo { background: #fefcbf; color: #975a16; }
.memo-tag-bug { background: #fed7d7; color: #c53030; }
.memo-tag-idea { background: #c6f6d5; color: #276749; }
.memo-tag-note { background: #bee3f8; color: #2a69ac; }

/* ── Searcher Tabs ── */
.searcher-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  flex-shrink: 0;
}
.searcher-tab {
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.15s ease;
}
.searcher-tab:hover { color: var(--text-secondary); }
.searcher-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.searcher-tab-panel {
  display: none;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}
.searcher-tab-panel.active { display: flex; flex-direction: column; }

/* ── Status Tab: Large Progress Numbers ── */
.status-hero {
  display: flex;
  gap: 24px;
  padding: 24px;
  flex-wrap: wrap;
}
.status-hero-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 80px;
}
.status-hero-val {
  font-size: 42px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}
.status-hero-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.status-phase-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 24px 12px;
}
.status-message {
  font-size: 13px;
  color: var(--text-secondary);
  flex: 1;
}
.status-log-area {
  flex: 1;
  overflow-y: auto;
  padding: 0 24px 16px;
  font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
  font-size: 11px;
  line-height: 1.7;
  color: var(--text-secondary);
}

/* ── History Tab ── */
.history-list {
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.history-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}
.history-item-status {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 10px;
  flex-shrink: 0;
}
.history-item-status.done { background: #dcfce7; color: #16a34a; }
.history-item-status.error { background: #fee2e2; color: #dc2626; }
.history-item-status.running { background: #dbeafe; color: #2563eb; }
.history-item-status.aborted { background: #fef9c3; color: #ca8a04; }
.history-item-info {
  flex: 1;
  min-width: 0;
  color: var(--text);
}
.history-item-meta {
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* ── API Client status badge ── */
.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border: 1px solid;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.4;
}

/* ── Data table ── */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.data-table th {
    text-align: left;
    padding: 8px 12px;
    border-bottom: 2px solid var(--border);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.data-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
}
.data-table tr:hover td {
    background: var(--bg-hover);
}

/* ── Empty state ── */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 0.9rem;
}
.empty-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

/* ── Spinner ── */
.spinner {
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Modal ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.modal-box {
    background: var(--bg);
    border-radius: 12px;
    padding: 24px;
    max-width: 420px;
    width: 90%;
    box-shadow: var(--shadow-lg);
}
.modal-box h3 {
    margin: 0 0 12px;
    font-size: 1.1rem;
}
.modal-box p {
    margin: 0 0 20px;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* ── Tracking ID Badge ── */
.tracking-id {
  font-family: 'SF Mono', 'Menlo', 'Monaco', monospace;
  font-size: 11px; color: var(--text-secondary); font-weight: 600;
  background: var(--bg-input);
  padding: 1px 6px; border-radius: 3px;
  letter-spacing: 0.3px; white-space: nowrap;
}

/* ── Industry / Category Pill ── */
.industry-pill {
  font-size: 9px; font-weight: 700; padding: 2px 7px; border-radius: 10px;
  text-transform: uppercase; letter-spacing: 0.03em; white-space: nowrap;
  display: inline-block;
}
.industry-pill.dental  { background: #e6fffa; color: #234e52; }
.industry-pill.medical { background: #faf5ff; color: #553c9a; }
.industry-pill.food    { background: #fffaf0; color: #9c4221; }
.industry-pill.legal   { background: #f7fafc; color: #4a5568; }
.industry-pill.auto    { background: #edf2f7; color: #718096; }
.industry-pill.other   { background: #edf2f7; color: #718096; }

/* ── Stage Badge (reusable) ── */
.stage-badge {
  font-size: 9px; font-weight: 600; padding: 2px 6px; border-radius: 3px;
  text-transform: capitalize; white-space: nowrap; display: inline-block;
}
.stage-badge.discovered, .stage-badge.rated, .stage-badge.crawled {
  background: #edf2f7; color: #718096;
}
.stage-badge.generated { background: var(--primary-light); color: var(--primary); }
.stage-badge.reviewed  { background: var(--orange-bg, #fffaf0); color: var(--orange); }
.stage-badge.captured  { background: var(--green-bg, #f0fff4); color: var(--green); }
.stage-badge.emailed   { background: var(--blue-bg, #ebf8ff); color: var(--blue); }
