/*
 * The benchmark site and console: the marketing site's ground and tokens,
 * mint for "cleared", coral for "refused", blue for structure, amber for
 * "estimate" and "draft". IBM Plex is self-hosted, copied from website/assets.
 * No inline styles anywhere: the server's CSP refuses them.
 */

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/ibm-plex-sans-400.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/ibm-plex-sans-500.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-400.woff2") format("woff2");
}

:root {
  color-scheme: dark;
  --bg: #07080c;
  --bg-raised: #0d1017;
  --bg-card: #11151e;
  --line: rgba(226, 232, 244, 0.09);
  --line-strong: rgba(226, 232, 244, 0.18);
  --text: #eef1f7;
  --text-2: #a9b1c1;
  --text-3: #6d7588;
  --mint: #6ef2c0;
  --mint-soft: rgba(110, 242, 192, 0.12);
  --blue: #7aa2ff;
  --blue-soft: rgba(122, 162, 255, 0.12);
  --coral: #ff8073;
  --coral-soft: rgba(255, 128, 115, 0.12);
  --amber: #ffc46b;
  --amber-soft: rgba(255, 196, 107, 0.12);
  --sans: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", monospace;
  --radius: 12px;
  --radius-small: 7px;
}

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

html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

body {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body.public {
  font-size: 17px;
}

a {
  color: inherit;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 0.2em;
}

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

a:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 2px;
}

h1,
h2,
h3 {
  font-weight: 500;
  line-height: 1.25;
  margin: 0 0 0.5em;
}

h1 {
  font-size: 28px;
}

h2 {
  font-size: 19px;
}

h3 {
  font-size: 16px;
}

p {
  margin: 0 0 0.75em;
}

code,
pre {
  font-family: var(--mono);
  font-size: 0.88em;
}

pre {
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: 12px;
  top: 12px;
  background: var(--bg-card);
  padding: 8px 12px;
  z-index: 10;
}

.muted {
  color: var(--text-2);
}

.small {
  font-size: 13px;
}

.error {
  color: var(--coral);
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.row > h1,
.row > h2,
.row > h3 {
  margin: 0;
}

/* Header */

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px 24px;
  background: rgba(7, 8, 12, 0.92);
  border-bottom: 1px solid var(--line);
}

.brand {
  font-weight: 500;
  font-size: 20px;
  text-decoration: none;
  letter-spacing: 0.01em;
}

.brand-llm {
  color: var(--mint);
}

.brand-sub {
  margin-left: 8px;
  color: var(--text-2);
  font-size: 15px;
  font-weight: 400;
}

.public .topbar {
  justify-content: space-between;
}

#nav {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
}

#nav[hidden] {
  display: none;
}

#nav a {
  text-decoration: none;
  color: var(--text-2);
}

#nav a.active,
#nav a:hover {
  color: var(--text);
}

#nav a.active {
  box-shadow: 0 2px 0 var(--mint);
}

.who {
  margin-left: auto;
  color: var(--text-3);
  font-size: 13px;
}

/* Buttons and forms */

button,
.button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: inherit;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-small);
  padding: 7px 14px;
  cursor: pointer;
  text-decoration: none;
}

button:hover,
.button:hover {
  border-color: var(--mint);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

button.primary,
.button.primary {
  background: var(--mint);
  color: var(--bg);
  border-color: var(--mint);
  font-weight: 500;
}

button.danger {
  border-color: var(--coral);
  color: var(--coral);
}

button.small,
.button.small {
  padding: 3px 10px;
  font-size: 13px;
}

label {
  display: block;
  margin: 0 0 12px;
  color: var(--text-2);
}

label.check {
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: var(--text);
  margin: 4px 0;
}

label.check.inline {
  display: inline-flex;
  margin-right: 16px;
}

input[type="email"],
input[type="password"],
input[type="number"],
input:not([type]) {
  display: block;
  width: 100%;
  max-width: 420px;
  margin-top: 4px;
  font: inherit;
  color: var(--text);
  background: var(--bg-raised);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-small);
  padding: 8px 10px;
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--mint);
}

fieldset {
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  padding: 8px 14px 10px;
  margin: 0 0 12px;
}

legend {
  color: var(--text-2);
  padding: 0 6px;
}

fieldset.tree label.check:not(:first-child) {
  margin-left: 22px;
}

/* Layout */

#view {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px;
}

.page-head {
  margin-bottom: 20px;
}

