:root {
  --bg: #f7f7f8;
  --surface: #ffffff;
  --surface-alt: #fafafb;
  --border: #e6e6ea;
  --border-strong: #d1d1d8;
  --text: #1a1a1f;
  --muted: #6b6b76;
  --subtle: #9a9aa3;
  --accent: #f97316;
  --accent-soft: #fff1e6;
  --success: #16a34a;
  --success-soft: #dcfce7;
  --warn: #d97706;
  --warn-soft: #fef3c7;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --info: #2563eb;
  --info-soft: #dbeafe;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.15);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
    Ubuntu, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
}

.muted {
  color: var(--muted);
}

/* Header */
.app-header {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 16px 32px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  order: 0;
  font-weight: 700;
  font-size: 22px;
  color: var(--accent);
  letter-spacing: -0.02em;
}

.primary-nav {
  order: 2;
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.primary-nav a {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s ease;
}

.primary-nav a:hover {
  color: var(--text);
  background: var(--surface-alt);
}

.primary-nav a.active {
  color: var(--text);
  background: var(--accent-soft);
}

/* Lane tabs (cards page) */
.lane-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 16px 32px 0;
}

.lane-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.lane-tab:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.lane-tab.active {
  background: var(--text);
  color: var(--surface);
  border-color: var(--text);
}

.lane-count {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.08);
  color: inherit;
  min-width: 18px;
  text-align: center;
}

.lane-tab.active .lane-count {
  background: rgba(255, 255, 255, 0.2);
}

.lane-count-visible {
  font-size: 10px;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.05);
  color: var(--muted);
  font-weight: 500;
}

.lane-tab.active .lane-count-visible {
  background: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.85);
}

/* Cards hero — lane tabs share a row with the Filter CTA. The hero owns the
   outer padding so the lane-tab strip can flex/scroll while the Filter button
   stays pinned to the right. position:relative anchors the sort popover. */
.cards-hero {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 32px 0;
  position: relative;
}

.cards-hero .lane-tabs {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0;
}

/* "refreshing…" while a saved or on-screen lane waits for the live list. Sits in the
   grid's top padding so showing/hiding it never moves a card. */
.refresh-marker {
  position: absolute;
  left: 32px;
  bottom: -20px;
  font-size: 11px;
  line-height: 14px;
  color: var(--subtle);
}

.refresh-marker-error {
  color: var(--warn);
}

@media (max-width: 720px) {
  .refresh-marker {
    left: 16px;
  }
}

/* Overview strip (cards page): what waits on me (clickable), total tracked, data
   as of. Redrawn 2026-10-22: the old per-lane pill list repeated the lane tabs
   below it one for one, so the two rows read as duplicates. Now the strip is a
   tinted stat band — square corners, small-caps labels, bigger numbers — so it
   cannot be mistaken for the round-pill tab/filter row, and it carries only what
   the tabs do not. min-height holds the row open so the first numbers arriving
   never move the page. */
.overview-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 28px;
  min-height: 48px;
  padding: 10px 32px;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border-strong);
  font-size: 13px;
  color: var(--muted);
}

.overview-needs {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-weight: 600;
}

.overview-needs-hot {
  background: var(--warn-soft);
  border-color: var(--warn);
  border-style: solid;
}

.overview-needs-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

/* Each waiting lane is a real button: click jumps to that lane. */
.overview-needs-part {
  padding: 3px 9px;
  border: 1px solid var(--warn);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
}

.overview-needs-part:hover {
  background: var(--warn);
  color: #fff;
}

.overview-count {
  color: var(--text);
  font-weight: 600;
}

.overview-total {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}

.overview-total .overview-count {
  font-size: 15px;
}

