/* ==========================================================================
   Growth Engine Design System v2 : GitHub (Primer) look
   Dense, bordered, information-first. White canvas, #d0d7de borders,
   6px radii, system font stack, blue links, green primary actions,
   orange active-tab underline. Reference: Beck's GitHub screenshots,
   21 Jul 2026 (tank/decisions.md).
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans",
    Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  /* Primer-ish palette */
  --canvas: #ffffff;
  --canvas-subtle: #f6f8fa;
  --canvas-inset: #eff2f5;
  --border: #d0d7de;
  --border-muted: #d8dee4;
  --fg: #1f2328;
  --fg-muted: #59636e;
  --fg-subtle: #818b98;
  --accent: #0969da;
  --accent-muted: #ddf4ff;
  --success: #1a7f37;
  /* Primary actions: deep elegant blue (was Primer green) */
  --success-emphasis: #1e3a8a;
  --success-muted: #dafbe1;
  --primary: #1e3a8a;
  --primary-hover: #172f70;
  --primary-muted: #e4e9f7;
  --danger: #d1242f;
  --danger-muted: #ffebe9;
  --attention: #9a6700;
  --attention-muted: #fff8c5;
  --done: #8250df;
  --done-muted: #fbefff;
  --tab-active: #1e3a8a;

  /* Legacy aliases kept so existing views/styles keep working */
  --ink-900: #1f2328;
  --ink-800: #24292f;
  --ink-700: #424a53;
  --ink-500: #59636e;
  --ink-400: #818b98;
  --ink-300: #d0d7de;
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f6f8fa;
  --surface-dim: #f6f8fa;
  --line: #d8dee4;
  --line-dark: #d0d7de;
  --coral-500: #fd8c73;
  --coral-600: #cf222e;
  --pink-500: #bf3989;
  --magenta-500: #bf3989;
  --peach-200: #ffebe9;
  --peach-100: #fff1e5;
  --gold-400: #d4a72c;
  --grad-hero: linear-gradient(118deg, #f98e60 0%, #f4506e 52%, #ec3fa6 100%);
  --grad-bar: linear-gradient(180deg, #54aeff 0%, #0969da 100%);
  --grad-progress: #0969da;
  --up: #1a7f37;
  --up-bg: #dafbe1;
  --down: #d1242f;
  --down-bg: #ffebe9;
  --warn: #9a6700;
  --warn-bg: #fff8c5;
  --info: #0969da;
  --info-bg: #ddf4ff;

  /* Chart series (validated categorical palette; fixed order) */
  --chart-1: #e5563b;
  --chart-2: #3e5ebe;
  --chart-3: #a8790d;
  --chart-4: #de3d82;
  --chart-track: #d0d7de;

  --r: 6px;
  --r-lg: 6px;
  --r-md: 6px;
  --r-sm: 6px;
  --r-xl: 6px;
  --r-pill: 999px;
  --shadow-card: 0 1px 0 rgba(31, 35, 40, 0.04);
  --shadow-pop: 0 8px 24px rgba(140, 149, 159, 0.2);
  --ring: 0 0 0 3px rgba(30, 58, 138, 0.25);
}

::selection { background: rgba(30, 58, 138, 0.15); }

/* Turbo page-load progress bar: it slides over the dark blue brand stripe,
   so it needs a hot contrasting color and a glow to read clearly. */
.turbo-progress-bar {
  height: 4px;
  background: linear-gradient(90deg, #f6c343 0%, #fd8c73 100%);
  box-shadow: 0 0 10px rgba(246, 195, 67, 0.85), 0 1px 3px rgba(253, 140, 115, 0.6);
  z-index: 9999;
}

/* --------------------------------------------------------------------------
   2. Base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { color-scheme: light; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--fg);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p { margin: 0; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  box-shadow: none;
}

/* inline-block so icons sit on the text line inside headings/paragraphs;
   inside flex containers the display value is ignored, so nothing shifts. */
.icon { flex: none; display: inline-block; vertical-align: -0.15em; }

/* The hidden attribute must always win, even over display:flex components
   (the view toggle hides the kanban board this way). */
[hidden] { display: none !important; }

/* --------------------------------------------------------------------------
   3. Typography helpers
   -------------------------------------------------------------------------- */
.display { font-size: 32px; font-weight: 600; }
.h1 { font-size: 26px; font-weight: 600; }
.h2 { font-size: 20px; font-weight: 600; }
.h3 { font-size: 16px; font-weight: 600; }
.h4 { font-size: 14px; font-weight: 600; }
.body-lg { font-size: 14px; }
.body-sm { font-size: 12px; }
.caption { font-size: 12px; color: var(--fg-muted); }
.muted { color: var(--fg-subtle); }
.subtle { color: var(--fg-muted); }
.num { font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------------------
   4. App shell: header, tabs, subnav
   -------------------------------------------------------------------------- */
.gh-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--canvas-subtle);
  border-bottom: 1px solid var(--border-muted);
  /* Subtle brand accent along the very top of the app */
  border-top: 3px solid var(--primary);
}

.gh-burger {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--fg-muted);
  background: transparent;
}

.gh-burger:hover { background: var(--canvas-inset); }

.gh-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gh-brand img { width: 32px; height: 32px; }

.gh-crumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--fg);
}

.gh-crumb a { color: var(--fg); }
.gh-crumb__sep { color: var(--fg-subtle); }
.gh-crumb strong { font-weight: 600; color: var(--primary); }

.gh-header__right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.gh-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 300px;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--canvas);
  color: var(--fg-subtle);
  font-size: 13px;
}

.gh-search:focus-within { border-color: var(--accent); box-shadow: var(--ring); }

.gh-search input {
  border: 0;
  background: none;
  font: inherit;
  color: var(--fg);
  width: 100%;
}

.gh-search input:focus { outline: none; }
.gh-search kbd {
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0 5px;
  font-size: 11px;
  color: var(--fg-subtle);
  font-family: var(--font-sans);
}

/* Universal search dropdown */
.gsearch { position: relative; }

.gsearch__panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 420px;
  max-height: 480px;
  overflow-y: auto;
  background: var(--canvas);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow-pop);
  z-index: 100;
}

.gsearch__group {
  padding: 8px 14px 3px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-subtle);
  background: var(--canvas-subtle);
}

.gsearch__item {
  display: flex;
  flex-direction: column;
  padding: 7px 14px;
  color: var(--fg);
  border-bottom: 1px solid var(--border-muted);
}

.gsearch__item:last-child { border-bottom: 0; }
.gsearch__item:hover, .gsearch__item.is-active { background: var(--accent-muted); text-decoration: none; }
.gsearch__title { font-size: 13px; font-weight: 600; }
.gsearch__sub { font-size: 11.5px; color: var(--fg-muted); }
.gsearch__empty { padding: 16px; font-size: 13px; color: var(--fg-muted); text-align: center; }

.gh-iconbtn {
  position: relative;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--fg-muted);
  background: transparent;
}

.gh-iconbtn:hover { background: var(--canvas-inset); text-decoration: none; }

.gh-iconbtn__dot {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--canvas-subtle);
}

.gh-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 600;
}

/* Tab nav */
.gh-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 16px;
  background: var(--canvas-subtle);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}

.gh-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px 11px;
  font-size: 14px;
  color: var(--fg);
  white-space: nowrap;
  border-radius: var(--r) var(--r) 0 0;
}

.gh-tab:hover { text-decoration: none; }
.gh-tab:hover::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--border);
}

.gh-tab .icon { color: var(--fg-muted); }

.gh-tab--disabled {
  color: var(--fg-subtle);
  opacity: 0.55;
  cursor: default;
}

.gh-tab--disabled:hover::after { display: none; }

.gh-tab.is-active { font-weight: 600; }
.gh-tab.is-active::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--tab-active);
}

.counter {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--r-pill);
  background: rgba(175, 184, 193, 0.2);
  font-size: 12px;
  font-weight: 500;
  color: var(--fg);
}

/* Content area */
.gh-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 24px 64px;
}

.gh-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

/* Section subnav (GitHub issues-page style) */
.gh-subnav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.gh-subnav__title {
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-muted);
  padding: 6px 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.gh-subnav__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--r);
  font-size: 14px;
  color: var(--fg);
  position: relative;
}

.gh-subnav__item:hover { background: var(--canvas-inset); text-decoration: none; }

.gh-subnav__item.is-active {
  background: var(--canvas-inset);
  font-weight: 600;
}

.gh-subnav__item.is-active::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 6px;
  bottom: 6px;
  width: 4px;
  border-radius: 4px;
  background: var(--primary);
}