.crumbs {
  color: var(--text-3);
  font-size: 13px;
  margin-bottom: 4px;
}

.panel {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 16px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.grid-2 > .panel {
  margin-bottom: 0;
}

.grid-2 + .panel,
.grid-2 + h2 {
  margin-top: 16px;
}

.scroll-x {
  overflow-x: auto;
}

.notice {
  border-left: 3px solid var(--blue);
  padding-left: 12px;
}

.headline {
  border-left: 3px solid var(--mint);
  padding: 4px 0 4px 12px;
}

/* Tables */

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
}

th {
  color: var(--text-3);
  font-weight: 400;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

th.num {
  text-align: right;
}

tr.refused td:first-child code {
  color: var(--text-2);
}

tr.detail td {
  padding-top: 0;
  border-bottom: 1px solid var(--line-strong);
}

tr.detail summary {
  color: var(--text-3);
  font-size: 12px;
  cursor: pointer;
}

tr.unavailable td {
  color: var(--text-3);
}

table.bill {
  max-width: 820px;
  margin: 8px 0;
}

table.assumptions td:nth-child(2) {
  min-width: 280px;
}

/* Chips */

.chip {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.6;
  white-space: nowrap;
  border: 1px solid var(--line-strong);
  color: var(--text-2);
}

.chip-mint {
  color: var(--mint);
  background: var(--mint-soft);
  border-color: transparent;
}

.chip-coral {
  color: var(--coral);
  background: var(--coral-soft);
  border-color: transparent;
}

.chip-blue {
  color: var(--blue);
  background: var(--blue-soft);
  border-color: transparent;
}

.chip-amber {
  color: var(--amber);
  background: var(--amber-soft);
  border-color: transparent;
}

/* Scenario pages */

dl.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 4px 16px;
  margin: 0;
}

dl.facts dt {
  color: var(--text-3);
}

dl.facts dd {
  margin: 0;
}

pre.prompt {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  padding: 12px;
  max-height: 420px;
  overflow: auto;
}

details > summary {
  cursor: pointer;
  color: var(--text-2);
  margin: 8px 0;
}

.case,
.call {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  padding: 12px 14px;
  margin-bottom: 10px;
}

.call.outcome-pass {
  border-left: 3px solid var(--mint);
}

.call.outcome-fail,
.call.outcome-safety_fail {
  border-left: 3px solid var(--coral);
}

.call.outcome-invalid,
.call.outcome-error {
  border-left: 3px solid var(--amber);
}

.message {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 8px;
  margin: 6px 0;
}

.message .role {
  color: var(--text-3);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding-top: 2px;
}

.message-assistant pre {
  color: var(--text-2);
}

pre.output {
  background: var(--bg-raised);
  border-radius: var(--radius-small);
  padding: 8px 10px;
  margin: 6px 0;
}

ul.checks {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--text-2);
  font-size: 13px;
}

.problems {
  border-color: var(--coral);
}

.models {
  columns: 2 320px;
}

.progress {
  width: 100%;
  max-width: 520px;
  height: 8px;
  accent-color: var(--mint);
  margin: 6px 0 8px;
}

/* Sign-in */

.login {
  max-width: 420px;
  margin: 8vh auto 0;
}

.login form {
  margin-top: 20px;
}

/* Public page */

.public-main {
  max-width: 760px;
  margin: 0 auto;
  padding: 10vh 24px 48px;
}

.public-main h1 {
  font-size: clamp(30px, 5vw, 44px);
  line-height: 1.15;
  margin-bottom: 20px;
}

.eyebrow {
  color: var(--mint);
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  margin-bottom: 16px;
}

.lead {
  color: var(--text-2);
  font-size: 19px;
  margin-bottom: 36px;
}

.principles {
  border-top: 1px solid var(--line);
  padding-top: 28px;
  margin-bottom: 28px;
}

.principles ol {
  padding-left: 20px;
  margin: 0;
}

.principles li {
  margin-bottom: 14px;
  color: var(--text-2);
}

.principles li strong {
  color: var(--text);
  font-weight: 500;
}

.public-foot {
  max-width: 760px;
  margin: 0 auto;
  padding: 24px;
  border-top: 1px solid var(--line);
}

@media (max-width: 720px) {
  .topbar {
    padding: 10px 16px;
    flex-wrap: wrap;
  }

  #nav {
    flex-wrap: wrap;
    gap: 10px;
  }

  #view {
    padding: 16px;
  }

  .message {
    grid-template-columns: 1fr;
  }
}
