/* JobBot Console — 2026 design system. Zero dependencies, system font stack,
   CSS custom properties only. Light by default, dark via prefers-color-scheme. */
:root {
  color-scheme: light;
  /* Neutral gray ramp (slate) */
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-alt: #f8f9fb;
  --border: #e7e9ee;
  --border-strong: #d4d8e0;
  --separator: #eceef2;
  --text: #0e121b;
  --text-muted: #5f6a7c;
  --text-dim: #98a2b3;
  /* Indigo accent (replaces iOS blue) */
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: rgba(79, 70, 229, 0.08);
  --accent-grad: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  /* Semantic */
  --success: #0d9d58;
  --success-soft: rgba(13, 157, 88, 0.10);
  --danger: #dc2626;
  --danger-hover: #b91c1c;
  --danger-soft: rgba(220, 38, 38, 0.08);
  --warning: #c27803;
  --warning-soft: rgba(194, 120, 3, 0.10);
  /* Elevation — softer, more diffuse than 2010-era hard shadows */
  --shadow: 0 1px 2px rgba(14, 18, 27, 0.05);
  --shadow-md: 0 12px 32px -8px rgba(14, 18, 27, 0.12), 0 2px 6px rgba(14, 18, 27, 0.05);
  /* Geometry */
  --radius: 16px;
  --radius-sm: 10px;
  --radius-pill: 999px;
  --blur: saturate(180%) blur(20px);
  --tabbar-h: 56px;
  --hairline: 1px solid var(--separator);
  /* Motion */
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Dark theme — applied when the OS prefers dark AND no manual override,
   OR when the user explicitly picks dark (data-theme="dark" on <html>).
   data-theme="light" forces light even when the OS wants dark. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0b0d12;
    --surface: #14171f;
    --surface-alt: #1a1e28;
    --border: #262c3a;
    --border-strong: #353d4f;
    --separator: #202634;
    --text: #e9edf5;
    --text-muted: #8b96a9;
    --text-dim: #5d6879;
    --accent: #818cf8;
    --accent-hover: #a5b4fc;
    --accent-soft: rgba(129, 140, 248, 0.14);
    --accent-grad: linear-gradient(135deg, #818cf8 0%, #6366f1 100%);
    --success: #34d399;
    --success-soft: rgba(52, 211, 153, 0.14);
    --danger: #f87171;
    --danger-hover: #fca5a5;
    --danger-soft: rgba(248, 113, 113, 0.14);
    --warning: #fbbf24;
    --warning-soft: rgba(251, 191, 36, 0.14);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 12px 32px -8px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.35);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0d12;
  --surface: #14171f;
  --surface-alt: #1a1e28;
  --border: #262c3a;
  --border-strong: #353d4f;
  --separator: #202634;
  --text: #e9edf5;
  --text-muted: #8b96a9;
  --text-dim: #5d6879;
  --accent: #818cf8;
  --accent-hover: #a5b4fc;
  --accent-soft: rgba(129, 140, 248, 0.14);
  --accent-grad: linear-gradient(135deg, #818cf8 0%, #6366f1 100%);
  --success: #34d399;
  --success-soft: rgba(52, 211, 153, 0.14);
  --danger: #f87171;
  --danger-hover: #fca5a5;
  --danger-soft: rgba(248, 113, 113, 0.14);
  --warning: #fbbf24;
  --warning-soft: rgba(251, 191, 36, 0.14);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 12px 32px -8px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.35);
}

/* Theme toggle button */
.theme-toggle { gap: 6px; }
.theme-toggle-label { font-size: 13px; font-weight: 600; }
@media (max-width: 720px) {
  .theme-toggle-label { display: none; } /* icon-only on phones to save space */
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.01em;
}

/* Respect reduced-motion: kill transitions/animations entirely */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Consistent, modern focus ring everywhere (keyboard nav) */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Thin unobtrusive scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }

/* Salary Map tab: lock page scroll so map fills remaining viewport */
html:has(.app--salary-map),
body:has(.app--salary-map),
body:has(.app--salary-map) #root {
  height: 100%;
  max-height: 100%;
  overflow: hidden;
}

button { font-family: inherit; font-size: inherit; }
input { font-family: inherit; font-size: inherit; }

.app {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 22px 80px;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  overflow-x: clip; /* prevent one wide card from forcing page scroll */
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 18px;
  border-bottom: var(--hairline);
  margin-bottom: 22px;
  gap: 12px;
  flex-wrap: wrap;
}

/* OpenAI usage badge (top-right) — compact facts only */
.oa-usage {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  padding: 8px 12px;
  border-radius: 12px;
  border: var(--hairline);
  background: var(--surface);
  font-size: 12px;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  box-shadow: var(--shadow);
  min-width: 148px;
}
.oa-usage--low { border-color: transparent; background: var(--warning-soft); }
.oa-usage .oa-line { color: var(--text); }
.oa-usage .oa-line.muted { color: var(--text-muted); font-size: 11px; }
.oa-usage b { font-weight: 650; }
.oa-usage .oa-left { color: var(--success); }
.oa-usage--low .oa-left { color: var(--warning); }
.oa-usage .oa-proj { color: var(--text); font-weight: 650; }
.oa-usage .oa-warn { color: var(--warning); font-size: 10.5px; font-weight: 600; }

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.logo {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--accent-grad);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.02em;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.30);
  flex-shrink: 0;
}

h1 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -0.03em; }
h2 { margin: 0; font-size: 17px; font-weight: 650; letter-spacing: -0.02em; }
h3 { margin: 0 0 8px; font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim); }

.muted { color: var(--text-muted); margin: 0; font-size: 13px; }
.dim   { color: var(--text-dim); }

.grid {
  display: grid;
  /* minmax(0,1fr) is critical: default 1fr = minmax(auto,1fr) lets wide
     content (Naukri SVG/charts) expand the whole page once details load */
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  margin-bottom: 24px;
  min-width: 0;
  max-width: 100%;
  width: 100%;
}
@media (max-width: 720px) {
  .grid { grid-template-columns: minmax(0, 1fr); }
}

.card {
  background: var(--surface);
  border: var(--hairline);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  box-shadow: var(--shadow);
  min-width: 0;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
  overflow-wrap: anywhere;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}

.bot .title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-dim);
  flex-shrink: 0;
}
.dot.on  { background: var(--success); box-shadow: 0 0 0 4px var(--success-soft); }
.dot.off { background: var(--text-dim); }

.actions {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: background 140ms var(--ease), transform 80ms var(--ease), opacity 120ms var(--ease), border-color 140ms var(--ease), box-shadow 140ms var(--ease);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.btn:hover { background: var(--surface-alt); border-color: var(--border-strong); }
.btn:active { transform: scale(0.97); opacity: 0.92; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.btn.primary {
  background: var(--accent);
  border-color: transparent;
  color: white;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.25);
}
.btn.primary:hover { background: var(--accent-hover); border-color: transparent; }

.btn.danger {
  background: var(--surface);
  border-color: var(--border);
  color: var(--danger);
}
.btn.success {
  background: var(--surface);
  border-color: var(--border);
  color: var(--success);
}
.btn.warn {
  background: var(--surface);
  border-color: var(--border);
  color: var(--warning);
}
.btn.danger:hover { background: var(--danger-soft); border-color: transparent; }
.btn.success:hover { background: var(--success-soft); border-color: transparent; }

.btn.ghost {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: var(--accent);
}
.btn.ghost:hover { background: var(--accent-soft); }
.btn.sm { padding: 6px 12px; font-size: 13px; }

.schedule, .last-run, .profile-state, .rate-limit-state { padding-top: 16px; border-top: 1px solid var(--border); margin-top: 16px; }
.big-time { font-size: 16px; font-weight: 600; margin: 4px 0; color: var(--text); letter-spacing: -0.01em; }

.stats { margin-bottom: 24px; }
.stats-row {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) 2fr;
  gap: 32px;
  align-items: center;
}
@media (max-width: 720px) { .stats-row { grid-template-columns: 1fr; gap: 16px; } }

.big-stat { padding-right: 24px; border-right: 1px solid var(--border); }
@media (max-width: 720px) { .big-stat { border-right: none; padding-right: 0; padding-bottom: 16px; border-bottom: 1px solid var(--border); } }
.big-num {
  font-size: 56px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--text);
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.big-lbl { font-size: 13px; font-weight: 500; color: var(--text); margin-top: 8px; }

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 480px) { .stats-grid { grid-template-columns: 1fr; } }

.stat-block { background: var(--surface-alt); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; }
.stat-title { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 8px; }
.stat-line { display: flex; justify-content: space-between; align-items: baseline; padding: 3px 0; font-size: 13px; }
.stat-line span { color: var(--text-muted); }
.stat-line b { color: var(--text); font-weight: 600; }
.stat-line.muted span, .stat-line.muted b { color: var(--text-dim); font-weight: 400; }

.sched-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.sched-head h3 { margin: 0; }
.sched-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.sched-actions { display: flex; gap: 8px; margin-bottom: 8px; }
.add-sched { padding: 4px 10px; }

.sched-row {
  display: flex;
  align-items: end;
  gap: 8px;
  flex-wrap: wrap;
  background: var(--surface-alt);
  padding: 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.sched-row .btn.danger.sm { padding: 4px 10px; font-size: 14px; line-height: 1; align-self: end; }
.sched-row label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--text-muted);
  font-size: 12px;
}
.sched-row input {
  width: 80px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
}
textarea.li-urls {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  line-height: 1.4;
  resize: vertical;
  background: var(--card);
  color: var(--text);
}
textarea.li-urls:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 20%, transparent);
}

