/* Editorial Briefing design system — see docs handoff "Dashboard - Editorial".
   Loaded after the legacy inline <style> so it restyles the app shell and
   provides the shared component classes each redesigned view uses. */

:root {
  /* Paper / neutral ramp */
  --paper: #f6f3ec; /* screen background (frame) */
  --canvas: #e6e2d9; /* outer page behind the frame */
  --fill: #fffdf8; /* inputs, sub-cards */
  --warm: #efe7d6; /* chips, collapsed rows, active sub-nav */
  --ink: #26221b; /* headings, wordmark, 2px rules */
  --ink-body: #3d372d; /* body copy */
  --ink-muted: #6b6357; /* secondary values */
  --ink-faint: #7a7264; /* labels, inactive nav */
  --ink-faintest: #8a8172; /* uppercase eyebrow labels */
  --hairline-faint: #a99f8d; /* meta text, table rank numbers */
  --rule: #ddd3c2; /* section dividers, metric-strip borders */
  --row-rule: #e6ddcd; /* table row separators */
  --input-border: #d9cfbd; /* input / control borders */
  --chip-border: #e0d5c0;

  /* Brand (OUTFRONT) — the only gradient */
  --brand-gradient: linear-gradient(90deg, #64008f 0%, #4e0070 55%, #37004f 100%);
  --accent: #64008f; /* OUTFRONT purple — nav underline, links, focus, avatar, primary */
  --accent-deep: #37004f; /* pressed / dense */
  --soft: rgba(100, 0, 143, 0.06); /* purple tint — hover/fill */

  /* Data-viz series */
  --series1: #64008f; /* primary series — purple (was --accent terracotta) */
  --series2: #3f6b7d; /* slate-teal — kept */
  --series3: #b5502f; /* terracotta — kept, data-viz only (demoted from accent) */

  /* Status / semantic */
  --pos-text: #166534;
  --pos-fill: #dcf3dd;
  --warn-text: #854d0e;
  --warn-fill: #f6ecc8;
  --watch-text: #9a6700;
  --danger: #cf222e;
  --merged-text: #8250df;
  --merged-fill: #f3ecfb;
  --nudge-fill: #fbeee6;
  --nudge-border: #eccbb8;
  --neutral: #57606a;

  /* Type */
  --serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --sans: 'Public Sans', system-ui, -apple-system, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
}

/* ---------- shell restyle (overrides legacy .app-header/.tab-bar/.content) ---------- */
body {
  background: var(--canvas) !important;
  color: var(--ink) !important;
  font-family: var(--sans) !important;
}

.eb-frame {
  max-width: 1040px;
  margin: 32px auto;
  background: var(--paper);
  border-radius: 14px;
  box-shadow:
    0 8px 30px rgba(38, 34, 27, 0.14),
    0 1px 2px rgba(38, 34, 27, 0.1);
  /* `clip` clips to the rounded corners like `hidden` but does NOT establish a
     scroll container, so descendant `position: sticky` (e.g. the developer
     profile's right rail) resolves against the viewport rather than the frame. */
  overflow: clip;
}
.eb-top {
  padding: 24px 40px 0;
}

/* masthead */
.app-header {
  background: none !important;
  border: none !important;
  border-bottom: 2px solid var(--ink) !important;
  padding: 0 0 16px !important;
  position: static !important;
  z-index: auto !important;
}
.masthead-brand {
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.app-header h1 {
  font-family: var(--serif) !important;
  font-size: 22px !important;
  font-weight: 600 !important;
  letter-spacing: -0.3px;
  color: var(--ink); /* fallback if background-clip unsupported */
  background-image: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0;
}
/* Forced-colors / Windows High Contrast suppresses the gradient background; without
   this the transparent text fill would render the wordmark invisible. Restore solid,
   system-colored text. */
@media (forced-colors: active) {
  .app-header h1 {
    background-image: none;
    -webkit-text-fill-color: revert;
  }
}
.masthead-eyebrow {
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faintest);
}
.header-controls {
  gap: 15px !important;
  font-size: 12.5px;
  color: var(--ink-faint);
}
#last-synced {
  color: var(--accent) !important;
  font-weight: 600 !important;
  font-size: 12.5px !important;
}
/* compact date-range control + popover */
.eb-daterange {
  position: relative;
}
.eb-range-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--ink-faint);
  padding: 4px 2px;
}
.eb-range-toggle:hover {
  color: var(--ink);
}
.eb-range-toggle .eb-caret {
  font-size: 10px;
  color: var(--hairline-faint);
}
.eb-range-popover {
  position: absolute;
  top: 30px;
  right: 0;
  z-index: 200;
  display: none;
  flex-direction: column;
  gap: 10px;
  background: var(--fill);
  border: 1px solid var(--input-border);
  border-radius: 10px;
  padding: 12px;
  box-shadow: 0 8px 24px rgba(38, 34, 27, 0.16);
}
.eb-range-popover.open {
  display: flex;
}
.eb-range-popover .date-reset-btn {
  align-self: flex-start;
}

