/* job-radar — redesign layer
   Loaded after style.css. It carries the Figma file's tokens (Job-Radar,
   collection "color", Light and Dark) and restyles the shared components on
   top of the existing markup, so every element id the app's script reaches
   for stays where it was. Rules here win by order, not by specificity games.

   Motion follows skills/motion.md: tokens only (style.css section "Motion
   tokens"), transform and opacity only, exits shorter than entrances, menus
   grow from their trigger, nothing that is opened a hundred times a day
   animates more than a fade. */

/* ── Fonts the design adds ─────────────────────────────────────────────── */
@font-face {
  font-family: 'Fragment Mono';
  src: url('/static/fonts/FragmentMono-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ── Tokens: Light ─────────────────────────────────────────────────────── */
:root {
  --bg: #f7f0eb;
  --surface: #f5f2ed;
  --surface-raised: #ffffff;
  --brand: #46433e;
  --brand-hover: #34322e;
  --brand-active: #24221f;
  --on-brand: #f5f2ed;
  --brand-06: rgb(70 67 62 / 0.06);
  --brand-10: rgb(70 67 62 / 0.10);
  --brand-18: rgb(70 67 62 / 0.18);
  --brand-35: rgb(70 67 62 / 0.35);
  --gray-100: rgb(70 67 62 / 0.07);
  --gray-150: rgb(70 67 62 / 0.11);
  --border: rgb(0 0 0 / 0.10);
  --text-primary: rgb(0 0 0 / 0.85);
  --text-secondary: rgb(0 0 0 / 0.67);
  --text-subtle: rgb(0 0 0 / 0.60);
  /* 0.60, not 0.50: half-black measured 3.9:1 on the page and the cards,
     under the 4.5:1 WCAG AA asks of text this small. 0.60 is 5.5:1. */
  --text-muted: rgb(0 0 0 / 0.60);
  --success: #1b5e20;
  --danger: #a82c20;
  --danger-10: rgb(168 44 32 / 0.08);
  --scrim: rgb(0 0 0 / 0.45);
  --link: #46433e;

  --clay: #b85736;   --clay-soft: rgb(213 116 79 / 0.16);   --block-clay: #f6ddd2;
  /* The brand clay is for marks and icons. As text on its own soft tint it
     measured 3.6:1; this is the same hue, dark enough for 5:1. */
  --clay-text: #9c462a;
  --sage: #4a6e4f;   --sage-soft: rgb(99 139 104 / 0.16);   --block-sage: #dce6da;
  --ochre: #805a17;  --ochre-soft: rgb(206 153 53 / 0.18);  --block-ochre: #f4e6c7;
  --sky: #3f6489;    --sky-soft: rgb(97 139 181 / 0.15);    --block-sky: #dde7f0;

  --shadow-card: 0 1px 2px rgb(70 67 62 / 0.08), 0 8px 24px rgb(70 67 62 / 0.08);
  --shadow-float: 0 2px 6px rgb(70 67 62 / 0.10), 0 24px 56px rgb(70 67 62 / 0.18);

  /* Old names the rest of style.css reads, pointed at the new values. */
  --app-bg: var(--bg);
  --white: var(--surface-raised);
  --destructive: var(--danger);
  --destructive-bg: var(--danger-10);
  --success-fg: var(--success);
  --success-icon: var(--success);
  --warn: var(--ochre);
  --warn-bg: var(--ochre-soft);
  --text-placeholder: var(--text-muted);
  --focus-ring: var(--clay);
  --selection-bg: var(--brand);
  --selection-ink: var(--on-brand);
  --shadow-xs: var(--shadow-card);
  --shadow-sm: var(--shadow-float);

  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-6: 24px;
  --space-8: 32px; --space-10: 40px; --space-12: 48px; --space-16: 64px; --space-20: 80px;
  --r-card: 28px;
  --r-input: 14px;
  --r-menu: 20px;
  --r-item: 12px;
  --radius-card: var(--r-card);
  --radius-btn: 999px;
  --control-h: 44px;
  --control-h-sm: 36px;

  --font-mono: 'Fragment Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --sidebar-w: 264px;
  --topbar-h: 72px;
}

/* ── Tokens: Dark ──────────────────────────────────────────────────────── */
:root[data-theme='dark'] {
  /* style.css's own dark block is more specific than the light :root above,
     so every alias the redesign sets there is set again here, or the old
     dark value wins. */
  --app-bg: var(--bg);
  --white: var(--surface-raised);
  --warn: var(--ochre);
  --warn-bg: var(--ochre-soft);
  --text-placeholder: var(--text-muted);
  --selection-bg: var(--brand);
  --bg: #1c1917;
  --surface: #242220;
  --surface-raised: #2e2b28;
  --brand: #9e8170;
  --brand-hover: #b49682;
  --brand-active: #c8aa96;
  --on-brand: #1c1917;
  --brand-06: rgb(158 129 112 / 0.06);
  --brand-10: rgb(158 129 112 / 0.10);
  --brand-18: rgb(158 129 112 / 0.18);
  --brand-35: rgb(158 129 112 / 0.35);
  --gray-100: rgb(158 129 112 / 0.09);
  --gray-150: rgb(158 129 112 / 0.14);
  --border: rgb(255 255 255 / 0.10);
  --text-primary: rgb(245 241 237 / 0.85);
  --text-secondary: rgb(184 176 168 / 0.85);
  --text-subtle: rgb(184 176 168 / 0.80);
  --text-muted: rgb(184 176 168 / 0.78);
  --success: #4caf50;
  --danger: #ec8070;
  --danger-10: rgb(236 128 112 / 0.10);
  --scrim: rgb(0 0 0 / 0.55);
  --link: #b49682;

  --clay: #de8767;   --clay-soft: rgb(213 116 79 / 0.16);   --block-clay: #43302a;
  --clay-text: var(--clay);
  --sage: #95b795;   --sage-soft: rgb(99 139 104 / 0.15);   --block-sage: #2c3a2e;
  --ochre: #e4b865;  --ochre-soft: rgb(206 153 53 / 0.15);  --block-ochre: #423822;
  --sky: #94b5d1;    --sky-soft: rgb(97 139 181 / 0.14);    --block-sky: #28333f;

  --shadow-card: 0 1px 2px rgb(0 0 0 / 0.30), 0 8px 24px rgb(0 0 0 / 0.25);
  --shadow-float: 0 2px 6px rgb(0 0 0 / 0.35), 0 24px 56px rgb(0 0 0 / 0.45);
  --selection-ink: var(--on-brand);
}
/* Secondary text in dark reads too faint at .67 alpha on the raised
   surface; the Figma value is kept for text on the page, and labels on
   cards use subtle, which is the design's own step for that. */

/* ── Base ──────────────────────────────────────────────────────────────── */
body {
  background: var(--bg);
  font-size: 16px;
  line-height: 1.5;
  font-weight: 400;
}
.mono { font-family: var(--font-mono); font-size: 13px; letter-spacing: 0; }

/* No dividers anywhere: grouping is done with space and surface. */
.navbar, .sidebar, .card-header, .card-body, .site-pane-header, .av-header,
.av-tabs, .doc-bar, .kanban-column-header, .data-grid th, .data-grid td,
.companies-table th, .companies-table td, .facet-group, .sidebar-filters,
.save-bar, footer, .rs-tabs, .how-item, .admin-row, .source-row, .connector-row,
.company-group, .outreach-card-head, .fit-table td, .fit-table th, .scan-health-row,
.select-list, .resume-editor-head, .resume-review-head {
  border-top-color: transparent !important;
  border-bottom-color: transparent !important;
}
.navbar-sep { display: none; }
hr { display: none; }

/* ── Top bar ───────────────────────────────────────────────────────────── */
/* One container for the whole page. The shell (nav column + content) is
   capped and centred, and the top bar's contents sit in the same column:
   the mark lines up over the nav icons and the controls end where the
   content ends, at any window width. The bar's own fill still runs edge to
   edge. */
:root { --shell-max: 1536px; --main-pad-r: 48px; }
.app-shell, .app-shell:has(#application-single-view:not([hidden])) { max-width: var(--shell-max); width: 100%; margin-inline: auto; }
main, main:has(#application-single-view:not([hidden])) { max-width: none; }
.navbar {
  height: var(--topbar-h);
  padding: 0 32px;
  padding-left: max(32px, calc((100% - var(--shell-max)) / 2 + 32px));
  padding-right: max(var(--main-pad-r), calc((100% - var(--shell-max)) / 2 + var(--main-pad-r)));
  /* A scrim, like the site's header: content scrolls under it blurred and
     dimmed, so the eye sees where the bar ends instead of a hard cut.
     Mostly page colour, so text under it never competes with the bar. */
  background: color-mix(in srgb, var(--bg) 76%, transparent);
  backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 0;
  transition: box-shadow var(--duration-hover, 150ms) ease;
}
/* The edge only once something is under it: at the top of a page there is
   nothing to separate the bar from. */
body.is-scrolled .navbar { box-shadow: 0 1px 0 var(--gray-150); }
.navbar-brand-link { gap: 10px; }
.navbar-logo { width: 28px; height: 28px; }
.navbar-brand {
  font-family: var(--font-serif);
  font-size: 22px;
  line-height: 29px;
  letter-spacing: -0.005em;
  color: var(--text-primary);
}
.navbar-actions { gap: 12px; }

.icon-btn {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  color: var(--text-secondary);
  background: transparent;
  font-size: 20px;
  text-decoration: none;
  transition:
    background-color var(--duration-hover) ease,
    color var(--duration-hover) ease,
    transform var(--duration-press) var(--ease-out);
}
.icon-btn:hover { background: var(--gray-100); color: var(--text-primary); }
.icon-btn-sm { width: 32px; height: 32px; font-size: 18px; }

/* Theme: the moon in light, the sun in dark. The icon that leaves turns a
   quarter and fades, the one that arrives settles from the other side --
   occasional, and it says which way the switch went. */
#theme-toggle { position: relative; }
.theme-icon {
  position: absolute;
  transition:
    transform var(--duration-dropdown) var(--ease-out),
    opacity var(--duration-tooltip) ease-out;
}
.theme-icon.is-dark { opacity: 0; transform: rotate(-90deg) scale(0.9); }
:root[data-theme='dark'] .theme-icon.is-light { opacity: 0; transform: rotate(90deg) scale(0.9); }
:root[data-theme='dark'] .theme-icon.is-dark { opacity: 1; transform: none; }

/* Colour changes when the theme flips: the surfaces cross-fade rather than
   cut. Only on the big surfaces, only colour, and only for the moment of
   the switch (the class is on for 300ms). */
:root.theme-changing *, :root.theme-changing *::before, :root.theme-changing *::after {
  transition: background-color var(--duration-modal) ease, color var(--duration-modal) ease,
    border-color var(--duration-modal) ease, fill var(--duration-modal) ease !important;
}

.account { position: relative; }
.account-btn {
  padding: 0;
  border: 0;
  background: none;
  border-radius: 12px;
  cursor: pointer;
  transition: transform var(--duration-press) var(--ease-out);
}
.account-btn:active { transform: scale(0.96); }
.monogram {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--gray-150);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.03em;
  transition: background-color var(--duration-hover) ease;
}
.account-btn:hover .monogram, .account-btn[aria-expanded='true'] .monogram { background: var(--brand-18); }

/* ── Menus ─────────────────────────────────────────────────────────────────
   No scrim: a menu is not modal. It grows out of whatever opened it --
   transform-origin is set by the script from the trigger's side -- and
   shrinks back into it, faster than it came. */
.menu {
  position: absolute;
  z-index: 500;
  min-width: 240px;
  padding: 8px;
  background: var(--surface-raised);
  border-radius: var(--r-menu);
  box-shadow: var(--shadow-float);
  display: flex;
  flex-direction: column;
  gap: 2px;
  transform-origin: top right;
  opacity: 1;
  transform: none;
  transition:
    transform var(--duration-dropdown) var(--ease-out),
    opacity var(--duration-tooltip) ease-out;
}
.menu[data-floating='1'] { position: fixed; }
@starting-style {
  .menu { opacity: 0; transform: scale(0.96) translateY(-4px); }
}
.menu.is-closing {
  opacity: 0;
  transform: scale(0.97);
  transition-duration: var(--duration-press);
  pointer-events: none;
}
.menu[hidden] { display: none; }
.menu .job-status-actions { display: contents; }
.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--r-item);
  background: transparent;
  color: var(--text-primary);
  font: 400 16px/24px var(--font-sans);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--duration-hover) ease;
}
.menu-item i { font-size: 18px; color: var(--text-secondary); flex: none; }
.menu-item > span:first-of-type { flex: 1; }
.menu-item:hover, .menu-item:focus-visible { background: var(--gray-100); outline: none; }
.menu-item-meta { flex: none !important; font-size: 13px; color: var(--text-muted); font-weight: 500; }
.menu-item-danger, .menu-item-danger i { color: var(--danger); }
.menu-item-danger:hover { background: var(--danger-10); }

.account-menu { right: 0; top: calc(100% + 8px); width: 288px; }
.account-menu-who { display: flex; flex-direction: column; padding: 10px 12px 12px; }
.account-menu-name { font: 500 16px/20px var(--font-sans); color: var(--text-primary); }
.account-menu-email { font: 300 14px/20px var(--font-sans); color: var(--text-muted); }
.account-menu-quota {
  margin: 0 4px 8px;
  padding: 12px;
  border-radius: var(--r-item);
  background: var(--gray-100);
}
.account-menu-quota-row {
  display: flex;
  justify-content: space-between;
  font: 300 14px/20px var(--font-sans);
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.account-menu-quota-row .mono { color: var(--text-primary); }
.meter { height: 4px; border-radius: 999px; background: var(--gray-150); overflow: hidden; }
.meter-fill {
  display: block;
  height: 100%;
  background: var(--brand);
  transform-origin: left;
  transform: scaleX(0);
  transition: transform var(--duration-modal) var(--ease-out);
}
.meter-fill.is-near { background: var(--clay); }

/* ── Shell ─────────────────────────────────────────────────────────────── */
.app-shell { max-width: none; }
.sidebar {
  top: var(--topbar-h);
  width: var(--sidebar-w);
  max-height: calc(100vh - var(--topbar-h));
  height: calc(100vh - var(--topbar-h));
  padding: 24px 16px 24px 24px;
  border-right: 0;
  gap: 0;
}
.sidebar::after { display: none; }
.sidebar-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.sidebar-spacer { flex: 1; }
.sidebar-group {
  padding: 24px 12px 8px;
  font: 500 13px/16px var(--font-sans);
  letter-spacing: 0.005em;
  color: var(--text-muted);
}
.sidebar-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 10px 16px 10px 12px;
  border: 0;
  border-radius: 999px;
  font: 500 16px/20px var(--font-sans);
  color: var(--text-secondary);
  /* Nav is high-traffic: colour only, no travel (motion.md 1). */
  transition: background-color var(--duration-hover) ease, color var(--duration-hover) ease;
}
.sidebar-link i { font-size: 22px; flex: none; }
.sidebar-link-label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-count { font: 500 13px/16px var(--font-sans); color: var(--text-muted); font-variant-numeric: tabular-nums; }
.sidebar-link:hover { background: var(--gray-100); color: var(--text-primary); }
.sidebar-link.active {
  background: var(--surface-raised);
  color: var(--text-primary);
  box-shadow: var(--shadow-card);
}
.sidebar-link.active i { color: var(--clay); }
.sidebar-link.active .ph::before { font-family: 'Phosphor-Fill'; }
.sidebar-close-btn, .sidebar-reopen-btn { display: none !important; }

/* The credit lives at the end of main, which is at least as tall as the
   screen under the top bar: a short page puts it at the bottom without
   adding height, so a clean screen never scrolls. */
main {
  max-width: none;
  padding: 16px var(--main-pad-r) 0 16px;
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - var(--topbar-h));
  box-sizing: border-box;
}
main > * { min-width: 0; }
.tab-panel.active {
  /* Switching sections is done tens of times a day: a fade under 150ms,
     no travel, so it reads as continuity and never as waiting. */
  animation: panel-in var(--duration-tooltip) ease-out;
}
@keyframes panel-in { from { opacity: 0; } to { opacity: 1; } }

