:root {
  color-scheme: light;

  /* Three colours, and colour is spent only on exceptions.

       Midnight Violet #160f29  text, and emphasis of every kind
       White           #fbfbfb  the page, and every surface on it
       Blue Slate      #5e6572  recessive: secondary text, and a non-match
       Copperwood      #bf6900  the only hue on screen, and only while
                                something is changing

     A matched tender is what the user came to see, so it is given weight — a
     solid ink fill — rather than a colour. A non-match recedes into grey. That
     leaves exactly one hue in the interface, and seeing it means something is
     in flight. A palette where the common case is coloured spends its loudest
     signal on the least surprising thing.

     Black Forest is gone. It was warm beside a cold ink, and at 12px it read as
     near-black rather than as green, so it was occupying a slot without
     delivering a signal. --accent now points at the ink, which is what carries
     emphasis everywhere: links, primary buttons, the eyebrow, the rule beside a
     reason that fits.

     Ink and ground are cold on purpose. The oxblood they replaced read as
     editorial — the register of a heritage brand rather than of an instrument,
     and this is a tool people scan under deadline. It is also measurably
     sharper: 17.9:1 against this white, where the oxblood managed 15.6:1
     against a warmer one.

     Everything else is derived from those so it follows them: the rule, the
     tint, the shadow, the scrim, the header. The exception is --warn-text,
     which exists because Copperwood measures 3.9:1 on this white and the badge
     label is 12px bold, under the 4.5:1 that size needs; the colour itself is
     unchanged everywhere it is not carrying small text. */

  --ink: #160f29; /* Midnight Violet — 17.9:1 on white */
  --ink-2: #3c3550; /* Midnight Violet lifted, for secondary lines */
  --muted: #5e6572; /* Blue Slate — 5.7:1 on white */
  /* One white. The page, every surface and text sitting on a dark fill all
     point at it, so there is exactly one value to change. --sunken is mixed
     from it rather than picked, so status bands and footers keep their step
     down however the white moves. */
  --white: #fbfbfb;
  --paper: var(--white); /* the page */
  --card: var(--white); /* cards, panels, dialogs, buttons, fields */
  --text-inverse: var(--white); /* the same white where it sits on a dark fill */
  --sunken: color-mix(in srgb, var(--white) 93%, var(--ink));

  --line: color-mix(in srgb, var(--ink) 22%, var(--white));
  --line-strong: var(--ink);

  /* Emphasis. Not a separate colour: the ink is the accent. */
  --accent: var(--ink);
  --accent-dark: #000000;
  --soft: color-mix(in srgb, var(--ink) 10%, var(--white));

  /* The one hue, and only while something is changing. */
  --warn: #bf6900; /* Copperwood */
  --warn-text: #8f4f00; /* darkened where Copperwood carries small text */

  /* Recessive. */
  --slate: #5e6572; /* Blue Slate */

  /* Now that body text is violet rather than red, an error can just be red. */
  --bad: #8a2020;

  /* Translucent values are mixed from the colours above rather than written as
     their own hex, so changing a named colour carries through to the shadow,
     the scrim and the header tint without anyone having to remember they exist. */
  --shadow: color-mix(in srgb, var(--ink) 13%, transparent);
  --scrim: color-mix(in srgb, var(--ink) 40%, transparent);
  --header-tint: color-mix(in srgb, var(--accent) 3%, transparent);
  --header-rule: color-mix(in srgb, var(--ink) 12%, transparent);

  /* Geometry. Nothing is rounded, and rules are hairlines. Both are single
     tokens so the whole system can be softened again from one place —
     the prototype's tokens are authored the same way and for the same reason. */
  --radius: 0px;
  --radius-pill: 0px;
  --border-hair: 0.5px;
  --border-strong: 1px;

  /* Type. Inter is the system face; Space Mono is kept narrowly for the
     wordmark, where the mechanical texture is the brand, and for figures,
     where fixed advance widths let dates and counts line up. */
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI",
    Helvetica, Arial, sans-serif;
  --font-numeric: "Space Mono", ui-monospace, "SF Mono", Menlo, Consolas,
    monospace;
  --font-wordmark: var(--font-numeric);
}
/* Reserve the scrollbar gutter permanently. main is a percentage of the
   viewport and the reason columns are auto-fit, so a scrollbar that appears
   when a card expands narrows the viewport, reflows the grid, changes the
   height and can take the scrollbar away again — a loop that wedges layout
   with script still running, which reads as dead JavaScript rather than as a
   CSS problem. A stable gutter breaks the circuit. */
