:root {
  --bg: #0b0f14;
  --panel: #121823;
  --panel-2: #161f2e;
  --border: #223049;
  --text: #d9e2ec;
  --text-dim: #8296ab;
  --accent: #35e0b8;
  --accent-dim: #1a7a63;
  --green: #35d07f;
  --blue: #4fa3ff;
  --red: #ff5d5d;
  --orange: #ff9f4a;
  --yellow: #ffd766;
  --gray: #5b6b80;
  --amber: #c9a227;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Roboto, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
}

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

.topbar {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, var(--panel) 0%, var(--bg) 100%);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

.topbar h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.topbar h1 .accent { color: var(--accent); }

.summary-row {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  flex: 1;
}

.stat {
  display: flex;
  flex-direction: column;
  min-width: 64px;
}

.stat-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.stat-label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.stat-ok .stat-value { color: var(--green); }
.stat-error .stat-value { color: var(--red); }
.stat-manual .stat-value { color: var(--gray); }

.btn {
  padding: 8px 14px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  transition: background 0.15s, border-color 0.15s;
}

.btn:hover { background: var(--border); border-color: var(--accent-dim); }

/* Phase 8.4: generic hidden-button rule for role-gated topbar controls (addCompanyBtn/crawlAllBtn/
   extractRequirementsBtn). Every OTHER `.hidden` usage in this file is deliberately scoped to its
   own container class (.add-company-panel.hidden, .cv-panel.hidden, etc.) -- this is the one place
   a bare `.hidden` needs to work on a `.btn`-classed element directly, since applyRoleGating() in
   app.js toggles plain `.hidden` on these buttons with no dedicated wrapper to scope it to. */
.btn.hidden {
  display: none;
}

.btn-crawl-all {
  border-color: var(--accent-dim);
  color: var(--accent);
}

.user-email {
  font-size: 12px;
  color: var(--text-dim);
}

.btn-logout {
  border-color: var(--border);
  color: var(--text-dim);
}

.btn-add-company {
  border-color: var(--border);
  color: var(--text);
}

.btn-crawl-now {
  padding: 5px 10px;
  font-size: 12px;
}

.btn-add-company-submit {
  border-color: var(--accent-dim);
  color: var(--accent);
}

.add-company-panel {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.add-company-panel.hidden {
  display: none;
}

.add-company-form {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 16px;
}

.add-company-form .form-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 200px;
}

.add-company-form .form-row-actions {
  flex: 0 0 auto;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding-top: 18px;
}

.add-company-form label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.add-company-form input[type="text"],
.add-company-form input[type="url"] {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 13px;
}

.form-help {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.4;
}

.add-company-msg {
  font-size: 12px;
}

.add-company-msg-success { color: var(--green); }
.add-company-msg-info { color: var(--amber); }
.add-company-msg-error { color: var(--red); }
.add-company-msg-pending { color: var(--text-dim); }

main {
  padding: 16px 20px 40px;
  max-width: 1200px;
  margin: 0 auto;
}

main.hidden {
  display: none;
}

.company-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}

.company-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.company-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

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

.status-pill {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 700;
  white-space: nowrap;
}