.gh-subnav__item .counter { margin-left: auto; }
.gh-subnav__item .icon { color: var(--fg-muted); }

/* Page heading row */
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.topbar__title {
  font-size: 20px;
  font-weight: 600;
  margin-right: auto;
}

.topbar__actions { display: flex; align-items: center; gap: 8px; }

/* --------------------------------------------------------------------------
   5. Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 5px 16px;
  border-radius: var(--r);
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  white-space: nowrap;
  border: 1px solid var(--border);
  background: var(--canvas-subtle);
  color: var(--fg);
  transition: background 0.12s ease;
}

.btn:hover { background: var(--canvas-inset); text-decoration: none; }

.btn--dark {
  background: var(--canvas-subtle);
  color: var(--fg);
}

.btn--accent {
  background: var(--success-emphasis);
  border-color: rgba(31, 35, 40, 0.15);
  color: #fff;
}

.btn--accent:hover { background: var(--primary-hover); }

.btn--ghost { background: transparent; }
.btn--ghost:hover { background: var(--canvas-subtle); }

.btn--soft {
  background: var(--canvas-subtle);
  color: var(--accent);
}

.btn--sm { padding: 3px 12px; font-size: 12px; line-height: 20px; }
.btn--lg { padding: 8px 20px; font-size: 14px; }

.btn[disabled], .btn.is-disabled { opacity: 0.5; pointer-events: none; }

.icon-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: var(--r);
  color: var(--fg-muted);
}

.icon-btn:hover { background: var(--canvas-inset); color: var(--fg); }

.icon-btn--solid { border: 1px solid var(--border); background: var(--canvas-subtle); }

.icon-btn__badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  display: grid;
  place-items: center;
}

/* --------------------------------------------------------------------------
   6. Boxes (cards)
   -------------------------------------------------------------------------- */
.card {
  background: var(--canvas);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 16px;
}

.card--flush { padding: 0; }

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

.card__title { font-size: 14px; font-weight: 600; }

/* Hero stat box (formerly the gradient card) */
.card--hero {
  background: var(--canvas);
  color: var(--fg);
}

.hero-number { font-size: 32px; font-weight: 600; line-height: 1.2; }

.hero-breakdown { display: flex; margin-top: 12px; }

.hero-breakdown__item {
  flex: 1;
  padding: 0 12px;
  border-left: 1px solid var(--border-muted);
}

.hero-breakdown__item:first-child { padding-left: 0; border-left: 0; }
.hero-breakdown__label { font-size: 12px; color: var(--fg-muted); }
.hero-breakdown__value { font-size: 16px; font-weight: 600; }

/* Small stat tile */
.stat-tile {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--canvas);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 12px 16px;
}

.stat-tile__figure {
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: var(--r);
  background: var(--primary-muted);
  border: 1px solid transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.stat-tile__figure .icon { color: var(--primary); }
.stat-tile__number { font-size: 15px; font-weight: 600; }
.stat-tile__body { flex: 1; min-width: 0; }
.stat-tile__label { font-size: 13px; font-weight: 600; margin-bottom: 8px; }

.icon-tile {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: var(--r);
  display: grid;
  place-items: center;
  background: var(--canvas-subtle);
  border: 1px solid var(--border-muted);
  color: var(--fg-muted);
}

.icon-tile--peach { background: var(--danger-muted); color: var(--danger); border-color: transparent; }
.icon-tile--radar { background: rgba(130, 80, 223, 0.1); color: #6639ba; border-color: transparent; }
.icon-tile--cream { background: var(--canvas-subtle); color: var(--fg-muted); }
.icon-tile--dark  { background: var(--ink-800); color: #fff; border-color: transparent; }

/* --------------------------------------------------------------------------
   7. Labels (badges & pills)
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 0 7px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 500;
  line-height: 18px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.badge--up      { background: var(--success-muted); color: var(--success); }
.badge--down    { background: var(--danger-muted); color: var(--danger); }
.badge--warn    { background: var(--attention-muted); color: var(--attention); }
.badge--info    { background: var(--accent-muted); color: var(--accent); }
.badge--neutral { background: rgba(175, 184, 193, 0.2); color: var(--fg-muted); }
.badge--dark    { background: var(--ink-800); color: #fff; }
.badge--radar   { background: rgba(130, 80, 223, 0.1); color: #6639ba; }
.badge--master {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, #6639ba 0%, #1e3a8a 55%, #4c2f9e 100%);
  background-size: 200% 200%;
  color: #fff !important;
  animation: master-drift 6s ease-in-out infinite;
  text-decoration: none;
}
.badge--master:hover { color: #fff; filter: brightness(1.12); text-decoration: none; }
.badge--master::after {
  content: "";
  position: absolute; top: -60%; bottom: -60%; width: 34%; left: -50%;
  transform: rotate(20deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  animation: master-shine 2.4s ease-in-out infinite;
  pointer-events: none;
}
.badge--master .spark { display: inline-block; animation: master-twinkle 1.6s ease-in-out infinite; }

.pill-label {
  display: inline-flex;
  align-items: center;
  padding: 1px 10px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--canvas);
  color: var(--fg-muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 18px;
}

/* --------------------------------------------------------------------------
   8. Tabs (in-page)
   -------------------------------------------------------------------------- */
.tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.tab {
  position: relative;
  padding: 8px 12px 10px;
  font-size: 14px;
  color: var(--fg-muted);
}

.tab:hover { color: var(--fg); text-decoration: none; }
.tab.is-active { color: var(--fg); font-weight: 600; }

.tab.is-active::after {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--tab-active);
}

/* --------------------------------------------------------------------------
   9. Forms
   -------------------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: 14px; font-weight: 600; }
.field__hint { font-size: 12px; color: var(--fg-muted); }
.field__error { font-size: 12px; font-weight: 500; color: var(--danger); }

.input, .select, .textarea {
  width: 100%;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--canvas);
  font: inherit;
  line-height: 20px;
  color: var(--fg);
}

.input::placeholder, .textarea::placeholder { color: var(--fg-subtle); }

.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--ring);
}

.input.is-invalid { border-color: var(--danger); }

.textarea { min-height: 90px; resize: vertical; }

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2359636e' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 30px;
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--canvas);
  color: var(--fg-subtle);
  min-width: 220px;
}

.search:focus-within { border-color: var(--accent); box-shadow: var(--ring); }
.search input { border: 0; background: none; font: inherit; color: var(--fg); width: 100%; }
.search input:focus { outline: none; }

.checkbox, .radio {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
}

.checkbox input, .radio input { width: 16px; height: 16px; accent-color: var(--accent); }

.toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; position: relative; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }

.toggle__track {
  width: 36px;
  height: 20px;
  border-radius: var(--r-pill);
  background: var(--border);
  position: relative;
  transition: background 0.15s ease;
}

.toggle__track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(31, 35, 40, 0.25);
  transition: transform 0.15s ease;
}

.toggle input:checked + .toggle__track { background: var(--success-emphasis); }
.toggle input:checked + .toggle__track::after { transform: translateX(16px); }
.toggle input:focus-visible + .toggle__track { box-shadow: var(--ring); }

/* --------------------------------------------------------------------------
   10. List rows (joined bordered list, GitHub file-list style)
   -------------------------------------------------------------------------- */
.row-list {
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  background: var(--canvas);
}

.list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border-muted);
}

.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: var(--canvas-subtle); }

.list-row__main { flex: 1; min-width: 0; }

.list-row__title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
}

.list-row__title .icon { color: var(--fg-subtle); }
.list-row__sub { font-size: 12px; color: var(--fg-muted); margin-top: 1px; }
.list-row__meta { flex: none; width: 100px; font-size: 12px; color: var(--fg-muted); }
.list-row__stat { flex: none; width: 48px; text-align: right; font-size: 13px; font-weight: 600; }

/* --------------------------------------------------------------------------
   11. Avatars
   -------------------------------------------------------------------------- */
.avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--ink-800);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  overflow: hidden;
}

.avatar img, .gh-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.avatar--sm { width: 22px; height: 22px; font-size: 9px; }
.avatar--lg { width: 40px; height: 40px; font-size: 14px; }
.avatar--frame { width: 48px; height: 48px; border-radius: var(--r); font-size: 16px; }
.avatar--peach { background: var(--danger-muted); color: var(--danger); }

.avatar-badge { position: relative; display: inline-block; }

.avatar-badge__count {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  display: grid;
  place-items: center;
  border: 2px solid var(--canvas);
}

/* --------------------------------------------------------------------------
   12. Progress
   -------------------------------------------------------------------------- */