.page-title {
  font-family: var(--font-serif);
  font-size: 40px;
  line-height: 46px;
  letter-spacing: -0.015em;
  margin: 8px 0 8px;
}
.page-subtitle {
  font: 300 18px/28px var(--font-sans);
  color: var(--text-secondary);
  max-width: 64ch;
  margin-bottom: 32px;
}
.section-head { display: flex; align-items: baseline; gap: 12px; margin: 8px 0 16px; }
.section-title {
  font-family: var(--font-serif);
  font-size: 22px;
  line-height: 29px;
  letter-spacing: -0.005em;
}
.section-count { color: var(--text-muted); }

/* ── Hero ──────────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 340px;
  padding: 48px 48px 48px 56px;
  margin-bottom: 32px;
  border-radius: 32px;
  background: var(--block-clay);
  overflow: hidden;
  isolation: isolate;
}
.hero-copy { position: relative; z-index: 1; flex: 1; min-width: 0; max-width: 608px; display: flex; flex-direction: column; gap: 20px; }
.hero-fresh { display: flex; align-items: center; gap: 8px; margin: 0; font: 500 15px/19px var(--font-sans); color: var(--text-secondary); }
.hero-title {
  font-size: 56px;
  line-height: 58px;
  letter-spacing: -0.025em;
  margin: 0;
  max-width: 14ch;
  text-wrap: balance;
}
.hero-sub { margin: 0; font: 300 18px/28px var(--font-sans); color: var(--text-secondary); max-width: 520px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); flex: none; }
.dot-success { background: var(--success); }
.dot-clay { background: var(--clay); }
.dot-ochre { background: var(--ochre); }

/* The radar: rings that open out from a point behind the card. Ambient, so
   it gets the long budget, runs three times and stops -- WCAG 2.2.2 asks
   for a pause control on anything that moves for longer than five seconds,
   and a background that settles needs none. */
.hero-radar { position: absolute; z-index: 0; right: 96px; top: 50%; width: 0; height: 0; pointer-events: none; }
.hero-radar span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 720px;
  height: 720px;
  margin: -360px 0 0 -360px;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--clay) 22%, transparent);
  transform: scale(0.25);
  opacity: 0;
  animation: radar-ring 4.8s cubic-bezier(0.22, 0.61, 0.36, 1) 3 forwards;
}
.hero-radar span:nth-child(2) { animation-delay: 1.2s; }
.hero-radar span:nth-child(3) { animation-delay: 2.4s; }
.hero-radar span:nth-child(4) {
  animation: none;
  transform: scale(0.62);
  opacity: 0.7;
  border-style: solid;
}
@keyframes radar-ring {
  0% { transform: scale(0.18); opacity: 0; }
  12% { opacity: 0.9; }
  100% { transform: scale(1); opacity: 0; }
}
.hero-collage { position: relative; z-index: 1; flex: none; width: 400px; height: 300px; }
.hero-card-back {
  position: absolute;
  inset: 8px 0 auto 30px;
  height: 250px;
  border-radius: 24px;
  background: color-mix(in srgb, var(--surface-raised) 55%, transparent);
  transform: rotate(4deg);
}
.hero-collage .job-card {
  position: absolute;
  left: 20px;
  top: 30px;
  width: 360px;
  box-shadow: var(--shadow-float);
  transform: rotate(-3deg);
  pointer-events: none;
}
.hero-collage .job-card .btn-secondary { background: var(--brand); color: var(--on-brand); border-color: transparent; }
.hero-collage:empty { display: none; }
.hero .results-search { max-width: 520px; }

/* ── Search field ──────────────────────────────────────────────────────── */
.results-search {
  position: relative;
  display: flex;
  align-items: center;
  height: 48px;
  padding: 0 20px 0 18px;
  gap: 10px;
  background: var(--surface-raised);
  border-radius: 999px;
  box-shadow: 0 0 0 1px var(--border);
  transition: box-shadow var(--duration-hover) ease;
}
.results-search:focus-within { box-shadow: 0 0 0 1px var(--brand), 0 0 0 4px var(--brand-10); }
.results-search i { position: static; transform: none; font-size: 18px; color: var(--text-muted); }
.results-search input[type='search'] {
  height: 46px;
  padding: 0;
  background: transparent !important;
  border: 0 !important;
  font: 400 16px/24px var(--font-sans);
  text-overflow: ellipsis;
}

/* ── Toolbar, chips, segmented ─────────────────────────────────────────── */
.results-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 24px;
}
.filter-chips { display: contents; }
.results-toolbar .view-toggle { margin-left: auto; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-raised);
  color: var(--text-primary);
  font: 500 13px/16px var(--font-sans);
  letter-spacing: 0.005em;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color var(--duration-hover) ease,
    border-color var(--duration-hover) ease,
    transform var(--duration-press) var(--ease-out);
}
.chip i { font-size: 14px; }
.chip.is-on { background: var(--gray-150); border-color: transparent; }
.chip.is-on:hover { background: var(--brand-18); }
.chip .chip-x { opacity: 0.55; margin-right: -4px; transition: opacity var(--duration-hover) ease; }
.chip:hover .chip-x { opacity: 1; }
.chip:active { transform: scale(0.97); }
.chip-blank { background: var(--clay-soft); color: var(--clay-text); border-color: transparent; }
@starting-style { .filter-chips .chip { opacity: 0; transform: scale(0.94); } }
.filter-chips .chip { transition: opacity var(--duration-tooltip) ease-out, transform var(--duration-dropdown) var(--ease-out), background-color var(--duration-hover) ease; }

.btn-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--brand);
  color: var(--on-brand);
  font: 500 12px/1 var(--font-sans);
}

.view-toggle, .segmented, .seg {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: var(--gray-100);
  border: 0;
}
.view-toggle-btn, .seg label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: auto;
  height: 36px;
  padding: 0 16px 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  font: 500 13px/16px var(--font-sans);
  text-transform: none;
  letter-spacing: 0.005em;
  cursor: pointer;
  transition: background-color var(--duration-hover) ease, color var(--duration-hover) ease, box-shadow var(--duration-hover) ease;
}
.view-toggle-btn i { font-size: 16px; }
.view-toggle-btn:hover, .seg label:hover { color: var(--text-primary); }
.view-toggle-btn.active, .seg input:checked + label {
  background: var(--surface-raised);
  color: var(--text-primary);
  box-shadow: var(--shadow-card);
}

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn {
  height: var(--control-h);
  padding: 0 20px;
  border-radius: 999px;
  font: 500 15px/19px var(--font-sans);
  gap: 8px;
}
.btn-sm { height: var(--control-h-sm); padding: 0 16px; font-size: 13px; line-height: 16px; letter-spacing: 0.005em; }
.btn-ghost.btn-sm { padding: 0 14px; }
.btn-primary { background: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: var(--brand-hover); }
.btn-primary:active { background: var(--brand-active); }
.btn-secondary {
  background: var(--surface-raised);
  color: var(--text-primary);
  border-color: var(--border);
}
.btn-secondary:hover { background: var(--surface-raised); border-color: var(--brand-35); }
.btn-ghost { color: var(--text-primary); }
.btn-ghost:hover { background: var(--gray-100); }
.btn-danger { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.btn-danger:hover { background: var(--danger-10); border-color: var(--danger); }
.btn:focus-visible, .chip:focus-visible, .icon-btn:focus-visible, .sidebar-link:focus-visible,
.view-toggle-btn:focus-visible, .menu-item:focus-visible, .account-btn:focus-visible {
  outline: 2px solid var(--clay);
  outline-offset: 2px;
}

/* ── Badges ────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--gray-100);
  color: var(--text-secondary);
  font: 500 12px/1 var(--font-sans);
  letter-spacing: 0.005em;
  text-transform: none;
  white-space: nowrap;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.8; }
.badge-sage { background: var(--sage-soft); color: var(--sage); }
.badge-ochre { background: var(--ochre-soft); color: var(--ochre); }
.badge-clay { background: var(--clay-soft); color: var(--clay-text); }
.badge-sky { background: var(--sky-soft); color: var(--sky); }

/* ── Monograms: neutral in lists, the logo when there is one ────────────── */
.brand-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--gray-100);
  color: var(--text-secondary);
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 18px;
  letter-spacing: 0;
}
.brand-avatar-img { background: var(--surface-raised); padding: 6px; }
.with-brand .brand-avatar, .data-grid .brand-avatar, .companies-table .brand-avatar,
.kanban-card .brand-avatar, .nearshore-card .brand-avatar, .company-job-row .brand-avatar {
  width: 28px; height: 28px; border-radius: 8px; font-size: 13px;
}
.with-brand .brand-avatar-img, .data-grid .brand-avatar-img, .kanban-card .brand-avatar-img { padding: 4px; }

/* ── Job card ──────────────────────────────────────────────────────────── */
.overview-results-card {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  align-items: start;
}
.job-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
  border-radius: 24px;
  background: var(--surface-raised);
  box-shadow: var(--shadow-card);
  min-width: 0;
  transition: transform var(--duration-dropdown) var(--ease-out), box-shadow var(--duration-dropdown) ease;
}
@media (hover: hover) and (pointer: fine) {
  .overview-results-card .job-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-float); }
}
.job-card-head { display: flex; align-items: center; gap: 12px; }
.job-card-who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.job-card-company { font: 500 15px/19px var(--font-sans); color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.job-card-when { font: 300 13px/18px var(--font-sans); color: var(--text-muted); }
.job-card-head .icon-btn { opacity: 0.7; }
.job-card:hover .job-card-head .icon-btn, .job-card-head .icon-btn:focus-visible, .job-card-head .icon-btn[aria-expanded='true'] { opacity: 1; }
.job-card-title {
  all: unset;
  cursor: pointer;
  font-family: var(--font-serif);
  font-size: 22px;
  line-height: 29px;
  letter-spacing: -0.005em;
  color: var(--text-primary);
  text-wrap: pretty;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.job-card-title:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; text-decoration-color: var(--brand-35); }
.job-card-title:focus-visible { outline: 2px solid var(--clay); outline-offset: 4px; border-radius: 6px; }
.job-card-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font: 300 14px/20px var(--font-sans); color: var(--text-secondary); }
.job-card-meta span { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.job-card-meta i { font-size: 16px; color: var(--text-muted); }
.job-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; }
.job-card-foot .job-status-btn {
  width: auto; height: var(--control-h-sm); border-radius: 999px; padding: 0 16px;
}
.job-card-foot .job-status-btn i { display: none; }
.job-card-foot .job-status-btn:has(.icon-spin) i,
.job-card-foot .job-status-btn.sent i { display: inline-block; }
.job-card-foot .job-status-btn.sent { background: var(--sage-soft); color: var(--sage); border-color: transparent; }

/* ── Empty state ───────────────────────────────────────────────────────── */
.empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 64px 24px;
  border-radius: var(--r-card);
  background: var(--surface);
}
.empty-state-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; border-radius: 18px;
  background: var(--gray-100); color: var(--text-secondary); font-size: 26px; margin-bottom: 8px;
}
.empty-state-title { margin: 0; font-family: var(--font-serif); font-size: 22px; line-height: 29px; color: var(--text-primary); }
.empty-state-body { margin: 0 0 12px; max-width: 44ch; font: 300 16px/24px var(--font-sans); color: var(--text-secondary); }
.nearshore-empty { padding: 48px 24px; text-align: center; color: var(--text-secondary); font: 300 16px/24px var(--font-sans); background: var(--surface); border-radius: var(--r-card); }

/* ── Drawer ────────────────────────────────────────────────────────────────
   Modal, so a scrim. It travels the farthest of anything here, so it gets
   the drawer budget and its own curve; it leaves the way it came, faster. */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 450;
  background: var(--scrim);
  opacity: 1;
  transition: opacity var(--duration-modal) ease-out;
}
@starting-style { .drawer-backdrop { opacity: 0; } }
.drawer-backdrop.is-closing { opacity: 0; transition-duration: var(--duration-drawer-exit); }
.drawer-backdrop[hidden] { display: none; }
.drawer {
  position: absolute;
  top: 12px;
  right: 12px;
  bottom: 12px;
  width: min(440px, calc(100vw - 24px));
  display: flex;
  flex-direction: column;
  background: var(--surface-raised);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-float);
  overflow: hidden;
  transform: none;
  transition: transform var(--duration-drawer) var(--ease-drawer);
}
@starting-style { .drawer { transform: translateX(calc(100% + 24px)); } }
.drawer-backdrop.is-closing .drawer {
  transform: translateX(calc(100% + 24px));
  transition: transform var(--duration-drawer-exit) var(--ease-in-out);
}
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 24px 24px 8px 32px; }
.drawer-title { font-family: var(--font-serif); font-size: 30px; line-height: 36px; letter-spacing: -0.01em; }
.drawer-body { flex: 1; overflow-y: auto; padding: 8px 32px 24px; overscroll-behavior: contain; }
.drawer-foot { display: flex; justify-content: space-between; gap: 12px; padding: 16px 24px 24px 32px; background: var(--surface-raised); }
.drawer .sidebar-filters { display: block; padding: 0; margin: 0; border: 0; }
.drawer .sidebar-filters[hidden] { display: block; }
.drawer .facet-group { padding: 16px 0 8px; margin: 0; }
.drawer .facet-group-title {
  font: 500 13px/16px var(--font-sans);
  letter-spacing: 0.005em;
  text-transform: none;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.drawer .facet-item, .drawer .facet-option {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: var(--r-item);
  font: 400 16px/24px var(--font-sans);
  color: var(--text-primary);
  background: transparent;
  border: 0;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: background-color var(--duration-hover) ease;
}
.drawer .facet-item:hover, .drawer .facet-option:hover { background: var(--gray-100); }
.drawer .facet-item label { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; cursor: pointer; }
.drawer .facet-item-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drawer .facet-item-count { font: 500 13px/16px var(--font-sans); color: var(--text-muted); }
.drawer .facet-option > span:first-child { flex: 1; }
.drawer .facet-option.active { background: var(--gray-150); }
.drawer .facet-option.active::before { content: '\e182'; font-family: 'Phosphor'; color: var(--clay); font-size: 16px; }
.drawer .facet-search-input, .drawer .facet-add-row input { margin: 4px 0 8px; }
.drawer .facet-add-row { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.drawer .facet-add-btn { width: 44px; height: 44px; border-radius: 999px; border: 0; flex: none; }
.drawer .facet-toggle-btn { margin: 4px 0 0 12px; background: none; border: 0; color: var(--link); font: 500 15px/19px var(--font-sans); cursor: pointer; padding: 8px 0; }
html.has-overlay { overflow: hidden; }

/* ── Inputs: the Field rules from the design ───────────────────────────────
   One line never wraps: ellipsis at rest, it scrolls sideways while typing.
   Many lines start at three, grow to about eight, then scroll. 16px on the
   sides, 14px top and bottom -- the text never meets the edge. */
input[type='text'], input[type='url'], input[type='number'], input[type='password'],
input[type='email'], input[type='search'], textarea, .select-button {
  height: var(--control-h);
  padding: 0 16px;
  border-radius: var(--r-input);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  font: 400 16px/24px var(--font-sans);
  color: var(--text-primary);
  text-overflow: ellipsis;
  transition: border-color var(--duration-hover) ease, box-shadow var(--duration-hover) ease;
}
input[type='text']:hover, input[type='url']:hover, input[type='password']:hover,
input[type='email']:hover, input[type='search']:hover, textarea:hover, .select-button:hover {
  background: var(--surface-raised);
  border-color: var(--brand-35);
}
input[type='text']:focus, input[type='url']:focus, input[type='number']:focus, input[type='password']:focus,
input[type='email']:focus, input[type='search']:focus, textarea:focus {
  background: var(--surface-raised);
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-10);
}
textarea {
  height: auto;
  min-height: calc(3 * 24px + 28px);
  max-height: calc(8 * 24px + 28px);
  padding: 14px 16px;
  line-height: 24px;
  field-sizing: content;
  resize: vertical;
}
input::placeholder, textarea::placeholder { color: var(--text-muted); }
.field-label, .rules-field-title {
  text-transform: none;
  letter-spacing: 0.005em;
  font: 500 13px/16px var(--font-sans);
  color: var(--text-secondary);
}
input[type='checkbox'] {
  width: 20px; height: 20px; border-radius: 6px;
  border: 1.5px solid var(--brand-35);
  background: var(--surface-raised);
  transition: background-color var(--duration-press) ease, border-color var(--duration-press) ease;
}
input[type='checkbox']:checked { background: var(--brand); border-color: var(--brand); }

/* ── Cards ─────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface-raised);
  border: 0;
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  margin-bottom: 24px;
}
.card-header { padding: 28px 32px 8px; }
.card-title {
  text-transform: none;
  letter-spacing: -0.005em;
  font-family: var(--font-serif);
  font-size: 22px;
  line-height: 29px;
  color: var(--text-primary);
}
.card-hint { font: 300 14px/20px var(--font-sans); color: var(--text-secondary); }
.card-body { padding: 8px 32px 32px; }

/* ── Toast ─────────────────────────────────────────────────────────────── */
.snackbar {
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 16px);
  min-height: 52px;
  padding: 8px 8px 8px 20px;
  border-radius: 999px;
  background: var(--brand);
  color: var(--on-brand);
  box-shadow: var(--shadow-float);
}
.snackbar.visible { transform: translate(-50%, 0); }
.snackbar-message { font: 400 15px/20px var(--font-sans); }
.snackbar-action {
  height: 36px; padding: 0 14px; border-radius: 999px; border: 0;
  background: color-mix(in srgb, var(--on-brand) 14%, transparent);
  color: var(--on-brand); font: 500 13px/16px var(--font-sans); cursor: pointer;
}
.snackbar-dismiss { color: var(--on-brand); border-radius: 999px; width: 36px; height: 36px; }

