/* CivLaunch web MVP. Brand: navy #172A3A, slate #4F7187, orange #D97745.
   Orange carries navy text (white on orange is too low-contrast). Tiers are
   communicated by text and a filled-segment indicator, never by color alone. */

:root {
  --brand-navy: #172a3a;
  --brand-slate: #4f7187;
  --brand-orange: #d97745;

  --bg: #f5f7f9;
  --surface: #ffffff;
  --surface-2: #eef3f6;
  --text: #172a3a;
  --muted: #5b6b78;
  --border: #dce3e8;
  --accent: #4f7187;          /* links, secondary emphasis */
  --accent-strong: #172a3a;   /* labels on tinted panels */
  --accent-soft: #eef3f6;     /* tinted panels, selected rows */
  --cta: #d97745;             /* primary buttons */
  --cta-hover: #e48b5e;
  --cta-text: #172a3a;
  --pill-on-bg: #172a3a;      /* selected branch */
  --pill-on-text: #ffffff;
  --meter-on: #d97745;        /* match-strength bars */
  --focus: #2f6fdf;
  --warn-bg: #fbf3e6;
  --warn-text: #7a4a12;
  --cta-soft: #fbeee6;        /* warm tint for callouts */
  --band-from: #172a3a;       /* hero band: navy into slate */
  --band-to: #2c4d66;
  --band-text: #ffffff;
  --band-muted: #d3dfe6;
  --band-accent: #e8935f;     /* orange tuned for large text on navy */
  --footer-bg: #172a3a;
  --footer-text: #c3d1da;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(23, 42, 58, 0.06), 0 4px 16px rgba(23, 42, 58, 0.05);
  --font: "Avenir Next", Avenir, "Segoe UI", Roboto, "Helvetica Neue", Arial, system-ui, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1822;
    --surface: #152331;
    --surface-2: #1d3242;
    --text: #e7ecef;
    --muted: #9aa9b5;
    --border: #2a3e4e;
    --accent: #8fb0c4;
    --accent-strong: #c9d8e1;
    --accent-soft: #1d3242;
    --cta: #e08a5c;
    --cta-hover: #ea9a70;
    --cta-text: #101b24;
    --pill-on-bg: #e7ecef;
    --pill-on-text: #101b24;
    --meter-on: #e08a5c;
    --focus: #7aa7ff;
    --warn-bg: #2d2615;
    --warn-text: #ebcf94;
    --cta-soft: #2e231c;
    --band-from: #13222f;
    --band-to: #1f3a4e;
    --band-muted: #b9cad5;
    --footer-bg: #0a131b;
    --footer-text: #9aa9b5;
    --shadow: none;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }

/* Long unbroken titles (e.g. "Communications/Navigation/Radar") must wrap on narrow phones. */
h1, h2, h3, p, li, .specialty-option span { overflow-wrap: anywhere; }
.specialty-option span { min-width: 0; }

/* Component display rules (e.g. inline-flex buttons) must not override the hidden attribute. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
}

.container { max-width: 780px; margin: 0 auto; padding: 0 16px; }
/* Header, results, and footer use the wide container so results can sit beside
   the filter column; the intro, mode tabs, and forms keep a readable measure. */
.container-wide { max-width: 1120px; }

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

a { color: var(--accent); }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

.skip-link {
  position: absolute; left: 16px; top: -48px;
  background: var(--surface); color: var(--text); padding: 8px 12px; border-radius: var(--radius-sm);
  z-index: 10;
}
.skip-link:focus { top: 12px; }

/* Header */
.site-header { border-bottom: 1px solid var(--border); background: var(--surface); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; text-decoration: none; color: var(--text); }
.brand-mark { width: 40px; height: 38px; flex: none; }
.brand-mark .mark-bar { fill: var(--brand-orange); }
.brand-mark .mark-arrow { fill: var(--brand-slate); }
@media (prefers-color-scheme: dark) { .brand-mark .mark-arrow { fill: var(--accent); } }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-weight: 600; font-size: 1.45rem; letter-spacing: -0.01em; color: var(--text); }
.brand-tagline { font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); margin-top: 3px; }

/* Hero: a navy band behind the intro and tabs. The band stops short of the
   bottom so the finder panel overlaps its edge. */