/* Keep the scrollbar present so the column does not jump sideways by its width
   the first time a card expands past the fold. */
html {
  overflow-y: scroll;
}
* {
  box-sizing: border-box;
}
/* A column the height of the viewport, so the footer sits on the bottom of the
   page when the list is short and gets pushed down when it is long — rather
   than riding up under the last card. The header is fixed and so out of flow;
   main's top padding is what clears it. */
body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font: 16.5px/1.6 var(--font-sans);
  -webkit-font-smoothing: antialiased;
}
/* Pinned and near-transparent, after favonius.energy: a 3% tint over an 8px
   backdrop blur rather than an actual transparent fill. The blur is what makes
   it work — cards scrolling underneath stay suggested rather than legible, so
   the wordmark never collides with a tender title. Where backdrop-filter is
   unsupported the tint alone is too weak, so that case gets a solid fallback. */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  min-height: 64px;
  padding: 0 clamp(16px, 2.5vw, 40px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--paper);
  border-bottom: var(--border-hair) solid var(--header-rule);
}
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .site-header {
    background: var(--header-tint);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
  }
}
.site-header > div {
  display: flex;
  gap: 12px;
  align-items: center;
}
.brand-lockup {
  min-width: 0;
}
.brand-divider {
  width: 1px;
  height: 24px;
  flex: 0 0 1px;
  background: var(--header-rule);
}
.customer-logo {
  display: block;
  width: clamp(82px, 9vw, 106px);
  height: auto;
}
.customer-logo.legacy-mainline-logo {
  /* Mainline's canonical mark is white for its dark site header. */
  filter: invert(1);
}
.brand {
  color: var(--ink);
  font-family: var(--font-wordmark);
  font-size: clamp(20px, 2vw, 26px);
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
}
.tm {
  /* Raised off the wordmark rather than sitting in the baseline: <sup> alone
     would push the header's line box taller. */
  font-size: 0.42em;
  vertical-align: super;
  line-height: 0;
  margin-left: 0.15em;
  letter-spacing: 0;
}
@media (max-width: 520px) {
  .brand-lockup {
    gap: 8px !important;
  }
  .brand {
    font-size: 19px;
  }
  .brand-divider {
    height: 20px;
  }
  .customer-logo {
    width: 76px;
  }
}
/* A filled band rather than a rule and some grey text. Full bleed, with its
   padding matching the header's, so the notice lines up under the wordmark —
   both are chrome pinned to the page edges rather than to the reading column.
   White on Rich Mahogany is 15.6:1. */