/* synced status = sync entry point */
.eb-synced {
  color: var(--accent) !important;
  font-weight: 600;
  font-size: 12.5px;
  text-decoration: none;
  white-space: nowrap;
}
.eb-synced:hover {
  text-decoration: underline;
}

/* account = bare avatar (no chrome), dropdown on click */
.account-trigger {
  background: none !important;
  border: none !important;
  padding: 0 !important;
  cursor: pointer;
  color: var(--ink-faint) !important;
}
#account-avatar {
  color: #fff;
}

/* underlined tab nav */
.tab-bar {
  background: none !important;
  border: none !important;
  padding: 12px 40px 0 !important;
  gap: 26px !important;
}
.tab-bar button,
.tab-bar a {
  background: none !important;
  border: none !important;
  border-bottom: 2px solid transparent !important;
  padding: 0 0 9px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  color: var(--ink-faint) !important;
  font-family: var(--sans) !important;
  text-decoration: none !important;
  cursor: pointer !important;
}
.tab-bar button.active,
.tab-bar a.active {
  color: var(--ink) !important;
  font-weight: 600 !important;
  border-bottom-color: var(--accent) !important;
}
.tab-bar button:hover,
.tab-bar a:hover {
  color: var(--ink) !important;
}

/* Insights dropdown: trigger reuses .tab-bar button styling; on-theme popover
   modeled on .eb-range-popover so it matches the period picker. */
.insights-nav {
  position: relative;
  display: inline-flex;
}
.insights-menu {
  position: absolute;
  top: 30px;
  left: 0;
  z-index: 200;
  display: none;
  flex-direction: column;
  min-width: 150px;
  background: var(--fill);
  border: 1px solid var(--input-border);
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 8px 24px rgba(38, 34, 27, 0.16);
}
.insights-menu.open {
  display: flex;
}
.insights-item {
  display: block;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-faint);
  text-decoration: none;
  white-space: nowrap;
}
.insights-item:hover {
  background: var(--paper);
  color: var(--ink);
}
.insights-item.active {
  color: var(--accent);
}

/* Masthead utility links (Ask, Settings): muted like the period control,
   accent when active. Distinct from .eb-synced (Sync stays accent-colored). */
.nav-util {
  color: var(--ink-faint);
  font-weight: 600;
  font-size: 12.5px;
  text-decoration: none;
  white-space: nowrap;
}
.nav-util:hover {
  color: var(--ink);
}
.nav-util.active {
  color: var(--accent);
}

.content {
  max-width: none !important;
  margin: 0 !important;
  padding: 28px 40px 36px !important;
}

/* ---------- shared editorial components ---------- */
.eb-lede {
  font-family: var(--serif);
  font-size: 31px;
  line-height: 1.18;
  font-weight: 500;
  letter-spacing: -0.4px;
  max-width: 720px;
  margin: 0 0 6px;
  color: var(--ink);
}
.eb-title {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.3px;
  color: var(--ink);
  margin: 0;
}
.eb-sub {
  font-size: 12.5px;
  color: var(--ink-faint);
  margin-top: 2px;
}
.eb-eyebrow {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faintest);
  font-weight: 600;
}
.eb-eyebrow.accent {
  color: var(--accent);
}
.eb-section-head {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--ink);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.eb-section-head .meta {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-faintest);
}

/* metric strip */
.eb-metric-strip {
  display: flex;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  margin: 0 0 28px;
}
.eb-metric {
  flex: 1;
  padding: 16px 4px 16px 20px;
  border-left: 1px solid var(--rule);
}
.eb-metric:first-child {
  padding-left: 0;
  border-left: none;
}
.eb-metric .fig {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.5px;
  color: var(--ink);
}
.eb-metric .lbl {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faintest);
  margin-top: 2px;
}
.eb-delta {
  font-size: 0.68rem;
  font-family: var(--sans, 'Public Sans', sans-serif);
  margin-left: 6px;
  vertical-align: 3px;
  white-space: nowrap;
}
.eb-delta-up {
  color: var(--pos-text);
}
.eb-delta-down {
  color: var(--danger);
}
.eb-delta-flat {
  color: var(--ink-muted);
}

