:root {
  /* Everything is a tint (mixed with white) or shade (mixed with black) of #0000FF. */
  --bg: #f2f2ff;
  --card: #ffffff;
  --fg: #0d0d33;
  --muted: #5a5a8c;
  --line: #d9d9fa;
  --chip: #ebebff;
  --accent: #0000ff;
  --accent-soft: #dcdcff;
  --on-accent: #ffffff;
  --accent-hover: #0000cc;
  --shadow: rgb(0 0 80 / 0.08);
  /* Status colours sit either side of blue on the wheel, so they read as
     one family with it: teal (new), rose (maybe), raspberry (closing soon). */
  --warn: #c0264f;
  --new: #006b80;
  --new-soft: #dff2f6;
  --maybe: #9c2f6b;
  --maybe-soft: #f7e6f0;
  --radius: 14px;
  --card-line: #e9e9fd;
  --chevron: 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='%235a5a8c' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --sans: "Inclusive Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #06061a;
    --card: #0d0d26;
    --fg: #eeeeff;
    --muted: #9d9dcc;
    --line: #24244d;
    --card-line: #16163a;
    --shadow: rgb(0 0 0 / 0.4);
    --chevron: 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='%239d9dcc' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    --chip: #1a1a40;
    /* #0000FF is too dark to read on black, so dark mode uses a lighter blue. */
    --accent: #8080ff;
    --accent-soft: #20205a;
    /* White on the lighter blue fails contrast, so dark buttons use navy text. */
    --on-accent: #06061a;
    --accent-hover: #9999ff;
    --warn: #ff7a99;
    --new: #6fd3e4;
    --new-soft: #0d2c35;
    --maybe: #f2a5cf;
    --maybe-soft: #36142b;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

/* Inclusive Sans has a single weight: keep everything regular rather than
   letting the browser fake a bold. */
h1, h2, h3, h4, strong, b { font-weight: 400; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 920px; margin: 0 auto; padding: 0 16px; }

button, select, input { font: inherit; color: inherit; }

/* Masthead */
.masthead { border-bottom: 1px solid var(--line); padding: 20px 0 16px; }
.masthead-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
h1 { font-size: 18px; line-height: 1.3; margin: 0; }
.refresh-btn {
  border: 0; background: none; padding: 0; margin-left: 6px; font-size: 14px; color: var(--accent); cursor: pointer;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px;
}
.refresh-btn:hover { text-decoration-thickness: 2px; }
.refresh-btn:disabled { color: var(--muted); cursor: default; }
.refresh-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
.refresh-status { margin-left: 6px; font-variant-numeric: tabular-nums; }
.refresh-status:empty { display: none; }
.ghost {
  border: 1px solid var(--line); background: transparent; border-radius: 999px;
  padding: 6px 14px; font-size: 14px; cursor: pointer; text-decoration: none; color: var(--fg);
}
.ghost:hover { background: var(--chip); }

/* Tabs */
.tabs { display: flex; gap: 4px; margin: 24px 0 20px; overflow-x: auto; scrollbar-width: none; }
.tabs button {
  border: 0; background: transparent; padding: 8px 14px; border-radius: 999px;
  font-weight: 400; color: var(--muted); cursor: pointer; white-space: nowrap;
}
.tabs button[aria-selected="true"] { background: var(--accent); color: var(--on-accent); }
/* Counts sit as a small superscript after the tab name. */
.tabs .count { font-size: 0.66em; line-height: 0; vertical-align: super; margin-left: 3px; font-variant-numeric: tabular-nums; }
.tabs .count:empty { display: none; }

/* Toolbar */
.toolbar { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin: 0; }
.search-row { display: flex; gap: 8px; align-items: center; }
.search-row #q { flex: 1; min-width: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
#q {
  width: 100%; height: 44px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); font-size: 16px;
}
#q:focus, select:focus, .chip:focus-visible, .tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.selects { display: flex; gap: 8px; flex: none; }
.selects label { display: block; min-width: 0; }
.selects select { width: auto; max-width: 190px; }
/* Custom select: our own chevron with room to breathe, matching the search
   field's height and corners. */