/* ── Tooltip ───────────────────────────────────────────────────────────── */
#global-tooltip {
  background: var(--brand);
  color: var(--on-brand);
  border-radius: 10px;
  padding: 8px 12px;
  font: 400 13px/18px var(--font-sans);
  box-shadow: var(--shadow-float);
  transform: translateY(2px);
  transition: opacity var(--duration-tooltip) ease-out, transform var(--duration-tooltip) var(--ease-out);
}
#global-tooltip.visible { transform: none; }

/* ── Dialogs ───────────────────────────────────────────────────────────── */
.dialog-backdrop { background: var(--scrim); }
.dialog-backdrop #application-single-view, .how-dialog, .dialog {
  border-radius: var(--r-card);
  background: var(--surface-raised);
  box-shadow: var(--shadow-float);
  border: 0;
}

/* ── Footer ────────────────────────────────────────────────────────────── */
main > .app-footer { max-width: none; width: auto; box-sizing: border-box; margin: auto 0 0; border: 0; padding: 48px 0 32px; text-align: left; font: 300 13px/18px var(--font-sans); color: var(--text-muted); background: transparent; }
main > .app-footer a { color: var(--text-secondary); }

/* ── Scan health chip (Jobs) ───────────────────────────────────────────── */
.scan-health {
  height: 36px; padding: 0 14px; border-radius: 999px; border: 0;
  background: transparent; color: var(--text-secondary);
  font: 500 13px/16px var(--font-sans); display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
}
.scan-health:hover { background: var(--gray-100); }
.scan-health.has-failures i { color: var(--ochre); }

/* ── Data grid, quieter ────────────────────────────────────────────────── */
.overview-results-grid, .table-scroll {
  background: var(--surface-raised);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  border: 0;
}
/* The header cell paints the page colour: it is the plate behind the bar's
   rounded ends (style.css). The card's shadow runs straight up its sides,
   so once the header sticks, a sliver of it showed as a sharp point between
   the bar's curve and that straight edge. The end cells cover it with a
   strip of page colour as wide as the shadow, for their own height only,
   and only while stuck (app.js sets .is-stuck): at rest that strip would be
   a notch cut out of the card's shadow. */
.data-grid.is-stuck thead th { box-shadow: 0 -16px 0 var(--app-bg); }
.data-grid.is-stuck thead th:first-child { box-shadow: 0 -16px 0 var(--app-bg), -32px 0 0 var(--app-bg), -32px -16px 0 var(--app-bg); }
.data-grid.is-stuck thead th:last-child { box-shadow: 0 -16px 0 var(--app-bg), 32px 0 0 var(--app-bg), 32px -16px 0 var(--app-bg); }
.data-grid th {
  background: var(--app-bg);
  font: 500 13px/16px var(--font-sans);
  letter-spacing: 0.005em;
  text-transform: none;
  color: var(--text-muted);
}
/* The header sticks flush under the top bar. 120px was the old navbar plus
   a toolbar that no longer sticks, and the gap between them was a window the
   rows scrolled through. Its bar takes the card's own radius: a smaller one
   left its corners outside the card's curve. */
/* Stuck 16px under the bar, not flush with it: a header touching the bar's
   edge read as cramped. The gap is filled with page colour by the stuck
   header itself (below), so rows never show through it. */
#overview-results-grid, .data-grid { --grid-head-top: calc(var(--topbar-h) + 16px); --radius-grid-head: var(--r-card); }
/* The bar keeps its top stroke: it is what joins the end cells' curved
   corners (style.css). Only the bottom line goes. */
.data-grid thead th::before { border: 0; border-top: 1px solid var(--border); }
/* One opaque hover colour, painted on the cells and reused by the actions
   veil. It was two translucent layers (the row's gray-100 under the cells'
   brand-06), while the veil mixed its tint over the page colour, not the
   card's -- so the veil read as a darker band over the hovered row. */
.data-grid { --row-hover: color-mix(in srgb, var(--brand) 14%, var(--surface-raised)); }
.data-grid tbody td { transition: background-color var(--duration-hover) ease; }
.data-grid tbody tr:hover td { background: var(--row-hover); }
.data-grid td .job-status-actions { --actions-veil: var(--row-hover); }

/* ── Reduced motion: keep fades, drop travel (motion.md 13) ──────────────── */
@media (prefers-reduced-motion: reduce) {
  .hero-radar span { animation: none; opacity: 0; }
  .hero-radar span:nth-child(4) { opacity: 0.7; }
  .drawer, .drawer-backdrop.is-closing .drawer { transition: none; transform: none; }
  .menu, .menu.is-closing { transform: none; }
  .job-card, .chip, .icon-btn, .btn { transition-property: background-color, color, border-color, box-shadow, opacity; }
  .overview-results-card .job-card:hover { transform: none; }
  .theme-icon { transition: opacity var(--duration-tooltip) ease-out; transform: none !important; }
}

/* Source kinds are facts, not alarms: all neutral. Only a failed source
   asks for anything, and it says so in words, with one ochre mark. */
.badge-api, .badge-rss, .badge-sitemap, .badge-google_fallback {
  background: var(--gray-100); color: var(--text-secondary); border: 0;
}
.badge-failed { background: var(--ochre-soft); color: var(--ochre); border: 0; }

/* The toolbar sat sticky over the list with nothing behind it. It scrolls
   with the page now; the chips are one scroll away at most. */
#tab-overview .results-toolbar { position: static; background: none; box-shadow: none; padding: 0; }

/* ── Drawer contents (S16) ─────────────────────────────────────────────── */
.drawer .facet-group { padding: 20px 0 4px; }
.drawer .facet-group-title {
  display: flex; justify-content: space-between; align-items: baseline;
  font: 500 15px/19px var(--font-sans); color: var(--text-primary); margin-bottom: 12px;
}
.facet-group-note { font: 300 13px/18px var(--font-sans); color: var(--text-muted); }
.drawer #facet-window-list, .drawer #facet-titles-list { display: flex; flex-wrap: wrap; gap: 8px; }
.drawer #facet-window-list .chip, .drawer #facet-titles-list .chip { height: 36px; }
.drawer .chip.facet-option { width: auto; min-height: 0; padding: 0 14px; border: 1px solid var(--border); background: var(--surface-raised); font: 500 13px/16px var(--font-sans); }
.drawer .chip.facet-option.is-on { background: var(--gray-150); border-color: transparent; }
.drawer .chip.facet-option.active::before { content: none; }
.chip-count { color: var(--text-muted); font-weight: 500; margin-left: 2px; }
.drawer .segmented { display: inline-flex; }
.drawer .facet-add-row { position: relative; margin-top: 12px; }
.drawer .facet-add-row input { margin: 0; padding-left: 44px; }
.drawer .facet-add-btn {
  position: absolute; left: 4px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; background: transparent; color: var(--text-muted); font-size: 18px;
}
.drawer .facet-add-btn:hover { color: var(--text-primary); background: var(--gray-100); }
.drawer .facet-search-input { padding-left: 44px; background-image: none; }
.drawer .facet-group:has(.facet-search-input) { position: relative; }
.drawer .facet-group:has(.facet-search-input)::before {
  content: '\e30c'; font-family: 'Phosphor'; position: absolute; left: 16px; top: 63px;
  font-size: 18px; color: var(--text-muted); pointer-events: none; z-index: 1;
}
.drawer .facet-item { padding: 0 12px 0 4px; }
.drawer .facet-item-count.is-additive { color: var(--text-muted); }
.drawer #facet-window-list, .drawer #facet-titles-list { flex-direction: row; align-items: center; }
.drawer #facet-window-list .chip, .drawer #facet-titles-list .chip { width: auto; flex: none; justify-content: flex-start; }
.drawer .segmented { align-self: flex-start; }
.drawer .segmented .view-toggle-btn { padding: 0 16px; }

/* ── Page head: title on the left, the page's one action on the right ──── */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.page-head-text { min-width: 0; }
.page-head .page-subtitle { margin-bottom: 0; font: 400 16px/24px var(--font-sans); }
.page-head .board-toolbar { margin: 0; flex-wrap: nowrap; }
.board-add-row { flex: 0 1 360px; width: 360px; }
.board-search { flex: 0 1 220px; }
.spinner-dot {
  display: inline-block; width: 14px; height: 14px; flex: none;
  border-radius: 50%; border: 2px solid color-mix(in srgb, currentColor 25%, transparent); border-top-color: currentColor;
  animation: spin 0.8s linear infinite;
}

/* ── Kanban (S4) ───────────────────────────────────────────────────────── */
.kanban { gap: 16px; grid-auto-columns: minmax(232px, 1fr); margin-top: 0; padding-bottom: 16px; }
.kanban-wrap::after { display: none; }
.kanban-column { background: var(--gray-100); border: 0; border-radius: 24px; }
.kanban-column-header { padding: 16px 18px 12px; }
.kanban-column-title { display: inline-flex; align-items: center; gap: 8px; font: 500 15px/19px var(--font-sans); text-transform: none; color: var(--text-primary); background: none; padding: 0; }
.kanban-column-title .dot { width: 7px; height: 7px; }
.stage-dot-to_apply { background: var(--sky); }
.stage-dot-applied { background: var(--ochre); }
.stage-dot-follow_ups { background: var(--clay); }
.stage-dot-rejected { background: var(--text-muted); }
.stage-dot-accepted { background: var(--sage); }
.kanban-column-count { background: none; padding: 0; font: 500 13px/16px var(--font-sans); color: var(--text-muted); }
.kanban-column-body { gap: 8px; padding: 0 8px 8px; min-height: 120px; border-radius: 20px; transition: background-color var(--duration-hover) ease; }
.kanban-column-body.is-over { background: var(--brand-10); }
.kanban-card {
  display: flex; flex-direction: column; gap: 8px;
  padding: 14px 12px 14px 16px;
  background: var(--surface-raised);
  border: 0;
  border-radius: 16px;
  box-shadow: 0 1px 2px rgb(70 67 62 / 0.06);
  transition: box-shadow var(--duration-dropdown) ease, transform var(--duration-dropdown) var(--ease-out), opacity var(--duration-dropdown) ease;
}
@media (hover: hover) and (pointer: fine) {
  .kanban-card:hover { box-shadow: var(--shadow-card); border-color: transparent; }
}
.kanban-card:focus-visible { outline: 2px solid var(--clay); outline-offset: 2px; }
.kanban-card.is-dragging { opacity: 0.5; transform: scale(0.98); }
.kanban-card.is-analyzing { border-style: none; }
.kanban-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kanban-card-company { display: flex; align-items: center; gap: 8px; min-width: 0; font: 400 14px/20px var(--font-sans); color: var(--text-secondary); }
.kanban-card .brand-avatar { width: 24px; height: 24px; border-radius: 7px; font-size: 12px; }
.kanban-card-menu-btn { position: static; width: 28px; height: 28px; border-radius: 999px; margin: -4px -2px -4px 0; }
.kanban-card-title { margin: 0; font: 500 15px/20px var(--font-sans); letter-spacing: 0; color: var(--text-primary); }
.app-status { display: inline-flex; align-items: center; gap: 6px; font: 400 13px/18px var(--font-sans); color: var(--text-muted); }
.app-status i { font-size: 15px; }
.app-status.is-action { color: var(--clay-text); }
.app-status.is-danger { color: var(--danger); }
.app-status.is-ok { color: var(--sage); }
.app-status.is-working { color: var(--text-secondary); }
.app-status .spinner-dot { width: 12px; height: 12px; }
/* While the comparison runs, the card breathes once a second and a half --
   it says "still working" without anything moving across the page. */
.kanban-card.is-analyzing::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(100deg, transparent 30%, color-mix(in srgb, var(--surface) 70%, transparent) 50%, transparent 70%);
  background-size: 250% 100%;
  animation: analysis-shimmer 1.8s linear infinite;
}
.kanban-column-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 28px 12px 32px; }
.kanban-empty-icon { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 16px; background: var(--block-ochre); color: var(--ochre); font-size: 26px; margin-bottom: 8px; }
.kanban-empty-title { margin: 0; font-family: var(--font-serif); font-size: 22px; line-height: 29px; color: var(--text-primary); }
.kanban-empty-body { margin: 0; font: 300 14px/20px var(--font-sans); color: var(--text-secondary); }
.card-menu { border: 0; border-radius: var(--r-menu); padding: 8px; box-shadow: var(--shadow-float); background: var(--surface-raised); min-width: 240px; }
.card-menu-item { min-height: 44px; padding: 10px 12px; border-radius: var(--r-item); font: 400 16px/24px var(--font-sans); gap: 12px; }
.card-menu-item i { font-size: 18px; }
.card-menu-item:hover { background: var(--gray-100); }
.card-menu-item.is-destructive:hover { background: var(--danger-10); }
[hidden] { display: none !important; }
.results-search input { height: 46px; padding: 0; background: transparent !important; border: 0 !important; box-shadow: none !important; font: 400 16px/24px var(--font-sans); min-width: 0; flex: 1; }
.kanban { grid-auto-columns: minmax(196px, 1fr); gap: 12px; }