.overview-asof {
  margin-left: auto;
  font-size: 12px;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .overview-strip {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 10px 16px;
    -webkit-overflow-scrolling: touch;
  }

  .overview-needs,
  .overview-total,
  .overview-asof {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .overview-asof {
    margin-left: 0;
  }
}

.filter-cta {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-cta:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

/* Lit accent when a sort is actively applied, so the user can tell at a glance
   the list is reordered even with the popover closed. */
.filter-cta.has-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.filter-cta .ico {
  width: 14px;
  height: 14px;
}

/* Sort popover — anchored under the Filter CTA, right-aligned. */
.filter-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 32px;
  z-index: 40;
  width: 280px;
  max-width: calc(100vw - 32px);
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}

.filter-popover[hidden] {
  display: none;
}

.filter-popover-title {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.filter-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.filter-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-option:hover {
  border-color: var(--border-strong);
}

.filter-option.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

.filter-option-check {
  opacity: 0;
  font-weight: 700;
}

.filter-option.active .filter-option-check {
  opacity: 1;
}

.filter-popover-actions {
  display: flex;
  gap: 8px;
}

.filter-popover-actions .btn {
  flex: 1;
}

/* Segmented choices inside the popover (sort direction, posted-within). */
.filter-seg {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.filter-seg-btn {
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-seg-btn:hover {
  border-color: var(--border-strong);
}

.filter-seg-btn.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

/* Minimum fit score slider: 0 reads as "Any". */
.filter-slider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.filter-slider input[type='range'] {
  flex: 1;
  accent-color: var(--accent);
}

.filter-slider-value {
  min-width: 52px;
  text-align: right;
  font-weight: 600;
  color: var(--text);
  font-size: 12px;
}

/* Hero search box: filters the open lane as he types. */
.card-search {
  flex: 0 1 230px;
  min-width: 130px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
}

.card-search:focus {
  outline: none;
  border-color: var(--accent);
}

/* Incremental-load bar at the grid's bottom edge: the running count, the Show
   more button, and the step-size dropdown. Also the scroll sentinel. */
.load-more-bar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px;
  color: var(--muted);
  font-size: 13px;
}

.load-more-size select {
  font: inherit;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
}

/* Blocker digest: the Needs Manual lane's missing pieces, gathered in one panel. */
.blocker-digest {
  grid-column: 1 / -1;
  background: var(--warn-soft);
  border: 1px solid var(--warn);
  border-radius: var(--radius);
  padding: 12px 16px;
}

.blocker-digest summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
}

.digest-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.digest-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.digest-card {
  display: flex;
  gap: 10px;
  align-items: baseline;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text);
}

.digest-card a {
  margin-left: auto;
  font-size: 12px;
}

.digest-needs {
  margin: 6px 0 0;
  padding-left: 18px;
  font-size: 12.5px;
  color: var(--muted);
}

/* The awaiting-enrichment banner is a grid child like its lowfit sibling but
   lacked the span, so on 2-3 column desktops it rendered one card wide with
   cards flowing beside it (review find, 2026-10-22). */
.pending-enrichment-banner {
  grid-column: 1 / -1;
}

/* Wrap-up answer boxes: one input per recorded question, save re-queues. */
.digest-answers {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.digest-answer-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  align-items: center;
}

.digest-answer-row label {
  flex: 1 1 100%;
  font-size: 12px;
  color: var(--muted);
}

.digest-answer {
  flex: 1 1 320px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  background: var(--surface);
}

.digest-answer:focus {
  outline: none;
  border-color: var(--accent);
}

.digest-answer-actions {
  margin-top: 8px;
}

/* Card grid — capped at 3 cards/row on desktop, stacking down at narrower viewports */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  padding: 24px 32px;
  max-width: 1440px;
  margin: 0 auto;
}

