:root {
  --bg: #ffffff;
  --fg: #1a1d21;
  --muted: #5c6570;
  --line: #e2e6ea;
  --card: #f7f9fa;
  --accent: #0b5d8f;
  --accent-soft: #e6f0f7;
  --badge: #ddeaf3;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171a;
    --fg: #e8eaed;
    --muted: #9aa3ad;
    --line: #2b3138;
    --card: #1c2126;
    --accent: #6fb3e0;
    --accent-soft: #1d2b36;
    --badge: #24323d;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
  max-width: 62rem;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.65 "Segoe UI", Arial, Helvetica, sans-serif;
}

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

nav {
  font-size: .9rem;
  color: var(--muted);
  padding-bottom: .75rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
}

h1 { font-size: 1.6rem; line-height: 1.3; margin: 0 0 .5rem; }
h2 { font-size: 1.1rem; margin: 1.75rem 0 .5rem; }

.lede { color: var(--muted); max-width: 46rem; }

.cta {
  display: inline-block;
  margin: .5rem 0 1.5rem;
  padding: .6rem 1.1rem;
  background: var(--accent);
  color: #fff;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
}

/* ---- metadata tables ---- */

dl.meta {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: .35rem 1rem;
  margin: 1rem 0;
  padding: 1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
}
dl.meta dt { color: var(--muted); font-size: .88rem; }
dl.meta dd { margin: 0; }

/* The award block is the result - the supplier who won and for how much.
   It gets a visual weight the rest of the metadata doesn't. */
.award dl.meta {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.desc p { margin: .4rem 0; white-space: pre-wrap; }

.docs ul { margin: .4rem 0; padding-inline-start: 1.2rem; }
.docs li { margin: .25rem 0; }
/* The archived copy, offered after the publisher's own link. Deliberately
   quiet: it is the fallback for when the original 404s, not the main route. */
.docs .mirror { color: var(--muted); font-size: .85em; margin-inline-start: .4rem; }

/* Extracted document text, collapsed by default - a tender page is a summary
   first, and some of these run to tens of thousands of characters. */
.doc-text { margin: .6rem 0; border: 1px solid var(--line); border-radius: 6px; padding: .5rem .8rem; background: var(--card); }
.doc-text summary { cursor: pointer; font-size: .9em; color: var(--muted); }
.doc-text pre { white-space: pre-wrap; font-family: inherit; font-size: .9em; margin: .6rem 0 0; max-height: 60vh; overflow-y: auto; }
.doc-text-note { color: var(--muted); font-size: .8em; margin: .5rem 0 0; }

.src-link {
  display: inline-block;
  margin-top: 1.5rem;
  font-weight: 600;
}

/* ---- listings ---- */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: 1rem 0;
}
.filters select, .filters input {
  padding: .45rem .6rem;
  font: inherit;
  font-size: .92rem;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
}
.filters input { flex: 1 1 14rem; min-width: 0; }

ul.tender-list, ul.source-list, ul.stats { list-style: none; margin: 0; padding: 0; }

ul.tender-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .5rem;
  padding: .6rem 0;
  border-bottom: 1px solid var(--line);
}
ul.tender-list li a { flex: 1 1 22rem; }
ul.tender-list .date { color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
ul.tender-list .badge {
  font-size: .78rem;
  padding: .1rem .5rem;
  background: var(--badge);
  border-radius: 999px;
  color: var(--muted);
}
ul.tender-list .sup { font-size: .82rem; color: var(--muted); flex-basis: 100%; }

ul.source-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: .75rem 0;
  border-bottom: 1px solid var(--line);
}
ul.source-list .n { color: var(--muted); font-size: .9rem; white-space: nowrap; }

ul.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin: 1.5rem 0;
  padding: 1rem;
  background: var(--card);
  border-radius: 8px;
}
ul.stats strong { display: block; font-size: 1.35rem; }
ul.stats li { color: var(--muted); font-size: .9rem; }

.build-time { color: var(--muted); font-size: .8rem; margin-top: 2.5rem; }

@media (max-width: 34rem) {
  dl.meta { grid-template-columns: 1fr; gap: 0 0; }
  dl.meta dt { margin-top: .5rem; }
}