/* ── Application dialog (S5) ───────────────────────────────────────────── */
.dialog-backdrop { padding: 24px; background: var(--scrim); }
.dialog-backdrop #application-single-view {
  max-width: 1360px;
  max-height: calc(100vh - 48px);
  background: var(--surface);
  border: 0;
  border-radius: var(--r-card);
  box-shadow: var(--shadow-float);
}
.dialog-backdrop #application-single-view > .av-header {
  position: sticky;
  top: 0;
  z-index: 21;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 20px 20px 16px 28px;
  background: var(--surface);
  border: 0;
}
.av-header-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.av-mono .brand-avatar { width: 40px; height: 40px; border-radius: 12px; font-size: 18px; }
.av-header-text { min-width: 0; }
.app-panel-title { font-family: var(--font-serif); font-size: 22px; line-height: 29px; letter-spacing: -0.005em; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 400; }
.app-panel-subtitle { font: 300 14px/20px var(--font-sans); color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 0; }
.dialog-backdrop .av-tabs, .av-tabs {
  position: static;
  padding: 4px;
  gap: 4px;
  border: 0;
  background: var(--gray-100);
  border-radius: 999px;
  justify-self: center;
}
.av-tab-btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 16px 0 14px;
  border: 0; border-radius: 999px;
  font: 500 13px/16px var(--font-sans); letter-spacing: 0.005em;
  color: var(--text-secondary);
  transition: background-color var(--duration-hover) ease, color var(--duration-hover) ease, box-shadow var(--duration-hover) ease;
}
.av-tab-btn i { font-size: 16px; }
.av-tab-btn:hover { color: var(--text-primary); }
.av-tab-btn.active { color: var(--text-primary); background: var(--surface-raised); box-shadow: var(--shadow-card); border: 0; }
.av-header-end { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.dialog-backdrop .av-header .icon-btn { margin-left: 0; }
.av-header-end .badge:empty { display: none; }
.stage-badge-to_apply { background: var(--sky-soft); color: var(--sky); }
.stage-badge-applied { background: var(--ochre-soft); color: var(--ochre); }
.stage-badge-follow_ups { background: var(--clay-soft); color: var(--clay-text); }
.stage-badge-accepted { background: var(--sage-soft); color: var(--sage); }
.app-panel-zoom-btn { width: 32px; height: 32px; border: 0; border-radius: 999px; background: transparent; }
.app-panel-zoom-btn:hover { background: var(--gray-100); }
.app-panel-zoom .select-button { height: 32px; border-radius: 999px; padding: 0 10px; font-size: 13px; }

.dialog-backdrop .doc-bar {
  padding: 4px 24px 12px 28px;
  background: var(--surface);
  border: 0;
}
.doc-tool { width: 36px; height: 36px; border-radius: 999px; border: 0; background: transparent; }
.doc-tool:hover { background: var(--gray-100); }
.doc-bar-divider { display: none; }
.doc-bar-status, .doc-bar-export-note { font: 300 14px/20px var(--font-sans); color: var(--text-muted); }
.doc-bar-export .btn-primary { background: var(--surface-raised); color: var(--text-primary); border-color: var(--border); }
.doc-bar-export .btn-primary:hover { border-color: var(--brand-35); background: var(--surface-raised); }

#av-panel-cv .av-subpanel-content { gap: 20px; padding: 0 20px 20px 28px; }
#av-panel-cv .av-subpanel-body {
  padding: 32px;
  border-radius: 24px;
  background: var(--gray-100);
}
.resume-preview .resume-paper, .av-subpanel-body .resume-paper { box-shadow: var(--shadow-card); border-radius: 4px; }
.app-panel-sidebar { width: 400px; border-left: 0; gap: 12px; }
.app-panel-scroll { padding: 0 4px 16px 0; }
.fit-head { margin-bottom: 12px; }
.fit-head-title { font-family: var(--font-serif); font-size: 22px; line-height: 29px; font-weight: 400; }
.edits-review {
  padding: 24px;
  border-radius: 24px;
  background: var(--surface-raised);
  border: 0;
  box-shadow: var(--shadow-card);
  margin-bottom: 24px;
}
.edits-review-count { font-family: var(--font-serif); font-size: 30px; line-height: 36px; font-weight: 400; letter-spacing: -0.01em; }
.edits-review-note { font: 300 15px/22px var(--font-sans); color: var(--text-secondary); }
.edits-review-actions { margin-top: 16px; gap: 8px; }
.edits-review-actions .btn-secondary { flex: 1; height: 44px; }
.resume-request {
  padding: 16px;
  border-radius: 20px;
  background: var(--surface-raised);
  box-shadow: 0 0 0 1px var(--border);
  border: 0;
}
.resume-request-title { font: 500 15px/19px var(--font-sans); }
.resume-request-label { font: 500 13px/16px var(--font-sans); color: var(--text-secondary); text-transform: none; letter-spacing: 0.005em; }
/* Edits inside the resume: pending is clay, a highlight not an alarm. */
.resume-edit-new { background: var(--clay-soft) !important; box-shadow: none !important; border-radius: 3px; }
.suggestion-popover { border: 0 !important; border-radius: var(--r-menu) !important; box-shadow: var(--shadow-float) !important; background: var(--surface-raised) !important; }
.score-card { padding: 24px; border-radius: 24px 24px 0 0; background: var(--surface-raised); box-shadow: var(--shadow-card); }
.score-card + .edits-review { border-radius: 0 0 24px 24px; padding-top: 0; box-shadow: 0 8px 24px rgb(70 67 62 / 0.08); }
.score-card:only-child { border-radius: 24px; margin-bottom: 24px; }
.score-card-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.score-card-number { font-family: var(--font-serif); font-size: 40px; line-height: 46px; letter-spacing: -0.015em; color: var(--text-primary); }
.score-card-label { font: 300 16px/24px var(--font-sans); color: var(--text-secondary); }
.meter-lg { height: 6px; }
.score-card .meter-fill { background: var(--sage); }
.score-card-note { margin: 12px 0 0; font: 300 15px/22px var(--font-sans); color: var(--text-secondary); }
#fit-score-slot:has(.score-card) + .edits-review { border-radius: 0 0 24px 24px; margin-top: -1px; }
#fit-score-slot:has(.score-card) + .edits-review[hidden] ~ * {}
#fit-score-slot:has(.score-card):has(+ .edits-review[hidden]) .score-card { border-radius: 24px; margin-bottom: 24px; }
.edits-review-count { font: 500 16px/20px var(--font-sans); }
#fit-score-slot:empty + .edits-review .edits-review-count { font-family: var(--font-serif); font-size: 30px; line-height: 36px; font-weight: 400; }

.app-panel-gaps-subtitle { font-family: var(--font-serif); font-size: 22px; line-height: 29px; color: var(--text-primary); margin: 8px 0 12px; text-transform: none; letter-spacing: -0.005em; font-weight: 400; }
.match-item {
  padding: 16px 16px 12px;
  border-radius: 20px;
  background: var(--surface-raised);
  border: 0 !important;
  box-shadow: 0 0 0 1px var(--border);
  margin-bottom: 8px;
}
.match-item-title { font: 500 15px/20px var(--font-sans); color: var(--text-primary); }
.match-item-note { font: 300 14px/20px var(--font-sans); color: var(--text-secondary); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.match-quote { border-left: 0 !important; padding: 10px 12px !important; border-radius: 12px; background: var(--gray-100); font: 300 14px/20px var(--font-sans); color: var(--text-secondary); }
.match-badge { background: var(--gray-100); color: var(--text-secondary); border: 0; font: 500 12px/1 var(--font-sans); text-transform: none; letter-spacing: 0.005em; padding: 6px 10px; border-radius: 999px; }
.match-badge.is-bad { background: var(--clay-soft); color: var(--clay-text); }
.match-badge.is-warn { background: var(--ochre-soft); color: var(--ochre); }
.match-badge.is-good { background: var(--sage-soft); color: var(--sage); }
.match-badge-dot { background: currentColor; }
.match-item-actions .btn-ghost { border: 1px solid var(--border); background: var(--surface-raised); }
.gap-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 16px; }
.gap-tally { height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-raised); font: 500 13px/16px var(--font-sans); color: var(--text-secondary); cursor: pointer; }
.gap-tally.active { background: var(--gray-150); border-color: transparent; color: var(--text-primary); }
.gap-summary-note { font: 300 13px/18px var(--font-sans); color: var(--text-muted); width: 100%; }
.dialog-backdrop #application-single-view { height: calc(100vh - 48px); }
#av-panel-cover-letter .empty-state { margin: 24px 28px; }
.fit-score-number { font-family: var(--font-serif); font-size: 40px; line-height: 46px; font-weight: 400; }
.fit-score-outof { font: 300 16px/24px var(--font-sans); color: var(--text-secondary); }
.fit-meter { height: 6px; border-radius: 999px; background: var(--gray-150); }
.fit-meter-fill { border-radius: 999px; background: var(--sage) !important; }
.fit-score-band { background: var(--sage-soft); color: var(--sage); border-radius: 999px; padding: 4px 10px; font: 500 12px/16px var(--font-sans); text-transform: none; }

/* ── Scan settings (S12) ───────────────────────────────────────────────── */
#jobs-save-bar { display: none !important; }
.status-line { display: flex; align-items: center; gap: 8px; margin: 0; font: 400 16px/24px var(--font-sans); color: var(--text-secondary); }
.run-count { font: 300 14px/20px var(--font-sans); color: var(--text-muted); display: inline-flex; gap: 8px; align-items: center; }
.run-count-chip { background: none; padding: 0; color: var(--text-secondary); font-weight: 500; }
.attention-row {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 16px 16px 20px; margin-bottom: 32px;
  border-radius: 20px; background: var(--surface-raised); box-shadow: var(--shadow-card);
}
.attention-icon { font-size: 22px; color: var(--ochre); flex: none; }
.attention-text { flex: 1; min-width: 0; }
.attention-title { margin: 0; font: 500 15px/19px var(--font-sans); color: var(--text-primary); }
.attention-body { margin: 2px 0 0; font: 300 14px/20px var(--font-sans); color: var(--text-secondary); }
.scan-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; align-items: start; }
.scan-aside { position: sticky; top: calc(var(--topbar-h) + 16px); }
.scan-section { margin-bottom: 40px; }
.scan-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-hint { margin: -4px 0 16px; font: 300 14px/20px var(--font-sans); color: var(--text-secondary); max-width: 60ch; }
.section-empty { margin: 0 0 12px; font: 300 14px/20px var(--font-sans); color: var(--text-muted); }
.board-list { display: flex; flex-direction: column; gap: 8px; }
.board-row {
  display: flex; align-items: center; gap: 14px;
  min-height: 72px; padding: 14px 16px;
  border-radius: 20px; background: var(--surface-raised);
  box-shadow: 0 1px 2px rgb(70 67 62 / 0.06);
  border: 1px solid transparent;
  cursor: pointer;
  transition: opacity var(--duration-dropdown) ease, background-color var(--duration-hover) ease;
}
.board-row.is-empty { background: transparent; box-shadow: none; border: 1px dashed var(--border); opacity: 0.6; }
.board-row.is-off:not(.is-empty) .board-name { color: var(--text-secondary); }
.board-mono { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 8px; background: var(--gray-100); color: var(--text-secondary); font: 500 12px/1 var(--font-sans); flex: none; text-transform: uppercase; }
.board-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.board-name { font: 500 15px/19px var(--font-sans); color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board-sub { font: 300 13px/18px var(--font-sans); color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board-sub:empty { display: none; }
.source-row { flex-wrap: wrap; cursor: default; }
.source-row > .alert, .source-row > .card-hint { flex-basis: 100%; margin: 4px 0 0 42px; }
.source-row .icon-btn { opacity: 0.6; }
.source-row:hover .icon-btn { opacity: 1; }
.add-row { display: flex; gap: 8px; align-items: center; }
.add-row input { flex: 1; min-width: 0; }
.add-source-row { margin-top: 12px; }
.look-for-card { padding: 28px; margin: 0; }
.look-for-card .section-title { margin-bottom: 12px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
#target-companies-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
#target-companies-list:empty { display: none; }
.chip-x-btn { all: unset; cursor: pointer; display: inline-flex; margin-right: -4px; opacity: 0.55; }
.chip-x-btn:hover { opacity: 1; }

/* Switch from the design: dark brand track when on, outline when off. The
   knob travels with the press curve; the colour follows with plain ease. */
.switch { position: relative; display: inline-flex; flex: none; width: 44px; height: 26px; cursor: pointer; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch-track {
  position: absolute; inset: 0; border-radius: 999px;
  background: var(--gray-150); box-shadow: inset 0 0 0 1px var(--border);
  transition: background-color var(--duration-hover) ease;
}
.switch-track::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--surface-raised); box-shadow: 0 1px 3px rgb(0 0 0 / 0.2);
  transition: transform var(--duration-dropdown) var(--ease-out);
}
.switch input:checked + .switch-track { background: var(--brand); box-shadow: none; }
.switch input:checked + .switch-track::after { transform: translateX(18px); background: var(--on-brand); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--clay); outline-offset: 2px; }
.switch:active .switch-track::after { transform: scaleX(1.12); }
.switch:active input:checked + .switch-track::after { transform: translateX(16px) scaleX(1.12); }

/* ── Companies (S8) ────────────────────────────────────────────────────── */
#companies-save-bar { display: none !important; }
.companies-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; align-items: start; }
.companies-toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.companies-search-field { flex: 1; }
.companies-toolbar .select-button { height: 48px; border-radius: 999px; }
.company-list { display: flex; flex-direction: column; gap: 8px; }
.company-row { border-radius: 20px; background: var(--surface-raised); box-shadow: 0 1px 2px rgb(70 67 62 / 0.06); }
.company-row-main { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 14px; min-height: 72px; }
.company-row-toggle { all: unset; flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; cursor: pointer; border-radius: 12px; }
.company-row-toggle:disabled { cursor: default; }
.company-row-toggle:focus-visible { outline: 2px solid var(--clay); outline-offset: 4px; }
.company-row .brand-avatar { width: 40px; height: 40px; border-radius: 12px; font-size: 18px; }
.company-ats { width: 104px; font: 300 13px/18px var(--font-sans); color: var(--text-muted); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.company-roles { padding: 0 12px 12px 68px; display: flex; flex-direction: column; gap: 4px; animation: panel-in var(--duration-dropdown) ease-out; }
.company-role { display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 12px; border-radius: 12px; background: var(--gray-100); }
.company-role-title { all: unset; cursor: pointer; flex: 1; min-width: 0; font: 400 15px/20px var(--font-sans); color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.company-role-title:hover { text-decoration: underline; text-underline-offset: 3px; }
.company-role-meta { font: 300 13px/18px var(--font-sans); color: var(--text-muted); white-space: nowrap; }
.company-role .job-status-btn { width: auto; }
.company-role .job-status-btn i { display: none; }
.company-role .job-status-btn.sent { background: var(--sage-soft); color: var(--sage); border-color: transparent; }
.company-more { align-self: center; margin-top: 8px; }
.companies-aside { position: sticky; top: calc(var(--topbar-h) + 16px); }
.add-company-card { padding: 28px; border-radius: var(--r-card); background: var(--block-ochre); display: flex; flex-direction: column; }
.add-company-card .section-title { margin-bottom: 8px; }
.add-company-card .field-label { margin: 16px 0 8px; }
.add-company-card .select-wrap, .add-company-card .select-button { width: 100%; }
.add-company-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-optional { color: var(--text-muted); font-weight: 400; }
.add-company-btn { margin-top: 24px; align-self: flex-start; }
#cc-add-status:not(:empty) { margin-top: 12px; }
.alert { border-radius: 14px; border: 0; font: 400 14px/20px var(--font-sans); padding: 12px 14px; }
.alert-error { background: var(--danger-10); color: var(--danger); }
.alert-warn { background: var(--ochre-soft); color: var(--text-primary); }
.alert-success { background: var(--sage-soft); color: var(--text-primary); }

/* Select menus (enhanceSelect): the design's menu surface. */
.select-menu { border: 0; border-radius: var(--r-menu); padding: 8px; box-shadow: var(--shadow-float); background: var(--surface-raised); }
.select-option { min-height: 40px; border-radius: var(--r-item); padding: 8px 12px; font: 400 15px/20px var(--font-sans); }
.select-option:hover, .select-option.is-active { background: var(--gray-100); }
.select-check { color: var(--clay); }
.select-search { border-radius: var(--r-item); }

/* ── Resume and letters (S7) ───────────────────────────────────────────── */
.rs-tabs { margin: 0 0 32px; display: inline-flex; position: static; }
.rs-rules-layout { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 24px; align-items: start; }
.rs-rules-main { min-width: 0; }
.rs-rules-main .resume-editor, .rs-rules-main .resume-review { padding: 24px; border-radius: var(--r-card); background: var(--gray-100); }
.resume-editor-head, .resume-review-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
.resume-review-paper { border-radius: 4px; }
.rs-rules-aside { position: sticky; top: calc(var(--topbar-h) + 16px); display: flex; flex-direction: column; gap: 16px; }
.file-card { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 24px; background: var(--surface-raised); box-shadow: var(--shadow-card); }
.file-card-icon { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; background: var(--block-sky); color: var(--sky); font-size: 22px; flex: none; }
.file-card-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.file-card-name { font: 500 15px/19px var(--font-sans); color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-card-sub { font: 300 13px/18px var(--font-sans); color: var(--text-muted); }
.rs-side-tabs { align-self: flex-start; }
.rs-side-panel { display: none; }
.rs-side-panel.active { display: flex; flex-direction: column; gap: 12px; animation: panel-in var(--duration-tooltip) ease-out; }
.rules-field { margin: 0; padding: 0; border: 0; }
.rs-side-panel .rules-field-title { font-family: var(--font-serif); font-size: 22px; line-height: 29px; color: var(--text-primary); font-weight: 400; letter-spacing: -0.005em; }
.rules-field-hint { margin: 0; font: 300 14px/20px var(--font-sans); color: var(--text-secondary); }
.app-rules-textarea { min-height: 220px; max-height: 420px; }
.rules-field-actions { display: flex; align-items: center; gap: 12px; }
.rules-field-actions .btn-primary { background: var(--surface-raised); color: var(--text-primary); border-color: var(--border); }
.rules-field-actions .btn-primary:hover { border-color: var(--brand-35); }
.save-bar-status { font: 300 14px/20px var(--font-sans); color: var(--text-muted); }
.rs-paper-empty:empty { display: none; }
.preview-zoom { display: flex; align-items: center; gap: 4px; padding: 4px; border-radius: 999px; background: var(--surface-raised); }
.preview-zoom-label { font: 500 13px/16px var(--font-sans); color: var(--text-secondary); min-width: 40px; text-align: center; }
textarea.app-rules-textarea, .field-textarea, textarea {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  font: 400 15px/24px var(--font-sans);
  padding: 14px 16px;
  color: var(--text-primary);
}
.rs-rules-main .resume-editor-head .rules-field-title { font-family: var(--font-serif); font-size: 22px; line-height: 29px; font-weight: 400; }

/* ── Settings: people (S13) ────────────────────────────────────────────── */
.people-list { gap: 8px; }
.person-row .company-row-toggle { cursor: default; }
.person-row .board-name { display: inline-flex; align-items: center; gap: 8px; overflow: visible; }
.person-row .brand-avatar { font-family: var(--font-sans); font-size: 14px; font-weight: 500; }
.person-row.is-disabled { opacity: 0.6; }
.person-usage { color: var(--text-secondary); white-space: nowrap; }
.invite-card { background: var(--block-clay); }
.field-help { margin: 8px 0 0; font: 300 13px/18px var(--font-sans); color: var(--text-muted); }
.invite-card .add-company-btn { align-self: stretch; }
.invite-link { display: flex; align-items: center; gap: 8px; margin-top: 16px; padding: 8px 8px 8px 14px; border-radius: 14px; background: var(--surface-raised); }
.invite-link-url { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-primary); }

/* ── App dialog: replaces prompt() and confirm() ───────────────────────── */
.app-dialog-backdrop { align-items: center; z-index: 600; }
.app-dialog { width: min(480px, calc(100vw - 32px)); padding: 28px; display: flex; flex-direction: column; transform: none; transition: transform var(--duration-modal) var(--ease-out); }
@starting-style { .app-dialog { transform: scale(0.97) translateY(6px); } }
.app-dialog-title { font-family: var(--font-serif); font-size: 30px; line-height: 36px; letter-spacing: -0.01em; margin: 0 0 8px; }
.app-dialog-body { margin: 0 0 8px; font: 300 16px/24px var(--font-sans); color: var(--text-secondary); }
.app-dialog-fields .field-label { display: block; margin: 16px 0 8px; }
.app-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 28px; }
.btn-danger-solid { background: var(--danger); color: #fff; }
:root[data-theme="dark"] .btn-danger-solid { color: #1c1917; }
.btn-danger-solid:hover { background: color-mix(in srgb, var(--danger) 88%, black); }

/* ── Near Shore (S3) ───────────────────────────────────────────────────── */
.hero-sage { background: var(--block-sage); min-height: 300px; }
.hero-sage .hero-radar span { border-color: color-mix(in srgb, var(--sage) 28%, transparent); }
.hero-eyebrow { margin: 0; font: 500 15px/19px var(--font-sans); color: var(--text-secondary); }
#tab-nearshore .chip-row { margin-bottom: 24px; }
.nearshore-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-top: 0; }
.nearshore-card { padding: 0; border: 0; border-radius: var(--r-card); background: var(--surface-raised); box-shadow: var(--shadow-card, none); overflow: hidden; display: flex; flex-direction: column;
  transition: transform var(--duration-hover) var(--ease-out), box-shadow var(--duration-hover) var(--ease-out); }
@media (hover: hover) { .nearshore-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-float); border-color: transparent; } }
.nearshore-band { display: flex; align-items: center; justify-content: space-between; height: 112px; padding: 0 24px; }
.tint-sky .nearshore-band { background: var(--block-sky); color: var(--sky); }
.tint-clay .nearshore-band { background: var(--block-clay); color: var(--clay-text); }
.tint-ochre .nearshore-band { background: var(--block-ochre); color: var(--ochre); }
.nearshore-mono { font: 400 40px/1 var(--font-serif); letter-spacing: -0.02em; }
.nearshore-band .badge { background: color-mix(in srgb, currentColor 12%, transparent); }
.nearshore-body { display: flex; flex-direction: column; flex: 1; padding: 24px; }
.nearshore-card-name { margin: 0 0 4px; font: 400 22px/28px var(--font-serif); }
.nearshore-card-hq { margin: 0 0 12px; font: 300 13px/18px var(--font-sans); color: var(--text-muted); }
.nearshore-card-desc { margin: 0 0 20px; font: 300 15px/22px var(--font-sans); color: var(--text-secondary); }
.nearshore-card-links { display: flex; gap: 4px; margin-top: auto; margin-left: -12px; }
.hero-sage .hero-copy { max-width: 640px; gap: 16px; }
.hero-sage .hero-title { font-size: 40px; line-height: 48px; }
.hero-sage .hero-title { max-width: 600px; }