/* P6: delivery stat band (Trends + repo detail) */
.eb-dband {
  display: flex;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  margin: 10px 0 16px;
}
.eb-dband-cell {
  flex: 1;
  /* let cells shrink below min-content in narrow columns; the delta chip
     wraps under the figure instead of forcing the band wider */
  min-width: 0;
  padding: 12px 14px 10px;
  border-right: 1px solid var(--row-rule);
}
.eb-dband-cell:last-child {
  border-right: none;
}
.eb-dband-num {
  font-family: var(--serif);
  font-size: 1.35rem;
  color: var(--ink);
}
.eb-dband-lbl {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-top: 2px;
}
.eb-dband-accent .eb-dband-num {
  color: var(--accent);
}
.eb-dband-accent .eb-dband-lbl {
  color: var(--accent);
  font-weight: 600;
}
/* P6: hover/focus-for-definition cue on each delivery label. Cells are
   tabindex="0" so keyboard users can reach the title tooltip too. */
.eb-dband-cell {
  cursor: help;
}
.eb-dband-info {
  font-size: 0.82em;
  color: var(--hairline-faint);
  vertical-align: 0.05em;
}
.eb-dband-cell:hover .eb-dband-info,
.eb-dband-cell:focus-visible .eb-dband-info {
  color: var(--accent);
}
.eb-dband-accent .eb-dband-info {
  color: var(--accent);
}
.eb-dband-cell:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

/* P7: richer per-team benchmark band — rank chip + position ticks + vs-org
   line, alongside the existing eb-dband cell/label/value styles. */
.eb-dbench .eb-dbench-cell {
  flex: 1;
  padding: 12px 14px 10px;
  border-right: 1px solid var(--row-rule);
}
.eb-dbench .eb-dbench-cell:last-child {
  border-right: none;
}
.eb-dbench-rank {
  margin-left: 6px;
  vertical-align: 2px;
}
.eb-dbench-tier-good {
  color: var(--pos-text);
  background: var(--pos-fill);
}
.eb-dbench-tier-mid {
  color: var(--warn-text);
  background: var(--warn-fill);
}
.eb-dbench-tier-bad {
  color: var(--danger);
  background: var(--warn-fill);
}
.eb-dbench-ticks {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-top: 6px;
}
.eb-dbench-tick {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--row-rule);
  flex: none;
}
.eb-dbench-tick-active {
  background: var(--accent);
  width: 7px;
  height: 7px;
}
.eb-dbench-vsorg {
  font-size: 0.68rem;
  color: var(--ink-muted);
  margin-top: 4px;
  white-space: nowrap;
}
.eb-dbench-vsorg .eb-delta {
  margin-left: 4px;
}

/* hairline table (grid-driven; set --cols per table) */
.eb-table {
  width: 100%;
}
.eb-thead {
  display: grid;
  grid-template-columns: var(--cols);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faintest);
  font-weight: 600;
  padding: 0 0 9px;
  border-bottom: 2px solid var(--ink);
}
.eb-row {
  display: grid;
  grid-template-columns: var(--cols);
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid var(--row-rule);
  font-size: 13px;
}
.eb-row:last-child {
  border-bottom: none;
}
.eb-row.clickable {
  cursor: pointer;
}
.eb-row.clickable:hover {
  background: var(--warm);
}
.eb-r {
  text-align: right;
}
.eb-mono {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-muted);
}
.eb-mono.accent {
  color: var(--accent);
  font-weight: 500;
}
.eb-type-token {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.eb-rank {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--hairline-faint);
}

/* ranked mini list (Summary columns) */
.eb-minirow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--row-rule);
  font-size: 13px;
}
.eb-minirow:last-child {
  border-bottom: none;
}
.eb-minirow .v {
  color: var(--ink-faint);
  font-weight: 600;
}
.eb-minirow .v.top {
  color: var(--accent);
}