.status-ok { background: rgba(53, 208, 127, 0.15); color: var(--green); }
.status-error { background: rgba(255, 93, 93, 0.15); color: var(--red); }
.status-manual { background: rgba(91, 107, 128, 0.2); color: var(--gray); }
.status-unconfigured { background: rgba(201, 162, 39, 0.18); color: var(--amber); }
.status-idle { background: rgba(91, 107, 128, 0.15); color: var(--text-dim); }
.status-running {
  background: rgba(79, 163, 255, 0.18);
  color: var(--blue);
  animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.progress-track {
  height: 5px;
  background: var(--panel-2);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.progress-fill {
  height: 100%;
  background: var(--blue);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.progress-fill.indeterminate {
  width: 40% !important;
  animation: indeterminate 1.1s ease-in-out infinite;
}

@keyframes indeterminate {
  0% { margin-left: -40%; }
  100% { margin-left: 100%; }
}

.company-card-body {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 12px;
  color: var(--text-dim);
}

.job-count-badge {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
}

.company-card-body-main {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

/* Shown only when a company's high+medium count differs from its raw total -- a large employer
   that posts its entire catalog (not just tech/security roles) through one board can have a raw
   total in the hundreds while only a few are relevant; this makes that split legible instead of
   the raw total reading as a data-quality problem. */
.job-count-relevant {
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 600;
}

.manual-note {
  font-size: 12px;
  color: var(--text-dim);
  font-style: italic;
  line-height: 1.4;
}

.company-card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.careers-link {
  font-size: 12px;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-section {
  margin-bottom: 28px;
}

.chart-section h2, .filter-bar + .job-list::before {
  font-size: 14px;
  color: var(--text-dim);
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.chart {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

.chart-label {
  width: 120px;
  flex-shrink: 0;
  font-size: 12px;
  color: var(--text-dim);
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-bar-track {
  flex: 1;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  height: 16px;
  overflow: hidden;
}

.chart-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
  border-radius: 4px;
}

.chart-count {
  min-width: 30px;
  font-size: 12px;
  color: var(--text-dim);
  text-align: right;
  white-space: nowrap;
}

/* The raw total half of a "N / M" relevant/total chart-count label -- de-emphasized vs. the
   relevant count, which is the number that actually matters. */
.chart-count-total {
  opacity: 0.6;
}

/* --- metrics charts grid (trend / priority / source / match histogram) ---------------------- */

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}

.metric-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  min-width: 0;
}

.metric-card h2 {
  font-size: 13px;
  color: var(--text-dim);
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metric-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* 1) trend-over-time */
.trend-svg {
  width: 100%;
  height: 90px;
  display: block;
}

.trend-area {
  fill: rgba(53, 224, 184, 0.12);
  stroke: none;
}

.trend-line {
  fill: none;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.trend-line-total { stroke: var(--accent); }
.trend-line-high { stroke: var(--red); }

.trend-axis {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-dim);
}

.trend-legend,
.priority-legend,
.source-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 12px;
  color: var(--text-dim);
}

.trend-legend-item,
.priority-legend-item,
.source-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.trend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.trend-dot-total { background: var(--accent); }
.trend-dot-high { background: var(--red); }

.trend-single {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
}

.trend-single-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.trend-single-note {
  font-size: 11px;
  color: var(--text-dim);
  font-style: italic;
}

/* 2) priority breakdown segmented bar */
.priority-bar {
  display: flex;
  height: 22px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--panel-2);
}

.priority-seg {
  height: 100%;
  transition: width 0.3s ease;
}

.priority-seg-high { background: var(--red); }
.priority-seg-medium { background: var(--yellow); }
.priority-seg-low { background: var(--gray); }

.priority-swatch,
.source-swatch {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 3px;
}

.priority-swatch-high { background: var(--red); }
.priority-swatch-medium { background: var(--yellow); }
.priority-swatch-low { background: var(--gray); }

/* 3) source breakdown (reuses .chart / .chart-row from the per-company chart) */
.source-row .chart-label {
  width: 100px;
}

.source-tag {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 1px 6px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}

.source-tag-agg {
  color: var(--blue);
  border: 1px solid var(--blue);
}

.source-tag-direct {
  color: var(--text-dim);
  border: 1px solid var(--border);
}

.source-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
  border-radius: 4px;
}

.source-bar-fill-agg {
  background: linear-gradient(90deg, rgba(79, 163, 255, 0.5), var(--blue));
}

.source-swatch-direct { background: var(--accent); }
.source-swatch-agg { background: var(--blue); }

.source-more {
  font-size: 11px;
  color: var(--text-dim);
  font-style: italic;
}

/* 4) match-score histogram (vertical columns) */
.match-hist {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  height: 120px;
}

.match-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
  justify-content: flex-end;
}

.match-col-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}

.match-col-track {
  width: 100%;
  flex: 1;
  display: flex;
  align-items: flex-end;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 4px 4px 0 0;
  overflow: hidden;
  min-height: 0;
}

.match-col-fill {
  width: 100%;
  border-radius: 4px 4px 0 0;
  transition: height 0.3s ease;
  min-height: 2px;
}

.match-col-low { background: var(--red); }
.match-col-medium { background: var(--yellow); }
.match-col-high { background: var(--green); }

.match-col-label {
  font-size: 10px;
  color: var(--text-dim);
  white-space: nowrap;
}

.match-hist-foot {
  font-size: 11px;
  color: var(--text-dim);
  text-align: right;
}

/* 5) priority share donut (reuses priority-swatch-*/priority-legend-* from the segmented bar above
   -- same color mapping for the same concept, just a different chart shape) */
.pie-wrap {
  display: flex;
  justify-content: center;
}

.pie-svg {
  width: 140px;
  height: 140px;
  display: block;
}

.pie-seg {
  fill: none;
  transition: stroke-dasharray 0.3s ease;
}

.pie-seg-high { stroke: var(--red); }
.pie-seg-medium { stroke: var(--yellow); }
.pie-seg-low { stroke: var(--gray); }

.pie-center-total {
  fill: var(--text);
  font-size: 22px;
  font-weight: 700;
}