/* ── Sign in / join (S0, S22) ──────────────────────────────────────────── */
.auth-body { display: block; padding: 0; min-height: 100vh; background: var(--bg); }
.auth-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0; min-height: 100vh; padding: 48px; }
.auth-pane { align-self: center; justify-self: center; width: 100%; max-width: 400px; padding: 0; }
.auth-mark { display: flex; align-items: center; gap: 10px; margin-bottom: 56px; }
.auth-logo { display: block; margin: 0; }
.auth-brand { margin: 0; font: 400 18px/24px var(--font-serif); color: var(--text-primary); text-align: left; }
.auth-title { margin: 0 0 8px; font: 400 48px/56px var(--font-serif); letter-spacing: -0.02em; color: var(--text-primary); }
.auth-sub { margin: 0 0 40px; text-align: left; font: 300 16px/24px var(--font-sans); color: var(--text-secondary); }
.auth-label { margin: 0 0 8px; font: 500 14px/18px var(--font-sans); color: var(--text-primary); }
.auth-form input + .auth-label { margin-top: 20px; }
.auth-hint { font: 300 13px/18px var(--font-sans); color: var(--text-muted); }
.auth-submit { margin-top: 28px; height: 52px; }
.auth-foot-note { margin: 40px 0 0; font: 300 13px/18px var(--font-sans); color: var(--text-muted); }
.auth-pane > * { animation: auth-rise var(--duration-modal) var(--ease-out) both; }
.auth-pane > :nth-child(2) { animation-delay: 40ms; }
.auth-pane > :nth-child(3) { animation-delay: 80ms; }
.auth-pane > :nth-child(n+4) { animation-delay: 120ms; }
@keyframes auth-rise { from { opacity: 0; transform: translateY(8px); } }

.auth-showcase { position: relative; overflow: hidden; isolation: isolate; border-radius: 40px; background: var(--block-clay); padding: 64px; display: flex; flex-direction: column; }
.auth-showcase .hero-radar { right: 22%; top: 62%; }
.auth-show-eyebrow { margin: 0 0 12px; font: 500 14px/18px var(--font-sans); color: var(--text-secondary); }
.auth-show-title { margin: 0; max-width: 480px; font: 400 36px/44px var(--font-serif); letter-spacing: -0.015em; color: var(--text-primary); }
.auth-demo { position: relative; flex: 1; min-height: 420px; }
.auth-demo-card { position: absolute; width: 340px; padding: 24px; border-radius: 24px; background: var(--surface-raised); box-shadow: var(--shadow-float);
  display: flex; flex-direction: column; gap: 12px; animation: auth-card-in 600ms var(--ease-out) both; }
.auth-demo-card.c1 { left: 6%; top: 12%; transform: rotate(-4deg); animation-delay: 200ms; --r: -4deg; }
.auth-demo-card.c2 { left: 36%; top: 38%; transform: rotate(3deg); animation-delay: 360ms; --r: 3deg; }
@keyframes auth-card-in { from { opacity: 0; transform: translateY(24px) rotate(var(--r)) scale(0.97); } }
.auth-demo-head { display: flex; align-items: center; gap: 12px; }
.auth-demo-head b { display: block; font: 500 14px/18px var(--font-sans); }
.auth-demo-head small { display: block; font: 300 12px/16px var(--font-sans); color: var(--text-muted); }
.auth-demo-title { margin: 0; font: 400 20px/26px var(--font-serif); }
.auth-demo-meta { margin: 0; display: flex; align-items: center; gap: 6px; font: 300 14px/18px var(--font-sans); color: var(--text-secondary); }
.auth-demo-card .badge { align-self: flex-start; }
.auth-demo-foot { display: flex; align-items: center; justify-content: space-between; }
.auth-demo-foot .btn { pointer-events: none; }
.auth-demo-toast { position: absolute; left: 12%; bottom: 0; display: inline-flex; align-items: center; gap: 10px; padding: 12px 20px; border-radius: 999px;
  background: var(--gray-900, #3b3a36); color: #fff; font: 400 14px/18px var(--font-sans); box-shadow: var(--shadow-float);
  animation: auth-toast 4.8s var(--ease-out) 1.4s both; }
@keyframes auth-toast { 0% { opacity: 0; transform: translateY(12px); } 8%, 82% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) {
  .auth-pane > *, .auth-demo-card { animation: none; }
  .auth-demo-toast { animation: none; opacity: 1; }
}

/* ── How this works (S23) ──────────────────────────────────────────────── */
.how-dialog { width: min(620px, calc(100vw - 32px)); max-height: none; }
.how-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.how-head .app-dialog-title { margin: 0; }
.how-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 20px; }
.how-steps li { display: grid; grid-template-columns: 48px 1fr; gap: 16px; align-items: start; }
.how-steps b { display: block; font: 500 15px/20px var(--font-sans); margin: 2px 0 4px; }
.how-steps p { margin: 0; font: 300 15px/22px var(--font-sans); color: var(--text-secondary); }
.how-ico { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 14px; font-size: 22px; }
.how-ico.tint-sky { background: var(--block-sky); color: var(--sky); }
.how-ico.tint-clay { background: var(--block-clay); color: var(--clay); }
.how-ico.tint-sage { background: var(--block-sage); color: var(--sage); }
.how-ico.tint-ochre { background: var(--block-ochre); color: var(--ochre); }
.how-note { display: flex; gap: 12px; align-items: flex-start; margin: 28px 0 0; padding: 16px 20px; border-radius: 16px; background: var(--gray-100); font: 300 14px/20px var(--font-sans); color: var(--text-secondary); }
.how-note i { font-size: 18px; margin-top: 1px; }
.how-steps li { animation: auth-rise var(--duration-modal) var(--ease-out) both; }
.how-steps li:nth-child(2) { animation-delay: 50ms; }
.how-steps li:nth-child(3) { animation-delay: 100ms; }
.how-steps li:nth-child(4) { animation-delay: 150ms; }

/* ── Motion pass (motion.md) ───────────────────────────────────────────── */
/* Overlays: scrim fades, surface rises from 97%. Exit 200ms, entry 300ms. */
.dialog-backdrop { transition: opacity var(--duration-dropdown) ease-out; }
@starting-style { .dialog-backdrop { opacity: 0; } }
.dialog-backdrop > * { transition: transform var(--duration-modal) var(--ease-out), opacity var(--duration-dropdown) ease-out; }
@starting-style { .dialog-backdrop > * { transform: scale(0.97) translateY(8px); opacity: 0; } }
.dialog-backdrop.is-closing { opacity: 0; transition-duration: 160ms; pointer-events: none; }
.dialog-backdrop.is-closing > * { transform: scale(0.98); opacity: 0; transition-duration: 200ms, 160ms; transition-timing-function: var(--ease-in-out), ease-in; }

/* Press: every control answers inside 100ms. */
.btn, .icon-btn, .menu-item, .sidebar-link, .view-toggle-btn { transition-property: background-color, color, border-color, box-shadow, transform; transition-duration: var(--duration-press); transition-timing-function: var(--ease-out); }
.btn:active:not(:disabled), .icon-btn:active:not(:disabled) { transform: scale(0.97); }
.sidebar-link:active { transform: scale(0.985); }

/* Counts tick once when they change. */
.sidebar-count { display: inline-block; }
.sidebar-count.is-ticking { animation: count-tick 360ms var(--ease-out); }
@keyframes count-tick { 0% { transform: translateY(-4px); opacity: 0; } 100% { transform: none; opacity: 1; } }

/* Sending a job: the button settles into its sent state with a small pop,
   the check draws in. The only celebratory beat in the app, and a short one. */
.job-status-btn.sent { animation: sent-pop 280ms var(--ease-out); }
.job-status-btn.sent i { animation: sent-check 240ms var(--ease-out) 60ms both; }
@keyframes sent-pop { 0% { transform: scale(0.96); } 60% { transform: scale(1.03); } 100% { transform: none; } }
@keyframes sent-check { from { transform: scale(0.4) rotate(-20deg); opacity: 0; } }

/* Switch and checkbox: the thumb travels, the colour follows. */
.switch-track, .switch-track::after { transition: background-color var(--duration-press) ease-out, transform var(--duration-dropdown) var(--ease-out), box-shadow var(--duration-press) ease-out; }
input[type="checkbox"] { transition: background-color var(--duration-press) ease-out, border-color var(--duration-press) ease-out, box-shadow var(--duration-press) ease-out; }

/* Fields: focus ring arrives fast, never animates layout. */
input, textarea, select { transition: border-color var(--duration-press) ease-out, box-shadow var(--duration-press) ease-out, background-color var(--duration-press) ease-out; }

/* Panels inside the application dialog fade like the page tabs. */
.av-subpanel.active { animation: panel-in var(--duration-tooltip) ease-out; }

/* Kanban: a card that changes column lands, it does not appear. */
@starting-style { .kanban-card { opacity: 0; transform: translateY(6px); } }
.kanban-card { transition: opacity var(--duration-dropdown) ease-out, transform var(--duration-dropdown) var(--ease-out), box-shadow var(--duration-press) ease-out; }

/* Chips toggling on: the check scales in. */
.chip.is-on > i.ph-check { animation: sent-check 200ms var(--ease-out); }

/* Snackbar: slide + fade, exit faster. */
.snackbar { opacity: 0; transition: transform var(--duration-modal) var(--ease-out), opacity var(--duration-dropdown) ease-out; }
.snackbar.visible { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .dialog-backdrop > *, .kanban-card { transition: opacity var(--duration-press) linear; }
  .job-status-btn.sent, .job-status-btn.sent i, .sidebar-count.is-ticking, .chip.is-on > i.ph-check { animation: none; }
}

/* ── Dark mode fixes ───────────────────────────────────────────────────── */
:root[data-theme="dark"] .brand-avatar { background: var(--gray-100); color: var(--text-secondary); }
:root[data-theme="dark"] .brand-avatar-img { background: var(--surface-raised); }
.suggestion-popover { border: 0; border-radius: 24px; background: var(--surface-raised); box-shadow: var(--shadow-float); }
.menu-item .dot { flex: none; width: 8px; height: 8px; margin: 0 5px; }

/* ══ Breakpoints ══════════════════════════════════════════════════════════
   Designed at 1440. Four widths, each answering one question:
   ≥1280  desktop      — the layout as drawn.
   1024   small laptop — asides narrow, the hero drops its collage.
   768    tablet       — sidebar becomes an icon rail, asides go under
                         the content, the dialog takes the screen.
   <768   phone        — the rail becomes a bottom bar, everything is one
                         column, overlays become sheets from the bottom.
   ════════════════════════════════════════════════════════════════════════ */

@media (max-width: 1279px) {
  :root { --main-pad-r: 32px; }
  .hero-collage { display: none; }
  .hero-copy { max-width: 640px; }
  .hero-title { font-size: 48px; line-height: 52px; }
  .scan-layout, .companies-layout { grid-template-columns: minmax(0, 1fr) 320px; }
  .rs-rules-layout { grid-template-columns: minmax(0, 1fr) 340px; }
  .app-panel-sidebar { width: 340px; }
  .kanban { grid-auto-columns: minmax(220px, 1fr); overflow-x: auto; scroll-snap-type: x proximity; }
  .kanban > * { scroll-snap-align: start; }
}