.progress {
  height: 8px;
  border-radius: var(--r-pill);
  background: var(--canvas-inset);
  overflow: hidden;
  border: 0;
}

.progress__fill { height: 100%; border-radius: var(--r-pill); background: var(--accent); }
.progress__fill--dark { background: var(--success-emphasis); }
.progress__fill--gold { background: var(--gold-400); }

/* --------------------------------------------------------------------------
   13. Charts
   -------------------------------------------------------------------------- */
.bars {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  height: 140px;
  padding: 6px 4px 0;
}

.bars__col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  height: 100%;
  justify-content: flex-end;
}

.bar {
  position: relative;
  width: 12px;
  border-radius: 4px 4px 0 0;
  background: var(--chart-track);
}

.bar--accent { background: var(--grad-bar); }

.bar--accent .bar__cap {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--canvas);
  display: grid;
  place-items: center;
  color: #fff;
}

.bar:hover { filter: brightness(0.92); }
.bars__label { font-size: 11px; font-weight: 500; color: var(--fg-muted); }

[data-tip] { position: relative; }

[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink-800);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: var(--r);
  white-space: nowrap;
  box-shadow: var(--shadow-pop);
  z-index: 20;
  pointer-events: none;
}

.donut-wrap { display: flex; align-items: center; gap: 20px; }
.donut { flex: none; }
.donut circle { fill: none; stroke-width: 12; stroke-linecap: butt; }
.donut__track { stroke: var(--canvas-inset); }

.legend { display: flex; flex-direction: column; gap: 8px; }
.legend__item { display: flex; flex-direction: column; gap: 0; }

.legend__key {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--fg-muted);
}

.legend__dot { width: 8px; height: 8px; border-radius: 50%; }
.legend__value { font-size: 16px; font-weight: 600; padding-left: 14px; }

.sparkline { width: 100%; height: 48px; margin-top: 8px; }

.swatch-row { display: flex; gap: 10px; flex-wrap: wrap; }

.swatch {
  width: 104px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  background: var(--canvas);
}

.swatch__color { height: 48px; }
.swatch__label { padding: 6px 8px; font-size: 11px; font-weight: 500; color: var(--fg-muted); }

/* --------------------------------------------------------------------------
   14. Tables
   -------------------------------------------------------------------------- */
.table-card {
  background: var(--canvas);
  border: 1px solid var(--border);
  border-radius: var(--r);
  /* scroll wide tables instead of clipping the actions column */
  overflow-x: auto;
  overflow-y: hidden;
}

.table-card .table { min-width: max-content; width: 100%; }
.row-actions { min-width: 96px; }

/* .table-card has no padding so tables sit edge to edge. A titled table needs
   its own padded header region rather than borrowing .card__head. */
.table-card__head {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-muted);
}

.table-card__head .card__title { margin: 0; }

.table-card__note {
  padding: 10px 16px;
  margin: 0;
  color: var(--fg-muted);
  font-size: 13px;
  border-bottom: 1px solid var(--border-muted);
}

.table { width: 100%; border-collapse: collapse; }

.table th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-muted);
  padding: 6px 12px;
  background: var(--canvas-subtle);
  border-bottom: 1px solid var(--border);
  text-transform: none;
  letter-spacing: 0;
}

.table td {
  padding: 5px 12px;
  font-size: 13px;
  border-bottom: 1px solid var(--border-muted);
  line-height: 1.4;
}

/* Horizontal bar chart (single measure per chart, direct value labels) */
.hbar { display: flex; flex-direction: column; gap: 5px; }

.hbar__row { display: flex; align-items: center; gap: 8px; }

.hbar__label {
  flex: none;
  width: 170px;
  font-size: 12px;
  color: var(--fg-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
}

.hbar__track {
  flex: 1;
  height: 14px;
  background: var(--canvas-subtle);
  border-radius: 4px;
  overflow: hidden;
}

.hbar__fill { display: block; height: 100%; border-radius: 4px 4px 4px 4px; min-width: 0; }
.hbar__fill--ga { background: var(--chart-2); }
.hbar__fill--hs { background: var(--chart-1); }
.hbar__fill--good { background: var(--success); }
.hbar__fill--mid  { background: var(--gold-400); }
.hbar__fill--poor { background: var(--danger); }

.hbar__value {
  flex: none;
  width: 52px;
  font-size: 12px;
  font-weight: 600;
  text-align: right;
}

/* AEO: engine identity dots (fixed assignment, never cycled) */
.eng-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  vertical-align: baseline;
}

.eng-chatgpt      { background: var(--chart-1); }
.eng-perplexity   { background: var(--chart-2); }
.eng-claude       { background: var(--chart-3); }
.eng-ai_overviews { background: var(--chart-4); }
.eng-gemini       { background: var(--ink-700); }
.eng-other        { background: var(--fg-subtle); }

/* Weekly sparkbars */
.sparkbar {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 44px;
}

.sparkbar--lg { height: 96px; }

.sparkbar span {
  flex: 1;
  min-height: 2px;
  border-radius: 3px 3px 0 0;
  background: var(--primary);
}

.cov-empty { color: var(--ink-300); }

/* Weekly stacked work chart */
.wstack {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 150px;
  padding-top: 6px;
}

.wstack__col {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-end;
}

.wstack__bars {
  display: flex;
  flex-direction: column;
  border-radius: 4px 4px 0 0;
  overflow: hidden;
  min-height: 0;
}

.wstack__bars span { display: block; min-height: 3px; }

.wstack__label {
  font-size: 10.5px;
  color: var(--fg-subtle);
  text-align: center;
  margin-top: 4px;
  white-space: nowrap;
}

.wstack__total {
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  color: var(--fg-muted);
}

.fix-plan-steps {
  margin: 0;
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 13.5px;
}

.fix-plan-steps li::marker { color: var(--primary); font-weight: 600; }

.insight-list {
  margin: 0;
  padding: 0 0 0 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
}

.insight-list li::marker { color: var(--fg-subtle); }
.insight-good::marker { color: var(--success); }
.insight-bad::marker { color: var(--danger); }

.th-sort { color: inherit; }
.th-sort:hover { color: var(--primary); text-decoration: none; }
.th-sort.is-sorted { color: var(--primary); }

/* button_to renders a form; keep them inline so action cells stay one line */
.table form,
.list-row form,
.row-actions form {
  display: inline-flex;
  vertical-align: middle;
}

.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--canvas-subtle); }
.table .num { text-align: right; }

/* --------------------------------------------------------------------------
   15. Alerts (GitHub flash banners)
   -------------------------------------------------------------------------- */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--r);
  border: 1px solid;
  font-size: 14px;
}

.alert .icon { margin-top: 3px; }
.alert__title { font-weight: 600; }
.alert__link { font-weight: 600; text-decoration: underline; color: inherit; }

.alert--info    { background: var(--accent-muted); border-color: rgba(9, 105, 218, 0.3); color: var(--fg); }
.alert--info .icon { color: var(--accent); }
.alert--success { background: var(--success-muted); border-color: rgba(26, 127, 55, 0.3); color: var(--fg); }
.alert--success .icon { color: var(--success); }
.alert--warning { background: var(--attention-muted); border-color: rgba(154, 103, 0, 0.3); color: var(--fg); }
.alert--warning .icon { color: var(--attention); }
.alert--danger  { background: var(--danger-muted); border-color: rgba(209, 36, 47, 0.3); color: var(--fg); }
.alert--danger .icon { color: var(--danger); }

.flash { margin-bottom: 16px; }

/* Integration status: ambient metadata, not an alert. A quiet rule under the
   page actions carrying connection state, budget and the controls that spend
   it, so cost sits next to the buttons that incur it. */
.intg {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-bottom: 10px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-muted);
  font-size: 12.5px;
  color: var(--fg-muted);
}

.intg__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: none;
  background: var(--fg-subtle);
}

.intg__dot--ok  { background: var(--success); }
.intg__dot--off { background: var(--attention); }
.intg__dot--bad { background: var(--danger); }
.intg strong    { color: var(--fg); font-weight: 600; }
.intg__actions  { margin-left: auto; display: flex; align-items: center; gap: 6px; }

/* Stacked cards need air between them. Nothing else in the system supplies it,
   so pages were doing it with inline margins. */
.table-card + .table-card,
.table-card + .kpi-grid { margin-top: 16px; }

.btn:disabled,
.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   16. Pagination
   -------------------------------------------------------------------------- */
.pagination { display: flex; align-items: center; gap: 4px; }

.page-btn {
  display: grid;
  place-items: center;
  min-width: 32px;
  height: 32px;
  padding: 0 6px;
  border-radius: var(--r);
  font-size: 13px;
  color: var(--fg);
}

