/* Entalvo, Design 7: fixed light palette with slate and copper accents. */

@font-face { font-family: "Plus Jakarta Sans"; font-weight: 400; font-display: optional; src: url("fonts/plus-jakarta-sans-regular.woff2?v=a2348fbcb366") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 600; font-display: optional; src: url("fonts/plus-jakarta-sans-semibold.woff2?v=73575dacd2fb") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 800; font-display: optional; src: url("fonts/plus-jakarta-sans-extrabold.woff2?v=c31bac004e9d") format("woff2"); }

:root {
  --print-text: #000000;
  --print-border: #aaaaaa;
  color-scheme: light;
  /* Brand */
  --slate: #1e293b;
  --slate-2: #3b4a63;
  --copper: #9a3412;
  --copper-lite: #b4461d;
  --copper-deep: #7c2d12;
  /* Surfaces and text */
  --text: #1e2235;
  --muted: #565b72;
  --bg: #f7f4ef;
  --surface: #ffffff;
  --border: #e4dfd6;
  --input-border: #7b8190;
  --primary: var(--slate);
  --primary-text: #ffffff;
  --link: var(--slate);
  /* Status */
  --ok-bg: #dcf5e7;
  --ok-text: #11643a;
  --warn-bg: #ffedc7;
  --warn-text: #7a4300;
  --urgent-bg: #b45309;
  --urgent-text: #ffffff;
  --error-bg: #ffe1df;
  --error-text: #9b1c1c;
  --new-bg: #e2e8f0;
  --new-text: #1e293b;
  --chip-bg: #eef0f3;
  --chip-text: #4a5263;
  /* Card states */
  --row-new: #fbfaf8;
  --row-changed: #fff6e5;
  --row-changed-line: #f6d38f;
  --row-dismissed: #f3f1ed;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(30, 34, 53, .06), 0 8px 24px rgba(30, 34, 53, .07);

  --skip-shadow-color: #0003;
  --header-shadow-color: rgba(15, 23, 42, .18);
  --header-text: #ffffff;
  --header-muted: rgba(255, 255, 255, .88);
  --header-border: rgba(255, 255, 255, .75);
  --header-hover: rgba(255, 255, 255, .14);
  --button-highlight: rgba(255, 255, 255, .8);
  --button-shadow-color: rgba(30, 34, 53, .08);
  --button-hover-shadow-color: rgba(30, 34, 53, .12);
  --action-highlight: rgba(255, 255, 255, .3);
  --action-shadow-color: rgba(154, 52, 18, .3);
  --button-hover: #faf8f5;
  --disabled-bg: #ebe8e2;
  --disabled-border: #b9b3a8;
  --error-border: #e9aaa5;
  --warn-border: #ecc77a;
  --table-heading-bg: #f3f0ea;
  --place-text: #3f4255;
  --card-border: #eee8de;
  --label-text: var(--muted);
  --title-text: var(--slate);
  --agency-text: var(--copper);
  --action-text: #ffffff;
  --badge-new-bg: var(--slate);
  --badge-new-text: #ffffff;
  --focus: var(--copper);
  --action-focus: var(--slate);
}

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

[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}

a { color: var(--link); text-underline-offset: 3px; }

h1 { font-size: 1.9rem; line-height: 1.2; font-weight: 800; letter-spacing: -.02em; margin: .75rem 0 1rem; }
h2 { font-size: 1.15rem; font-weight: 800; margin: 1.25rem 0 .5rem; }

.muted { color: var(--muted); }

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

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

.skip-link {
  position: absolute;
  left: .5rem;
  top: -4rem;
  padding: .5rem 1rem;
  background: var(--surface);
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  box-shadow: 0 4px 12px var(--skip-shadow-color);
  font-weight: 700;
  z-index: 100;
}
.skip-link:focus { top: .5rem; }

/* Header and layout */

.site-header {
  background: linear-gradient(90deg, var(--slate), var(--slate-2));
  box-shadow: 0 2px 8px var(--header-shadow-color);
}
.site-header, .site-header a { color: var(--header-text); }
.site-header :focus-visible { outline-color: var(--header-text); }
.bar {
  max-width: 80rem;
  margin: 0 auto;
  padding: .75rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem 1rem;
}
.brand { display: inline-flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1.45rem; letter-spacing: -.02em; text-decoration: none; }
.brand img { display: block; }
.org-name, .who { color: var(--header-muted); }
.account {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem 1rem;
}
.who { overflow-wrap: anywhere; }
.site-header .button, .site-header .button-quiet { background: transparent; border-color: var(--header-border); color: var(--header-text); box-shadow: none; }
.site-header .button:hover { background: var(--header-hover); }