/* avatars + glyphs */
.eb-avatar {
  border-radius: 50%;
  color: #fff;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.eb-glyph {
  border-radius: 8px;
  color: #fff;
  font-family: var(--serif);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* chips + pills */
.eb-chip {
  font-size: 11px;
  background: var(--warm);
  border: 1px solid var(--chip-border);
  border-radius: 12px;
  padding: 1px 8px;
  color: var(--ink-muted);
  white-space: nowrap;
}
.eb-repochip {
  font-size: 10.5px;
  color: var(--ink-faint);
  background: var(--warm);
  border-radius: 4px;
  padding: 1px 7px;
}
.eb-pill {
  font-size: 10px;
  font-weight: 600;
  border-radius: 3px;
  padding: 2px 7px;
}
.eb-pill.round {
  border-radius: 10px;
}
.eb-pill.green {
  color: var(--pos-text);
  background: var(--pos-fill);
}
.eb-pill.amber {
  color: var(--warn-text);
  background: var(--warn-fill);
}
.eb-pill.merged {
  color: var(--merged-text);
  background: var(--merged-fill);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 9.5px;
}
.eb-pill.open {
  color: var(--pos-text);
  background: var(--pos-fill);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 9.5px;
}

/* lines +/- */
.eb-add {
  color: var(--pos-text);
}
.eb-del {
  color: var(--accent);
}
.eb-slash {
  color: var(--hairline-faint);
}

/* buttons */
.eb-btn {
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 12.5px;
  font-weight: 600;
  font-family: var(--sans);
  cursor: pointer;
  background: none;
}
.eb-btn.primary {
  background: var(--brand-gradient);
  color: #fff;
  border: none;
}
.eb-btn.outline {
  border: 1px solid var(--ink);
  color: var(--ink);
}
.eb-btn.faint {
  border: 1px solid var(--input-border);
  color: var(--ink-faint);
}

/* inputs */
.eb-input {
  background: var(--fill);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12.5px;
  font-family: var(--sans);
  color: var(--ink);
}

/* bar chart (warm ramp) */
.eb-bars {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 120px;
  border-bottom: 1px solid var(--rule);
}
.eb-bars .bar {
  flex: 1;
  min-height: 2px;
  border-radius: 2px 2px 0 0;
}
.eb-bars-axis {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--hairline-faint);
  margin-top: 6px;
}

/* layout helpers */
.eb-cols-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}
.eb-cols-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 36px;
}
/* 1fr tracks are minmax(auto, 1fr): wide unbreakable content (e.g. extreme
   delivery deltas) would expand a column past the container and clip the
   other column. Cap every column at its allotted share instead. */
.eb-cols-2 > *,
.eb-cols-3 > * {
  min-width: 0;
}
.eb-backlink {
  font-size: 12.5px;
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
  display: inline-block;
  margin-bottom: 18px;
  background: none;
  border: none;
  padding: 0;
  font-family: var(--sans);
}
.eb-narrative {
  font-size: 14px;
  line-height: 1.68;
  color: var(--ink-body);
}
.eb-muted {
  color: var(--ink-faint);
}
.eb-empty {
  color: var(--ink-faint);
  font-size: 13px;
  padding: 24px 0;
}

/* Settings toggle switches → editorial (off = warm border, on = terracotta) */
.toggle-slider {
  background-color: var(--input-border) !important;
}
.toggle-switch input:checked + .toggle-slider {
  background-color: var(--accent) !important;
}

/* Native checkboxes → terracotta accent (Settings org/workspace pickers, etc.) */
.content input[type='checkbox'] {
  accent-color: var(--accent);
}

/* Repo-detail "Automated activity" collapse (editorial class names) */
.eb-automated-section.collapsed .eb-automated-content {
  display: none;
}

/* --- Summary dek + full-briefing modal --- */
.eb-narrative-dek {
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
}
.eb-narrative-dek p {
  margin: 0 0 8px;
}
.eb-briefing-open {
  display: inline-block;
  margin: 12px 12px 0 0;
  padding: 0;
  background: none;
  border: none;
  color: var(--accent);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.eb-briefing-open:hover {
  text-decoration: underline;
}
.eb-briefing-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 1000;
}
.eb-briefing-modal {
  background: var(--paper);
  border-radius: 12px;
  width: 100%;
  max-width: 680px;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.eb-briefing-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--row-rule);
}
.eb-briefing-title {
  font-family: var(--serif);
  font-size: 18px;
  color: var(--ink);
}
.eb-briefing-range {
  font-size: 12px;
  color: var(--ink-faintest);
  margin-top: 2px;
}
.eb-briefing-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.eb-briefing-copy {
  background: none;
  border: 1px solid var(--row-rule);
  border-radius: 6px;
  font: inherit;
  font-size: 12px;
  color: var(--ink-faint);
  cursor: pointer;
  padding: 4px 10px;
}
.eb-briefing-copy:hover {
  color: var(--ink);
}
.eb-briefing-close {
  background: none;
  border: none;
  font-size: 16px;
  line-height: 1;
  color: var(--ink-faint);
  cursor: pointer;
  padding: 4px;
}
.eb-briefing-close:hover {
  color: var(--ink);
}
.eb-briefing-body {
  padding: 18px 22px;
  overflow-y: auto;
}