.pie-center-label {
  fill: var(--text-dim);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.pie-legend-pct {
  color: var(--text-dim);
  opacity: 0.8;
}

/* 6) per-requirement-category line trend (reuses .trend-svg/.trend-axis/.trend-legend/.trend-dot
   from the "Jobs over time" chart -- same inline-SVG polyline technique, up to CATEGORY_TREND_TOP_N
   series). Distinct colors per category, reusing this file's existing palette variables rather than
   inventing new hex values. */
.cat-line-tool { stroke: var(--accent); }
.cat-line-certification { stroke: var(--blue); }
.cat-line-experience { stroke: var(--orange); }
.cat-line-language { stroke: var(--green); }
.cat-line-soft_skill { stroke: var(--yellow); }
.cat-line-domain_knowledge { stroke: var(--gray); }

.trend-dot.cat-line-tool { background: var(--accent); }
.trend-dot.cat-line-certification { background: var(--blue); }
.trend-dot.cat-line-experience { background: var(--orange); }
.trend-dot.cat-line-language { background: var(--green); }
.trend-dot.cat-line-soft_skill { background: var(--yellow); }
.trend-dot.cat-line-domain_knowledge { background: var(--gray); }

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.filter-bar select,
.filter-bar input[type="text"] {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 13px;
}

.filter-bar input[type="text"] {
  flex: 1;
  min-width: 160px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-dim);
}

.job-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.job-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
}

.job-company {
  font-size: 12px;
  color: var(--text-dim);
  width: 100px;
  flex-shrink: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-title {
  flex: 1;
  min-width: 160px;
  font-weight: 600;
  font-size: 13px;
}

.job-location {
  font-size: 12px;
  color: var(--text-dim);
  min-width: 100px;
}

.priority-chip {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.priority-high { background: rgba(255, 93, 93, 0.18); color: var(--red); }
.priority-medium { background: rgba(255, 215, 102, 0.18); color: var(--yellow); }
.priority-low { background: rgba(91, 107, 128, 0.2); color: var(--gray); }

/* Phase 5.1: salary badge. Same chip shape as .priority-chip/.match-chip; reuses the accent var
   (teal) to read as a positive "here's the money" signal. Only NoFluffJobs rows render it, so it
   adds nothing to any other row. Shared by the job list row and the vacancy detail header. */
.job-salary {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: rgba(53, 224, 184, 0.12);
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

/* Phase 5.2: APPROXIMATE (computed) salary badge, deliberately DISTINCT from the solid accent-filled
   real .job-salary above -- a muted dashed outline with no accent fill + a leading "~" so a glance
   can never mistake a market approximation for a real posted number. Detail page only (never on the
   compact list rows). Reuses existing palette vars (no new colors). Wraps on narrow viewports (the
   basis caption is long); only the amount stays unbreakable. */
.job-salary-estimate {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  background: transparent;
  border: 1px dashed var(--border);
  padding: 2px 8px;
  border-radius: 999px;
  white-space: normal;
}
.job-salary-estimate-amount {
  white-space: nowrap;
}
.job-salary-estimate-basis {
  font-weight: 400;
  color: var(--gray);
}

/* Phase 7.2: reconciliation link — an aggregator posting whose employer matches a real tracked
   company. A muted, clearly-secondary chip (dashed outline, no accent fill) that reads as a quiet
   "also tracked as X" signpost, not a primary action; turns accent on hover/focus like the other
   link affordances. Reuses existing palette vars; only shown on the ~1% of rows that match. Shared
   by the compact job row and the vacancy detail header. */
.resolved-company-link {
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  background: transparent;
  border: 1px dashed var(--border);
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
  cursor: pointer;
}
.resolved-company-link:hover,
.resolved-company-link:focus-visible {
  color: var(--accent);
  border-color: var(--accent-dim);
}

.oncall-icon {
  font-size: 13px;
  color: var(--orange);
  cursor: default;
}

.job-seen {
  font-size: 11px;
  color: var(--text-dim);
  min-width: 64px;
  text-align: right;
}

.empty-state {
  text-align: center;
  color: var(--text-dim);
  padding: 24px;
  font-size: 13px;
}

/* --- "Load more" pagination control at the bottom of the job list -------------------------- */

.load-more-row {
  display: flex;
  justify-content: center;
  margin-top: 8px;
}

.btn-load-more {
  border-color: var(--accent-dim);
  color: var(--accent);
  min-width: 240px;
  padding: 9px 16px;
}

.btn-cv {
  border-color: var(--accent-dim);
  color: var(--accent);
}

.btn-profile {
  border-color: var(--border);
  color: var(--text);
}

.btn-requirements {
  border-color: var(--border);
  color: var(--text);
}

/* --- CV panel ---------------------------------------------------------------------------- */

.cv-panel {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.cv-panel.hidden {
  display: none;
}

.cv-panel-inner {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cv-status-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.cv-status-empty {
  font-size: 12px;
  color: var(--text-dim);
  font-style: italic;
  flex: 1;
  min-width: 200px;
}

.cv-status-filled {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 200px;
}

.cv-status-filled.hidden {
  display: none;
}

.cv-status-empty.hidden {
  display: none;
}

.cv-status-filename {
  font-weight: 600;
  font-size: 13px;
}

.cv-status-meta {
  font-size: 11px;
  color: var(--text-dim);
}

.cv-status-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.btn-score-all {
  border-color: var(--accent-dim);
  color: var(--accent);
  white-space: nowrap;
}

.score-all-msg {
  font-size: 12px;
  color: var(--text-dim);
}

.cv-input-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 16px;
}

.cv-input-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 200px;
}

.cv-input-col-grow {
  flex: 1;
}

.cv-input-sep {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  align-self: center;
  padding-top: 18px;
}

.cv-input-col label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.cv-input-col input[type="file"] {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 12px;
}

.cv-input-col textarea {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
}

/* --- Profile section (suggestions list + live CV view) -------------------------------------- */

.profile-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 20px 40px;
}

.profile-section.hidden {
  display: none;
}

.profile-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.profile-toolbar h2 {
  margin: 0;
  font-size: 18px;
  flex: 1;
}

.btn-profile-close {
  border-color: var(--border);
  color: var(--text-dim);
}

.generate-suggestions-msg {
  font-size: 12px;
  color: var(--text-dim);
}

.profile-columns {
  display: flex;
  align-items: flex-start;
  gap: 18px;
}

.profile-col {
  flex: 1;
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
}

.profile-col h3 {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.profile-col-suggestions {
  max-height: 75vh;
  overflow-y: auto;
}

.profile-col-cv {
  max-height: 75vh;
  overflow-y: auto;
}

.profile-cv-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.profile-cv-head h3 {
  margin: 0;
}

.btn-export-pdf {
  border-color: var(--accent-dim);
  color: var(--accent);
  font-size: 12px;
  padding: 5px 10px;
}

.profile-cv-body {
  word-wrap: break-word;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
}

.profile-cv-body .cv-name {
  margin: 0 0 4px;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--text);
}

.profile-cv-body .cv-contact {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--text-dim);
}

.profile-cv-body .cv-contact-sep {
  color: var(--border);
}

.profile-cv-body .cv-header-rule {
  border-bottom: 2px solid var(--accent-dim);
  margin-bottom: 12px;
}

.profile-cv-body .cv-section {
  margin: 18px 0 8px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--accent);
  border-bottom: 1px solid var(--border);
  padding-bottom: 4px;
}