.page {
  max-width: 80rem;
  margin: 0 auto;
  padding: 1rem;
}
.site-footer {
  max-width: 80rem;
  margin: 0 auto;
  padding: 1.5rem 1rem;
  color: var(--muted);
  font-size: .88rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  margin: 1rem 0;
}
.narrow { max-width: 30rem; }

/* Buttons: one solid copper call to action per place; everything else is quiet. */

.button {
  display: inline-block;
  min-height: 2.75rem;
  padding: .55rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  box-shadow: inset 0 1px 0 var(--button-highlight), 0 2px 4px var(--button-shadow-color);
}
.button:hover { background: var(--button-hover); box-shadow: 0 4px 10px var(--button-hover-shadow-color); }
.button-primary {
  background: linear-gradient(180deg, var(--copper-lite), var(--copper));
  border-color: var(--copper-deep);
  color: var(--action-text);
  box-shadow: inset 0 1px 0 var(--action-highlight), 0 3px 10px var(--action-shadow-color);
}
.button-primary:hover { background: var(--copper-deep); }
.button-quiet { border-color: transparent; background: transparent; box-shadow: none; }
.button-link { border-color: transparent; background: transparent; box-shadow: none; color: var(--muted); text-decoration: underline; font-weight: 600; }
.button-link:hover { background: transparent; color: var(--text); box-shadow: none; }
.button:disabled {
  background: var(--disabled-bg);
  border-color: var(--disabled-border);
  color: var(--muted);
  box-shadow: none;
  cursor: not-allowed;
}
form.inline { display: inline; margin: 0; }
/* Buttons written without a class (staff forms, demo sign-in) get the standard look. */
button:not(.button) {
  min-height: 2.75rem; padding: .55rem 1.1rem; border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer;
  box-shadow: inset 0 1px 0 var(--button-highlight), 0 2px 4px var(--button-shadow-color);
}
button:not(.button):hover { background: var(--button-hover); }

/* Forms */

.field { display: flex; flex-direction: column; gap: .25rem; margin-bottom: .75rem; }
label { font-weight: 600; }
input:not([type]),
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="date"],
input[type="month"],
input[type="url"],
input[type="tel"],
input[type="datetime-local"],
textarea,
select {
  min-height: 2.75rem;
  padding: .5rem .75rem;
  border: 1px solid var(--input-border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  width: 100%;
}
textarea { resize: vertical; }
input[type="file"] { font: inherit; }
/* Checkboxes stay comfortably tappable beside their labels. */
input[type="checkbox"] { width: 1.25rem; height: 1.25rem; margin: 0 .4rem 0 0; vertical-align: -.2em; accent-color: var(--copper); }

.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: .5rem 1rem;
  align-items: end;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 1rem;
  margin: 1rem 0;
}
.filters .field { margin-bottom: 0; }
.filter-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.filters-disclosure summary { cursor: pointer; font-weight: 600; padding: .5rem 0; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem .75rem;
  margin: 1rem 0;
}
.toolbar .spacer { flex: 1 1 auto; }

/* Alerts and badges */

.alert {
  padding: .75rem 1rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  margin: 0 0 1rem;
}
.alert-success { background: var(--surface); color: var(--text); border-color: var(--ok-text); }
.alert-info { background: var(--new-bg); color: var(--new-text); border-color: var(--new-text); }
.alert-error { background: var(--error-bg); color: var(--error-text); border-color: var(--error-border); }
.alert-warning, .alert-warn { background: var(--warn-bg); color: var(--warn-text); border-color: var(--warn-border); }

.badge {
  display: inline-block;
  padding: .15rem .6rem;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 600;
  line-height: 1.5;
}
.badge-ok { background: var(--ok-bg); color: var(--ok-text); }
.badge-warn { background: var(--warn-bg); color: var(--warn-text); }
.badge-new { background: var(--badge-new-bg); color: var(--badge-new-text); }
.badge-muted { background: var(--chip-bg); color: var(--text); }
@media (forced-colors: active) { .badge { border: 1px solid currentColor; } }
.badges { display: flex; flex-wrap: wrap; gap: .3rem; margin: .3rem 0; }