@media (min-width: 760px) {
  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1100px) {
  .card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.empty-state {
  grid-column: 1 / -1;
  padding: 48px;
  text-align: center;
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.empty-state code {
  background: var(--surface-alt);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 12px;
}

.empty-state.error {
  color: var(--danger);
  border-color: var(--danger);
  background: var(--danger-soft);
}

.lowfit-banner {
  grid-column: 1 / -1;
  padding: 10px 14px;
  margin-bottom: 4px;
  font-size: 13px;
  color: var(--muted);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.lowfit-banner strong { color: var(--text); }

.link-btn {
  background: none;
  border: none;
  color: var(--accent, #2563eb);
  cursor: pointer;
  padding: 0;
  font-size: inherit;
  text-decoration: underline;
}

.link-btn:hover { opacity: 0.8; }

/* Pipeline status badge (Continuity F1+F2) */
.status-badge {
  /* order:1 places it right after the brand; flex-end bottom-aligns the pill
     to the brand's text line (brand is the tallest header item, so its bottom
     edge == the flex line bottom). */
  order: 1;
  align-self: flex-end;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
}

.status-badge:hover { background: var(--surface-alt); }

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94a3b8;
}

.status-badge[data-color="green"] .status-dot { background: #16a34a; }
.status-badge[data-color="yellow"] .status-dot { background: #eab308; }
.status-badge[data-color="red"] .status-dot { background: #dc2626; }
.status-badge[data-color="unknown"] .status-dot { background: #94a3b8; }

.status-panel {
  position: absolute;
  top: 56px;
  right: 16px;
  width: 360px;
  max-width: calc(100vw - 32px);
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  z-index: 50;
  font-size: 13px;
}

.status-panel h3 {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-panel .status-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--border);
}

.status-panel .status-row:first-of-type { border-top: none; }
.status-panel .status-row-dot {
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 5px;
  background: #94a3b8;
}
.status-panel .status-row[data-color="green"] .status-row-dot { background: #16a34a; }
.status-panel .status-row[data-color="yellow"] .status-row-dot { background: #eab308; }
.status-panel .status-row[data-color="red"] .status-row-dot { background: #dc2626; }
.status-panel .status-row-body { flex: 1; }
.status-panel .status-row-title { font-weight: 600; }
.status-panel .status-row-meta { color: var(--muted); font-size: 12px; margin-top: 2px; }

/* Queue runner banner — sits above the Approved-lane card grid */
.queue-banner {
  grid-column: 1 / -1;
  padding: 10px 14px;
  margin-bottom: 4px;
  font-size: 13px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 8px;
}

.queue-banner[data-color="green"] {
  color: var(--muted);
  background: var(--surface-alt);
  border: 1px solid var(--border);
}
.queue-banner[data-color="yellow"] {
  color: #854d0e;
  background: #fef9c3;
  border: 1px solid #facc15;
}
.queue-banner[data-color="red"] {
  color: #991b1b;
  background: #fee2e2;
  border: 1px solid #dc2626;
}

/* Card */
.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  min-height: 340px;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-lg);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px 0;
  flex-wrap: wrap;
}

.card-position {
  font-size: 11px;
  color: var(--text);
  font-weight: 600;
  margin-right: auto;
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--muted);
  border: 1px solid var(--border);
}

.badge-status {
  background: var(--info-soft);
  color: var(--info);
  border-color: transparent;
}

.badge-ats {
  background: var(--surface-alt);
  color: var(--muted);
}

.badge-ats-greenhouse {
  background: var(--success-soft);
  color: var(--success);
}

.badge-ats-lever {
  background: var(--warn-soft);
  color: var(--warn);
}

.badge-ats-workday {
  background: var(--info-soft);
  color: var(--info);
}

/* Recommendation chip */
.rec-chip {
  display: inline-block;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-radius: 999px;
  border: 1px solid transparent;
}

.rec-apply {
  background: var(--success-soft);
  color: var(--success);
}

.rec-caution {
  background: var(--warn-soft);
  color: var(--warn);
}

.rec-pass {
  background: var(--danger-soft);
  color: var(--danger);
}

.card-posture-line {
  font-size: 12px;
  line-height: 1.4;
  color: var(--text);
  padding: 8px 10px;
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent);
}

.posture-label {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--accent);
  margin-right: 6px;
}

.path-code {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 12px;
  background: var(--surface);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
  word-break: break-all;
}

.btn-link {
  background: none;
  border: none;
  color: var(--info);
  cursor: pointer;
  font-size: 12px;
  text-decoration: underline;
  padding: 0 4px;
}

.btn-link:hover {
  color: var(--text);
}

.card-body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.card-identity {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.card-logo {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
}

.card-identity-text {
  min-width: 0;
  flex: 1;
}

.card-company {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  font-weight: 500;
}

.card-title {
  margin: 4px 0 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.card-tags:empty {
  display: none;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  font-size: 11px;
  border-radius: 6px;
  background: var(--surface-alt);
  color: var(--muted);
  border: 1px solid var(--border);
}

/* Inline outline icon — inherits currentColor so it matches whatever pill or
   line of text it sits in. Stroke-only, no fill. */
.ico {
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -1px;
}

.card-location .ico,
.card-meta-line .ico {
  width: 13px;
  height: 13px;
  margin-right: 4px;
}

.tag-date {
  background: var(--info-soft);
  color: var(--info);
  border-color: transparent;
}

.tag-mode {
  background: #f3e8ff;
  color: #7c3aed;
  border-color: transparent;
}

.tag-level {
  background: #f3e8ff;
  color: #7c3aed;
  border-color: transparent;
}

.card-salary {
  font-size: 14px;
  font-weight: 600;
  color: var(--success);
}

.card-location,
.card-meta-line {
  font-size: 13px;
  color: var(--muted);
}

.card-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface-alt);
}

.action-row {
  display: flex;
  gap: 6px;
}

.btn {
  flex: 1;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn:hover:not(:disabled) {
  border-color: var(--border-strong);
  background: var(--surface-alt);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--text);
  color: var(--surface);
  border-color: var(--text);
}

.btn-primary:hover:not(:disabled) {
  background: #2a2a32;
  border-color: #2a2a32;
}

.btn-secondary {
  background: var(--surface);
  color: var(--muted);
}

.btn-success {
  background: var(--success-soft);
  color: var(--success);
  border-color: transparent;
}

.btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: transparent;
}

.card.lane-post-mortem .card-logo {
  background: var(--surface-alt);
  color: var(--muted);
}

/* ---- Page container (Search Config + Resumes) ---- */

.page-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px;
}

.page-header {
  margin-bottom: 28px;
}

.page-header h1 {
  margin: 0 0 6px;
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
}

.page-header p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

/* Preferences form */
.prefs-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.prefs-form fieldset {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0;
  padding: 18px 0;
}

.prefs-form fieldset:first-of-type {
  border-top: none;
}

.prefs-form legend {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  padding: 0;
  margin-bottom: 4px;
}

.field-hint {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--muted);
}

.prefs-form input[type='number'] {
  width: 200px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
}

.checkbox-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.checkbox-row label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  cursor: pointer;
}

.form-footer {
  padding-top: 18px;
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}

.form-footer .btn {
  flex: 0 0 auto;
  padding: 10px 22px;
}

.save-status {
  margin-bottom: 12px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  min-height: 18px;
}

.save-status.pending {
  background: var(--info-soft);
  color: var(--info);
}

.save-status.success {
  background: var(--success-soft);
  color: var(--success);
}

.save-status.error {
  background: var(--danger-soft);
  color: var(--danger);
}

.save-status:empty {
  display: none;
}

/* Chip input */
.chip-input {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 28px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 6px 5px 12px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
}

.chip-remove {
  border: none;
  background: rgba(0, 0, 0, 0.08);
  color: inherit;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.chip-remove:hover {
  background: rgba(0, 0, 0, 0.15);
}

.chip-empty {
  font-size: 12px;
  color: var(--subtle);
  font-style: italic;
}

.chip-add-row {
  display: flex;
  gap: 6px;
  align-items: center;
  max-width: 360px;
}

.chip-add-input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
}

.chip-add-input:focus {
  outline: 2px solid var(--accent-soft);
  outline-offset: 1px;
  border-color: var(--accent);
}

.chip-add-btn {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--accent);
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
}

.chip-add-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}

/* Salary floor + target row */
.salary-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.salary-row label {
  display: flex;
  flex-direction: column;
  font-size: 13px;
  color: var(--muted);
  gap: 4px;
}