@media (max-width: 1023px) {
  :root { --sidebar-w: 88px; }
  /* style.css stacks the shell under 900px; the rail keeps it side by side. */
  .app-shell { flex-direction: row; }
  .sidebar { position: sticky; top: var(--topbar-h); width: var(--sidebar-w); height: calc(100vh - var(--topbar-h)); max-height: calc(100vh - var(--topbar-h)); border-bottom: 0; padding: 24px 12px; align-items: center; }
  .sidebar-nav { flex-direction: column; overflow: visible; }
  .sidebar-link, .sidebar-link.active { border-bottom: 0; }
  .sidebar-nav { align-items: center; }
  .sidebar-link { width: 56px; height: 48px; min-height: 48px; justify-content: center; padding: 0; gap: 0; }
  .sidebar-link-label, .sidebar-group { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .sidebar-group { position: static; width: 32px; height: 1px; margin: 16px 0 12px; clip: auto; background: var(--gray-150); }
  .sidebar-group { font-size: 0; padding: 0; }
  .sidebar-count { position: absolute; top: 4px; right: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--gray-150); font-size: 11px; line-height: 18px; text-align: center; }
  .sidebar-count:empty, #nav-count-companies { display: none; }
  :root { --main-pad-r: 24px; }
  main { padding: 16px 24px 0 8px; }

  .scan-layout, .companies-layout, .rs-rules-layout { grid-template-columns: minmax(0, 1fr); }
  .scan-aside, .companies-aside, .rs-rules-aside { position: static; }
  .page-head { flex-wrap: wrap; align-items: flex-start; }
  .page-head .board-toolbar { flex: 1 1 100%; }
  .page-head .board-toolbar .board-add-row { flex: 1; }

  .hero { min-height: 0; padding: 40px; }
  .hero-title { font-size: 40px; line-height: 46px; }
  .hero-radar { right: -40px; }

  /* The application dialog takes the screen; its tabs drop to their own row. */
  .dialog-backdrop { padding: 12px; }
  .dialog-backdrop #application-single-view { height: calc(100vh - 24px); }
  .dialog-backdrop #application-single-view > .av-header { grid-template-columns: minmax(0, 1fr) auto; padding: 16px 16px 12px 20px; row-gap: 12px; }
  .dialog-backdrop .av-tabs { grid-column: 1 / -1; grid-row: 2; justify-self: start; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  #av-panel-cv .av-subpanel-content { flex-direction: column; padding: 0 12px 12px; }
  .app-panel-sidebar { width: auto; }
  #av-panel-cv .av-subpanel-body { padding: 16px; overflow-x: auto; }

  .auth-split { grid-template-columns: minmax(0, 1fr); padding: 32px; }
  .auth-showcase { display: none; }
}

@media (max-width: 767px) {
  :root { --sidebar-w: 0px; --topbar-h: 60px; }
  .navbar { padding: 0 16px; }
  .navbar-brand { font-size: 20px; }

  /* Bottom bar: every section one thumb away, icon over a short label. */
  .sidebar {
    position: fixed; inset: auto 0 0 0; top: auto; z-index: 150;
    width: 100%; height: auto; max-height: none;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--surface-raised) 92%, transparent);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 -1px 0 var(--gray-150), 0 -8px 24px rgb(0 0 0 / 0.06);
  }
  .sidebar { align-items: stretch; }
  .sidebar-nav { width: 100%; flex-direction: row; align-items: stretch; gap: 0; overflow: visible; justify-content: space-between; }
  .sidebar-group, .sidebar-spacer { display: none; }
  .sidebar-link { flex: 1 1 0; min-width: 0; width: auto; height: 56px; min-height: 56px; flex-direction: column; gap: 3px; border-radius: 16px; }
  .sidebar-link i { font-size: 21px; }
  /* The sidebar's labels are sentences; a bottom bar needs one word each. */
  .sidebar-link::after { content: attr(data-short); display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; font: 500 10px/12px var(--font-sans); letter-spacing: -0.01em; white-space: nowrap; }
  .sidebar-link.active { box-shadow: none; background: var(--gray-100); }
  .sidebar-count { top: 2px; right: calc(50% - 26px); }
  main { padding: 8px 16px 0; }
  main > .app-footer { padding: 32px 0 calc(96px + env(safe-area-inset-bottom)); }

  .page-title { font-size: 34px; line-height: 40px; }
  .hero { padding: 28px 24px; border-radius: 28px; margin-bottom: 20px; }
  .hero-copy { gap: 14px; }
  .hero-title, .hero-sage .hero-title { font-size: 32px; line-height: 38px; max-width: none; }
  .hero-sub { font-size: 16px; line-height: 24px; }
  .hero-radar { right: -120px; top: 20%; }

  .results-toolbar { flex-wrap: wrap; gap: 8px; }
  .results-toolbar .filter-chips { flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .results-toolbar .view-toggle { margin-left: auto; }
  #overview-results-card, .nearshore-grid { grid-template-columns: minmax(0, 1fr); }

  .kanban { grid-auto-columns: 82%; margin: 0 -16px; padding: 0 16px 16px; scroll-snap-type: x mandatory; }
  .page-head .board-toolbar { flex-wrap: wrap; }
  .page-head .board-toolbar .board-add-row { flex: 1 1 100%; }

  .company-row-main { flex-wrap: nowrap; gap: 8px; }
  .company-row-toggle { flex: 1 1 auto; min-width: 0; }
  .company-ats { display: none; }
  .company-row .badge { flex: none; }
  .companies-toolbar { flex-wrap: wrap; }
  .companies-toolbar .companies-search-field { flex: 1 1 100%; }
  .companies-toolbar > :not(.companies-search-field) { flex: 1 1 0; min-width: 0; }
  .company-roles { padding: 0 8px 12px 8px; }
  .person-usage { display: none; }
  .add-company-pair { grid-template-columns: 1fr; }

  /* Overlays become sheets: they come up from the bottom edge your thumb is on. */
  .dialog-backdrop { padding: 0; align-items: flex-end; }
  .dialog-backdrop #application-single-view { height: calc(100dvh - 24px); border-radius: 24px 24px 0 0; }
  .app-dialog { width: 100%; border-radius: 24px 24px 0 0; padding: 24px 20px calc(20px + env(safe-area-inset-bottom)); }
  @starting-style { .dialog-backdrop > * { transform: translateY(40px); opacity: 0; } }
  .dialog-backdrop.is-closing > * { transform: translateY(24px); }
  .app-dialog-actions .btn { flex: 1; }
  .drawer { width: 100%; border-radius: 24px 24px 0 0; top: auto; left: 0; right: 0; bottom: 0; height: 88dvh; }
  @starting-style { .drawer { transform: translateY(100%); } }
  .drawer-backdrop.is-closing .drawer { transform: translateY(100%); }
  .av-header-end #av-cv-zoom, .av-header-end .badge { display: none; }
  .doc-bar-status { display: none; }
  .dialog-backdrop .doc-bar { flex-wrap: wrap; padding: 4px 12px 8px; }
  #av-panel-cv .av-subpanel-body { min-width: 0; width: 100%; box-sizing: border-box; padding: 12px; overflow: hidden; }
  .av-subpanel-body .resume-preview { width: 794px; max-width: none; }
  .dialog-backdrop .av-header-title { min-width: 0; }

  .auth-split { padding: 24px; }
  .auth-title { font-size: 38px; line-height: 44px; }
  .auth-mark { margin-bottom: 40px; }

  .snackbar { bottom: calc(84px + env(safe-area-inset-bottom)); max-width: calc(100vw - 24px); }
}
/* Already sent on an earlier visit: the state, without the celebration. */
.job-status-btn.sent.is-settled, .job-status-btn.sent.is-settled i { animation: none; }
.job-status-btn.sent:disabled { opacity: 1; cursor: default; }

/* ── Posting preview (S2b) ───────────────────────────────────────────────
   A floating panel on the right, the same family as the filters drawer:
   tinted header with who, when, where and the next step; the posting
   typeset below it. On a phone it is a sheet from the bottom edge. */
.site-pane-backdrop {
  position: fixed; inset: 0; top: 0; z-index: 440;
  background: var(--scrim);
  opacity: 1;
  transition: opacity var(--duration-drawer) ease-out;
}
@starting-style { .site-pane-backdrop { opacity: 0; } }
.site-pane-backdrop.is-closing { opacity: 0; transition-duration: var(--duration-drawer-exit); }
.site-pane {
  position: fixed; top: 16px; right: 16px; bottom: 16px; left: auto; z-index: 450;
  width: min(640px, calc(100vw - 32px));
  display: flex; flex-direction: column;
  background: var(--surface-raised);
  border: 0; border-radius: 28px;
  box-shadow: var(--shadow-float);
  overflow: hidden;
  transform: none; opacity: 1;
  transition: transform var(--duration-drawer) var(--ease-drawer), opacity var(--duration-drawer) ease-out;
}
@starting-style { .site-pane { transform: translateX(calc(100% + 24px)); } }
.site-pane.is-closing {
  transform: translateX(calc(100% + 24px));
  transition: transform var(--duration-drawer-exit) var(--ease-in-out, ease-in);
}
.site-pane-header {
  display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 0;
  padding: 24px 24px 24px 32px;
  background: var(--block-sky);
  flex-shrink: 0;
}
.sp-top { display: flex; align-items: center; gap: 12px; }
.sp-top .brand-avatar { width: 40px; height: 40px; }
.sp-who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sp-company { font: 600 15px/20px var(--font-sans); color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-when { font: 400 13px/18px var(--font-sans); color: var(--text-muted); }
.icon-btn-raised {
  width: 36px; height: 36px; border-radius: 999px;
  background: var(--surface-raised); color: var(--text-primary);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.06);
  text-decoration: none;
}
.sp-title {
  margin: 18px 0 12px;
  font: 400 30px/36px var(--font-serif); letter-spacing: -0.01em;
  color: var(--text-primary);
  text-wrap: balance;
}
.sp-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.sp-meta:empty { display: none; }
.sp-meta span { display: inline-flex; align-items: center; gap: 6px; font: 400 15px/22px var(--font-sans); color: var(--text-secondary); }
.sp-meta i { font-size: 18px; }
.sp-meta span + span { animation: sp-in 240ms var(--ease-out) both; }
.sp-actions { display: flex; gap: 8px; margin-top: 20px; }
.sp-actions .btn { height: 40px; padding: 0 18px; }
.site-pane-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 24px 32px 48px; background: var(--surface-raised); }

.sp-fit {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 16px 16px 18px; margin-bottom: 28px;
  border-radius: 20px; background: var(--gray-100);
  animation: sp-in 260ms var(--ease-out) both;
}
.sp-fit-icon { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 999px; background: var(--surface-raised); color: var(--clay); font-size: 18px; }
.sp-fit-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sp-fit-copy strong { font: 600 15px/20px var(--font-sans); color: var(--text-primary); }
.sp-fit-copy span { font: 400 13px/19px var(--font-sans); color: var(--text-secondary); }

.site-pane-article.sp-article {
  max-width: none; margin: 0; padding: 0;
  font: 400 16px/26px var(--font-sans); color: var(--text-primary);
  animation: sp-in 320ms var(--ease-out) 40ms both;
}
.sp-article p { margin: 0 0 14px; color: var(--text-secondary); }
.sp-article h1, .sp-article h2, .sp-article h3, .sp-article h4 {
  margin: 30px 0 10px;
  font: 400 22px/28px var(--font-serif); letter-spacing: -0.005em;
  color: var(--text-primary);
}
.sp-article > :first-child { margin-top: 0; }
.sp-article ul, .sp-article ol { margin: 0 0 16px; padding: 0; list-style: none; }
.sp-article ol { counter-reset: sp; }
.sp-article li { position: relative; margin: 0 0 8px; padding-left: 20px; color: var(--text-secondary); }
.sp-article ul > li::before { content: ""; position: absolute; left: 2px; top: 10px; width: 6px; height: 6px; border-radius: 999px; background: var(--clay); }
.sp-article ol > li { counter-increment: sp; padding-left: 24px; }
.sp-article ol > li::before { content: counter(sp) "."; position: absolute; left: 0; font: 500 14px/26px var(--font-mono); color: var(--clay); }
.sp-article li p { margin: 0; }
.sp-article strong, .sp-article b { font-weight: 600; color: var(--text-primary); }
.sp-article em { color: var(--text-muted); }
.sp-article a { color: var(--link, var(--text-primary)); text-decoration: underline; text-underline-offset: 3px; }
.sp-article img { max-width: 100%; height: auto; border-radius: 12px; }

.sp-skeleton { display: flex; flex-direction: column; gap: 12px; padding-top: 4px; }
.sp-skeleton span {
  display: block; height: 14px; border-radius: 7px;
  background: linear-gradient(90deg, var(--gray-100) 0%, var(--gray-150) 50%, var(--gray-100) 100%);
  background-size: 200% 100%;
  animation: analysis-shimmer 1.6s linear infinite;
}
.sp-skeleton span:first-child { height: 72px; border-radius: 20px; margin-bottom: 16px; }
.sp-skeleton .short { width: 58%; }
.sp-skeleton .gap { height: 10px; background: none; animation: none; }

.sp-state {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px;
  padding: 56px 24px; animation: sp-in 280ms var(--ease-out) both;
}
.sp-state-icon { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 18px; background: var(--block-ochre); color: var(--ochre); font-size: 26px; margin-bottom: 6px; }
.sp-state-icon.is-gone { background: var(--block-clay); color: var(--clay); }
.sp-state-title { margin: 0; font: 400 24px/30px var(--font-serif); color: var(--text-primary); }
.sp-state-body { margin: 0 0 8px; max-width: 42ch; font: 400 15px/23px var(--font-sans); color: var(--text-secondary); }