.site-footer {
  flex-shrink: 0;
  padding: 18px clamp(16px, 2.5vw, 40px);
  background: var(--ink);
  color: var(--text-inverse);
  font-size: 12.5px;
}
button,
a {
  font: inherit;
}
button {
  border: var(--border-hair) solid var(--line);
  border-radius: var(--radius);
  padding: 8px 12px;
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
}
button:hover {
  border-color: var(--ink-2);
  background: var(--sunken);
}
button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--text-inverse);
}
button.primary:hover {
  background: var(--accent-dark);
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.quiet {
  background: var(--card);
}
/* The bar is a 3% tint over a blur; a filled button on top of it would be the
   only opaque thing there and would undo the effect. */
.site-header .quiet {
  background: transparent;
}
.site-header .quiet:hover {
  background: var(--sunken);
}
.muted {
  color: var(--muted);
}
.hidden {
  display: none !important;
}
.error {
  color: var(--bad);
}
/* Four fifths of whatever it is shown on, with a ceiling so the lines do not
   run to an unreadable measure on a very wide display. */
main {
  flex: 1 0 auto;
  width: min(80vw, 1400px);
  margin: 0 auto;
  /* Clears the fixed header. */
  padding: 96px 0 32px;
}
.intro {
  margin: 10px 0 28px;
}
.intro h1 {
  margin: 1px 0 4px;
  font-size: clamp(27px, 4.4vw, 44px);
  line-height: 1.05;
  letter-spacing: -0.05em;
}
.intro p {
  margin: 0;
}
.eyebrow {
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.panel {
  max-width: 480px;
  margin: 8vh auto;
  background: var(--card);
  border: var(--border-hair) solid var(--line);
  padding: 30px;
  border-radius: var(--radius);
}
.login label,
dialog label {
  display: block;
  margin: 18px 0 6px;
}
.login input,
textarea {
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border: var(--border-hair) solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  font: inherit;
}
.login button {
  width: 100%;
  margin-top: 12px;
}
.toolbar {
  display: flex;
  justify-content: flex-start;
  gap: 20px;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: var(--border-hair) solid var(--line);
}
.refresh-progress {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.refresh-progress-copy {
  display: grid;
  line-height: 1.25;
}
.refresh-progress-copy strong {
  font-size: 12px;
  font-weight: 650;
}
.refresh-progress-copy span {
  color: var(--muted);
  font-family: var(--font-numeric);
  font-size: 10.5px;
}
.refresh-spinner {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  border: 1.5px solid color-mix(in srgb, var(--accent) 20%, var(--white));
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: refresh-spin 0.8s linear infinite;
}
@keyframes refresh-spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .refresh-spinner {
    animation: none;
    border-style: dotted;
  }
}
.matched-progress {
  min-height: 230px;
  margin-top: 18px;
  border: var(--border-hair) solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  text-align: center;
}
.matched-progress-spinner {
  width: 30px;
  height: 30px;
  flex-basis: 30px;
  border-width: 2px;
  margin-bottom: 8px;
}
.matched-progress strong {
  font-size: 17px;
}
.matched-progress .muted {
  font-family: var(--font-numeric);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.tabs {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: var(--border-hair) solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}
.tabs button {
  border: 0;
  padding: 6px 11px;
}
.tabs button.active {
  background: var(--ink);
  color: var(--text-inverse);
  border-color: var(--ink);
}
@media (max-width: 680px) {
  .toolbar {
    align-items: flex-start;
    flex-direction: column;
  }
  .refresh-progress {
    margin-left: 3px;
  }
}
.summary {
  padding: 16px 2px 10px;
  font-size: 13px;
}
.feed {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tender-card {
  /* Focused or scrolled-to cards should clear the fixed bar, not hide under it. */
  scroll-margin-top: 80px;
}
.tender-card {
  cursor: pointer;
  background: var(--card);
  border: var(--border-hair) solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
}
.tender-card h2 {
  font-size: 26px;
  line-height: 1.3;
  margin: 14px 0 3px;
  letter-spacing: -0.015em;
}
.reason-teaser {
  margin: 14px 0 0;
  padding-left: 14px;
  border-left: 2px solid var(--accent);
  color: var(--ink-2);
}
.card-foot {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-top: 12px;
}
/* Focusable, so it needs a ring. :focus-visible only, or every mouse click
   would leave one behind. */
.tender-card:focus {
  outline: none;
}
.tender-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.detail-count {
  font-size: 13px;
}
.tender-detail {
  margin-top: 6px;
  padding-top: 1px;
}
/* Deadline leads the provenance line because it determines whether the
   opportunity is still actionable; the buyer follows as supporting context. */
.card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 14px;
  margin: 4px 0 0;
}
.card-top,
.card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.badge {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  /* White, outlined in the state's own colour. border-color is currentColor so
     each state below sets one property; Copperwood is the exception, because it
     measures 4.0:1 on white and this text is 12px bold, so the rule keeps the
     named colour while the label takes the darkened one. */
  background: var(--card);
  border: var(--border-hair) solid currentColor;
  color: var(--muted);
}
.source-country {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  padding: 3px 8px;
  border: var(--border-hair) solid var(--line);
  border-radius: var(--radius-pill);
  color: var(--muted);
  font-family: var(--font-numeric);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.35;
}
.country-flag {
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1;
}
/* A match is weight, not colour: solid ink, inverted text. It is the one badge
   that should stop the eye, and it does it without spending the hue. */
.badge.matched {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--text-inverse); /* 17.9:1 */
}
.badge.not_matched {
  color: var(--slate); /* Blue Slate — 5.7:1 on white */
}
.badge.refreshing,
.badge.failed {
  color: var(--warn-text); /* 5.6:1 on white */
  border-color: var(--warn); /* Copperwood at full strength */
}
.badge.summary_pending,
.badge.context_missing,
.badge.pending {
  color: var(--slate);
  border-color: var(--line-strong);
}
.deadline {
  font-family: var(--font-numeric);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-2);
}
.buyer {
  font-size: 13px;
}
/* Reasons for and against sit side by side, as in the prototype: the
   judgment is a balance, and stacking them buries whichever came second.
   Collapses to one column where two would leave neither readable. */
/* Two columns above a breakpoint, one below. A breakpoint rather than
   auto-fit, so the pair is always for-and-against side by side and never
   three tracks of something on a wide screen. */
.reasons {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px 28px;
  margin-top: 16px;
}
@media (min-width: 760px) {
  .reasons {
    grid-template-columns: 1fr 1fr;
  }
}
.reason {
  margin: 0;
  padding-left: 14px;
  border-left: 2px solid var(--accent);
}
.reason.against {
  border-color: var(--warn);
}
.reason div {
  margin-bottom: 2px;
}
.reason strong {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  margin-bottom: 5px;
  color: var(--accent);
}
.reason.against strong {
  /* Tracked 10.5px: Copperwood itself is 4.0:1 on the card, just under what
     that size needs, so the heading takes the darkened one. The rule beside
     it stays full-strength Copperwood. */
  color: var(--warn-text);
}
.card-actions {
  margin-top: 20px;
  justify-content: flex-start;
}
.card-actions a {
  color: var(--accent);
  text-decoration: none;
  margin-left: auto;
}
.file-list {
  border-top: var(--border-hair) solid var(--line);
  margin-top: 14px;
  padding-top: 10px;
}
.file-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  font-size: 13px;
}
.signal-row {
  margin-top: 14px;
}
.feedback summary {
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
}
.feedback-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.feedback-options button {
  font-size: 12px;
  padding: 5px 8px;
}
.more {
  display: block;
  margin: 24px auto;
}
dialog {
  max-width: 650px;
  width: calc(100% - 32px);
  /* Declared, because the UA default is #ffffff and would otherwise be the
     only colour in the interface outside this stylesheet's control. */
  background: var(--card);
  color: var(--ink);
  border: var(--border-strong) solid var(--line-strong);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: 0 12px 44px var(--shadow);
}
dialog::backdrop {
  background: var(--scrim);
}
.close {
  float: right;
  border: 0;
  font-size: 24px;
  padding: 0 8px;
}
.statusbox {
  padding: 12px;
  background: var(--sunken);
  border-radius: var(--radius);
  white-space: pre-wrap;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
#contextDialog.confirming {
  max-width: 430px;
  padding: 0;
  overflow: hidden;
}
.confirm-copy {
  padding: 24px 26px 20px;
}
.confirm-copy h2 {
  margin: 3px 0 8px;
  font-size: 21px;
  letter-spacing: -0.02em;
}
.confirm-copy p:last-child {
  margin: 0;
}
.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 18px;
  border-top: var(--border-hair) solid var(--line);
  background: var(--sunken);
}
@media (max-width: 680px) {
  .actions .muted {
    display: none;
  }
  main {
    width: calc(100vw - 28px);
    padding: 86px 0 22px;
  }
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }
  .feed {
    display: flex;
  }
  .tender-card {
    padding: 16px;
  }
}