/* Source health strip */

.health-strip h2 { margin-top: 0; }
.health { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.health-item {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  padding: .6rem .85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left-width: 6px;
  border-radius: var(--radius);
  min-width: 12rem;
}
.health-ok { border-left-color: var(--ok-text); }
.health-gap { border-left-color: var(--warn-text); border-style: dashed; border-left-style: solid; }
.health-name { font-weight: 600; }
.health-detail { font-size: .9rem; color: var(--muted); overflow-wrap: anywhere; }

/* Plain tables (admin pages) */

.count { color: var(--muted); margin: .5rem 0; }
.page pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.team-table { overflow-wrap: normal; word-break: normal; }
.team-table th, .team-table td { padding: .5rem; text-align: left; vertical-align: top; }
.page .team-table button { overflow-wrap: normal; word-break: normal; }
.table-wrap { overflow-x: auto; position: relative; }
table.matches {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.matches th,
.matches td {
  padding: .6rem .8rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
  overflow-wrap: normal;
}
.matches th { background: var(--table-heading-bg); font-size: .88rem; }

/* Staff and team tables: one calm style; :where keeps the opportunity-card rules in charge. */
:where(.table-wrap > table:not(.match-cards)) { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
:where(.table-wrap > table:not(.match-cards)) :is(th, td) { padding: .55rem .75rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
:where(.table-wrap > table:not(.match-cards)) thead th { background: var(--table-heading-bg); font-size: .88rem; }
:where(.table-wrap) td a, :where(.table-wrap) th a, .action-links a { display: inline-block; min-height: 24px; min-width: 24px; padding: 2px 0; }
.action-links { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; margin: .5rem 0 1rem; padding: 0; list-style: none; }
.table-note { font-size: .88rem; color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }

.reasons { margin: 0; padding-left: 1.1rem; }
.reason-chips { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .3rem; }
.reason-chips li { background: var(--chip-bg); color: var(--chip-text); border-radius: 999px; padding: .1rem .6rem; font-size: .8rem; font-weight: 600; }
.empty { background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); padding: 1rem; }

.details-list { display: grid; grid-template-columns: max-content 1fr; gap: .5rem 1.5rem; margin: 0; }
.details-list dt { font-weight: 600; color: var(--muted); }
.details-list dd { margin: 0; overflow-wrap: normal; }

.nowrap, code { white-space: nowrap; }

/* Opportunity cards (dashboard): what, who to submit to, where; then deadline, number, reasons, actions. */

.match-cards .title-link { color: var(--title-text); font-weight: 800; font-size: 1.05rem; }
.match-cards .details { display: inline-block; margin-top: .25rem; font-size: .88rem; color: var(--muted); }
.match-cards .agency, .match-cards .place { position: relative; padding-left: 30px !important; }
.match-cards .agency { color: var(--agency-text); font-weight: 800; font-size: 1.05rem; }
.match-cards .place { color: var(--place-text); font-weight: 600; }
.match-cards .agency::after, .match-cards .place:not(:empty)::after {
  content: "";
  position: absolute;
  left: 0;
  top: .2em;
  width: 21px;
  height: 21px;
  background: currentColor;
  -webkit-mask: no-repeat center / contain;
  mask: no-repeat center / contain;
}
.match-cards .agency::after { -webkit-mask-image: url("brand/agency.svg?v=d6d35dafe8d3"); mask-image: url("brand/agency.svg?v=d6d35dafe8d3"); }
.match-cards .place:not(:empty)::after { -webkit-mask-image: url("brand/pin.svg?v=c5a6d9ac5ace"); mask-image: url("brand/pin.svg?v=c5a6d9ac5ace"); }
.match-cards td[data-label="Due"] { font-weight: 600; color: var(--text); }
.match-cards td[data-label="Due"] .badge-warn { background: var(--urgent-bg); color: var(--urgent-text); }
.was { display: block; margin-top: .3rem; font-size: .85rem; font-weight: 600; color: var(--warn-text); text-decoration: line-through; text-decoration-thickness: 1px; }
.match-cards td[data-label="Number"] { color: var(--muted); font-size: .92rem; }
.match-cards td[data-label="Work type"] { display: none; }
.match-cards .row-new { background: var(--row-new); }
.match-cards .row-changed { background: linear-gradient(90deg, var(--row-changed), var(--surface) 45%); border-color: var(--row-changed-line) !important; }
.match-cards .row-dismissed { background: var(--row-dismissed); color: var(--muted); }

@media (min-width: 48.01em) {
  table.match-cards { border: 0; background: transparent; }
  .match-cards thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .match-cards tbody { display: grid; gap: 14px; }
  .match-cards tr {
    display: grid;
    grid-template-columns: minmax(16rem, 1fr) 15rem 11rem 15rem;
    gap: 8px 26px;
    padding: 18px 22px;
    align-items: start;
    background: var(--surface);
    border: 1px solid var(--card-border);
    border-radius: 18px;
    box-shadow: var(--shadow);
  }
  .match-cards td { display: block; border: 0; padding: 0; min-width: 0; }
  .match-cards td::before { content: attr(data-label); display: block; font-size: .78rem; font-weight: 600; color: var(--label-text); margin-bottom: 2px; }
  .match-cards td[data-label="Title"]::before, .match-cards td[data-label="Actions"]::before,
  .match-cards .agency::before, .match-cards .place::before { display: none; }
  .match-cards td[data-label="Title"] { grid-column: 1; grid-row: 1; }
  .match-cards .agency { grid-column: 1; grid-row: 2; }
  .match-cards .place { grid-column: 1; grid-row: 3; }
  .match-cards td[data-label="Due"] { grid-column: 2; grid-row: 1 / span 3; text-align: center; }
  .match-cards td[data-label="Number"] { grid-column: 3; grid-row: 1; text-align: center; }
  .match-cards td[data-label="Why it matched"] { grid-column: 3; grid-row: 2 / span 2; text-align: center; }
  .match-cards td[data-label="Why it matched"] .reason-chips { justify-content: center; }
  .match-cards td[data-label="Actions"] { grid-column: 4; grid-row: 1 / span 3; display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
  .match-cards td[data-label="Actions"] form.inline { display: block; }
  .match-cards td[data-label="Actions"] .button { width: 100%; }
}

/* Phone width: each opportunity becomes a stacked card; plain tables scroll. */

@media (max-width: 48em) {
  .match-cards thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
  table.match-cards { border: 0; background: transparent; }
  .match-cards, .match-cards tbody { display: block; width: 100%; }
  .match-cards tr {
    display: flex;
    flex-direction: column;
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    margin-bottom: .9rem;
    padding: .9rem;
  }
  .match-cards td { display: block; width: 100%; border: 0; padding: .2rem 0; }
  .match-cards td::before { content: attr(data-label); display: block; font-size: .78rem; font-weight: 600; color: var(--label-text); }
  .match-cards td[data-label="Title"]::before, .match-cards td[data-label="Actions"]::before,
  .match-cards .agency::before, .match-cards .place::before { display: none; }
  .match-cards td[data-label="Title"] { order: 0; }
  .match-cards .agency { order: 1; }
  .match-cards .place { order: 2; }
  .match-cards td[data-label="Due"] { order: 3; }
  .match-cards td { order: 4; }
  .match-cards td[data-label="Actions"] { order: 9; display: flex; flex-wrap: wrap; gap: .5rem; padding-top: .6rem; }
  .match-cards .actions form.inline { display: flex; flex: 1 1 0; }
  .match-cards .actions .button { width: 100%; }
  .details-list { grid-template-columns: 1fr; gap: .15rem; }
  .details-list dd { margin-bottom: .5rem; }
  .account { margin-left: 0; }
  .toolbar .spacer { display: none; }
  .toolbar form.inline { flex: 1 1 100%; display: flex; }
  .toolbar form.inline .button { width: 100%; }
  .toolbar a.button { flex: 1 1 calc(33.33% - .5rem); min-width: min-content; }
  .hide-sm { display: none; }
  h1 { font-size: 1.6rem; }

  /* Let long source text, URLs and member emails fit the phone viewport. */
  .page, .bar, .site-footer { overflow-wrap: anywhere; }
  .bar > *, .account, .account > *, .field, .toolbar > *,
  .card, .table-wrap, .details-list > *, .health-item { min-width: 0; max-width: 100%; }
  .filters { grid-template-columns: minmax(0, 1fr); }
  fieldset { min-width: 0; margin: 0 0 .75rem; }
  legend { max-width: 100%; }
  input, select, textarea { min-width: 0; max-width: 100%; }
  .team-table select { min-width: 11rem; }

  /* Staff and team tables: each row becomes a labelled card instead of a squeezed grid. */
  .stack-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.stack-table { border: 0; background: transparent; }
  .stack-table, .stack-table tbody, .stack-table tr, .stack-table td, .stack-table tbody th { display: block; width: 100%; }
  .stack-table tr { background: var(--surface); border: 1px solid var(--card-border); border-radius: 14px; padding: .6rem .9rem; margin-bottom: .75rem; }
  .stack-table td, .stack-table tbody th { border: 0 !important; padding: .25rem 0 !important; }
  .stack-table :is(td, th)[data-label]::before { content: attr(data-label); display: block; font-size: .78rem; font-weight: 600; color: var(--label-text); }
  .stack-table tbody th { font-size: 1.05rem; }
  .team-table select { min-width: 0; width: 100%; }
  .stack-table form { display: flex; flex-wrap: wrap; gap: .5rem; }
  input[type="checkbox"] { width: 1.5rem; height: 1.5rem; }
  .details-list dd { overflow-wrap: anywhere; }
  .page code, .page .nowrap { white-space: normal; overflow-wrap: anywhere; }

  /* The checkbox label is the full row's tap target. */
  .column-choice { display: flex; align-items: center; gap: .5rem; }
  .column-choice input { flex: 0 0 auto; }
  .column-choice label { display: flex; align-items: center; min-height: 44px; flex: 1; }
  .page :is(.button, .btn, .action-links a, .subnav a), .account a { display: inline-block; min-height: 44px; max-width: 100%; }
  /* Checklist links sit inside a sentence; inline keeps each ": Done" / ": To do" beside its label. */
  #onboarding-card li a { display: inline; min-height: 0; }
  .page summary, .page button, .page select, .page input:not([type="hidden"]):not([type="checkbox"]) { min-height: 44px; }
  /* Labels wrap between words only; never split a word such as "Download". */
  .page button, .page .button { white-space: normal; overflow-wrap: normal; word-break: normal; }
  .match-cards .details { display: inline-block; min-height: 44px; }
  .match-cards .actions form.inline { flex-basis: 100%; }
  section[aria-labelledby="help-calendar"] form { display: flex; flex-wrap: wrap; gap: .5rem; }
}

.check-status { white-space: nowrap; }

.incomplete-group { margin-top: 1.5rem; background: var(--surface); border: 1px solid var(--card-border); border-radius: 18px; box-shadow: var(--shadow); padding: .4rem 1.25rem; }
.incomplete-group summary { cursor: pointer; font-weight: 600; padding: .5rem 0; }
.incomplete-group .table-wrap { margin-top: .75rem; }

.button-primary:focus-visible { outline-color: var(--action-focus); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}

/* Secondary forms tucked behind a disclosure (staff organization page). */
.subtle-details { margin-top: 1rem; }
.subtle-details summary { cursor: pointer; font-weight: 600; padding: .5rem 0; color: var(--link); }
.inline-form { display: flex; flex-wrap: wrap; align-items: end; gap: .5rem 1rem; margin-top: 1rem; }
.inline-form .field { margin: 0; min-width: 12rem; }

/* Pilot report: headline numbers, then one compact table per section. */
.stat-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: .75rem; margin: 0; }
.stat-list div { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: .6rem .9rem; }
.stat-list dt { font-size: .85rem; font-weight: 600; color: var(--muted); }
.stat-list dd { margin: 0; font-size: 1.6rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.report-table th[scope="row"] { font-weight: 400; }
.report-table td { width: 8rem; text-align: right !important; }
.report-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 30rem), 1fr)); gap: 0 1rem; align-items: start; }
.filters .filter-actions.wide { grid-column: 1 / -1; }