@keyframes sp-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@media (max-width: 767px) {
  .site-pane {
    top: auto; left: 0; right: 0; bottom: 0;
    width: 100%; height: 88dvh;
    border-radius: 24px 24px 0 0;
  }
  @starting-style { .site-pane { transform: translateY(100%); } }
  .site-pane.is-closing { transform: translateY(100%); }
  .site-pane-header { padding: 22px 20px 20px; }
  .site-pane-header::before { content: ""; align-self: center; width: 36px; height: 5px; border-radius: 3px; background: color-mix(in srgb, var(--text-primary) 18%, transparent); margin: -12px 0 12px; }
  .sp-title { font-size: 24px; line-height: 30px; margin-top: 14px; }
  .sp-actions .btn { flex: 1; }
  .site-pane-body { padding: 20px 20px calc(32px + env(safe-area-inset-bottom)); }
  .sp-fit { align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .site-pane, .site-pane.is-closing { transform: none; transition: opacity var(--duration-drawer-exit) ease-out; }
  .site-pane.is-closing { opacity: 0; }
  @starting-style { .site-pane { transform: none; opacity: 0; } }
  .sp-fit, .sp-article, .sp-state, .sp-meta span + span { animation: none; }
  .sp-skeleton span { animation: none; }
}

/* ── Application · Fit (S9) ────────────────────────────────────────────── */
#av-panel-fit .av-subpanel-body { padding: 0 40px 40px; background: none; }
@media (max-width: 767px) { #av-panel-fit .av-subpanel-body { padding: 0 16px 24px; } }
.fx-layout { display: grid; grid-template-columns: 400px minmax(0, 1fr); gap: 24px; align-items: start; padding: 8px 0 32px; }
.fx-side { position: sticky; top: 0; }
.fx-score { padding: 32px; border-radius: var(--r-card); background: var(--block-sage); display: flex; flex-direction: column; }
.fx-score.is-mixed { background: var(--block-ochre); }
.fx-score.is-weak { background: var(--block-clay); }
.fx-band { font: 500 15px/20px var(--font-sans); color: var(--text-primary); }
.fx-number { margin-top: 20px; font: 400 56px/1 var(--font-serif); letter-spacing: -0.02em; color: var(--text-primary); }
.fx-number span { font: 400 14px/1 var(--font-sans); color: var(--text-secondary); margin-left: 6px; }
.fx-meter { margin-top: 24px; height: 10px; border-radius: 999px; background: var(--surface-raised); overflow: hidden; }
.fx-meter span { display: block; height: 100%; border-radius: 999px; background: var(--sage); transition: width var(--duration-panel, 300ms) var(--ease-out, ease); }
.fx-score.is-mixed .fx-meter span { background: var(--ochre); }
.fx-score.is-weak .fx-meter span { background: var(--clay); }
.fx-summary { margin: 24px 0 0; font: 300 15px/24px var(--font-sans); color: var(--text-secondary); }
.fx-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.fx-pill, .fx-level { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font: 500 12px/1 var(--font-sans); white-space: nowrap; flex: none; }
.fx-pill::before, .fx-level::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.fx-pill.is-strong { background: var(--sage-soft); color: var(--sage); }
.fx-pill.is-partial, .fx-level.is-partial { background: var(--ochre-soft); color: var(--ochre); }
.fx-pill.is-missing, .fx-level.is-missing { background: var(--clay-soft); color: var(--clay-text); }
.fx-next { margin-top: 24px; display: flex; align-items: center; gap: 12px; padding: 16px 16px 16px 20px; border-radius: 20px; background: var(--surface-raised); }
.fx-next > i { font-size: 18px; color: var(--text-secondary); align-self: flex-start; margin-top: 1px; }
.fx-next-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fx-next-title { font: 500 14px/20px var(--font-sans); color: var(--text-primary); }
.fx-next-sub { font: 300 13px/18px var(--font-sans); color: var(--text-secondary); }

.fx-main { min-width: 0; }
.fx-heading { display: flex; align-items: baseline; gap: 10px; margin: 0 0 16px; font: 400 22px/29px var(--font-serif); color: var(--text-primary); letter-spacing: -0.005em; }
.fx-heading:not(:first-child) { margin-top: 40px; }
.fx-count { font: 400 13px/1 var(--font-sans); color: var(--text-muted); }
.fx-empty { margin: 0; font: 300 15px/22px var(--font-sans); color: var(--text-secondary); }
.fx-rows { display: flex; flex-direction: column; gap: 10px; }
.fx-row { border-radius: 20px; background: var(--surface-raised); transition: box-shadow var(--duration-hover, 150ms) ease; }
.fx-row:hover, .fx-row.is-open { box-shadow: var(--shadow-card); }
.fx-row-head { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 0 16px 0 4px; }
.fx-row-toggle { flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; padding: 12px 0 12px 16px; border: 0; background: none; text-align: left; cursor: pointer; color: inherit; border-radius: 16px; }
.fx-row-toggle:focus-visible { outline: 2px solid var(--clay); outline-offset: -2px; }
.fx-row-title { flex: 1; min-width: 0; font: 400 15px/21px var(--font-sans); color: var(--text-primary); }
.fx-tag { font: 400 12px/1 var(--font-sans); color: var(--text-muted); flex: none; }
.fx-caret { font-size: 14px; color: var(--text-muted); flex: none; opacity: 0; transition: transform var(--duration-dropdown, 200ms) ease, opacity var(--duration-hover, 150ms) ease; }
.fx-row:hover .fx-caret, .fx-row.is-open .fx-caret, .fx-row-toggle:focus-visible .fx-caret { opacity: 1; }
.fx-row.is-open .fx-caret { transform: rotate(180deg); }
.fx-row-note { font: 300 13px/18px var(--font-sans); color: var(--text-muted); flex: none; }
.fx-row-body { display: flex; flex-direction: column; gap: 20px; padding: 4px 20px 20px; border-top: 1px solid var(--border); margin: 0 4px; padding-top: 16px; }
.fx-row-body:not([hidden]) { animation: sp-in 220ms var(--ease-out, ease) both; }
/* A label is a heading for the paragraph under it: darker and heavier than
   the text, not lighter and smaller, or the two read as one grey block. */
.fx-label { margin-bottom: 6px; font: 600 13px/18px var(--font-sans); color: var(--text-primary); letter-spacing: 0; }
.fx-text { margin: 0; max-width: 72ch; font: 400 15px/23px var(--font-sans); color: var(--text-secondary); }
.fx-text .fit-change { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 14px; background: var(--gray-100); }
.fx-text .fit-change + .fit-change { margin-top: 8px; }
.fx-composer { display: flex; flex-direction: column; gap: 8px; padding: 0; border: 0; background: none; }
.fx-composer .gap-fill-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.fx-composer .gap-fill-status { flex: 1; font: 300 13px/18px var(--font-sans); color: var(--text-muted); }

.fx-risk { margin-top: 32px; padding: 24px; border-radius: 24px; background: var(--block-clay); }
.fx-risk-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.fx-risk-head i { font-size: 20px; color: var(--clay); }
.fx-risk-head h3 { margin: 0; font: 500 15px/20px var(--font-sans); color: var(--text-primary); }
.fx-risk-item { padding: 0; border: 0; background: none; box-shadow: none; }
.fx-risk-item + .fx-risk-item { margin-top: 16px; padding-top: 16px; border-top: 1px solid color-mix(in srgb, var(--clay) 18%, transparent); }
.fx-risk-title { margin: 0; font: 500 14px/21px var(--font-sans); color: var(--text-primary); }
.fx-sev { margin-left: 6px; font: 400 12px/1 var(--font-sans); color: var(--text-muted); text-transform: capitalize; }
.fx-risk-why { margin: 4px 0 0; font: 300 15px/24px var(--font-sans); color: var(--text-secondary); max-width: 72ch; }
.fx-quote { margin: 10px 0 0; padding: 10px 14px; border: 0; border-radius: 12px; background: color-mix(in srgb, var(--surface-raised) 60%, transparent); font: 300 14px/20px var(--font-sans); color: var(--text-secondary); }
.fx-risk-reply { margin: 10px 0 0; font: 300 14px/21px var(--font-sans); color: var(--text-primary); }
.fx-risk .fit-risk-plan { margin-top: 14px; }
.fx-risk .fit-risk-plan .field-actions { justify-content: flex-start; gap: 8px; }
.fx-risk .fit-risk-plan-edit { display: flex; flex-direction: column; gap: 8px; }
.fx-risk .fit-risk-plan-edit .field-actions { justify-content: flex-end; }
.fx-risk .fit-risk-plan-edit[hidden] { display: none; }

.fx-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.fx-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 6px 14px 6px 12px; border-radius: 999px; background: var(--sage-soft); font: 500 14px/18px var(--font-sans); color: var(--text-primary); }
.fx-chip i { font-size: 14px; color: var(--sage); }
.fx-backs { margin-top: 16px; }
.fx-backs > summary { display: inline-flex; align-items: center; gap: 10px; padding: 6px 8px 6px 12px; border-radius: 999px; list-style: none; cursor: pointer; font: 500 14px/20px var(--font-sans); color: var(--text-primary); }
.fx-backs > summary::-webkit-details-marker { display: none; }
.fx-backs > summary:hover { background: var(--gray-100); }
.fx-backs > summary i { transition: transform var(--duration-dropdown, 200ms) ease; }
.fx-backs[open] > summary i { transform: rotate(180deg); }
.fx-backs .fit-table-wrap { margin-top: 12px; }

.fx-state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 96px 24px; }
.fx-state > i { font-size: 28px; color: var(--text-muted); margin-bottom: 4px; }
.fx-state-title { margin: 0; font: 400 22px/29px var(--font-serif); color: var(--text-primary); }
.fx-state-body { margin: 0 0 12px; max-width: 44ch; font: 300 15px/22px var(--font-sans); color: var(--text-secondary); }

@media (max-width: 1023px) {
  .fx-layout { grid-template-columns: minmax(0, 1fr); }
  .fx-side { position: static; }
}
@media (max-width: 767px) {
  .fx-score { padding: 24px; }
  .fx-row-head { flex-wrap: wrap; padding: 0 12px 12px 4px; }
  .fx-row-head > .btn, .fx-row-head > .fx-row-note { margin-left: 16px; }
  .fx-risk { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .fx-row-body:not([hidden]) { animation: none; }
}
.fx-text .fit-gap-kind { display: inline-block; margin-bottom: 4px; font: 500 12px/16px var(--font-sans); text-transform: none; letter-spacing: 0.005em; color: var(--ochre); background: none; padding: 0; }
.fx-text .fit-gap-kind.is-outside_resume { color: var(--text-muted); }
.fx-text .fit-gap-action { display: block; }
.fx-text .fit-change-where { font: 500 12px/16px var(--font-sans); color: var(--text-muted); text-transform: none; letter-spacing: 0.005em; }
.fx-text .fit-was { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--clay) 60%, transparent); color: var(--text-muted); }
.fx-text .fit-now { color: var(--text-primary); }
.fx-text .fit-change-confirm, .fx-text .fit-change-flag, .fx-text .fit-change-why { font: 300 13px/19px var(--font-sans); color: var(--text-secondary); }
.fx-risk .fx-risk-item { background: none; border-radius: 0; }
.fx-side { top: 93px; }
.fx-quote { background: color-mix(in srgb, var(--surface-raised) 55%, transparent); }