.salary-row input {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  width: 180px;
  font-family: inherit;
}

/* Salary on card */
.card-salary {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 14px;
  font-weight: 600;
  color: var(--success);
}

.card-salary-unknown {
  color: var(--subtle);
  font-weight: 500;
  font-style: italic;
}

.salary-confidence {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--surface-alt);
  color: var(--muted);
  border: 1px solid var(--border);
}

.salary-conf-posted {
  background: var(--success-soft);
  color: var(--success);
  border-color: transparent;
}

.salary-conf-inferred {
  background: var(--warn-soft);
  color: var(--warn);
  border-color: transparent;
}

.salary-conf-unknown {
  background: var(--surface-alt);
  color: var(--subtle);
}

/* Aside panel (top titles) */
.aside-panel {
  margin-top: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
}

.aside-panel h2 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 600;
}

.title-list {
  margin: 14px 0 0;
  padding-left: 22px;
  font-size: 14px;
  color: var(--text);
}

.title-list li {
  margin: 4px 0;
}

/* Resume list */
.resume-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.resume-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s ease;
}

.resume-row:hover {
  border-color: var(--border-strong);
}

.resume-identity h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.resume-identity p {
  margin: 2px 0 0;
  font-size: 12px;
}

.resume-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.resume-actions .btn {
  flex: 0 0 auto;
  padding: 7px 14px;
  font-size: 12px;
}

.source-viewer {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text);
  white-space: pre;
  overflow-x: auto;
  max-height: 60vh;
  margin: 0;
}

/* ---- Modal ---- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 50;
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(720px, calc(100vw - 32px));
  max-height: calc(100vh - 64px);
  overflow: auto;
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  z-index: 51;
}

.modal[hidden],
.modal-backdrop[hidden] {
  display: none;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover {
  background: var(--surface-alt);
  color: var(--text);
}

.modal-content {
  padding: 28px 28px 20px;
}

.modal-header {
  margin: 0 0 16px;
  padding-right: 32px;
}

.modal-header h2 {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.modal-subtitle {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.modal-section {
  padding: 14px 0;
  border-top: 1px solid var(--border);
}

.modal-section:first-of-type {
  border-top: none;
  padding-top: 0;
}

.modal-section h3 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.modal-section p {
  margin: 4px 0;
  font-size: 14px;
  color: var(--text);
}

.modal-section-highlight {
  background: var(--info-soft);
  margin: 0 -28px;
  padding-left: 28px;
  padding-right: 28px;
  border: none;
  border-top: 1px solid var(--info-soft);
  border-bottom: 1px solid var(--info-soft);
}

.modal-section-highlight h3 {
  color: var(--info);
}

.modal-section-duplicate {
  background: var(--warning-soft, rgba(234, 179, 8, 0.08));
  margin: 0 -28px;
  padding-left: 28px;
  padding-right: 28px;
  border-top: 1px solid rgba(234, 179, 8, 0.25);
  border-bottom: 1px solid rgba(234, 179, 8, 0.25);
}

.modal-section-duplicate h3 {
  color: #92400e;
}

.modal-footer {
  padding: 16px 0 4px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-start;
}

.modal-footer .btn {
  flex: 0 0 auto;
  padding: 10px 18px;
}

.modal-error {
  color: var(--danger);
}

/* Notes editor (inside modal) */
.notes-editor {
  width: 100%;
  min-height: 70px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 14px;
  resize: vertical;
  background: var(--surface);
  color: var(--text);
}

.notes-editor:focus {
  outline: 2px solid var(--accent-soft);
  outline-offset: 1px;
  border-color: var(--accent);
}

.notes-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 10px;
}

.notes-footer .save-status {
  margin: 0;
  padding: 4px 10px;
  font-size: 12px;
}

.btn-compact {
  flex: 0 0 auto;
  padding: 8px 16px;
  font-size: 13px;
}

/* Card pending/removing transitions */
.card-pending {
  opacity: 0.55;
  pointer-events: none;
}

.card-removing {
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Toast */
#toast.toast {
  position: fixed;
  top: 24px;
  right: 24px;
  transform: translateY(-20px);
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  background: var(--text);
  color: var(--surface);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  max-width: 360px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 100;
}

#toast.toast-show {
  opacity: 1;
  transform: translateY(0);
}

#toast.toast-success {
  background: var(--success);
}

#toast.toast-error {
  background: var(--danger);
}

/* ---- Pending-enrichment banner (New Matches lane) ---- */
.pending-enrichment-banner {
  background: var(--warn-soft);
  color: var(--warn);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 12px;
}

/* ---- Blocker banner on Needs Manual cards ---- */
.blocker-banner {
  background: var(--danger-soft);
  border-left: 3px solid var(--danger);
  padding: 8px 12px;
  margin-top: 8px;
  border-radius: var(--radius-sm);
  font-size: 12px;
}

.blocker-banner .blocker-label {
  color: var(--danger);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.04em;
  font-size: 10px;
  margin-bottom: 4px;
}

.blocker-banner .blocker-action {
  color: var(--text);
  line-height: 1.4;
}