/* Sign-in: a short product line beside a centred card; stacks on phones. */
.login-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 28rem); gap: 2rem 3rem; align-items: center; max-width: 60rem; margin: 2rem auto; }
.login-tagline { font-size: 1.6rem; line-height: 1.25; font-weight: 800; letter-spacing: -.01em; margin-top: 0; color: var(--title-text); }
.login-card { margin: 0; }
.centered-card { margin-left: auto; margin-right: auto; margin-top: 2rem; }
@media (max-width: 48em) {
  .login-layout { grid-template-columns: minmax(0, 1fr); margin: 0 auto; gap: 0; }
  .login-tagline { font-size: 1.25rem; }
  .login-card { order: -1; margin-bottom: 1.25rem; }
  .centered-card { margin-top: 1rem; }
}
.account-anon { margin-left: auto !important; }

/* Dashboard: collapsible source health, active-filter chips, result summary. */
.health-strip { padding: .5rem 1.25rem; }
.health-strip > summary { cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .75rem; padding: .5rem 0; font-weight: 600; }
.health-summary-title { font-weight: 800; }
.health-strip[open] > summary { margin-bottom: .5rem; }
.health { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); gap: .6rem; margin-bottom: .5rem; }
.health-item { min-width: 0; }
.health-technical { font-size: .82rem; }
.filters .field-wide { grid-column: span 2; }
.checkbox-field { justify-content: center; gap: .35rem; }
.checkbox-field label { font-weight: 600; display: flex; align-items: center; min-height: 2rem; }
.results-bar { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .25rem 1rem; margin: 1rem 0 .25rem; }
.results-bar .count { margin: 0; color: var(--text); }
.changed-note { margin: 0; }
.filter-chips { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; padding: 0; margin: .5rem 0 1rem; }
.filter-chips li { display: inline-flex; align-items: center; gap: .35rem; background: var(--chip-bg); color: var(--chip-text); border-radius: 999px; padding: .15rem .3rem .15rem .75rem; font-size: .88rem; }
.filter-chips a { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; min-height: 28px; border-radius: 999px; text-decoration: none; font-size: 1.1rem; line-height: 1; color: inherit; }
.filter-chips a:hover { background: var(--button-hover); }
.filter-chips .chip-clear { background: transparent; padding: 0 .3rem; }
.filter-chips .chip-clear a { text-decoration: underline; font-size: .88rem; padding: 0 .4rem; }
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: .5rem 0; }
.download-group { display: inline-flex; flex-wrap: wrap; gap: .5rem; }
.bulk-bar { margin: .5rem 0 1rem; }
.bulk-note { font-size: .88rem; }
.setup-cta { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; }
.deadline-note { display: block; margin-top: .3rem; font-size: .85rem; color: var(--muted); font-weight: 400; }
@media (max-width: 48em) {
  .filters .field-wide { grid-column: auto; }
  .download-group { display: flex; width: 100%; }
  .download-group a.button { flex: 1 1 calc(33.33% - .5rem); min-width: min-content; }
  .filter-chips a { min-width: 44px; min-height: 44px; }
}
.history-list { list-style: none; padding: 0; margin: 0; }
.history-list > li { border-left: 3px solid var(--border); padding: .1rem 0 .5rem 1rem; margin-bottom: .75rem; }
.history-list h3 { font-size: 1rem; margin: 0 0 .25rem; }
.history-list ul { margin: 0; padding-left: 1.1rem; }
.detail-actions { margin-top: .5rem; }
h2[id], h3[id] { scroll-margin-top: 1rem; }
.count-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .75rem; }
.count-line p { margin: 0; }
.results-bar .count { font-weight: 800; }
.notice-excerpt { white-space: pre-wrap; margin: 0 0 .5rem; }