/* ── brief onboarding ──────────────────────────────────────────────────────
   Three questions in their own dialog. Wider than the context dialog because
   the boundary rows carry a label and a three-way control on one line.

   Rows are separated by ordinary borders rather than by a sub-pixel grid gap
   showing the background through: at 0.5px that separator renders
   inconsistently across zoom levels and display densities. */
#briefDialog {
  max-width: 820px;
  padding: 0;
}
.brief-head {
  padding: 14px 22px 0;
  min-height: 20px;
}
.brief-head .close {
  float: right;
  margin: -4px -6px 0 0;
}
.brief-title {
  margin: 22px 26px 0;
  font-size: 21px;
  letter-spacing: -0.03em;
}
.brief-rail {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 0 26px;
  border-bottom: var(--border-strong) solid var(--line-strong);
}
.brief-step {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  padding: 10px 13px;
  margin-bottom: -1px;
  color: var(--muted);
  border-bottom: 2px solid transparent;
}
.brief-step.active {
  color: var(--ink);
  font-weight: 600;
  border-bottom-color: var(--accent);
}
.brief-step:disabled {
  opacity: 0.4;
}
.brief-step-n {
  font-family: var(--font-numeric);
  font-size: 10px;
  font-weight: 700;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: var(--border-hair) solid var(--line-strong);
}
.brief-step.active .brief-step-n {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--text-inverse);
}
.brief-body {
  padding: 16px 26px 28px;
}
.brief-lead {
  margin: 0 0 18px;
  font-size: 14px;
  color: var(--ink-2);
}
.brief-entry {
  display: flex;
  gap: 8px;
}
.brief-entry input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 9px 11px;
  border: var(--border-hair) solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  font: inherit;
}
.brief-manual {
  margin: 16px 0 0;
}
.brief-body textarea {
  margin-top: 8px;
}
.brief-note {
  font-size: 12.5px;
  margin: 10px 0 0;
}
/* Illustrative prompts, not claims about this client — styled quieter than
   anything the client has actually said. */