.blocker-banner .blocker-detail {
  color: var(--text);
  line-height: 1.4;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.blocker-banner .blocker-detail-meta {
  color: var(--muted);
  font-size: 11px;
}

/* ---- Dismiss reason on dismissed-lane cards ---- */
.dismiss-reason {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
  padding: 6px 10px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  border-left: 2px solid var(--border);
  line-height: 1.4;
}

.dismiss-reason .dismiss-label {
  font-weight: 600;
  color: var(--text);
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.04em;
}

/* ---- 1.j Confirmation reconciliation ---- */
.confirmation-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #1b5e20;
  background: #e8f5e9;
  border: 1px solid #a5d6a7;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.02em;
  cursor: help;
}

.pending-confirmation-banner {
  background: #e3f2fd;
  border-left: 3px solid #1976d2;
  padding: 10px 12px;
  margin-top: 8px;
  border-radius: var(--radius-sm);
  font-size: 12px;
}

.pending-confirmation-label {
  color: #0d47a1;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 10px;
  margin-bottom: 4px;
}

.pending-confirmation-reason {
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 8px;
  font-style: italic;
}

.pending-confirmation-list {
  list-style: none;
  padding: 0;
  margin: 0 0 8px 0;
}

.pending-confirmation-candidate {
  background: #fff;
  border: 1px solid #bbdefb;
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  margin-bottom: 6px;
}

.pending-confirmation-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
  margin-bottom: 4px;
}

.pending-confirmation-from {
  color: var(--muted);
  font-size: 11px;
}

.pending-confirmation-date {
  color: var(--muted);
  font-size: 10px;
  margin-left: auto;
}

.pending-confirmation-snippet {
  color: var(--text);
  font-size: 11px;
  line-height: 1.4;
  margin: 4px 0 6px 0;
}

.btn-sm {
  font-size: 11px;
  padding: 4px 10px;
}

/* ---- Hold-for-review pill on Ready Tonight cards ---- */
/* Low-emphasis nudge by default; high-visibility marker when active so a
   scan of the lane shows which cards are opted out of overnight auto-submit. */
.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px dashed var(--border);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--text);
  background: var(--surface);
}

.force-review-on {
  background: #fff3cd;
  color: #856404;
  border-color: #856404;
}

.force-review-on:hover {
  background: #ffeaa0;
}

/* ---- Materials preview modal ---- */
.materials-meta {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
}

.materials-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
}