.hero {
  background:
    radial-gradient(ellipse 60% 70% at 85% 0%, rgba(217, 119, 69, 0.18), transparent 70%) top / 100% calc(100% - 96px) no-repeat,
    linear-gradient(135deg, var(--band-from) 0%, var(--band-to) 100%) top / 100% calc(100% - 96px) no-repeat;
}
.intro { padding: 48px 0 28px; text-align: center; color: var(--band-text); }
.intro h1 { font-size: clamp(1.7rem, 4.4vw, 2.5rem); font-weight: 650; line-height: 1.18; letter-spacing: -0.02em; margin: 0 auto 14px; max-width: 22ch; }
.intro h1 .accent { color: var(--band-accent); }
.lede { color: var(--band-muted); font-size: 1.05rem; margin: 0 auto; max-width: 60ch; }
.hero .notice { margin-bottom: 12px; }

.notice { background: var(--warn-bg); color: var(--warn-text); padding: 12px 16px; border-radius: var(--radius-sm); }

/* Mode tabs: match by specialty, or search every job */
.mode-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 12px; }
.mode-tab {
  display: flex; flex-direction: column; gap: 2px; text-align: left; font: inherit; cursor: pointer;
  color: var(--band-text); background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius); padding: 12px 16px; position: relative; overflow: hidden;
}
.mode-tab:hover { background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.4); }
.mode-tab[aria-selected="true"] { background: var(--surface); color: var(--text); border-color: var(--surface); }
/* Orange bar marks the active tab, in addition to its filled background. */
.mode-tab[aria-selected="true"]::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--cta); }
.mode-tab-title { font-weight: 650; font-size: 1rem; }
.mode-tab-sub { color: var(--band-muted); font-size: 0.85rem; }
.mode-tab[aria-selected="true"] .mode-tab-sub { color: var(--muted); }
@media (prefers-color-scheme: dark) {
  /* Keep the selected tab the most prominent on the dark band. */
  .mode-tab { background: rgba(255, 255, 255, 0.03); border-color: rgba(255, 255, 255, 0.14); color: var(--band-muted); }
  .mode-tab[aria-selected="true"] { background: var(--surface-2); border-color: var(--surface-2); color: var(--text); }
}

/* Search form */
.search-panel { padding: 20px 24px; }
.search-fields { display: grid; grid-template-columns: minmax(0, 1fr) 220px auto; gap: 12px; align-items: end; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { font-weight: 650; font-size: 0.95rem; }
.search-fields input[type="search"] { min-height: 48px; }
.search-submit { min-height: 48px; }

/* Finder panel */
.panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 8px 24px;
}
.step { border: 0; margin: 0; padding: 20px 0; min-width: 0; }
.step + .step { border-top: 1px solid var(--border); }
.step legend, .step-label {
  display: flex; align-items: center; gap: 10px;
  font-weight: 650; font-size: 1.05rem; margin: 0 0 12px; padding: 0;
}
.step-number {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--cta); color: var(--cta-text); font-size: 0.85rem; font-weight: 700;
}
.hint { color: var(--muted); font-size: 0.9rem; margin: 0 0 8px; }

/* Branch choices: radio buttons styled as pills */
/* Branch dropdown (native select for phone pickers and screen readers). */
.select {
  width: 100%; font: inherit; font-size: 1rem; min-height: 48px; padding: 10px 44px 10px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background-color: var(--surface); color: var(--text);
  appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%234F7187' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center; background-size: 12px 8px;
}
.select:hover { border-color: var(--accent); }
.select:invalid, .select option[value=""] { color: var(--muted); }
.select option { color: var(--text); }
@media (prefers-color-scheme: dark) {
  .select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%238FB0C4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
}

/* Specialty search */
input[type="search"] {
  width: 100%; font: inherit; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
}
input[type="search"]:disabled { background: var(--surface-2); color: var(--muted); }
.specialty-list { list-style: none; margin: 4px 0 0; padding: 0; max-height: 320px; overflow-y: auto; border-radius: var(--radius-sm); }
.specialty-list:not(:empty) { border: 1px solid var(--border); }
.specialty-list li + li { border-top: 1px solid var(--border); }
.specialty-option {
  width: 100%; display: flex; gap: 12px; align-items: baseline; text-align: left;
  padding: 10px 14px; background: none; border: 0; font: inherit; color: var(--text); cursor: pointer;
}
.specialty-option:hover { background: var(--surface-2); }
.specialty-option[aria-pressed="true"] { background: var(--accent-soft); }
.specialty-code { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 5.5ch; color: var(--accent); }