/* ==========================================================================
   Shared components added for the orphan-page restyle (login/setup/sync).
   All token-driven — see docs/style-guide.md.
   ========================================================================== */

/* ---------- inline alerts (login / setup / sync errors) ----------
   Hidden by default; page scripts toggle `.visible` (matches the pre-existing
   login/setup show/hide logic, so those scripts need no changes). */
.eb-alert {
  display: none;
  border-radius: 8px;
  padding: 11px 14px;
  font-size: 12.5px;
  line-height: 1.5;
  margin-bottom: 16px;
  border: 1px solid transparent;
}
.eb-alert.visible {
  display: block;
}
.eb-alert.error {
  color: var(--danger);
  background: var(--nudge-fill);
  border-color: color-mix(in srgb, var(--danger) 25%, transparent);
}
.eb-alert.success {
  color: var(--pos-text);
  background: var(--pos-fill);
  border-color: color-mix(in srgb, var(--pos-text) 25%, transparent);
}

/* ---------- inline status text (Settings forms) ----------
   Twin of the legacy inline `<span style="color:...">` save/error feedback
   in settings.js — plain colored text, no box, unlike `.eb-alert` above. */
.eb-status-message-success {
  color: var(--pos-text);
}
.eb-status-message-error {
  color: var(--danger);
}

/* ---------- contributor typeahead (Settings: team members, identity merge) ---------- */
.eb-typeahead {
  position: relative;
}
.eb-typeahead-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.eb-typeahead-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--warm);
  border: 1px solid var(--chip-border);
  border-radius: 16px;
  padding: 2px 8px 2px 10px;
  font-size: 12.5px;
  color: var(--ink-body);
}
.eb-typeahead-chip button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink-faint);
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
}
.eb-typeahead-input-wrap {
  position: relative;
}
.eb-typeahead-input-wrap input {
  width: 100%;
  box-sizing: border-box;
  background: var(--fill);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12.5px;
  font-family: var(--sans);
  color: var(--ink);
}
.eb-typeahead-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 200px;
  overflow-y: auto;
  background: var(--fill);
  border: 1px solid var(--input-border);
  border-top: none;
  border-radius: 0 0 8px 8px;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(38, 34, 27, 0.12);
}
.eb-typeahead-result {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 12.5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--row-rule);
}
.eb-typeahead-result:last-child {
  border-bottom: none;
}
.eb-typeahead-result:hover {
  background: var(--warm);
}
.eb-typeahead-login {
  color: var(--ink-faint);
}

/* ---------- auth pages (login / setup) ---------- */
.eb-auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--canvas);
}
.eb-auth-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 34px 32px;
  width: 100%;
  max-width: 420px;
  box-shadow:
    0 8px 30px rgba(38, 34, 27, 0.12),
    0 1px 2px rgba(38, 34, 27, 0.08);
}
.eb-auth-head {
  text-align: center;
  margin-bottom: 24px;
}
.eb-auth-title {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.3px;
  color: var(--ink);
  margin-bottom: 6px;
}
.eb-auth-sub {
  font-size: 12.5px;
  color: var(--ink-faint);
  line-height: 1.5;
}
.eb-field {
  margin-bottom: 16px;
}
.eb-field label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ink-faintest);
  margin-bottom: 6px;
}
.eb-field .eb-input {
  width: 100%;
}
.eb-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(181, 80, 47, 0.12);
}
.eb-checkrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  font-size: 12.5px;
  color: var(--ink-body);
}
.eb-auth-card input[type='checkbox'] {
  accent-color: var(--accent);
}
/* warm sub-panel (setup password requirements) */
.eb-subpanel {
  background: var(--warm);
  border: 1px solid var(--chip-border);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 20px;
  font-size: 12px;
  color: var(--ink-muted);
}
.eb-subpanel h3 {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faintest);
  font-weight: 600;
  margin-bottom: 8px;
}
.eb-subpanel ul {
  margin-left: 18px;
  line-height: 1.7;
}