.brief-examples {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
}
.brief-examples-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--muted);
  margin-right: 2px;
}
.brief-example {
  font-size: 12.5px;
  padding: 5px 9px;
  color: var(--muted);
  background: var(--sunken);
}
.brief-example::before {
  content: "+ ";
  color: var(--accent);
}
.brief-example:disabled::before {
  content: "✓ ";
}
.brief-rows {
  border: var(--border-hair) solid var(--line-strong);
  margin-top: 16px;
}
.brief-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 13px;
  background: var(--card);
}
.brief-row + .brief-row {
  border-top: var(--border-hair) solid var(--line);
}
.brief-row-label {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 14px;
}
.seg {
  display: inline-flex;
  border: var(--border-hair) solid var(--line-strong);
  flex: 0 0 auto;
}
.seg button {
  border: 0;
  border-radius: 0;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 7px 10px;
  color: var(--muted);
  background: transparent;
}
.seg button + button {
  border-left: var(--border-hair) solid var(--line);
}
.seg button.active {
  background: var(--ink);
  color: var(--text-inverse);
}
.brief-remove {
  flex: 0 0 auto;
  border: 0;
  padding: 2px 7px;
  font-size: 17px;
  line-height: 1;
  color: var(--muted);
  background: transparent;
}
.brief-choices {
  display: grid;
  gap: 8px;
}
.brief-choices button {
  text-align: left;
  padding: 13px 15px;
  font-size: 14.5px;
}
.brief-choices button.active {
  border-color: var(--accent);
  background: var(--soft);
  color: var(--accent);
  font-weight: 600;
}
.brief-count {
  font-size: 12.5px;
  margin: 12px 0 0;
}
.brief-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 13px 26px;
  border-top: var(--border-hair) solid var(--line);
  background: var(--sunken);
}
.brief-foot .muted {
  font-size: 12.5px;
}