/* ── Application · Cover letter (S10 / S20) ────────────────────────────── */
.cl-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; padding: 8px 40px 40px; }
.cl-well { position: relative; min-height: calc(100vh - 48px - 85px - 48px); border-radius: var(--r-card); background: var(--gray-150); display: flex; flex-direction: column; overflow: hidden; }
.dialog-backdrop .cl-well .doc-bar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 8px; padding: 12px 16px; border: 0; background: transparent; }
.cl-well .doc-bar[hidden] { display: none; }
.cl-well .doc-bar-group { gap: 2px; padding: 2px; border-radius: 999px; background: var(--surface-raised); box-shadow: 0 1px 2px rgb(70 67 62 / 0.08); }
.cl-well .doc-bar-status { flex: 1; text-align: right; }
.cl-well .av-subpanel-body { flex: 1; display: flex; flex-direction: column; padding: 8px 28px 40px; }
.cl-well .resume-preview { margin: 0 auto; }
.cl-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px; padding: 64px 24px; }
.cl-empty-icon { display: inline-flex; align-items: center; justify-content: center; width: 72px; height: 72px; margin-bottom: 16px; border-radius: 50%; background: var(--clay-soft); color: var(--clay); font-size: 28px; }
.cl-empty-title { margin: 0; font: 400 28px/36px var(--font-serif); letter-spacing: -0.01em; color: var(--text-primary); }
.cl-empty-body { margin: 4px 0 0; max-width: 46ch; font: 300 15px/24px var(--font-sans); color: var(--text-secondary); }
.cl-empty-actions { display: flex; gap: 8px; margin-top: 20px; flex-wrap: wrap; justify-content: center; }
.cl-empty .spinner { margin-bottom: 12px; }
.cl-side { position: sticky; top: 93px; display: flex; flex-direction: column; gap: 16px; }
.cl-card { padding: 24px; border-radius: var(--r-card); background: var(--surface-raised); display: flex; flex-direction: column; }
.cl-status { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; background: var(--gray-100); color: var(--text-secondary); font: 500 12px/1 var(--font-sans); }
.cl-status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.cl-status.is-ready { background: var(--sage-soft); color: var(--sage); }
.cl-status.is-warn { background: var(--ochre-soft); color: var(--ochre); }
.cl-title { margin: 14px 0 0; font: 400 22px/29px var(--font-serif); letter-spacing: -0.005em; color: var(--text-primary); }
.cl-note { margin: 10px 0 0; font: 300 15px/24px var(--font-sans); color: var(--text-secondary); }
.cl-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 20px; }
.cl-actions[hidden] { display: none; }
.cl-actions .btn { width: 100%; justify-content: center; }
#cover-letter-checks:empty { display: none; }
#cover-letter-checks .letter-checks { margin: 16px 0 0; padding: 12px 14px; border: 0; border-radius: 16px; background: var(--ochre-soft); color: var(--text-primary); font: 400 13px/19px var(--font-sans); }
#cover-letter-checks .letter-checks strong { display: flex; gap: 6px; align-items: center; font-weight: 500; }
#cover-letter-checks .letter-checks strong i { color: var(--ochre); }
#cover-letter-checks .letter-checks ul { padding-left: 18px; }
#cover-letter-checks .letter-checks.is-clean { display: flex; align-items: center; gap: 6px; background: none; padding: 0; color: var(--text-secondary); }
#cover-letter-checks .letter-checks.is-clean i { color: var(--sage); }
.cl-from { padding: 24px; border-radius: var(--r-card); background: var(--block-ochre); display: flex; flex-direction: column; }
.cl-from-title { margin: 0; font: 500 15px/20px var(--font-sans); color: var(--text-primary); }
.cl-from-note { margin: 8px 0 0; font: 300 13px/20px var(--font-sans); color: var(--text-secondary); }
.cl-from-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.cl-chip { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px 0 12px; border-radius: 999px; background: var(--surface-raised); font: 500 13px/1 var(--font-sans); color: var(--text-primary); }
.cl-chip i { font-size: 13px; }
.cl-from-own { align-self: flex-start; margin: 12px 0 0 -4px; }
.cl-from-own[hidden] { display: none; }
@media (max-width: 1023px) {
  .cl-layout { grid-template-columns: minmax(0, 1fr); }
  .cl-side { position: static; order: -1; }
  .cl-well { min-height: 480px; }
}
@media (max-width: 767px) {
  .cl-layout { padding: 0 12px 24px; }
  .cl-well .av-subpanel-body { padding: 8px 8px 24px; }
}

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ── Application · Outreach (S6 / S21) ─────────────────────────────────── */
.or-layout { display: grid; grid-template-columns: 336px minmax(0, 1fr); gap: 24px; align-items: start; padding: 8px 28px 32px; }
.or-loading { grid-column: 1 / -1; display: flex; justify-content: center; padding: 120px 0; }
.or-error { grid-column: 1 / -1; }
.or-side { position: sticky; top: 93px; display: flex; flex-direction: column; }
.or-heading { margin: 0; font: 400 22px/29px var(--font-serif); letter-spacing: -0.005em; color: var(--text-primary); }
.or-sub { margin: 6px 0 0; font: 300 13px/20px var(--font-sans); color: var(--text-secondary); }
.or-sub.is-body { margin-top: 10px; font-size: 15px; line-height: 24px; }
.or-group { margin-top: 24px; display: flex; flex-direction: column; gap: 2px; }
.or-group-label { padding: 0 12px 8px; font: 500 12px/16px var(--font-sans); color: var(--text-secondary); }
.or-person { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; border: 0; border-radius: 16px; background: transparent; text-align: left; cursor: pointer; color: inherit; transition: background-color var(--duration-hover, 150ms) ease, box-shadow var(--duration-hover, 150ms) ease; }
.or-person:hover { background: color-mix(in srgb, var(--surface-raised) 55%, transparent); }
.or-person.is-active { background: var(--surface-raised); box-shadow: var(--shadow-card); }
.or-person:focus-visible { outline: 2px solid var(--clay); outline-offset: -2px; }
.or-avatar { position: relative; flex: none; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 10px; overflow: hidden; background: var(--sky-soft); color: var(--sky); font: 500 14px/1 var(--font-sans); }
.or-avatar.is-recruiter { background: var(--clay-soft); color: var(--clay-text); }
.or-avatar.is-designer { background: var(--sage-soft); color: var(--sage); }
.or-avatar.is-hiring_manager { background: var(--ochre-soft); color: var(--ochre); }
.or-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.or-avatar.is-lg { width: 48px; height: 48px; border-radius: 14px; font: 400 22px/1 var(--font-serif); }
.or-person-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.or-person-name { font: 500 14px/18px var(--font-sans); color: var(--text-primary); }
.or-person-title { font: 300 13px/17px var(--font-sans); color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.or-sent { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 999px; background: var(--sage-soft); color: var(--sage); font: 500 12px/1 var(--font-sans); }
.or-sent::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.or-label { margin-top: 20px; font: 500 14px/20px var(--font-sans); color: var(--text-primary); }
.or-linkedin-row { display: flex; gap: 8px; margin-top: 8px; }
.or-linkedin-row .field-input { flex: 1; min-width: 0; height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-raised); font: 400 14px/20px var(--font-sans); color: var(--text-primary); }
.or-linkedin-row .btn { height: 44px; }
.or-hint { margin: 8px 0 0; font: 300 13px/18px var(--font-sans); color: var(--text-muted); }
.or-searches { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.or-search { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 20px; background: var(--surface-raised); text-decoration: none; color: inherit; transition: box-shadow var(--duration-hover, 150ms) ease; }
.or-search:hover { box-shadow: var(--shadow-card); }
.or-search-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.or-search-name { font: 500 14px/18px var(--font-sans); color: var(--text-primary); }
.or-search-desc { font: 300 12px/17px var(--font-sans); color: var(--text-secondary); }
.or-search-go { flex: none; display: inline-flex; align-items: center; gap: 8px; font: 500 14px/1 var(--font-sans); color: var(--text-primary); }
.or-search-go i { font-size: 16px; }

.or-main { min-width: 0; }
.or-card { padding: 28px 32px 28px; border-radius: var(--r-card); background: var(--surface-raised); box-shadow: var(--shadow-card); display: flex; flex-direction: column; gap: 20px; }
.or-card-head { display: flex; align-items: center; gap: 14px; }
.or-to { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.or-to-name { margin: 0; font: 400 22px/29px var(--font-serif); letter-spacing: -0.005em; color: var(--text-primary); }
.or-to-name.is-empty { color: var(--text-secondary); }
.or-to-sub { font: 300 13px/18px var(--font-sans); color: var(--text-secondary); }
.or-kind { position: relative; display: inline-flex; align-items: center; }
.or-kind select { appearance: none; -webkit-appearance: none; height: 36px; padding: 0 34px 0 14px; border: 0; border-radius: 999px; background: transparent; font: 500 14px/1 var(--font-sans); color: var(--text-primary); cursor: pointer; }
.or-kind select:hover { background: var(--gray-100); }
.or-kind select:focus-visible { outline: 2px solid var(--clay); }
.or-kind i { position: absolute; right: 12px; pointer-events: none; font-size: 14px; color: var(--text-secondary); }
.or-message { width: 100%; min-height: 360px; padding: 24px; border: 0; border-radius: 24px; background: var(--gray-100); resize: vertical; font: 300 16px/28px var(--font-sans); color: var(--text-primary); box-sizing: border-box; }
.or-message:focus { outline: 2px solid var(--brand-35); outline-offset: 0; }
.or-holes { display: flex; gap: 8px; margin: -8px 0 0; font: 300 13px/19px var(--font-sans); color: var(--text-secondary); }
.or-holes i { color: var(--ochre); font-size: 16px; margin-top: 1px; flex: none; }
.or-holes code { font: 500 12px/1 var(--font-mono, monospace); background: var(--ochre-soft); padding: 2px 5px; border-radius: 4px; }
.or-include { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.or-include-label { margin-right: 2px; font: 400 14px/20px var(--font-sans); color: var(--text-secondary); }
.or-include-empty { font: 300 13px/19px var(--font-sans); color: var(--text-muted); }
.or-chip { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-raised); font: 500 13px/1 var(--font-sans); color: var(--text-primary); cursor: pointer; user-select: none; transition: background-color var(--duration-hover, 150ms) ease, border-color var(--duration-hover, 150ms) ease; }
.or-chip input { position: absolute; opacity: 0; pointer-events: none; }
.or-chip i { display: none; font-size: 13px; }
.or-chip.is-on { background: var(--gray-150); border-color: var(--border); }
.or-chip.is-on i { display: inline; }
.or-chip:hover { border-color: var(--brand-35); }
.or-chip:has(input:focus-visible) { outline: 2px solid var(--clay); outline-offset: 2px; }
.or-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.or-actions .btn { height: 48px; }
.or-mark { margin-left: auto; display: inline-flex; align-items: center; gap: 10px; font: 500 14px/20px var(--font-sans); color: var(--text-primary); cursor: pointer; }
.or-mark input { width: 20px; height: 20px; accent-color: var(--brand); }
.or-foot { margin: 16px 0 0; font: 300 13px/18px var(--font-sans); color: var(--text-muted); }
@media (max-width: 1023px) {
  .or-layout { grid-template-columns: minmax(0, 1fr); }
  .or-side { position: static; }
}
@media (max-width: 767px) {
  .or-layout { padding: 0 12px 24px; }
  .or-card { padding: 20px; }
  .or-message { min-height: 260px; padding: 16px; }
  .or-mark { margin-left: 0; }
}

/* ── Application · Posting (S11) ───────────────────────────────────────── */
.ps-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; align-items: start; padding: 8px 40px 48px 64px; }
.ps-main { min-width: 0; max-width: 720px; }
.dialog-backdrop .posting-toolbar { position: sticky; top: 85px; z-index: 3; display: flex; align-items: center; gap: 12px; padding: 0 0 20px; border: 0; background: var(--surface); }
.posting-toolbar .posting-search-field { flex: 0 1 340px; height: 48px; }
.ps-count { font: 300 13px/18px var(--font-sans); color: var(--text-muted); }
.posting-toolbar #posting-open-original { margin-left: auto; }
.posting-text .site-pane-article { padding: 8px 0 24px; }
.posting-text .sp-article li { color: var(--text-secondary); }
.posting-text .sp-article li.has-ask { margin-left: -8px; padding: 9px 14px 9px 28px; border-radius: 14px; background: var(--block-ochre); color: var(--text-primary); }
.posting-text .sp-article li.has-ask.is-risk { background: var(--block-clay); }
.posting-text .sp-article ul > li.has-ask::before { left: 13px; top: 19px; }
mark.posting-ask { padding: 1px 2px; border-radius: 3px; background: var(--block-ochre); color: var(--text-primary); box-shadow: 0 0 0 2px var(--block-ochre); }
mark.posting-ask.is-risk { background: var(--block-clay); box-shadow: 0 0 0 2px var(--block-clay); }
li.has-ask mark.posting-ask { background: none; box-shadow: none; padding: 0; }
.posting-hit { background: var(--clay) !important; color: #fff !important; box-shadow: 0 0 0 2px var(--clay); }
.ps-side { position: sticky; top: 93px; }
.ps-card { padding: 24px; border-radius: var(--r-card); background: var(--surface-raised); display: flex; flex-direction: column; }
.ps-card-title { margin: 0; font: 400 22px/29px var(--font-serif); letter-spacing: -0.005em; color: var(--text-primary); }
.ps-card-note { margin: 10px 0 0; font: 300 13px/20px var(--font-sans); color: var(--text-secondary); }
.ps-legend { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.ps-legend li { display: flex; align-items: center; gap: 10px; min-height: 34px; font: 400 14px/20px var(--font-sans); color: var(--text-primary); }
.ps-swatch { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 6px; background: var(--block-sage); color: var(--sage); font-size: 12px; }
.ps-swatch.is-partial { background: var(--block-ochre); }
.ps-swatch.is-risk { background: var(--block-clay); }
.ps-n { margin-left: auto; font: 400 14px/20px var(--font-sans); color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.ps-card > .btn { margin-top: 16px; width: 100%; justify-content: center; }
@media (max-width: 1023px) {
  .ps-layout { grid-template-columns: minmax(0, 1fr); padding: 0 24px 32px; gap: 16px; }
  .ps-side { position: static; order: -1; }
  .ps-main { max-width: none; }
}
@media (max-width: 767px) {
  .ps-layout { padding: 0 16px 24px; }
  .dialog-backdrop .posting-toolbar { top: 0; position: static; flex-wrap: wrap; }
  .posting-toolbar .posting-search-field { flex: 1 1 100%; }
}

/* ── Audit fixes ───────────────────────────────────────────────────────── */
/* The toast rides above the posting preview's scrim (440) and pane (450),
   below menus (500). */
.snackbar { z-index: 460; }
@media (max-width: 767px) {
  #resume-style-save-bar, .save-bar { bottom: calc(84px + env(safe-area-inset-bottom)); }
}
.variable-rail { top: calc(var(--topbar-h) + 16px); }
.rs-style-layout > .card:last-child { top: calc(var(--topbar-h) + 16px); }
.rs-style-layout .resume-style-preview { max-height: calc(100vh - var(--topbar-h) - 160px); }
@media (max-width: 1023px) {
  .app-panel-sidebar { position: static; max-height: none; }
}
.sp-article hr { display: block; height: 1px; margin: 24px 0; border: 0; background: var(--border); }
@media (prefers-reduced-motion: reduce) {
  .snackbar, .snackbar.visible { transition-property: opacity; transform: translate(-50%, 0); }
  .kanban-card.is-analyzing::after { animation: none; }
  .how-steps li { animation: none; }
  .nearshore-card:hover { transform: none; }
}

/* ── Rules as cards (S7) ───────────────────────────────────────────────── */
.rule-list { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.rule-card { display: flex; align-items: flex-start; gap: 14px; width: 100%; padding: 18px 20px; border: 0; border-radius: 20px; background: var(--surface-raised); text-align: left; color: inherit; cursor: pointer; transition: box-shadow var(--duration-hover, 150ms) ease; }
button.rule-card:hover { box-shadow: var(--shadow-card); }
button.rule-card:focus-visible { outline: 2px solid var(--clay); outline-offset: 2px; }
.rule-check { flex: none; margin-top: 1px; font-size: 20px; color: var(--sage); }
.rule-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.rule-title { font: 500 15px/20px var(--font-sans); color: var(--text-primary); }
.rule-rest { font: 300 13px/19px var(--font-sans); color: var(--text-secondary); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rule-card.is-editing { flex-direction: column; align-items: stretch; gap: 10px; cursor: default; box-shadow: var(--shadow-card); }
.rule-input { width: 100%; box-sizing: border-box; }
.rule-edit-actions { display: flex; align-items: center; gap: 8px; }
.rule-spacer { flex: 1; }
.rule-delete { color: var(--danger); }
.rule-empty { margin: 0; font: 300 14px/20px var(--font-sans); color: var(--text-muted); }
.rules-field-actions .rule-add { margin-left: 4px; }
.rules-field-actions .rule-add[hidden] { display: none; }
.rule-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.av-tab-btn { white-space: nowrap; flex: none; }
@media (max-width: 767px) {
  .fx-row-head { flex-wrap: wrap; row-gap: 0; }
  .fx-row-toggle { flex: 1 1 100%; padding-bottom: 8px; }
  .fx-row-head > .btn, .fx-row-head > .fx-row-note { margin: 0 0 4px 16px; }
}
.posting-text .site-pane-status { padding: 24px 0; font: 300 14px/20px var(--font-sans); color: var(--text-muted); }
@media (max-width: 767px) {
  .or-card-head { flex-wrap: wrap; }
  .or-to-name { font-size: 20px; line-height: 26px; }
}
/* The stage dot is the item's first span; the label after it takes the room. */
.menu-item > span.dot { flex: none; width: 8px; height: 8px; margin: 0 5px; }
.menu-item > span.dot + span { flex: 1; }

/* ── Brand mark as a panel loading state ── */
.brand-mark { display: inline-flex; align-items: center; justify-content: center; margin-bottom: 12px; color: var(--text-primary); }
.brand-mark svg { display: block; }
.fx-state.is-error > i { color: var(--danger, #b3261e); }
.fx-failure { display: flex; align-items: center; gap: 12px; margin: 0 0 24px; padding: 14px 16px 14px 18px; border-radius: 16px; background: var(--warn-bg); color: var(--text-primary); font: 300 14px/21px var(--font-sans); }
.fx-failure > i { flex: none; font-size: 20px; color: var(--warn); }
.fx-failure > div { flex: 1; min-width: 0; }
.fx-failure strong { font-weight: 500; }
.fx-failure .btn { flex: none; }

/* The right pane scrolls down, never sideways. "Analyze again" pulled
   itself 10px past the edge for optical alignment, and that 6px overhang
   gave the pane a horizontal scrollbar that revealed nothing. */
#app-panel-scroll { overflow-x: hidden; }
#app-panel-scroll .fit-head #app-panel-reoptimize-btn { margin-right: 0; }

/* ── What changed, marked ──
   The green the resume preview uses for an edit, on the changed stretch of
   a line only, so the eye goes to what moved instead of reading both
   versions word against word. */
.diff-mark { background: color-mix(in srgb, var(--success-fg) 18%, transparent); color: inherit; border-bottom: 2px solid var(--success-fg); border-radius: 2px; }
.data-grid .diff-mark, table .diff-mark { padding: 0; }
.diff-field { position: relative; flex: 1; display: flex; flex-direction: column; }
.diff-field > textarea { position: relative; z-index: 1; background: transparent !important; }
.diff-field-backdrop { position: absolute; inset: 0; z-index: 0; min-height: 0 !important; max-height: none !important; overflow: hidden !important; color: transparent; white-space: pre-wrap; overflow-wrap: break-word; border: 1px solid transparent !important; pointer-events: none; }
.diff-field-backdrop .diff-mark { color: transparent; }
/* Both versions in one colour: the mark carries the difference. */
.suggestion-popover-original { color: var(--text-primary) !important; }

/* ── Tech Job Scan: how it works, in videos (howitworks.js) ─────────────── */
/* Large on purpose: the films show the real interface, and its 13px type has
   to read inside the player. 16:9 video, the step under way below it. */
.tjs-dialog { width: min(1120px, calc(100vw - 48px)); max-height: calc(100vh - 48px); overflow: auto; padding: 24px 28px 24px; display: flex; flex-direction: column; gap: 16px; }
.tjs-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.tjs-head-text { display: flex; flex-direction: column; gap: 4px; }
.tjs-eyebrow { font: 500 13px/18px var(--font-sans); color: var(--text-secondary); }
.tjs-count { margin-left: 8px; font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }
.tjs-head .app-dialog-title { margin: 0; }
.tjs-media { position: relative; aspect-ratio: 16 / 9; width: 100%; max-height: calc(100vh - 330px); margin: 0 auto; border-radius: 18px; overflow: hidden; background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); }
.tjs-video { display: block; width: 100%; height: 100%; object-fit: contain; cursor: pointer; background: var(--surface); }
.tjs-controls { display: flex; align-items: center; gap: 12px; }
.tjs-controls .icon-btn i { font-size: 18px; }
.tjs-track { position: relative; flex: 1; height: 24px; display: flex; align-items: center; }
.tjs-rail { position: absolute; left: 0; right: 0; height: 4px; border-radius: 2px; background: var(--gray-100, rgb(0 0 0 / 0.08)); overflow: hidden; }
.tjs-fill { height: 100%; width: 0; background: var(--brand); border-radius: 2px; }
.tjs-ticks span { position: absolute; top: 50%; width: 2px; height: 10px; margin: -5px 0 0 -1px; border-radius: 1px; background: var(--text-muted); opacity: 0.5; transition: background var(--duration-tooltip, 120ms) ease-out; }
.tjs-ticks span.past { background: var(--brand); opacity: 1; }
.tjs-scrub { position: absolute; inset: 0; width: 100%; margin: 0; opacity: 0; cursor: pointer; }
.tjs-scrub:focus-visible + * , .tjs-track:focus-within .tjs-rail { outline: 2px solid var(--focus-ring); outline-offset: 3px; }
.tjs-time { font: 400 12px/16px var(--font-mono); color: var(--text-secondary); min-width: 84px; text-align: right; }
.tjs-step { position: relative; min-height: 48px; overflow: hidden; }
.tjs-line { display: flex; gap: 12px; align-items: flex-start; font: 400 17px/24px var(--font-sans); color: var(--text-primary); transition: transform 450ms cubic-bezier(0.45, 0, 0.1, 1), opacity 450ms cubic-bezier(0.45, 0, 0.1, 1); }
.tjs-line + .tjs-line { position: absolute; left: 0; right: 0; top: 0; }
.tjs-line[data-enter] { transform: translateY(100%); opacity: 0; transition: none; }
.tjs-line[data-leave] { transform: translateY(-100%); opacity: 0; }
.tjs-n { flex: none; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 999px; background: var(--block-clay); color: var(--clay-text); font: 500 12px/1 var(--font-sans); }
.tjs-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 4px; }
.tjs-foot .btn { min-width: 96px; }
.tjs-dots { display: flex; gap: 2px; }
.tjs-dot { display: grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 0; background: none; border-radius: 999px; cursor: pointer; }
.tjs-dot span { width: 8px; height: 8px; border-radius: 999px; background: var(--text-muted); opacity: 0.35; transition: width var(--duration-dropdown, 200ms) var(--ease-out, ease-out), opacity var(--duration-dropdown, 200ms) ease-out; }
.tjs-dot.done span { opacity: 0.7; }
.tjs-dot[aria-current="step"] span { width: 20px; background: var(--brand); opacity: 1; }
.tjs-dot:hover span { opacity: 0.85; }
.tjs-dot:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 1px; }
@media (prefers-reduced-motion: reduce) { .tjs-line, .tjs-dot span { transition: none; } }
@media (max-width: 720px) {
  .tjs-dialog { padding: 20px 16px calc(16px + env(safe-area-inset-bottom)); gap: 12px; }
  .tjs-replay, .tjs-time { display: none; }
  .tjs-line { font-size: 15px; line-height: 22px; }
  .tjs-foot .btn { min-width: 0; }
}