/* ---------- button + pill variants needed by sync ---------- */
.eb-btn.danger {
  background: var(--danger);
  color: #fff;
  border: 1px solid var(--danger);
}
.eb-btn.full {
  width: 100%;
  display: block;
  text-align: center;
}
.eb-btn .spinner {
  width: 13px;
  height: 13px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  display: none;
  animation: eb-spin 0.8s linear infinite;
  vertical-align: -2px;
  margin-right: 4px;
}
.eb-btn.syncing .spinner {
  display: inline-block;
}
@keyframes eb-spin {
  to {
    transform: rotate(360deg);
  }
}
.eb-pill.danger {
  color: var(--danger);
  background: var(--nudge-fill);
}
.eb-pill.info {
  color: var(--accent);
  background: var(--nudge-fill);
}

/* ---------- live console (sync) — editorialized (light paper panel) ---------- */
.eb-console {
  background: var(--fill);
  border: 1px solid var(--input-border);
  border-radius: 10px;
  padding: 14px 16px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-body);
  min-height: 200px;
  max-height: 400px;
  overflow-y: auto;
}
.eb-console .log-line {
  padding: 1px 0;
  white-space: pre-wrap;
}
.eb-console .log-success {
  color: var(--pos-text);
}
.eb-console .log-complete {
  color: var(--pos-text);
  font-weight: 600;
}
.eb-console .log-error {
  color: var(--danger);
}
.eb-console .log-batch {
  color: var(--merged-text);
}
.eb-console .log-skip,
.eb-console .log-dim,
.eb-console .log-muted {
  color: var(--ink-faint);
}

/* ---------- progress bar (sync) ---------- */
.eb-progress-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--ink-faint);
}
.eb-progress-pct {
  font-weight: 600;
  color: var(--accent);
}
.eb-progress-track {
  background: var(--rule);
  border-radius: 4px;
  height: 8px;
  overflow: hidden;
}
.eb-progress-bar {
  background: var(--accent);
  height: 100%;
  border-radius: 4px;
  width: 0%;
  transition: width 0.3s ease;
}
.eb-progress-stats {
  display: flex;
  gap: 16px;
  margin-top: 6px;
  font-size: 11px;
  color: var(--ink-faint);
}

/* ---------- semantic data table (sync history) ----------
   Visual twin of the grid `.eb-table` but on a real <table>, so row-cell
   index access (updateCurrentSyncRow) keeps working. */
.eb-datatable {
  width: 100%;
  border-collapse: collapse;
}
.eb-datatable thead th {
  text-align: left;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faintest);
  font-weight: 600;
  padding: 0 14px 9px;
  border-bottom: 2px solid var(--ink);
}
.eb-datatable tbody td {
  padding: 11px 14px;
  font-size: 13px;
  color: var(--ink-body);
  border-bottom: 1px solid var(--row-rule);
}
.eb-datatable tbody tr:last-child td {
  border-bottom: none;
}

/* ---------- Ask (conversational analytics) ---------- */
.ask-view {
  max-width: 720px;
}
.ask-hint {
  font-size: 12.5px;
  color: var(--ink-faint);
  margin-top: 2px;
  margin-bottom: 18px;
}
.ask-transcript {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 60vh;
  overflow-y: auto;
  padding: 4px 2px;
  margin-bottom: 16px;
}
.ask-q {
  align-self: flex-end;
  max-width: 85%;
  background: var(--soft);
  color: var(--ink);
  border-radius: 12px 12px 2px 12px;
  padding: 9px 13px;
  font-size: 13px;
  line-height: 1.5;
}
.ask-a {
  align-self: flex-start;
  max-width: 85%;
  background: var(--fill);
  border: 1px solid var(--rule);
  border-radius: 12px 12px 12px 2px;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-body);
}
.ask-a.ask-error {
  color: var(--danger);
  background: var(--nudge-fill);
  border-color: color-mix(in srgb, var(--danger) 25%, transparent);
}
.ask-a.ask-busy {
  color: var(--ink-faint);
  font-style: italic;
}
.ask-sources {
  margin-top: 8px;
  font-size: 10.5px;
  color: var(--ink-faintest);
}
.ask-form {
  display: flex;
  gap: 10px;
}
.ask-form input {
  flex: 1;
  background: var(--fill);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  padding: 9px 13px;
  font-size: 13px;
  font-family: var(--sans);
  color: var(--ink);
}
.ask-form input:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}
.ask-form button {
  border: none;
  border-radius: 8px;
  padding: 9px 18px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--sans);
  cursor: pointer;
}
.ask-form button:disabled {
  background: var(--input-border);
  color: var(--ink-faint);
  cursor: not-allowed;
}