/* Spreadsheet import: native file input and stacked review tables. */
.import-dropzone { border: 2px dashed var(--input-border); padding: 1rem; border-radius: .5rem; }
.import-dropzone input, .import-dropzone textarea { max-width: 100%; width: 100%; box-sizing: border-box; }
.import-url { overflow-wrap: anywhere; }

.portal-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem 1rem; margin-block: .75rem; }

.forecast-table { table-layout: fixed; }
.forecast-table th:first-child { width: 38%; }
.forecast-table th:nth-child(2) { width: 6%; }
.forecast-title { display: inline; overflow-wrap: anywhere; }
.forecast-details summary { display: list-item; padding: 0; font-weight: 600; }
.forecast-details p { font-size: .92rem; }
.forecast-coverage { margin-block: 1rem; }
@media (max-width: 48em) {
  .forecast-table th:first-child, .forecast-table th:nth-child(2) { width: auto; }
  .forecast-table .forecast-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem 1rem; }
  .forecast-row td:first-child { grid-column: 1 / -1; }
  .forecast-row td:first-child::before { display: none; }
  .forecast-row td { overflow-wrap: anywhere; }
}

@media (min-width: 48.01em) {
  .forecast-filters { grid-template-columns: minmax(0, 1fr) minmax(8rem, .6fr) minmax(0, 2fr) auto; }
  .forecast-filter-help { grid-column: 1 / -1; }
  .award-filters { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; }
  .award-filters .filter-actions { align-items: center; }
}

