:root {
  --paper: #eef2f6;
  --sheet: #ffffff;
  --ink: #14233f;
  --ink-soft: #55637c;
  --rule: #d5dde7;
  --blue: #1d3fa6;
  --green: #0a7a4c;
  --amber: #a7620a;
  --red: #b3261e;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  color-scheme: light;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.5 "Schibsted Grotesk", ui-sans-serif, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, dl, dd, ul { margin: 0; padding: 0; }
ul { list-style: none; }
a { color: var(--blue); }
[hidden] { display: none !important; }

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

.button {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 7px 13px;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: transform 140ms var(--ease-out);
}
.button:active { transform: scale(0.97); }
.button:disabled { color: var(--ink-soft); opacity: 0.5; cursor: default; transform: none; }
.button-primary { background: var(--ink); color: #fff; }
.button-quiet { background: transparent; color: var(--ink); border-color: var(--rule); }
@media (hover: hover) and (pointer: fine) {
  .button-quiet:hover:not(:disabled) { background: var(--sheet); }
}

/* Top */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1160px;
  margin: 0 auto;
  padding: 20px 32px 0;
}
.brand { font-weight: 600; }

.page { max-width: 1160px; margin: 0 auto; padding: 0 32px 96px; }

/* Headline and heartbeat: the one loud thing on the page. */
.hero { padding: 72px 0 56px; }
#headline {
  font-size: clamp(2.5rem, 6.4vw, 4.75rem);
  line-height: 1.02;
  font-weight: 600;
  letter-spacing: -0.032em;
  max-width: 15em;
  text-wrap: balance;
}
#headline[data-status="delayed"] { color: var(--amber); }
#headline[data-status="problem"] { color: var(--red); }
.subline {
  margin-top: 20px;
  font-size: 1.25rem;
  line-height: 1.4;
  max-width: 44em;
  color: var(--ink-soft);
  min-height: 1.4em;
}
.heartbeat {
  display: grid;
  grid-template-columns: repeat(96, 1fr);
  gap: 3px;
  height: 72px;
  margin-top: 44px;
}
.heartbeat[data-reveal] {
  animation: reveal 700ms var(--ease-out) both;
}
@keyframes reveal {
  from { clip-path: inset(0 100% 0 0); }
  to { clip-path: inset(0 0 0 0); }
}
.tick { background: var(--rule); border-radius: 2px; opacity: 0.35; }
.tick[data-status="succeeded"] { background: var(--green); opacity: 1; }
.tick[data-status="failed"] { background: var(--red); opacity: 1; }
.tick[data-status="rejected"] { background: var(--amber); opacity: 1; }
.tick[data-status="running"] { background: var(--blue); opacity: 1; }
.heartbeat-key {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-top: 10px;
  font-size: 0.875rem;
  color: var(--ink-soft);
}

.tooltip {
  position: fixed;
  z-index: 5;
  transform: translate(-50%, -100%);
  background: var(--ink);
  color: #fff;
  font-size: 0.8125rem;
  line-height: 1.35;
  padding: 6px 9px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
}

/* Tally */
.tally { border-top: 1px solid var(--rule); padding-top: 28px; }
.tally-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}
.tally-grid dt { color: var(--ink-soft); font-size: 0.9375rem; }
.tally-grid dd {
  font-size: 2.25rem;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-top: 4px;
}
.tally-note { font-size: 0.875rem; color: var(--ink-soft); }
.tally-note[data-attention] { color: var(--red); }
.health, .outcomes { font-size: 0.9375rem; color: var(--ink-soft); }
.health { margin-top: 28px; }
.health b { font-weight: 500; color: var(--green); }
.health b[data-bad] { color: var(--red); }
.outcomes { margin-top: 4px; max-width: 70ch; }