/* Selected specialty */
.specialty-card { background: var(--surface-2); border-radius: var(--radius-sm); padding: 16px; margin-bottom: 16px; }
.specialty-meta { margin: 0; color: var(--muted); font-size: 0.875rem; font-weight: 600; letter-spacing: 0.02em; }
.specialty-card h3 { margin: 2px 0 8px; font-size: 1.15rem; }
.specialty-description { margin: 0 0 12px; color: var(--muted); font-size: 0.95rem; }

.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.chips li {
  padding: 3px 10px; border-radius: 999px; font-size: 0.85rem;
  background: var(--surface); border: 1px solid var(--border);
}

/* Buttons */
.button-primary, .button-secondary, .button-link {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 650; border-radius: var(--radius-sm); padding: 11px 20px; cursor: pointer; text-decoration: none;
}
.button-primary { background: var(--cta); color: var(--cta-text); border: 1px solid var(--cta); }
.button-primary:hover { background: var(--cta-hover); border-color: var(--cta-hover); }
.button-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.button-secondary:hover { border-color: var(--accent); }
.button-link { background: var(--cta); color: var(--cta-text); border: 1px solid var(--cta); padding: 9px 16px; }
.button-link:hover { background: var(--cta-hover); border-color: var(--cta-hover); }

/* Results */
.results { padding-top: 32px; padding-bottom: 16px; }
.results-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px 24px; flex-wrap: wrap; }
.results-head .hint { margin: 0; }
.results-tools { display: flex; align-items: center; gap: 12px; }
.sort-label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.9rem; white-space: nowrap; }
.select-compact { width: auto; min-height: 42px; padding: 8px 40px 8px 12px; font-size: 0.95rem; background-position: right 14px center; }
.filters-toggle { min-height: 42px; padding: 8px 16px; }
.filters-count:not(:empty) {
  display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px;
  background: var(--pill-on-bg); color: var(--pill-on-text); font-size: 0.8rem; font-weight: 700;
}

.active-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.active-filter-list { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; }
.filter-chip {
  display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 0.875rem; color: var(--text); cursor: pointer;
  background: var(--accent-soft); border: 1px solid var(--border); border-radius: 999px; padding: 4px 10px 4px 12px;
}
.filter-chip:hover { border-color: var(--accent); }
.filter-chip-x { font-size: 1.1em; line-height: 1; color: var(--muted); }
.link-button {
  background: none; border: 0; padding: 4px 2px; font: inherit; font-size: 0.9rem; font-weight: 650; cursor: pointer;
  color: var(--accent-strong); text-decoration: underline; text-underline-offset: 3px;
}

.results-layout { display: grid; gap: 16px; margin-top: 16px; align-items: start; }
.results-main { min-width: 0; }
.results-main .results-list { margin-top: 0; }

/* Filters: a column beside the results on wide screens, a panel behind the
   Filters button on narrow ones. */
.filters {
  display: none; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 8px 16px;
}
.filters.open { display: block; }
.filters-title { font-size: 1rem; margin: 10px 0 0; padding-bottom: 8px; border-bottom: 3px solid var(--cta); display: inline-block; }
.filter-group { border: 0; margin: 0; padding: 14px 0; min-width: 0; }
.filter-group + .filter-group { border-top: 1px solid var(--border); }
.filter-group legend, .filter-group-label { display: block; font-weight: 650; font-size: 0.95rem; padding: 0; margin-bottom: 6px; }
/* Floating the legend keeps it inside the group instead of on the divider line. */
.filter-group legend { float: left; width: 100%; }
.filter-options { list-style: none; margin: 0; padding: 0; clear: both; }
.filter-option { display: flex; align-items: center; gap: 10px; min-height: 36px; cursor: pointer; font-size: 0.95rem; }
.filter-option input { width: 18px; height: 18px; margin: 0; flex: none; accent-color: var(--brand-navy); cursor: pointer; }
@media (prefers-color-scheme: dark) { .filter-option input { accent-color: var(--accent); } }
.filter-option .filter-label { flex: 1; min-width: 0; }
.filter-count { color: var(--muted); font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.filter-option.is-empty { color: var(--muted); }
.filter-options li.extra { display: none; }
.filter-options.expanded li.extra { display: block; }
.filter-group .select { min-height: 42px; font-size: 0.95rem; }
.filter-more { margin-top: 2px; font-size: 0.875rem; }
/* Employer type-ahead: a text box with a suggestion list beneath it. */
.typeahead { position: relative; }
.typeahead-input {
  width: 100%; font: inherit; font-size: 0.95rem; min-height: 42px; padding: 8px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text);
}
.typeahead-input:hover { border-color: var(--accent); }
.typeahead-list {
  list-style: none; margin: 4px 0 0; padding: 4px 0; max-height: 260px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow);
}
.typeahead-option { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 4px 12px; cursor: pointer; font-size: 0.95rem; }
.typeahead-option:hover, .typeahead-option[aria-selected="true"] { background: var(--accent-soft); }
.typeahead-option .filter-label { flex: 1; min-width: 0; }
.typeahead-empty { padding: 8px 12px; color: var(--muted); font-size: 0.95rem; }
@media (max-width: 560px) { .typeahead-option { min-height: 44px; } }
.filters-done { width: 100%; margin: 4px 0 14px; }