.profile-cv-body .cv-section:first-child {
  margin-top: 0;
}

.profile-cv-body .cv-role {
  margin: 10px 0 2px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.profile-cv-body .cv-dates {
  margin: 0 0 6px;
  font-size: 12px;
  font-style: italic;
  color: var(--text-dim);
}

.profile-cv-body .cv-line {
  margin: 0 0 8px;
}

.profile-cv-body .cv-bullets {
  margin: 0 0 8px;
  padding-left: 18px;
}

.profile-cv-body .cv-bullets li {
  margin-bottom: 4px;
}

/* --- Market Requirements section (posting-requirements market aggregate) --------------------- */

.requirements-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 20px 40px;
}

.requirements-section.hidden {
  display: none;
}

.requirements-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.requirements-toolbar h2 {
  margin: 0;
  font-size: 18px;
  flex: 1;
}

.btn-requirements-close {
  border-color: var(--border);
  color: var(--text-dim);
}

.requirements-coverage {
  margin-bottom: 18px;
}

.requirements-coverage-note {
  font-size: 13px;
  color: var(--text-dim);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  line-height: 1.5;
}

.requirements-coverage-note strong {
  color: var(--text);
}

.requirements-coverage-partial {
  border-color: var(--amber);
}

.requirements-coverage-empty {
  border-color: var(--border);
}

.requirements-coverage-complete {
  border-color: var(--accent-dim);
}

.requirements-coverage-sub {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-dim);
}

.requirements-body {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.requirement-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  min-width: 0;
}

.requirement-card-title {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.requirement-card-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 8px;
  text-transform: none;
  letter-spacing: 0;
}

.requirement-card-empty {
  padding: 12px;
  text-align: left;
}

.requirement-label {
  width: 160px;
}