select {
  appearance: none; -webkit-appearance: none;
  width: 100%; height: 44px; padding: 0 40px 0 14px;
  border-radius: 10px; border: 1px solid var(--line);
  background: var(--card) var(--chevron) no-repeat right 14px center / 12px 8px;
  font-size: 15px; color: var(--fg); cursor: pointer;
  text-overflow: ellipsis; white-space: nowrap; overflow: hidden;
  transition: border-color 0.15s;
}
select:hover { border-color: var(--muted); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
/* Clear filters sits at the end of the chip row, in the filter bank. */
.chips-row { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; }
.chips-row .chips { min-width: 0; }
.chips-row .clear-filters { flex: none; white-space: nowrap; }
.chip[title] { cursor: pointer; }
.chip {
  border: 1px solid var(--line); background: var(--card); border-radius: 999px;
  padding: 5px 12px; font-size: 13px; cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

/* One row under the filters: the count on the left, view options on the right. */
.result-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; margin: 20px 0 12px; min-height: 24px; }
.result-tools { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.result-tools:not(:has(> :not([hidden]))) { display: none; }
.result-line { color: var(--muted); font-size: 14px; margin: 0; }
.clear-filters {
  border: 0; background: none; padding: 0; font-size: 14px; color: var(--accent); cursor: pointer;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px;
}
.clear-filters:hover { text-decoration-thickness: 2px; }
.clear-filters:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

/* Cards */
.list { list-style: none; padding: 0; margin: 0 0 24px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
#list-view { padding-bottom: 40px; }
.view-note { margin: 0; max-width: 70ch; font-size: 13px; line-height: 1.5; color: var(--muted); }
.card {
  display: flex; flex-direction: column; gap: 16px;
  background: var(--card); border: 1px solid var(--card-line); border-radius: 12px;
  padding: 24px; font-weight: 400; line-height: normal;
}
.card p, .card h3 { margin: 0; }
.card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px 16px; flex-wrap: wrap; }
.tags { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.cats { display: contents; }
.tag, .new, .maybe-tag, .dps-tag, .ni-tag {
  font-size: 12px; padding: 8px 12px; border-radius: 24px; background: var(--chip); color: var(--fg);
}
.new { background: var(--new-soft); color: var(--new); }
.maybe-tag { background: var(--maybe-soft); }
/* Quiet like the other tags: pale blue with blue text, as a selected chip. */
.ni-tag { background: var(--accent-soft); color: var(--accent); }
.dps-tag { background: transparent; box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); }
.procedure { font-size: 16px; white-space: nowrap; }
.buyer { font-size: 24px; font-weight: 400; letter-spacing: 0; }
.title-line { font-size: 16px; }
.title-line a { color: inherit; text-decoration: none; }
/* The title link stretches over the whole card, so the card is one click
   target but still a single, properly labelled link for keyboards and
   screen readers. */
.card { position: relative; cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s; }
.title-line a::after { content: ""; position: absolute; inset: 0; border-radius: 12px; }
.title-line a:focus-visible { outline: none; }
.card:hover { border-color: var(--line); box-shadow: 0 6px 20px var(--shadow); transform: translateY(-1px); }
.card:hover .title-line a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.card:has(a:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.card:active { transform: none; }
@media (prefers-reduced-motion: reduce) { .card { transition: none; } .card:hover { transform: none; } }
.meta { display: flex; gap: 8px 48px; flex-wrap: wrap; font-size: 16px; font-variant-numeric: tabular-nums; }
.deadline.soon { color: var(--warn); }

.empty { text-align: center; color: var(--muted); padding: 48px 16px; border: 1px dashed var(--line); border-radius: var(--radius); }

/* Feeds dialog */
dialog {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--fg);
  max-width: 560px; width: calc(100% - 32px); padding: 24px;
}
dialog::backdrop { background: rgb(0 0 40 / 0.45); }
dialog h2 { margin: 0 0 6px; font-size: 20px; }
.muted { color: var(--muted); font-size: 14px; margin: 0 0 16px; }
#feed-list { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 12px; }
#feed-list li { display: grid; gap: 4px; }
#feed-list strong { font-size: 15px; }
.feed-row { display: flex; gap: 8px; }
.feed-row input { flex: 1; min-width: 0; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); font-size: 13px; font-family: ui-monospace, monospace; }
.solid { border: 0; border-radius: 8px; padding: 8px 16px; background: var(--accent); color: var(--on-accent); font-weight: 400; cursor: pointer; transition: background 0.15s; }
.solid:hover { background: var(--accent-hover); }
.solid:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.copy { border: 1px solid var(--line); background: transparent; border-radius: 8px; padding: 6px 12px; font-size: 13px; cursor: pointer; }

@media (max-width: 560px) {
  .masthead { padding: 20px 0 16px; }
  .tabs { margin: 16px -16px 12px; padding: 0 16px; }
  .card { padding: 20px; }
  .buyer { font-size: 21px; }
  .meta { gap: 4px 24px; }
  .selects select { height: 40px; padding: 0 20px 0 8px; font-size: 13px; background-position: right 7px center; background-size: 10px 7px; }
  /* One scrollable row of category chips instead of three wrapped rows. */
  .chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px 2px; scrollbar-width: none; }
  .chips-row { flex-wrap: wrap; }
  .chips-row .chips { flex: 1 1 100%; }
  .chip { white-space: nowrap; }
}