.account-menu { position: relative; }
.account-menu summary { cursor: pointer; padding: .5rem .75rem; min-height: 2.75rem; border: 1px solid var(--header-border); border-radius: 10px; }
.account-menu-panel { position: absolute; right: 0; top: calc(100% + .5rem); z-index: 10; background: var(--slate); border: 1px solid var(--header-border); border-radius: 10px; padding: 1rem; width: max-content; max-width: min(22rem, calc(100vw - 2rem)); }
.account-menu-panel .who { margin: 0 0 .75rem; }
@media (min-width: 80em) {
  .bar { flex-wrap: nowrap; gap: .5rem .75rem; }
  .org-name { min-width: 0; max-width: 12rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .account { flex-wrap: nowrap; flex-shrink: 0; gap: .5rem .75rem; font-size: .875rem; }
  .account > a, .account-menu summary { white-space: nowrap; }
}
@media (max-width: 48em) {
  .account-menu-panel { position: static; width: auto; max-width: 100%; margin-top: .5rem; }
}

/* Import previews retain readable captions when tables become phone cards. */
.import-file { margin-block: 1rem; }
.import-file > summary { font-weight: 600; overflow-wrap: anywhere; }
.import-file .table-wrap { margin-block: 1rem; }
.import-file table { table-layout: fixed; width: 100%; }
.import-file td, .import-file th { overflow-wrap: anywhere; }
.import-source-choice { display: flex; align-items: baseline; gap: .6rem; margin-block: .7rem; }
.import-source-choice input { flex: 0 0 auto; }
@media (max-width: 48em) {
  .import-file .stack-table caption { display: block; width: 100%; text-align: left; }
}

/* Optional review density; the opportunity detail retains the full fit explanation. */
.dashboard-results:has(#compact-density:checked) .match-cards .reasons { display: none; }
.dashboard-results:has(#compact-density:checked) .match-cards p { margin-block: .2rem; }
@media (min-width: 48.01em) {
  .dashboard-results:has(#compact-density:checked) .match-cards tbody { gap: 6px; }
  .dashboard-results:has(#compact-density:checked) .match-cards tr {
    grid-template-columns: minmax(12rem, 2fr) minmax(9rem, 1fr) minmax(12rem, 1.5fr) minmax(9rem, 1fr);
    gap: 4px 12px;
    padding: 8px 12px;
  }
}

/* Column review tiers also have visible text, independent of color. */
.import-columns { list-style: none; padding: 0; }
.import-column { padding: .75rem; border-inline-start: 4px solid; border-radius: .25rem; overflow-wrap: anywhere; }
.import-column p { margin: .25rem 0; }
.import-column-auto { background: var(--ok-bg); color: var(--ok-text); border-color: var(--ok-text); }
.import-column-confirm { background: var(--warn-bg); color: var(--warn-text); border-color: var(--warn-text); }
.import-column-unmapped { background: var(--chip-bg); color: var(--chip-text); border-color: var(--chip-text); }

}

/* Footer links are standalone targets: keep them at least 24px tall (WCAG 2.5.8). */
.site-footer-links a, .app-footer a { display: inline-block; min-height: 24px; min-width: 24px; padding: 2px 4px; }
.app-footer a + a { margin-left: 8px; }

/* WCAG 2.5.8: text links on their own line are 16-22px tall. Vertical padding on an inline
   link enlarges the hit box to 24px or more without moving the surrounding text. */
:where(.content, .page, .login-page) :where(p, li, dd, dt, td, small, span) > a:not([class]),
.login-page .login-card a, .link-arrow, a.details, a.title-link { padding-block: 4px; }
a.details, a.title-link { min-height: 24px; box-sizing: border-box; }