/* Register */
.register { margin-top: 72px; }
.register-head {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.register-head h2 { font-size: 1.625rem; font-weight: 600; letter-spacing: -0.015em; }
.register-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
input {
  font: inherit;
  color: inherit;
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: 7px;
  padding: 7px 11px;
}
#search { width: 320px; max-width: 100%; }
.segment { display: inline-flex; background: #e0e6ee; border-radius: 8px; padding: 2px; }
.segment-button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: transform 140ms var(--ease-out);
}
.segment-button:active { transform: scale(0.97); }
.segment-button[aria-pressed="true"] { background: var(--sheet); color: var(--ink); }

.table-wrap { background: var(--sheet); border: 1px solid var(--rule); border-radius: 10px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 640px; }
th {
  text-align: left;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-soft);
  padding: 11px 16px;
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
}
td { padding: 13px 16px; border-bottom: 1px solid #e9edf2; vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { cursor: pointer; }
@media (hover: hover) and (pointer: fine) {
  tbody tr:hover { background: #f5f7fa; }
}
.numeric { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.tender-open {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  color: inherit;
  font: inherit;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 62ch;
}
.tender-organisation { color: var(--ink-soft); font-size: 0.875rem; margin-top: 2px; }
.register-empty { padding: 28px 2px; color: var(--ink-soft); }
.pager { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; color: var(--ink-soft); font-size: 0.9375rem; }
.pager-buttons { display: inline-flex; gap: 8px; }

/* Drawer */
.drawer {
  position: fixed;
  inset: 0 0 0 auto;
  height: 100dvh;
  max-height: none;
  width: min(560px, 100vw);
  max-width: none;
  margin: 0;
  border: 0;
  padding: 0;
  background: var(--sheet);
  color: var(--ink);
  box-shadow: -18px 0 50px rgb(20 35 63 / 0.16);
  transform: translateX(100%);
  transition:
    transform 200ms var(--ease-out),
    overlay 200ms allow-discrete,
    display 200ms allow-discrete;
}
.drawer[open] {
  transform: translateX(0);
  transition:
    transform 320ms var(--ease-drawer),
    overlay 320ms allow-discrete,
    display 320ms allow-discrete;
}
@starting-style {
  .drawer[open] { transform: translateX(100%); }
}
.drawer::backdrop {
  background: rgb(20 35 63 / 0);
  transition: background-color 200ms ease, overlay 200ms allow-discrete, display 200ms allow-discrete;
}
.drawer[open]::backdrop { background: rgb(20 35 63 / 0.28); }
@starting-style {
  .drawer[open]::backdrop { background: rgb(20 35 63 / 0); }
}
.drawer-inner { padding: 24px 28px 48px; }
.drawer-close { float: right; margin: 0 0 12px 16px; }
#drawer-title { font-size: 1.375rem; line-height: 1.25; font-weight: 600; letter-spacing: -0.012em; }
.drawer-organisation { color: var(--ink-soft); margin-top: 6px; clear: both; }
.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 20px;
  margin: 22px 0 30px;
  font-size: 0.9375rem;
}
.facts dt { color: var(--ink-soft); }
.facts dd { overflow-wrap: anywhere; }
.drawer h3 { font-size: 1rem; font-weight: 600; margin-bottom: 4px; }
.drawer-empty { color: var(--ink-soft); }
.document {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid #e9edf2;
}
.document-name { font-weight: 500; overflow-wrap: anywhere; }
.document-meta { color: var(--ink-soft); font-size: 0.8125rem; margin-top: 1px; }

/* Sign in */
.login-body { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.login { width: min(380px, 100%); }
.login h1 { font-size: 2.25rem; line-height: 1.1; font-weight: 600; letter-spacing: -0.025em; }
.login-lede { margin-top: 10px; color: var(--ink-soft); }
.login-form { margin-top: 28px; display: grid; gap: 6px; }
.login-form label { font-weight: 500; font-size: 0.9375rem; margin-top: 10px; }
.login-form input { width: 100%; padding: 10px 12px; }
.login-form .button { margin-top: 18px; padding: 10px 14px; }
.login-error { color: var(--red); font-size: 0.9375rem; margin-top: 12px; }

@media (max-width: 800px) {
  .topbar { padding: 16px 16px 0; }
  .page { padding: 0 16px 64px; }
  .hero { padding: 44px 0 40px; }
  .subline { font-size: 1.0625rem; }
  .heartbeat { gap: 1px; height: 56px; margin-top: 32px; }
  .tally-grid { grid-template-columns: repeat(2, 1fr); gap: 24px 20px; }
  .tally-grid dd { font-size: 1.75rem; }
  #search { width: 100%; }
  .register-tools { width: 100%; }
  .drawer-inner { padding: 18px 16px 40px; }
}

@media (prefers-reduced-motion: reduce) {
  .heartbeat[data-reveal] { animation: none; }
  .button:active, .segment-button:active { transform: none; }
  .drawer, .drawer[open] { transform: none; transition: opacity 150ms ease, overlay 150ms allow-discrete, display 150ms allow-discrete; opacity: 0; }
  .drawer[open] { opacity: 1; }
  @starting-style { .drawer[open] { opacity: 0; transform: none; } }
}