@media (min-width: 960px) {
  .results-layout { grid-template-columns: 264px minmax(0, 1fr); gap: 28px; }
  .results-layout.no-filters { grid-template-columns: minmax(0, 1fr); }
  .filters { display: block; position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; }
  .filters-toggle, .filters-done { display: none; }
}

.callout {
  display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap;
  background: var(--cta-soft); border-left: 4px solid var(--cta); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 12px;
}
.callout p { margin: 0; max-width: 56ch; }
.show-more { margin-top: 4px; }

.job-tags { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; padding: 0; }
.job-tags li { font-size: 0.8rem; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--text); }
.job-tags li.tag-pay { background: var(--accent-soft); font-weight: 650; font-variant-numeric: tabular-nums; }
.filter-hint { margin: 6px 0 0; font-size: 0.8rem; }
.job-tags li.tag-highlight { background: var(--surface); box-shadow: inset 0 0 0 1px var(--cta); font-weight: 650; }
.results h2 { font-size: 1.35rem; margin: 0 0 4px; letter-spacing: -0.01em; }
.results h2:focus { outline: none; }
.empty-state {
  margin: 16px 0; padding: 20px; background: var(--surface); border: 1px dashed var(--border);
  border-radius: var(--radius);
}
.empty-state p { margin: 0 0 16px; max-width: 52ch; }
.results-list { list-style: none; margin: 16px 0; padding: 0; display: grid; gap: 12px; }

.job-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px;
}
.job-card:focus-within { border-color: var(--accent); }
.job-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.job-card h3 { margin: 0; font-size: 1.15rem; line-height: 1.3; }
.job-org { margin: 2px 0 0; color: var(--muted); }
.job-org strong { color: var(--text); font-weight: 600; }
.job-summary { margin: 12px 0 0; font-size: 0.95rem; }

.tier { display: inline-flex; align-items: center; gap: 8px; font-size: 0.85rem; font-weight: 650; white-space: nowrap; }
.tier-bars { display: inline-flex; gap: 3px; }
.tier-bars span { width: 6px; height: 14px; border-radius: 2px; background: var(--border); }
.tier-bars span.on { background: var(--meter-on); }

.why { margin-top: 14px; padding: 12px 14px; background: var(--accent-soft); border-radius: var(--radius-sm); }
.why-label { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent); margin: 0 0 4px; }
.why p { margin: 0; }
.why .chips { margin-top: 10px; }
.why .chips li { background: var(--surface); }
.more-skills, .more-summary { display: none; }
.overlap { color: var(--muted); font-size: 0.875rem; margin-top: 6px !important; }

.flags { margin: 12px 0 0; padding: 0; list-style: none; font-size: 0.875rem; color: var(--warn-text); }
.flags li { display: flex; gap: 6px; }
.flags li::before { content: "!"; font-weight: 800; }