.page-btn:hover { border: 1px solid var(--border); text-decoration: none; }
.page-btn.is-active { background: var(--primary); color: #fff; }

/* --------------------------------------------------------------------------
   17. Empty state
   -------------------------------------------------------------------------- */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  padding: 40px 24px;
}

.empty__art {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary-muted);
  border: 1px solid transparent;
  color: var(--primary);
  display: grid;
  place-items: center;
}

.empty__title { font-size: 16px; font-weight: 600; }
.empty__text { max-width: 340px; color: var(--fg-muted); font-size: 13px; }

/* --------------------------------------------------------------------------
   18. Dashboard layout
   -------------------------------------------------------------------------- */
.dash {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  align-items: start;
}

.dash__main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.dash__row {
  display: grid;
  grid-template-columns: minmax(0, 11fr) minmax(0, 9fr);
  gap: 16px;
  align-items: stretch;
}

.dash__side { display: flex; flex-direction: column; gap: 16px; }

.stats-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-muted);
}

.stats-footer__label { font-weight: 600; font-size: 13px; }
.stats-footer__value { margin-left: auto; font-size: 20px; font-weight: 600; }

@media (max-width: 1100px) {
  .dash { grid-template-columns: 1fr; }
  .dash__row { grid-template-columns: 1fr; }
  .gh-layout { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------------------
   19. SEO Tech module
   -------------------------------------------------------------------------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.kpi {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--canvas);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 8px 12px;
}

.kpi:hover { background: var(--canvas-subtle); text-decoration: none; }
.kpi.is-active { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }

.kpi__num { font-size: 20px; font-weight: 600; line-height: 1.2; color: var(--fg); }
.kpi__label { font-size: 12px; color: var(--fg-muted); }
.kpi .icon-tile { width: 28px; height: 28px; }

.text-down { color: var(--danger); }
.text-warn { color: var(--attention); }

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

.toolbar__filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar__search { min-width: 240px; }
.toolbar__select { width: auto; }
.toolbar__actions { display: flex; align-items: center; gap: 8px; }

.inline-form { display: inline-flex; }
.inline-form button { display: inline-flex; }

.import-card { margin-bottom: 12px; }
.import-card > summary { list-style: none; display: inline-flex; cursor: pointer; }
.import-card > summary.import-card__row { display: flex; align-items: center; gap: 10px; width: 100%; }
.import-card__row form { cursor: default; }
.import-card > summary::-webkit-details-marker { display: none; }
.import-card__body { margin-top: 8px; }

.import-card__cols {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.import-card__cols > div:first-child { max-width: 560px; }
.import-card__template { font-weight: 600; }
.import-card__form { display: flex; align-items: center; gap: 8px; }

.file-field { font-size: 13px; color: var(--fg-muted); }

.file-field::file-selector-button {
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--fg);
  background: var(--canvas-subtle);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 4px 12px;
  margin-right: 10px;
  cursor: pointer;
}

.table--pages td { vertical-align: middle; }
.url-td { max-width: 320px; white-space: nowrap; }

.url-cell {
  display: inline-block;
  max-width: 270px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
  font-weight: 600;
  color: var(--accent);
}

.url-ext { color: var(--fg-subtle); vertical-align: middle; margin-left: 2px; }
.url-ext:hover { color: var(--accent); }
.url-ext .icon { display: inline-block; }

.row-actions { white-space: nowrap; text-align: right; }
.icon-btn--table { width: 26px; height: 26px; color: var(--fg-subtle); }

.radar-btn.is-on { color: #6639ba; }
.radar-btn.is-risk { color: var(--danger); }

.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.page-detail { display: flex; flex-direction: column; gap: 16px; }
.page-detail__crumb { margin-bottom: -4px; }

.crumb-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-muted);
}

.crumb-link:hover { color: var(--accent); text-decoration: none; }

.page-detail__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.page-detail__url { word-break: break-all; font-size: 20px; font-weight: 600; }
.page-detail__full { display: inline-flex; align-items: center; gap: 4px; margin-top: 2px; color: var(--fg-muted); }
.page-detail__full:hover { color: var(--accent); }
.page-detail__actions { display: flex; gap: 8px; flex: none; }

.page-detail__tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.verdict__label {
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-muted);
  margin-bottom: 8px;
}

@media (max-width: 1280px) {
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .page-detail__tiles { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------------------
   20. Optimisation board (GitHub Projects style)
   -------------------------------------------------------------------------- */
.ob-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.ob-toolbar__left, .ob-toolbar__right { display: flex; align-items: center; gap: 12px; }
.ob-toolbar__left { flex-wrap: wrap; }

.ob-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.ob-filter-count {
  font-size: 12px;
  font-weight: 500;
  color: var(--fg-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ob-filter-clear {
  font-size: 12px;
  font-weight: 500;
  color: var(--accent, #0969da);
  white-space: nowrap;
}
.ob-filter-clear:hover { text-decoration: underline; }

.ob-legend { display: flex; align-items: center; gap: 12px; }

.ob-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  color: var(--fg-muted);
}

.ob-legend__dot { width: 9px; height: 9px; border-radius: 3px; }

.ob-track-content { background: var(--chart-1); }
.ob-track-design  { background: var(--chart-3); }
.ob-track-dev     { background: var(--chart-2); }

.ob-view-switch {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
}

.ob-view-btn {
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-muted);
  background: var(--canvas);
}

.ob-view-btn + .ob-view-btn { border-left: 1px solid var(--border); }
.ob-view-btn.is-active { background: var(--canvas-inset); color: var(--fg); font-weight: 600; }

.ob-board {
  display: flex;
  align-items: stretch;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 12px;
}

.ob-col {
  flex: 0 0 260px;
  display: flex;
  flex-direction: column;
  /* Fixed column height; overflowing cards scroll inside the column */
  height: calc(100vh - 250px);
  min-height: 340px;
  background: var(--canvas-subtle);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 8px;
}

.ob-col-over { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }

.ob-col-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 4px 8px;
}

.ob-col-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.ob-col-dot--todo   { background: var(--fg-subtle); }
.ob-col-dot--active { background: var(--success-emphasis); }
.ob-col-dot--done   { background: var(--done); }

.ob-col-title {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ob-col-count { margin-left: auto; }

.ob-col-count,
.ob-col .counter {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--r-pill);
  background: rgba(175, 184, 193, 0.2);
  font-size: 12px;
  font-weight: 500;
  color: var(--fg);
  display: grid;
  place-items: center;
}

.ob-col-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.ob-col-add {
  flex: none;
  display: block;
  margin-top: 8px;
  padding: 5px;
  border-radius: var(--r);
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--fg-muted);
}

.ob-col-add:hover { background: var(--canvas-inset); color: var(--fg); text-decoration: none; }

.ob-card {
  position: relative;
  background: var(--canvas);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 8px 10px 8px 14px;
  cursor: grab;
}

.ob-card:hover { border-color: var(--fg-subtle); }
.ob-card-dragging { opacity: 0.5; cursor: grabbing; }

.ob-card-bar {
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 3px;
}

.ob-card-title { font-size: 13px; font-weight: 600; line-height: 1.4; margin-bottom: 6px; }

.ob-card-tags {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.ob-card-page { font-size: 11px; padding: 0 8px; }

.ob-card-review {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-muted);
  border-radius: var(--r);
  padding: 3px 6px;
  margin-bottom: 6px;
}

.ob-card-meta { display: flex; align-items: center; gap: 8px; min-height: 18px; }

.ob-card-due, .ob-card-comments {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 500;
  color: var(--fg-muted);
}

.ob-card-due.is-overdue { color: var(--danger); }
.ob-card-avatar { margin-left: auto; width: 20px; height: 20px; font-size: 8px; }

.ob-dialog {
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow-pop);
  padding: 20px;
  width: min(420px, 90vw);
}

.ob-dialog::backdrop { background: rgba(31, 35, 40, 0.5); }
.ob-dialog-form { display: flex; flex-direction: column; gap: 12px; }