.sched-row input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.counters {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}
.counter {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}
.counter .num { font-size: 18px; font-weight: 600; }
.counter .lbl { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.counter.applied .num { color: var(--success); }
.counter.failed  .num { color: var(--danger); }
.counter.skipped .num { color: var(--warning); }

.emailed-today { padding-top: 14px; border-top: 1px solid var(--border); margin-top: 14px; }
.emailed-today h4 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.today-jobs {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 280px;
  overflow: auto;
}
.today-jobs li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 10px;
  padding: 6px 8px;
  background: var(--bg-subtle, rgba(0,0,0,0.03));
  border-radius: 6px;
  font-size: 13px;
}
.today-jobs .job-title { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.today-jobs .job-co { grid-column: 1; font-size: 11px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.today-jobs .job-time { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.emailed-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.emailed-list li { display: flex; flex-direction: column; gap: 1px; padding: 8px 10px; background: var(--bg-subtle, rgba(0,0,0,0.03)); border-radius: 8px; font-size: 13px; }
.emailed-list .em-name { font-weight: 600; }
.emailed-list .em-email { color: var(--accent, #2563eb); text-decoration: none; font-size: 12px; }
.emailed-list .em-email:hover { text-decoration: underline; }
.emailed-list .em-co { font-size: 11px; }
.emailed-list .em-open { font-size: 11px; font-weight: 600; color: var(--accent, #2563eb); text-decoration: none; margin-top: 2px; align-self: flex-start; }
.emailed-list .em-open:hover { text-decoration: underline; }
.emailed-list .em-score { font-size: 10px; font-weight: 700; color: var(--success, #16a34a); background: rgba(22,163,74,0.12); border-radius: 6px; padding: 1px 6px; margin-top: 3px; align-self: flex-start; }
.emailed-list .em-resume { font-size: 11px; font-weight: 600; color: var(--accent, #2563eb); text-decoration: none; margin-top: 2px; align-self: flex-start; }
.emailed-list .em-resume:hover { text-decoration: underline; }

.tab {
  padding: 8px 14px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-weight: 500;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.excel-empty { padding: 24px; text-align: center; color: var(--text-muted); }

.sheet-search {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.sheet-search input {
  flex: 1;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: var(--surface);
  color: var(--text);
}
.sheet-search input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.sheet-search-count { font-size: 12px; white-space: nowrap; }

.sheet-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.sheet-table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: auto;
  max-height: 600px;
}
.sheet-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.sheet-table thead th {
  position: sticky;
  top: 0;
  background: var(--surface-alt);
  color: var(--text-muted);
  font-weight: 600;
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  z-index: 1;
}
.sheet-table tbody td {
  padding: 6px 12px;
  border-bottom: 1px solid var(--border);
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: top;
}
.sheet-table tbody tr:hover { background: var(--surface-alt); }
.sheet-table tbody tr:last-child td { border-bottom: none; }
.sheet-table a { color: var(--accent); text-decoration: none; }
.sheet-table a:hover { text-decoration: underline; }
.sheet-table mark {
  background: #fef3c7;
  color: inherit;
  padding: 0 2px;
  border-radius: 2px;
}

.sheet-search-groups { display: flex; flex-direction: column; gap: 20px; }
.search-group-head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 8px 0;
}
.sheet-overflow {
  margin-top: 8px;
  font-size: 12px;
  text-align: center;
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--text);
  color: var(--bg);
  box-shadow: var(--shadow-md);
  font-size: 13px;
  animation: slideUp 200ms var(--ease);
}
.toast.error { background: var(--danger); }
.toast.success { background: var(--success); }
@keyframes slideUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.spinner {
  display: inline-block;
  width: 12px; height: 12px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 600ms linear infinite;
  vertical-align: -2px;
  margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  background: var(--surface-alt);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.badge.on  { background: var(--success-soft); color: var(--success); border-color: var(--success-soft); }
.badge.off { background: var(--surface-alt); }

.source-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  background: #dbeafe;
  color: #1d4ed8;
}

/* ===== Page Navigation (desktop: segmented top; mobile: bottom tab bar) ===== */
.page-nav {
  display: flex;
  gap: 2px;
  margin-bottom: 22px;
  padding: 4px;
  border-bottom: none;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.page-nav::-webkit-scrollbar { display: none; }
.page-nav-btn {
  padding: 8px 14px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: none;
  margin-bottom: 0;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: -0.01em;
  transition: color 140ms var(--ease), background 140ms var(--ease), box-shadow 140ms var(--ease);
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: 8px;
  flex: 0 0 auto;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.page-nav-btn:hover { color: var(--text); background: var(--accent-soft); }
.page-nav-btn.active {
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow);
  border-bottom-color: transparent;
}
.page-nav-btn .nav-icon { font-size: 15px; line-height: 1; }
.page-nav-btn .nav-label { line-height: 1.1; }

/* ===== Mail Status Page ===== */
.mail-page { animation: fadeIn 300ms ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.mail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}
.mail-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}
.mail-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent-grad);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 20px;
}
.mail-header h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.mail-header .muted { margin-top: 2px; }

.mail-actions { display: flex; gap: 8px; align-items: center; }
.mail-days-select {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}
.mail-days-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Mail Stats Summary */
.mail-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}
.mail-stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  transition: transform 120ms, box-shadow 120ms;
  cursor: default;
}
.mail-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.mail-stat-num {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
}
.mail-stat-lbl {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 6px;
}
/* ===== Mail Analytics ===== */
.mail-analytics {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 24px;
}
.mail-analytics-head h3 { margin: 0 0 14px 0; font-size: 16px; }
.mail-analytics-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.ma-kpi {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
}
.ma-kpi-num { font-size: 24px; font-weight: 700; line-height: 1.1; letter-spacing: -0.03em; color: var(--accent); }
.ma-kpi-lbl { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; margin-top: 5px; color: var(--text-muted); }
.mail-analytics-cols {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
}
@media (max-width: 720px) { .mail-analytics-cols { grid-template-columns: 1fr; } }
.ma-panel {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
}
.ma-panel-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 12px; }
/* 14-day bar chart */
.ma-bars { display: flex; align-items: flex-end; gap: 4px; height: 90px; }
.ma-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; }
.ma-bar { width: 100%; min-height: 2px; background: var(--accent); border-radius: 3px 3px 0 0; transition: height 200ms; }
.ma-bar-x { font-size: 9px; color: var(--text-muted); margin-top: 4px; }
/* Top companies bars */
.ma-complist { display: flex; flex-direction: column; gap: 8px; }
.ma-comprow { display: grid; grid-template-columns: 90px 1fr 28px; align-items: center; gap: 8px; }
.ma-comp-name { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ma-comp-track { background: var(--border); border-radius: 6px; height: 8px; overflow: hidden; }
.ma-comp-fill { display: block; height: 100%; background: var(--accent); border-radius: 6px; }
.ma-comp-num { font-size: 12px; font-weight: 600; text-align: right; color: var(--text-muted); }
.ma-kpi-open .ma-kpi-num { color: #0ea5e9; }
/* Rejection-reason breakdown card */
.rej-reasons {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 24px;
}
.rej-reasons-head h3 { margin: 0 0 14px 0; font-size: 16px; }
.rej-reason-list { display: flex; flex-direction: column; gap: 10px; }
.rej-reason-row { display: grid; grid-template-columns: minmax(140px, 240px) 1fr 32px; align-items: center; gap: 10px; }
.rej-reason-label { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rej-reason-track { background: var(--border); border-radius: 6px; height: 10px; overflow: hidden; }
.rej-reason-fill { display: block; height: 100%; background: #ef4444; border-radius: 6px; transition: width 200ms; }
.rej-reason-num { font-size: 13px; font-weight: 700; text-align: right; color: var(--text-muted); }
@media (max-width: 720px) { .rej-reason-row { grid-template-columns: minmax(110px, 1fr) 1fr 28px; } }
/* Read-receipt badges in the Sent list */
.sent-read {
  font-size: 11px; font-weight: 700; color: #0ea5e9;
  background: rgba(14,165,233,0.12); border-radius: 10px; padding: 1px 8px; margin-left: 6px;
}
.sent-status.opened { color: #0ea5e9; }

/* Stat card color variants */
.mail-stat-card.interview .mail-stat-num { color: #7c3aed; }
.mail-stat-card.interview { border-top: 3px solid #7c3aed; }
.mail-stat-card.assessment .mail-stat-num { color: #d97706; }
.mail-stat-card.assessment { border-top: 3px solid #d97706; }
.mail-stat-card.recruiter .mail-stat-num { color: #2563eb; }
.mail-stat-card.recruiter { border-top: 3px solid #2563eb; }
.mail-stat-card.offer .mail-stat-num { color: #16a34a; }
.mail-stat-card.offer { border-top: 3px solid #16a34a; }
.mail-stat-card.rejection .mail-stat-num { color: #dc2626; }
.mail-stat-card.rejection { border-top: 3px solid #dc2626; }
.mail-stat-card.update .mail-stat-num { color: #0891b2; }
.mail-stat-card.update { border-top: 3px solid #0891b2; }
.mail-stat-card.total .mail-stat-num {
  background: linear-gradient(135deg, var(--accent), #6366f1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.mail-stat-card.total { border-top: 3px solid var(--accent); }

/* Mail Category Sections */
.mail-section {
  margin-bottom: 28px;
  animation: fadeIn 400ms ease-out;
}
.mail-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.mail-section-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.mail-section-icon.interview { background: #f3e8ff; color: #7c3aed; }
.mail-section-icon.assessment { background: var(--warning-soft); color: var(--warning); }
.mail-section-icon.recruiter { background: var(--accent-soft); color: var(--accent); }
.mail-section-icon.offer { background: var(--success-soft); color: var(--success); }
.mail-section-icon.rejection { background: var(--danger-soft); color: var(--danger); }
.mail-section-icon.update { background: #e0f2fe; color: #0891b2; }
.mail-section-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.mail-section-count {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: var(--surface-alt);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* Mail Cards */
.mail-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Recruiter replies ("reverts") highlight */
.reply-alert { margin: 16px 0; padding: 14px 16px; border-radius: 12px;
  background: rgba(34,197,94,0.10); border: 1px solid rgba(34,197,94,0.45); }
.reply-alert-head { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--success, #16a34a); margin-bottom: 10px; }
.reply-alert-icon { font-size: 16px; }
.reply-list { display: flex; flex-direction: column; gap: 8px; }
.reply-item { display: flex; flex-direction: column; gap: 1px; padding: 8px 10px; border-radius: 8px;
  background: var(--bg-card, #fff); border: 1px solid var(--border); text-decoration: none; color: inherit; }
.reply-item:hover { border-color: var(--success, #16a34a); }
.reply-from { font-weight: 600; font-size: 13px; }
.reply-subj { font-size: 12px; }
.reply-meta { font-size: 11px; }

/* Sent outreach section */
.mail-section-icon.sent { background: rgba(37,99,235,0.15); }
.sent-replied-badge { margin-left: 8px; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px;
  background: rgba(34,197,94,0.18); color: var(--success, #16a34a); }
.sent-table { display: flex; flex-direction: column; gap: 6px; }
.sent-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding: 8px 10px; border-radius: 8px;
  background: var(--bg-card, #fff); border: 1px solid var(--border); }
.sent-row.replied { border-color: rgba(34,197,94,0.5); background: rgba(34,197,94,0.06); }
.sent-main { display: flex; align-items: baseline; gap: 8px; min-width: 240px; flex: 1; }
.sent-name { font-weight: 600; font-size: 13px; }
.sent-email { font-size: 12px; color: var(--accent, #2563eb); text-decoration: none; }
.sent-email:hover { text-decoration: underline; }
.sent-co { font-size: 12px; flex: 2; min-width: 180px; }
.sent-side { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.sent-status { font-size: 12px; }
.sent-status.replied { color: var(--success, #16a34a); font-weight: 600; text-decoration: none; }
.sent-status.replied:hover { text-decoration: underline; }
.sent-date { font-size: 11px; white-space: nowrap; }
.sent-src { font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 999px; background: rgba(37,99,235,0.12); color: var(--accent, #2563eb); margin-left: 6px; }
.sent-row { flex-direction: column; align-items: stretch; gap: 4px; }
.sent-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.sent-count { font-size: 10px; color: var(--text-muted); margin-left: 6px; }
.sent-subj { font-size: 13px; font-weight: 600; }
/* per-mail source-account badge (which mailbox it arrived in) */
.mail-card-account, .sent-account { display: inline-flex; align-items: center; gap: 3px;
  font-size: 11px; margin-left: 8px; padding: 1px 7px; border-radius: 10px;
  background: rgba(37,99,235,0.12); color: var(--accent, #2563eb); font-weight: 500;
  vertical-align: middle; white-space: nowrap; }
/* Mail accounts manager */
.mail-accounts { margin: 4px 0 14px; border: 1px solid var(--border, rgba(120,120,120,0.25));
  border-radius: 10px; overflow: hidden; }
.mail-accounts-head { width: 100%; display: flex; align-items: center; gap: 8px; padding: 10px 14px;
  background: var(--panel, rgba(255,255,255,0.03)); border: none; cursor: pointer; font-size: 14px;
  font-weight: 600; color: var(--text, inherit); }
.mail-accounts-head:hover { background: rgba(37,99,235,0.06); }
.mail-accounts-arrow { transition: transform 0.15s ease; color: var(--text-muted); }
.mail-accounts-arrow.open { transform: rotate(90deg); }
.mail-accounts-count { font-size: 12px; background: rgba(37,99,235,0.15); color: var(--accent, #2563eb);
  border-radius: 9px; padding: 1px 8px; }
.mail-accounts-body { padding: 12px 14px; border-top: 1px solid var(--border, rgba(120,120,120,0.2)); }
.mail-accounts-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.mail-account-row { display: flex; align-items: center; gap: 10px; padding: 7px 10px;
  border-radius: 8px; background: var(--panel, rgba(255,255,255,0.03)); }
.mail-account-email { font-size: 13px; font-weight: 500; }
.mail-account-tag.primary { font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px;
  background: rgba(34,197,94,0.15); color: var(--success, #16a34a); padding: 2px 8px; border-radius: 9px; }
.mail-account-remove { margin-left: auto; font-size: 12px; border: none; background: none;
  color: var(--danger, #dc2626); cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.mail-account-remove:hover { background: rgba(220,38,38,0.1); }
.mail-accounts-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mail-accounts-add-title { width: 100%; font-size: 12px; font-weight: 600; color: var(--text-muted); }
.mail-accounts-add input { flex: 1 1 180px; padding: 8px 10px; border-radius: 8px;
  border: 1px solid var(--border, rgba(120,120,120,0.3)); background: var(--bg, transparent);
  color: var(--text, inherit); font-size: 13px; }
.mail-accounts-add button { padding: 8px 16px; border-radius: 8px; border: none; cursor: pointer;
  background: var(--accent, #2563eb); color: #fff; font-size: 13px; font-weight: 600; }
.mail-accounts-add button:disabled { opacity: 0.6; cursor: default; }
.mail-accounts-hint { width: 100%; font-size: 11px; line-height: 1.5; margin: 2px 0 0; }
.mail-accounts-msg { margin-top: 10px; padding: 8px 12px; border-radius: 8px; font-size: 12.5px; }
.mail-accounts-msg.ok { background: rgba(34,197,94,0.12); color: var(--success, #16a34a); }
.mail-accounts-msg.err { background: rgba(220,38,38,0.12); color: var(--danger, #dc2626); }
/* expand arrow + full-mail panel */
.sent-toggle { background: none; border: none; cursor: pointer; color: var(--text-muted);
  font-size: 13px; line-height: 1; padding: 2px 4px; border-radius: 4px; flex: 0 0 auto;
  transition: transform 0.15s ease, color 0.15s ease; align-self: center; }
.sent-toggle:hover { color: var(--accent, #2563eb); background: rgba(37,99,235,0.10); }
.sent-toggle.open { transform: rotate(90deg); color: var(--accent, #2563eb); }
.sent-row.expanded { border-color: rgba(37,99,235,0.45); background: rgba(37,99,235,0.05); }
.sent-fullmail { margin: 4px 0 2px; border: 1px solid var(--border, rgba(120,120,120,0.25));
  border-radius: 8px; overflow: hidden; background: var(--panel, rgba(255,255,255,0.03)); }
.sent-fullmail-head { font-size: 12px; padding: 8px 12px; color: var(--text-muted);
  border-bottom: 1px solid var(--border, rgba(120,120,120,0.2)); line-height: 1.6; }
.sent-fullmail-label { display: inline-block; min-width: 52px; font-weight: 600;
  color: var(--text, inherit); opacity: 0.65; }
.sent-fullmail-body { margin: 0; padding: 12px; font-size: 13px; line-height: 1.55;
  white-space: pre-wrap; word-break: break-word; font-family: inherit; }
.sent-last { font-size: 12px; line-height: 1.4; }
.sent-last-who { font-weight: 600; color: var(--success, #16a34a); }
.sent-last-who.them { color: var(--accent, #2563eb); }
.sent-statusrow { margin-top: 2px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sent-block-btn { margin-left: auto; font-size: 12px; padding: 3px 9px; border-radius: 6px; cursor: pointer;
  border: 1px solid rgba(185, 28, 28, 0.45); background: rgba(185, 28, 28, 0.08); color: #b91c1c; }
.sent-block-btn:hover { background: rgba(185, 28, 28, 0.16); }
.sent-block-btn.on { border-color: rgba(100, 116, 139, 0.45); background: rgba(100, 116, 139, 0.1); color: var(--text-muted, #64748b); }
.sent-blocked { font-size: 11px; font-weight: 600; color: #b91c1c; background: rgba(185, 28, 28, 0.1);
  border-radius: 999px; padding: 1px 8px; }
.sent-blocked-badge { font-size: 12px; font-weight: 600; color: #b91c1c; background: rgba(185, 28, 28, 0.1);
  border-radius: 999px; padding: 2px 8px; }
.sent-row.is-blocked { border-color: rgba(185, 28, 28, 0.28); }
.blocked-people-panel { margin: 8px 4px 12px; padding: 12px; border-radius: 10px;
  border: 1px solid rgba(185, 28, 28, 0.25); background: rgba(185, 28, 28, 0.04); }
.blocked-people-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.blocked-people-title { font-size: 13px; font-weight: 650; }
.blocked-people-hint { font-size: 12px; margin: 0 0 8px; }
.blocked-add-row { display: flex; gap: 8px; align-items: flex-start; }
.blocked-add-input { flex: 1; min-height: 64px; resize: vertical; font-size: 13px; padding: 8px 10px;
  border-radius: 8px; border: 1px solid var(--border, rgba(120,120,120,0.35)); background: var(--panel, #fff);
  font-family: inherit; }
.blocked-add-btn { white-space: nowrap; }
.blocked-people-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.blocked-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px;
  padding: 3px 6px 3px 8px; border-radius: 999px; background: rgba(185, 28, 28, 0.08);
  border: 1px solid rgba(185, 28, 28, 0.22); }
.blocked-chip-x { font-size: 11px; padding: 1px 6px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(100, 116, 139, 0.4); background: transparent; color: inherit; }
.blocked-chip-x:hover { background: rgba(100, 116, 139, 0.12); }

/* Star button + Starred pill */
.mail-card-topright { display: flex; align-items: center; gap: 8px; }
.star-btn { background: none; border: none; cursor: pointer; font-size: 16px; line-height: 1; color: #cbd5e1; padding: 0 2px; }
.star-btn.on { color: #eab308; }
.star-btn:hover { color: #eab308; }
.mail-filter-pill.starred.active { background: #eab308; border-color: #eab308; color: #1f2937; }

/* Telegram in-UI re-auth panel */
.tg-reauth { margin-top: 14px; padding: 14px; border-radius: 12px; background: rgba(220,38,38,0.06); border: 1px solid rgba(220,38,38,0.35); }
.tg-reauth.ok { background: rgba(34,197,94,0.08); border-color: rgba(34,197,94,0.45); }
.tg-reauth-head { font-size: 13px; font-weight: 600; margin-bottom: 10px; color: var(--text, #111827); }
.tg-reauth-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tg-input { padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; min-width: 180px; }
.tg-reauth-msg { margin-top: 10px; font-size: 12px; color: var(--text-muted); }

/* Outreach draft review cards */
.mail-filter-pill.draft.active { background: #d97706; border-color: #d97706; color: #fff; }
.mail-section-icon.draft { background: rgba(217,119,6,0.15); }
.draft-section .mail-section-header { flex-wrap: wrap; }
.draft-list { display: flex; flex-direction: column; gap: 14px; }
.draft-card { border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; background: var(--bg-card, #fff); }
.draft-card-sent { border-color: rgba(22, 163, 74, 0.35); background: linear-gradient(180deg, rgba(22,163,74,0.04), transparent 48px); }
.draft-sent-badge {
  display: inline-block; font-size: 11px; font-weight: 700; color: #15803d;
  background: rgba(22,163,74,0.12); border: 1px solid rgba(22,163,74,0.35);
  border-radius: 999px; padding: 2px 8px; margin-right: 8px; vertical-align: middle;
}
.draft-sent-at { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.draft-head { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 10px; }
.draft-name { font-weight: 700; font-size: 14px; margin-right: 8px; }
.draft-email { font-size: 12px; color: var(--accent, #2563eb); text-decoration: none; }
.draft-co { font-size: 12px; }
.draft-jd { margin: 8px 0; font-size: 12px; }
.draft-jd summary { cursor: pointer; color: var(--text-muted); font-weight: 600; }
.draft-jd-body { margin-top: 6px; padding: 8px 10px; background: var(--bg-subtle, rgba(0,0,0,0.03)); border-radius: 8px; white-space: pre-wrap; max-height: 220px; overflow: auto; font-size: 12px; line-height: 1.5; }
.draft-field { margin-top: 10px; }
.draft-label { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 3px; }
.draft-subject { font-weight: 600; font-size: 13px; }
.draft-body { margin: 0; padding: 10px 12px; background: var(--bg-subtle, rgba(0,0,0,0.03)); border-radius: 8px; white-space: pre-wrap; font-family: inherit; font-size: 13px; line-height: 1.55; }
.draft-actions { display: flex; gap: 10px; margin-top: 14px; }
.btn-send { background: #16a34a; color: #fff; border: none; padding: 8px 18px; border-radius: 8px; font-weight: 600; cursor: pointer; font-size: 13px; }
.btn-send:hover { background: #15803d; }
.btn-send:disabled { opacity: 0.6; cursor: default; }
.draft-send-all { margin-left: auto; white-space: nowrap; }
.btn-dismiss { background: transparent; color: var(--text-muted); border: 1px solid var(--border); padding: 8px 16px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.btn-dismiss:hover { border-color: var(--danger, #dc2626); color: var(--danger, #dc2626); }
.btn-resume { background: transparent; color: var(--accent, #2563eb); border: 1px solid var(--accent, #2563eb); padding: 8px 14px; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; }
.btn-resume:hover { background: rgba(37,99,235,0.08); }
.mail-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  transition: box-shadow 150ms, border-color 150ms;
}
.mail-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}
.mail-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 6px;
}
.mail-card-subject {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}
.mail-card-date {
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
  flex-shrink: 0;
}
.mail-card-from {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.mail-card-summary {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}
.mail-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.mail-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  background: var(--surface-alt);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.mail-tag.company { background: #ede9fe; color: #6d28d9; border-color: #ede9fe; }
.mail-tag.role { background: #dbeafe; color: #1d4ed8; border-color: #dbeafe; }
.mail-tag.time { background: #fef3c7; color: #92400e; border-color: #fef3c7; }
.mail-tag.platform { background: #e0f2fe; color: #0369a1; border-color: #e0f2fe; }
.mail-tag.apply-source { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.mail-tag.reason { background: #fee2e2; color: #b91c1c; border-color: #fee2e2; }

/* Meeting link button */
.mail-join-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #7c3aed, #6366f1);
  color: white;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 150ms, transform 100ms;
  margin-top: 10px;
}
.mail-join-link:hover { opacity: 0.9; transform: translateY(-1px); }

/* Loading & Empty States */
.mail-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  gap: 16px;
}
.mail-loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: #7c3aed;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}
.mail-loading-text {
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
}
.mail-empty {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-muted);
}
.mail-empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.5;
}
.mail-error {
  background: var(--danger-soft);
  border: 1px solid var(--danger);
  color: var(--danger);
  border-radius: var(--radius);
  padding: 16px 20px;
  font-size: 13px;
  margin-bottom: 20px;
}

/* Interview timeline highlight card */
.mail-card.interview-highlight {
  border-left: 3px solid #7c3aed;
  background: linear-gradient(135deg, #faf5ff 0%, var(--surface) 100%);
}
.mail-card.assessment-highlight {
  border-left: 3px solid var(--warning);
  background: linear-gradient(135deg, #fffbeb 0%, var(--surface) 100%);
}

/* Category filter pills */
.mail-filters {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.mail-filter-pill {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 120ms;
}
.mail-filter-pill:hover { background: var(--surface-alt); color: var(--text); }
.mail-filter-pill.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* Sync Banner & Progress Bar */
.mail-sync-banner {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 18px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 13px;
  box-shadow: var(--shadow);
}
.mail-sync-banner.syncing {
  border-left: 3px solid var(--accent);
}
.mail-sync-banner.error {
  border-left: 3px solid var(--danger);
  background: var(--danger-soft);
  color: var(--danger);
}
.mail-sync-banner.idle {
  border-left: 3px solid var(--success);
}
.mail-sync-banner-info {
  display: flex;
  align-items: center;
  gap: 10px;
}
.mail-sync-progress-bar {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.mail-sync-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 300ms ease-out;
}

/* Card Actions & Open Link */
.mail-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.mail-open-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: background 150ms, border-color 150ms, transform 100ms;
}
.mail-open-link:hover {
  background: #ede9fe;
  border-color: #7c3aed;
  color: #7c3aed;
  transform: translateY(-1px);
}
/* Secondary fallback "By Subject" button — slightly muted */
.mail-open-link.secondary {
  opacity: 0.65;
  font-size: 11px;
  padding: 6px 10px;
}
.mail-open-link.secondary:hover {
  opacity: 1;
}
.mail-join-link {
  margin-top: 0 !important; /* Reset layout margin since it is now in actions container */
}

/* Spin animation for spinner */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.animate-spin {
  animation: spin 1s linear infinite;
}

/* ========== Salary Map (full-bleed to bottom, no page scroll) ========== */
.app.app--salary-map {
  max-width: none;
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh; /* mobile browser chrome safe */
  max-height: 100vh;
  max-height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}
.app.app--salary-map .topbar {
  flex: 0 0 auto;
  padding: 12px 16px 10px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--border);
}
.app.app--salary-map .page-nav {
  flex: 0 0 auto;
  margin: 0;
  padding: 0 16px;
}
/* Fill ALL remaining height under topbar+nav — absolute chain so iframe always gets pixels */
.app.app--salary-map .salary-map-wrap {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  width: 100%;
  /* override inline display:block when active; hide when not */
  display: none;
}
.app.app--salary-map .salary-map-wrap.is-visible {
  display: block !important;
}
.app.app--salary-map .salary-map-page {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
}
.salary-map-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: none;
  border-radius: 0;
  /* Map canvas is always dark, even when the site is in light mode */
  background: #0b0d12;
  display: block;
}
/* Hide other page panes completely on salary tab (avoid leftover height) */
.app.app--salary-map > div:not(.salary-map-wrap):not(.topbar):not(.page-nav) {
  display: none !important;
}

/* ========== System Health Board ========== */
/* Default (narrow screens): render in normal flow as a full-width card. */
.health-board {
  margin: 14px 0;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-alt);
  box-shadow: var(--shadow);
}
/* Wide screens: float into the empty right margin beside the 1100px content column. */
@media (min-width: 1560px) {
  .health-board {
    position: fixed;
    top: 96px;
    right: 24px;
    width: 250px;
    margin: 0;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    box-shadow: var(--shadow-md);
    z-index: 50;
  }
}

/* ========== Grok Chat page ========== */
.grok-chat-page {
  max-width: 880px;
  margin: 0 auto 28px;
  padding: 8px 16px 24px;
}
.grok-chat-shell {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 180px);
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-alt);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.grok-chat-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.grok-chat-header h2 {
  margin: 0;
  font-size: 1.15rem;
}
.grok-chat-header .muted {
  margin: 4px 0 0;
  font-size: 0.8rem;
}
.grok-chat-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.grok-model-select {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-alt);
  color: var(--text);
  padding: 6px 10px;
  font-size: 0.8rem;
  font-weight: 600;
}
.grok-chat-banner {
  margin: 0;
  padding: 10px 16px;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border);
}
.grok-chat-banner.warn {
  background: color-mix(in srgb, var(--warning) 12%, transparent);
  color: var(--text);
}
.grok-chat-banner.error {
  background: color-mix(in srgb, var(--danger) 12%, transparent);
  color: var(--danger);
}
.grok-chat-banner code {
  font-size: 0.8rem;
  background: var(--surface);
  padding: 1px 6px;
  border-radius: 4px;
}
.grok-chat-messages {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 280px;
  max-height: calc(100vh - 340px);
}
.grok-chat-empty {
  margin: auto;
  text-align: center;
  max-width: 440px;
  padding: 24px 12px;
}
.grok-chat-empty-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.grok-chat-suggestions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}
.grok-chip {
  text-align: left;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.82rem;
  cursor: pointer;
  line-height: 1.35;
}
.grok-chip:hover {
  border-color: var(--accent);
  color: var(--text);
  background: var(--accent-soft);
}
.grok-msg {
  max-width: min(92%, 640px);
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
}
.grok-msg.user {
  align-self: flex-end;
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}
.grok-msg.assistant {
  align-self: flex-start;
}
.grok-msg.error {
  border-color: color-mix(in srgb, var(--danger) 40%, var(--border));
}
.grok-msg-role {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.grok-msg-body {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--text);
}
.grok-msg-meta {
  margin-top: 6px;
  font-size: 0.7rem;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.grok-chat-composer {
  display: flex;
  gap: 10px;
  padding: 12px 14px 14px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  align-items: flex-end;
}
.grok-chat-input {
  flex: 1 1 auto;
  resize: vertical;
  min-height: 64px;
  max-height: 180px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  font-size: 0.92rem;
  background: var(--surface-alt);
  color: var(--text);
}
.grok-chat-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.grok-send {
  flex: 0 0 auto;
  min-width: 88px;
}
.btn.primary {
  background: var(--accent);
  color: #fff;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 16px;
  font-weight: 650;
  cursor: pointer;
}
.btn.primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.btn.primary:not(:disabled):hover {
  filter: brightness(1.05);
}

/* ========== System Monitor page (nav tab) ========== */
.monitor-page {
  max-width: 1180px;
  margin: 0 auto 32px;
  padding: 8px 16px 24px;
}
.monitor-page-inner.mon-board,
.monitor-page-inner {
  padding: 18px 20px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-alt);
  box-shadow: var(--shadow);
}
.monitor-page .hb-head {
  flex-wrap: wrap;
  gap: 8px 14px;
}
.monitor-page .hb-head h3 {
  font-size: 1.15rem;
}
.monitor-page-desc {
  flex: 1 1 100%;
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.mon-page-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.mon-page-grid--2 {
  grid-template-columns: 1fr 1fr;
}
.mon-page-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.mon-page-card--wide {
  grid-column: 1 / -1;
}
.mon-section--page {
  gap: 12px;
}
.monitor-page .mon-table .mono-path {
  max-width: 280px;
}
.monitor-page .mon-trace-list--tall {
  max-height: 420px;
}
.monitor-page .mon-chart {
  min-height: 120px;
}
@media (max-width: 860px) {
  .mon-page-grid,
  .mon-page-grid--2 {
    grid-template-columns: 1fr;
  }
  .mon-page-card--wide {
    grid-column: auto;
  }
}

/* ========== Compact rail (optional legacy) ========== */
.laptop-health-board {
  margin: 14px 0;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-alt);
  box-shadow: var(--shadow);
}
.laptop-health-board.mon-board {
  padding: 12px 14px 10px;
}

/* ---- Monitor tabs / charts / tables ---- */
.mon-tabs {
  display: flex;
  gap: 4px;
  margin: 0 0 10px;
  padding: 3px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
}
.mon-tab {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 650;
  padding: 5px 2px;
  border-radius: 6px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.mon-tab:hover { color: var(--text); }
.mon-tab.active {
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 25%, transparent);
}

.mon-section { display: flex; flex-direction: column; gap: 8px; }
.mon-subhead {
  margin: 6px 0 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.mon-bar-row { display: flex; flex-direction: column; gap: 3px; }
.mon-bar-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.mon-bar-label { font-size: 0.78rem; font-weight: 600; color: var(--text); }
.mon-bar-val { font-size: 0.78rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.mon-bar-val.up { color: var(--success); }
.mon-bar-val.warn { color: var(--warning); }
.mon-bar-val.down { color: var(--danger); }
.mon-bar-track {
  height: 6px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}
.mon-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--success);
  transition: width .35s ease;
}
.mon-bar-fill.warn { background: var(--warning); }
.mon-bar-fill.down { background: var(--danger); }
.mon-bar-sub { font-size: 0.68rem; color: var(--text-dim); line-height: 1.25; }

.mon-chart {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  padding: 6px 6px 4px;
}
.mon-chart.empty {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.mon-chart-svg {
  display: block;
  cursor: crosshair;
  touch-action: none;
}
.mon-grid { stroke: var(--border); stroke-width: 1; stroke-dasharray: 2 3; }
.mon-axis { fill: var(--text-dim); font-size: 8px; font-family: ui-sans-serif, system-ui, sans-serif; }
.mon-hover-line {
  stroke: var(--text-muted);
  stroke-width: 1;
  stroke-dasharray: 3 3;
  opacity: 0.85;
}
.mon-tooltip {
  position: absolute;
  z-index: 5;
  min-width: 128px;
  max-width: 220px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 92%, #000 8%);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.14);
  pointer-events: none;
  font-size: 0.72rem;
  line-height: 1.35;
}
.mon-tooltip-time {
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}
.mon-tooltip-row {
  display: grid;
  grid-template-columns: 8px 1fr auto;
  gap: 6px;
  align-items: center;
  margin-top: 3px;
}
.mon-tooltip-swatch {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}
.mon-tooltip-label { color: var(--text-muted); }
.mon-tooltip-val {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.mon-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  padding: 2px 4px 2px;
}
.mon-leg-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.66rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.mon-leg-item i {
  width: 8px; height: 8px; border-radius: 2px; display: inline-block;
}

.mon-bot-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 4px;
}
.mon-bot-list li {
  display: grid;
  grid-template-columns: 10px 1fr auto auto;
  gap: 6px;
  align-items: center;
  font-size: 0.74rem;
}
.mon-bot-list li.off { opacity: 0.45; }
.mon-bot-name { font-weight: 600; color: var(--text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mon-bot-cpu { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--text); }
.mon-bot-meta { font-size: 0.66rem; color: var(--text-dim); min-width: 3.2rem; text-align: right; }

.mon-inline { display: flex; align-items: center; gap: 8px; }
.mon-crash-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 6px;
  font-size: 0.7rem; color: var(--text-dim);
  max-height: 180px; overflow-y: auto;
}
.mon-crash-list li {
  display: flex; flex-direction: column; gap: 2px;
  padding: 5px 7px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
}
.mon-crash-list li.likely { border-color: color-mix(in srgb, var(--warning) 50%, var(--border)); }
.mon-crash-list li.unlikely { border-color: color-mix(in srgb, var(--success) 35%, var(--border)); }
.mon-crash-row { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.mon-crash-tag {
  font-size: 0.58rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.04em; padding: 1px 5px; border-radius: 999px;
  background: color-mix(in srgb, #a855f7 18%, transparent); color: #7e22ce;
}
.mon-crash-attr { font-size: 0.64rem; line-height: 1.3; color: var(--text-muted); }
.mon-crash-verdict {
  margin: 0; font-size: 0.7rem; font-weight: 650; line-height: 1.3;
}
.mon-crash-verdict.likely { color: var(--warning); }
.mon-crash-verdict.unlikely { color: var(--success); }
.mon-crash-verdict.maybe { color: var(--text-muted); }

.mon-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.7rem;
}
.mon-table th {
  text-align: left;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  padding: 3px 4px;
  border-bottom: 1px solid var(--border);
}
.mon-table td {
  padding: 4px;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  color: var(--text);
  vertical-align: top;
  font-variant-numeric: tabular-nums;
}
.mon-table tr.dim td { opacity: 0.4; }
.mon-table td.hot { color: var(--danger); font-weight: 700; }
.mon-table .mono-path {
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.66rem;
}
.mon-pill {
  display: inline-block;
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 1px 5px;
  border-radius: 999px;
  margin-right: 4px;
  background: var(--border);
  color: var(--text-muted);
  vertical-align: middle;
}
.mon-pill.bot { background: color-mix(in srgb, #f59e0b 22%, transparent); color: #b45309; }
.mon-pill.website { background: color-mix(in srgb, #22c55e 22%, transparent); color: #15803d; }
.mon-pill.chrome, .mon-pill.chrome-renderer { background: color-mix(in srgb, #ef4444 18%, transparent); color: #b91c1c; }
.mon-pill.gpu { background: color-mix(in srgb, #a855f7 22%, transparent); color: #7e22ce; }
.mon-pill.java { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }

.mon-trace-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 6px;
  max-height: 220px; overflow-y: auto;
}
.mon-trace-list li {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 8px;
  background: var(--surface);
}
.mon-trace-list li.warn { border-color: color-mix(in srgb, var(--warning) 45%, var(--border)); }
.mon-trace-list li.crit { border-color: color-mix(in srgb, var(--danger) 50%, var(--border)); background: color-mix(in srgb, var(--danger) 6%, var(--surface)); }
.mon-trace-top { display: flex; gap: 8px; align-items: baseline; }
.mon-trace-ms { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--warning); font-size: 0.78rem; min-width: 3.2rem; }
.mon-trace-list li.crit .mon-trace-ms { color: var(--danger); }
.mon-trace-path {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.66rem;
  color: var(--text);
  word-break: break-all;
}
.mon-trace-meta {
  display: flex; justify-content: space-between;
  margin-top: 3px; font-size: 0.66rem; color: var(--text-dim);
}
.mon-empty { font-size: 0.75rem; margin: 4px 0; }

.mon-range-row, .mon-days {
  display: flex; flex-wrap: wrap; gap: 4px;
}
.mon-chip {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
}
.mon-chip.sm { padding: 2px 7px; font-size: 0.65rem; }
.mon-chip:hover { border-color: var(--border-strong); color: var(--text); }
.mon-chip.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}
.mon-note {
  margin: 4px 0 0;
  font-size: 0.66rem;
  color: var(--text-dim);
  line-height: 1.35;
}
.mon-note code {
  font-size: 0.62rem;
  background: var(--surface);
  padding: 0 3px;
  border-radius: 3px;
}


.hb-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.hb-head h3 { margin: 0; font-size: 0.95rem; }
.hb-overall-label { margin: 1px 0 0; font-size: 0.78rem; font-weight: 600; }
.hb-overall-label.up { color: var(--success); }
.hb-overall-label.down { color: var(--danger); }
.hb-overall-label.warn { color: var(--warning); }

.hb-overall {
  width: 12px; height: 12px; border-radius: 50%; flex: 0 0 auto;
}
.hb-overall.up { background: var(--success); box-shadow: 0 0 0 4px var(--success-soft); }
.hb-overall.down { background: var(--danger); box-shadow: 0 0 0 4px var(--danger-soft); animation: hb-pulse 1.4s ease-in-out infinite; }
.hb-overall.warn { background: var(--warning); box-shadow: 0 0 0 4px var(--warning-soft); }

@keyframes hb-pulse {
  0%, 100% { box-shadow: 0 0 0 4px var(--danger-soft); }
  50% { box-shadow: 0 0 0 7px rgba(220,38,38,0.12); }
}

.hb-loading { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
.hb-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.hb-item { display: flex; align-items: flex-start; gap: 9px; }
.hb-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; margin-top: 4px; }
.hb-dot.up { background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }
.hb-dot.down { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.hb-dot.warn { background: var(--warning); box-shadow: 0 0 0 3px var(--warning-soft); }
.hb-text { display: flex; flex-direction: column; min-width: 0; }
.hb-label { font-size: 0.85rem; font-weight: 600; color: var(--text); line-height: 1.2; }
.hb-detail { font-size: 0.74rem; color: var(--text-muted); line-height: 1.3; }
.hb-foot { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--border); font-size: 0.72rem; color: var(--text-dim); }

/* ===== Naukri multi-profile dashboard ===== */
/* Desktop: full-width in 2-col grid. Mobile: same width as other bot cards.
   When graph/contacts load, SVG intrinsic width (~720) must NOT expand layout. */
.card.bot.naukri-card {
  grid-column: 1 / -1;
  min-height: 0;
  min-width: 0 !important;
  max-width: 100%;
  width: 100%;
  padding: 28px 32px;
  overflow: hidden; /* clip; never push siblings / page wider */
  contain: inline-size; /* isolate width from heavy chart content */
}
.card.bot.naukri-card > * {
  min-width: 0;
  max-width: 100%;
}
.card.bot.naukri-card .rate-limit-state,
.card.bot.naukri-card .profile-state,
.card.bot.naukri-card .schedule,
.card.bot.naukri-card .last-run,
.card.bot.naukri-card .nk-perf,
.card.bot.naukri-card .nk-invites {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}
.card.bot.naukri-card .card-head {
  min-width: 0;
}
.card.bot.naukri-card .title-row h2 {
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
}
.card.bot.naukri-card code,
.card.bot.naukri-card pre {
  word-break: break-all;
  white-space: pre-wrap;
  max-width: 100%;
}
.card.bot.naukri-card .actions {
  flex-wrap: wrap;
}
.card.bot.naukri-card .actions .btn {
  min-width: 0;
}

.naukri-active-label { color: var(--text-muted); font-weight: 500; }

.naukri-profiles { margin: 4px 0 18px; min-width: 0; }
.np-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 100%;
}
.np-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface-alt);
  color: var(--text); font-size: 0.86rem; font-weight: 600; cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
  max-width: 100%;
  min-width: 0;
}
.np-pill:hover { border-color: var(--border-strong); }
.np-pill.active { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px var(--accent-soft); }
.np-pill.np-add { border-style: dashed; color: var(--accent); background: transparent; }
.np-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-dim); flex: 0 0 auto; }
.np-dot.on { background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }
.np-dot.idle { background: var(--warning); }
.np-dot.off { background: var(--text-dim); }
.np-disabled { color: var(--text-dim); font-weight: 500; }

.np-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 10px; font-size: 0.82rem; min-width: 0; }
.np-meta > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.np-link { background: none; border: none; padding: 0; cursor: pointer; color: var(--accent); font-size: 0.82rem; font-weight: 600; }
.np-link.danger { color: var(--danger); }
.np-link:hover { text-decoration: underline; }

.np-form {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-alt); padding: 16px 18px; margin-bottom: 18px;
  min-width: 0; max-width: 100%;
}
.np-form h3 { margin: 0 0 12px; font-size: 0.95rem; }
.np-form label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--text-muted); margin-bottom: 10px; }
.np-form label input[type="text"],
.np-form label input[type="email"],
.np-form label input[type="password"] {
  display: block; width: 100%; max-width: 100%; margin-top: 5px; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font-size: 0.9rem;
  box-sizing: border-box;
}
.np-form label.np-check { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--text); }
.np-form label.np-check input { margin: 0; flex-shrink: 0; }
.np-form-actions { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }

/* ---- Naukri performance chart (responsive) ---- */
.nk-perf { min-width: 0; max-width: 100%; overflow: hidden; }
.nk-perf-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 6px;
  table-layout: fixed;
}
.nk-perf-table td {
  padding: 6px 8px 6px 0;
  vertical-align: middle;
  word-break: break-word;
}
.nk-perf-val {
  text-align: right;
  white-space: nowrap;
}
.nk-perf-val b { font-size: 18px; }
.nk-perf-delta {
  margin-left: 8px;
  font-weight: 600;
  color: var(--text-muted);
}
.nk-perf-delta.up { color: var(--success); }
.nk-perf-delta.down { color: var(--danger); }
.nk-perf-snap { font-size: 12px; margin-top: 6px; }

.nk-chart {
  margin-top: 18px;
  background: var(--surface, #fff);
  border-radius: 12px;
  padding: 18px 20px;
  border: 1px solid var(--border, #e5e7eb);
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}
/* Daily applies chart sits inside the main stats card — slightly tighter top margin */
.card.stats .apply-chart {
  margin-top: 22px;
  background: transparent;
  border: none;
  padding: 8px 0 0;
  border-top: 1px solid var(--border, #e5e7eb);
  border-radius: 0;
}
.nk-chart-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
  min-width: 0;
}
.nk-chart-title {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 8px;
  font-size: 17px;
  font-weight: 600;
  color: var(--text, #111827);
  min-width: 0;
  flex: 1 1 200px;
  line-height: 1.35;
}
.nk-chart-range { position: relative; flex-shrink: 0; }
.nk-chart-range-btn {
  background: transparent;
  border: none;
  color: #7c3aed;
  font-weight: 600;
  font-size: 17px;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: inherit;
}
.nk-chart-caret { font-size: 11px; }
.nk-chart-range-menu {
  position: absolute;
  top: 28px;
  left: 0;
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.1);
  z-index: 20;
  min-width: 120px;
  overflow: hidden;
}
.nk-chart-range-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  color: var(--text, #111827);
  font-family: inherit;
}
.nk-chart-range-item.active {
  color: #7c3aed;
  font-weight: 600;
  background: #f5f3ff;
}
.nk-chart-range-item:hover { background: #f9fafb; }
.nk-chart-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-width: 0;
  flex: 0 1 auto;
}
.nk-chart-toggles button {
  flex: 0 0 auto;
  white-space: nowrap;
  font-family: inherit;
}
.nk-chart-sep {
  width: 1px;
  height: 18px;
  background: var(--border, #e5e7eb);
  margin: 0 2px;
  flex-shrink: 0;
}
.nk-chart-trend {
  font-size: 14px;
  margin: -6px 0 16px;
}
.nk-chart-divider {
  height: 1px;
  background: var(--border, #e5e7eb);
  margin: 16px 0;
}
.nk-chart-body {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  min-width: 0;
}
.nk-chart-side {
  flex: 0 0 25%;
  min-width: 0;
  max-width: 100%;
}
.nk-chart-main {
  flex: 1 1 75%;
  min-width: 0;
  max-width: 100%;
}
.nk-chart-side-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text, #111827);
  margin-bottom: 10px;
  line-height: 1.3;
}
.nk-chart-empty { font-size: 12px; color: var(--text-muted, #9ca3af); }
.nk-chart-keywords { display: flex; flex-direction: column; gap: 8px; }
.nk-kw-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text, #111827);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nk-kw-count { font-size: 12px; color: var(--text-muted, #9ca3af); margin-top: 1px; }
.nk-chart-today { margin-top: 22px; }
.nk-chart-today-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 4px;
  -webkit-overflow-scrolling: touch;
}
.nk-today-item { border-left: 2px solid #ede9fe; padding-left: 8px; min-width: 0; }
.nk-today-activity { font-size: 11px; color: #7c3aed; margin-top: 2px; }
.nk-chart-svg-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  /* hidden (not auto): overflow-x:auto still lets some browsers grow the flex min-size */
  overflow: hidden;
  position: relative;
}
.nk-chart-svg,
.nk-chart-svg-wrap > svg {
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  display: block;
  /* Override SVG intrinsic min-content (~viewBox width 720) that blows the grid */
  min-width: 0 !important;
}
.nk-proj {
  margin-top: 24px;
  border-top: 1px dashed var(--border, #e5e7eb);
  padding-top: 18px;
  min-width: 0;
}
.nk-proj-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  min-width: 0;
}
.nk-proj-meta { min-width: 0; flex: 1 1 160px; }
.nk-proj-title { font-size: 13px; font-weight: 600; color: var(--text, #111827); }
.nk-proj-sub { font-size: 12px; color: var(--text-muted, #6b7280); margin-top: 2px; line-height: 1.4; word-break: break-word; }
.nk-proj-horizons { flex: 0 1 auto; }

/* Mobile: uniform card width, stack chart, no horizontal page scroll */
@media (max-width: 720px) {
  html, body, #root {
    max-width: 100vw;
    overflow-x: hidden;
  }
  .app {
    overflow-x: hidden;
    max-width: 100vw;
    padding-left: max(12px, env(safe-area-inset-left, 0px));
    padding-right: max(12px, env(safe-area-inset-right, 0px));
  }

  .card.bot.naukri-card {
    grid-column: auto;
    min-height: 0;
    padding: 14px;
    width: 100%;
    max-width: 100%;
    /* After graph/contacts paint, keep card within viewport */
    overflow: hidden;
    contain: inline-size;
  }
  .card.bot.naukri-card .actions .btn {
    flex: 1 1 calc(50% - 8px);
    min-height: 42px;
  }
  .nk-chart {
    padding: 10px;
    margin-top: 12px;
    border-radius: 10px;
    overflow: hidden;
  }
  .nk-chart-head {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .nk-chart-title {
    font-size: 14px;
    flex: 1 1 auto;
    word-break: break-word;
  }
  .nk-chart-range-btn { font-size: 14px; }
  .nk-chart-toggles {
    width: 100%;
  }
  .nk-chart-toggles button {
    flex: 1 1 calc(50% - 6px);
    min-height: 36px;
    font-size: 11px !important;
    padding: 6px 6px !important;
    white-space: normal;
  }
  .nk-chart-sep { display: none; }
  .nk-chart-body {
    flex-direction: column;
    gap: 14px;
    width: 100%;
  }
  .nk-chart-side,
  .nk-chart-main {
    flex: 1 1 auto !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }
  .nk-chart-today-list { max-height: 180px; }
  .nk-proj-head {
    flex-direction: column;
    align-items: stretch;
  }
  .nk-proj-horizons {
    width: 100%;
  }
  .nk-perf-val {
    white-space: normal;
  }
  .nk-perf-val b { font-size: 15px; }
  .nk-perf-delta { display: inline-block; margin-left: 4px; }
  .np-pills {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    scrollbar-width: none;
    max-width: 100%;
  }
  .np-pills::-webkit-scrollbar { display: none; }
  .np-pill {
    flex: 0 0 auto;
    padding: 8px 12px;
    font-size: 0.82rem;
  }
  .np-form { padding: 12px; }
  .np-form-actions .btn {
    flex: 1 1 auto;
    min-height: 40px;
  }
  /* Invites / contacts list once loaded */
  .nk-invites-filters {
    flex-direction: column;
    align-items: stretch;
  }
  .nk-invites-filters .intel-search,
  .nk-invites-filters select {
    width: 100% !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    max-width: 100%;
    box-sizing: border-box;
  }
  .nk-invites-list {
    max-height: 280px;
  }
  .nk-invite-meta {
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  /* Keep whole dashboard from expanding past viewport when details load */
  .grid,
  .card.bot,
  .rate-limit-state,
  .profile-state,
  .schedule,
  .nk-perf,
  .nk-invites,
  .nk-chart,
  .nk-chart-body,
  .nk-chart-main,
  .nk-chart-side {
    min-width: 0 !important;
    max-width: 100%;
  }
}

/* ---- Naukri invites / contacts (loaded details) ---- */
.nk-invites {
  margin-top: 14px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}
.nk-invites-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 6px 0 8px;
  min-width: 0;
  max-width: 100%;
}
.nk-invites-filters .intel-search {
  flex: 1 1 160px;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  box-sizing: border-box;
}
.nk-invites-filters select {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
}
.nk-invites-count {
  font-size: 11px;
  margin-bottom: 6px;
}
.nk-invites-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 360px;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 4px;
  -webkit-overflow-scrolling: touch;
  min-width: 0;
}
.nk-invite-row {
  border-left: 2px solid #ede9fe;
  padding-left: 8px;
  min-width: 0;
  max-width: 100%;
}
.nk-invite-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.nk-invite-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.nk-invite-foot {
  font-size: 11px;
  margin-top: 2px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}
.nk-invite-activity {
  font-weight: 600;
  color: #7c3aed;
}
.nk-invite-activity.is-nvite {
  color: var(--success);
}


/* Open-tracking indicator on outreach draft cards */
.draft-tracked { font-size: 11px; font-weight: 600; color: #0ea5e9; background: rgba(14,165,233,0.12); border-radius: 10px; padding: 2px 9px; align-self: center; }
.draft-tracked.off { color: var(--text-muted); background: var(--surface-alt); }

/* Tracking pixel markup shown in the outreach draft card */
.draft-pixel { display: block; font-family: ui-monospace, Menlo, monospace; font-size: 10px; color: #0ea5e9; background: var(--surface-alt); border: 1px solid var(--border); border-radius: 6px; padding: 6px 8px; margin-top: 4px; word-break: break-all; white-space: pre-wrap; }

/* ===== Email Finder page ===== */
.email-finder { padding: 4px 0; }
.ef-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin: 16px 0; }
.ef-kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; text-align: center; }
.ef-num { font-size: 26px; font-weight: 700; letter-spacing: -0.03em; color: var(--accent); }
.ef-lbl { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-top: 4px; }
.ef-dist { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.ef-pill { font-size: 12px; background: var(--surface-alt); border: 1px solid var(--border); border-radius: 12px; padding: 3px 10px; }
.ef-pill b { color: var(--accent); margin-right: 4px; }
.ef-search { width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 12px; background: var(--surface); color: var(--text); }
.ef-table { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; font-size: 12.5px; }
.ef-row { display: grid; grid-template-columns: 1.3fr 1.1fr 1.7fr 1.7fr 0.9fr 0.4fr 0.5fr; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--border); align-items: center; }
.ef-row:last-child { border-bottom: none; }
.ef-head { background: var(--surface-alt); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.ef-row.miss { background: rgba(220,38,38,0.05); }
.ef-mail { font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ef-mail.ok { color: #16a34a; }
.ef-mail.bad { color: var(--danger); }

/* Email Finder — real-time generator */
.ef-gen { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin: 14px 0; }
.ef-gen-title { font-weight: 600; margin-bottom: 10px; }
.ef-gen-form { display: flex; gap: 8px; flex-wrap: wrap; }
.ef-gen-form input { flex: 1 1 200px; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); }
.ef-gen-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ef-gen-err { color: var(--danger); font-size: 12px; margin-top: 8px; }
.ef-gen-warn { color: var(--warning); background: var(--warning-soft); font-size: 12px; font-weight: 600; border-radius: 8px; padding: 7px 11px; margin: 10px 0; }
.ef-gen-ok { color: #16a34a; background: var(--success-soft); font-size: 12px; font-weight: 600; border-radius: 8px; padding: 7px 11px; margin: 10px 0; }
.ef-gen-out.observed .ef-gen-bestmail { color: #16a34a; }
.ef-gen-alts { font-size: 12px; color: var(--text-muted); margin-top: 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ef-gen-out { margin-top: 14px; }
.ef-gen-best { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ef-gen-bestmail { font-family: ui-monospace, Menlo, monospace; font-size: 16px; font-weight: 700; color: var(--accent); cursor: pointer; }
.ef-badge { font-size: 11px; font-weight: 600; border-radius: 10px; padding: 2px 9px; }
.ef-badge.ok { color: #16a34a; background: var(--success-soft); }
.ef-badge.bad { color: var(--danger); background: var(--danger-soft); }
.ef-badge.learned { color: #16a34a; background: var(--success-soft); }
.ef-badge.guess { color: var(--warning); background: var(--warning-soft); }
.ef-badge.domain { color: var(--accent, #2563eb); background: var(--accent-soft, rgba(37,99,235,.12)); }
.ef-gen-candslabel { font-size: 11px; color: var(--text-muted); margin: 12px 0 6px; text-transform: uppercase; letter-spacing: 0.04em; }
.ef-gen-cands { display: flex; flex-wrap: wrap; gap: 6px; }
.ef-cand { font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; background: var(--surface-alt); border: 1px solid var(--border); border-radius: 6px; padding: 3px 8px; cursor: pointer; }
.ef-cand:hover { border-color: var(--accent); }
.ef-cand.best { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.ef-gen-alts { font-size: 12px; color: var(--text-muted); margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* ---- SMTP mailbox verification badges ---- */
.ef-badge.smtp-ok   { color: #15803d; background: #dcfce7; border: 1px solid #86efac; }
.ef-badge.smtp-bad  { color: #dc2626; background: #fee2e2; border: 1px solid #fca5a5; }
.ef-badge.smtp-warn { color: #92400e; background: #fef3c7; border: 1px solid #fcd34d; }
.ef-badge.verifying { color: #1d4ed8; background: #dbeafe; border: 1px solid #93c5fd;
                      animation: ef-pulse 1.2s ease-in-out infinite; }
@keyframes ef-pulse { 0%,100% { opacity:1; } 50% { opacity:.45; } }

/* ---- Verify Mailbox button ---- */
.ef-verify-btn {
  font-size: 11.5px; font-weight: 600; padding: 3px 12px; border-radius: 20px;
  background: linear-gradient(135deg, #1d4ed8, #6d28d9);
  color: #fff; border: none; cursor: pointer; transition: opacity .15s, transform .1s;
  white-space: nowrap;
}
.ef-verify-btn:hover { opacity: .85; transform: translateY(-1px); }
.ef-verify-btn:active { transform: translateY(0); }

/* ---- Re-probe button ---- */
.ef-reverify-btn {
  font-size: 10.5px; padding: 1px 8px; border-radius: 12px;
  background: var(--surface-alt); border: 1px solid var(--border);
  color: var(--text-muted); cursor: pointer; margin-left: 6px;
}
.ef-reverify-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ---- SMTP probe detail row ---- */
.ef-verify-detail {
  margin-top: 10px; padding: 8px 12px; border-radius: 8px;
  background: var(--surface-alt); border: 1px solid var(--border);
  font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.ef-verify-label { font-weight: 600; color: var(--text); }
.ef-verify-cache { font-size: 10.5px; color: var(--text-muted); font-style: italic; }

/* ── Company Intel (Layoffs / Levels / Unique) — card list ─────────────────── */
.intel-search {
  width: 100%; padding: 9px 12px; margin: 6px 0; box-sizing: border-box;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font-size: 13px;
}
.intel-search:focus { outline: none; border-color: var(--accent); }
.intel-filters {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 4px 0 10px;
  padding: 10px 10px 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-alt, color-mix(in srgb, var(--surface) 88%, var(--accent) 6%));
}
.intel-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}
.intel-filter-label {
  min-width: 58px;
  color: var(--text-dim);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.intel-filter-chip {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  padding: 5px 9px;
  cursor: pointer;
}
.intel-filter-chip:hover { border-color: var(--accent); color: var(--text); }
.intel-filter-chip.active {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  background: var(--accent-soft, color-mix(in srgb, var(--accent) 16%, var(--surface)));
  color: var(--accent);
}
.intel-filter-clear {
  margin-left: auto;
  border: none;
  background: none;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 2px;
}

/* Compact faceted filter bar (Unique companies) */
.uf-bar {
  position: relative;
  z-index: 6;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 4px 0 12px;
  padding: 10px 12px 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.uf-search-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.uf-search {
  position: relative;
  flex: 1;
  min-width: 0;
  display: block;
}
.uf-search .intel-search {
  width: 100%;
  margin: 0;
  padding: 9px 34px 9px 36px;
  border-radius: 10px;
  background: var(--surface-alt);
}
.uf-search-ico {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
}
.uf-search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 999px;
  background: var(--border);
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}
.uf-search-clear:hover { color: var(--text); background: var(--border-strong); }
.uf-search input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.uf-result {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 650;
  color: var(--text-muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.uf-result b { color: var(--text); }
.uf-menus {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}
.uf-menu { position: relative; flex: 0 0 auto; }
.uf-trigger {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  min-width: 108px;
  max-width: 160px;
  padding: 6px 26px 6px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-alt);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  position: relative;
}
.uf-trigger:hover { border-color: var(--border-strong); }
.uf-trigger-kicker {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.uf-trigger-value {
  font-size: 12.5px;
  font-weight: 650;
  line-height: 1.2;
  max-width: 122px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.uf-caret {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 10px;
}
.uf-menu.is-open .uf-trigger,
.uf-menu.is-active .uf-trigger {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--border));
  background: var(--accent-soft);
}
.uf-menu.is-active .uf-trigger-value { color: var(--accent); }
.uf-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 240px;
  max-height: min(360px, 60vh);
  overflow: auto;
  z-index: 30;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}
.uf-panel-end { left: auto; right: 0; }
.uf-menus .uf-menu:nth-child(n+4) .uf-panel { left: auto; right: 0; }
.uf-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
  text-align: left;
}
.uf-option:hover { background: var(--surface-alt); }
.uf-option.is-selected { background: var(--accent-soft); color: var(--accent); }
.uf-option.is-empty { opacity: .45; }
.uf-option em {
  font-style: normal;
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
}
.uf-option.is-selected em { color: var(--accent); }
.uf-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  padding: 0 12px;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-alt);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
}
.uf-toggle em {
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.uf-toggle:hover { border-color: var(--border-strong); }
.uf-toggle.is-active {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--border));
  background: var(--accent-soft);
  color: var(--accent);
}
.uf-toggle.is-active em { color: var(--accent); }
.uf-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.uf-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 10px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border));
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 650;
  cursor: pointer;
}
.uf-chip:hover { border-color: var(--accent); }
.uf-clear {
  border: 0;
  background: none;
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 2px;
}
.uf-clear:hover { color: var(--accent); }
.uf-empty { max-width: 42rem; line-height: 1.45; }
.jm-stat-card.is-filter { cursor: pointer; }
.jm-stat-card.is-filter:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  background: var(--accent-soft);
}

.intel-meta { font-size: 11px; color: var(--text-dim); margin-bottom: 8px; }

/* Cards / Table toggle on Company tab */
.intel-view-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0;
  margin-left: auto;
  margin-right: 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface-alt, #f1f5f9);
  flex-shrink: 0;
}
.intel-view-btn {
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  cursor: pointer;
  line-height: 1.2;
}
.intel-view-btn:hover { color: var(--text); }
.intel-view-btn.active {
  background: #2563eb;
  color: #fff;
}
.mail-section-header .btn.primary.sm {
  flex-shrink: 0;
}

.intel-card-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 72vh;
  overflow: auto;
  padding: 2px 2px 16px;
}
.intel-card-count {
  font-size: 12px;
  color: var(--text-dim);
  padding: 2px 4px 4px;
}
.intel-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px 18px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.intel-card:hover {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

/* Clean unique/levels cards — minimal, only essentials (legacy) */
.intel-card.clean {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.intel-card.clean:hover {
  border-color: color-mix(in srgb, var(--accent) 30%, var(--border));
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
  background: var(--surface);
}
.intel-card.clean.has-new {
  border-color: color-mix(in srgb, #22c55e 40%, var(--border));
  background: color-mix(in srgb, #22c55e 4%, var(--surface));
}
.intel-card.clean.mon {
  box-shadow: inset 3px 0 0 #22c55e;
}
.intel-card.clean.err {
  box-shadow: inset 3px 0 0 #dc2626;
  border-color: color-mix(in srgb, #dc2626 28%, var(--border));
}
.intel-card.clean.err.has-new {
  border-color: color-mix(in srgb, #dc2626 28%, var(--border));
  background: color-mix(in srgb, #dc2626 4%, var(--surface));
}

/* ── GlobalMove-style company cards (self-contained, no .intel-card fights) ── */
.gm-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  grid-template-areas:
    "avatar main side";
  column-gap: 14px;
  row-gap: 0;
  align-items: start;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.gm-card:hover {
  border-color: color-mix(in srgb, var(--accent) 30%, var(--border));
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}
.gm-card.has-new {
  border-color: color-mix(in srgb, #22c55e 40%, var(--border));
  background: color-mix(in srgb, #22c55e 4%, var(--surface));
}
/* Green left bar ONLY when board is verified AND has open jobs */
.gm-card.is-verified {
  box-shadow: inset 3px 0 0 #22c55e, 0 1px 2px rgba(15, 23, 42, 0.04);
}
.gm-card.is-expanded {
  grid-template-areas:
    "avatar main side"
    "jobs   jobs  jobs";
  row-gap: 12px;
}

.gm-avatar {
  grid-area: avatar;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 17px;
  color: #fff;
  flex-shrink: 0;
  user-select: none;
}
.gm-avatar.verified {
  background: #0d9488;
  box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.22);
}
.gm-avatar.neutral { background: #94a3b8; }
.gm-avatar.tone-0 { background: #0d9488; }
.gm-avatar.tone-1 { background: #2563eb; }
.gm-avatar.tone-2 { background: #dc2626; }
.gm-avatar.tone-3 { background: #7c3aed; }
.gm-avatar.tone-4 { background: #ea580c; }
.gm-avatar.tone-5 { background: #0891b2; }

.gm-main {
  grid-area: main;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 1px;
}
.gm-visa {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  align-self: flex-start;
  max-width: 100%;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 650;
  line-height: 1.25;
  color: #1d4ed8;
  background: rgba(37, 99, 235, 0.12);
  border: 1px solid rgba(37, 99, 235, 0.28);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gm-visa.is-remote {
  color: #047857;
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.3);
}
.gm-visa-ico {
  flex-shrink: 0;
  font-size: 11px;
  line-height: 1;
}
.gm-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gm-meta {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gm-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.gm-chip {
  display: inline-flex;
  align-items: center;
  max-width: 220px;
  padding: 3px 9px;
  border-radius: 8px;
  font-size: 11px;
  color: #334155;
  background: var(--surface-alt, #f8fafc);
  border: 1px solid var(--border);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
a.gm-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.gm-chip.is-muted {
  opacity: 0.75;
  font-style: italic;
  color: var(--text-dim);
}

.gm-side {
  grid-area: side;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  min-width: 92px;
  padding-top: 2px;
}
.gm-new {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: #15803d;
  background: rgba(34, 197, 94, 0.14);
  white-space: nowrap;
}
.gm-open {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  line-height: 1.2;
}
.gm-open strong {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-right: 3px;
}
.gm-open.is-dim,
.gm-open.is-dim strong {
  color: var(--text-dim);
  font-weight: 500;
}
.gm-open.is-dim strong { font-weight: 600; }
.gm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 84px;
  padding: 8px 14px;
  border-radius: 999px;
  background: #2563eb;
  color: #fff !important;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  text-decoration: none !important;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s ease;
}
.gm-btn:hover { background: #1d4ed8; }
.gm-btn.is-ghost {
  background: transparent;
  color: var(--text-dim) !important;
  border: 1px solid var(--border);
}
.gm-btn.is-ghost:hover {
  border-color: var(--accent);
  color: var(--accent) !important;
}
.gm-btn.is-disabled {
  background: var(--surface-alt, #e2e8f0);
  color: var(--text-muted) !important;
  cursor: default;
  pointer-events: none;
}
.gm-when {
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
}
/* Global combined jobs chart on Unique companies page */
.jm-global-chart-wrap {
  margin: 12px 0 16px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.jm-global-chart-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 14px;
  margin: 0 2px 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text, #0e121b);
}
.jm-global-chart {
  margin-top: 0 !important;
  min-height: 280px;
  width: 100%;
  box-sizing: border-box;
}
.jm-global-chart .nk-chart-body {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}
.jm-global-chart .nk-chart-side {
  flex: 1 1 160px;
  max-width: 220px;
}
.jm-global-chart .nk-chart-main {
  flex: 1 1 320px;
  min-width: 0;
  min-height: 220px;
}
.jm-global-chart .nk-chart-svg-wrap {
  width: 100%;
  min-height: 220px;
}
.jm-cat-list {
  gap: 10px !important;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 4px;
}
.jm-cat-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.jm-cat-row-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.jm-cat-row-top .nk-kw-name {
  flex: 1;
  min-width: 0;
}
.jm-cat-row-top .nk-kw-count {
  margin-top: 0;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--text, #111827);
  white-space: nowrap;
}
.jm-cat-bar-track {
  height: 4px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--border, #e5e7eb) 80%, transparent);
  overflow: hidden;
}
.jm-cat-bar-fill {
  height: 100%;
  border-radius: 999px;
  opacity: 0.85;
  min-width: 2px;
}
.jm-cat-pct {
  font-size: 11px;
  line-height: 1.2;
}

/* Jobs-added chart inside expanded company card */
.gm-jobs .jm-jobs-chart-wrap {
  display: block;
  width: 100%;
  margin: 8px 0 14px;
  min-height: 120px;
}
.gm-jobs .jm-jobs-chart-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-muted, #6b7280);
  margin: 0 0 8px 2px;
}
.gm-jobs .jm-jobs-chart {
  margin: 0;
  padding: 14px 14px 10px;
  width: 100%;
  min-height: 220px;
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  box-sizing: border-box;
}
.gm-jobs .jm-jobs-chart .nk-chart-body {
  gap: 14px;
  display: flex;
  flex-wrap: wrap;
}
.gm-jobs .jm-jobs-chart .nk-chart-side {
  flex: 1 1 160px;
  min-width: 140px;
  max-width: 220px;
}
.gm-jobs .jm-jobs-chart .nk-chart-main {
  flex: 1 1 280px;
  min-width: 0;
  min-height: 200px;
}
.gm-jobs .jm-jobs-chart .nk-chart-svg-wrap {
  width: 100%;
  min-height: 200px;
}
.gm-jobs .jm-jobs-chart .nk-chart-title {
  font-size: 14px;
  flex-wrap: wrap;
  gap: 6px;
}

.gm-jobs {
  grid-area: jobs;
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface-alt, #f8fafc);
  border: 1px solid var(--border);
}
.gm-jobs .intel-job-list {
  max-height: 320px;
  gap: 6px;
}

@media (max-width: 720px) {
  .gm-card {
    grid-template-columns: 44px minmax(0, 1fr);
    grid-template-areas:
      "avatar main"
      "side   side";
    row-gap: 10px;
  }
  .gm-card.is-expanded {
    grid-template-areas:
      "avatar main"
      "side   side"
      "jobs   jobs";
  }
  .gm-side {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    min-width: 0;
    width: 100%;
    gap: 8px 12px;
  }
  .gm-open { margin-right: auto; }
}
.ic-main { flex: 1; min-width: 0; }
.ic-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.ic-name {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1.3;
  word-break: break-word;
  text-transform: none;
}
.ic-stats {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.ic-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
  flex-shrink: 0;
}
.ic-dot.err {
  background: #dc2626;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.22);
}
.ic-dot.pending {
  background: #94a3b8;
  box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.25);
}
.ic-jobs {
  font-size: 13px;
  font-weight: 650;
  color: var(--text);
}
.ic-jobs.dim {
  font-weight: 500;
  color: var(--text-dim);
}
.ic-jobs.err {
  color: #dc2626;
  font-weight: 600;
}
.ic-new {
  font-size: 12px;
  font-weight: 700;
  color: #15803d;
  background: rgba(34, 197, 94, 0.12);
  padding: 2px 8px;
  border-radius: 999px;
}
.ic-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.35;
}
.ic-sub span + span::before {
  /* gap handles spacing; no bullet needed */
}
.ic-visa {
  color: #1d4ed8;
  font-weight: 600;
}
.ic-visa.remote {
  color: #047857;
}
.ic-ats {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 11px;
  font-weight: 600;
  opacity: 0.85;
}
.ic-err { color: #dc2626; font-weight: 600; }
.ic-actions {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
.ic-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 8px 14px;
  border-radius: 999px;
  background: #2563eb;
  color: #fff !important;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none !important;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s ease, opacity 0.12s ease;
}
.ic-btn:hover { background: #1d4ed8; }
.ic-btn.ghost {
  background: transparent;
  color: var(--text-dim) !important;
  border: 1px solid var(--border);
}
.ic-btn.ghost:hover {
  border-color: var(--accent);
  color: var(--accent) !important;
  background: transparent;
}
.ic-btn.disabled {
  background: var(--surface-alt, #e2e8f0);
  color: var(--text-muted) !important;
  cursor: default;
  pointer-events: none;
}
.intel-job-panel.clean-panel {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface-alt, #f8fafc);
  border: 1px solid var(--border);
}
.intel-job-panel.clean-panel .intel-job-list {
  max-height: 320px;
  gap: 6px;
}
.intel-job-panel.clean-panel .intel-job-list li {
  padding: 8px 10px;
  border-radius: 8px;
}
.intel-job-panel.clean-panel .intel-job-preview { display: none; }

@media (max-width: 720px) {
  .intel-card.clean {
    flex-wrap: wrap;
    padding: 12px 14px;
  }
  .ic-actions {
    width: 100%;
    justify-content: flex-end;
  }
}
.intel-card-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 17px;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}
/* Unique cards: green ONLY when verified; everything else neutral (incl. bad ATS) */
.intel-card-avatar.verified {
  background: #0d9488;
  box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.22);
}
.intel-card-avatar.neutral {
  background: #94a3b8;
}
.intel-card-avatar.tone-0 { background: #0d9488; }
.intel-card-avatar.tone-1 { background: #2563eb; }
.intel-card-avatar.tone-2 { background: #dc2626; }
.intel-card-avatar.tone-3 { background: #7c3aed; }
.intel-card-avatar.tone-4 { background: #ea580c; }
.intel-card-avatar.tone-5 { background: #0891b2; }

.intel-card-body { flex: 1; min-width: 0; }
.intel-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 4px;
}
.intel-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.10);
  color: #1d4ed8;
  white-space: nowrap;
}
.intel-badge.accent {
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
}
.intel-badge.muted {
  background: rgba(100, 116, 139, 0.12);
  color: #475569;
}
.intel-badge.remote {
  background: rgba(16, 185, 129, 0.14);
  color: #047857;
}
.intel-badge.reloc {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: min(100%, 320px);
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
  border: 1px solid rgba(37, 99, 235, 0.28);
  font-weight: 650;
  font-size: 11.5px;
  padding: 3px 10px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
}
.intel-badge.reloc.is-remote {
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
  border-color: rgba(16, 185, 129, 0.3);
}
.intel-visa-icon {
  flex-shrink: 0;
  font-size: 11px;
  line-height: 1;
}
.intel-badge.monitored {
  background: rgba(16, 185, 129, 0.16);
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.35);
}
.intel-badge.mon-error {
  background: rgba(220, 38, 38, 0.12);
  color: #b91c1c;
  border: 1px solid rgba(220, 38, 38, 0.35);
}
.intel-badge.new-jobs {
  background: rgba(34, 197, 94, 0.18);
  color: #15803d;
  font-weight: 700;
}
.intel-badge.jobs-fetched {
  background: rgba(37, 99, 235, 0.14);
  color: #1d4ed8;
  font-weight: 700;
  border: 1px solid rgba(37, 99, 235, 0.28);
}

/* NordVPN status bar on Company Intel */
.nord-vpn-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
}
.nord-vpn-bar.connected {
  border-color: color-mix(in srgb, #4687ff 45%, var(--border));
  background: color-mix(in srgb, #4687ff 8%, var(--surface));
}
.nord-vpn-bar.direct {
  border-color: color-mix(in srgb, #f59e0b 35%, var(--border));
}
.nord-vpn-bar.unknown {
  border-color: color-mix(in srgb, #94a3b8 40%, var(--border));
}
.nord-vpn-dot.maybe {
  background: #94a3b8;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.25);
}
.nord-vpn-left {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  min-width: 0;
  flex: 1;
}
.nord-vpn-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-top: 4px;
  flex-shrink: 0;
}
.nord-vpn-dot.on {
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25);
}
.nord-vpn-dot.off {
  background: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}
.nord-vpn-title {
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
}
.nord-vpn-meta {
  font-size: 12px;
  margin-top: 2px;
  line-height: 1.4;
  word-break: break-word;
}
.nord-vpn-meta b { color: var(--text); font-variant-numeric: tabular-nums; }
.nord-vpn-hint {
  font-size: 11px;
  margin-top: 6px;
  max-width: 720px;
  line-height: 1.35;
}
.nord-vpn-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
/* On wide Company pages the main column leaves a right rail, matching System Health. */
@media (min-width: 1560px) {
  .nord-vpn-board {
    position: fixed;
    top: 96px;
    right: 24px;
    width: 250px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    display: block;
    margin: 0;
    padding: 14px 16px;
    box-shadow: var(--shadow-md);
    z-index: 50;
  }
  .nord-vpn-board .nord-vpn-left {
    width: 100%;
  }
  .nord-vpn-board .nord-vpn-actions {
    margin-top: 12px;
    align-items: stretch;
  }
  .nord-vpn-board .nord-vpn-actions .btn {
    flex: 1 1 105px;
  }
}
.intel-jobs-fetched-num {
  color: #1d4ed8;
  font-variant-numeric: tabular-nums;
}
.intel-card-job-count {
  font-size: 12px;
  font-weight: 700;
  color: #1d4ed8;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.intel-card.is-monitored {
  border-color: color-mix(in srgb, #10b981 40%, var(--border));
}
.intel-card.has-new-jobs {
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.25), 0 4px 14px rgba(15, 23, 42, 0.06);
}
.intel-card-avatar.monitored {
  position: relative;
}
.intel-monitor-dot {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid var(--surface, #fff);
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.4);
}
.intel-new-jobs-text { color: #15803d; }
.intel-mon-err { color: #dc2626; font-weight: 600; }
.intel-card-board-link {
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.intel-card-board-link:hover { text-decoration: underline; }
.intel-job-panel {
  margin-top: 12px;
  padding: 12px;
  border-radius: 12px;
  background: var(--surface-alt, #f8fafc);
  border: 1px solid var(--border);
}
.intel-job-panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
  font-size: 13px;
}
.intel-job-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 420px;
  overflow: auto;
}
.intel-job-list li {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface, #fff);
  border: 1px solid var(--border);
}
.intel-job-list li.is-new {
  border-color: rgba(34, 197, 94, 0.45);
  background: color-mix(in srgb, #22c55e 6%, var(--surface, #fff));
}
.intel-job-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 13px;
  flex-wrap: wrap;
}
.intel-job-title-row a {
  color: var(--text);
  text-decoration: none;
}
.intel-job-title-row a:hover { color: var(--accent); text-decoration: underline; }
.intel-job-new {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 1px 6px;
  border-radius: 4px;
  background: #22c55e;
  color: #fff;
}
.intel-job-meta {
  font-size: 12px;
  margin-top: 2px;
}
.intel-job-preview {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.intel-job-links {
  display: flex;
  gap: 12px;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
}
.intel-job-links a { color: var(--accent); text-decoration: none; }
.intel-job-links a:hover { text-decoration: underline; }
.intel-card-title {
  margin: 2px 0 4px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
  word-break: break-word;
}
.intel-card-meta {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.35;
}
.intel-card-meta b { color: var(--text); font-weight: 600; }
.intel-card-inline-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.intel-card-inline-link:hover { text-decoration: underline; }

.intel-card-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.intel-chip {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 8px;
  background: var(--surface-alt, #f8fafc);
  border: 1px solid var(--border);
  color: var(--text-dim);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.intel-chip.link {
  color: #334155;
  text-decoration: none;
  cursor: pointer;
}
.intel-chip.link:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.intel-chip.muted { opacity: 0.75; font-style: italic; }

.intel-card-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
  padding-top: 2px;
}
.intel-card.gm .intel-card-actions {
  gap: 10px;
}
.intel-card-apply {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 88px;
  padding: 8px 16px;
  border-radius: 999px;
  background: #2563eb;
  color: #fff !important;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none !important;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.intel-card-apply:hover { background: #1d4ed8; }
.intel-card-apply.ghost {
  background: transparent;
  color: var(--text-dim) !important;
  border: 1px solid var(--border);
}
.intel-card-apply.ghost:hover {
  border-color: var(--accent);
  color: var(--accent) !important;
  background: transparent;
}
.intel-card-apply.disabled {
  background: var(--surface-alt, #e2e8f0);
  color: var(--text-muted) !important;
  cursor: default;
  pointer-events: none;
}
.intel-card-when {
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
}

/* YC Work at a Startup directory */
.yc-toolbar, .yc-actions, .yc-search-row, .yc-founder-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.yc-toolbar { justify-content: space-between; }
.yc-toolbar h2 { margin: 0 0 3px; }
.yc-toolbar p { margin: 0; }
.yc-search-row { margin: 8px 0 12px; flex-wrap: nowrap; }
.yc-search-row .intel-search { flex: 1; margin: 0; }
.yc-status {
  margin: 8px 0 12px;
  padding: 9px 12px;
  border: 1px solid rgba(37, 99, 235, .25);
  border-radius: 10px;
  background: rgba(37, 99, 235, .07);
  color: #1d4ed8;
  font-size: 12px;
}
.yc-status.error { color: #b91c1c; border-color: rgba(220,38,38,.28); background: rgba(220,38,38,.07); }
.yc-empty { min-height: 260px; }
.yc-card { align-items: flex-start; }
.yc-logo {
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  padding: 4px;
}
.yc-card .intel-card-title a { color: inherit; text-decoration: none; }
.yc-card .intel-card-title a:hover { color: var(--accent); text-decoration: underline; }
.yc-founder-row { margin-top: 10px; align-items: stretch; }
.yc-founder {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  min-width: 210px;
  max-width: 420px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--surface-alt, #f8fafc);
  border: 1px solid var(--border);
  font-size: 12px;
}
.yc-founder img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.yc-founder a { color: var(--accent); text-decoration: none; font-size: 11px; }
.yc-founder p, .yc-about { margin: 5px 0 0; line-height: 1.4; color: var(--text-dim); }
.yc-about { font-size: 12px; }
.yc-job-list { margin-top: 12px; max-height: 520px; }
@media (max-width: 760px) {
  .yc-search-row { align-items: stretch; flex-direction: column; }
  .yc-search-row .intel-view-toggle { margin-left: 0; align-self: flex-end; }
  .yc-card { flex-wrap: wrap; }
  .yc-card .intel-card-actions { width: 100%; flex-direction: row; justify-content: flex-end; }
}

/* legacy table classes kept for any other screens */
.intel-table-wrap {
  overflow: auto; max-height: 70vh;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.intel-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.intel-table thead th {
  position: sticky; top: 0; z-index: 1; text-align: left; white-space: nowrap;
  padding: 9px 10px; font-weight: 600; color: var(--text-muted);
  background: var(--surface-alt); border-bottom: 1px solid var(--border-strong);
}
.intel-table td { padding: 7px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.intel-table tbody tr:hover { background: var(--surface-alt); }
.intel-co { font-weight: 600; white-space: nowrap; }
.intel-hq { max-width: 170px; font-size: 11px; color: var(--text-dim); }
.intel-table a { color: var(--accent); }

@media (max-width: 720px) {
  .intel-card {
    flex-wrap: wrap;
    padding: 14px;
  }
  .intel-card-actions {
    width: 100%;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding-top: 4px;
  }
}

/* ── Bounced-email indicators (Sent Mails) ─────────────────────────────────── */
/* Email origin badges (GetProspect / learned pattern / guess) */
.sent-origin {
  display: inline-flex; align-items: center; gap: 2px;
  font-size: 10px; font-weight: 600; padding: 1px 7px; border-radius: 999px;
  white-space: nowrap; margin-left: 4px;
}
.sent-origin.origin-gp { background: rgba(124, 58, 237, 0.14); color: #7c3aed; }
.sent-origin.origin-learned { background: rgba(16, 185, 129, 0.14); color: #059669; }
.sent-origin.origin-guess { background: rgba(107, 114, 128, 0.14); color: #6b7280; }
.sent-origin.origin-sheet { background: rgba(37, 99, 235, 0.12); color: #2563eb; }
.sent-origin.origin-you { background: rgba(37, 99, 235, 0.10); color: #2563eb; }
.sent-origin.origin-unknown { background: rgba(120, 120, 120, 0.12); color: var(--text-muted); }

/* Bounce correction line under sent row */
.sent-correction {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px;
  margin: 2px 0 2px 28px; padding: 5px 10px; border-radius: 6px;
  background: rgba(16, 185, 129, 0.08); border: 1px solid rgba(16, 185, 129, 0.25);
  font-size: 12px;
}
.sent-correction.pending {
  background: rgba(245, 158, 11, 0.08); border-color: rgba(245, 158, 11, 0.3);
}
.sent-correction-label {
  font-weight: 700; font-size: 10px; text-transform: uppercase; letter-spacing: 0.03em;
  color: #059669;
}
.sent-correction.pending .sent-correction-label { color: #d97706; }
.sent-correction-email {
  font-weight: 600; color: #059669; text-decoration: none;
}
.sent-correction-email:hover { text-decoration: underline; }
.sent-correction-src, .sent-correction-failed { font-size: 11px; }
.sent-row.is-bounced { border-color: rgba(220, 38, 38, 0.35); }

/* Bounce corrections panel below sent list */
.bounce-details-panel {
  margin-top: 16px; padding: 12px 14px; border-radius: 10px;
  border: 1px solid rgba(220, 38, 38, 0.28); background: rgba(220, 38, 38, 0.04);
}
.bounce-details-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 10px; gap: 12px;
}
.bounce-details-title { font-weight: 700; font-size: 13px; color: #dc2626; }
.bounce-details-table { display: flex; flex-direction: column; gap: 8px; }
.bounce-details-row {
  padding: 8px 10px; border-radius: 8px; background: var(--card, rgba(255,255,255,0.04));
  border: 1px solid var(--border, rgba(120,120,120,0.2));
}
.bounce-details-who { font-size: 13px; margin-bottom: 4px; }
.bounce-details-emails {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 8px; font-size: 12px;
}
.bounce-bad { color: #dc2626; text-decoration: line-through; opacity: 0.9; }
.bounce-bad em, .bounce-good em { font-style: normal; opacity: 0.75; font-size: 11px; }
.bounce-arrow { color: var(--text-muted); font-weight: 700; }
.bounce-good { color: #059669; font-weight: 600; text-decoration: none; }
.bounce-good:hover { text-decoration: underline; }
.bounce-details-pref { font-size: 11px; margin-top: 4px; }

.sent-bounced-badge {
  margin-left: 8px; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600;
  background: var(--danger-soft); color: var(--danger);
}
.sent-bounced {
  margin-left: 8px; font-size: 11px; font-weight: 600; color: var(--danger);
  background: var(--danger-soft); padding: 1px 7px; border-radius: 999px; white-space: nowrap;
}
.sent-row:has(.sent-bounced) { background: rgba(220,38,38,0.04); }

/* "already emailed N× before" — prior-contact signal on Sent rows + Draft cards */
.prior-sent-badge {
  margin-left: 8px; font-size: 11px; font-weight: 600; white-space: nowrap;
  padding: 1px 7px; border-radius: 999px;
  background: var(--warning-soft, rgba(217,119,6,0.12)); color: var(--warning, #b45309);
}

/* ==========================================================================
   Mobile / phone layout (Tailscale phone access)
   ========================================================================== */

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  overflow-x: hidden;
}

/* Comfortable tap targets */
button, .btn, .page-nav-btn, select, a {
  touch-action: manipulation;
}

.topbar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* Horizontal scroll tabs — works on phone without hamburger complexity */
.page-nav {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  flex-wrap: nowrap;
  gap: 2px;
}
.page-nav-btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

/* Tables / wide lists */
.sheet-table-wrap,
.intel-table-wrap,
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

@media (max-width: 720px) {
  .app {
    max-width: 100%;
    padding: 12px 12px 96px;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
    padding-bottom: 12px;
    margin-bottom: 16px;
    gap: 10px;
  }

  .brand {
    gap: 10px;
  }

  .logo {
    width: 36px;
    height: 36px;
    font-size: 16px;
    flex-shrink: 0;
  }

  h1 {
    font-size: 18px;
  }

  .brand .muted {
    font-size: 12px;
  }

  .topbar-actions {
    width: 100%;
    justify-content: stretch;
  }

  .topbar-actions .btn {
    flex: 1 1 auto;
    min-height: 40px;
    padding: 8px 10px;
    font-size: 12px;
    justify-content: center;
  }

  /* Hide ChatGPT/OpenAI token panel on mobile — desktop topbar only */
  .oa-usage,
  .topbar-actions .oa-usage {
    display: none !important;
  }

  .page-nav {
    margin-bottom: 16px;
    padding-bottom: 0;
  }

  .page-nav-btn {
    padding: 10px 12px;
    font-size: 13px;
    min-height: 44px;
  }

  .page-nav-btn .nav-icon {
    font-size: 15px;
  }

  .card {
    padding: 16px;
  }

  .card-head {
    flex-direction: column;
    align-items: stretch;
  }

  .grid {
    gap: 12px;
    margin-bottom: 20px;
  }

  /* Bot action rows stack */
  .bot .actions,
  .bot-actions,
  .card .btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .bot .actions .btn,
  .bot-actions .btn {
    flex: 1 1 calc(50% - 8px);
    min-height: 40px;
  }

  /* Mail page */
  .mail-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .mail-actions {
    flex-wrap: wrap;
    width: 100%;
  }

  .mail-actions .btn,
  .mail-actions select {
    flex: 1 1 auto;
    min-height: 40px;
  }

  .sent-main,
  .sent-co {
    min-width: 0 !important;
    flex: 1 1 100% !important;
  }

  .sent-row {
    flex-wrap: wrap;
    gap: 6px;
  }

  /* Grok chat */
  .grok-chat-page,
  .grok-chat {
    max-width: 100%;
  }

  .grok-chat-messages {
    max-height: min(55vh, 420px);
  }

  .grok-chat-compose {
    flex-wrap: wrap;
  }

  .grok-chat-compose textarea,
  .grok-chat-input {
    width: 100%;
    min-height: 72px;
  }

  /* Monitor */
  .mon-page,
  .mon-page-card {
    max-width: 100%;
  }

  .mon-bot-list li {
    flex-wrap: wrap;
  }

  /* Company intel / email finder */
  .intel-filters,
  .ef-filters,
  .email-finder-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .intel-filters input,
  .ef-filters input,
  .tg-input {
    min-width: 0 !important;
    width: 100%;
  }

  .uf-bar { padding: 8px; }
  .uf-search-row { flex-wrap: wrap; }
  .uf-result { width: 100%; }
  .uf-trigger { min-width: 96px; padding: 6px 22px 6px 8px; }
  .uf-panel { min-width: 220px; }

  /* Forms & inputs */
  input[type="text"],
  input[type="email"],
  input[type="number"],
  input[type="search"],
  select,
  textarea {
    max-width: 100%;
    font-size: 16px; /* prevents iOS zoom-on-focus */
  }

  /* Health board full width on phone */
  .health-board {
    position: static !important;
    width: auto !important;
    max-height: none !important;
    margin: 0 0 16px;
  }

  /* Salary map chrome on mobile */
  .app.app--salary-map .topbar {
    padding: 8px 10px;
  }

  .app.app--salary-map .page-nav {
    padding: 0 8px;
  }

  .app.app--salary-map h1 {
    font-size: 16px;
  }

  .app.app--salary-map .topbar-actions .btn {
    font-size: 11px;
    padding: 6px 8px;
    min-height: 36px;
  }

  .app.app--salary-map .oa-usage {
    display: none; /* reclaim header space on map tab */
  }
}

@media (max-width: 480px) {
  .app {
    padding: 10px 10px 88px;
  }

  h1 { font-size: 16px; }
  h2 { font-size: 15px; }

  .page-nav-btn {
    padding: 10px 10px;
    font-size: 12px;
    gap: 5px;
  }

  /* Icon-first nav labels: keep short text */
  .page-nav-btn {
    max-width: none;
  }

  .topbar-actions .btn {
    font-size: 11px;
    padding: 8px 6px;
  }

  .stats-row,
  .stats-grid {
    grid-template-columns: 1fr !important;
  }

  .big-stat {
    border-right: none !important;
    padding-right: 0 !important;
  }
}

/* Safe area for notched phones */
@supports (padding: env(safe-area-inset-bottom)) {
  .app {
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
    padding-bottom: max(80px, calc(24px + env(safe-area-inset-bottom)));
  }
  .app.app--salary-map {
    padding: 0;
  }
}

/* ==========================================================================
   ALL PAGES — mobile polish (Dashboard, Mail, Map, Email Finder, Company,
   Chat, Monitor). Complements the base mobile block above.
   ========================================================================== */

@media (max-width: 720px) {
  /* ---- Dashboard: bot counters, schedules, sheet ---- */
  .counters {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px;
  }
  .counter {
    padding: 8px 6px;
    text-align: center;
  }
  .counter .num { font-size: 16px; }
  .counter .lbl { font-size: 10px; }

  .sched-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .sched-actions {
    flex-wrap: wrap;
  }
  .sched-actions .btn {
    flex: 1 1 auto;
    min-height: 40px;
  }

  .sheet-search {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .sheet-search input {
    width: 100%;
    font-size: 16px;
  }
  .sheet-search-count {
    white-space: normal;
  }
  .sheet-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .sheet-tabs .tab {
    flex: 0 0 auto;
    min-height: 40px;
  }
  .sheet-table-wrap {
    max-height: 55vh;
    -webkit-overflow-scrolling: touch;
  }
  .sheet-table {
    font-size: 12px;
    min-width: 640px; /* scroll horizontally instead of crushing columns */
  }
  .sheet-table tbody td {
    max-width: 200px;
  }

  .title-row {
    flex-wrap: wrap;
  }
  .np-form {
    padding: 12px;
  }
  .np-form-actions {
    flex-wrap: wrap;
  }
  .np-form-actions .btn {
    flex: 1 1 auto;
    min-height: 40px;
  }

  /* ---- Mail ---- */
  .mail-stats {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px;
  }
  .mail-stat-card {
    padding: 12px 10px;
  }
  .mail-stat-num {
    font-size: 22px;
  }
  .mail-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .mail-filter-pill {
    flex: 0 0 auto;
    min-height: 36px;
  }
  .mail-card-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .mail-card-actions {
    flex-wrap: wrap;
    gap: 6px;
  }
  .mail-card-actions .btn,
  .mail-open-link {
    min-height: 36px;
  }
  .sent-main {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    min-width: 0 !important;
  }
  .sent-co {
    min-width: 0 !important;
    flex: 1 1 auto !important;
  }
  .sent-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .sent-side {
    margin-left: 0;
    flex-wrap: wrap;
  }
  .mail-accounts-head {
    min-height: 44px;
  }
  .mail-account-row {
    flex-wrap: wrap;
  }
  .reply-item {
    word-break: break-word;
  }
  .draft-card {
    padding: 12px;
  }
  .draft-email {
    word-break: break-all;
  }

  /* ---- Email Finder ---- */
  .ef-row {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 12px;
  }
  .ef-head {
    display: none; /* header row meaningless in stacked card layout */
  }
  .ef-row > * {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .ef-mail {
    white-space: normal;
    word-break: break-all;
  }
  .ef-table {
    overflow: visible;
  }
  .ef-gen-form {
    flex-direction: column;
  }
  .ef-gen-form input {
    flex: 1 1 auto;
    width: 100%;
    font-size: 16px;
  }
  .ef-gen-form .btn {
    width: 100%;
    min-height: 44px;
  }
  .ef-gen-bestmail {
    font-size: 14px;
    word-break: break-all;
  }
  .ef-search {
    font-size: 16px;
  }

  /* ---- Company Intel ---- */
  .intel-search {
    width: 100%;
    font-size: 16px;
    margin-bottom: 10px;
  }
  .intel-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
  }
  .intel-table {
    min-width: 560px;
    font-size: 12px;
  }
  .intel-hq {
    max-width: 120px;
  }

  /* ---- Chat LLM ---- */
  .grok-chat-page {
    padding: 0;
  }
  .grok-chat-shell {
    border-radius: var(--radius);
    max-height: none;
  }
  .grok-chat-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px;
  }
  .grok-chat-header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
  }
  .grok-model-select {
    flex: 1 1 auto;
    min-height: 40px;
    font-size: 16px;
  }
  .grok-chat-header-actions .btn {
    flex: 1 1 auto;
    min-height: 40px;
  }
  .grok-chat-messages {
    max-height: min(50dvh, 400px);
    padding: 12px;
    -webkit-overflow-scrolling: touch;
  }
  .grok-msg-body {
    word-break: break-word;
    overflow-wrap: anywhere;
  }
  .grok-chat-composer {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  }
  .grok-chat-input {
    width: 100%;
    min-height: 72px;
    font-size: 16px;
  }
  .grok-send {
    width: 100%;
    min-height: 44px;
  }
  .grok-chat-suggestions {
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 12px 8px;
  }
  .grok-chip {
    min-height: 36px;
  }

  /* ---- Monitor ---- */
  .mon-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  .mon-tab {
    flex: 0 0 auto;
    min-height: 40px;
    white-space: nowrap;
  }
  .mon-range-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .mon-days {
    flex-wrap: wrap;
  }
  .mon-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .mon-table table {
    min-width: 480px;
  }
  .monitor-page .mon-table .mono-path {
    max-width: 160px;
  }
  .mon-trace-list--tall {
    max-height: 280px;
  }
  .mon-bot-list li {
    gap: 6px;
  }
  .mon-bot-name {
    flex: 1 1 100%;
  }
  .mon-chart {
    min-height: 100px;
    overflow-x: auto;
  }
  .mon-chart-svg {
    min-width: 280px;
  }

  /* ---- Shared toast / banners ---- */
  .toast {
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    max-width: none;
    width: auto;
    transform: none;
  }
}

@media (max-width: 480px) {
  .mail-stats {
    grid-template-columns: 1fr 1fr !important;
  }
  .ef-kpis {
    grid-template-columns: 1fr 1fr;
  }
  .ef-num {
    font-size: 20px;
  }
  .counters {
    grid-template-columns: 1fr 1fr 1fr;
  }
  /* Hide long nav text on tiny phones — icon + short label already in markup */
  .page-nav-btn .nav-label {
    max-width: 5.5em;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* ==========================================================================
   Native mobile shell — Apple HIG-inspired (pure CSS, zero UI kits)
   Bottom tab bar + frosted chrome. Desktop keeps segmented top nav.
   ========================================================================== */

@media (max-width: 720px) {
  .app {
    max-width: 100%;
    padding: 12px 14px calc(var(--tabbar-h) + 28px + env(safe-area-inset-bottom, 0px));
  }

  /* Frosted top app bar */
  .topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    margin: -12px -14px 14px;
    padding: 12px 14px calc(10px + env(safe-area-inset-top, 0px));
    padding-top: max(12px, env(safe-area-inset-top, 0px));
    background: rgba(242, 242, 247, 0.82);
    -webkit-backdrop-filter: var(--blur);
    backdrop-filter: var(--blur);
    border-bottom: var(--hairline);
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
  }

  .brand .muted { display: none; } /* cleaner native header */
  h1 { font-size: 20px; font-weight: 700; letter-spacing: -0.03em; }
  .logo {
    width: 34px;
    height: 34px;
    font-size: 14px;
    border-radius: 10px;
  }

  .topbar-actions {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: stretch;
  }
  /* ChatGPT/OpenAI 4o mini token panel — removed from mobile view */
  .topbar-actions .oa-usage {
    display: none !important;
  }
  .topbar-actions .btn {
    flex: 1 1 auto;
    min-height: 40px;
    border-radius: var(--radius-pill);
    font-size: 14px;
    font-weight: 650;
  }
  .topbar-actions .btn.ghost {
    min-width: 44px;
    padding-left: 12px;
    padding-right: 12px;
  }

  /* Bottom tab bar (native app) */
  .page-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    margin: 0;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
    height: auto;
    min-height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
    border-radius: 0;
    border-top: var(--hairline);
    border-bottom: none;
    background: color-mix(in srgb, var(--surface) 86%, transparent);
    -webkit-backdrop-filter: var(--blur);
    backdrop-filter: var(--blur);
    display: flex;
    justify-content: space-around;
    align-items: stretch;
    gap: 0;
    overflow-x: auto;
    overflow-y: hidden;
    box-shadow: 0 -8px 24px rgba(0,0,0,0.04);
  }

  .page-nav-btn {
    flex: 1 1 0;
    min-width: 48px;
    max-width: 88px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2px;
    padding: 6px 4px 4px;
    margin: 0;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text-muted);
    background: transparent !important;
    box-shadow: none !important;
  }
  .page-nav-btn:hover {
    background: transparent !important;
    color: var(--text);
  }
  .page-nav-btn.active {
    color: var(--accent);
    background: transparent !important;
    box-shadow: none !important;
  }
  .page-nav-btn .nav-icon {
    font-size: 20px;
    line-height: 1.1;
    display: block;
  }
  .page-nav-btn .nav-label {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 10px;
    line-height: 1.15;
  }

  /* Cards — grouped list aesthetic */
  .card {
    border: none;
    border-radius: 16px;
    padding: 16px;
    box-shadow: none;
    background: var(--surface);
  }
  .grid {
    gap: 12px;
    margin-bottom: 18px;
  }

  /* Stats */
  .big-num {
    font-size: 44px;
    background: none;
    -webkit-text-fill-color: var(--text);
    color: var(--text);
  }
  .stat-block {
    border: none;
    background: var(--bg);
    border-radius: 12px;
  }

  /* Buttons denser, pill */
  .actions {
    gap: 8px;
    flex-wrap: wrap;
  }
  .actions .btn {
    flex: 1 1 calc(50% - 8px);
    min-height: 42px;
  }

  /* Mail / lists */
  .mail-stat-card {
    border-radius: 14px;
    border: none;
    background: var(--surface);
    box-shadow: none;
  }
  .mail-cards .mail-card,
  .mail-card {
    border-radius: 14px;
    border: none;
    background: var(--surface);
  }
  .sent-row,
  .reply-item,
  .draft-card {
    border-radius: 14px;
    border: none;
    background: var(--surface);
  }

  /* Tables as inset groups */
  .sheet-table-wrap,
  .ef-table,
  .intel-table-wrap {
    border: none;
    border-radius: 14px;
    overflow: hidden;
    background: var(--surface);
  }

  /* Chat */
  .grok-chat-shell {
    border: none;
    border-radius: 16px;
    overflow: hidden;
    background: var(--surface);
    box-shadow: none;
  }
  .grok-send {
    border-radius: var(--radius-pill);
    background: var(--accent);
    color: #fff;
    border: none;
  }

  /* Health board */
  .health-board {
    border: none;
    border-radius: 16px;
    background: var(--surface);
    box-shadow: none;
  }

  /* Toast — floating native banner */
  .toast {
    border-radius: 14px;
    left: 16px;
    right: 16px;
    bottom: calc(var(--tabbar-h) + 12px + env(safe-area-inset-bottom, 0px));
    box-shadow: var(--shadow-md);
    text-align: center;
    font-weight: 600;
  }

  /* Salary map: minimal floating chrome so the map is the hero */
  .app.app--salary-map {
    padding: 0;
  }
  .app.app--salary-map .topbar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    margin: 0;
    padding: 6px 10px;
    padding-top: max(6px, env(safe-area-inset-top, 0px));
    background: linear-gradient(180deg, rgba(11, 13, 18, 0.72), rgba(11, 13, 18, 0));
    border-bottom: none;
    z-index: 40;
    pointer-events: none;
  }
  .app.app--salary-map .topbar .brand,
  .app.app--salary-map .topbar .topbar-actions {
    pointer-events: auto;
  }
  .app.app--salary-map .page-nav {
    /* still bottom */
  }
  .app.app--salary-map .salary-map-wrap.is-visible {
    /* full-bleed under chrome */
    top: 0;
    bottom: 0;
  }
  .app.app--salary-map .topbar-actions .oa-usage { display: none; }
  .app.app--salary-map .brand .muted { display: none; }
  .app.app--salary-map h1 {
    font-size: 14px;
    color: #eef3f8;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
  }
  .app.app--salary-map .logo {
    width: 26px;
    height: 26px;
    font-size: 11px;
    border-radius: 8px;
  }
  .app.app--salary-map .topbar-actions {
    width: auto;
    display: flex;
    grid-template-columns: none;
    gap: 6px;
  }
  .app.app--salary-map .topbar-actions .btn {
    min-height: 30px;
    font-size: 11px;
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(28, 28, 30, 0.78);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 0.5px solid rgba(255, 255, 255, 0.12);
    color: #eef3f8;
  }
}

/* Desktop polish: keep segmented control nav, soft page bg */
@media (min-width: 721px) {
  .app {
    padding-top: 28px;
  }
  .card {
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: box-shadow 180ms var(--ease);
  }
  .page-nav {
    display: inline-flex;
    width: auto;
    max-width: 100%;
  }
}

button:focus:not(:focus-visible) { outline: none; }

/* ==========================================================================
   Mobile Grok Build TUI — black & white only (no purple / cyan / accent hues)
   Full-viewport fit (no size break).
   ========================================================================== */

.mcli-fab,
.gb-overlay {
  display: none;
}

@media (max-width: 720px) {
  /* Strict monochrome: black / white / gray only */
  .gb-tui,
  .mcli-fab {
    --gb-bg: #000000;
    --gb-bg-elevated: #111111;
    --gb-bg-card: #1c1c1c;
    --gb-bg-hover: #262626;
    --gb-border: #2a2a2a;
    --gb-border-strong: #3d3d3d;
    --gb-text: #ffffff;
    --gb-text-2: #e0e0e0;
    --gb-muted: #9a9a9a;
    --gb-dim: #6e6e6e;
    --gb-heading: #ffffff;       /* white headings — no purple */
    --gb-link: #ffffff;          /* white links (underlined) */
    --gb-bold: #ffffff;
    --gb-code-bg: #141414;
    --gb-prompt-border: #404040;
    --gb-prompt-focus: #808080;
    --gb-error: #ffffff;
    --gb-success: #e0e0e0;
    --gb-running: #c0c0c0;
    --gb-tool: #d0d0d0;
    --gb-thinking: #a0a0a0;
    --gb-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
    --gb-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  }

  /* JobBot logo — kill blue/purple gradient on mobile */
  .logo {
    background: #000000 !important;
    background-image: none !important;
    color: #ffffff !important;
    box-shadow: none !important;
  }
  .brand h1,
  .brand .muted {
    color: #111111;
  }

  /* FAB (mobile chat entry) — pure black & white, no gradients */
  .mcli-fab {
    display: flex !important;
    position: fixed;
    right: 14px;
    bottom: calc(var(--tabbar-h, 56px) + 14px + env(safe-area-inset-bottom, 0px));
    z-index: 110;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 14px 0 12px;
    border: 1px solid #555555 !important;
    border-radius: 999px;
    background: #000000 !important;
    background-image: none !important;
    color: #ffffff !important;
    font-family: var(--gb-sans);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: -0.01em;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55) !important;
    -webkit-tap-highlight-color: transparent;
  }
  .mcli-fab:active { transform: scale(0.97); background: #1a1a1a !important; }
  .mcli-fab-icon,
  .mcli-fab .mcli-fab-icon {
    width: 22px !important;
    height: 22px !important;
    border-radius: 6px !important;
    background: #000000 !important;
    background-image: none !important;
    border: 1px solid #666666 !important;
    color: #ffffff !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    font-size: 12px !important;
    font-weight: 700;
  }
  .mcli-fab-label { color: #ffffff !important; }
  .mcli-fab-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #666666 !important;
    box-shadow: none !important;
    flex-shrink: 0;
  }
  .mcli-fab-dot--ok { background: #ffffff !important; }
  .mcli-fab-dot--run {
    background: #ffffff !important;
    animation: gb-pulse 1.1s ease-in-out infinite;
  }
  .mcli-fab-dot--warn { background: #b0b0b0 !important; }
  .mcli-fab-dot--err { background: #555555 !important; outline: 1px solid #fff; }
  .mcli-fab-dot--idle { background: #666666 !important; }
  .mcli-fab--run { border-color: #888 !important; }
  .mcli-fab--err { border-color: #777 !important; }
  .mcli-fab--warn { border-color: #666 !important; }
  @keyframes gb-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
  }

  /* Full-screen shell — JS pins size to visualViewport when keyboard opens */
  .gb-overlay {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 200;
    background: #000000 !important;
    width: 100%;
    max-width: 100vw;
    height: 100%;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
    overscroll-behavior: none;
    /* Avoid iOS rubber-band pushing fixed UI behind keyboard */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
  }
  .gb-tui {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    min-height: 0;
    background: #000000 !important;
    color: #ffffff !important;
    font-family: var(--gb-sans);
    font-size: 14px;
    line-height: 1.45;
    overflow: hidden;
    box-sizing: border-box;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
    /* Nuclear: strip any residual hue inside the chat shell */
    filter: grayscale(1);
  }
  /* Keyboard open: fit inside visual viewport, free vertical space for prompt */
  .gb-overlay.is-kb-open .gb-tui,
  html.gb-kb-open .gb-tui {
    padding-bottom: 0 !important;
  }
  .gb-overlay.is-kb-open .gb-footer,
  html.gb-kb-open .gb-footer,
  .gb-overlay.is-kb-open .gb-prompt-status,
  html.gb-kb-open .gb-prompt-status {
    display: none !important;
  }
  .gb-overlay.is-kb-open .gb-prompt,
  html.gb-kb-open .gb-prompt {
    padding: 4px 10px 6px;
  }
  .gb-overlay.is-kb-open .gb-prompt-border,
  html.gb-kb-open .gb-prompt-border {
    padding: 8px 10px;
  }
  .gb-overlay.is-kb-open .gb-prompt-input,
  html.gb-kb-open .gb-prompt-input {
    max-height: 72px;
  }
  .gb-overlay.is-kb-open .gb-topbar,
  html.gb-kb-open .gb-topbar {
    min-height: 32px;
    padding: 4px 10px;
  }
  .gb-overlay.is-kb-open .gb-done-bar,
  html.gb-kb-open .gb-done-bar {
    padding: 4px 10px;
  }
  .gb-overlay.is-kb-open .gb-autocomplete,
  html.gb-kb-open .gb-autocomplete {
    max-height: 28vh;
  }
  .gb-tui a,
  .gb-tui h1,
  .gb-tui h2,
  .gb-tui h3,
  .gb-tui h4,
  .gb-tui strong,
  .gb-tui code {
    color: #ffffff !important;
  }
  .gb-tui *,
  .gb-tui *::before,
  .gb-tui *::after {
    box-sizing: border-box;
  }

  /* Top bar — matches laptop: path left, tokens right */
  .gb-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-shrink: 0;
    min-height: 36px;
    padding: 6px 12px;
    background: var(--gb-bg);
    border-bottom: 1px solid transparent;
  }
  .gb-topbar-left {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex: 1 1 auto;
  }
  .gb-close {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--gb-muted);
    font-size: 16px;
    line-height: 1;
    padding: 0;
  }
  .gb-close:active { background: var(--gb-bg-hover); color: var(--gb-text); }
  .gb-cwd {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: var(--gb-mono);
    font-size: 12px;
    color: var(--gb-muted);
  }
  .gb-topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
  }
  .gb-tokens {
    font-family: var(--gb-mono);
    font-size: 12px;
    color: var(--gb-muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
  }
  .gb-icon-quiet {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--gb-dim);
    font-size: 14px;
    line-height: 1;
    padding: 0;
  }
  .gb-icon-quiet:active { background: var(--gb-bg-hover); color: var(--gb-text); }
  .gb-icon-quiet.is-on { color: var(--gb-text-2); }

  /* Optional overflow menu (model/effort) — not purple chrome */
  .gb-menu {
    flex-shrink: 0;
    padding: 8px 12px;
    background: var(--gb-bg-elevated);
    border-bottom: 1px solid var(--gb-border);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
  }
  .gb-menu label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--gb-mono);
    font-size: 11px;
    color: var(--gb-muted);
  }
  .gb-menu select {
    background: var(--gb-bg-card);
    color: var(--gb-text);
    border: 1px solid var(--gb-border-strong);
    border-radius: 6px;
    font-family: var(--gb-mono);
    font-size: 11px;
    padding: 4px 6px;
    max-width: 42vw;
  }
  .gb-menu-actions {
    display: flex;
    gap: 6px;
    margin-left: auto;
    flex-wrap: wrap;
  }
  .gb-menu-btn {
    border: 1px solid var(--gb-border-strong);
    background: var(--gb-bg-card);
    color: var(--gb-text-2);
    font-family: var(--gb-mono);
    font-size: 11px;
    padding: 5px 8px;
    border-radius: 6px;
    min-height: 28px;
  }
  .gb-menu-btn:active { background: var(--gb-bg-hover); }
  .gb-menu-btn--danger {
    border-color: #555555;
    color: #ffffff;
  }

  .gb-banner {
    flex-shrink: 0;
    padding: 8px 12px;
    font-size: 12px;
    font-family: var(--gb-mono);
    line-height: 1.35;
  }
  .gb-banner--error {
    background: #1a1a1a;
    color: #ffffff;
    border-bottom: 1px solid #3d3d3d;
  }
  .gb-banner--warn {
    background: #141414;
    color: #c0c0c0;
    border-bottom: 1px solid #2a2a2a;
  }

  /* ── View target toggle (mobile vs web edits) ── */
  .gb-view-toggle {
    flex-shrink: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
    padding: 6px 10px 8px;
    border-bottom: 1px solid #222;
    background: #050505;
  }
  .gb-view-toggle-label {
    font-family: var(--gb-mono);
    font-size: 10px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }
  .gb-view-toggle-seg {
    display: inline-flex;
    border: 1px solid #333;
    border-radius: 8px;
    overflow: hidden;
    background: #111;
  }
  .gb-view-btn {
    border: none;
    border-right: 1px solid #2a2a2a;
    background: transparent;
    color: #999;
    font-family: var(--gb-sans);
    font-size: 12px;
    font-weight: 600;
    padding: 6px 10px;
    line-height: 1.2;
    -webkit-tap-highlight-color: transparent;
  }
  .gb-view-btn:last-child { border-right: none; }
  .gb-view-btn.is-on {
    background: #1c1c1c;
    color: #fff;
  }
  .gb-view-btn:disabled { opacity: 0.45; }
  .gb-view-btn:active:not(:disabled) { background: #262626; }
  .gb-view-toggle-hint {
    flex: 1 1 100%;
    font-family: var(--gb-mono);
    font-size: 10px;
    color: #666;
  }
  .gb-user-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 6px;
  }
  .gb-user-view-tag {
    font-family: var(--gb-mono);
    font-size: 10px;
    color: #bbb;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 2px 6px;
    background: #111;
  }
  .gb-user-view-tag--mobile { color: #ddd; }
  .gb-user-view-tag--web { color: #ccc; }
  .gb-user-view-tag--both { color: #aaa; }

  /* ── Health strip: CLI connected / running / login / model ── */
  .gb-health {
    flex-shrink: 0;
    padding: 6px 10px 8px;
    border-bottom: 1px solid #222;
    background: #0a0a0a;
  }
  .gb-health--ok { border-bottom-color: #333; }
  .gb-health--run { border-bottom-color: #444; }
  .gb-health--warn { border-bottom-color: #3a3a3a; }
  .gb-health--err { border-bottom-color: #555; }
  .gb-health-summary {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    margin-bottom: 6px;
  }
  .gb-health-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    background: #666;
  }
  .gb-health-dot--ok { background: #fff; }
  .gb-health-dot--run {
    background: #fff;
    animation: gb-pulse 1.1s ease-in-out infinite;
  }
  .gb-health-dot--warn { background: #aaa; }
  .gb-health-dot--err { background: #555; box-shadow: 0 0 0 1px #fff; }
  .gb-health-dot--idle { background: #555; }
  .gb-health-label {
    font-family: var(--gb-mono);
    font-size: 12px;
    font-weight: 650;
    color: #fff;
    letter-spacing: -0.01em;
  }
  .gb-health-verdict {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: var(--gb-mono);
    font-size: 11px;
    color: #999;
  }
  .gb-health-refresh {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border: 1px solid #333;
    border-radius: 6px;
    background: #111;
    color: #ccc;
    font-size: 14px;
    line-height: 1;
    padding: 0;
  }
  .gb-health-refresh:active { background: #222; color: #fff; }
  .gb-health-pills {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
  }
  .gb-health-pills::-webkit-scrollbar {
    display: none;
  }
  .gb-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
    padding: 2px 6px;
    border-radius: 999px;
    border: 1px solid #333;
    background: #111;
    color: #bbb;
    font-family: var(--gb-mono);
    font-size: 10px;
    line-height: 1.2;
    white-space: nowrap;
  }
  .gb-pill i {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #555;
    flex-shrink: 0;
  }
  .gb-pill--ok { border-color: #3a3a3a; color: #e8e8e8; }
  .gb-pill--ok i { background: #fff; }
  .gb-pill--run {
    border-color: #555;
    color: #fff;
    background: #1a1a1a;
  }
  .gb-pill--run i {
    background: #fff;
    animation: gb-pulse 1.1s ease-in-out infinite;
  }
  .gb-pill--warn { border-color: #444; color: #ccc; }
  .gb-pill--warn i { background: #aaa; }
  .gb-pill--err { border-color: #666; color: #fff; background: #1c1c1c; }
  .gb-pill--err i { background: #fff; box-shadow: 0 0 0 1px #666; }
  .gb-pill--idle { border-color: #2a2a2a; color: #777; }
  .gb-pill--idle i { background: #444; }
  .gb-health-meta {
    margin-top: 5px;
    font-family: var(--gb-mono);
    font-size: 10px;
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .gb-prompt-health {
    font-weight: 600;
  }
  .gb-prompt-health--ok { color: #e0e0e0; }
  .gb-prompt-health--run { color: #fff; }
  .gb-prompt-health--warn { color: #aaa; }
  .gb-prompt-health--err { color: #fff; }
  .gb-prompt-health--idle { color: #777; }

  /* Scrollback */
  .gb-scrollback {
    flex: 1 1 0;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 8px 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: var(--gb-bg);
    width: 100%;
  }

  .gb-welcome {
    padding: 24px 4px 8px;
  }
  .gb-welcome-health {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 10px 0 12px;
    padding: 8px 10px;
    border: 1px solid #333;
    border-radius: 8px;
    background: #111;
    font-family: var(--gb-mono);
    font-size: 12px;
    color: #ccc;
  }
  .gb-welcome-health--ok { border-color: #3a3a3a; color: #eee; }
  .gb-welcome-health--run { border-color: #555; color: #fff; }
  .gb-welcome-health--warn { border-color: #444; color: #bbb; }
  .gb-welcome-health--err { border-color: #666; color: #fff; }
  .gb-welcome-title {
    font-size: 18px;
    font-weight: 650;
    color: var(--gb-text);
    margin-bottom: 6px;
    letter-spacing: -0.02em;
  }
  .gb-welcome-sub {
    font-size: 13px;
    color: var(--gb-muted);
    line-height: 1.45;
    margin-bottom: 16px;
  }
  .gb-hint {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
    text-align: left;
    border: 1px solid var(--gb-border);
    background: var(--gb-bg-card);
    color: var(--gb-text-2);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 6px;
    font-size: 13px;
    line-height: 1.35;
  }
  .gb-hint:active { background: var(--gb-bg-hover); }
  .gb-hint-prefix {
    color: var(--gb-muted);
    font-family: var(--gb-mono);
    font-weight: 600;
    flex-shrink: 0;
  }

  .gb-turn-agent {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    width: 100%;
  }

  /* USER card — gray block like laptop, NOT purple */
  .gb-user-card {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    background: var(--gb-bg-card);
    border-radius: 8px;
    padding: 10px 12px;
    border: 1px solid transparent;
  }
  .gb-user-prefix {
    color: var(--gb-muted);
    font-family: var(--gb-mono);
    font-weight: 600;
    font-size: 14px;
    line-height: 1.45;
    flex-shrink: 0;
  }
  .gb-user-text {
    flex: 1 1 auto;
    min-width: 0;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
    color: var(--gb-text);
    font-size: 14px;
    line-height: 1.45;
  }
  .gb-user-time {
    flex-shrink: 0;
    font-family: var(--gb-mono);
    font-size: 11px;
    color: var(--gb-dim);
    margin-left: 6px;
    white-space: nowrap;
  }

  /* Assistant markdown — laptop colors */
  .gb-md {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    color: var(--gb-text-2);
    font-size: 14px;
    line-height: 1.55;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  .gb-md p {
    margin: 0 0 0.75em;
  }
  .gb-md p:last-child { margin-bottom: 0; }
  .gb-md h1, .gb-md h2, .gb-md h3, .gb-md h4 {
    color: #ffffff;
    font-weight: 700;
    font-size: 14.5px;
    margin: 0.9em 0 0.4em;
    letter-spacing: -0.01em;
  }
  .gb-md h1:first-child, .gb-md h2:first-child, .gb-md h3:first-child {
    margin-top: 0;
  }
  .gb-md strong, .gb-md b {
    color: var(--gb-bold);
    font-weight: 650;
  }
  .gb-md a {
    color: #ffffff;
    text-decoration: underline;
    text-underline-offset: 2px;
    word-break: break-all;
  }
  .gb-md ul, .gb-md ol {
    margin: 0.4em 0 0.75em;
    padding-left: 1.25em;
  }
  .gb-md li {
    margin: 0.25em 0;
  }
  .gb-md code {
    font-family: var(--gb-mono);
    font-size: 12.5px;
    background: var(--gb-code-bg);
    border: 1px solid var(--gb-border);
    border-radius: 4px;
    padding: 1px 5px;
    color: var(--gb-text);
  }
  .gb-md pre {
    margin: 0.5em 0 0.75em;
    padding: 10px 12px;
    background: var(--gb-code-bg);
    border: 1px solid var(--gb-border);
    border-radius: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }
  .gb-md pre code {
    background: none;
    border: none;
    padding: 0;
    font-size: 12px;
    line-height: 1.4;
    white-space: pre;
  }
  .gb-md table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    margin: 0.6em 0 0.9em;
    font-size: 13px;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .gb-md th, .gb-md td {
    border: 1px solid var(--gb-border-strong);
    padding: 8px 10px;
    text-align: left;
    vertical-align: top;
    min-width: 0;
  }
  .gb-md th {
    color: var(--gb-text);
    font-weight: 650;
    background: transparent;
  }
  .gb-md td {
    color: var(--gb-text-2);
  }
  .gb-md td a { color: #ffffff; }
  .gb-md hr {
    border: none;
    border-top: 1px solid var(--gb-border);
    margin: 0.8em 0;
  }
  .gb-md .gb-worked {
    margin-top: 0.6em;
    font-size: 12px;
    color: var(--gb-dim);
    font-family: var(--gb-mono);
  }

  /* Thinking / tools — muted, no loud purple bars */
  .gb-meta-row {
    font-family: var(--gb-mono);
    font-size: 12px;
    color: var(--gb-thinking);
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .gb-meta-row .gb-bullet { color: var(--gb-thinking); font-size: 10px; }
  .gb-tool-row {
    font-family: var(--gb-mono);
    font-size: 12px;
    color: var(--gb-tool);
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 8px;
  }
  .gb-tool-row .gb-bullet { color: var(--gb-tool); font-size: 10px; }
  .gb-tool-row .gb-tool-status { color: var(--gb-dim); font-size: 11px; }
  .gb-tool-row.is-done { color: var(--gb-success); }
  .gb-tool-row.is-done .gb-bullet { color: var(--gb-success); }
  .gb-pre {
    margin: 6px 0 0;
    font-family: var(--gb-mono);
    font-size: 11.5px;
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
    color: var(--gb-text-2);
    background: var(--gb-code-bg);
    border-radius: 6px;
    padding: 8px 10px;
    max-height: 160px;
    overflow: auto;
    border: 1px solid var(--gb-border);
    max-width: 100%;
  }
  .gb-pre--sm { max-height: 100px; }
  .gb-status-text {
    font-family: var(--gb-mono);
    font-size: 12px;
    color: var(--gb-muted);
    white-space: pre-wrap;
    word-break: break-word;
  }
  .gb-error-text {
    font-family: var(--gb-mono);
    font-size: 12.5px;
    color: var(--gb-error);
    white-space: pre-wrap;
    word-break: break-word;
  }

  .gb-done-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 12px;
    background: #111111;
    border-top: 1px solid #2a2a2a;
    flex-shrink: 0;
  }
  .gb-done-text {
    font-family: var(--gb-mono);
    font-size: 11px;
    color: #e0e0e0;
  }
  .gb-done-bar .gb-menu-btn {
    color: var(--gb-text-2);
    border-color: var(--gb-border-strong);
  }
  /* Green dot when agent edited web UI assets — sticky until page reload */
  .gb-reload-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 7px;
  }
  .gb-reload-btn.has-update {
    color: #e8ffe8;
    border-color: #2d6a2d;
  }
  .gb-reload-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.28);
    flex: 0 0 auto;
    animation: gb-reload-pulse 1.2s ease-in-out infinite;
  }
  @keyframes gb-reload-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.55; transform: scale(0.92); }
  }

  /* Prompt — laptop style gray box */
  .gb-prompt {
    flex-shrink: 0;
    padding: 6px 12px 0;
    background: var(--gb-bg);
    width: 100%;
  }

  /* ── Attach phone screenshots (mobile CLI) ── */
  .gb-file-input-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
    opacity: 0;
    pointer-events: none;
  }
  .gb-attach-panel {
    margin-bottom: 8px;
    border: 1px solid #333;
    border-radius: 10px;
    background: #0e0e0e;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  .gb-attach-help {
    margin: 0;
    padding: 8px 12px 4px;
    font-size: 12px;
    line-height: 1.4;
    color: #999;
  }
  .gb-attach-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px 10px 10px;
  }
  .gb-attach-action {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    width: 100%;
    text-align: left;
    border: 1px solid #333;
    border-radius: 10px;
    background: #141414;
    color: #eee;
    padding: 12px 14px;
  }
  .gb-attach-action:active { background: #1c1c1c; border-color: #555; }
  .gb-attach-action:disabled { opacity: 0.45; }
  .gb-attach-action-icon { font-size: 20px; line-height: 1; }
  .gb-attach-action-label {
    font-size: 14px;
    font-weight: 650;
    color: #fff;
  }
  .gb-attach-action-sub {
    flex-basis: 100%;
    padding-left: 30px;
    font-size: 11px;
    color: #888;
    font-family: var(--gb-mono);
  }
  .gb-attach-chip--img {
    padding-left: 4px;
  }
  .gb-attach-thumb {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    object-fit: cover;
    background: #222;
    flex-shrink: 0;
  }
  .gb-attach-chip.is-uploading { opacity: 0.7; }
  .gb-attach-chip.is-err {
    border-color: #666;
    color: #fff;
  }
  .gb-attach-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-bottom: 1px solid #222;
  }
  .gb-attach-title {
    font-family: var(--gb-mono);
    font-size: 12px;
    font-weight: 650;
    color: #eee;
  }
  .gb-attach-close {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #aaa;
    font-size: 18px;
    line-height: 1;
  }
  .gb-attach-close:active { background: #222; color: #fff; }
  .gb-attach-search {
    margin: 8px 10px 6px;
    padding: 10px 12px;
    border: 1px solid #333;
    border-radius: 8px;
    background: #000;
    color: #fff;
    font-size: 16px; /* no iOS zoom */
    font-family: var(--gb-sans);
    outline: none;
  }
  .gb-attach-search:focus { border-color: #666; }
  .gb-attach-quick {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 10px 8px;
  }
  .gb-attach-chip-btn {
    border: 1px solid #333;
    border-radius: 999px;
    background: #151515;
    color: #ccc;
    font-family: var(--gb-mono);
    font-size: 11px;
    padding: 4px 10px;
  }
  .gb-attach-chip-btn:active { background: #222; color: #fff; }
  .gb-attach-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border-top: 1px solid #1a1a1a;
  }
  .gb-attach-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    text-align: left;
    border: none;
    border-bottom: 1px solid #1a1a1a;
    background: transparent;
    color: #ddd;
    padding: 10px 12px;
    font-size: 12px;
  }
  .gb-attach-row:active,
  .gb-attach-row.is-on {
    background: #1a1a1a;
  }
  .gb-attach-row.is-on .gb-attach-check {
    color: #fff;
    border-color: #888;
  }
  .gb-attach-check {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border: 1px solid #444;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #888;
  }
  .gb-attach-path {
    flex: 1 1 auto;
    min-width: 0;
    font-family: var(--gb-mono);
    font-size: 12px;
    color: #eee;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .gb-attach-name {
    flex-shrink: 0;
    max-width: 30%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #777;
    font-size: 11px;
  }
  .gb-attach-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    border-top: 1px solid #222;
    font-family: var(--gb-mono);
    font-size: 10px;
    color: #888;
  }
  .gb-attach-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 8px;
  }
  .gb-attach-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    max-width: 100%;
    padding: 4px 6px 4px 8px;
    border: 1px solid #333;
    border-radius: 999px;
    background: #141414;
    color: #e0e0e0;
    font-family: var(--gb-mono);
    font-size: 11px;
  }
  .gb-attach-chip-icon { flex-shrink: 0; font-size: 11px; }
  .gb-attach-chip-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 160px;
  }
  .gb-attach-chip-x {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #999;
    font-size: 14px;
    line-height: 1;
    padding: 0;
  }
  .gb-attach-chip-x:active { background: #2a2a2a; color: #fff; }
  .gb-attach-btn {
    flex: 0 0 auto;
    position: relative;
    align-self: flex-end;
    width: 32px;
    height: 32px;
    border: 1px solid var(--gb-border-strong);
    border-radius: 6px;
    background: var(--gb-bg-card);
    color: var(--gb-text-2);
    font-size: 14px;
    line-height: 1;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .gb-attach-btn.is-on {
    border-color: #666;
    color: #fff;
    background: #1c1c1c;
  }
  .gb-attach-btn:disabled { opacity: 0.3; }
  .gb-attach-btn:active { background: #222; }
  .gb-attach-count {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 14px;
    height: 14px;
    padding: 0 3px;
    border-radius: 999px;
    background: #fff;
    color: #000;
    font-family: var(--gb-mono);
    font-size: 9px;
    font-weight: 700;
    line-height: 14px;
    text-align: center;
  }
  .gb-user-body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  .gb-user-attach {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
  }
  .gb-user-attach-chip {
    font-family: var(--gb-mono);
    font-size: 10px;
    color: #bbb;
    background: #111;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 2px 6px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .gb-prompt-border {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid var(--gb-prompt-border);
    border-radius: 8px;
    background: var(--gb-bg);
    width: 100%;
    transition: border-color 0.12s ease;
  }
  .gb-prompt-border:focus-within {
    border-color: var(--gb-prompt-focus);
  }
  .gb-prompt.is-busy .gb-prompt-border {
    border-color: #666666;
  }
  .gb-prompt-prefix {
    color: var(--gb-muted);
    font-family: var(--gb-mono);
    font-weight: 600;
    font-size: 14px;
    line-height: 1.45;
    flex-shrink: 0;
    padding-top: 1px;
  }
  .gb-prompt-input {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 22px;
    max-height: 120px;
    resize: none;
    border: none;
    outline: none;
    background: transparent;
    color: var(--gb-text);
    font-family: var(--gb-sans);
    font-size: 16px; /* prevent iOS zoom */
    line-height: 1.4;
    padding: 0;
    margin: 0;
    width: 100%;
  }
  .gb-prompt-input::placeholder { color: var(--gb-dim); }
  .gb-prompt-input:disabled { opacity: 0.5; }
  .gb-send {
    flex: 0 0 auto;
    align-self: flex-end;
    width: 32px;
    height: 32px;
    border: 1px solid var(--gb-border-strong);
    border-radius: 6px;
    background: var(--gb-bg-card);
    color: var(--gb-text-2);
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
  }
  .gb-send:disabled {
    opacity: 0.3;
  }
  .gb-prompt-status {
    display: flex;
    justify-content: flex-end;
    padding: 4px 4px 2px;
    font-family: var(--gb-mono);
    font-size: 11px;
    color: var(--gb-dim);
    gap: 6px;
  }
  .gb-prompt-status .sep { color: var(--gb-dim); opacity: 0.7; }

  /* Footer shortcuts removed — keep rule hidden if any leftover markup */
  .gb-footer {
    display: none !important;
  }

  /* Panels / autocomplete — neutral */
  .gb-panel {
    flex-shrink: 0;
    max-height: 32vh;
    overflow: auto;
    padding: 10px 12px;
    background: var(--gb-bg-elevated);
    border-bottom: 1px solid var(--gb-border);
  }
  .gb-panel-title {
    font-family: var(--gb-mono);
    font-size: 11px;
    font-weight: 650;
    color: var(--gb-muted);
    margin-bottom: 8px;
  }
  .gb-panel-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }
  .gb-panel-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 6px 4px;
    font-size: 12px;
    color: var(--gb-text-2);
    min-width: 0;
  }
  .gb-panel-row code {
    font-family: var(--gb-mono);
    font-size: 11.5px;
    color: var(--gb-text);
    flex-shrink: 0;
  }
  .gb-panel-row--btn {
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    border-radius: 6px;
  }
  .gb-panel-row--btn:active { background: var(--gb-bg-hover); }
  .gb-panel-desc {
    flex: 1;
    min-width: 0;
    color: var(--gb-dim);
    font-size: 11px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .gb-panel-tag {
    font-family: var(--gb-mono);
    font-size: 9px;
    color: var(--gb-dim);
    text-transform: uppercase;
    flex-shrink: 0;
  }
  .gb-panel-foot {
    margin: 10px 0 0;
    font-size: 11px;
    color: var(--gb-muted);
  }
  .gb-panel-foot code {
    color: var(--gb-text-2);
    font-family: var(--gb-mono);
  }

  .gb-autocomplete {
    max-height: min(220px, 36vh);
    overflow-y: auto;
    overflow-x: hidden;
    margin-bottom: 6px;
    border: 1px solid var(--gb-border-strong);
    border-radius: 8px;
    background: var(--gb-bg-elevated);
    box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.35);
    width: 100%;
  }
  .gb-ac-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    color: var(--gb-text-2);
    padding: 9px 12px;
    font-size: 12.5px;
    border-bottom: 1px solid var(--gb-border);
    min-width: 0;
  }
  .gb-ac-row code {
    font-family: var(--gb-mono);
    font-size: 12px;
    color: var(--gb-text);
    flex-shrink: 0;
  }
  .gb-ac-row.is-active,
  .gb-ac-row:active {
    background: var(--gb-bg-hover);
    color: var(--gb-text);
  }
  .gb-ac-desc {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--gb-dim);
    font-size: 11px;
  }
  .gb-ac-tag {
    font-family: var(--gb-mono);
    font-size: 9px;
    color: var(--gb-dim);
    text-transform: uppercase;
    flex-shrink: 0;
  }
  .gb-ac-empty {
    color: var(--gb-muted);
    font-family: var(--gb-mono);
    font-size: 11px;
  }

  /* body lock when overlay open — applied via class on html from JS optional */
  html.gb-open,
  body.gb-open {
    overflow: hidden !important;
    height: 100% !important;
    max-height: 100% !important;
    overscroll-behavior: none;
    touch-action: none;
  }
  html.gb-open {
    /* Keep layout viewport stable while keyboard resizes visualViewport */
    height: 100% !important;
  }
  body.gb-open {
    /* position:fixed set inline by JS so scroll offset is preserved */
    overflow: hidden !important;
  }
}

/* ==========================================================================
   HARD OVERRIDE — mobile chat pure black/white (beats any older rules)
   ========================================================================== */
@media (max-width: 720px) {
  .logo {
    background: #000000 !important;
    background-image: none !important;
    color: #ffffff !important;
    box-shadow: none !important;
  }

  .mcli-fab,
  button.mcli-fab {
    background: #000000 !important;
    background-image: none !important;
    color: #ffffff !important;
    border-color: #555555 !important;
  }
  .mcli-fab-icon {
    background: #000000 !important;
    background-image: none !important;
    color: #ffffff !important;
    border-color: #666666 !important;
  }
  .mcli-fab-label { color: #ffffff !important; }
  .mcli-fab-dot { background: #666666 !important; }
  .mcli-fab-dot--ok { background: #ffffff !important; }
  .mcli-fab-dot--run { background: #ffffff !important; }
  .mcli-fab-dot--warn { background: #b0b0b0 !important; }
  .mcli-fab-dot--err { background: #555555 !important; }
  .mcli-fab-dot--idle { background: #666666 !important; }

  /* Keep health strip visible (not filtered away) */
  .gb-tui .gb-health {
    filter: grayscale(1);
  }

  .gb-overlay { background: #000 !important; }
  .gb-tui {
    background: #000 !important;
    color: #fff !important;
    /* No parent filter — grayscale on children so green reload-dot still shows */
    filter: none !important;
  }
  .gb-tui .gb-topbar,
  .gb-tui .gb-menu,
  .gb-tui .gb-scrollback,
  .gb-tui .gb-panel,
  .gb-tui .gb-prompt,
  .gb-tui .gb-banner {
    filter: grayscale(1);
  }
  /* Keep reload indicator in full color */
  .gb-tui .gb-done-bar {
    filter: none !important;
  }
  .gb-reload-dot {
    background: #22c55e !important;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.28) !important;
  }
  .gb-reload-btn.has-update {
    color: #e8ffe8 !important;
    border-color: #2d6a2d !important;
  }

  /* Chat tab (GrokChatPage / cli-*) — monochrome terminal */
  .cli-page {
    margin: 0 -8px;
    max-width: 100vw;
  }
  .cli-window {
    background: #000000 !important;
    color: #ffffff !important;
    border: 1px solid #333 !important;
    border-radius: 10px;
    min-height: 70dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    filter: grayscale(1);
  }
  .cli-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: #000 !important;
    color: #aaa !important;
    border-bottom: 1px solid #222;
    font-family: ui-monospace, Menlo, monospace;
    font-size: 12px;
  }
  .cli-cwd { color: #999 !important; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .cli-tokens { color: #999 !important; }
  .cli-topbar-right { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
  .cli-model-select,
  .cli-effort-select,
  .cli-clear-btn {
    background: #111 !important;
    color: #eee !important;
    border: 1px solid #444 !important;
    border-radius: 6px;
    font-size: 11px;
    padding: 4px 6px;
  }
  .cli-scrollback {
    flex: 1 1 auto;
    min-height: 200px;
    overflow-y: auto;
    padding: 10px 12px;
    background: #000 !important;
    color: #e0e0e0 !important;
  }
  .cli-user-block {
    background: #1c1c1c !important;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 10px;
  }
  .cli-prefix,
  .cli-thought-diamond { color: #aaa !important; }
  .cli-thought { color: #aaa !important; font-family: ui-monospace, Menlo, monospace; font-size: 12px; }
  .cli-user-text,
  .cli-assistant-text { color: #fff !important; }
  .cli-time,
  .cli-worked,
  .cli-usage { color: #777 !important; font-size: 11px; }
  .cli-prompt {
    background: #000 !important;
    padding: 8px 10px;
    border-top: 1px solid #222;
  }
  .cli-prompt-box {
    display: flex;
    gap: 8px;
    border: 1px solid #444 !important;
    border-radius: 8px;
    padding: 10px;
    background: #000 !important;
  }
  .cli-prompt-input {
    flex: 1;
    background: transparent !important;
    color: #fff !important;
    border: none;
    outline: none;
    font-size: 16px;
    resize: none;
  }
  .cli-prompt-status,
  .cli-shortcuts {
    color: #777 !important;
    font-size: 11px;
    font-family: ui-monospace, Menlo, monospace;
    padding: 4px 2px;
  }
  .cli-banner--warn,
  .cli-banner--error {
    background: #111 !important;
    color: #fff !important;
    border-bottom: 1px solid #333;
    padding: 8px 12px;
    font-size: 12px;
  }
  .cli-try {
    background: #1c1c1c !important;
    color: #ddd !important;
    border: 1px solid #333 !important;
  }
  .cli-caret {
    background: #fff !important;
  }

  /* Active nav: no blue accent on mobile */
  .page-nav-btn.active {
    color: #111111 !important;
  }
}

/* ==========================================================================
   Web-only page-aware Grok chatbot (floating). Hidden on mobile (≤720px).
   ========================================================================== */
.web-chat {
  display: none; /* mobile default off */
}
@media (min-width: 721px) {
  .web-chat {
    display: block;
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 80;
    font-family: inherit;
  }
  .web-chat-fab {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: var(--accent, #007aff);
    color: #fff;
    font-size: 22px;
    box-shadow: 0 8px 28px rgba(0, 122, 255, 0.35), 0 2px 8px rgba(0,0,0,0.08);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 120ms ease, background 120ms ease;
  }
  .web-chat-fab:hover { transform: scale(1.05); background: var(--accent-hover, #0066d6); }
  .web-chat-fab.is-open {
    background: var(--surface, #fff);
    color: var(--text, #1c1c1e);
    border: var(--hairline, 0.5px solid rgba(60,60,67,0.18));
    box-shadow: var(--shadow-md, 0 8px 28px rgba(0,0,0,0.08));
  }
  .web-chat-panel {
    position: absolute;
    right: 0;
    bottom: 68px;
    width: min(440px, calc(100vw - 40px));
    height: min(620px, calc(100vh - 100px));
    display: flex;
    flex-direction: column;
    background: var(--surface, #fff);
    border: var(--hairline, 0.5px solid rgba(60,60,67,0.18));
    border-radius: 18px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.14), 0 4px 12px rgba(0,0,0,0.06);
    overflow: hidden;
  }
  .web-chat-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 14px 12px;
    border-bottom: var(--hairline, 0.5px solid rgba(60,60,67,0.12));
    background: linear-gradient(180deg, rgba(0,122,255,0.06), transparent);
  }
  .web-chat-title {
    font-weight: 700;
    font-size: 15px;
    letter-spacing: -0.02em;
  }
  .web-chat-sub {
    font-size: 12px;
    color: var(--text-muted, #8e8e93);
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
  }
  .web-chat-model-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
  }
  .web-chat-model-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--text-muted, #8e8e93);
  }
  .web-chat-model-select {
    flex: 1;
    min-width: 0;
    max-width: 180px;
    appearance: none;
    -webkit-appearance: none;
    border: var(--hairline, 0.5px solid rgba(60,60,67,0.22));
    background: var(--surface, #fff)
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238e8e93' d='M3 4.5L6 8l3-3.5'/%3E%3C/svg%3E")
      no-repeat right 8px center;
    border-radius: 8px;
    padding: 5px 28px 5px 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text, #1c1c1e);
    cursor: pointer;
  }
  .web-chat-model-select:disabled {
    opacity: 0.55;
    cursor: not-allowed;
  }
  .web-chat-model-select:focus {
    outline: none;
    border-color: var(--accent, #007aff);
    box-shadow: 0 0 0 3px rgba(0,122,255,0.15);
  }
  .web-chat-model-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text, #1c1c1e);
    background: rgba(60,60,67,0.08);
    padding: 2px 8px;
    border-radius: 999px;
  }
  .web-chat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
    box-shadow: 0 0 0 1.5px rgba(255,255,255,0.9);
  }
  .web-chat-dot--green { background: #34c759; }
  .web-chat-dot--yellow { background: #ffcc00; }
  .web-chat-dot--red { background: #ff3b30; }
  .web-chat-settings {
    flex: 1 1 auto;
    min-height: 0;
    border-bottom: none;
    background: linear-gradient(180deg, rgba(242,242,247,0.95), rgba(255,255,255,0.98));
    padding: 12px 14px 14px;
    overflow-y: auto;
  }
  .web-chat-settings-footer {
    flex-shrink: 0;
    padding: 10px 14px 14px;
    border-top: var(--hairline, 0.5px solid rgba(60,60,67,0.12));
    background: var(--surface, #fff);
  }
  .web-chat-settings-done {
    width: 100%;
    min-height: 40px;
    font-weight: 650;
  }
  .web-chat-settings-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
  }
  .web-chat-settings-title {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: -0.01em;
  }
  .web-chat-settings-sub {
    font-size: 11px;
    color: var(--text-muted, #8e8e93);
    margin-top: 1px;
  }
  .web-chat-settings-section { margin-top: 12px; }
  .web-chat-settings-section:first-of-type { margin-top: 0; }
  .web-chat-settings-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted, #8e8e93);
    margin-bottom: 6px;
  }
  .web-chat-settings-error,
  .web-chat-settings-empty {
    font-size: 12px;
    color: var(--text-muted, #8e8e93);
    padding: 8px 0;
  }
  .web-chat-settings-error { color: #ff3b30; }
  .web-chat-model-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  .web-chat-model-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    text-align: left;
    border: var(--hairline, 0.5px solid rgba(60,60,67,0.16));
    background: #fff;
    border-radius: 10px;
    padding: 8px 10px;
    cursor: pointer;
    color: inherit;
  }
  .web-chat-model-option:hover { border-color: rgba(0,122,255,0.35); }
  .web-chat-model-option.is-selected {
    border-color: var(--accent, #007aff);
    background: rgba(0,122,255,0.06);
  }
  .web-chat-model-option:disabled { opacity: 0.55; cursor: not-allowed; }
  .web-chat-model-option-main {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
  }
  .web-chat-model-option-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
  }
  .web-chat-model-option-name {
    font-size: 13px;
    font-weight: 650;
  }
  .web-chat-model-option-hint {
    font-size: 11px;
    color: var(--text-muted, #8e8e93);
  }
  .web-chat-model-option-check {
    color: var(--accent, #007aff);
    font-weight: 700;
    font-size: 13px;
  }
  .web-chat-tools-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: var(--hairline, 0.5px solid rgba(60,60,67,0.16));
    background: #fff;
    border-radius: 10px;
    padding: 9px 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    color: inherit;
  }
  .web-chat-tools-toggle:disabled {
    opacity: 0.55;
    cursor: not-allowed;
  }
  .web-chat-tools-switch {
    width: 36px;
    height: 22px;
    border-radius: 999px;
    background: rgba(60,60,67,0.22);
    position: relative;
    flex-shrink: 0;
    transition: background 0.15s ease;
  }
  .web-chat-tools-switch::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    transition: transform 0.15s ease;
  }
  .web-chat-tools-toggle.is-on .web-chat-tools-switch { background: #34c759; }
  .web-chat-tools-toggle.is-on .web-chat-tools-switch::after { transform: translateX(14px); }
  .web-chat-provider-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  .web-chat-provider-card {
    width: 100%;
    text-align: left;
    border: var(--hairline, 0.5px solid rgba(60,60,67,0.14));
    background: #fff;
    border-radius: 10px;
    padding: 0;
    color: inherit;
    overflow: hidden;
  }
  .web-chat-provider-card:hover { border-color: rgba(0,122,255,0.3); }
  .web-chat-provider-card.is-selected {
    border-color: var(--accent, #007aff);
    box-shadow: inset 0 0 0 1px rgba(0,122,255,0.15);
  }
  .web-chat-provider-select {
    display: block;
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    padding: 8px 10px;
    cursor: pointer;
    color: inherit;
    font: inherit;
  }
  .web-chat-provider-top {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 3px;
  }
  .web-chat-provider-name {
    font-size: 12px;
    font-weight: 700;
  }
  .web-chat-provider-status {
    margin-left: auto;
    font-size: 10px;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: 0.03em;
  }
  .web-chat-provider-status--green { color: #248a3d; }
  .web-chat-provider-status--yellow { color: #9a6700; }
  .web-chat-provider-status--red { color: #d70015; }
  .web-chat-provider-account {
    font-size: 12px;
    font-weight: 600;
    color: var(--text, #1c1c1e);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .web-chat-provider-limit {
    font-size: 11px;
    color: var(--text-muted, #8e8e93);
    margin-top: 2px;
    line-height: 1.35;
  }
  .web-chat-acct-block {
    border-top: var(--hairline, 0.5px solid rgba(60,60,67,0.1));
    padding: 8px 10px 10px;
    background: rgba(242,242,247,0.55);
  }
  .web-chat-acct-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted, #8e8e93);
    margin-bottom: 6px;
  }
  .web-chat-acct-empty,
  .web-chat-acct-hint {
    font-size: 11px;
    color: var(--text-muted, #8e8e93);
    line-height: 1.35;
  }
  .web-chat-acct-hint { margin-top: 6px; }
  .web-chat-acct-row {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 4px;
  }
  .web-chat-acct-switch {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    border: var(--hairline, 0.5px solid rgba(60,60,67,0.14));
    background: #fff;
    border-radius: 8px;
    padding: 6px 8px;
    cursor: pointer;
    color: inherit;
    font: inherit;
    text-align: left;
  }
  .web-chat-acct-switch:hover:not(:disabled) {
    border-color: var(--accent, #007aff);
  }
  .web-chat-acct-switch:disabled {
    cursor: default;
    opacity: 1;
  }
  .web-chat-acct-row.is-active .web-chat-acct-switch {
    border-color: rgba(52,199,89,0.45);
    background: rgba(52,199,89,0.08);
  }
  .web-chat-acct-email {
    flex: 1;
    min-width: 0;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .web-chat-acct-badge {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted, #8e8e93);
    flex-shrink: 0;
  }
  .web-chat-acct-row.is-active .web-chat-acct-badge { color: #248a3d; }
  .web-chat-acct-remove {
    border: none;
    background: transparent;
    color: var(--text-muted, #8e8e93);
    width: 28px;
    height: 28px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
  }
  .web-chat-acct-remove:hover { background: rgba(255,59,48,0.1); color: #d70015; }
  .web-chat-acct-save {
    margin-top: 6px;
    width: 100%;
    border: var(--hairline, 0.5px solid rgba(0,122,255,0.3));
    background: rgba(0,122,255,0.08);
    color: var(--accent, #007aff);
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 650;
    cursor: pointer;
    font-family: inherit;
  }
  .web-chat-acct-save:hover { background: rgba(0,122,255,0.14); }
  .web-chat-acct-save:disabled { opacity: 0.55; cursor: not-allowed; }
  .web-chat-acct-msg {
    margin-top: 8px;
    font-size: 12px;
    color: #248a3d;
    padding: 6px 8px;
    border-radius: 8px;
    background: rgba(52,199,89,0.1);
  }
  .web-chat-acct-msg.is-error {
    color: #d70015;
    background: rgba(255,59,48,0.1);
  }
  .web-chat-api-wallet {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    color: var(--text-muted, #636366);
    padding: 6px 8px;
    border-radius: 8px;
    background: rgba(60,60,67,0.06);
  }
  .web-chat-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
    font-size: 10px;
    color: var(--text-muted, #8e8e93);
  }
  .web-chat-legend span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
  }
  .web-chat-icon-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
  }
  .web-chat-pill {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(52, 199, 89, 0.15);
    color: #248a3d;
  }
  .web-chat-pill.is-tools {
    background: var(--accent-soft, rgba(0,122,255,0.12));
    color: var(--accent, #007aff);
  }
  .web-chat-head-actions { display: flex; gap: 6px; flex-shrink: 0; align-items: center; }
  .web-chat-icon-btn {
    border: none;
    background: transparent;
    color: var(--text-muted, #8e8e93);
    font-size: 12px;
    font-weight: 600;
    padding: 6px 8px;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
  }
  .web-chat-icon-btn:hover { background: var(--surface-alt, #f2f2f7); color: var(--text); }
  .web-chat-icon-btn.is-active {
    background: var(--accent-soft, rgba(0,122,255,0.12));
    color: var(--accent, #007aff);
  }
  .web-chat-settings-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: var(--hairline, 0.5px solid rgba(60,60,67,0.18));
    background: var(--surface, #fff);
    color: var(--text, #1c1c1e);
    font-size: 13px;
    font-weight: 650;
    padding: 8px 12px;
    min-height: 36px;
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
    line-height: 1;
  }
  .web-chat-settings-btn:hover {
    background: var(--surface-alt, #f2f2f7);
    border-color: rgba(0,122,255,0.35);
  }
  .web-chat-settings-btn.is-active {
    background: var(--accent-soft, rgba(0,122,255,0.14));
    border-color: var(--accent, #007aff);
    color: var(--accent, #007aff);
  }
  .web-chat-settings-btn-icon {
    font-size: 16px;
    line-height: 1;
  }
  .web-chat-foot--settings {
    text-align: center;
    padding: 12px 14px 14px;
    color: var(--text-muted, #8e8e93);
  }
  .web-chat-messages {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
    background: var(--bg, #f2f2f7);
  }
  .web-chat-empty {
    color: var(--text-muted, #8e8e93);
    font-size: 13px;
    line-height: 1.45;
  }
  .web-chat-empty p { margin: 0 0 10px; }
  .web-chat-suggestions {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  .web-chat-chip {
    text-align: left;
    border: var(--hairline, 0.5px solid rgba(60,60,67,0.14));
    background: var(--surface, #fff);
    color: var(--text, #1c1c1e);
    border-radius: 12px;
    padding: 9px 12px;
    font-size: 12.5px;
    cursor: pointer;
    font-family: inherit;
  }
  .web-chat-chip:hover { border-color: var(--accent, #007aff); color: var(--accent, #007aff); }
  .web-chat-msg {
    display: flex;
    max-width: 100%;
    gap: 8px;
    align-items: flex-end;
  }
  .web-chat-msg--user { justify-content: flex-end; }
  .web-chat-msg--assistant { justify-content: flex-start; }
  .web-chat-avatar {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(145deg, #1c1c1e, #3a3a3c);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2px;
  }
  .web-chat-msg-body {
    max-width: min(92%, 360px);
    padding: 10px 13px;
    border-radius: 16px;
    font-size: 13.5px;
    line-height: 1.5;
    word-break: break-word;
    overflow-wrap: anywhere;
  }
  .web-chat-msg-body p { margin: 0 0 0.35em; }
  .web-chat-msg-body p:last-child { margin-bottom: 0; }
  .web-chat-msg--user .web-chat-msg-body {
    background: var(--accent, #007aff);
    color: #fff;
    border-bottom-right-radius: 4px;
    max-width: 85%;
  }
  .web-chat-msg--user .web-chat-plain p { margin: 0 0 0.25em; white-space: pre-wrap; }
  .web-chat-msg--assistant .web-chat-msg-body {
    background: var(--surface, #fff);
    color: var(--text, #1c1c1e);
    border: var(--hairline, 0.5px solid rgba(60,60,67,0.12));
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  }
  .web-chat-msg.is-error .web-chat-msg-body {
    background: var(--danger-soft, rgba(255,59,48,0.12));
    color: var(--danger, #ff3b30);
    border-color: transparent;
  }
  .web-chat-msg.is-page {
    justify-content: center;
  }
  .web-chat-msg.is-page .web-chat-msg-body {
    background: transparent;
    border: none;
    box-shadow: none;
    color: var(--text-muted, #8e8e93);
    font-size: 12px;
    padding: 4px 0;
    text-align: center;
    max-width: 100%;
    width: 100%;
  }
  .web-chat-msg.is-streaming .web-chat-msg-body {
    border-color: rgba(0,122,255,0.25);
  }
  .web-chat-typing {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 12.5px;
  }
  .web-chat-status-live {
    margin-top: 6px;
    font-size: 11px;
    color: var(--text-muted, #8e8e93);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  }
  .web-chat-stream-pre {
    margin: 0;
    padding: 0;
    font-family: inherit;
    font-size: 13.5px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
    background: transparent;
    border: none;
    color: inherit;
    max-width: 100%;
  }

  /* Formatted assistant replies (light theme — overrides dark .gb-md from mobile CLI) */
  .web-chat-md .gb-md {
    color: var(--text, #1c1c1e);
    font-size: 13.5px;
    line-height: 1.55;
  }
  .web-chat-md .gb-md p { margin: 0 0 0.55em; }
  .web-chat-md .gb-md p:last-child { margin-bottom: 0; }
  .web-chat-md .gb-md h1,
  .web-chat-md .gb-md h2,
  .web-chat-md .gb-md h3,
  .web-chat-md .gb-md h4 {
    color: var(--text, #1c1c1e);
    font-size: 13.5px;
    font-weight: 700;
    margin: 0.7em 0 0.35em;
  }
  .web-chat-md .gb-md h1:first-child,
  .web-chat-md .gb-md h2:first-child,
  .web-chat-md .gb-md h3:first-child { margin-top: 0; }
  .web-chat-md .gb-md strong,
  .web-chat-md .gb-md b {
    color: var(--text, #1c1c1e);
    font-weight: 650;
  }
  .web-chat-md .gb-md em { font-style: italic; color: var(--text-muted, #636366); }
  .web-chat-md .gb-md a {
    color: var(--accent, #007aff);
    text-decoration: underline;
    text-underline-offset: 2px;
    word-break: break-all;
  }
  .web-chat-md .gb-md ul,
  .web-chat-md .gb-md ol {
    margin: 0.35em 0 0.65em;
    padding-left: 1.2em;
  }
  .web-chat-md .gb-md li { margin: 0.2em 0; }
  .web-chat-md .gb-md code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
    background: rgba(60,60,67,0.08);
    border: 1px solid rgba(60,60,67,0.1);
    border-radius: 5px;
    padding: 1px 5px;
    color: #1c1c1e;
  }
  .web-chat-md .gb-md pre {
    margin: 0.45em 0 0.7em;
    padding: 10px 12px;
    background: #1c1c1e;
    border: none;
    border-radius: 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }
  .web-chat-md .gb-md pre code {
    background: none;
    border: none;
    padding: 0;
    color: #f2f2f7;
    font-size: 11.5px;
    line-height: 1.45;
    white-space: pre;
  }
  .web-chat-md .gb-md table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    margin: 0.5em 0 0.75em;
    font-size: 12px;
    display: block;
    overflow-x: auto;
  }
  .web-chat-md .gb-md th,
  .web-chat-md .gb-md td {
    border: 1px solid rgba(60,60,67,0.14);
    padding: 6px 8px;
    text-align: left;
    vertical-align: top;
  }
  .web-chat-md .gb-md th {
    background: rgba(60,60,67,0.06);
    font-weight: 650;
    color: var(--text, #1c1c1e);
  }
  .web-chat-md .gb-md td { color: var(--text, #1c1c1e); }
  .web-chat-md .gb-md td a { color: var(--accent, #007aff); }
  .web-chat-md .gb-md blockquote {
    margin: 0.4em 0 0.65em;
    padding: 6px 10px;
    border-left: 3px solid var(--accent, #007aff);
    background: rgba(0,122,255,0.06);
    color: var(--text-muted, #636366);
    border-radius: 0 8px 8px 0;
  }
  .web-chat-md .gb-md hr {
    border: none;
    border-top: 1px solid rgba(60,60,67,0.12);
    margin: 0.7em 0;
  }
  .web-chat-error {
    padding: 6px 14px;
    font-size: 11px;
    color: var(--danger, #ff3b30);
    background: var(--danger-soft, rgba(255,59,48,0.1));
  }
  .web-chat-compose {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border-top: var(--hairline, 0.5px solid rgba(60,60,67,0.12));
    background: var(--surface, #fff);
    align-items: flex-end;
  }
  .web-chat-input {
    flex: 1 1 auto;
    min-width: 0;
    resize: none;
    border: var(--hairline, 0.5px solid rgba(60,60,67,0.18));
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 13px;
    font-family: inherit;
    background: var(--bg, #f2f2f7);
    color: var(--text);
    line-height: 1.4;
  }
  .web-chat-input:focus {
    outline: none;
    border-color: var(--accent, #007aff);
    box-shadow: 0 0 0 3px var(--accent-soft, rgba(0,122,255,0.15));
  }
  .web-chat-send {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 0 14px;
  }
  .web-chat-foot {
    font-size: 10px;
    color: var(--text-dim, #aeaeb2);
    text-align: center;
    padding: 0 12px 8px;
    background: var(--surface, #fff);
  }
  /* Keep map usable — lower chat if salary map full-bleed */
  .app.app--salary-map .web-chat {
    bottom: 80px;
    right: 16px;
  }
}
/* Force hide on mobile even if media query order conflicts */
@media (max-width: 720px) {
  .web-chat { display: none !important; }
}


.web-chat-meta {
  margin: 6px 0 0 !important;
  font-size: 10px !important;
  color: var(--text-dim, #aeaeb2) !important;
  opacity: 0.9;
}

/* ===== Resume Tailor tab ===== */
.resume-tailor { display: flex; flex-direction: column; gap: 16px; }
.rt-card {
  background: var(--surface, #fff);
  border: var(--hairline, 0.5px solid rgba(60,60,67,0.14));
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: var(--shadow, 0 4px 16px rgba(0,0,0,0.04));
}
.rt-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
@media (max-width: 720px) {
  .rt-row { grid-template-columns: 1fr; }
}
.rt-card label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted, #8e8e93);
}
.rt-card input,
.rt-card textarea {
  font: inherit;
  font-weight: 400;
  color: var(--text, #1c1c1e);
  border: var(--hairline, 0.5px solid rgba(60,60,67,0.18));
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--bg, #f2f2f7);
}
.rt-card textarea {
  resize: vertical;
  min-height: 200px;
  line-height: 1.45;
}
.rt-jd { display: flex; flex-direction: column; gap: 6px; }
.rt-actions { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.rt-err {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--danger-soft, rgba(255,59,48,0.1));
  color: var(--danger, #ff3b30);
  font-size: 13px;
}
.rt-busy { margin-top: 10px; font-size: 13px; }
.rt-result { margin-top: 16px; padding-top: 14px; border-top: var(--hairline, 0.5px solid rgba(60,60,67,0.12)); }
.rt-kpis { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.rt-kpi {
  min-width: 88px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--bg, #f2f2f7);
  text-align: center;
}
.rt-num { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.rt-lbl { font-size: 11px; color: var(--text-muted, #8e8e93); margin-top: 2px; }
.rt-added { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 12px; }
.rt-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(0,122,255,0.1);
  color: var(--accent, #007aff);
}
.rt-dl { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.rt-fname { font-size: 12px; word-break: break-all; }
.rt-recent {
  background: var(--surface, #fff);
  border: var(--hairline, 0.5px solid rgba(60,60,67,0.14));
  border-radius: 16px;
  padding: 16px 18px;
}
.rt-recent-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.rt-recent-head h3 { margin: 0; font-size: 15px; }
.rt-table { display: flex; flex-direction: column; gap: 0; }
.rt-trow {
  display: grid;
  grid-template-columns: 1.6fr 0.5fr 1fr 0.9fr;
  gap: 8px;
  padding: 10px 4px;
  border-bottom: var(--hairline, 0.5px solid rgba(60,60,67,0.1));
  font-size: 12.5px;
  align-items: center;
}
.rt-thead { font-weight: 650; color: var(--text-muted, #8e8e93); font-size: 11px; text-transform: uppercase; letter-spacing: 0.03em; }
.rt-links a { color: var(--accent, #007aff); text-decoration: none; font-weight: 600; }
.rt-links a:hover { text-decoration: underline; }
@media (max-width: 720px) {
  .rt-trow { grid-template-columns: 1fr; gap: 2px; }
  .rt-thead { display: none; }
}

/* ── Task Board (project kanban) ───────────────────────────── */
.tb-page { margin: 12px 0 28px; }
.tb-heading { margin: 0 0 4px; font-size: 1.15rem; font-weight: 700; }
.tb-sub { margin: 0; font-size: 13px; max-width: 52ch; }
.tb-toolbar { margin-bottom: 14px; padding: 16px 18px; }
.tb-toolbar-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.tb-counts { display: flex; flex-wrap: wrap; gap: 8px; }
.tb-count-chip {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 4px 10px;
}
.tb-count-chip b { color: var(--text); margin-right: 4px; }
.tb-create, .tb-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.tb-filters { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--separator); }
.tb-input, .tb-select, .tb-textarea {
  font: inherit;
  font-size: 13px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  min-width: 0;
}
.tb-input { flex: 1 1 160px; }
.tb-input-notes { flex: 1 1 140px; }
.tb-select { flex: 0 0 auto; min-width: 110px; }
.tb-select.sm { min-width: 96px; padding: 5px 8px; font-size: 12px; }
.tb-textarea { width: 100%; resize: vertical; margin-top: 6px; }
.tb-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(200px, 1fr));
  gap: 12px;
  align-items: start;
  overflow-x: auto;
  padding-bottom: 8px;
}
.tb-col {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-height: 280px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.tb-col.is-drop-target {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.tb-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 12px 8px;
  border-bottom: 1px solid var(--separator);
}
.tb-col-head h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.tb-col-count {
  font-size: 12px;
  font-weight: 650;
  color: var(--text-dim);
  background: var(--surface);
  border-radius: var(--radius-pill);
  padding: 2px 8px;
  border: 1px solid var(--border);
}
.tb-col-body {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-height: 120px;
}
.tb-empty {
  margin: 24px 8px;
  text-align: center;
  font-size: 12px;
}
.tb-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 11px;
  box-shadow: var(--shadow);
  cursor: grab;
  transition: transform 0.12s var(--ease), opacity 0.12s var(--ease);
  border-left: 3px solid var(--border-strong);
}
.tb-card:active { cursor: grabbing; }
.tb-card.is-dragging { opacity: 0.45; transform: scale(0.98); }
.tb-card.prio-urgent { border-left-color: var(--danger); }
.tb-card.prio-high { border-left-color: var(--warning); }
.tb-card.prio-medium { border-left-color: var(--accent); }
.tb-card.prio-low { border-left-color: var(--text-dim); }
.tb-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 6px;
}
.tb-prio {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: var(--radius-pill);
  padding: 2px 7px;
  background: var(--surface-alt);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.tb-prio-urgent { color: var(--danger); background: var(--danger-soft); border-color: transparent; }
.tb-prio-high { color: var(--warning); background: var(--warning-soft); border-color: transparent; }
.tb-prio-medium { color: var(--accent); background: var(--accent-soft); border-color: transparent; }
.tb-card-title {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.35;
  word-break: break-word;
}
.tb-card-notes {
  margin: 0 0 8px;
  font-size: 12px;
  line-height: 1.4;
  word-break: break-word;
}
.tb-card-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.tb-field-label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  flex: 1 1 100px;
}
.tb-card-menu { display: flex; gap: 2px; }
.tb-icon-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
}
.tb-icon-btn:hover { background: var(--accent-soft); color: var(--text); }
.tb-icon-btn.danger:hover { background: var(--danger-soft); color: var(--danger); }
.tb-card-actions { display: flex; gap: 6px; margin-top: 8px; }
.tb-edit .tb-input { width: 100%; flex: none; margin-bottom: 6px; }

/* Total usage left summary (OpenAI API / Grok / Codex separated) */
.tb-usage-totals {
  display: grid;
  grid-template-columns: repeat(3, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.tb-usage-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  border-left: 3px solid var(--border-strong);
}
.tb-usage-tile.tone-green { border-left-color: var(--success); }
.tb-usage-tile.tone-yellow { border-left-color: var(--warning); }
.tb-usage-tile.tone-red { border-left-color: var(--danger); }
.tb-usage-kicker {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  margin-bottom: 4px;
}
.tb-usage-big {
  font-size: 1.45rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.15;
}
.tb-usage-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.35;
}
.tb-usage-meta {
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 6px;
  line-height: 1.35;
}
.tb-agent-left-big {
  font-size: 1.15rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 2px 0 4px;
  line-height: 1.2;
}
@media (max-width: 720px) {
  .tb-usage-totals { grid-template-columns: 1fr; }
}

/* Agent capacity strip */
.tb-agents {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.tb-agent-card {
  text-align: left;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
  border-left: 3px solid var(--border-strong);
}
.tb-agent-card:hover { border-color: var(--border-strong); }
.tb-agent-card.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.tb-agent-card.tone-green { border-left-color: var(--success); }
.tb-agent-card.tone-yellow { border-left-color: var(--warning); }
.tb-agent-card.tone-red { border-left-color: var(--danger); }
.tb-agent-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 4px;
}
.tb-agent-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.tb-agent-badge.provider-grok { color: var(--accent); background: var(--accent-soft); border-color: transparent; }
.tb-agent-badge.provider-chatgpt { color: var(--success); background: var(--success-soft); border-color: transparent; }
.tb-agent-live, .tb-agent-idle {
  font-size: 10px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.tb-agent-live { color: var(--success); }
.tb-agent-idle { color: var(--text-dim); }
.tb-agent-email {
  font-size: 12px;
  font-weight: 650;
  color: var(--text);
  word-break: break-all;
  margin-bottom: 4px;
}
.tb-agent-usage {
  font-size: 11px;
  line-height: 1.35;
  color: var(--text-muted);
  margin-bottom: 6px;
  min-height: 2.6em;
}
.tb-agent-meta {
  display: flex;
  gap: 10px;
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 600;
}

/* Assignee chip on cards */
.tb-assignee {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 6px 0 8px;
  padding: 6px 8px;
  border-radius: 8px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
}
.tb-assignee.provider-grok { border-left: 2px solid var(--accent); }
.tb-assignee.provider-chatgpt { border-left: 2px solid var(--success); }
.tb-assignee-label { font-size: 12px; font-weight: 650; color: var(--text); }
.tb-assignee-usage {
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tb-assignee-usage.tone-green { color: var(--success); }
.tb-assignee-usage.tone-yellow { color: var(--warning); }
.tb-assignee-usage.tone-red { color: var(--danger); }

/* Subtasks */
.tb-subs {
  margin: 4px 0 8px;
  padding-top: 6px;
  border-top: 1px dashed var(--separator);
}
.tb-subs-head {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.tb-sub {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 12px;
  padding: 3px 0;
  cursor: pointer;
}
.tb-sub input { margin-top: 2px; flex-shrink: 0; }
.tb-sub-title { flex: 1; line-height: 1.35; word-break: break-word; }
.tb-sub.is-done .tb-sub-title {
  text-decoration: line-through;
  color: var(--text-dim);
}
.tb-sub .tb-icon-btn.sm {
  width: 22px;
  height: 22px;
  font-size: 11px;
  opacity: 0.55;
}
.tb-sub:hover .tb-icon-btn.sm { opacity: 1; }
.tb-sub-add {
  display: flex;
  gap: 4px;
  margin-top: 6px;
}
.tb-sub-add .tb-input.sm {
  flex: 1;
  padding: 5px 8px;
  font-size: 12px;
}
.tb-input.sm { font-size: 12px; padding: 5px 8px; }

@media (max-width: 1100px) {
  .tb-board { grid-template-columns: repeat(2, minmax(220px, 1fr)); }
}
@media (max-width: 720px) {
  .tb-board {
    grid-template-columns: minmax(260px, 1fr);
    grid-auto-flow: column;
    grid-auto-columns: minmax(260px, 82vw);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }
  .tb-col { scroll-snap-align: start; min-height: 220px; }
  .tb-create .tb-input, .tb-filters .tb-input { flex: 1 1 100%; }
  .tb-agents { grid-template-columns: 1fr; }
}

/* ========== Unique companies · ATS monitor dashboard ========== */
.jm-monitor-panel {
  margin: 10px 0 18px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: linear-gradient(145deg, var(--surface) 0%, var(--surface-alt) 100%);
  box-shadow: var(--shadow-md);
}
.jm-monitor-panel.is-scanning {
  border-color: color-mix(in srgb, var(--accent) 38%, var(--border));
  background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 7%, var(--surface)) 0%, var(--surface) 72%);
}
.jm-monitor-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.jm-monitor-heading { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.jm-live-indicator {
  width: 11px; height: 11px; margin-top: 7px; border-radius: 50%; flex: 0 0 auto;
  background: var(--text-dim); box-shadow: 0 0 0 5px color-mix(in srgb, var(--text-dim) 12%, transparent);
}
.jm-live-indicator.active {
  background: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft), 0 0 16px color-mix(in srgb, var(--accent) 50%, transparent);
  animation: jm-pulse 1.8s ease-in-out infinite;
}
@keyframes jm-pulse { 50% { opacity: .48; transform: scale(.82); } }
.jm-kicker { color: var(--text-dim); font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.jm-monitor-heading h3 { margin: 1px 0 2px; font-size: 19px; letter-spacing: -.03em; }
.jm-monitor-heading p { margin: 0; color: var(--text-muted); font-size: 12px; line-height: 1.45; }
.jm-next-scan {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 7px;
  color: var(--text-muted); font-size: 11px; line-height: 1.35;
}
.jm-next-scan span { color: var(--text-dim); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.jm-next-scan b { color: var(--text); font-weight: 700; }
.jm-next-scan em { color: var(--accent); font-style: normal; font-weight: 750; }
.jm-state-pill {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px; padding: 6px 11px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-pill); background: var(--surface);
  color: var(--text-muted); font-size: 12px; font-weight: 750;
}
.jm-state-pill span { color: var(--success); }
.jm-state-pill.live { border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); color: var(--accent); }
.jm-state-pill.live span { color: var(--accent); }
.jm-progress-wrap { margin: 18px 0 2px; }
.jm-progress-label { display: flex; justify-content: space-between; color: var(--text-muted); font-size: 11px; margin-bottom: 7px; }
.jm-progress-label b { color: var(--accent); }
.jm-progress-track { height: 7px; overflow: hidden; border-radius: 99px; background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.jm-progress-track span { display: block; height: 100%; border-radius: inherit; background: var(--accent-grad); transition: width .35s var(--ease); }
.jm-stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; margin-top: 18px; }
.jm-stat-card { min-width: 0; display: flex; align-items: center; gap: 9px; padding: 12px 10px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface); }
.jm-stat-card.is-filter:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.jm-stat-icon { display: grid; place-items: center; width: 27px; height: 27px; flex: 0 0 auto; border-radius: 8px; background: var(--surface-alt); color: var(--text-muted); font-size: 14px; font-weight: 800; }
.jm-stat-copy { min-width: 0; }
.jm-stat-copy strong { display: block; overflow: hidden; text-overflow: ellipsis; color: var(--text); font-size: 17px; line-height: 1.1; letter-spacing: -.03em; }
.jm-stat-copy span { display: block; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-muted); font-size: 10px; line-height: 1.1; }
.jm-stat-hint { display: block; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-dim); font-size: 9px; font-style: normal; line-height: 1.15; }
.jm-stat-card.success .jm-stat-icon { background: var(--success-soft); color: var(--success); }
.jm-stat-card.danger .jm-stat-icon { background: var(--danger-soft); color: var(--danger); }
.jm-stat-card.accent .jm-stat-icon { background: var(--accent-soft); color: var(--accent); }
.jm-run-details { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 16px; padding-top: 15px; border-top: 1px solid var(--separator); }
.jm-run-details.single { grid-template-columns: 1fr; }
.jm-run-details div { min-width: 0; }
.jm-run-details span, .jm-footer-label { display: block; color: var(--text-dim); font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.jm-run-details b { display: block; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-muted); font-size: 11px; font-weight: 600; }
.jm-monitor-footer { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 15px; }
.jm-ats-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.jm-ats-chips span { padding: 3px 7px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text-muted); font-size: 10px; font-weight: 650; }
@media (max-width: 1120px) { .jm-stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 720px) {
  .jm-monitor-panel { padding: 15px; border-radius: 16px; }
  .jm-monitor-header { gap: 10px; }
  .jm-monitor-heading h3 { font-size: 17px; }
  .jm-state-pill { padding: 5px 8px; font-size: 11px; }
  .jm-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .jm-stat-card { padding: 10px 8px; }
  .jm-stat-copy strong { font-size: 16px; }
  .jm-run-details { grid-template-columns: 1fr; gap: 9px; }
}

/* ========== Wayback Machine tab ========== */
.wayback-page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 12px 16px 48px;
}
.wayback-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.wayback-header h2 { margin: 0 0 4px; font-size: 1.25rem; }
.wayback-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.wayback-banner { margin: 0 0 12px; }
.wayback-empty {
  text-align: center;
  padding: 48px 16px;
  background: var(--surface, #fff);
  border-radius: 12px;
  border: 1px solid var(--border, #e5e7eb);
}
.wayback-layout {
  display: grid;
  grid-template-columns: minmax(200px, 260px) 1fr;
  gap: 16px;
  align-items: start;
}
@media (max-width: 800px) {
  .wayback-layout { grid-template-columns: 1fr; }
}
.wayback-days {
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  padding: 12px;
  max-height: min(70vh, 720px);
  overflow: auto;
}
.wayback-days h3 { margin: 0 0 10px; font-size: .95rem; }
.wayback-days ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.wayback-day-btn {
  display: flex;
  gap: 10px;
  width: 100%;
  text-align: left;
  border: 1px solid var(--border, #e5e7eb);
  background: var(--bg, #f4f5f7);
  border-radius: 10px;
  padding: 8px;
  cursor: pointer;
  color: inherit;
  font: inherit;
}
.wayback-day-btn:hover { border-color: var(--text-muted, #9ca3af); }
.wayback-day-btn.active {
  border-color: var(--text, #111);
  box-shadow: 0 0 0 1px var(--text, #111);
}
.wayback-day-btn img,
.wayback-day-placeholder {
  width: 72px;
  height: 48px;
  object-fit: cover;
  object-position: top;
  border-radius: 6px;
  background: #111;
  flex-shrink: 0;
}
.wayback-day-placeholder {
  display: flex; align-items: center; justify-content: center; color: #666; font-size: 12px;
}
.wayback-day-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wayback-day-meta strong { font-size: .9rem; }
.wayback-detail {
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  padding: 14px 16px 24px;
  min-height: 320px;
}
.wayback-detail-head {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px;
}
.wayback-detail-head h3 { margin: 0; }
.wayback-detail-links { display: flex; gap: 12px; font-size: .9rem; }
.wayback-detail-sub { margin: 6px 0 16px; }
.wayback-section-title {
  margin: 18px 0 10px;
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted, #6b7280);
}
.wayback-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.wayback-card {
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  padding: 10px;
  background: var(--bg, #f9fafb);
}
.wayback-card.is-fail { border-color: #fca5a5; }
.wayback-card-title { margin-bottom: 8px; font-size: .9rem; }
.wayback-thumb-btn {
  display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in;
}
.wayback-thumb-btn img {
  width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--border, #e5e7eb);
  display: block;
}
.wayback-card-links { display: flex; gap: 10px; margin-top: 8px; font-size: .85rem; }
.wayback-api-list { margin: 0; padding-left: 18px; line-height: 1.7; }
.wayback-lightbox {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(0,0,0,.72);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.wayback-lightbox-inner {
  background: #111; color: #fff; border-radius: 12px;
  max-width: min(96vw, 1200px); max-height: 94vh;
  overflow: auto; padding: 12px;
}
.wayback-lightbox-inner header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px;
}
.wayback-lightbox-inner img { max-width: 100%; height: auto; display: block; border-radius: 8px; }

/* Compact application-pipeline summary. The detailed, live inspection board stays available on demand. */
.pipeline-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
  flex-wrap: wrap;
}
.pipeline-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}
.pipeline-schedule { font-size: .74rem; }
.pipeline-actions { display: inline-flex; gap: 6px; margin-left: auto; }
.pipeline-actions .btn { padding: 6px 9px; font-size: .76rem; }
.pipeline-compact { margin-top: 10px; }
.pipeline-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(105px, 1fr));
  gap: 6px;
}
.pipeline-metric {
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-alt);
}
.pipeline-metric > span,
.pipeline-metric > small { display: block; color: var(--text-muted); }
.pipeline-metric > span { font-size: .7rem; }
.pipeline-metric > strong { display: block; margin: 1px 0; font-size: 1rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.pipeline-metric > small { overflow: hidden; font-size: .66rem; text-overflow: ellipsis; white-space: nowrap; }
.pipeline-metric.is-success > strong { color: var(--success); }
.pipeline-metric.is-warning > strong { color: var(--warning); }
.pipeline-ats-breakdown { margin-top: 8px; }
.pipeline-ats-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 0 2px 4px;
  font-size: .74rem;
}
.pipeline-ats-heading .muted { font-size: .68rem; }
.pipeline-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 8px; }
.pipeline-table { width: 100%; border-collapse: collapse; font-size: .74rem; font-variant-numeric: tabular-nums; }
.pipeline-table th,
.pipeline-table td { padding: 5px 9px; border-bottom: 1px solid var(--border); text-align: right; white-space: nowrap; }
.pipeline-table thead th { color: var(--text-muted); background: var(--surface-alt); font-size: .66rem; font-weight: 600; }
.pipeline-table th:first-child { text-align: left; }
.pipeline-table tbody th { font-weight: 600; }
.pipeline-table tbody tr:last-child th,
.pipeline-table tbody tr:last-child td { border-bottom: 0; }
.pipeline-failed { color: var(--danger); }
.pipeline-state-line { margin: 7px 2px 0; color: var(--text-muted); font-size: .7rem; }
.pipeline-live-details { margin-top: 9px; border-top: 1px solid var(--border); }
.pipeline-live-details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 2px 0;
  cursor: pointer;
  list-style: none;
  font-size: .76rem;
}
.pipeline-live-details > summary::-webkit-details-marker { display: none; }
.pipeline-live-details > summary > span:first-child { display: flex; align-items: baseline; gap: 7px; min-width: 0; }
.pipeline-live-details > summary small { color: var(--text-muted); font-size: .68rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pipeline-live-details > summary::after { content: "⌄"; color: var(--text-muted); font-size: .95rem; }
.pipeline-live-details[open] > summary::after { transform: rotate(180deg); }
.pipeline-live-details[open] > .orch-queue-board { margin-top: 12px; }

/* Live orchestrator queue / worker board */
.orch-queue-board {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.orch-board-head,
.orch-subsection-head,
.orch-worker-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.orch-board-head h3,
.orch-subsection-head h4 { margin: 0; }
.orch-board-head h3 { font-size: 1rem; }
.orch-board-head p { margin-top: 3px; font-size: .82rem; }
.orch-live-badge {
  padding: 4px 9px;
  border-radius: 999px;
  font-size: .74rem;
  font-weight: 700;
  white-space: nowrap;
}
.orch-live-badge.is-live { color: var(--success); background: var(--success-soft); }
.orch-live-badge.is-idle { color: var(--text-muted); background: var(--surface-alt); }
.orch-queue-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 8px;
  margin-top: 14px;
}
.orch-queue-metric {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-alt);
}
.orch-queue-metric span,
.orch-queue-metric small { display: block; }
.orch-queue-metric span { font-size: .73rem; }
.orch-queue-metric strong {
  display: block;
  margin: 2px 0;
  font-size: 1.2rem;
  line-height: 1.25;
}
.orch-queue-metric small {
  overflow: hidden;
  color: var(--text-muted);
  font-size: .72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.orch-subsection { margin-top: 16px; }
.orch-subsection-head { margin-bottom: 8px; }
.orch-subsection-head h4 { font-size: .88rem; }
.orch-subsection-head > .muted { font-size: .76rem; }
.orch-worker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
}
.orch-worker-card {
  min-width: 0;
  min-height: 122px;
  padding: 10px 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}
.orch-worker-card.is-working { border-color: color-mix(in srgb, var(--accent) 42%, var(--border)); }
.orch-worker-card.is-waiting { opacity: .78; }
.orch-worker-topline { font-size: .76rem; }
.orch-state {
  padding: 3px 7px;
  border-radius: 999px;
  font-size: .67rem;
  font-weight: 700;
  line-height: 1.2;
}
.orch-state-applying { color: var(--success); background: var(--success-soft); }
.orch-state-waiting { color: var(--text-muted); background: var(--surface-alt); }
.orch-state-opening_browser,
.orch-state-claiming,
.orch-state-claimed { color: var(--accent); background: var(--accent-soft); }
.orch-state-closing_browser { color: var(--warning); background: var(--warning-soft); }
.orch-worker-job {
  overflow: hidden;
  margin-top: 9px;
  font-size: .84rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.orch-worker-company {
  overflow: hidden;
  margin-top: 1px;
  color: var(--text-muted);
  font-size: .76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.orch-worker-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
  color: var(--text-muted);
  font-size: .7rem;
}
.orch-ats-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--text);
  background: var(--surface-alt);
  font-size: .68rem;
  font-weight: 700;
  white-space: nowrap;
}
.orch-job-link {
  display: inline-block;
  margin-top: 7px;
  color: var(--accent);
  font-size: .72rem;
  font-weight: 650;
  text-decoration: none;
}
.orch-job-link:hover { text-decoration: underline; }
.orch-empty {
  padding: 13px;
  border: 1px dashed var(--border-strong);
  border-radius: 9px;
  color: var(--text-muted);
  font-size: .78rem;
  text-align: center;
}
.orch-queued-list {
  max-height: 310px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.orch-queued-row {
  display: grid;
  grid-template-columns: 28px minmax(180px, 1fr) 120px minmax(120px, .7fr) 58px;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--separator);
  font-size: .76rem;
}
.orch-queued-row:last-child { border-bottom: 0; }
.orch-queue-position { color: var(--text-dim); font-variant-numeric: tabular-nums; text-align: right; }
.orch-queued-job { min-width: 0; }
.orch-queued-job b,
.orch-queued-job span,
.orch-queued-tenant { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.orch-queued-job b { font-size: .78rem; }
.orch-queued-job span,
.orch-queued-tenant { color: var(--text-muted); font-size: .7rem; }
.orch-queued-tenant { min-width: 0; }

@media (max-width: 720px) {
  .pipeline-metrics { grid-template-columns: repeat(2, minmax(110px, 1fr)); }
  .pipeline-live-details > summary > span:first-child { min-width: 0; }
  .pipeline-live-details > summary small { display: none; }
  .orch-queue-metrics { grid-template-columns: repeat(2, minmax(130px, 1fr)); }
  .orch-queued-row { grid-template-columns: 24px minmax(0, 1fr) auto; }
  .orch-queued-row > .orch-queued-tenant { display: none; }
  .orch-queued-row > .orch-job-link { margin-top: 0; }
}
@media (max-width: 480px) {
  .pipeline-heading { align-items: flex-start; }
  .pipeline-actions { width: 100%; margin-left: 0; }
  .pipeline-actions .btn { flex: 1; }
  .pipeline-table th,
  .pipeline-table td { padding: 5px 7px; }
  .pipeline-live-details > summary { align-items: flex-start; }
  .pipeline-live-details > summary > .muted { display: none; }
  .orch-queue-metrics { grid-template-columns: 1fr 1fr; gap: 6px; }
  .orch-queue-metric { padding: 8px 9px; }
  .orch-queue-metric strong { font-size: 1.05rem; }
  .orch-queue-metric small { white-space: normal; }
  .orch-worker-grid { grid-template-columns: 1fr; }
}

/* Application operations center: fixed live rows, durable ledger counts, no hidden lists. */
.application-operations {
  margin: 12px 0;
  padding: 10px 12px;
  overflow: hidden;
}
.operations-heading,
.operations-title-line,
.operations-section-heading,
.operations-row-meta,
.operations-monitor-actions {
  display: flex;
  align-items: center;
}
.operations-heading {
  justify-content: space-between;
  gap: 12px;
}
.operations-heading-copy { min-width: 0; }
.operations-title-line { gap: 7px; flex-wrap: wrap; }
.operations-title-line h2 { margin: 0; font-size: 1.05rem; }
.operations-live,
.operations-state,
.operations-ats {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  border-radius: 999px;
  font-size: .64rem;
  font-weight: 750;
  line-height: 1.2;
  white-space: nowrap;
}
.operations-live { padding: 3px 7px; background: var(--surface-alt); color: var(--text-muted); }
.operations-live.is-live { background: var(--success-soft); color: var(--success); }
.operations-live.is-paused { background: var(--warning-soft); color: var(--warning); }
.operations-worker-count { color: var(--text-muted); font-size: .72rem; font-variant-numeric: tabular-nums; }
.operations-schedule {
  margin: 1px 0 0;
  overflow: hidden;
  color: var(--text-muted);
  font-size: .7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.operations-queue-control { flex: 0 0 auto; padding: 6px 10px; font-size: .75rem; }
.operations-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-top: 7px;
}
.operations-metric {
  min-width: 0;
  padding: 4px 7px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-alt);
}
.operations-metric > span,
.operations-metric > small { display: block; color: var(--text-muted); }
.operations-metric > span { font-size: .61rem; }
.operations-metric > strong {
  display: block;
  margin: 1px 0;
  overflow: hidden;
  font-size: .9rem;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.operations-metric > small {
  overflow: hidden;
  font-size: .56rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.operations-metric.is-success > strong { color: var(--success); }
.operations-metric.is-warning > strong { color: var(--warning); }
.operations-worker-config {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  margin-top: 7px;
  padding: 5px 7px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-alt);
}
.operations-worker-config-label,
.operations-worker-stepper > label {
  color: var(--text-muted);
  font-size: .61rem;
  font-weight: 700;
  white-space: nowrap;
}
.operations-mode-toggle { display: inline-flex; min-width: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 6px; }
.operations-mode-button {
  display: grid;
  gap: 0;
  min-width: 82px;
  padding: 3px 6px;
  border: 0;
  border-right: 1px solid var(--border);
  color: var(--text-muted);
  background: var(--surface);
  cursor: pointer;
  font: inherit;
  line-height: 1.1;
  text-align: left;
}
.operations-mode-button:last-child { border-right: 0; }
.operations-mode-button b { font-size: .62rem; }
.operations-mode-button small { overflow: hidden; font-size: .52rem; text-overflow: ellipsis; white-space: nowrap; }
.operations-mode-button:hover:not(:disabled) { color: var(--text); background: var(--surface-alt); }
.operations-mode-button.is-selected { color: var(--accent); background: var(--accent-soft); }
.operations-mode-button:disabled { cursor: wait; opacity: .62; }
.operations-worker-stepper { display: inline-flex; align-items: center; gap: 3px; }
.operations-worker-stepper select {
  min-width: 48px;
  min-height: 24px;
  padding: 1px 4px;
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--surface);
  font: inherit;
  font-size: .76rem;
  line-height: 1;
  border-radius: 5px;
  cursor: pointer;
}
.operations-worker-stepper select:hover:not(:disabled) { border-color: var(--accent); }
.operations-worker-stepper select:disabled { cursor: wait; opacity: .62; }
.operations-worker-stepper small { color: var(--text-muted); font-size: .54rem; white-space: nowrap; }
.operations-worker-config-note {
  min-width: 0;
  margin-left: auto;
  overflow: hidden;
  color: var(--text-muted);
  font-size: .58rem;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.operations-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 1.08fr) minmax(260px, .94fr);
  gap: 12px;
  margin-top: 9px;
}
.operations-column { min-width: 0; }
.operations-section-heading {
  justify-content: space-between;
  gap: 8px;
  min-height: 17px;
  margin-bottom: 3px;
}
.operations-section-heading h3 { margin: 0; font-size: .73rem; }
.operations-section-heading > span {
  overflow: hidden;
  color: var(--text-muted);
  font-size: .58rem;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.operations-row-list {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}
.operations-worker-row,
.operations-queue-row {
  display: grid;
  align-items: center;
  min-width: 0;
  min-height: 34px;
  padding: 1px 5px;
  border-bottom: 1px solid var(--separator);
}
.operations-worker-row { grid-template-columns: 25px minmax(0, 1fr) 34px; gap: 5px; }
.operations-queue-row { grid-template-columns: 18px minmax(0, 1fr) 72px 34px; gap: 5px; }
.operations-worker-row:last-child,
.operations-queue-row:last-child { border-bottom: 0; }
.operations-worker-row.has-job { background: color-mix(in srgb, var(--accent) 4%, var(--surface)); }
.operations-worker-row.is-ready,
.operations-queue-row.is-empty { background: var(--surface-alt); }
.operations-slot {
  color: var(--text-muted);
  font-size: .66rem;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.operations-slot.is-headless { color: var(--accent); }
.operations-row-copy { min-width: 0; }
.operations-row-meta { gap: 3px; min-width: 0; height: 11px; }
.operations-state { max-width: 80px; padding: 1px 4px; overflow: hidden; background: var(--surface-alt); color: var(--text-muted); font-size: .58rem; text-overflow: ellipsis; }
.operations-state.state-applying { background: var(--success-soft); color: var(--success); }
.operations-state.state-opening_browser,
.operations-state.state-claiming,
.operations-state.state-claimed { background: var(--accent-soft); color: var(--accent); }
.operations-state.state-closing_browser,
.operations-state.state-stopping { background: var(--warning-soft); color: var(--warning); }
.operations-ats {
  max-width: 68px;
  justify-content: center;
  padding: 1px 4px;
  overflow: hidden;
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--surface-alt);
  text-overflow: ellipsis;
}
.operations-elapsed {
  overflow: hidden;
  margin-left: auto;
  color: var(--text-muted);
  font-size: .55rem;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.operations-job,
.operations-queue-job { min-width: 0; }
.operations-job b,
.operations-job span,
.operations-queue-job b,
.operations-queue-job span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.operations-job b,
.operations-queue-job b { font-size: .64rem; line-height: 1.05; }
.operations-job span,
.operations-queue-job span { color: var(--text-muted); font-size: .55rem; line-height: 1; }
.operations-job-link,
.operations-no-link {
  color: var(--accent);
  font-size: .57rem;
  font-weight: 700;
  text-align: right;
  text-decoration: none;
  white-space: nowrap;
}
.operations-job-link:hover { text-decoration: underline; }
.operations-no-link { color: var(--text-dim); }
.operations-queue-row > .operations-ats { justify-self: end; }
.operations-ats-table {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: .63rem;
  font-variant-numeric: tabular-nums;
}
.operations-ats-row {
  display: grid;
  grid-template-columns: minmax(56px, 1fr) 32px 42px 47px 47px 43px;
  align-items: center;
  gap: 3px;
  min-height: 18px;
  padding: 1px 5px;
  border-bottom: 1px solid var(--separator);
}
.operations-ats-row:last-child { border-bottom: 0; }
.operations-ats-row > span:not(:first-child) { text-align: right; }
.operations-ats-head { min-height: 25px; background: var(--surface-alt); color: var(--text-muted); font-size: .53rem; font-weight: 700; line-height: .95; }
.operations-ats-head > span { overflow: hidden; text-overflow: ellipsis; white-space: normal; }
.operations-ats-head > span:not(:first-child) { text-align: right; }
.operations-ats-row .is-failure,
.operations-failure-summary .is-failure { color: var(--danger); }
.operations-success-rate { color: var(--success); font-weight: 750; }
.operations-failure-summary {
  display: grid;
  grid-template-columns: .72fr .62fr minmax(0, 1.45fr);
  gap: 7px;
  margin-top: 5px;
}
.operations-failure-summary > div { min-width: 0; }
.operations-failure-summary span,
.operations-failure-summary b { display: block; }
.operations-failure-summary span { color: var(--text-muted); font-size: .55rem; }
.operations-failure-summary b {
  overflow: hidden;
  font-size: .66rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.operations-failure-categories {
  display: flex;
  min-height: 18px;
  align-items: center;
  gap: 4px;
  overflow: hidden;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: .54rem;
}
.operations-failure-categories > span {
  max-width: 100%;
  overflow: hidden;
  padding: 1px 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.operations-monitor-actions { justify-content: flex-end; gap: 5px; margin-top: 4px; }
.operations-monitor-actions .btn { min-height: 22px; padding: 3px 7px; font-size: .6rem; }

@media (max-width: 980px) {
  .operations-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .operations-monitor { grid-column: 1 / -1; }
}
@media (max-width: 680px) {
  .application-operations { padding: 11px; }
  .operations-heading { align-items: flex-start; }
  .operations-queue-control { padding: 6px 8px; }
  .operations-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .operations-worker-config { flex-wrap: wrap; }
  .operations-worker-config-note { width: 100%; margin-left: 0; text-align: left; }
  .operations-grid { grid-template-columns: 1fr; gap: 10px; }
  .operations-monitor { grid-column: auto; }
  .operations-ats-row { grid-template-columns: minmax(52px, 1fr) 30px 38px 44px 43px 40px; }
}
@media (max-width: 420px) {
  .operations-heading { flex-wrap: wrap; }
  .operations-queue-control { width: 100%; }
  .operations-queue-row { grid-template-columns: 17px minmax(0, 1fr) 58px 30px; gap: 4px; }
  .operations-worker-config-label { width: 100%; }
  .operations-mode-toggle { width: 100%; }
  .operations-mode-button { flex: 1; }
  .operations-ats { max-width: 58px; font-size: .58rem; }
  .operations-failure-summary { grid-template-columns: .7fr .6fr minmax(0, 1.3fr); }
}
