/* The console's own pages, in the platform UI's design (apps/demo/src/ui/styles.css):
   the same paper, ink and seal, the same faces, the same bar, panels, fields and buttons.
   These pages run no script, so everything here is plain CSS, light and dark. */

@font-face {
  font-family: "Outfit Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("fonts/outfit-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Outfit Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("fonts/outfit-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url("fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url("fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2");
}

:root {
  --paper: #f5f2ec;
  --surface: #ffffff;
  --surface-2: #efeae1;
  --ink: #0a0a0b;
  --text: #2a2724;
  --muted: #5f5a54;
  --line: #ddd5c9;
  --seal: #b5322b;
  --seal-deep: #8f2622;
  --seal-ink: #b5322b;
  --on-seal: #ffffff;
  --info: #2f5a8a;
  --info-soft: #e3ebf5;
  --ok: #2e6b4f;
  --ok-soft: #e2efe7;
  --warn: #8a5a0b;
  --warn-soft: #f6ead2;
  --bad: #b42318;
  --bad-soft: #f9e2df;
  --shadow: 0 1px 2px rgba(10, 10, 11, 0.06), 0 8px 24px rgba(10, 10, 11, 0.05);

  --display: "Outfit Variable", "Outfit", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --t-xs: 0.75rem;
  --t-sm: 0.875rem;
  --t-md: 1rem;
  --t-lg: 1.125rem;
  --t-xl: 1.375rem;
  --t-2xl: 1.75rem;
  --t-3xl: clamp(1.9rem, 3.4vw, 2.5rem);
  --radius: 6px;
  --gutter: clamp(16px, 3vw, 32px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0e0f12;
    --surface: #16171c;
    --surface-2: #1e2026;
    --ink: #f5f2ec;
    --text: #e4dfd6;
    --muted: #aaa39a;
    --line: #2f3139;
    --seal: #db5148;
    --seal-deep: #e87a72;
    --seal-ink: #e87a72;
    --on-seal: #0a0a0b;
    --info: #86b3e6;
    --info-soft: #1b2635;
    --ok: #74c99a;
    --ok-soft: #16281f;
    --warn: #e9b65e;
    --warn-soft: #2d2415;
    --bad: #f27b70;
    --bad-soft: #321a18;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0e0f12;
  --surface: #16171c;
  --surface-2: #1e2026;
  --ink: #f5f2ec;
  --text: #e4dfd6;
  --muted: #aaa39a;
  --line: #2f3139;
  --seal: #db5148;
  --seal-deep: #e87a72;
  --seal-ink: #e87a72;
  --on-seal: #0a0a0b;
  --info: #86b3e6;
  --info-soft: #1b2635;
  --ok: #74c99a;
  --ok-soft: #16281f;
  --warn: #e9b65e;
  --warn-soft: #2d2415;
  --bad: #f27b70;
  --bad-soft: #321a18;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  color-scheme: dark;
}

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

html,
body { margin: 0; }
html { height: 100%; }
body {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--text);
  font: 400 var(--t-md) / 1.55 var(--display);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  color: var(--ink);
  font-family: var(--display);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0;
  text-wrap: balance;
}
h1 { font-size: var(--t-3xl); font-weight: 650; }
h2 { font-size: var(--t-2xl); font-weight: 650; }
h3 { font-size: var(--t-xl); font-weight: 600; }
h4 { font-size: var(--t-lg); font-weight: 600; }

p { margin: 0; max-width: 68ch; }
a { color: var(--seal-ink); text-underline-offset: 2px; }
a:hover { color: var(--seal-deep); }
code, .mono { font-family: var(--mono); font-size: 0.86em; }
strong { color: var(--ink); font-weight: 600; }
:focus-visible { outline: 2px solid var(--seal); outline-offset: 2px; }

.small { font-size: var(--t-sm); color: var(--muted); }
.muted, .empty { color: var(--muted); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }

.eyebrow {
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 500 var(--t-xs) / 1.4 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.eyebrow::before { background: var(--seal); content: ""; height: 6px; width: 6px; }

/* ---------- the bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding-inline: var(--gutter);
  padding-block: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font: 700 0.95rem / 1 var(--display);
  letter-spacing: 0.22em;
  text-decoration: none;
}
.brand:hover { color: var(--ink); }
.brand svg { width: 18px; height: 20px; color: var(--seal); }
.brand .product { color: var(--muted); font-weight: 500; letter-spacing: 0.08em; }
.nav { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; }
.nav a {
  border-radius: var(--radius);
  color: var(--muted);
  font-size: var(--t-sm);
  font-weight: 500;
  padding: 8px 12px;
  text-decoration: none;
}
.nav a:hover { color: var(--ink); background: var(--surface-2); }
.topbar-account { display: flex; align-items: center; gap: 12px; }
.who { color: var(--muted); font: 400 var(--t-xs) / 1.4 var(--mono); }
form.sign-out { margin: 0; }

/* ---------- the page ---------- */

main.page {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding-inline: var(--gutter);
  padding-block: 32px 64px;
  flex: 1;
}
main.page > h1 { margin-bottom: 12px; }
main.page > h2 { margin: 32px 0 12px; font-size: var(--t-xl); }
main.page > p + p { margin-top: 10px; }

/* ---------- buttons, fields ---------- */

button,
.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--radius);
  cursor: pointer;
  font: 600 var(--t-sm) / 1 var(--display);
  padding: 11px 16px;
  text-decoration: none;
}
button:hover,
.btn:hover { border-color: var(--muted); color: var(--ink); }
.btn-primary,
button.btn-primary { background: var(--seal); border-color: var(--seal); color: var(--on-seal); }
.btn-primary:hover,
button.btn-primary:hover { background: var(--seal-deep); border-color: var(--seal-deep); color: var(--on-seal); }
.btn-sm { padding: 7px 10px; font-size: var(--t-xs); }
.btn-block { width: 100%; padding-block: 13px; font-size: var(--t-md); }