.requirement-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
  border-radius: 4px;
}

.requirement-more {
  margin-top: 8px;
}

.requirements-empty {
  grid-column: 1 / -1;
  line-height: 1.6;
}

/* --- Discovery queue (Phase 7.4) ------------------------------------------------------------- */
/* Employers seen only on aggregator boards, not yet tracked. A sibling analytics page of Market
   Requirements (reuses .requirements-section for page width/padding + .requirements-toolbar), so it
   stays in the same dark-theme visual language — a flat ranked list of one row per employer, not the
   2-column card grid. No new color palette; existing vars only. */
.discovery-header {
  font-size: 14px;
  color: var(--text-dim);
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
  line-height: 1.5;
}

.discovery-header strong {
  color: var(--text);
  font-size: 16px;
}

.discovery-header-sub {
  color: var(--text-dim);
}

.discovery-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.discovery-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  min-width: 0;
}

.discovery-name {
  flex: 0 0 240px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.discovery-count {
  flex: 0 0 auto;
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
}

.discovery-sources {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.discovery-source {
  font-size: 11px;
  color: var(--blue);
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 8px;
  white-space: nowrap;
}

.discovery-example {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 12px;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: right;
}

.discovery-example-plain {
  color: var(--text-dim);
}

.discovery-more {
  margin-top: 10px;
}

.discovery-empty {
  line-height: 1.6;
}

/* Phase 7.5: per-row promote action — a "Track this company" button (opens the + Add company panel
   pre-filled) plus a "search" link (Google "<company> careers" fallback). Button reuses the same
   pill shape as .resolved-company-link (Phase 7.2) so it sits consistently in the dark theme. */
.discovery-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.discovery-track-btn {
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  background: transparent;
  border: 1px dashed var(--border);
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
  cursor: pointer;
}
.discovery-track-btn:hover,
.discovery-track-btn:focus-visible {
  color: var(--accent);
  border-color: var(--accent-dim);
}

.discovery-search-link {
  font-size: 11px;
  color: var(--blue);
  white-space: nowrap;
  text-decoration: none;
}
.discovery-search-link:hover,
.discovery-search-link:focus-visible {
  text-decoration: underline;
}

/* --- Skill Gaps headline card (Phase 4.3) ---------------------------------------------------- */
/* A read-side analytic that sits ABOVE the per-category .requirement-card grid: the top market
   requirements NOT present in the user's CV/profile. Deliberately styled as a distinct, headline
   analytic (accent left-border + subtle accent tint) so it stands out from the per-category cards
   below it, while each gap row reuses the shared .chart-row / .chart-bar-track / .chart-count
   bar language (not redefined here). */
.skill-gaps-body {
  margin-bottom: 18px;
}

.skill-gaps-card {
  background: linear-gradient(90deg, rgba(53, 224, 184, 0.07), var(--panel) 55%);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 16px 18px;
}

.skill-gaps-title {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.skill-gaps-subtitle {
  margin: 0 0 14px;
  font-size: 12px;
  color: var(--text-dim);
}

/* Small category-label tag on each gap row (prettyCategoryLabel output). Accent-tinted pill, sits
   between the requirement label and the bar track. */
.skill-gap-cat {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 600;
  color: var(--accent);
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 8px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
}

/* --- Company name link on the main dashboard (Phase 2.2) ------------------------------------- */

.company-name-link {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  text-align: left;
  color: var(--text);
  cursor: pointer;
}

.company-name-link:hover,
.company-name-link:focus-visible {
  color: var(--accent);
  text-decoration: underline;
}

/* --- Company detail section (Phase 2.1/2.2) --------------------------------------------------- */

.company-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 20px 40px;
}

.company-section.hidden {
  display: none;
}

.company-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.company-name-heading {
  margin: 0;
  font-size: 18px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.company-card-section {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 18px;
}

.company-card-section-title {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.company-subsection-title {
  margin: 16px 0 10px;
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* Header card: logo + name + careers link. */
.company-header-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.company-header-logo-wrap {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  position: relative;
}

.company-header-logo {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  object-fit: contain;
  background: var(--panel-2);
  border: 1px solid var(--border);
}

.company-header-logo-fallback {
  position: absolute;
  inset: 0;
  width: 56px;
  height: 56px;
  border-radius: 10px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
}

.company-header-meta {
  min-width: 0;
}

.company-header-name {
  margin: 0 0 4px;
  font-size: 16px;
}

.company-header-careers {
  font-size: 12px;
  word-break: break-all;
}

.company-header-careers-missing {
  font-size: 12px;
  color: var(--text-dim);
  font-style: italic;
}

/* Vacancy list: reuses .job-list/.job-row from the main dashboard job list verbatim. */
.company-vacancy-list {
  margin-top: 4px;
}

/* Hiring-activity card: trend chart (reuses .metric-body/.trend-* styles) + events list. */
.company-trend-chart {
  margin-bottom: 4px;
}

.company-event-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.company-event-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 6px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  font-size: 12px;
}

.company-event-icon {
  width: 16px;
  text-align: center;
  font-weight: 700;
}

.company-event-appeared .company-event-icon { color: var(--green); }
.company-event-disappeared .company-event-icon { color: var(--red); }

.company-event-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.company-event-type {
  color: var(--text-dim);
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.4px;
  white-space: nowrap;
}

.company-event-when {
  color: var(--text-dim);
  font-size: 11px;
  white-space: nowrap;
  min-width: 56px;
  text-align: right;
}

.company-event-more {
  margin-top: 4px;
}

/* Requirements card: same grid as the Market Requirements page, scoped inside this one card. */
.company-requirements-body {
  grid-template-columns: repeat(2, 1fr);
}

.company-not-found {
  padding: 40px 20px;
}

/* --- Vacancy detail section (Phase 3.1/3.2) --------------------------------------------------
   Same top-level section-swap skeleton as .company-section/.requirements-section: max-width
   centered column, toolbar with a back button + heading, body stacked into cards. */

.vacancy-section {
  max-width: 900px;
  margin: 0 auto;
  padding: 16px 20px 40px;
}

.vacancy-section.hidden {
  display: none;
}

.vacancy-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.vacancy-title-heading {
  margin: 0;
  font-size: 18px;
  flex: 1;
  min-width: 0;
}

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

/* Reuses .company-card-section/.company-card-section-title for every card in this body
   (header meta, description, requirements, match, actions) -- same visual language, no
   duplicate card styling needed. */

.vacancy-header-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
}

.vacancy-header-company {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}

.vacancy-header-company:hover,
.vacancy-header-company:focus-visible {
  color: var(--accent);
  text-decoration: underline;
}

.vacancy-header-location {
  font-size: 13px;
  color: var(--text-dim);
}

.vacancy-apply-link {
  margin-left: auto;
  font-size: 13px;
  font-weight: 600;
}

.vacancy-superseded-banner {
  background: rgba(255, 215, 102, 0.1);
  border: 1px solid var(--amber);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.vacancy-superseded-banner strong {
  color: var(--yellow);
}

.vacancy-description-text {
  white-space: pre-wrap;
  word-wrap: break-word;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
  margin: 0;
}

.vacancy-requirements-body {
  grid-template-columns: repeat(2, 1fr);
}

.vacancy-match-score-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.vacancy-match-reasoning {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
  word-wrap: break-word;
  margin: 0 0 12px;
}

.vacancy-match-lists {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.vacancy-match-list-title {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.vacancy-match-list {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.6;
}

.vacancy-match-list li {
  margin-bottom: 4px;
}

.vacancy-actions-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.vacancy-not-found {
  padding: 40px 20px;
}

/* --- print / "Export as PDF" ------------------------------------------------------------------
   window.print() (see exportCvPdfBtn in app.js) hands off to the browser's own print dialog,
   which every major browser lets you target at "Save as PDF" -- no server-side PDF rendering
   needed. These rules isolate #profileCvBody (visibility, not display, so nothing's layout shifts
   before the browser captures the page) and restyle it black-on-white, since the rest of the app
   is a dark theme that would otherwise print as a wall of ink. */
@media print {
  @page {
    margin: 16mm 15mm;
  }
  /* html/body themselves aren't matched by "body *", and their dark-theme background would
     otherwise paint the rest of the page below the (shorter) absolutely-positioned CV content —
     confirmed by actually rendering the exported PDF to an image, not just a browser screenshot. */
  html,
  body {
    background: #fff !important;
  }
  body * {
    visibility: hidden;
  }
  #profileCvBody,
  #profileCvBody * {
    visibility: visible;
  }
  #profileCvBody {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    background: #fff;
    color: #1a1a1a;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 10.5pt;
    line-height: 1.45;
  }
  /* Every structured piece needs an explicit print override -- each already carries its own
     dark-theme `color` (accent/text/text-dim custom properties) with higher selector specificity
     than the plain `#profileCvBody` rule above, so without this they print in their on-screen
     (light-on-dark) colors, unreadable on a white page. */
  /* Phase 6.1 colour redesign: a restrained navy/steel-blue accent (#1e4976 — a dark, desaturated
     "corporate/legal document" blue) anchors ONLY the structural hierarchy elements (name, header
     rule, section headings). Body text, roles and dates stay black/dark-gray so the document reads
     strict and professional, not busy or colourful. */
  .profile-cv-body .cv-name {
    color: #1e4976;
    font-size: 21pt;
    font-family: Georgia, "Times New Roman", serif;
    text-align: center;
    letter-spacing: 1px;
    margin: 0 0 4pt;
  }
  .profile-cv-body .cv-contact {
    color: #48515e;
    font-size: 9.5pt;
    text-align: center;
    margin: 0 0 6pt;
  }
  .profile-cv-body .cv-contact-sep {
    color: #9aa6b5;
  }
  .profile-cv-body .cv-header-rule {
    border-bottom: 1.5pt solid #1e4976;
    margin-bottom: 10pt;
  }
  .profile-cv-body .cv-section {
    color: #1e4976;
    border-bottom: 1pt solid #8aa3c0;
    font-size: 11.5pt;
    letter-spacing: 1.5px;
    margin: 14pt 0 6pt;
    padding-bottom: 2pt;
    page-break-after: avoid;
  }
  .profile-cv-body .cv-role {
    color: #000;
    font-size: 10.5pt;
    margin: 8pt 0 1pt;
    page-break-after: avoid;
  }
  .profile-cv-body .cv-dates {
    color: #4d5a6b;
    font-size: 9pt;
    margin: 0 0 4pt;
    page-break-after: avoid;
  }
  .profile-cv-body .cv-line {
    color: #1a1a1a;
    margin: 0 0 5pt;
  }
  .profile-cv-body .cv-bullets {
    margin: 0 0 6pt;
    padding-left: 14pt;
  }
  .profile-cv-body .cv-bullets li {
    margin-bottom: 2.5pt;
    page-break-inside: avoid;
  }
  /* Restrained accent touch: navy bullet markers while the bullet TEXT stays dark/readable. */
  .profile-cv-body .cv-bullets li::marker {
    color: #1e4976;
  }
}

.suggestion-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.suggestion-card {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.suggestion-card-pending {
  cursor: pointer;
  border-color: var(--accent-dim);
}

.suggestion-card-pending:hover {
  background: var(--border);
}

.suggestion-card-accepted {
  opacity: 0.75;
  border-color: var(--green);
}

.suggestion-card-rejected {
  opacity: 0.6;
  border-color: var(--border);
}

.suggestion-card-stale {
  opacity: 0.75;
  border-color: var(--orange);
}

.suggestion-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.suggestion-card-title {
  font-weight: 600;
  font-size: 13px;
  flex: 1;
  min-width: 0;
}

.suggestion-source-badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.4px;
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.suggestion-source-mine {
  color: var(--blue);
  border-color: var(--blue);
}

.suggestion-source-ai {
  color: var(--text-dim);
}

.suggestion-card-append-label {
  font-weight: 600;
  color: var(--text-dim);
  margin-right: 4px;
}

.suggestion-card-section {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.suggestion-card-rationale {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.4;
}

.suggestion-card-preview {
  font-size: 12px;
  line-height: 1.4;
}

.suggestion-card-preview .orig {
  color: var(--red);
  text-decoration: line-through;
}

.suggestion-card-preview .arrow {
  color: var(--text-dim);
  margin: 0 4px;
}

.suggestion-card-preview .suggested {
  color: var(--green);
}

.suggestion-card-stale-reason {
  font-size: 11px;
  color: var(--orange);
  font-style: italic;
}

.status-pending { background: rgba(79, 163, 255, 0.18); color: var(--blue); }
.status-accepted { background: rgba(53, 208, 127, 0.15); color: var(--green); }
.status-rejected { background: rgba(91, 107, 128, 0.2); color: var(--gray); }
.status-stale { background: rgba(255, 159, 74, 0.18); color: var(--orange); }

.suggestion-modal-rationale {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 12px;
  line-height: 1.4;
}

.suggestion-modal-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.suggestion-modal-field label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.suggestion-modal-original {
  font-size: 13px;
  color: var(--text-dim);
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.suggestion-modal-field textarea {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
}

.btn-suggestion-accept {
  border-color: var(--accent-dim);
  color: var(--accent);
}

.btn-suggestion-reject {
  border-color: var(--border);
  color: var(--red);
}

.btn-suggestion-save {
  border-color: var(--blue);
  color: var(--blue);
}

.btn-add-own {
  border-color: var(--blue);
  color: var(--blue);
}

.suggestion-modal-field input[type="text"] {
  width: 100%;
  box-sizing: border-box;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 7px 9px;
  font-size: 13px;
}

/* --- match chip + score/tailor buttons on job rows ---------------------------------------- */

.match-chip {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
  cursor: default;
}

.match-high { background: rgba(53, 208, 127, 0.18); color: var(--green); }
.match-medium { background: rgba(255, 215, 102, 0.18); color: var(--yellow); }
.match-low { background: rgba(255, 93, 93, 0.18); color: var(--red); }
.match-none { background: rgba(91, 107, 128, 0.2); color: var(--gray); }

.btn-score-job,
.btn-tailor-job,
.btn-job-details {
  padding: 4px 9px;
  font-size: 11px;
  white-space: nowrap;
}

.btn-score-job {
  border-color: var(--accent-dim);
  color: var(--accent);
}

.btn-tailor-job {
  border-color: var(--border);
  color: var(--text-dim);
}

/* Compact per-row affordance into the new vacancy detail page (Phase 3.2). Deliberately NOT the
   same element as .job-title (which must keep pointing externally) -- a separate small button so
   the row never becomes one giant, easy-to-mis-click target alongside the title link, company-name
   link, and score/tailor buttons that already live in the same row. */
.btn-job-details {
  border-color: var(--border);
  color: var(--blue);
}

/* --- tailor modal -------------------------------------------------------------------------- */

.tailor-modal {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 12, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}

.tailor-modal.hidden {
  display: none;
}

.tailor-modal-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  max-width: 720px;
  width: 100%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.tailor-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.tailor-modal-title {
  font-weight: 700;
  font-size: 14px;
}

.tailor-modal-close {
  padding: 2px 10px;
  font-size: 16px;
  line-height: 1;
}

.tailor-modal-body {
  flex: 1;
  overflow-y: auto;
  margin: 0;
  padding: 16px;
  font-family: "Segoe UI", Roboto, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
  color: var(--text);
}

.tailor-modal-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}

@media (max-width: 640px) {
  .topbar { flex-direction: column; align-items: flex-start; }
  .job-company, .job-location, .job-seen { width: auto; min-width: 0; }
  .job-row { flex-direction: column; align-items: flex-start; }
  .chart-label { width: 90px; }
  .metrics-grid { grid-template-columns: 1fr; }
  .source-row .chart-label { width: 80px; }
  .match-col-label { font-size: 9px; }
  .add-company-form { flex-direction: column; }
  .add-company-form .form-row-actions { padding-top: 0; }
  .cv-input-row { flex-direction: column; }
  .cv-input-sep { padding-top: 0; }
  .tailor-modal-box { max-height: 90vh; }
  .profile-columns { flex-direction: column; }
  .profile-col-suggestions, .profile-col-cv { max-height: none; }
  .requirements-body { grid-template-columns: 1fr; }
  .requirement-label { width: 90px; }
  /* Keep the bar readable at phone width: truncate the (sometimes long) category pill rather than
     letting it squeeze the gap bar to nothing. The full label still shows on desktop. */
  .skill-gap-cat { max-width: 96px; overflow: hidden; text-overflow: ellipsis; }
  .skill-gaps-card { padding: 14px; }
  .company-requirements-body { grid-template-columns: 1fr; }
  .company-header-card { flex-direction: column; align-items: flex-start; }
  .company-event-row { flex-wrap: wrap; }
  .company-event-when { text-align: left; min-width: 0; }
  .vacancy-requirements-body { grid-template-columns: 1fr; }
  .vacancy-match-lists { grid-template-columns: 1fr; }
  .vacancy-apply-link { margin-left: 0; }
  /* Discovery rows stack vertically on phone width so the name/count/sources/example never squeeze
     each other into unreadable slivers. */
  .discovery-row { flex-direction: column; align-items: flex-start; gap: 6px; }
  .discovery-name { flex: 0 0 auto; max-width: 100%; }
  .discovery-example { text-align: left; max-width: 100%; }
  /* Phase 7.5: the promote action stacks as its own row item on phone width, its button + search
     link staying side-by-side and wrapping if needed. */
  .discovery-actions { flex-wrap: wrap; max-width: 100%; }
}

/* Job lifecycle (2026-11-24): a posting that vanished from its company's crawl stays in the store as
   history (active:false). When the Status filter shows it, it must never read as a live job: dimmed
   row + red "Removed <date>" chip (same pill shape as .priority-chip) + the seen-window. */
.job-row-removed {
  opacity: 0.72;
  border-style: dashed;
}
.job-row-removed .job-title {
  text-decoration: line-through;
  text-decoration-color: var(--text-dim);
}
.job-removed-chip {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
  color: var(--red);
  border: 1px solid var(--red);
  background: rgba(255, 93, 93, 0.08);
}
.job-seen-removed {
  min-width: 0;
  white-space: nowrap;
}