.job-actions { margin-top: 16px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.job-actions .source { color: var(--muted); font-size: 0.8rem; }

/* Static specialty pages (/careers/...): the home page's navy band behind the
   heading, then content sections on the page background. */
.page-hero {
  background:
    radial-gradient(ellipse 60% 70% at 85% 0%, rgba(217, 119, 69, 0.18), transparent 70%),
    linear-gradient(135deg, var(--band-from) 0%, var(--band-to) 100%);
  color: var(--band-text); padding: 20px 0 36px;
}
.page-hero h1 { font-size: clamp(1.6rem, 3.6vw, 2.25rem); font-weight: 650; line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 12px; max-width: 30ch; }
.page-hero .container > h1:first-child { margin-top: 16px; }
.page-eyebrow { margin: 20px 0 6px; color: var(--band-accent); font-weight: 650; font-size: 0.95rem; }
.page-answer { margin: 0; color: var(--band-muted); font-size: 1.05rem; max-width: 70ch; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; margin: 0; padding: 0; font-size: 0.85rem; color: var(--band-muted); }
.breadcrumb li + li::before { content: "›"; margin-right: 4px; }
.breadcrumb a { color: var(--band-text); }
.page-body { padding-top: 8px; }
.page-section { margin-top: 32px; }
.page-section > h2 { font-size: 1.35rem; margin: 0 0 8px; letter-spacing: -0.01em; }
.page-section > h3 { font-size: 1.05rem; margin: 20px 0 10px; }
.page-section > p { max-width: 75ch; }
.page-cta { margin-top: 20px; }
.page-section .results-list { margin-top: 16px; }
.not-found-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.specialty-index { list-style: none; margin: 0; padding: 0; columns: 3 280px; column-gap: 32px; }
.specialty-index li { break-inside: avoid; padding: 4px 0; }
.specialty-index a { color: var(--text); text-decoration: none; }
.specialty-index a:hover { text-decoration: underline; }

/* Footer: a navy band with the brand and notes side by side. */
.site-footer { margin-top: 40px; padding: 28px 0; background: var(--footer-bg); color: var(--footer-text); font-size: 0.85rem; border-top: 4px solid var(--cta); }
.footer-inner { display: grid; grid-template-columns: auto 1fr 1fr auto; gap: 16px 40px; align-items: start; }
.footer-brand { display: flex; align-items: center; gap: 10px; }
.footer-mark { width: 32px; height: 30px; }
.site-footer .brand-name { color: #ffffff; font-size: 1.15rem; }
.site-footer .brand-tagline { color: var(--footer-text); }
.site-footer .brand-mark .mark-arrow { fill: #8fb0c4; }
.site-footer p { margin: 0 0 6px; }
.site-footer p:last-child { margin-bottom: 0; }
.footer-heading { margin: 0 0 6px; color: #ffffff; font-size: 0.85rem; font-weight: 600; }
.site-footer a { color: #ffffff; text-underline-offset: 2px; }
.site-footer a:hover { color: var(--footer-text); }
.footer-social a { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; }
.social-icon { width: 18px; height: 18px; flex: none; }
@media (max-width: 860px) { .footer-inner { grid-template-columns: 1fr; gap: 14px; } }

/* Phones: full-width actions, compact cards, nothing narrower than a thumb. */
@media (max-width: 560px) {
  .intro { padding: 28px 0 20px; }
  .hero { background-size: 100% calc(100% - 64px), 100% calc(100% - 64px); }
  .panel { padding: 4px 16px; }
  .brand-tagline { font-size: 0.62rem; }
  .job-card { padding: 16px; }
  .why { padding: 10px 12px; }
  .why .chips { gap: 4px; margin-top: 8px; }
  .chips li { font-size: 0.8rem; padding: 2px 8px; }
  .job-summary:not(.expanded) {
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden;
  }
  .more-summary {
    display: inline-flex; align-items: center; min-height: 44px; margin: -6px 0 -10px; padding: 0 2px;
    background: none; border: 0; font: inherit; font-size: 0.875rem; font-weight: 650;
    color: var(--accent-strong); text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
  }
  .why .chips:not(.expanded) li.extra { display: none; }
  /* Tags and the "+N more" button share one wrapping row. */
  .shared-skills { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 8px; }
  .shared-skills .chips { display: contents; }
  .more-skills {
    display: inline-flex; align-items: center; min-height: 44px; margin: -10px 0; padding: 0 4px;
    background: none; border: 0; font: inherit; font-size: 0.875rem; font-weight: 650;
    color: var(--accent-strong); text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
  }
  .button-primary, .button-secondary, .job-actions .button-link { width: 100%; }
  .job-actions { gap: 8px; }
  .job-actions .source { width: 100%; text-align: center; }
  .results { padding-top: 24px; }
  .search-panel { padding: 16px; }
  .search-fields { grid-template-columns: 1fr; }
  .mode-tab { padding: 10px 12px; }
  .mode-tab-sub { font-size: 0.8rem; }
  .results-tools { width: 100%; }
  .results-tools .filters-toggle { width: auto; flex: 1; }
  .sort-label { flex: 1; }
  /* The select's own text names the sort, so the visible label gives way on phones. */
  .sort-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .sort-label .select-compact { width: 100%; }
  .filter-option { min-height: 44px; }
  .active-filters .link-button { min-height: 44px; }
  .callout .button-secondary { width: 100%; }
}

@media (prefers-reduced-motion: no-preference) {
  .button-primary, .button-secondary, .button-link, .specialty-option, .mode-tab, .filter-chip { transition: background-color 120ms ease, border-color 120ms ease; }
}