.ob-form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.ob-comments { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.ob-comment { display: flex; align-items: flex-start; gap: 8px; }
.ob-comment__body { flex: 1; }
.ob-comment__head { display: flex; align-items: baseline; gap: 6px; }
.ob-comment-form { display: flex; align-items: center; gap: 8px; }

/* --------------------------------------------------------------------------
   20b. New Content section
   -------------------------------------------------------------------------- */
.nc-grid {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 20px;
  align-items: start;
}

@media (max-width: 1100px) {
  .nc-grid { grid-template-columns: 1fr; }
}

.nc-cited-on { color: var(--attention); }

.rab-set-active { color: var(--accent); background: var(--accent-muted); }

.edit-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

@media (max-width: 1100px) {
  .edit-grid { grid-template-columns: 1fr; }
}

.ob-comment-form--stack {
  flex-direction: column;
  align-items: stretch;
}

.ob-view-switch form + form .ob-view-btn { border-left: 1px solid var(--border); }

.nc-insights {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}

@media (max-width: 1280px) {
  .nc-insights { grid-template-columns: 1fr; }
}

.nc-funnel { padding: 12px 14px; }

.nc-funnel__head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nc-funnel__health { margin-left: auto; font-size: 13px; font-weight: 600; }

.nc-funnel__meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 8px;
}

.nc-funnel__meta span { display: inline-flex; align-items: center; gap: 3px; }

.nc-board-counts {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.nc-board-count {
  flex: 1;
  min-width: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px;
  border: 1px solid var(--border-muted);
  border-radius: var(--r);
  background: var(--canvas-subtle);
}

/* New Content board: 5 columns fill the row */
.nc-col { flex: 1 1 0; min-width: 196px; }

.nc-bar-tofu { background: var(--chart-2); }
.nc-bar-mofu { background: var(--chart-3); }
.nc-bar-bofu { background: var(--ink-800); }

/* --------------------------------------------------------------------------
   20d. Thought Leadership
   -------------------------------------------------------------------------- */
.stepper {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  padding: 12px 16px;
}

.stepper__step {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 4px;
  border-radius: var(--r-pill);
  white-space: nowrap;
  color: var(--fg-subtle);
}

.stepper__step + .stepper__step { margin-left: 8px; position: relative; }

.stepper__step + .stepper__step::before {
  content: "";
  position: absolute;
  left: -10px;
  width: 12px;
  height: 1px;
  background: var(--border);
}

.stepper__dot {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 600;
  background: var(--canvas);
}

.stepper__label { font-size: 12.5px; font-weight: 500; }

.stepper__step--done { color: var(--success); }
.stepper__step--done .stepper__dot { background: var(--success-muted); border-color: transparent; color: var(--success); }

.stepper__step--current { color: var(--fg); }
.stepper__step--current .stepper__dot { background: var(--primary); border-color: transparent; color: #fff; }
.stepper__step--current .stepper__label { font-weight: 600; }

/* Distribution checklist rows */
.dist-group {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 12px 0 4px;
}

.dist-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
}

.dist-item__check {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.dist-item__check input { width: 15px; height: 15px; accent-color: var(--success-emphasis); flex: none; }

.dist-item__name { font-size: 13px; }
.dist-item__name.is-done { color: var(--fg-muted); text-decoration: line-through; }

.dist-item__url {
  width: 220px;
  flex: none;
  padding: 2px 8px;
  font-size: 12px;
}

/* --------------------------------------------------------------------------
   20c. Auth
   -------------------------------------------------------------------------- */
.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
  background: var(--canvas-subtle);
}

.auth-card {
  width: min(380px, 100%);
  background: var(--canvas);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 32px 28px;
  text-align: center;
}

.auth-logo {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
}

.auth-title { font-size: 20px; font-weight: 600; }

.auth-subtitle {
  font-size: 13px;
  color: var(--fg-muted);
  margin: 4px 0 20px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
}

.auth-foot { margin-top: 16px; }

.impersonate-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 6px 16px;
  background: var(--attention-muted);
  border-bottom: 1px solid rgba(154, 103, 0, 0.3);
  font-size: 13px;
  color: var(--fg);
}

.impersonate-bar__exit button,
.impersonate-bar__exit {
  font-size: 12px;
  font-weight: 600;
  color: var(--attention);
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   21. Styleguide
   -------------------------------------------------------------------------- */
.sg { display: flex; flex-direction: column; gap: 20px; max-width: 1080px; }

.sg-section__label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fg-muted);
  margin-bottom: 8px;
}

.sg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.sg-cluster { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

/* --------------------------------------------------------------------------
   22. Utilities
   -------------------------------------------------------------------------- */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.w-full { width: 100%; }
.text-right { text-align: right; }

/* ==========================================================================
   Kant : the AI marketing strategist. A stone/graphite surface that breaks
   from the Primer canvas to earn attention, with the deep-blue primary for
   actions. The Categorical Imperative is the striking dark pane on the right.
   ========================================================================== */
.kant {
  --kant-stone: #2b2f36;
  --kant-stone-2: #3a4048;
  --kant-ink: #1f2328;
  --kant-line: #d8dee4;
  --kant-primary: #1e3a8a;
}
.kant-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 344px;
  gap: 20px;
  align-items: start;
}
@media (max-width: 1100px) {
  .kant-layout { grid-template-columns: 1fr; }
  .kant-imperative { order: -1; }
}
.kant-main { min-width: 0; }

/* ---- Hero ---- */
.kant-hero {
  position: relative;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 22px 24px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background:
    radial-gradient(120% 140% at 100% 0%, #3a4048 0%, #2b2f36 46%, #22262c 100%);
  color: #eef1f4;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.kant-face {
  flex: 0 0 auto;
  width: 84px; height: 84px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}
.kant-portrait {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 47% 22%;
  display: block;
}
.kant-hero-text { min-width: 0; }
.kant-eyebrow {
  font-style: italic;
  font-size: 12.5px;
  color: #aeb7c2;
  margin-bottom: 3px;
  letter-spacing: 0.1px;
}
.kant-title {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.05;
  margin: 0 0 6px;
  color: #fff;
  letter-spacing: -0.4px;
}
.kant-sub {
  font-size: 12.5px;
  line-height: 1.55;
  color: #c3cbd4;
  max-width: 62ch;
  margin: 0;
}
.kant-spend {
  position: absolute;
  top: 12px; right: 14px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: #e7ebef;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 3px 9px;
  border-radius: var(--r-pill);
}
.kant-spend-spark { color: #ffd479; font-size: 11px; }

/* ---- Toolbar ---- */
.kant-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--canvas-subtle);
}
.kant-status { font-size: 12.5px; color: var(--fg-muted); }
.kant-status strong { color: var(--fg); font-weight: 600; }
.kant-toolbar-actions { display: flex; gap: 8px; }
.kant-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--fg-subtle); margin-right: 3px; vertical-align: middle;
}
.kant-dot-on { background: var(--success); }
.kant-dot-warn { background: var(--attention); }
.kant-btn { position: relative; }
.kant-btn.is-busy .kant-btn-label { opacity: 0.45; }
.kant-btn-spinner {
  display: none;
  position: absolute; left: 8px; top: 50%;
  width: 12px; height: 12px; margin-top: -6px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-top-color: #fff; border-radius: 50%;
  animation: kant-spin 0.7s linear infinite;
}
.kant-btn.is-busy .kant-btn-spinner { display: block; }
.btn--sm.kant-btn.is-busy .kant-btn-spinner { border-color: rgba(31,35,40,0.25); border-top-color: var(--fg); }
@keyframes kant-spin { to { transform: rotate(360deg); } }

/* ---- Indexing overlay ---- */
.kant-indexing {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--canvas);
  padding: 26px;
  text-align: center;
}
.kant-indexing-orb {
  width: 46px; height: 46px; margin: 0 auto 12px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #54aeff, #1e3a8a 70%);
  box-shadow: 0 0 0 6px rgba(30, 58, 138, 0.1);
  animation: kant-pulse 1.4s ease-in-out infinite;
}
@keyframes kant-pulse { 0%,100% { transform: scale(1); opacity: 0.9; } 50% { transform: scale(1.12); opacity: 1; } }
.kant-indexing-title { font-weight: 600; font-size: 14px; margin: 0 0 4px; }
.kant-indexing-sub { font-size: 12px; color: var(--fg-muted); margin: 0; max-width: 52ch; margin-inline: auto; }

/* ---- Executive insights ---- */
.kant-insight-panel {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--kant-primary);
  border-radius: var(--r);
  background: var(--canvas);
  padding: 16px 18px;
}
.kant-insight-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.kant-insight-spark { color: var(--kant-primary); }
.kant-insight-title { font-size: 14px; font-weight: 600; margin: 0; flex: 1; }
.kant-insight-at { font-size: 11px; color: var(--fg-subtle); }