.materials-tab {
  background: transparent;
  border: none;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.materials-tab:hover {
  color: var(--text);
}

.materials-tab.active {
  color: var(--text);
  border-bottom-color: var(--info);
}

.materials-panel {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  max-height: 60vh;
  overflow-y: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-family: ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
}

.materials-paths {
  margin-top: 10px;
  font-size: 11px;
  color: var(--muted);
}

.materials-paths code {
  background: var(--surface);
  padding: 1px 5px;
  border-radius: 3px;
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

.modal-cta-row {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* ---- Bullet bank ---- */

.bullet-bank {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 24px;
}

.bullet-bank-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 10px;
}

.bullet-bank-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.bullet-filters {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.bullet-search-input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.filter-pill {
  padding: 4px 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  border-radius: 999px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
}

.filter-pill:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.filter-pill.active {
  background: var(--text);
  color: var(--surface);
  border-color: var(--text);
}

.bullet-add-form {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bullet-add-form .form-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.bullet-add-form input,
.bullet-add-form select,
.bullet-add-form textarea {
  flex: 1;
  min-width: 120px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  background: var(--surface);
}

.bullet-add-form textarea {
  width: 100%;
  resize: vertical;
}

.bullet-add-form .form-footer {
  padding: 0;
  margin: 0;
  border: 0;
  justify-content: flex-end;
  gap: 8px;
}

.bullet-add-form .form-footer .btn {
  flex: 0 0 auto;
}

.bullet-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.bullet-group-heading {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.bullet-group {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
  margin-bottom: 20px;
}

.bullet-group .bullet-group-heading {
  grid-column: 1 / -1;
  margin: 6px 0 0;
}

@media (max-width: 1100px) {
  .bullet-group {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .bullet-group {
    grid-template-columns: 1fr;
  }
}

.bullet-card {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bullet-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
  position: relative;
}

.bullet-menu-wrap {
  position: relative;
  margin-left: auto;
}

.bullet-menu-trigger {
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  width: 28px;
  height: 28px;
  font-size: 18px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.bullet-menu-trigger:hover,
.bullet-menu-trigger[aria-expanded="true"] {
  background: var(--surface);
  color: var(--text);
}

.bullet-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 180px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 50;
}

/* Author `display: flex` above beats the UA `[hidden] { display: none }` rule
   (equal specificity, author origin wins), so the JS `panel.hidden = true`
   toggle had no visual effect — every menu rendered open and couldn't close.
   This higher-specificity rule restores `[hidden]` so menus default closed and
   the trigger toggles them. */
.bullet-menu[hidden] {
  display: none;
}

.bullet-menu-item {
  background: transparent;
  border: none;
  text-align: left;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
}

.bullet-menu-item:hover,
.bullet-menu-item:focus-visible {
  background: var(--surface-alt);
}

.bullet-menu-item-danger {
  color: var(--danger);
}

.bullet-menu-item-danger:hover,
.bullet-menu-item-danger:focus-visible {
  background: var(--danger-soft);
}

.bullet-id {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 11px;
  color: var(--muted);
  background: var(--surface);
  padding: 1px 6px;
  border-radius: 4px;
}

.bullet-status {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.bullet-status-active {
  background: var(--success-soft);
  color: var(--success);
}

.bullet-status-candidate {
  background: var(--warn-soft);
  color: var(--warn);
}

.bullet-status-retired {
  background: var(--surface);
  color: var(--subtle);
  border: 1px solid var(--border);
}

.bullet-sub {
  font-size: 11px;
  color: var(--muted);
  font-style: italic;
}

.bullet-text {
  margin: 4px 0 8px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
}

.bullet-text-edit {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
  margin: 4px 0 8px;
}

.bullet-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.bullet-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.bullet-tag {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}

.bullet-used {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 4px 0 10px;
  font-size: 12px;
}

.bullet-used-label {
  color: var(--muted);
  font-weight: 600;
}

.bullet-used-chip {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-alt, #f3f4f6);
  color: var(--text);
  cursor: default;
}

.bullet-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* The `display: flex` above beats the UA `[hidden] { display: none }` rule, so the
   edit-mode Cancel/Save row would leak into view mode. This higher-specificity rule
   restores `[hidden]` (mirrors the `.bullet-menu[hidden]` fix). F-1, 2026-07-01. */
.bullet-actions[hidden] {
  display: none;
}

.bullet-actions .btn {
  flex: 0 0 auto;
}

.recent-resumes details summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  padding: 10px 0;
  list-style: none;
}

.recent-resumes details summary::before {
  content: '▸ ';
  display: inline-block;
  transition: transform 0.15s ease;
}

.recent-resumes details[open] summary::before {
  content: '▾ ';
}

.recent-resumes details[open] .resume-list {
  margin-top: 12px;
}

/* ---- Sign-in gate ---- */

.signin-gate {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 200;
}

.signin-gate[hidden] {
  display: none;
}

.signin-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.signin-card h1 {
  margin: 0;
  color: var(--accent);
  font-size: 26px;
  letter-spacing: -0.02em;
}

.signin-hint {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.signin-input {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
}

.signin-input:focus {
  outline: 2px solid var(--accent-soft);
  outline-offset: 1px;
  border-color: var(--accent);
}

.signin-submit {
  width: 100%;
  padding: 12px;
  font-size: 14px;
  flex: 0 0 auto;
}

.signin-help {
  font-size: 13px;
  color: var(--muted);
  margin: -4px 0 2px;
}

.signin-help summary {
  cursor: pointer;
  color: var(--info);
  user-select: none;
}

.signin-help summary:hover {
  text-decoration: underline;
}

.signin-help-body {
  padding: 10px 12px;
  margin-top: 8px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  line-height: 1.5;
}

.signin-help-body p {
  margin: 0 0 8px;
}

.signin-help-body p:last-child {
  margin-bottom: 0;
}

.signin-help-body code {
  background: var(--bg);
  padding: 1px 5px;
  border-radius: 3px;
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 12px;
}

.signin-status {
  margin: 0;
  min-height: 18px;
  font-size: 13px;
  color: var(--muted);
}

.signin-status.pending {
  color: var(--info);
}

.signin-status.success {
  color: var(--success);
}

.signin-status.error {
  color: var(--danger);
}

.signout-btn {
  order: 3;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 6px 12px;
  font-size: 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
}

.signout-btn:hover {
  background: var(--surface-alt);
  color: var(--text);
}

/* ---- Mobile responsive ---- */

@media (max-width: 720px) {
  body {
    font-size: 15px;
  }

  /* Header: row 1 = logo · health pill · (spacer) · sign out; row 2 = nav.
     Orders override the desktop arrangement; nav at width:100% forces the
     wrap so it lands on its own line below the logo row. */
  .app-header {
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 16px;
    align-items: center;
  }

  .brand {
    order: 0;
    font-size: 20px;
  }

  .status-badge {
    order: 1;
  }

  .signout-btn {
    order: 2;
    margin-left: auto;
  }

  .primary-nav {
    order: 3;
    width: 100%;
    margin-left: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    gap: 4px;
    padding-bottom: 2px;
  }

  .primary-nav a {
    flex: 0 0 auto;
    padding: 6px 12px;
    font-size: 13px;
  }

  /* Lane tabs become a horizontal scroll strip */
  .lane-tabs {
    padding: 12px 16px 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
  }

  .lane-tab {
    flex: 0 0 auto;
    scroll-snap-align: start;
    padding: 6px 12px;
    font-size: 12px;
  }

  /* Hero: tighter outer padding; popover spans the viewport with side margins.
     The search box drops to its own full-width line so the tabs keep room. */
  .cards-hero {
    padding: 12px 16px 0;
    flex-wrap: wrap;
  }

  .card-search {
    order: 3;
    flex: 1 1 100%;
  }

  .filter-cta {
    padding: 6px 12px;
    font-size: 12px;
  }

  .filter-popover {
    right: 16px;
    left: 16px;
    width: auto;
    max-width: none;
  }

  /* Cards stack into a single column with tighter spacing */
  .card-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 14px 12px 80px;
  }

  .card {
    min-height: 0;
  }

  .card-header {
    padding: 10px 12px 0;
  }

  .card-body {
    padding: 12px;
    gap: 10px;
  }

  .card-title {
    font-size: 16px;
  }

  .card-logo {
    width: 40px;
    height: 40px;
    font-size: 14px;
  }

  .card-actions {
    padding: 10px 12px 12px;
  }

  /* Buttons get touch-friendly height */
  .btn {
    padding: 10px 12px;
    font-size: 14px;
    min-height: 40px;
  }

  /* Search Config + Resumes pages */
  .page-container {
    padding: 18px 14px 80px;
  }

  .page-header h1 {
    font-size: 22px;
  }

  .prefs-form {
    padding: 4px 16px 16px;
  }

  .prefs-form input[type='number'] {
    width: 100%;
    max-width: 240px;
  }

  .checkbox-row {
    gap: 10px;
  }

  .form-footer .btn {
    width: 100%;
    padding: 12px;
  }

  /* Resume rows stack vertically */
  .resume-row {
    flex-direction: column;
    align-items: stretch;
    padding: 14px 16px;
  }

  .resume-actions {
    width: 100%;
  }

  .resume-actions .btn {
    flex: 1 1 0;
    font-size: 13px;
    padding: 9px 10px;
  }

  /* Modal goes full-screen on small viewports */
  .modal {
    top: 0;
    left: 0;
    transform: none;
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    overflow-y: auto;
  }

  .modal-backdrop {
    background: rgba(0, 0, 0, 0.6);
  }

  .modal-content {
    padding: 20px 16px 24px;
  }

  .modal-header h2 {
    font-size: 18px;
    padding-right: 24px;
  }

  .modal-close {
    top: 8px;
    right: 8px;
    width: 36px;
    height: 36px;
    font-size: 22px;
  }

  .modal-section-highlight {
    margin: 0 -16px;
    padding-left: 16px;
    padding-right: 16px;
  }

  .path-code {
    display: inline-block;
    margin-top: 4px;
    max-width: 100%;
  }

  /* Toast lifts above iOS Safari home indicator */
  #toast.toast {
    bottom: max(16px, env(safe-area-inset-bottom));
    font-size: 14px;
    padding: 12px 18px;
  }
}

@media (max-width: 400px) {
  .card-position {
    display: none;
  }

  .card-header {
    gap: 6px;
  }

  .rec-chip {
    padding: 2px 8px;
    font-size: 10px;
  }

  .badge {
    padding: 2px 8px;
    font-size: 10px;
  }
}

/* ---- Posture modal ---- */
.posture-match {
  padding: 10px 12px;
  margin-bottom: 10px;
  border-left: 3px solid var(--border-strong);
  background: var(--surface-alt);
  border-radius: 0 6px 6px 0;
}
.posture-resp { margin-bottom: 4px; }
.posture-bullet {
  margin: 4px 0 4px 12px;
  font-size: 14px;
}
.posture-bullet-empty em { color: var(--muted); }
.posture-reasoning {
  margin-left: 12px;
  font-size: 12px;
}
.posture-gap {
  padding: 8px 12px;
  margin-bottom: 8px;
  border-left: 3px solid var(--warn);
  background: var(--warn-soft);
  border-radius: 0 6px 6px 0;
}
.match-strength {
  display: inline-block;
  padding: 1px 8px;
  margin-left: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 999px;
}
.match-strength-strong   { background: var(--success-soft); color: var(--success); }
.match-strength-moderate { background: var(--warn-soft);    color: var(--warn); }
.match-strength-weak     { background: #fee2e2;             color: #b91c1c; }
.match-strength-unknown  { background: var(--border);       color: var(--muted); }
.bullet-id {
  font-size: 11px;
  color: var(--subtle);
  margin-left: 4px;
}
.modal-section-warn {
  border-left: 3px solid var(--warn);
  padding-left: 10px;
}
.modal-meta {
  margin-top: 16px;
  font-size: 12px;
}

/* ---- Flags list ---- */
.flag-list { margin: 4px 0 8px 18px; padding: 0; }
.flag-list li { margin-bottom: 3px; }
.flag-list-green li::marker { color: var(--success); }
.flag-list-red li::marker { color: #b91c1c; }

/* ---- Pipeline page (live fleet map) ---- */
.pipeline-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }

.pl-overall {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--border); background: #fff;
  font-weight: 600; font-size: 14px; margin-bottom: 20px;
}
.pl-overall-sub { color: var(--muted); font-weight: 400; font-size: 12px; }
.pl-dot { width: 10px; height: 10px; border-radius: 50%; background: #94a3b8; flex: none; }
[data-color="green"] > .pl-dot, .pl-overall[data-color="green"] .pl-dot { background: #16a34a; }
[data-color="yellow"] > .pl-dot, .pl-overall[data-color="yellow"] .pl-dot { background: #eab308; }
[data-color="red"] > .pl-dot, .pl-overall[data-color="red"] .pl-dot { background: #dc2626; }
[data-color="unknown"] > .pl-dot, .pl-overall[data-color="unknown"] .pl-dot { background: #94a3b8; }

.pl-flow {
  display: flex; align-items: stretch; flex-wrap: wrap; gap: 8px; margin-bottom: 28px;
}
.pl-stage {
  flex: 1 1 150px; min-width: 150px;
  background: #fff; border: 1px solid var(--border); border-top: 3px solid #94a3b8;
  border-radius: 10px; padding: 12px 13px; display: flex; flex-direction: column; gap: 6px;
}
.pl-stage[data-color="green"] { border-top-color: #16a34a; }
.pl-stage[data-color="yellow"] { border-top-color: #eab308; }
.pl-stage[data-color="red"] { border-top-color: #dc2626; }
.pl-stage[data-color="unknown"] { border-top-color: #94a3b8; }
.pl-stage-top { display: flex; align-items: center; gap: 7px; }
.pl-stage-name { font-weight: 700; font-size: 15px; }
.pl-where {
  display: inline-flex; align-items: center; gap: 4px; align-self: flex-start;
  font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px;
  background: #f1f5f9; color: #475569;
}
.pl-where[data-where="terminal"] { background: #fef3c7; color: #92400e; }
.pl-where[data-where="routine"] { background: #ede9fe; color: #6d28d9; }
.pl-where[data-where="cloud"] { background: #e0f2fe; color: #075985; }
.pl-blurb { font-size: 12px; color: var(--muted); line-height: 1.35; }
.pl-summary { font-size: 13px; font-weight: 600; color: var(--text); margin-top: auto; }
.pl-meta { font-size: 11px; color: var(--muted); }
.pl-arrow { align-self: center; color: var(--border-strong); font-size: 20px; font-weight: 700; flex: none; }

.pl-lanes { margin-bottom: 24px; }
.pl-lanes h2, .pl-alerts h2 { font-size: 14px; margin: 0 0 10px; }
.pl-lane-strip { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.pl-lane {
  display: flex; flex-direction: column; align-items: center; min-width: 64px;
  background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px;
}
.pl-lane-empty { opacity: 0.5; }
.pl-lane-n { font-size: 18px; font-weight: 700; line-height: 1; }
.pl-lane-l { font-size: 11px; color: var(--muted); margin-top: 3px; white-space: nowrap; }
.pl-lane-arrow { color: var(--border-strong); font-size: 14px; flex: none; }

.pl-alerts { margin-bottom: 22px; }
.pl-alerts ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.pl-alert {
  font-size: 13px; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--border);
  border-left-width: 3px;
}
.pl-alert-red { border-left-color: #dc2626; background: #fef2f2; }
.pl-alert-yellow { border-left-color: #eab308; background: #fefce8; }
.pl-alerts-clear p { font-size: 13px; color: var(--muted); margin: 0; }

.pl-legend { font-size: 11px; color: var(--muted); line-height: 1.6; }
.pl-key { font-weight: 600; }
.pl-key[data-where="cloud"] { color: #075985; }
.pl-key[data-where="terminal"] { color: #92400e; }
.pl-key[data-where="routine"] { color: #6d28d9; }

@media (max-width: 640px) {
  .pl-arrow { display: none; }
  .pl-stage { flex-basis: 100%; }
}

/* ---- WS-7 verification ledger (modal section + card chip) ---- */
.card-verif-line { margin-top: 4px; font-size: 12px; color: var(--muted); }
.verif-claim {
  padding: 8px 12px;
  margin-bottom: 8px;
  border-left: 3px solid var(--border-strong);
  background: var(--surface-alt);
  border-radius: 0 6px 6px 0;
}
.verif-req { margin-bottom: 4px; }
.verif-kind { font-size: 11px; color: var(--muted); margin-left: 4px; }
.verif-conf {
  display: inline-block;
  padding: 1px 8px;
  margin-left: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 999px;
  background: var(--border);
  color: var(--muted);
}
.verif-conf-verified, .verif-grade-info    { background: var(--success-soft); color: var(--success); }
.verif-conf-supported                        { background: var(--accent-soft);  color: var(--accent); }
.verif-conf-inferred, .verif-grade-warning  { background: var(--warn-soft);    color: var(--warn); }
.verif-conf-unsupported, .verif-grade-error { background: var(--danger-soft);  color: var(--danger); }
.verif-evidence { margin: 4px 0 0 12px; padding-left: 12px; font-size: 13px; }
.verif-src { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); }
.verif-resolved { font-size: 11px; color: var(--success); }
.verif-unresolved { font-size: 11px; color: var(--danger); }
.verif-quote { font-size: 12px; margin: 2px 0 4px; }
.verif-gap { font-size: 12px; margin-left: 12px; }
.verif-summary { margin: 0 0 10px; font-size: 13px; }
.verif-violations { margin-top: 10px; padding: 8px 12px; border-left: 3px solid var(--danger); background: var(--danger-soft); border-radius: 0 6px 6px 0; font-size: 13px; }
.verif-violations ul { margin: 4px 0 0; padding-left: 16px; }
.verif-narration { margin-top: 8px; font-size: 13px; }
.verif-audit-due { background: var(--warn-soft); color: var(--warn); border-color: var(--warn); }

/* ---- Sign-in walls page (2026-10-12, modules/walls.js) ---- */
.walls-section {
  margin-bottom: 24px;
}

.walls-section h2 {
  font-size: 15px;
  margin: 0 0 10px;
}

.wall-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 10px;
}

.wall-row[data-status="account_made"],
.wall-row[data-status="ignored"] {
  background: var(--surface-alt);
}

.wall-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.wall-head strong {
  overflow-wrap: anywhere;
}

.wall-status {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.wall-line {
  font-size: 13px;
  line-height: 1.4;
  margin-top: 4px;
}

.wall-warn {
  color: var(--warn);
}

.wall-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.wall-actions .btn {
  flex: 0 1 auto;
}

.wall-msg {
  font-size: 12px;
  color: var(--danger);
  margin-top: 6px;
}

.wall-msg:empty {
  display: none;
}