label,
.field { display: flex; flex-direction: column; gap: 6px; color: var(--ink); font-weight: 600; font-size: var(--t-sm); }
.field-label { color: var(--ink); font-weight: 600; font-size: var(--t-sm); }
input,
textarea,
select,
.input {
  width: 100%;
  min-width: 0;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font: 400 var(--t-md) / 1.4 var(--display);
  padding: 11px 12px;
}
input[type="hidden"] { display: none; }
textarea { min-height: 96px; resize: vertical; }
input:focus,
textarea:focus,
select:focus { border-color: var(--seal); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--seal) 18%, transparent); }
input[aria-invalid="true"] { border-color: var(--bad); }
form.stack { display: flex; flex-direction: column; gap: 14px; max-width: 40rem; }
.error { color: var(--bad); font-weight: 600; font-size: var(--t-sm); }

/* ---------- surfaces ---------- */

.panel,
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  margin: 16px 0;
  min-width: 0;
}
.card > * + * { margin-top: 10px; }
blockquote {
  margin: 6px 0 8px;
  padding: 6px 12px;
  border-left: 3px solid var(--line);
  color: var(--muted);
}
.refused { border-left: 3px solid var(--bad); }
.signal { border-left: 3px solid var(--warn); }
.figure { font-size: var(--t-xl); font-weight: 650; color: var(--ink); margin: 4px 0; }
dl.fields { display: grid; grid-template-columns: minmax(10rem, 14rem) 1fr; gap: 8px 16px; margin: 0; }
dl.fields dt { font-weight: 600; color: var(--muted); font-size: var(--t-sm); }
dl.fields dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

table.runs,
table.scores {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  font-size: var(--t-sm);
}
table.runs th,
table.runs td,
table.scores th,
table.scores td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.runs th,
table.scores th { font: 500 var(--t-xs) / 1.4 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); }
table.runs tr:last-child td,
table.scores tr:last-child td { border-bottom: 0; }

.status {
  display: inline-block;
  font: 500 var(--t-xs) / 1 var(--mono);
  letter-spacing: 0.04em;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  white-space: nowrap;
}
.status-awaiting_review,
.status-awaiting_measurement { background: var(--warn-soft); color: var(--warn); }
.status-analysing,
.status-writing { background: var(--info-soft); color: var(--info); }
.status-approved { background: var(--ok-soft); color: var(--ok); }
.status-declined,
.status-failed { background: var(--bad-soft); color: var(--bad); }

.verdict { font: 500 var(--t-xs) / 1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; }
.verdict-build { color: var(--ok); }
.verdict-defer { color: var(--warn); }
.verdict-decline { color: var(--bad); }

.decisions { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 16px; }
.decisions form { display: grid; gap: 8px; align-content: start; }
.decisions button { width: 100%; }
button.approve { background: var(--ok); border-color: var(--ok); color: var(--surface); }
button.revise { border-color: var(--warn); color: var(--warn); }
button.decline { border-color: var(--bad); color: var(--bad); }

/* ---------- signing in ---------- */

main.auth {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 48px;
  align-items: center;
  max-width: 1100px;
  padding-block: clamp(32px, 7vw, 88px) 64px;
}
.auth-intro { display: flex; flex-direction: column; gap: 18px; }
.auth-intro .display {
  color: var(--ink);
  font: 650 var(--t-3xl) / 1.12 var(--display);
  letter-spacing: -0.02em;
  max-width: 18ch;
  text-wrap: balance;
}
.auth-intro .lead { color: var(--muted); font-size: var(--t-lg); max-width: 46ch; }
.auth-points { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.auth-points li {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: baseline;
  color: var(--text);
  font-size: var(--t-sm);
}
.auth-points li::before {
  content: "";
  width: 8px;
  height: 8px;
  margin-left: 4px;
  background: var(--seal);
  transform: rotate(45deg);
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: clamp(22px, 4vw, 34px);
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 0;
}
.auth-card h1 { font-size: var(--t-2xl); }
.auth-card p { color: var(--text); }
.auth-card .small { color: var(--muted); }
.auth-card form { margin: 0; }
.auth-card .stack { max-width: none; }
main.auth.single { grid-template-columns: minmax(0, 520px); justify-content: center; }

@media (max-width: 820px) {
  main.auth { grid-template-columns: minmax(0, 1fr); gap: 28px; padding-block: 28px 48px; }
  .auth-intro .display { font-size: var(--t-2xl); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