/* ---- Chat ---- */
/* Master Optimise: the glittery one. Gradient, sweeping shine, soft glow. */
.btn--master {
  position: relative;
  overflow: hidden;
  border: none;
  color: #fff !important;
  background: linear-gradient(135deg, #6639ba 0%, #1e3a8a 55%, #4c2f9e 100%);
  background-size: 200% 200%;
  animation: master-drift 6s ease-in-out infinite, master-glow 2.6s ease-in-out infinite;
}
.btn--master:hover {
  color: #fff;
  filter: brightness(1.12);
  background: linear-gradient(135deg, #6639ba 0%, #1e3a8a 55%, #4c2f9e 100%);
  background-size: 200% 200%;
}
.btn--master::after {
  content: "";
  position: absolute;
  top: -60%; bottom: -60%;
  width: 34%;
  left: -50%;
  transform: rotate(20deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  animation: master-shine 2.4s ease-in-out infinite;
  pointer-events: none;
}
.btn--master .spark {
  display: inline-block;
  animation: master-twinkle 1.6s ease-in-out infinite;
}
@keyframes master-shine {
  0%   { left: -50%; }
  55%  { left: 120%; }
  100% { left: 120%; }
}
@keyframes master-glow {
  0%, 100% { box-shadow: 0 0 6px rgba(102, 57, 186, 0.45), 0 1px 3px rgba(27, 31, 36, 0.2); }
  50%      { box-shadow: 0 0 16px rgba(102, 57, 186, 0.75), 0 0 30px rgba(30, 58, 138, 0.35); }
}
@keyframes master-drift {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}
@keyframes master-twinkle {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.55; transform: scale(1.25) rotate(18deg); }
}

/* Days-in-column callout on leadership cards: the clock the owner feels. */
.ob-card-age {
  display: flex; align-items: center; gap: 4px;
  margin-top: 8px; padding-top: 6px;
  border-top: 1px dashed var(--border-muted);
  font-size: 11px; color: var(--fg-muted);
}
.ob-card-age--warn { color: var(--attention); font-weight: 600; }
.ob-card-age--danger { color: var(--danger); font-weight: 600; }

/* Any Kant reply can become a leadership task. */
.kant-msg-actions { margin: 6px 0 0 2px; }
.kant-msg-add {
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  font-size: 11px; font-weight: 600;
  padding: 3px 10px;
  background: transparent; border: 1px solid var(--border);
  border-radius: var(--r-pill); color: var(--fg-subtle); cursor: pointer;
  transition: color 0.12s ease, border-color 0.12s ease;
}
.kant-msg-add:hover:not(:disabled) { color: var(--primary); border-color: var(--primary); }
.kant-msg-add:disabled { cursor: default; }
.kant-msg-add.is-added { color: var(--success); border-color: var(--success); }
.kant-msg-add.is-added a { color: var(--success); text-decoration: underline; }

/* Kant's wait dial: 30s draining ring while the answer is being reasoned. */
.kant-wait { display: flex; align-items: center; gap: 10px; padding: 2px 0; }
.kant-wait-dial { position: relative; width: 34px; height: 34px; flex: 0 0 auto; }
.kant-wait-dial svg { width: 34px; height: 34px; transform: rotate(-90deg); }
.kant-wait-bg { fill: none; stroke: var(--border); stroke-width: 2.5; }
.kant-wait-fg {
  fill: none; stroke: var(--primary); stroke-width: 2.5; stroke-linecap: round;
  stroke-dasharray: 100.5; stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear;
}
.kant-wait-num {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 10.5px; font-weight: 700; font-variant-numeric: tabular-nums;
  color: var(--primary);
}
.kant-wait-dial.is-overtime .kant-wait-num { animation: kant-wait-pulse 1.2s ease-in-out infinite; }
@keyframes kant-wait-pulse { 50% { opacity: 0.35; } }
.kant-wait-label { font-size: 12px; color: var(--fg-muted); }

.kant-tabs { margin-top: 16px; }
.kant-history-flat {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 2px;
}
.kant-chat {
  margin-top: 0;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--canvas);
  overflow: hidden;
}
.kant-conv-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-muted);
  background: var(--canvas-subtle);
}
.kant-conv-title { font-size: 12.5px; font-weight: 600; color: var(--fg); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kant-conv-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.kant-conv-new, .kant-conv-new button {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; color: var(--accent);
  background: none; border: none; cursor: pointer; padding: 2px 4px;
}
.kant-history { position: relative; }
.kant-history > summary {
  list-style: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--fg-muted);
  padding: 3px 8px; border: 1px solid var(--border); border-radius: var(--r-pill);
}
.kant-history > summary::-webkit-details-marker { display: none; }
.kant-history-count {
  font-size: 10px; background: var(--canvas-inset); color: var(--fg-muted);
  border-radius: var(--r-pill); padding: 0 5px;
}
.kant-history-list {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20;
  width: 300px; max-height: 320px; overflow-y: auto;
  list-style: none; margin: 0; padding: 6px;
  background: var(--canvas); border: 1px solid var(--border);
  border-radius: var(--r); box-shadow: var(--shadow-pop);
}
.kant-history-row { display: flex; align-items: center; gap: 4px; }
.kant-history-item { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 6px 8px; border-radius: var(--r); text-decoration: none; }
.kant-history-item:hover { background: var(--canvas-subtle); }
.kant-history-item.is-active { background: var(--primary-muted); }
.kant-history-title { font-size: 12.5px; color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kant-history-time { font-size: 10.5px; color: var(--fg-subtle); }
.kant-history-del, .kant-history-del button { background: none; border: none; color: var(--fg-subtle); cursor: pointer; padding: 4px; }
.kant-history-del:hover { color: var(--danger); }

.kant-thread { max-height: 46vh; min-height: 220px; overflow-y: auto; padding: 16px; }
.kant-msg { margin-bottom: 14px; display: flex; }
.kant-msg-assistant { flex-direction: column; align-items: flex-start; }
.kant-msg-user { justify-content: flex-end; }
.kant-msg-user .kant-md {
  background: var(--primary-muted); color: var(--kant-ink);
  padding: 8px 12px; border-radius: 12px 12px 2px 12px; max-width: 78%;
}
.kant-msg-assistant .kant-md {
  background: var(--canvas-subtle); border: 1px solid var(--border-muted);
  padding: 10px 13px; border-radius: 12px 12px 12px 2px; max-width: 88%;
}
.kant-md { font-size: 13px; line-height: 1.6; color: var(--fg); }
.kant-md p { margin: 0 0 8px; } .kant-md p:last-child { margin-bottom: 0; }
.kant-md-list { margin: 4px 0 8px; padding-left: 18px; } .kant-md-list li { margin-bottom: 3px; }
.kant-md-h { font-size: 13px; font-weight: 700; margin: 6px 0 4px; }
.kant-md code { font-family: var(--font-mono); font-size: 12px; background: var(--canvas-inset); padding: 1px 5px; border-radius: 4px; }
.kant-err { color: var(--danger); }

.kant-empty { text-align: center; padding: 18px 8px; }
.kant-empty-title { font-size: 13px; font-weight: 600; color: var(--fg); margin: 0 0 12px; }
.kant-suggestions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.kant-chip {
  font-size: 12px; color: var(--fg); background: var(--canvas); cursor: pointer;
  border: 1px solid var(--border); border-radius: var(--r-pill); padding: 6px 12px;
}
.kant-chip:hover { border-color: var(--kant-primary); color: var(--kant-primary); background: var(--primary-muted); }
.kant-empty-hint { font-size: 11.5px; color: var(--fg-subtle); margin: 14px 0 0; }

.kant-thinking { display: inline-flex; gap: 4px; }
.kant-thinking i { width: 6px; height: 6px; border-radius: 50%; background: var(--fg-subtle); animation: kant-blink 1.2s infinite both; }
.kant-thinking i:nth-child(2) { animation-delay: 0.2s; } .kant-thinking i:nth-child(3) { animation-delay: 0.4s; }
@keyframes kant-blink { 0%,80%,100% { opacity: 0.2; } 40% { opacity: 1; } }

.kant-ask { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--border-muted); background: var(--canvas-subtle); }
.kant-ask-input {
  flex: 1; resize: none; font: inherit; font-size: 13px; line-height: 1.5;
  border: 1px solid var(--border); border-radius: var(--r); padding: 9px 12px; background: var(--canvas);
}
.kant-ask-input:focus { outline: none; border-color: var(--kant-primary); box-shadow: var(--ring); }
.kant-ask-input:disabled { background: var(--canvas-inset); color: var(--fg-subtle); }
.kant-ask-send {
  flex: 0 0 auto; width: 40px; display: grid; place-items: center;
  background: var(--kant-primary); color: #fff; border: none; border-radius: var(--r); cursor: pointer;
}
.kant-ask-send:hover { background: var(--primary-hover); }
.kant-ask-send:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---- The Categorical Imperative pane ---- */
.kant-imperative {
  position: sticky; top: 16px;
  border-radius: var(--r);
  background: radial-gradient(130% 120% at 0% 0%, #33383f 0%, #24282e 60%, #1c1f24 100%);
  border: 1px solid #11141a;
  color: #eef1f4;
  padding: 16px 16px 18px;
  box-shadow: 0 10px 30px rgba(20, 24, 30, 0.28);
}
.kant-imp-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kant-imp-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; color: #cdd4dc; }
.kant-imp-spark { color: #ffd479; }
.kant-imp-refresh {
  display: grid; place-items: center; width: 26px; height: 26px;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.14);
  border-radius: 6px; color: #cdd4dc; cursor: pointer;
}
.kant-imp-refresh:hover { background: rgba(255,255,255,0.12); color: #fff; }
.kant-imp-refresh:disabled { opacity: 0.4; cursor: not-allowed; }
.kant-imp-title { font-size: 20px; font-weight: 700; color: #fff; letter-spacing: -0.3px; margin: 2px 0 0; }
.kant-imp-lede { font-size: 11.5px; color: #9aa4b0; margin: 6px 0 12px; line-height: 1.45; }
.kant-imp-generate {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600;
  padding: 5px 10px; margin-bottom: 14px;
  background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px; color: #eef1f4; cursor: pointer;
}
.kant-imp-generate:hover { background: rgba(255, 255, 255, 0.14); color: #fff; }
.kant-imp-generate:disabled { opacity: 0.4; cursor: not-allowed; }
.kant-imp-actions { margin-top: 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.kant-imp-add {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 600;
  padding: 7px 12px;
  background: var(--primary); border: 1px solid var(--primary);
  border-radius: 6px; color: #fff; cursor: pointer;
}
.kant-imp-add:hover:not(:disabled) { background: var(--primary-hover); }
.kant-imp-add:disabled { cursor: default; background: rgba(45, 164, 78, 0.2); border-color: rgba(45, 164, 78, 0.4); color: #7fd39a; }
.kant-imp-view { font-size: 12px; color: #9fb6f5; }
.kant-imp-view:hover { color: #c3d2fa; }
.kant-imp-move {
  font-size: 17px; font-weight: 700; line-height: 1.28; color: #fff; margin: 0 0 12px;
  letter-spacing: -0.2px;
}
.kant-imp-k {
  display: block; font-size: 10px; font-weight: 700; letter-spacing: 0.5px;
  text-transform: uppercase; color: #8b95a1; margin-bottom: 2px;
}
.kant-imp-target { font-size: 12.5px; color: #dce1e7; margin: 0 0 10px; }
.kant-imp-reason { font-size: 12.5px; line-height: 1.55; color: #c3cbd4; margin: 0 0 10px; }
.kant-imp-upside {
  font-size: 12.5px; color: #d7f5e2; background: rgba(45, 164, 78, 0.14);
  border: 1px solid rgba(45, 164, 78, 0.3); border-radius: 6px; padding: 8px 10px; margin: 0 0 10px;
}
.kant-imp-upside .kant-imp-k { color: #7fd39a; }
.kant-imp-foot { display: flex; gap: 6px; margin-bottom: 8px; }
.kant-imp-conf {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px;
  padding: 2px 8px; border-radius: var(--r-pill);
}
.kant-imp-conf-high { background: rgba(45,164,78,0.2); color: #86e0a2; }
.kant-imp-conf-medium { background: rgba(212,167,44,0.2); color: #ecc663; }
.kant-imp-conf-low { background: rgba(255,255,255,0.1); color: #b7c0ca; }
.kant-imp-unlock {
  font-size: 11.5px; line-height: 1.5; color: #aeb7c2; margin: 4px 0 0;
  padding-top: 10px; border-top: 1px solid rgba(255,255,255,0.1);
}
.kant-imp-unlock strong { color: #dce1e7; }
.kant-imp-empty { font-size: 12.5px; line-height: 1.55; color: #aeb7c2; margin: 0; }

/* ==========================================================================
   Leadership board: function colours (reuses the .ob-* board look) and the
   prominent Kant / Leadership nav links beside the search bar.
   ========================================================================== */
.ob-fn-seo     { background: #0969da; }
.ob-fn-content { background: #1a7f37; }
.ob-fn-offpage { background: #8250df; }
.ob-fn-brand   { background: #bf3989; }
.ob-fn-paid    { background: #9a6700; }

/* Prominent super-admin links to the right of the search bar */
.gh-special { display: flex; align-items: center; gap: 6px; margin: 0 2px 0 10px; }
.gh-special__link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; line-height: 1; white-space: nowrap;
  color: var(--fg); text-decoration: none;
  padding: 6px 11px; border-radius: 6px; border: 1px solid transparent;
}
.gh-special__link .icon { color: var(--fg-muted); }
.gh-special__link:hover { background: var(--canvas-subtle); border-color: var(--border); }
.gh-special__link:hover .icon { color: var(--fg); }
.gh-special__link.is-active { color: var(--primary); background: var(--primary-muted); border-color: #c7d2f0; }
.gh-special__link.is-active .icon { color: var(--primary); }
.gh-special__link--kant .icon { color: #1e3a8a; }
.gh-special__ai {
  font-size: 9px; font-weight: 700; letter-spacing: 0.4px;
  background: var(--primary); color: #fff; padding: 1px 5px; border-radius: 4px;
}

@media (max-width: 960px) { .gh-special { display: none; } }

/* --------------------------------------------------------------------------
   Live: the leads chart. Hand-authored SVG, like every other chart in GE.
   Hue is the channel (all vs ad pages), fill weight is whether they booked.
   The two lighter steps are validated colour steps, not opacity tints: a 32%
   tint of the solid falls below the contrast and chroma floors and reads grey.
   -------------------------------------------------------------------------- */

.lvhead { flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.lvhead .card__title { flex: none; }
.lvhead__form { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.lvhead__range { margin-left: auto; }

.select--sm { padding: 5px 26px 5px 10px; font-size: 12.5px; height: auto; }

.lvlegend { margin: 0 0 6px; align-items: center; }
.lvlegend__form { margin-left: auto; }
.lvdivider { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 28px 0 12px; padding-top: 18px; border-top: 1px solid var(--border); }
.lvdivider__title { font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }

.lvtabs { display: flex; gap: 2px; margin: 0 0 16px; border-bottom: 1px solid var(--border); }
.lvtabs__tab { padding: 7px 14px; margin-bottom: -1px; font-size: 13.5px; font-weight: 500; color: var(--fg-muted); text-decoration: none; border-bottom: 2px solid transparent; }
.lvtabs__tab:hover { color: var(--fg); text-decoration: none; }
.lvtabs__tab--active { color: var(--fg); font-weight: 600; border-bottom-color: var(--accent); }

.lvchart { width: 100%; }
.lvchart svg { display: block; width: 100%; height: auto; }
.lvchart__empty { padding: 28px 0; text-align: center; }

.lvgrid { stroke: var(--border-muted); stroke-width: 1; }
.lvaxis { stroke: var(--border); stroke-width: 1; }
.lvaxis__name { font-size: 11px; fill: var(--fg-subtle); letter-spacing: 0.6px; }
.lvtick  { font-size: 12px; fill: var(--fg-muted); }
.lvlabel { font-size: 12px; fill: var(--fg-muted); }
.lvlabel--future { fill: var(--ink-300); }
.lvlabel__note { font-size: 9.5px; fill: var(--ink-300); }

.lvtotal { font-size: 12.5px; font-weight: 700; fill: var(--fg); }
.lvseg   { font-size: 11px; font-weight: 600; }
.lvseg--dark  { fill: #2f333a; }
.lvseg--light { fill: #ffffff; }
.lvzero  { font-size: 11px; fill: var(--fg-subtle); }

.lvbar--all       { fill: #3e5ebe; }
.lvbar--all-open  { fill: #7d9aec; }
.lvbar--ad        { fill: #c94a2f; }
.lvbar--ad-open   { fill: #ee977f; }
.lvbar__zero--all { fill: #7d9aec; }
.lvbar__zero--ad  { fill: #ee977f; }

.lv-dot--all      { background: #3e5ebe; }
.lv-dot--all-open { background: #7d9aec; }
.lv-dot--ad       { background: #c94a2f; }
.lv-dot--ad-open  { background: #ee977f; }

.lvsync { margin-right: 10px; white-space: nowrap; }
.lvfoot { margin-top: 12px; border-top: 1px solid var(--border-muted); padding-top: 10px; }

@media (max-width: 700px) {
  .lvhead__range { margin-left: 0; width: 100%; }
}
}

/* --------------------------------------------------------------------------
   De-cannibalisation plan card
   -------------------------------------------------------------------------- */
.plan-card {
  background: var(--canvas-subtle);
  border: 1px solid var(--border-muted);
  border-radius: var(--r);
  padding: 12px 14px;
  margin: 10px 0;
}

.plan-card__head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
  font-size: 12.5px;
}

.plan-card p { margin: 0 0 6px; }

.plan-card__steps {
  margin: 10px 0 6px;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.plan-card__steps li { padding-left: 2px; }

/* --------------------------------------------------------------------------
   Expandable detail row
   .table-card .table is min-width: max-content so wide tables scroll rather
   than clip. Long prose inside a cell therefore stretches the whole table and
   drags the page sideways. The detail row opts out: it is capped to the
   viewport and wraps instead.
   -------------------------------------------------------------------------- */
.detail-row > td {
  padding: 0 16px 12px;
  background: var(--canvas);
}

.detail-row summary {
  cursor: pointer;
  color: var(--fg-muted);
  font-size: 12.5px;
  padding: 6px 0;
}

.detail-row__body {
  max-width: min(1040px, calc(100vw - 360px));
  white-space: normal;
  overflow-wrap: anywhere;
}

.detail-row__body .table { min-width: 0; width: 100%; }
.detail-row__body .table td:first-child { max-width: 460px; overflow-wrap: anywhere; }

.cell-query {
  max-width: 320px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.plan-card__steps li,
.plan-card p { overflow-wrap: anywhere; }

/* Link Map: one suggested internal link, with the sentence it belongs in.
   A list rather than a grid of cards: these are read top to bottom and
   compared against each other, and prose needs a full-width measure. */
.ilink-list { list-style: none; margin: 14px 0 0; padding: 0; }
.ilink {
  padding: 14px 0;
  border-top: 1px solid var(--line);
  max-width: min(760px, 100%);
}
.ilink-list > .ilink:first-child { border-top: 0; }
.ilink__head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 6px; }
.ilink__from { font-weight: 600; margin-right: 2px; }
.ilink__why { font-size: 14px; margin: 0 0 8px; color: var(--fg-muted); }
.ilink__sentence {
  margin: 0 0 8px;
  padding: 10px 12px;
  background: var(--canvas-subtle);
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.ilink__sentence mark { background: var(--attention-muted); padding: 0 2px; border-radius: 3px; font-weight: 600; }
.ilink__flag { font-size: 13px; color: var(--attention); display: flex; align-items: center; gap: 5px; margin: 6px 0 0; }
.ilink__paste {
  display: block;
  padding: 8px 10px;
  background: var(--canvas-inset);
  border-radius: 6px;
  font-size: 12.5px;
  overflow-wrap: anywhere;
  white-space: normal;
}
.ilink__actions { display: flex; gap: 6px; margin-top: 10px; }
.ilink__alt { margin-top: 2px; }
.ilink--unverified .ilink__sentence { opacity: 0.75; }

/* A run that finds nothing still has to show it ran, and say why it stopped. */
.ilink-empty { margin-top: 14px; max-width: min(680px, 100%); }
.ilink-empty__lead { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; margin: 0 0 6px; }
.ilink-empty__why { font-size: 14px; line-height: 1.55; color: var(--fg-muted); margin: 0 0 6px; }
.ilink-log { margin-top: 14px; font-size: 13px; }
.ilink-log summary { cursor: pointer; color: var(--fg-subtle); }
.ilink-log ol { margin: 8px 0 0; padding-left: 20px; color: var(--fg-muted); line-height: 1.7; }

/* ---- Live · shows its work ------------------------------------------- */
.lv-excl { color: var(--attention); }
.lvwork__group { border-top: 1px solid var(--border-muted); }
.lvwork__group:first-of-type { border-top: 0; }
.lvwork__group > summary { list-style: none; cursor: pointer; }
.lvwork__group > summary::-webkit-details-marker { display: none; }
.lvwork__row { display: flex; align-items: center; gap: 10px; padding: 10px 0; }
.lvwork__row::before { content: "▸"; color: var(--fg-muted); font-size: 11px; width: 10px; }
.lvwork__group[open] > .lvwork__row::before { content: "▾"; }
.lvwork__title { font-weight: 600; }
.lvwork__hint { margin-left: auto; text-align: right; }
.lvwork__table { margin: 0 0 14px 20px; width: calc(100% - 20px); font-size: 13px; }
.lvwork__table td.mono { font-family: var(--font-mono, ui-monospace, monospace); font-size: 12.5px; }
.lvwork__bars { margin: 4px 0 14px 20px; max-width: 520px; }
.lvwork__patterns { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin: 4px 0 12px 20px; }
.lvwork__list { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.lvwork__list li { display: flex; align-items: center; gap: 6px; }
.lvwork__list code { font-size: 12px; }
.lvwork__add { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0 0 12px 20px; }
.lvwork__add .input--sm { padding: 4px 8px; font-size: 13px; border: 1px solid var(--border); border-radius: 6px; background: var(--canvas); color: inherit; }
@media (max-width: 900px) { .kpi-grid[style*="repeat(5"] { grid-template-columns: repeat(2, 1fr) !important; } }

/* ---- Live · leads by country dialog ---------------------------------- */
.kpi--button { font: inherit; text-align: left; cursor: pointer; color: inherit; }
.kpi--button:hover .lvlink, .kpi--button:focus-visible .lvlink { text-decoration: underline; }
.kpi--button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.lvlink { color: var(--accent); }
.ob-dialog--wide { width: min(1040px, 94vw); max-height: 88vh; padding: 22px 24px; position: relative; }
.lvleads__close { position: absolute; top: 12px; right: 12px; }
.lvleads__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin: 0 40px 14px 0; }
.lvleads__scroll { overflow: auto; max-height: calc(88vh - 150px); }
.lvleads__table { font-size: 13.5px; font-variant-numeric: tabular-nums; }
.lvleads__table th.num, .lvleads__table td.num { text-align: right; }
.lvleads__table thead th { position: sticky; top: 0; background: var(--canvas); z-index: 1; }
.lvleads__unknown td { color: var(--fg-muted); }
.lvleads__total td { font-weight: 600; border-top: 2px solid var(--border); }

/* ---- Live · regions table -------------------------------------------- */
.lvregions { font-size: 14px; font-variant-numeric: tabular-nums; }
.lvregions th.num, .lvregions td.num { text-align: right; }
.lvregions td:first-child, .lvregions th:first-child { font-weight: 600; }
.lvregions__total { border-left: 1px solid var(--border); font-weight: 600; }
.lvregions__rate td { color: var(--fg-muted); border-top: 1px solid var(--border-muted); }
.lvregions__warn { background: var(--attention-muted); color: var(--attention); border-radius: 6px; padding: 8px 12px; margin: 0 0 12px; display: flex; align-items: flex-start; gap: 8px; }

/* ---- Live · segment comparison --------------------------------------- */
/* The filter groups and the table share one column template: each group is
   exactly as wide as the table column below it. Change the widths here and
   both move together. */
.lvseg { --lvseg-prop: 200px; --lvseg-col: 200px; }
.lvseg__scroll { overflow-x: auto; }
.lvseg__form { margin: 0; }
.lvseg__controls {
  display: grid;
  grid-template-columns: var(--lvseg-prop) repeat(4, var(--lvseg-col)) max-content;
  align-items: end;
}
.lvseg__group {
  display: flex; flex-direction: column; gap: 6px;
  padding: 8px 10px 10px;
  border: 1px solid var(--border-muted); border-radius: 8px;
  margin-bottom: 10px;
}
/* Group n sits over table column n; adjacent boxes share one 1px line at the
   exact column boundary. */
.lvseg__group:nth-child(1) { grid-column: 2; }
.lvseg__group:nth-child(2) { grid-column: 3; }
.lvseg__group:nth-child(3) { grid-column: 4; }
.lvseg__group:nth-child(4) { grid-column: 5; }
.lvseg__group + .lvseg__group { margin-left: -1px; }
.lvseg__group-title { margin-bottom: 2px; }
.lvseg__group .select { width: 100%; }
.lvseg__go { margin: 0 0 10px 14px; }
.lvseg__table { table-layout: fixed; width: calc(var(--lvseg-prop) + 5 * var(--lvseg-col)); }
.lvseg__table th:first-child { width: var(--lvseg-prop); }
.lvseg__totalcol { border-left: 1px solid var(--border); font-weight: 600; }
.lvseg__period .lvseg__totalcol { font-weight: 400; }
.lvseg__table th.num, .lvseg__table td.num { text-align: right; }
.lvseg__period td { color: var(--fg-muted); font-size: 12.5px; }