/* Tender page */
/* Tender page: the full width of a list card, with the content on the
   left and the key-dates timeline fixed in view on the right. */
.tender { padding: 24px 0 80px; display: grid; gap: 16px; }
.tender-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px 32px; align-items: start; }
.tender-main { display: grid; gap: 16px; min-width: 0; }
.tender-aside { position: sticky; top: 24px; }
/* No fill or border on the timeline panel. */
.tender-aside .timeline-block { background: transparent; border: 0; padding: 8px 0 0; }
.tender-aside .timeline-block .tl-dot { background: var(--bg); }

@media (max-width: 860px) {
  /* One column: the dates come straight after "At a glance". */
  .tender-layout { display: flex; flex-direction: column; gap: 16px; align-items: stretch; }
  .tender-main { display: contents; }
  .tender-main > * { order: 2; }
  .tender-main > .tender-head, .tender-main > .tender-head + .block { order: 0; }
  .tender-aside { order: 1; position: static; }
  .tender-aside .timeline-block { padding: 8px 4px 0; }
}
.back { color: var(--muted); text-decoration: none; font-size: 15px; width: fit-content; }
.back:hover { color: var(--fg); }
.tender-head, .block {
  background: var(--card); border: 1px solid var(--card-line); border-radius: 12px; padding: 24px;
  display: grid; gap: 16px;
}
.tender-head .tags { display: flex; gap: 12px; flex-wrap: wrap; }
.tender-buyer { margin: 0; font-size: 28px; line-height: 1.2; }
.tender-title { margin: 0; font-size: 18px; line-height: 1.4; }
.tender-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tender-actions a { text-decoration: none; display: inline-flex; align-items: center; }
.tender-actions .solid { padding: 9px 16px; }
.tender-actions .ghost { padding: 8px 16px; font-size: 15px; }
.block h3 { margin: 0; font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.block h4 { margin: 8px 0 -8px; font-size: 16px; }
.block.quiet { background: transparent; border-color: var(--line); }
.tender-source { margin: 4px 0 0; }
.prose { margin: 0; font-size: 16px; line-height: 1.55; max-width: 62ch; }
.prose.muted, .muted { color: var(--muted); }
.lede { margin: 0; font-size: 20px; }

.facts { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px 24px; }
.facts dt { font-size: 13px; color: var(--muted); margin-bottom: 2px; }
.facts dd { margin: 0; font-size: 16px; line-height: 1.4; }

.timeline { list-style: none; margin: 0; padding: 0; display: grid; }
.tl-item { display: grid; grid-template-columns: 20px 1fr; gap: 12px; position: relative; padding-bottom: 20px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item:not(:last-child)::before {
  content: ""; position: absolute; left: 9px; top: 16px; bottom: -2px; width: 2px; background: var(--line);
}
.tl-dot { width: 12px; height: 12px; margin: 4px 0 0 4px; border-radius: 50%; border: 2px solid var(--fg); background: var(--card); position: relative; }
.tl-item.key .tl-dot { background: var(--fg); }
.tl-item.past .tl-dot { border-color: var(--line); background: var(--line); }
.tl-item.past .tl-label, .tl-item.past .tl-date { color: var(--muted); }
.tl-body p { margin: 0; }
.tl-label { font-size: 16px; }
.tl-item.key .tl-label { font-size: 18px; }
.tl-done { font-size: 12px; padding: 2px 8px; border-radius: 24px; background: var(--chip); color: var(--muted); margin-left: 4px; }
.tl-date { font-size: 15px; font-variant-numeric: tabular-nums; }
.tl-hint { font-size: 14px; color: var(--muted); margin-top: 4px !important; max-width: 52ch; }

.watch { margin: 0; padding: 14px 16px 14px 34px; background: var(--maybe-soft); border-radius: 10px; display: grid; gap: 6px; font-size: 15px; }

.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 18px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 32px 1fr; column-gap: 12px; }
.steps li::before {
  content: counter(step); grid-row: span 3; width: 28px; height: 28px; border-radius: 50%;
  background: var(--chip); display: grid; place-items: center; font-size: 14px;
}
.steps p { margin: 0; }
.step-title { font-size: 16px; }
.step-body { font-size: 15px; color: var(--muted); line-height: 1.45; margin-top: 2px !important; }
.steps a { color: var(--accent); font-size: 15px; margin-top: 4px; width: fit-content; }


@media (max-width: 560px) {
  .tender { padding-top: 16px; }
  .tender-head, .block { padding: 20px; }
  .tender-buyer { font-size: 24px; }
}

/* History and renewals */
.block strong { font-weight: 400; background: var(--maybe-soft); padding: 0 3px; border-radius: 3px; }
.history { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.history li { display: grid; grid-template-columns: 48px 1fr; gap: 12px; }
.history p { margin: 0; }
.hist-year { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 15px; }
.hist-title { font-size: 15px; line-height: 1.4; }
.hist-facts { font-size: 14px; color: var(--muted); margin-top: 2px !important; }
.source { margin: 0; font-size: 13px; color: var(--muted); }
.card.renewal { cursor: default; }
.card.renewal:hover { transform: none; box-shadow: none; border-color: var(--card-line); }
.renewal-open { position: relative; z-index: 1; color: var(--accent); font-size: 15px; width: fit-content; }

/* Budget check */
.range { position: relative; height: 64px; margin: 4px 0 0; }
.range-track { position: absolute; left: 0; right: 0; top: 30px; height: 6px; border-radius: 3px; background: var(--chip); }
.range-band { position: absolute; top: 30px; height: 6px; border-radius: 3px; background: var(--muted); opacity: 0.45; }
.range-median { position: absolute; top: 26px; width: 2px; height: 14px; margin-left: -1px; background: var(--muted); }
.range-marker { position: absolute; top: 24px; width: 18px; height: 18px; margin-left: -9px; border-radius: 50%; background: var(--fg); border: 3px solid var(--card); box-shadow: 0 0 0 1px var(--fg); }
.range-marker span {
  position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); white-space: nowrap;
  font-size: 13px; background: var(--fg); color: var(--bg); padding: 3px 8px; border-radius: 6px;
}
.range-labels span { position: absolute; top: 44px; transform: translateX(-50%); font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.note { background: var(--chip); border-radius: 10px; padding: 14px 16px; display: grid; gap: 8px; }
.note p { margin: 0; font-size: 15px; line-height: 1.5; }
.note strong { background: none; padding: 0; }
.range-marker.at-end span { left: auto; right: -6px; transform: none; }
.range-marker.at-start span { left: -6px; transform: none; }

/* Agency league */
.rank { display: inline-block; min-width: 2ch; margin-right: 10px; color: var(--muted); font-variant-numeric: tabular-nums; }
.buyer-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.buyer-list li { display: flex; justify-content: space-between; gap: 16px; font-size: 15px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.buyer-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.buyer-list .count { color: var(--muted); font-variant-numeric: tabular-nums; }
.league-row .buyer a { color: inherit; text-decoration: none; }
.league-row .buyer a::after { content: ""; position: absolute; inset: 0; border-radius: 12px; }
.league-row .buyer a:focus-visible { outline: none; }
.league-row:hover .buyer a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.league-row .meta .lead { color: var(--fg); }
.league-row .meta span:not(.lead) { color: var(--muted); }
.origin-tag { font-size: 12px; font-weight: 400; color: var(--muted); white-space: nowrap; margin-left: 4px; }
.overseas-summary { margin: 0; font-size: 14px; color: var(--muted); flex-basis: 100%; }
.overseas-summary summary { cursor: pointer; width: fit-content; }
.overseas-summary summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
.overseas-list { margin: 12px 0 0; max-width: 560px; }
.overseas-list li { font-size: 14px; }
.overseas-summary .source { max-width: 560px; margin-top: 10px; }
.link-btn { border: 0; background: none; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-align: left; }
.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }
.link-btn[aria-pressed="true"] { color: var(--fg); font-weight: 600; }
.link-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

/* Agencies matching a search, shown above tender results */
.agency-hits { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 20px 0 0; }
.agency-hits-label { font-size: 13px; color: var(--muted); margin-right: 4px; }
.agency-hit {
  display: inline-flex; align-items: baseline; gap: 4px; text-decoration: none; color: var(--fg);
  background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 14px;
}
.agency-hit:hover { border-color: var(--muted); }
.agency-hit-meta { color: var(--muted); font-size: 13px; }
.toggle { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; color: var(--muted); cursor: pointer; width: fit-content; }
.toggle input { width: 16px; height: 16px; accent-color: var(--fg); margin: 0; }

/* Bid log */
.bids-view { display: grid; gap: 16px; margin-bottom: 64px; }
.bids-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.bid-insights { display: grid; gap: 16px; }
.bid-insights:empty { display: none; }
.group-title { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 16px 0 10px; }
#bid-lists .list { margin-bottom: 8px; }
#bid-lists > .empty { margin: 0; }

.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.tile { background: var(--card); border: 1px solid var(--card-line); border-radius: 12px; padding: 18px 20px; }
.tile p { margin: 0; }
.tile-label { font-size: 13px; color: var(--muted); }
.tile-value { font-size: 28px; line-height: 1.2; margin: 4px 0 2px !important; font-variant-numeric: tabular-nums; }
.tile-sub { font-size: 13px; color: var(--muted); }

.todo { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.todo li { display: grid; gap: 2px; padding-bottom: 10px; border-bottom: 1px solid var(--line); font-size: 15px; }
.todo li:last-child { border-bottom: 0; padding-bottom: 0; }
.todo a { color: var(--fg); text-decoration-thickness: 1px; text-underline-offset: 3px; width: fit-content; }
.todo span { color: var(--muted); }

.rec h4 { margin: 0 0 8px; font-size: 15px; color: var(--fg); }
.rec + .rec { margin-top: 4px; }
.rec-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rec-list li { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(60px, 1fr) auto; align-items: center; gap: 12px; font-size: 15px; }
.rec-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-bar { height: 8px; border-radius: 4px; background: var(--chip); overflow: hidden; }
.rec-bar span { display: block; height: 100%; background: var(--fg); border-radius: 4px; }
.rec-num { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 14px; white-space: nowrap; }
.buyer-list a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.reasons-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 15px; }
.reasons-list li { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.reasons-list .muted { margin: 0; }

.status-tag { font-size: 12px; padding: 8px 12px; border-radius: 24px; background: var(--chip); color: var(--fg); }
.status-tag.s-writing, .status-tag.s-submitted { background: var(--accent-soft); color: var(--accent); }
.status-tag.s-won { background: var(--new-soft); color: var(--new); }
.status-tag.s-lost { background: transparent; box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); }
.status-tag.s-no-bid, .status-tag.s-withdrawn { background: transparent; color: var(--muted); padding-left: 0; }
.your-bid-row { display: flex; justify-content: space-between; align-items: center; gap: 12px 16px; flex-wrap: wrap; }
.your-bid-row .lede { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 17px; }
.your-bid-row .prose { max-width: 48ch; }

/* Bid form */
.bid-dialog { max-width: 640px; padding: 0; max-height: calc(100dvh - 32px); }
.bid-form { display: grid; gap: 0; }
.bid-form-head, .bid-form-foot {
  position: sticky; z-index: 1; background: var(--card); display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 24px;
}
.bid-form-head { top: 0; border-bottom: 1px solid var(--line); }
.bid-form-head h2 { margin: 0; }
.bid-form-foot { bottom: 0; border-top: 1px solid var(--line); }
.foot-actions { display: flex; gap: 8px; }
.foot-actions .ghost, .danger { font-size: 15px; padding: 8px 16px; }
.danger { color: var(--warn); }
.icon-btn { border: 0; background: transparent; font-size: 26px; line-height: 1; cursor: pointer; color: var(--muted); padding: 0 4px; }
.bid-form fieldset { border: 0; margin: 0; padding: 20px 24px; display: grid; gap: 14px; border-bottom: 1px solid var(--line); }
.bid-form fieldset:last-of-type { border-bottom: 0; }
.bid-form legend { float: left; width: 100%; padding: 0; margin-bottom: 2px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.f { display: grid; gap: 6px; min-width: 0; }
.f-label { font-size: 13px; color: var(--muted); }
.f-hint { font-size: 12px; color: var(--muted); }
.f-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.f-row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.bid-form input:not([type="checkbox"]), .bid-form textarea {
  width: 100%; height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); font-size: 15px;
}
.bid-form textarea { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.45; }
.bid-form select { background-color: var(--bg); }
.bid-form input:focus, .bid-form textarea:focus, .bid-form select:focus, .icon-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.f-cats { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-check { position: relative; cursor: pointer; }
.chip-check input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip-check span { display: inline-block; border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font-size: 13px; background: var(--card); }
.chip-check input:checked + span { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.chip-check input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.scores summary { cursor: pointer; font-size: 15px; }
.scores[open] summary { margin-bottom: 10px; }
.scores .f-hint { display: block; margin: 0 0 10px; }
.score-grid { display: grid; grid-template-columns: auto repeat(3, minmax(0, 1fr)); gap: 8px 10px; align-items: center; }
.public-record { gap: 10px; }
.public-record .ghost { width: fit-content; font-size: 14px; }
.form-error { margin: 0; padding: 0 24px 12px; color: var(--warn); font-size: 14px; }

@media (max-width: 560px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile { padding: 14px 16px; }
  .tile-value { font-size: 22px; }
  .f-row, .f-row-3 { grid-template-columns: 1fr; }
  .bid-form fieldset { padding: 16px; }
  .bid-form-head, .bid-form-foot { padding: 14px 16px; }
  .bids-head .solid { width: 100%; }
}

/* Signed-in agency name */

/* "Needs a Fergal" roundel */
:root { --fergal: var(--accent); --fergal-ink: var(--card); --fergal-text: var(--accent); }
.fergal { position: absolute; z-index: 2; pointer-events: none; display: block; }
.fergal svg { display: block; width: 100%; height: 100%; overflow: visible; }
.fergal-ring { transform-origin: 50px 50px; animation: fergal-spin 14s linear infinite; }
.fergal-ring text { fill: var(--fergal-text); font: 12.5px/1 var(--sans); }
.fergal-mark { fill: var(--fergal-text); font: 22px/1 var(--sans); }
.fergal-smiley { stroke: var(--fergal-text); stroke-width: 2.4; stroke-linecap: round; }
.fergal-smiley .eye { fill: var(--fergal-text); stroke: none; }
.fergal-mark.long { font-size: 17px; }
.fergal-a11y .fergal-mark { font-size: 18px; }
@keyframes fergal-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .fergal-ring { animation: none; } }

.fergal-card { width: 88px; height: 88px; top: -22px; right: -14px; transform: rotate(-8deg); }
.card.has-fergal .card-top { padding-right: 64px; }
.fergal-page { width: 112px; height: 112px; top: -26px; right: -14px; transform: rotate(-8deg); }
.tender-head.has-fergal { position: relative; }
.tender-head.has-fergal .tags, .tender-head.has-fergal .tender-buyer { padding-right: 88px; }

.fergal-why { border-left: 3px solid var(--fergal); padding: 2px 0 2px 14px; display: grid; gap: 6px; }
.fergal-why p { margin: 0; font-size: 15px; }
.fergal-why ul { margin: 0; padding-left: 18px; font-size: 14px; color: var(--muted); display: grid; gap: 2px; }

@media (max-width: 560px) {
  .fergal-card { width: 72px; height: 72px; top: -18px; right: -8px; }
  .card.has-fergal .card-top { padding-right: 52px; }
  .fergal-page { width: 88px; height: 88px; top: -18px; right: -8px; }
  .tender-head.has-fergal .tags, .tender-head.has-fergal .tender-buyer { padding-right: 64px; }
}

/* Toolbar: search and filters share a row on wide screens, stack below that. */
@media (max-width: 760px) {
  .search-row { flex-direction: column; align-items: stretch; }
  .search-row #q { flex: none; }
  .selects { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .selects select { width: 100%; max-width: none; }
}

/* Panels */
.buyer-list a { color: inherit; }
.panel-row .tags .new { white-space: nowrap; }

/* Coming up: section headings and advance notices */
.list-heading { list-style: none; font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin: 16px 0 0; }
.list-heading:first-child { margin-top: 0; }
.notice .meta { color: var(--muted); font-size: 15px; }
.notice-links { display: flex; gap: 16px; flex-wrap: wrap; margin: 0; }

/* Top bar: just the title */
.masthead h1 { margin: 0; }
.home-link { color: inherit; text-decoration: none; }

/* Footer: two columns of small labelled groups, white on #0000FF. */
.site-footer {
  --footer-bg: #0000ff; --footer-fg: #ffffff; --footer-muted: rgb(255 255 255 / 0.72);
  background: var(--footer-bg); color: var(--footer-fg);
  margin-top: 48px; padding: 48px 0 40px; font-size: 15px; line-height: 1.45;
}
.site-footer ::selection { background: var(--footer-fg); color: var(--footer-bg); }
.site-footer :focus-visible { outline: 2px solid var(--footer-fg); outline-offset: 2px; border-radius: 2px; }
/* The Data column is twice the width of Made by. */
.footer-grid { display: grid; grid-template-columns: 1fr 2fr; column-gap: 48px; row-gap: 32px; align-items: start; }
.footer-col p { margin: 0; }
.footer-col p + p { margin-top: 4px; }
.footer-label { margin: 0 0 14px; font-size: 15px; font-weight: 400; color: var(--footer-muted); }
.footer-col .footer-label:not(:first-child) { margin-top: 32px; }
.footer-muted { color: var(--footer-muted); }
.footer-col .footer-top { margin-top: 32px; }
.footer-links { display: grid; grid-template-columns: repeat(2, max-content); column-gap: 96px; }
.footer-links ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; align-content: start; }
.footer-links li:empty, .footer-links li:has(> [hidden]) { display: none; }
.site-footer a, .site-footer .link-btn { color: var(--footer-fg); text-decoration: none; }
.site-footer a:hover, .link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }
.link-btn { border: 0; background: none; padding: 0; font: inherit; cursor: pointer; }
.site-footer .refresh-btn { font-size: inherit; color: var(--footer-fg); text-decoration: underline; text-underline-offset: 3px; }
.site-footer .refresh-status { color: var(--footer-muted); }

@media (max-width: 640px) {
  .footer-grid { grid-template-columns: 1fr; row-gap: 32px; }
  }

/* Coming up: automated accessibility check of the buyer's website */
.site-check { margin: 0; font-size: 14px; color: var(--muted); }
.site-check a { color: var(--accent); position: relative; z-index: 1; }
