/* Marin customer dashboard.
   A dark, warm console: Graphite surfaces layered on a deeper canvas,
   hairline borders, Geist for text and Geist Mono for labels, ids and
   figures. Yellow Lumen is the single accent: the mark, where you are,
   focus, live data in charts, and the one "launch" action on a page.
   Everything else is neutral. Tokens first. */

/* ---------- Design tokens ---------- */
:root {
  /* Brand palette */
  --lumen: #FBE708;
  --graphite: #191715;
  --concrete: #D0CBC8;
  --clean-room: #FFFFFF;

  /* Surfaces, darkest to lightest: the navigation rail, the page, a
     panel, something raised on a panel, and its hover. */
  --bg-rail: #0D0C0B;
  --bg: #121110;
  --surface: var(--graphite);
  --surface-raised: #22201D;
  --surface-hover: #2B2825;
  --surface-inset: #0F0E0D;
  --line: rgb(255 246 235 / 0.08);
  --line-strong: rgb(255 246 235 / 0.15);
  --line-hover: rgb(255 246 235 / 0.28);

  /* Text */
  --text: #F5F3F0;
  --text-muted: #B3ADA7;
  --text-dim: #857F79;
  --on-lumen: #14120F;

  /* Filled actions and selected options. */
  --action-fill: #F2EFEB;
  --action-fill-hover: var(--clean-room);

  /* Lumen as a tint: active marks, focus rings, highlights. */
  --lumen-soft: rgb(251 231 8 / 0.12);
  --lumen-line: rgb(251 231 8 / 0.4);

  /* Status (independent of Lumen, which is never "error") */
  --status-critical: #FF6B6B;
  --status-ok: #46D08C;
  --status-warn: #FFA94D;
  --status-info: #74B4FF;

  /* Type */
  --font-body: "Geist", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --weight-light: 400;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --tracking-display: -0.022em;
  --tracking-tag: 0.06em;

  /* Rhythm */
  --space: 0.5rem;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-control: 8px;
  --radius-pill: 999px;
  --gutter: clamp(1rem, 3vw, 2.25rem);
  --content-width: 82rem;
  --rail-width: 16.75rem;
  --header-height: 4rem;

  /* Controls: one height for buttons, fields and selects. */
  --control-height: 2.4286rem;
  --control-height-sm: 2rem;

  /* Depth */
  --shadow-pop: 0 0 0 1px rgb(0 0 0 / 0.4), 0 12px 32px -4px rgb(0 0 0 / 0.55), 0 4px 10px rgb(0 0 0 / 0.35);
  --shadow-control: inset 0 1px 0 rgb(255 255 255 / 0.04), 0 1px 2px rgb(0 0 0 / 0.3);

  /* Motion */
  --transition: 140ms cubic-bezier(0.4, 0, 0.2, 1);
}

@font-face {
  font-family: "Geist";
  src: url("/static/fonts/geist-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "Geist Mono";
  src: url("/static/fonts/geist-mono-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

/* Google's sign-in button guidelines require Roboto Medium for its label. */
@font-face {
  font-family: "Roboto";
  src: url("/static/fonts/roboto-latin-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

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

html {
  color-scheme: dark;
  font-size: 87.5%;
  scrollbar-color: var(--surface-hover) transparent;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: var(--weight-regular);
  font-size: 1rem;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-display);
  line-height: 1.2;
  text-wrap: balance;
}

h1 { font-size: 1.5rem; }
h2 { font-size: 1.0714rem; letter-spacing: -0.012em; }
h3 { font-size: 1rem; letter-spacing: -0.006em; }

p { margin: 0; text-wrap: pretty; }

a {
  color: inherit;
  text-decoration-color: var(--line-hover);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  transition: color var(--transition), text-decoration-color var(--transition);
}

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

code,
kbd,
samp,
pre {
  font-family: var(--font-mono);
}

code {
  font-size: 0.9em;
  padding: 0.12em 0.4em;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-raised);
  color: var(--text);
}

pre code {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  font-size: inherit;
}

code:empty {
  display: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

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

::selection {
  background: var(--lumen);
  color: var(--on-lumen);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* A label: small mono capitals. Column heads, tile captions, badges. */
.tag {
  font-family: var(--font-mono);
  font-size: 0.7857rem;
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-tag);
  text-transform: uppercase;
  color: var(--text-dim);
}

.tag.pending {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: var(--space);
  padding: 0.25rem 0.625rem;
  border: 1px solid var(--lumen-line);
  border-radius: var(--radius-pill);
  background: var(--lumen-soft);
  color: var(--lumen);
}

.tag.pending::before {
  content: "";
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: currentColor;
}

/* ---------- Actions ---------- */
/* One button shape. Filled light for the page's primary action, Lumen for
   launching something, a quiet outline for the rest. */
.action-primary,
.action-secondary,
.action-danger,
.action-launch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: var(--control-height);
  padding: 0 0.9286rem;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  font-weight: var(--weight-medium);
  font-size: 0.9286rem;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.action-primary:active,
.action-secondary:active,
.action-danger:active,
.action-launch:active {
  transform: translateY(0.5px);
}

.action-primary {
  border-color: var(--action-fill);
  background: var(--action-fill);
  color: var(--on-lumen);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.4);
}

.action-primary:hover {
  background: var(--action-fill-hover);
  border-color: var(--action-fill-hover);
  color: var(--on-lumen);
}

/* Launching a model: the page's next step, in Lumen. One per view. */
.action-launch {
  border-color: var(--lumen);
  background: var(--lumen);
  color: var(--on-lumen);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 0 0 0 var(--lumen-soft);
}

.action-launch:hover {
  background: #FFF04A;
  border-color: #FFF04A;
  color: var(--on-lumen);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 0 0 4px var(--lumen-soft);
}

/* A smaller button for actions repeated down a table's rows. */
.action-sm {
  height: var(--control-height-sm);
  padding: 0 0.7143rem;
  gap: 0.375rem;
  font-size: 0.8571rem;
}

/* Line icons inside buttons and links, in the text's color. */
.icon {
  flex: none;
  width: 1.1em;
  height: 1.1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.action-secondary {
  border-color: var(--line-strong);
  background: rgb(255 246 235 / 0.03);
  color: var(--text);
  box-shadow: var(--shadow-control);
}

.action-secondary:hover {
  border-color: var(--line-hover);
  background: var(--surface-hover);
  color: var(--text);
}

button:disabled,
button[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---------- Fields ---------- */
/* Text fields and selects, everywhere: set into the panel, a Lumen ring
   on focus. */
input[type="email"],
input[type="password"],
input[type="text"],
input[type="url"],
input[type="number"],
input[type="date"],
input[type="search"],
select,
textarea {
  /* Never wider than its column, however long an option reads. */
  min-width: 0;
  max-width: 100%;
  height: var(--control-height);
  padding: 0 0.8571rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background-color: var(--surface-inset);
  color: var(--text);
  font: inherit;
  box-shadow: inset 0 1px 2px rgb(0 0 0 / 0.25);
  transition: border-color var(--transition), box-shadow var(--transition), background-color var(--transition);
}

textarea {
  height: auto;
  padding-block: 0.6rem;
  line-height: 1.5;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-dim);
  opacity: 1;
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--line-hover);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--lumen);
  outline: none;
  box-shadow: inset 0 1px 2px rgb(0 0 0 / 0.25), 0 0 0 3px var(--lumen-soft);
}

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

/* A field with suggestions wears the select's chevron; the browser's own
   indicator stays, invisible, to open the list. */
input[list]::-webkit-calendar-picker-indicator {
  opacity: 0;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: 0.55;
  cursor: pointer;
}

select,
input[list] {
  padding-right: 2.25rem;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23B3ADA7' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
  background-position: right 0.625rem center;
  background-size: 1rem 1rem;
  background-repeat: no-repeat;
  text-overflow: ellipsis;
}

/* ---------- Sign-in ---------- */
/* One card in the middle of a quiet field: the mark, a Lumen glow behind
   it, and the two ways in. */
body:has(> .auth),
body:has(> .error-page) {
  background:
    radial-gradient(60rem 30rem at 50% -8rem, rgb(251 231 8 / 0.07), transparent 70%),
    radial-gradient(circle at 1px 1px, rgb(255 246 235 / 0.055) 1px, transparent 0) 0 0 / 28px 28px,
    var(--bg);
}

.auth {
  flex: 1;
  display: grid;
  align-content: center;
  gap: calc(var(--space) * 2.5);
  width: min(100% - 2rem, 27rem);
  margin: 2rem auto;
}

.auth-header {
  display: grid;
  justify-items: center;
  gap: calc(var(--space) * 2.5);
  margin-bottom: var(--space);
  text-align: center;
}

.auth-header h1 {
  font-size: 1.7143rem;
}

.auth-form,
.auth > .google-signin {
  position: relative;
}

.auth-form {
  display: grid;
  gap: calc(var(--space) * 2.5);
  padding: 1.75rem;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  background: var(--surface);
  box-shadow: 0 24px 60px -20px rgb(0 0 0 / 0.6);
}

.auth-form fieldset {
  display: grid;
  margin: 0;
  padding: 0;
  border: 0;
}

/* Labels sit close to their field; fields sit apart from each other. */
.auth-form label {
  margin-bottom: calc(var(--space) * 0.75);
  font-size: 0.9286rem;
  font-weight: var(--weight-medium);
  color: var(--text-muted);
}

.auth-form input {
  height: 2.75rem;
}

.auth-form input + label {
  margin-top: calc(var(--space) * 2);
}

.auth-form .action-primary {
  justify-self: stretch;
  height: 2.75rem;
  font-size: 1rem;
}

/* "Sign in with Google": Google's dark-theme button. Its colours and type
   come from Google's branding guidelines, not our tokens. */
.google-signin {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid #8E918F;
  border-radius: 4px;
  background: #131314;
  color: #E3E3E3;
  font-family: "Roboto", system-ui, sans-serif;
  font-weight: 500;
  font-size: 14px;
  line-height: 20px;
  text-decoration: none;
  transition: background-color var(--transition);
}

.google-signin:hover {
  background: #1F1F21;
  color: #E3E3E3;
}

/* Divider between the two ways in: hairlines either side of the label. */
.auth-or {
  display: flex;
  align-items: center;
  gap: calc(var(--space) * 2);
  color: var(--text-dim);
  font-size: 0.8571rem;
}

.auth-or::before,
.auth-or::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--line-strong);
}

.form-error {
  padding: 0.625rem 0.875rem;
  border: 1px solid color-mix(in srgb, var(--status-critical) 35%, transparent);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--status-critical) 10%, transparent);
  color: #FFB3B3;
  font-size: 0.9286rem;
}

/* ---------- App shell ---------- */
/* A rail of navigation on the left, a slim bar naming the page, and the
   page itself in a centred column. On a phone the rail folds into a menu
   under the bar. */
.app {
  flex: 1;
  display: grid;
  /* Never wider than the screen, whatever a page holds. */
  min-width: 0;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto 1fr;
  grid-template-areas:
    "nav"
    "header"
    "main";
}

.app-nav {
  grid-area: nav;
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 calc(var(--space) * 2);
  padding: 0.625rem var(--gutter);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-rail) 88%, transparent);
  backdrop-filter: blur(14px) saturate(1.4);
}

/* Narrow screens: the brand and a menu button; the rest opens below.
   A checkbox toggles it, so it needs no script. */
.nav-toggle {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.nav-toggle-label {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  margin-left: auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background: rgb(255 246 235 / 0.03);
  cursor: pointer;
  transition: border-color var(--transition), background-color var(--transition);
}

/* Three bars, drawn as one bar and its two shadows. */
.nav-toggle-label::before {
  content: "";
  width: 1.0714rem;
  height: 1.5px;
  border-radius: 1px;
  background: var(--text);
  box-shadow: 0 -5px 0 var(--text), 0 5px 0 var(--text);
  transition: box-shadow var(--transition);
}

.nav-toggle:checked + .nav-toggle-label {
  border-color: var(--line-hover);
  background: var(--surface-hover);
}

/* Open: the bars close to one, a cue that the menu folds back up. */
.nav-toggle:checked + .nav-toggle-label::before {
  box-shadow: 0 0 0 var(--text), 0 0 0 var(--text);
}

.nav-toggle:focus-visible + .nav-toggle-label {
  outline: 2px solid var(--lumen);
  outline-offset: 2px;
}

.nav-panel {
  display: none;
  flex-basis: 100%;
  gap: calc(var(--space) * 2.25);
  max-height: calc(100dvh - 4rem);
  overflow-y: auto;
  padding-block: calc(var(--space) * 1.5) calc(var(--space) * 2);
}

.nav-toggle:checked ~ .nav-panel {
  display: grid;
  align-content: start;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6875rem;
  min-height: 2.5rem;
  color: var(--text);
  text-decoration: none;
}

.brand:hover {
  color: var(--text);
}

.brand img {
  width: 1.9286rem;
  height: auto;
}

.brand-name {
  font-size: 1.2857rem;
  font-weight: var(--weight-semibold);
  letter-spacing: -0.03em;
}

.nav-group {
  display: grid;
  gap: 0.3125rem;
}

.nav-group .tag {
  display: block;
  padding-inline: 0.7143rem;
  font-size: 0.7143rem;
  line-height: 1.6;
}

.nav-items {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-items a {
  display: flex;
  align-items: center;
  gap: 0.7143rem;
  min-height: 2.2857rem;
  padding: 0.25rem 0.7143rem;
  border-radius: var(--radius-control);
  color: var(--text-muted);
  font-weight: var(--weight-medium);
  text-decoration: none;
  transition: color var(--transition), background-color var(--transition);
}

.nav-items a .icon {
  width: 1.1429rem;
  height: 1.1429rem;
  color: var(--text-dim);
  transition: color var(--transition);
}

.nav-items a:hover {
  color: var(--text);
  background: rgb(255 246 235 / 0.05);
}

.nav-items a:hover .icon {
  color: var(--text-muted);
}

/* Where you are: a lifted row and a Lumen icon. */
.nav-items a[aria-current="page"] {
  color: var(--text);
  background: rgb(255 246 235 / 0.08);
  box-shadow: inset 0 0 0 1px var(--line);
}

.nav-items a[aria-current="page"] .icon {
  color: var(--lumen);
}

/* The version, at the foot of the rail. */
.nav-foot {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.7143rem 0;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.7857rem;
}

.app-header {
  grid-area: header;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: calc(var(--space) * 2);
  min-height: 3.5rem;
  padding: var(--space) var(--gutter);
  border-bottom: 1px solid var(--line);
}

.app-header h1 {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-size: 1.2857rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-menu {
  position: relative;
  flex: none;
  min-width: 0;
}

.profile-menu summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: min(18rem, 46vw);
  height: var(--control-height-sm);
  padding: 0 0.625rem 0 0.3125rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: rgb(255 246 235 / 0.03);
  color: var(--text-muted);
  font-size: 0.8571rem;
  font-weight: var(--weight-medium);
  cursor: pointer;
  list-style: none;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  transition: border-color var(--transition), color var(--transition), background-color var(--transition);
}

/* A plain disc stands in for a portrait. */
.profile-menu summary::before {
  content: "";
  flex: none;
  width: 1.4286rem;
  height: 1.4286rem;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 38%, var(--on-lumen) 0 22%, transparent 23%),
    radial-gradient(ellipse 60% 44% at 50% 100%, var(--on-lumen) 0 98%, transparent 100%),
    linear-gradient(140deg, var(--lumen), #F5B800);
}

.profile-menu summary::-webkit-details-marker {
  display: none;
}

.profile-menu summary:hover,
.profile-menu[open] summary {
  border-color: var(--line-hover);
  background: var(--surface-hover);
  color: var(--text);
}

.profile-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.375rem);
  z-index: 40;
  display: grid;
  gap: 0.125rem;
  min-width: max(100%, 11rem);
  padding: 0.3125rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  box-shadow: var(--shadow-pop);
  animation: pop-in 120ms ease-out;
}

.profile-menu-panel a,
.profile-menu-panel button {
  display: block;
  width: 100%;
  padding: 0.4286rem 0.625rem;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--text);
  font-size: 0.9286rem;
  text-align: left;
  text-decoration: none;
}

.profile-menu-panel a:hover,
.profile-menu-panel button:hover {
  background: var(--surface-hover);
  color: var(--text);
}

/* On a phone the menu is the disc alone; the address is in the panel's
   width, not the bar's. */
@media (max-width: 40rem) {
  .profile-menu summary {
    gap: 1rem;
    width: calc(1.4286rem + 0.625rem + 2px);
    padding-right: 0;
    text-overflow: clip;
  }

  .profile-menu-panel {
    min-width: 11rem;
  }
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}

.app-main {
  container: app-main / inline-size;
  grid-area: main;
  display: grid;
  align-content: start;
  gap: calc(var(--space) * 2.5);
  width: 100%;
  max-width: calc(var(--content-width) + var(--gutter) * 2);
  margin-inline: auto;
  padding: calc(var(--space) * 3) var(--gutter) calc(var(--space) * 8);
}

@media (min-width: 60rem) {
  .app {
    grid-template-columns: var(--rail-width) minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    /* The rail's colour runs the page's full height, however far it scrolls. */
    background: linear-gradient(to right, var(--bg-rail) var(--rail-width), transparent 0);
    grid-template-areas:
      "nav header"
      "nav main";
  }

  .app-nav {
    position: sticky;
    top: 0;
    height: 100dvh;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: calc(var(--space) * 2);
    padding: 0.875rem 0.75rem 1rem;
    overflow-y: auto;
    border-bottom: 0;
    border-right: 1px solid var(--line);
    background: var(--bg-rail);
    backdrop-filter: none;
    scrollbar-width: thin;
  }

  .brand {
    min-height: 2.5rem;
    padding-inline: 0.7143rem;
  }

  .nav-toggle-label {
    display: none;
  }

  .nav-panel,
  .nav-toggle:checked ~ .nav-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: calc(var(--space) * 2.5);
    max-height: none;
    overflow: visible;
    padding: 0;
  }

  /* The version sinks to the bottom of the rail. */
  .nav-foot {
    margin-top: auto;
    padding-top: var(--space);
  }

  .app-header {
    position: sticky;
    top: 0;
    z-index: 20;
    min-height: var(--header-height);
    padding-inline: max(var(--gutter), (100% - var(--content-width)) / 2);
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: blur(14px) saturate(1.4);
  }

  .app-header h1 {
    font-size: 1.4286rem;
  }
}

/* ---------- Panels ---------- */
.panel {
  display: grid;
  align-content: start;
  gap: calc(var(--space) * 1.75);
  min-width: 0;
  padding: 1.375rem 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 1px 0 rgb(255 246 235 / 0.02) inset, 0 1px 2px rgb(0 0 0 / 0.2);
}

.panel p {
  max-width: 68ch;
  color: var(--text-muted);
}

.panel > h2 {
  color: var(--text);
}

/* Nothing here yet: the panel speaks more quietly, on a dashed border,
   with the mark's dot above its heading. */
.empty-state {
  justify-items: start;
  padding: 2.5rem clamp(1.5rem, 5vw, 3rem);
  border-style: dashed;
  border-color: var(--line-strong);
  background:
    radial-gradient(40rem 16rem at 0% 0%, rgb(251 231 8 / 0.045), transparent 70%),
    var(--surface);
}

.empty-state::before {
  content: "";
  width: 2.5rem;
  height: 2.5rem;
  margin-bottom: 0.25rem;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background:
    radial-gradient(circle at 50% 50%, var(--lumen) 0 0.25rem, transparent calc(0.25rem + 1px)),
    var(--surface-raised);
}

.empty-state h2 {
  color: var(--text);
  font-size: 1.2857rem;
}

/* The card on file: the last four digits read as a figure. */
.panel .card-on-file {
  color: var(--text);
}

.card-on-file strong {
  font-family: var(--font-mono);
  font-weight: var(--weight-medium);
  font-variant-numeric: tabular-nums;
}

/* The overview's Get started guide: numbered cards, closed once, gone for
   good. */
.get-started {
  background:
    radial-gradient(50rem 18rem at 100% 0%, rgb(251 231 8 / 0.06), transparent 70%),
    var(--surface);
}

.steps {
  counter-reset: step;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13.5rem), 1fr));
  gap: calc(var(--space) * 1.5);
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--text-muted);
}

.steps li {
  counter-increment: step;
  display: block;
  padding: 0.875rem 1rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgb(0 0 0 / 0.22);
  line-height: 1.5;
}

.steps li::before {
  content: counter(step, decimal-leading-zero);
  display: block;
  margin-bottom: 0.5rem;
  color: var(--lumen);
  font-family: var(--font-mono);
  font-size: 0.7857rem;
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-tag);
}

.steps a {
  color: var(--text);
  font-weight: var(--weight-medium);
}

.get-started-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: calc(var(--space) * 2);
}

.get-started-header form {
  margin: 0;
}

.close-button {
  display: grid;
  place-items: center;
  width: var(--control-height-sm);
  height: var(--control-height-sm);
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition), background-color var(--transition);
}

.close-button:hover,
.close-button:focus-visible {
  border-color: var(--line-strong);
  background: var(--surface-hover);
  color: var(--text);
}

/* An ×, drawn with two strokes. */
.close-button::before {
  content: "";
  width: 0.875rem;
  height: 0.875rem;
  background:
    linear-gradient(45deg, transparent calc(50% - 0.75px), currentColor calc(50% - 0.75px), currentColor calc(50% + 0.75px), transparent calc(50% + 0.75px)),
    linear-gradient(-45deg, transparent calc(50% - 0.75px), currentColor calc(50% - 0.75px), currentColor calc(50% + 0.75px), transparent calc(50% + 0.75px));
}

/* ---------- Headline figures ---------- */
/* Tiles and panels in even rows: the column count divides the number of
   items at every width, so no row is ever left part-filled. */
.tiles {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: calc(var(--space) * 2);
  margin: 0;
}

@container app-main (min-width: 34rem) {
  .tiles--2,
  .tiles--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@container app-main (min-width: 52rem) {
  .tiles--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@container app-main (min-width: 64rem) {
  .tiles--4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  /* The twelve-week grid keeps its size; the models take the rest. */
  .tiles--2:has(> .chart-panel) {
    grid-template-columns: minmax(0, 29rem) minmax(0, 1fr);
  }
}

.stat {
  display: grid;
  align-content: start;
  gap: 0.5rem;
  min-width: 0;
  padding: 1.25rem 1.375rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 1px 0 rgb(255 246 235 / 0.02) inset, 0 1px 2px rgb(0 0 0 / 0.2);
}

.stat dt {
  margin: 0;
}

.stat-value {
  margin: 0;
  font-size: 2.2857rem;
  font-weight: var(--weight-semibold);
  letter-spacing: -0.035em;
  line-height: 1.1;
  color: var(--text);
}

.stat-value--pending {
  color: var(--text-dim);
  font-weight: var(--weight-regular);
}

/* Totals inside one panel: figures side by side, hairlines between. */
.panel.stats {
  padding: 0;
}

.panel.stats > dl {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  margin: 0;
}

.panel.stats .stat {
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}

.panel.stats .stat + .stat {
  box-shadow: -1px 0 0 var(--line), 0 -1px 0 var(--line);
}

/* ---------- Overview charts ---------- */
/* Drawn on the server as SVG; colours and motion live here. Lumen marks
   activity, neutral greys the rest. */
.stat-change {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
  margin: 0;
  color: var(--text-dim);
  font-size: 0.8571rem;
}

.stat-change-badge {
  padding: 0.0625rem 0.4375rem;
  border-radius: var(--radius-pill);
  background: rgb(255 246 235 / 0.07);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.7857rem;
  font-weight: var(--weight-medium);
}

.stat-change--up {
  background: color-mix(in srgb, var(--status-ok) 14%, transparent);
  color: var(--status-ok);
}

.stat-change--down {
  background: color-mix(in srgb, var(--status-critical) 13%, transparent);
  color: var(--status-critical);
}

.stat-chart {
  display: grid;
  gap: 0.5rem;
  margin: 0.375rem 0 0;
}

.stat-chart svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart-note {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.8571rem;
}

/* The month's requests: a bar a day, today in Lumen with the mark's dot. */
.chart-day {
  fill: rgb(255 246 235 / 0.26);
  transform-box: fill-box;
  transform-origin: bottom;
  animation: chart-grow 700ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.chart-day--today {
  fill: var(--lumen);
}

.chart-day--future {
  fill: rgb(255 246 235 / 0.07);
  animation: none;
}

.chart-today {
  fill: var(--lumen);
  animation: chart-fade 400ms 600ms both;
}

/* Split bars: tokens by kind, and the month's models. */
.chart-split {
  overflow: hidden;
  height: 0.625rem;
  border-radius: var(--radius-pill);
  background: rgb(255 246 235 / 0.07);
}

.chart-split--wide {
  height: 0.875rem;
}

.chart-split--empty {
  height: 0.875rem;
}

.chart-split svg {
  display: block;
  width: 100%;
  height: 100%;
}

.chart-segment {
  transform-box: view-box;
  transform-origin: left;
  animation: chart-sweep 900ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  stroke: var(--surface);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.chart-shade-1 { fill: var(--lumen); background: var(--lumen); }
.chart-shade-2 { fill: #B9A91A; background: #B9A91A; }
.chart-shade-3 { fill: #7A7020; background: #7A7020; }
.chart-shade-4 { fill: #8E8883; background: #8E8883; }
.chart-shade-5 { fill: #56514D; background: #56514D; }

/* Keys: one dot each, lit when used this week. */
.chart-key {
  fill: none;
  stroke: var(--line-hover);
  stroke-width: 1.5;
}

.chart-key--lit {
  fill: var(--lumen);
  stroke: none;
  animation: chart-fade 500ms both;
}

.stat-chart .chart-keys {
  max-width: 14rem;
}

.chart-panel {
  align-content: start;
  gap: calc(var(--space) * 2);
}

.chart-grid {
  display: block;
  width: 100%;
  max-width: 26rem;
  height: auto;
}

.chart-label {
  fill: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 4.5px;
  letter-spacing: 0.04em;
}

.chart-cell {
  animation: chart-fade 600ms both;
}

.chart-level-0 { fill: rgb(255 246 235 / 0.07); background: rgb(255 246 235 / 0.07); }
.chart-level-1 { fill: #4A4514; background: #4A4514; }
.chart-level-2 { fill: #857A12; background: #857A12; }
.chart-level-3 { fill: #C4B40E; background: #C4B40E; }
.chart-level-4 { fill: var(--lumen); background: var(--lumen); }

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
}

.chart-swatch {
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 3px;
}

.chart-models {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--text-muted);
  font-size: 0.9286rem;
}

.chart-models li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.chart-models code {
  overflow: hidden;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-share {
  margin-left: auto;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.8571rem;
}

@keyframes chart-grow {
  from { transform: scaleY(0); }
}

@keyframes chart-sweep {
  from { transform: scaleX(0); }
}

@keyframes chart-fade {
  from { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .chart-day,
  .chart-today,
  .chart-segment,
  .chart-key--lit,
  .chart-cell,
  .profile-menu-panel,
  .org-switcher-panel {
    animation: none;
  }
}

/* ---------- Tables and facts ---------- */
/* On a phone a wide table scrolls inside its panel, not the page. */
.panel:has(> .data-table) {
  /* Positioned, so visually hidden labels scroll with it too. */
  position: relative;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  padding: 0 1rem 0.625rem 0;
  text-align: left;
  font-family: var(--font-mono);
  font-size: 0.7857rem;
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-tag);
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--text-dim);
  border-bottom: 1px solid var(--line-strong);
}

.data-table td {
  padding: 0.75rem 1rem 0.75rem 0;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.data-table tbody tr:last-child > td,
.data-table tbody tr:last-child > th {
  border-bottom-color: transparent;
}

.data-table tbody:not(:last-child) tr:last-child > td,
.data-table tbody:not(:last-child) tr:last-child > th {
  border-bottom-color: var(--line);
}

.data-table code {
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-muted);
}

.data-table time {
  white-space: nowrap;
}

/* A role or state: a small pill. */
.role {
  display: inline-block;
  padding: 0.0625rem 0.5625rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: rgb(255 246 235 / 0.04);
  font-size: 0.8571rem;
  font-weight: var(--weight-medium);
  color: var(--text-muted);
  white-space: nowrap;
}

.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: calc(var(--space) * 1.25) calc(var(--space) * 4);
  margin: 0;
}

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

.facts dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

/* ---------- Error page ---------- */
.error-page {
  flex: 1;
  display: grid;
  place-content: center;
  justify-items: start;
  gap: calc(var(--space) * 2);
  width: min(100% - 2rem, 34rem);
  margin: 2rem auto;
}

.error-page h1 {
  font-size: 2.1429rem;
  letter-spacing: -0.03em;
}

.error-page .tag {
  padding: 0.25rem 0.625rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text-muted);
}

.error-page p:not(.tag) {
  color: var(--text-muted);
  font-size: 1.0714rem;
}

.error-page .action-secondary {
  margin-top: var(--space);
}

/* ---------- Footer ---------- */
/* Pages without the rail (sign-in, the organizations hub, errors) end
   with the mark and the version. */
.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: calc(var(--space) * 2.5) var(--gutter);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.7857rem;
}

/* ---------- Organization switcher ---------- */
.org-switcher {
  position: relative;
}

.org-switcher summary {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  min-height: 2.75rem;
  padding: 0.375rem 0.75rem 0.375rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgb(255 246 235 / 0.035);
  color: var(--text);
  font-weight: var(--weight-medium);
  cursor: pointer;
  list-style: none;
  transition: border-color var(--transition), background-color var(--transition);
}

.org-switcher summary:hover,
.org-switcher[open] summary {
  border-color: var(--line-strong);
  background: rgb(255 246 235 / 0.07);
}

.org-switcher summary::-webkit-details-marker {
  display: none;
}

/* The organization's tile: the mark's dot on Lumen-tinted Graphite. */
.org-switcher summary::before {
  content: "";
  flex: none;
  width: 1.7143rem;
  height: 1.7143rem;
  border: 1px solid var(--lumen-line);
  border-radius: 6px;
  background:
    radial-gradient(circle at 50% 50%, var(--lumen) 0 0.2rem, transparent calc(0.2rem + 0.5px)),
    var(--lumen-soft);
}

/* Up-and-down chevrons: this opens a list. */
.org-switcher summary::after {
  content: "";
  flex: none;
  width: 1rem;
  height: 1rem;
  margin-left: auto;
  background: var(--text-dim);
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 6 3-3 3 3M5 10l3 3 3-3'/%3E%3C/svg%3E") center / contain no-repeat;
}

.org-switcher-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.org-switcher-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 0.375rem);
  z-index: 40;
  display: grid;
  gap: 0.25rem;
  min-width: 14rem;
  padding: 0.3125rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  box-shadow: var(--shadow-pop);
  animation: pop-in 120ms ease-out;
}

.org-switcher-panel ul {
  display: grid;
  gap: 0.125rem;
  margin: 0;
  padding: 0 0 0.3125rem;
  border-bottom: 1px solid var(--line);
  list-style: none;
}

.org-switcher-panel button,
.org-current,
.org-switcher-panel > a {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0.4286rem 0.625rem;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--text-muted);
  font-size: 0.9286rem;
  text-align: left;
  text-decoration: none;
}

.org-current {
  color: var(--text);
  font-weight: var(--weight-medium);
}

/* A tick beside the organization you're in. */
.org-current::after {
  content: "";
  width: 0.3125rem;
  height: 0.625rem;
  margin: -0.125rem 0.25rem 0 auto;
  border-right: 1.5px solid var(--lumen);
  border-bottom: 1.5px solid var(--lumen);
  transform: rotate(45deg);
}

.org-switcher-panel button:hover,
.org-switcher-panel > a:hover {
  background: var(--surface-hover);
  color: var(--text);
}

/* ---------- Organizations hub (no app shell) ---------- */
body:has(> .hub) {
  background:
    radial-gradient(60rem 26rem at 50% -6rem, rgb(251 231 8 / 0.06), transparent 70%),
    var(--bg);
}

.hub-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: var(--header-height);
  padding: var(--space) var(--gutter);
  border-bottom: 1px solid var(--line);
}

.hub {
  flex: 1;
  display: grid;
  align-content: start;
  gap: calc(var(--space) * 2.5);
  width: min(100%, 52rem);
  margin-inline: auto;
  padding: calc(var(--space) * 6) var(--gutter) calc(var(--space) * 8);
}

.hub > h1 {
  font-size: 2rem;
  letter-spacing: -0.03em;
}

.hub--narrow {
  width: min(100%, 34rem);
}

/* The two ways to start: a card each, one tap. The art is drawn in CSS:
   one Lumen disc for an individual, a cluster of three for a team. */
.choices {
  display: grid;
  gap: calc(var(--space) * 2);
}

.choice-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  gap: calc(var(--space) * 2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.choice-list form {
  height: 100%;
}

.choice {
  --art-size: 9.5rem;
  position: relative;
  display: grid;
  grid-template-rows: 1fr auto auto;
  gap: calc(var(--space) * 0.75);
  width: 100%;
  height: 100%;
  min-height: 15rem;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 50% 30%, rgb(251 231 8 / 0.07), transparent 60%),
    var(--surface);
  color: var(--text);
  text-align: left;
  text-decoration: none;
  transition:
    transform var(--transition),
    border-color var(--transition),
    background-color var(--transition),
    box-shadow var(--transition);
}

.choice::before {
  content: "";
  align-self: center;
  justify-self: center;
  width: calc(var(--art-size) * 1.6);
  height: var(--art-size);
  /* The art is drawn at full size; shown at two-thirds. */
  zoom: 0.66;
  transition: transform 320ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* A single disc inside a quiet orbit. */
.choice--individual::before {
  background:
    radial-gradient(circle at 50% 50%, var(--lumen) 0 2.4rem, transparent calc(2.4rem + 1px)),
    radial-gradient(circle at 50% 50%, transparent 0 4.1rem, var(--line-strong) calc(4.1rem + 1px) 4.2rem, transparent calc(4.2rem + 1px));
}

/* Three overlapping discs, each cut out from the card behind it. */
.choice--team::before {
  background:
    radial-gradient(circle at 50% 50%, var(--lumen) 0 2.4rem, var(--surface) calc(2.4rem + 1px) 2.75rem, transparent calc(2.75rem + 1px)),
    radial-gradient(circle at 24% 50%, var(--concrete) 0 2rem, var(--surface) calc(2rem + 1px) 2.35rem, transparent calc(2.35rem + 1px)),
    radial-gradient(circle at 76% 50%, var(--surface-hover) 0 2rem, var(--line-hover) calc(2rem + 1px) calc(2rem + 2px), transparent calc(2rem + 3px));
}

/* A "+" disc, outlined until the card is chosen. */
.choice::after {
  --cross-length: 0.625rem;
  --cross-weight: 0.125rem;
  content: "";
  position: absolute;
  right: 1.5rem;
  bottom: 1.5rem;
  width: 1.875rem;
  height: 1.875rem;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background:
    linear-gradient(var(--text), var(--text)) center / var(--cross-length) var(--cross-weight) no-repeat,
    linear-gradient(var(--text), var(--text)) center / var(--cross-weight) var(--cross-length) no-repeat;
  transition: background-color var(--transition), border-color var(--transition), transform var(--transition);
}

.choice-title {
  font-size: 1.4286rem;
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-display);
  line-height: 1.15;
}

.choice-line {
  padding-right: 3.5rem;
  color: var(--text-muted);
}

.choice:hover,
.choice:focus-visible {
  transform: translateY(-2px);
  border-color: var(--lumen-line);
  background-color: var(--surface-raised);
  color: var(--text);
  box-shadow: 0 18px 40px -18px rgb(0 0 0 / 0.7);
}

.choice:hover::before,
.choice:focus-visible::before {
  transform: scale(1.08);
}

.choice:hover::after,
.choice:focus-visible::after {
  --text: var(--on-lumen);
  border-color: var(--lumen);
  background-color: var(--lumen);
  transform: rotate(90deg);
}

.choice:active {
  transform: translateY(-1px);
}

/* The team path's naming step. */
.back-link {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--text-muted);
  font-size: 0.9286rem;
  text-decoration: none;
}

.back-link::before {
  content: "\2190";
  transition: transform var(--transition);
}

.back-link:hover::before {
  transform: translateX(-2px);
}

.team-form {
  display: grid;
  gap: calc(var(--space) * 1.25);
  justify-items: start;
  margin-top: calc(var(--space) * 2);
}

.team-form label {
  color: var(--text-muted);
  font-weight: var(--weight-medium);
}

.team-form input[type="text"] {
  width: 100%;
  height: 3rem;
  font-size: 1.1429rem;
}

.team-form-hint {
  margin-bottom: calc(var(--space) * 2);
  color: var(--text-dim);
  font-size: 0.9286rem;
}

.team-join {
  margin-top: calc(var(--space) * 4);
  color: var(--text-dim);
  font-size: 0.9286rem;
}

.invite-list,
.org-list {
  display: grid;
  gap: calc(var(--space) * 2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.invite-list li {
  display: grid;
  gap: var(--space);
  padding-bottom: calc(var(--space) * 2);
  border-bottom: 1px solid var(--line);
}

.invite-list li:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.panel .invite-meta {
  color: var(--text-dim);
  font-size: 0.9286rem;
}

.org-list li {
  display: flex;
  align-items: center;
  gap: var(--space);
}

/* ---------- Forms in panels ---------- */
.inline-form {
  display: grid;
  gap: calc(var(--space) * 0.75);
  max-width: 40rem;
}

.inline-form label,
.invite-field label {
  font-size: 0.9286rem;
  font-weight: var(--weight-medium);
  color: var(--text-muted);
}

.inline-form-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: calc(var(--space) * 1.5);
}

.inline-form-row input {
  flex: 1 1 16rem;
}

.invite-form {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: calc(var(--space) * 1.5);
  max-width: 56rem;
}

.invite-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: calc(var(--space) * 0.75);
  flex: 1 1 14rem;
}

/* A date needs only a date's width. */
.invite-field:has(input[type="date"]) {
  flex: 0 1 12rem;
}

.usage-table th:nth-child(n + 4) {
  text-align: right;
}

.role-form {
  display: flex;
  align-items: center;
  gap: var(--space);
}

.role-form select {
  height: var(--control-height-sm);
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.25rem;
}

.data-table .row-end {
  padding-right: 0;
  text-align: right;
}

/* Small text buttons for row-level actions. */
.action-quiet,
.link-button {
  height: var(--control-height-sm);
  padding: 0 0.7143rem;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  background: none;
  color: var(--text-muted);
  font-size: 0.9286rem;
  font-weight: var(--weight-medium);
  white-space: nowrap;
  transition: color var(--transition), background-color var(--transition), border-color var(--transition);
}

/* A link styled as a quiet action centers its text like a button. */
a.action-quiet {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.action-quiet:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.action-quiet--danger:hover {
  background: color-mix(in srgb, var(--status-critical) 12%, transparent);
  color: var(--status-critical);
}

.link-button {
  height: auto;
  padding: 0;
  color: var(--text);
  font-size: inherit;
  font-weight: inherit;
  text-decoration: underline;
  text-decoration-color: var(--line-hover);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

.link-button:hover {
  color: var(--lumen);
}

.action-danger {
  justify-self: start;
  border-color: color-mix(in srgb, var(--status-critical) 45%, transparent);
  background: color-mix(in srgb, var(--status-critical) 6%, transparent);
  color: var(--status-critical);
}

.action-danger:hover {
  border-color: color-mix(in srgb, var(--status-critical) 70%, transparent);
  background: color-mix(in srgb, var(--status-critical) 14%, transparent);
  color: var(--status-critical);
}

.error-page .error-detail {
  color: var(--text);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}

/* ---------- API keys and usage ---------- */
/* A newly minted key: shown once, so it stands out until copied. */
.minted-token {
  border-color: var(--lumen-line);
  background:
    radial-gradient(40rem 14rem at 0% 0%, rgb(251 231 8 / 0.07), transparent 70%),
    var(--surface);
  box-shadow: 0 0 0 4px var(--lumen-soft);
}

.token-value {
  width: 100%;
  padding: calc(var(--space) * 1.5) calc(var(--space) * 2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-inset);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.9286rem;
}

.token-value:focus {
  outline: 2px solid var(--lumen);
  outline-offset: 2px;
}

/* A key's state: a pill with a dot. */
.key-status {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.0625rem 0.5rem;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--status-ok) 13%, transparent);
  color: var(--status-ok);
  font-size: 0.7143rem;
  white-space: nowrap;
}

.key-status::before {
  content: "";
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 50%;
  background: currentColor;
}

.key-status--expired,
.key-status--plan {
  background: rgb(255 246 235 / 0.07);
  color: var(--text-muted);
}

.key-status--plan::before {
  content: none;
}

.key-status--revoked {
  background: color-mix(in srgb, var(--status-critical) 13%, transparent);
  color: var(--status-critical);
}

.key-status--paused {
  background: color-mix(in srgb, var(--status-warn) 13%, transparent);
  color: var(--status-warn);
}

.key-status--uncapped {
  background: color-mix(in srgb, var(--status-warn) 13%, transparent);
  color: var(--status-warn);
}

/* Counts line up by place value. */
.data-table .figure {
  text-align: right;
  font-variant-numeric: tabular-nums;
}


/* ---------- Code samples on the keys page ---------- */
/* Two radio groups pick the API style and language; CSS shows the one
   matching sample. Without CSS every sample shows, each captioned. */
.code-samples {
  min-width: 0;
}

.sample-controls {
  display: grid;
  gap: calc(var(--space) * 2);
}

.sample-options {
  display: flex;
  flex-wrap: wrap;
  gap: calc(var(--space) * 1.5);
}

/* The mode switch: tabs on a rule, the chosen one underlined in Lumen. */
.sample-modes {
  display: flex;
  gap: calc(var(--space) * 3);
  margin: 0;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--line);
}

.sample-modes label {
  margin-bottom: -1px;
  padding: var(--space) 0 calc(var(--space) * 1.25);
  font-weight: var(--weight-medium);
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
}

.sample-modes label:hover {
  color: var(--text);
}

.sample-modes input:checked + label {
  border-bottom-color: var(--lumen);
  color: var(--text);
}

.sample-modes input:focus-visible + label {
  outline: 2px solid var(--lumen);
  outline-offset: 2px;
}

.sample-choice {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.125rem;
  justify-self: start;
  margin: 0;
  padding: 0.1875rem;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius-control) + 2px);
  background: var(--surface-inset);
}

.sample-choice legend,
.sample-modes legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.sample-choice input,
.sample-modes input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.sample-choice label {
  display: block;
  padding: 0.3rem 0.875rem;
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 0.9286rem;
  font-weight: var(--weight-medium);
  cursor: pointer;
  transition: background-color var(--transition), color var(--transition);
}

.sample-choice label:hover {
  color: var(--text);
}

.sample-choice input:checked + label {
  background: var(--surface-hover);
  color: var(--text);
  box-shadow: 0 0 0 1px var(--line-strong), 0 1px 2px rgb(0 0 0 / 0.4);
}

.sample-choice input:focus-visible + label {
  outline: 2px solid var(--lumen);
  outline-offset: 2px;
}

.sample {
  display: grid;
  gap: var(--space);
  min-width: 0;
  margin: 0;
}

.sample figcaption {
  color: var(--text-dim);
  font-size: 0.8125rem;
}

.sample pre {
  margin: 0;
  padding: calc(var(--space) * 2.5);
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-inset);
  font-size: 0.8929rem;
  line-height: 1.65;
  tab-size: 2;
}

.sample pre code {
  padding: 0;
  border: 0;
  background: none;
  font-size: inherit;
}

/* The code fills the figure's second row; its copy button sits in the
   top corner. */
.sample-code {
  position: relative;
  display: grid;
  min-width: 0;
}

.sample-code .copy {
  position: absolute;
  top: var(--space);
  right: var(--space);
}

/* Copy buttons: a small pill, shown by copy.js where the clipboard works. */
.copy {
  height: var(--control-height-sm);
  padding: 0 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background: var(--surface-raised);
  color: var(--text-muted);
  font: inherit;
  font-size: 0.8571rem;
  font-weight: var(--weight-medium);
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition), background-color var(--transition);
}

.copy:hover {
  border-color: var(--line-hover);
  background: var(--surface-hover);
  color: var(--text);
}

.copy:focus-visible {
  outline: 2px solid var(--lumen);
  outline-offset: 2px;
}

.copy[hidden] {
  display: none;
}

.token-copy {
  display: flex;
  gap: var(--space);
  align-items: center;
}

.token-copy .copy {
  flex: none;
}

.sample-models summary {
  color: var(--text-dim);
  font-size: 0.875rem;
  cursor: pointer;
}

.sample-models ul {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
  gap: var(--space);
  margin: calc(var(--space) * 1.25) 0 0;
  padding: 0;
  list-style: none;
}

.sample-models li {
  display: flex;
  gap: var(--space);
  align-items: center;
  min-width: 0;
  padding: 0.3125rem 0.3125rem 0.3125rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgb(0 0 0 / 0.18);
}

.sample-models li code {
  padding: 0;
  border: 0;
  background: none;
}

.sample-models li .copy {
  margin-left: auto;
}

.sample-models code {
  overflow-wrap: anywhere;
}

.sample-model-name {
  color: var(--text-dim);
  font-size: 0.8125rem;
}

/* One sample shows at a time; the block is as tall as the one chosen. */
.sample-stack {
  display: grid;
}

.code-samples:has(#sample-api-openai:checked) .sample--anthropic,
.code-samples:has(#sample-api-anthropic:checked) .sample--openai,
.code-samples:has(#sample-lang-curl:checked) :is(.sample--python, .sample--typescript),
.code-samples:has(#sample-lang-python:checked) :is(.sample--curl, .sample--typescript),
.code-samples:has(#sample-lang-typescript:checked) :is(.sample--curl, .sample--python) {
  display: none;
}

/* Your code or a coding tool: the mode decides which choices and samples
   apply, then each mode's own choices pick one sample. */
.code-samples:has(#sample-use-code:checked) .sample-choice--tools,
.code-samples:has(#sample-use-tools:checked) .sample-choice--code {
  display: none;
}

.code-samples:has(#sample-use-code:checked) .sample--tool,
.code-samples:has(#sample-use-tools:checked) .sample:not(.sample--tool),
.code-samples:has(#sample-tool-claude:checked) .sample--tool:not(.sample--claude),
.code-samples:has(#sample-tool-opencode:checked) .sample--tool:not(.sample--opencode),
.code-samples:has(#sample-tool-aider:checked) .sample--tool:not(.sample--aider),
.code-samples:has(#sample-tool-other:checked) .sample--tool:not(.sample--other) {
  display: none;
}

/* Syntax highlighting, as classes from the server (`samples.rs`): Concrete
   text, Lumen keywords, warm strings, quiet punctuation and comments. */
.sample pre code {
  color: var(--text-muted);
}

.hl-keyword,
.hl-storage {
  color: var(--lumen);
}

.hl-string {
  color: #D6CC8C;
}

.hl-string .hl-punctuation {
  color: inherit;
}

.hl-key .hl-string,
.hl-constant,
.hl-variable,
.hl-support.hl-function {
  color: var(--text);
}

.hl-punctuation {
  color: var(--text-dim);
}

.hl-comment {
  color: var(--text-dim);
  font-style: italic;
}

/* ---------- Model policy ---------- */
/* One table row per key; "Edit limits" opens that key's form in the row
   beneath it (by :target, so no script). Without CSS every form shows. */
.policy-note {
  font-size: 0.875rem;
}

.panel .policy-note {
  color: var(--text-dim);
}

.limits-table {
  margin-top: calc(var(--space) * 1.5);
}

.limits-table tbody th {
  padding: 0.85rem 1rem 0.85rem 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-family: var(--font-body);
  font-weight: var(--weight-medium);
  text-transform: none;
  letter-spacing: normal;
  color: var(--text);
  font-size: 1rem;
  white-space: normal;
  overflow-wrap: anywhere;
}

.limits-table td {
  overflow-wrap: anywhere;
}

/* An open limit reads quieter than a set one. */
.limits-table .limit-open {
  color: var(--text-dim);
}

.limit-plan {
  color: var(--text-dim);
}

.limit-plan {
  font-size: 0.875rem;
  white-space: nowrap;
}

.limit-used {
  font-variant-numeric: tabular-nums;
}

.limit-used meter {
  display: block;
  width: 100%;
  max-width: 7rem;
  height: 0.25rem;
  margin-top: 0.4rem;
  border: 0;
  border-radius: var(--radius-control);
  background: rgb(255 246 235 / 0.09);
  appearance: none;
}

.limit-used meter::-webkit-meter-bar {
  height: 0.25rem;
  border: 0;
  border-radius: var(--radius-control);
  background: rgb(255 246 235 / 0.09);
}

.limit-used meter::-webkit-meter-optimum-value {
  border-radius: var(--radius-control);
  background: var(--lumen);
}

.limit-used meter::-webkit-meter-suboptimum-value {
  border-radius: var(--radius-control);
  background: var(--status-critical);
}

.limit-used meter::-moz-meter-bar {
  border-radius: var(--radius-control);
  background: var(--lumen);
}

.limit-used meter:-moz-meter-sub-optimum::-moz-meter-bar {
  background: var(--status-critical);
}

.limits-table .row-end a {
  white-space: nowrap;
}

/* The editor row stays shut until its link targets it. */
.limits-table .limit-editor:not(:target) {
  display: none;
}

.limit-editor {
  scroll-margin-top: 30vh;
}

.limit-editor > td {
  padding: 0 0 calc(var(--space) * 2);
}

.limit-row:has(+ .limit-editor:target) > * {
  border-bottom-color: transparent;
}

.limit-row:has(+ .limit-editor:target) .row-end a {
  visibility: hidden;
}

/* Phones: each key as a block, its limits two by two under the name. */
@container app-main (max-width: 40rem) {
  .limits-table thead {
    display: none;
  }

  .limits-table,
  .limits-table tbody,
  .limits-table tr,
  .limits-table tbody th,
  .limits-table td {
    display: block;
  }

  .limits-table .limit-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: calc(var(--space) * 1.5) calc(var(--space) * 2);
    padding: calc(var(--space) * 2) 0;
    border-bottom: 1px solid var(--line);
  }

  .limits-table .limit-row > * {
    padding: 0;
    border: 0;
  }

  .limits-table .key-cell {
    grid-column: 1 / -1;
  }

  .limits-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 0.15rem;
    color: var(--text-dim);
    font-size: 0.75rem;
    letter-spacing: var(--tracking-tag);
    text-transform: uppercase;
  }

  .limits-table .row-end {
    grid-column: 1 / -1;
    text-align: left;
  }

  .limits-table .row-end:empty {
    display: none;
  }
}

.limit-form {
  display: grid;
  gap: calc(var(--space) * 3);
  padding: calc(var(--space) * 2.5);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-inset);
}

.limit-models {
  display: grid;
  gap: var(--space);
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.limit-models legend {
  margin-bottom: var(--space);
  padding: 0;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.limit-form input[type="radio"],
.limit-form input[type="checkbox"] {
  margin: 0;
  accent-color: var(--lumen);
}

.panel .limit-scope {
  display: flex;
  align-items: center;
  gap: var(--space);
  margin: 0;
  color: var(--text);
}

/* Equal columns, so the model names line up whatever their length. */
.limit-model-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
  gap: var(--space) calc(var(--space) * 3);
  margin: 0 0 0 calc(var(--space) * 3.25);
  padding: 0;
  list-style: none;
  transition: opacity var(--transition);
}

.limit-model-list li {
  display: flex;
  align-items: center;
  gap: var(--space);
  min-width: 0;
  color: var(--text-muted);
  font-size: 0.875rem;
  overflow-wrap: anywhere;
}

/* "Every model" leaves the list out of play (the server ignores it too). */
.limit-models:has(input[value="any"]:checked) .limit-model-list {
  opacity: 0.4;
  pointer-events: none;
}

.limit-numbers {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: calc(var(--space) * 2);
  max-width: 34rem;
}

@container app-main (min-width: 34rem) {
  .limit-numbers {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.panel .limit-actions {
  display: flex;
  align-items: center;
  gap: calc(var(--space) * 2);
  margin: 0;
}

/* ---------- API keys page ---------- */
/* Keys paused for want of a card: an amber edge, like other warnings. */
.keys-paused {
  border-color: color-mix(in srgb, var(--status-warn) 45%, transparent);
  background: color-mix(in srgb, var(--status-warn) 6%, var(--surface));
}

.keys-paused h2 {
  color: var(--status-warn);
}

/* Measured on the content area, so the sidebar's width counts: wide
   enough, the create form fits on one line. */
@container app-main (min-width: 44rem) {
  .keys-top .key-form {
    grid-template-columns: minmax(0, 2fr) repeat(2, minmax(0, 1fr)) auto;
  }

  .keys-top .key-form > * {
    grid-column: auto;
  }
}

/* Name across the top, then when it expires: the date's slot is always
   there, so choosing "On a date" never moves anything. */
.key-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: calc(var(--space) * 2);
  align-items: end;
}

.key-field {
  display: grid;
  gap: calc(var(--space) * 0.75);
  min-width: 0;
  margin: 0;
}

.key-field label {
  font-size: 0.9286rem;
  font-weight: var(--weight-medium);
  color: var(--text-muted);
}

.key-field input,
.key-field select {
  width: 100%;
  min-width: 0;
}

.key-field--name,
.key-form button {
  grid-column: 1 / -1;
}

.key-form button {
  justify-self: start;
}

.key-field--date {
  visibility: hidden;
}

.key-form:has(#key-expiry option[value="date"]:checked) .key-field--date {
  visibility: visible;
}

/* The date field: a text field in the brand's dark surface, with the
   browser's calendar button recoloured and its segments highlighted in
   Lumen as they're edited. */
input[type="date"] {
  color-scheme: dark;
  /* Chromium's segment highlight and calendar popup follow this. */
  accent-color: var(--lumen);
  font-variant-numeric: tabular-nums;
}

input[type="date"]::-webkit-datetime-edit {
  padding: 0;
}

input[type="date"]::-webkit-datetime-edit-text {
  padding: 0 0.15em;
  color: var(--text-dim);
}

input[type="date"]::-webkit-datetime-edit-month-field,
input[type="date"]::-webkit-datetime-edit-day-field,
input[type="date"]::-webkit-datetime-edit-year-field {
  padding: 0.1em 0.2em;
  border-radius: 4px;
}

input[type="date"]::-webkit-datetime-edit-month-field:focus,
input[type="date"]::-webkit-datetime-edit-day-field:focus,
input[type="date"]::-webkit-datetime-edit-year-field:focus {
  background: var(--lumen);
  color: var(--on-lumen);
}

input[type="date"]::-webkit-calendar-picker-indicator {
  padding: 0.35rem;
  margin-left: 0.5rem;
  border-radius: 8px;
  opacity: 0.6;
  cursor: pointer;
  transition: opacity var(--transition), background-color var(--transition);
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
  background-color: var(--surface-raised);
}

/* The keys table, compact enough for the main column: status under the
   name, the creator under the date, dates and actions on one line. */
.key-cell .key-name,
.key-creator {
  display: block;
}

.key-cell .key-name {
  font-weight: var(--weight-medium);
}

.key-cell .key-status {
  margin-top: 0.3rem;
}

.key-creator {
  max-width: 100%;
  overflow: hidden;
  color: var(--text-dim);
  font-size: 0.8125rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.key-cell ~ td time,
.data-table th {
  white-space: nowrap;
}

.data-table .row-actions {
  flex-wrap: nowrap;
}


/* ---------- Chat ---------- */
/* The chat page fills the window above the footer: the thread scrolls,
   the composer stays. */
.chat-page .app-main {
  grid-template-rows: minmax(0, 1fr);
  align-content: stretch;
  max-width: none;
  min-height: 0;
  padding-bottom: calc(var(--space) * 4);
}

.chat {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

/* Conversations sit under Chat in the main navigation (chat pages only). */
.nav-chats {
  display: grid;
  min-width: 0;
  gap: 0.25rem;
  margin: 0.25rem 0 0 0.9rem;
  padding-left: 0.6rem;
  border-left: 1px solid var(--line);
}

.nav-items .chat-new {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  justify-self: start;
  min-height: 0;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-control);
  color: var(--text);
  font-size: 0.9286rem;
}

/* The Lumen "+" disc, small, as on the brand pills. */
.nav-items .chat-new::before {
  content: "";
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background:
    linear-gradient(var(--on-lumen), var(--on-lumen)) center / 0.5rem 2px no-repeat,
    linear-gradient(var(--on-lumen), var(--on-lumen)) center / 2px 0.5rem no-repeat,
    var(--lumen);
}

.chat-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.125rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-items .chat-list a {
  display: block;
  min-height: 0;
  overflow: hidden;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.8929rem;
  font-weight: var(--weight-regular);
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The Chat item already carries the dot. */
.nav-items .chat-list a[aria-current="page"]::after {
  content: none;
}

/* Delete: a bin at the row's right, shown on hover or focus (always on
   touch screens). Opening it asks to confirm below the title. */
.chat-list li {
  position: relative;
}

.nav-items .chat-list li:is(:hover, :focus-within) a,
.nav-items .chat-list li:has(.chat-list-delete[open]) a {
  padding-right: 2rem;
}

.chat-list-delete summary {
  position: absolute;
  top: 0.15rem;
  right: 0.25rem;
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  cursor: pointer;
  list-style: none;
  opacity: 0;
  transition: opacity var(--transition), color var(--transition);
}

.chat-list-delete summary::-webkit-details-marker {
  display: none;
}

.chat-list-delete summary::before {
  content: "";
  width: 0.875rem;
  height: 0.875rem;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 4h11M6.5 4V2.5h3V4M4 4l.7 9.5h6.6L12 4M6.75 6.5v4.5M9.25 6.5v4.5'/%3E%3C/svg%3E") center / contain no-repeat;
}

.chat-list li:is(:hover, :focus-within) .chat-list-delete summary,
.chat-list-delete[open] summary {
  opacity: 1;
}

.chat-list-delete summary:hover,
.chat-list-delete[open] summary {
  color: var(--text);
}

@media (hover: none) {
  .chat-list-delete summary {
    opacity: 1;
  }

  .nav-items .chat-list a {
    padding-right: 2rem;
  }
}

.chat-list-delete form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0.25rem 0 0.35rem;
  padding: 0.4rem 0.5rem 0.4rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.chat-list-delete button {
  padding: 0.2rem 0.7rem;
  border: 1px solid var(--status-critical);
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--status-critical);
  font-size: 0.8125rem;
}

.chat-list-delete button:hover {
  background: var(--status-critical);
  color: var(--graphite);
}

.chat-thread {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: calc(var(--space) * 2);
  min-height: 0;
}

.chat-thread-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: calc(var(--space) * 2);
  width: min(100%, 48rem);
  margin-inline: auto;
}

.chat-thread-header h2 {
  min-width: 0;
  overflow: hidden;
  font-size: 1.125rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-delete {
  position: relative;
  flex: none;
}

.chat-delete summary {
  color: var(--text-dim);
  font-size: 0.8125rem;
  cursor: pointer;
  list-style: none;
}

.chat-delete summary::-webkit-details-marker {
  display: none;
}

.chat-delete summary:hover,
.chat-delete[open] summary {
  color: var(--text);
}

.chat-delete form {
  position: absolute;
  right: 0;
  top: calc(100% + var(--space));
  z-index: 10;
  display: grid;
  gap: var(--space);
  width: max-content;
  padding: calc(var(--space) * 1.5);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  font-size: 0.875rem;
}

.chat-delete button {
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--status-critical);
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--status-critical);
}

.chat-delete button:hover {
  background: var(--status-critical);
  color: var(--graphite);
}

.nav-collapse {
  display: none;
}

.nav-collapse button {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: transparent;
  transition: border-color var(--transition);
}

.nav-collapse button:hover {
  border-color: var(--line-hover);
  background: var(--surface-hover);
}

.nav-collapse button::before {
  content: "";
  width: 1.1rem;
  height: 0.9rem;
  border: 1.5px solid var(--text-muted);
  border-radius: 3px;
  background: linear-gradient(var(--text-muted), var(--text-muted)) left / 0.35rem 100% no-repeat;
}

.nav-collapse button[aria-pressed="true"]::before {
  background: linear-gradient(var(--text-muted), var(--text-muted)) 0.3rem 0 / 1.5px 100% no-repeat;
}

/* Newest at the bottom, and the view stays there as answers grow. */
.chat-scroll {
  flex: 1;
  display: flex;
  flex-direction: column-reverse;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.chat-log,
.chat-composer,
.chat-blocked,
.chat-page .chat-notice {
  width: min(100%, 48rem);
  justify-self: center;
  margin-inline: auto;
}

.chat-welcome {
  display: grid;
  justify-items: center;
  gap: calc(var(--space) * 2);
  padding-block: clamp(2rem, 12vh, 8rem) calc(var(--space) * 4);
  color: var(--text-muted);
  font-size: clamp(1.25rem, 1rem + 1vw, 1.75rem);
  letter-spacing: var(--tracking-display);
}

.chat-welcome[hidden] {
  display: none;
}

.chat-messages {
  display: grid;
  gap: calc(var(--space) * 3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.chat-message--user {
  justify-self: end;
  max-width: min(36rem, 85%);
  margin-left: auto;
  padding: calc(var(--space) * 1.25) calc(var(--space) * 2);
  border-radius: var(--radius) var(--radius) 6px var(--radius);
  background: var(--surface-raised);
  overflow-wrap: anywhere;
}

.chat-message--user p {
  white-space: pre-wrap;
}

.chat-message--answer {
  display: grid;
  gap: var(--space);
}

.chat-model {
  color: var(--text-dim);
}

/* Answer prose: Markdown rendered on the server. */
.chat-answer {
  overflow-wrap: anywhere;
}

/* One rhythm between blocks, whatever they are: no block keeps its own
   margins, and each one after the first sits the same gap below. */
.chat-answer > * {
  margin-block: 0;
}

.chat-answer > * + * {
  margin-top: calc(var(--space) * 2);
}

.chat-answer > :is(h1, h2, h3, h4):not(:first-child) {
  margin-top: calc(var(--space) * 3.5);
}

.chat-answer :is(h1, h2, h3, h4) {
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-display);
}

.chat-answer h1 { font-size: 1.5rem; }
.chat-answer h2 { font-size: 1.25rem; }
.chat-answer :is(h3, h4) { font-size: 1.0625rem; }

.chat-answer strong {
  font-weight: var(--weight-semibold);
}

.chat-answer ul,
.chat-answer ol {
  padding-left: 1.5rem;
}

.chat-answer li + li {
  margin-top: 0.25rem;
}

.chat-answer li > :is(ul, ol, p) {
  margin-block: 0.25rem 0;
}

.chat-answer blockquote {
  padding-left: calc(var(--space) * 2);
  border-left: 2px solid var(--line-strong);
  color: var(--text-muted);
}

.chat-answer pre {
  padding: calc(var(--space) * 2);
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 0.875rem;
  line-height: 1.55;
}

.chat-answer pre code {
  padding: 0;
  background: none;
  font-size: inherit;
  white-space: pre;
}

.chat-answer table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

/* `anywhere` (inherited from the answer) lets a column shrink to one
   letter; `break-word` keeps whole words as a column's minimum, and the
   table scrolls sideways when that's too wide. */
.chat-answer :is(th, td) {
  overflow-wrap: break-word;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

/* The header row sits flush, so the gap above a table matches the rest. */
.chat-answer th {
  padding-top: 0;
  color: var(--text-muted);
  font-weight: var(--weight-regular);
}

.chat-answer a {
  color: var(--text);
  text-decoration-color: var(--lumen);
}

.chat-reasoning summary {
  color: var(--text-dim);
  font-size: 0.875rem;
  cursor: pointer;
}

.chat-reasoning p {
  max-height: 16rem;
  margin-top: var(--space);
  padding-left: calc(var(--space) * 2);
  overflow-y: auto;
  border-left: 2px solid var(--line);
  color: var(--text-dim);
  font-size: 0.875rem;
  white-space: pre-wrap;
}

.chat-message--pending .chat-reasoning summary,
.chat-activity {
  color: var(--text-muted);
  font-size: 0.875rem;
  animation: chat-pulse 1.6s ease-in-out infinite;
}

/* Working: the mark's Lumen dot, breathing. */
.chat-working::before {
  content: "";
  display: block;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--lumen);
  animation: chat-pulse 1.2s ease-in-out infinite;
}

@keyframes chat-pulse {
  50% { opacity: 0.35; }
}

.chat-page .chat-notice {
  color: var(--text-dim);
  font-size: 0.8125rem;
}

.chat-message .chat-notice {
  width: auto;
  margin: 0;
  color: var(--status-critical);
}

.chat-sources {
  margin-top: var(--space);
  padding-top: var(--space);
  border-top: 1px solid var(--line);
}

/* Collapsed: one quiet line naming the sites. */
.chat-sources summary {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  min-width: 0;
  color: var(--text-dim);
  cursor: pointer;
  list-style: none;
}

.chat-sources summary::-webkit-details-marker {
  display: none;
}

.chat-sources summary::after {
  content: "";
  flex: none;
  width: 0.4rem;
  height: 0.4rem;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: translateY(-0.15rem) rotate(45deg);
  transition: transform var(--transition);
}

.chat-sources[open] summary::after {
  transform: translateY(0.05rem) rotate(-135deg);
}

.chat-sources summary:hover {
  color: var(--text-muted);
}

.chat-sources summary .tag {
  color: var(--text-muted);
}

.chat-sources summary small {
  min-width: 0;
  overflow: hidden;
  font-size: 0.8125rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Open: a plain list, each title with its site beside it. */
.chat-sources ul {
  display: grid;
  gap: 0.35rem;
  margin: var(--space) 0 0;
  padding-left: 1.25rem;
  font-size: 0.875rem;
  line-height: 1.4;
}

.chat-sources li::marker {
  color: var(--text-dim);
}

.chat-sources li a {
  color: var(--text-muted);
  text-decoration-color: var(--line-strong);
  transition: color var(--transition);
}

.chat-sources li a:hover,
.chat-sources li a:focus-visible {
  color: var(--text);
}

.chat-sources cite {
  font-style: normal;
}

.chat-sources li small {
  color: var(--text-dim);
  font-size: 0.8125rem;
}

@media (prefers-reduced-motion: reduce) {
  .chat-sources summary::after,
  .chat-sources li a {
    transition: none;
  }
}

/* The composer: one rounded field, options and send along its foot. */
.chat-composer {
  display: grid;
  gap: var(--space);
  padding: calc(var(--space) * 1.5) calc(var(--space) * 1.5) var(--space) calc(var(--space) * 2);
  border: 1px solid var(--line-strong);
  border-radius: calc(var(--radius) + 4px);
  background: var(--surface);
  box-shadow: 0 12px 32px -12px rgb(0 0 0 / 0.6);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.chat-composer:focus-within {
  border-color: var(--line-hover);
  box-shadow: 0 12px 32px -12px rgb(0 0 0 / 0.6), 0 0 0 3px rgb(255 246 235 / 0.05);
}

.chat-composer textarea {
  width: 100%;
  min-height: 1.5rem;
  max-height: 14rem;
  padding: 0.25rem 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--text);
  font: inherit;
  line-height: 1.5;
  resize: none;
  field-sizing: content;
}

.chat-composer textarea:focus {
  outline: none;
  box-shadow: none;
}

.chat-composer textarea::placeholder {
  color: var(--text-dim);
}

.chat-options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space);
  margin: 0;
  padding: 0;
  border: 0;
}

.chat-options select {
  flex: 0 1 auto;
  min-width: 0;
  height: 2rem;
  max-width: 100%;
  padding-left: 0.75rem;
  border-radius: var(--radius-control);
  font-size: 0.8125rem;
}

.chat-search-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  color: var(--text-muted);
  font-size: 0.8125rem;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

.chat-search-toggle input {
  margin: 0;
  accent-color: var(--lumen);
}

.chat-search-toggle:has(input:checked) {
  border-color: var(--lumen);
  color: var(--text);
}

/* Why the last message wasn't sent. */
.chat-error {
  margin: 0;
  color: var(--status-critical);
  font-size: 0.8125rem;
}

/* Attach: a ringed plus; the file input itself is visually hidden. */
.chat-attach {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition);
}

.chat-attach::before {
  content: "+";
  font-size: 1.25rem;
  font-weight: var(--weight-light);
  line-height: 1;
}

.chat-attach:hover,
.chat-options:has(#chat-files:focus-visible) .chat-attach {
  border-color: var(--line-hover);
  color: var(--text);
}

.chat-options:has(#chat-files:focus-visible) .chat-attach {
  outline: 2px solid var(--lumen);
  outline-offset: 2px;
}

.chat-attached {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 14rem;
  overflow: hidden;
  color: var(--text-dim);
  font-size: 0.8125rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-attached:empty {
  display: none;
}

/* Files sent with a prompt, above its text. */
.chat-attachments {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: flex-start;
  gap: var(--space);
  margin: 0 0 var(--space);
  padding: 0;
  list-style: none;
}

.chat-attachment--image img {
  display: block;
  max-width: min(16rem, 100%);
  max-height: 12rem;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.chat-attachment--document {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  font-size: 0.8125rem;
}

.chat-attachment--document a {
  color: var(--text);
}

.chat-attachment--document small {
  color: var(--text-dim);
  font-size: 0.8125rem;
}

/* Send: a Lumen disc with an upward chevron. */
.chat-send {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  margin-left: auto;
  border: 0;
  border-radius: 50%;
  background: var(--lumen);
  transition: opacity var(--transition);
}

.chat-send::before {
  content: "";
  width: 0.6rem;
  height: 0.6rem;
  margin-top: 0.3rem;
  border-top: 2px solid var(--on-lumen);
  border-left: 2px solid var(--on-lumen);
  transform: rotate(45deg);
}

.chat-send:disabled {
  opacity: 0.35;
  cursor: default;
}

@media (min-width: 60rem) {
  body.chat-page {
    height: 100dvh;
  }

  .chat-page .app {
    min-height: 0;
  }

  /* The sidebar toggle: a panel glyph, its left column filled when the
     sidebar shows. Narrow screens use the menu button instead. */
  .nav-collapse {
    display: block;
  }

  .chat-page .app-header h1 {
    margin-right: auto;
  }

  .nav-collapsed .app {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "header"
      "main";
  }

  .nav-collapsed .app-nav {
    display: none;
  }

  /* Many conversations scroll inside the sidebar, not the page; long
     titles end in an ellipsis rather than widening it. */
  .chat-page .app-nav {
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .nav-panel,
  .nav-panel .nav-items,
  .nav-panel .nav-items li {
    min-width: 0;
  }
}

/* ---------- Private models ---------- */
.panel-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: calc(var(--space) * 2);
}

.panel-header h2 {
  margin: 0;
}

.model-id {
  display: block;
  width: fit-content;
  max-width: 100%;
  color: var(--text-muted);
  font-size: 0.8125rem;
  overflow-wrap: anywhere;
}

/* A model's or job's state: a pill with a dot, coloured by how it's going. */
.model-status {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  width: fit-content;
  padding: 0.0625rem 0.5rem;
  border-radius: var(--radius-pill);
  background: rgb(255 246 235 / 0.07);
  color: var(--text-muted);
  font-size: 0.7143rem;
  white-space: nowrap;
}

.model-status::before {
  content: "";
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 50%;
  background: currentColor;
}

.model-status--serving,
.model-status--done {
  background: color-mix(in srgb, var(--status-ok) 13%, transparent);
  color: var(--status-ok);
}

.model-status--waiting,
.model-status--working {
  background: var(--lumen-soft);
  color: var(--lumen);
}

.model-status--working::before {
  animation: chat-pulse 1.4s ease-in-out infinite;
}

.model-status--warning {
  background: color-mix(in srgb, var(--status-warn) 13%, transparent);
  color: var(--status-warn);
}

.model-status--failed {
  background: color-mix(in srgb, var(--status-critical) 13%, transparent);
  color: var(--status-critical);
}

/* Small labels beside a value in a table or list ("You", "Current"). */
.data-table td > .tag:not(.key-status, .model-status, .checkpoint-best),
.org-list .tag,
.item-main .tag {
  margin-left: 0.375rem;
  padding: 0.0625rem 0.4375rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  font-size: 0.7143rem;
  vertical-align: 0.1em;
}

.image-list {
  display: grid;
  gap: var(--space);
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-wrap: anywhere;
}

.image-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space);
}

.inline-action {
  display: inline-flex;
}

.model-new,
.serve-form {
  display: grid;
  gap: calc(var(--space) * 2.5);
}

/* Fields two to a row; wide ones (`key-field--name`) span the row. */
.model-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: calc(var(--space) * 2);
  align-items: start;
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.model-form .key-field--name,
.model-form > button {
  grid-column: 1 / -1;
}

.model-form > button {
  justify-self: start;
}

.model-form--numbers {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr));
}

.model-form textarea {
  width: 100%;
  min-width: 0;
  padding: 0.75rem 1rem;
  resize: vertical;
  font-family: var(--font-mono);
  font-size: 0.8929rem;
}

.optional {
  color: var(--text-dim);
}

.form-actions {
  margin: calc(var(--space) * 2) 0 0;
}

/* Selectable cards: a radio and its description. */
.option-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: calc(var(--space) * 1.5);
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.option-card {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: calc(var(--space) * 1.5);
  row-gap: calc(var(--space) * 0.5);
  padding: calc(var(--space) * 2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: rgb(255 246 235 / 0.025);
  cursor: pointer;
  transition: border-color var(--transition), background-color var(--transition), box-shadow var(--transition);
}

.option-card:hover {
  border-color: var(--line-hover);
  background: rgb(255 246 235 / 0.05);
}

.option-card:has(input:checked) {
  border-color: var(--lumen-line);
  background: rgb(251 231 8 / 0.06);
  box-shadow: 0 0 0 1px var(--lumen-line);
}

.option-card:has(input:focus-visible) {
  outline: 2px solid var(--lumen);
  outline-offset: 2px;
}

.option-card input {
  grid-row: 1 / span 3;
  margin-top: 0.2rem;
  accent-color: var(--lumen);
}

.option-title {
  color: var(--text);
  font-weight: var(--weight-medium);
}

.option-line {
  grid-column: 2;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Option cards as links: one choice per row, the main path outlined. */
.option-cards--stacked {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  margin-top: calc(var(--space) * 2);
  list-style: none;
}

.option-card--link {
  grid-template-columns: 1fr auto;
  align-items: center;
  text-decoration: none;
}

.option-card--link .option-line {
  grid-column: 1;
}

.option-card--link .item-chevron {
  grid-column: 2;
  grid-row: 1 / span 2;
}

.option-card--link:hover .option-title,
.option-card--link:hover .item-chevron {
  color: var(--lumen);
}

.option-card--link:focus-visible {
  outline: 2px solid var(--lumen);
  outline-offset: 2px;
}

.option-card--primary {
  border-color: var(--lumen-line);
  background: rgb(251 231 8 / 0.05);
}

/* The new-model form shows the fields for the kind chosen. */
.model-source--container,
.model-new:has(input[name="kind"][value="container"]:checked) .model-source--weights {
  display: none;
}

.model-new:has(input[name="kind"][value="container"]:checked) .model-source--container {
  display: grid;
}

.revision {
  display: grid;
  gap: var(--space);
  padding-top: calc(var(--space) * 2);
  border-top: 1px solid var(--line);
}

.revision-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: calc(var(--space) * 1.5);
}

.revision-header h3 {
  margin: 0;
  font-weight: var(--weight-medium);
}

.revision-state--passed {
  color: var(--status-ok);
}

.revision-state--failed {
  color: var(--status-critical);
}

.checks {
  display: grid;
  gap: calc(var(--space) * 0.75);
  margin: 0;
  padding: 0;
  list-style: none;
}

.check {
  display: grid;
  grid-template-columns: 9rem auto 1fr;
  align-items: baseline;
  gap: calc(var(--space) * 1.5);
}

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

.check-detail {
  font-size: 0.875rem;
  color: var(--text-dim);
  overflow-wrap: anywhere;
}

.check--passed .tag {
  color: var(--status-ok);
}

.check--failed .tag {
  color: var(--status-critical);
}

.check--running .tag,
.check--warning .tag {
  color: var(--text);
}

.bench caption {
  padding-bottom: var(--space);
  text-align: left;
}

@media (max-width: 40rem) {
  .check {
    grid-template-columns: 1fr auto;
  }

  .check-detail {
    grid-column: 1 / -1;
  }
}

.model-new .panel > button {
  justify-self: start;
}

/* ---------- Billing: this month's GPU time ---------- */
/* The month's total is the headline figure, in Lumen, opposite the
   section's name. */
.bill-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: var(--space) calc(var(--space) * 3);
}

.bill-head hgroup {
  display: grid;
  gap: 0.25rem;
}

.bill-head hgroup p {
  color: var(--text-dim);
}

.bill-total {
  display: grid;
  justify-items: end;
  gap: 0.125rem;
  margin: 0;
}

.bill-total dt {
  font-family: var(--font-mono);
  font-size: 0.7857rem;
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-tag);
  text-transform: uppercase;
  color: var(--text-dim);
}

.bill-total dd {
  margin: 0;
  font-size: 2.5714rem;
  font-weight: var(--weight-semibold);
  letter-spacing: -0.035em;
  line-height: 1;
  color: var(--text);
}

.gpu-bill {
  margin-top: var(--space);
}

/* Names are row headings but read as plain entries, in the body face. */
.gpu-bill tbody th {
  padding: 0.75rem 1rem 0.75rem 0;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: var(--weight-medium);
  letter-spacing: 0;
  text-transform: none;
  color: var(--text);
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}

/* "Private models" and "Training jobs" head their rows. */
.gpu-bill .bill-group th {
  padding-top: 1.25rem;
  padding-bottom: 0.375rem;
  border-bottom-color: var(--line);
  font-family: var(--font-mono);
  font-size: 0.7857rem;
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-tag);
  text-transform: uppercase;
  color: var(--lumen);
}

.gpu-bill tbody td {
  color: var(--text-muted);
}

.gpu-bill tbody td:last-child {
  color: var(--text);
}

/* Headings may wrap on a phone; figures never do. */
.gpu-bill thead th {
  white-space: normal;
  vertical-align: bottom;
}

.gpu-bill td.figure {
  white-space: nowrap;
}

.gpu-bill tfoot th,
.gpu-bill tfoot td {
  padding: 0.875rem 1rem 0 0;
  border-top: 1px solid var(--line-strong);
  border-bottom: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: var(--weight-semibold);
  letter-spacing: 0;
  text-transform: none;
  color: var(--text);
}

/* Figures line up under their headings; the last column ends flush. */
.gpu-bill th.figure {
  padding-right: 1rem;
  text-align: right;
}

.gpu-bill tr > :last-child {
  padding-right: 0;
}

/* On a phone the rate card below carries the rate, so its column goes
   and the rest fit without scrolling. */
@media (max-width: 40rem) {
  .gpu-bill .rate {
    display: none;
  }

  .gpu-bill tr > :not(:last-child) {
    padding-right: 0.625rem;
  }
}

/* Each GPU kind's rate: a row of small facts, the price in figures. */
.rate-card {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr));
  gap: calc(var(--space) * 1.5);
  margin: 0;
}

.rate-card div {
  display: grid;
  gap: 0.375rem;
  padding: 0.875rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgb(0 0 0 / 0.2);
}

.rate-card dt {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.8571rem;
}

.rate-card dd {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.875rem;
}

.rate-card dd strong {
  margin-right: 0.125rem;
  font-size: 1.4286rem;
  font-weight: var(--weight-semibold);
  letter-spacing: -0.025em;
  color: var(--text);
}

/* Why a form came back: something to fix, or a step still to take. */
.form-problem {
  border-color: color-mix(in srgb, var(--status-warn) 45%, transparent);
  background:
    linear-gradient(color-mix(in srgb, var(--status-warn) 7%, transparent), color-mix(in srgb, var(--status-warn) 7%, transparent)),
    var(--surface);
}

.form-problem h2 {
  margin: 0;
}

/* ---------- Model forms: one rhythm for every section ---------- */
/* A section's number, in Lumen: the page reads as steps, not a wall. */
.step {
  display: inline-grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  margin-right: 0.75rem;
  border: 1px solid var(--lumen-line);
  border-radius: 50%;
  background: var(--lumen-soft);
  color: var(--lumen);
  font-family: var(--font-mono);
  font-size: 0.8571rem;
  font-weight: var(--weight-medium);
  letter-spacing: 0;
  vertical-align: 0.1em;
}

/* Two columns at most; long fields take the row. One column on phones. */
.fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: calc(var(--space) * 2.5) calc(var(--space) * 3);
  align-items: start;
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.fields--single {
  grid-template-columns: minmax(0, 1fr);
}

.field--wide {
  grid-column: 1 / -1;
}

.fields .key-field select,
.fields .key-field input {
  width: 100%;
}

.fields textarea {
  width: 100%;
  min-width: 0;
  padding: 0.75rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.8929rem;
  resize: vertical;
}

.panel .field-hint {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-dim);
}

.fields-heading {
  margin: calc(var(--space) * 1) 0 0;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 0.7857rem;
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-tag);
  text-transform: uppercase;
  color: var(--text-dim);
}

/* What the API will call it, filled in as the name is typed. */
.model-call {
  color: var(--lumen);
}

/* Settings with good defaults stay folded until wanted. */
.advanced {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: calc(var(--space) * 1.5) calc(var(--space) * 2);
}

.advanced summary {
  cursor: pointer;
  color: var(--text-muted);
  font-weight: var(--weight-medium);
}

.advanced summary:hover {
  color: var(--text);
}

.advanced summary .optional {
  margin-left: var(--space);
  font-size: 0.8125rem;
}

.advanced[open] summary {
  margin-bottom: calc(var(--space) * 2);
}

/* GPUs as a list: name and specs on the left, the price on the right. */
.gpu-list {
  display: grid;
  gap: var(--space);
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.gpu-list legend {
  margin-bottom: var(--space);
}

.gpu-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: calc(var(--space) * 2);
  padding: calc(var(--space) * 1.5) calc(var(--space) * 2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: rgb(255 246 235 / 0.025);
  cursor: pointer;
  transition: border-color var(--transition), background-color var(--transition), box-shadow var(--transition);
}

.gpu-option:hover {
  border-color: var(--line-hover);
  background: rgb(255 246 235 / 0.05);
}

.gpu-option:has(input:checked) {
  border-color: var(--lumen-line);
  background: rgb(251 231 8 / 0.06);
  box-shadow: 0 0 0 1px var(--lumen-line);
}

.gpu-option:has(input:focus-visible) {
  outline: 2px solid var(--lumen);
  outline-offset: 2px;
}

.gpu-option input {
  accent-color: var(--lumen);
}

.gpu-about {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.gpu-name {
  color: var(--text);
  font-weight: var(--weight-medium);
}

.gpu-specs {
  font-size: 0.8125rem;
  color: var(--text-dim);
}

.gpu-price {
  text-align: right;
  font-size: 0.8125rem;
  color: var(--text-dim);
  white-space: nowrap;
}

.gpu-price strong {
  display: block;
  font-size: 1.1429rem;
  font-weight: var(--weight-semibold);
  letter-spacing: -0.02em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 40rem) {
  .fields {
    grid-template-columns: minmax(0, 1fr);
  }

  .gpu-option {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .gpu-price {
    grid-column: 2;
    text-align: left;
  }
}

/* Wide fields fill their row (panel paragraphs otherwise stop at 60ch). */
.fields .key-field {
  max-width: none;
}

/* Only the chosen kind's fields show. Stated after `.fields` so its grid
   display can't bring the other kind's back. */
.model-new .model-source--container,
.model-new:has(input[name="kind"][value="container"]:checked) .model-source--weights {
  display: none;
}

.model-new:has(input[name="kind"][value="container"]:checked) .model-source--container {
  display: grid;
}

/* ---------- Lists on the private models page ---------- */
/* Rows in a bordered list; the empty state is a row too, so the section
   reads the same with nothing in it. */
.item-list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgb(0 0 0 / 0.16);
}

.item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: calc(var(--space) * 1) calc(var(--space) * 3);
  padding: calc(var(--space) * 1.75) calc(var(--space) * 2);
  min-width: 0;
}

.item + .item {
  border-top: 1px solid var(--line);
}

.item-main {
  display: grid;
  gap: 0.2rem;
  flex: 1 1 16rem;
  min-width: 0;
  overflow-wrap: anywhere;
}

.item-name {
  color: var(--text);
  font-weight: var(--weight-medium);
  text-decoration: none;
}

.item-name:hover {
  color: var(--lumen);
}

.item-status {
  display: grid;
  gap: 0.2rem;
  justify-items: start;
}

.item-detail,
.item-meta {
  font-size: 0.8125rem;
  color: var(--text-dim);
}

/* Nothing to list yet: a dashed, centred placeholder, so it can't be
   mistaken for a field. */
.panel .empty-list {
  display: grid;
  justify-items: center;
  gap: var(--space);
  max-width: none;
  margin: 0;
  padding: calc(var(--space) * 4) calc(var(--space) * 3);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  background: rgb(0 0 0 / 0.14);
  text-align: center;
  color: var(--text-dim);
}

.panel .empty-list p {
  margin: 0;
  max-width: 48ch;
  color: var(--text-dim);
}

.panel .empty-list .empty-list-title {
  color: var(--text);
  font-size: 1.0714rem;
  font-weight: var(--weight-medium);
}

.empty-list .action-primary {
  margin-top: var(--space);
}

.panel .empty-list--compact {
  padding: calc(var(--space) * 2);
}

.list-actions {
  margin: 0;
}

.panel .notice {
  max-width: none;
  padding: calc(var(--space) * 1.5) calc(var(--space) * 2);
  border: 1px solid var(--lumen-line);
  border-radius: var(--radius-sm);
  background: rgb(251 231 8 / 0.06);
  color: var(--text);
}

/* "Add a registry login": a button that opens its form in place. */
.add-form > summary {
  list-style: none;
  justify-self: start;
  width: fit-content;
  cursor: pointer;
}

.add-form > summary::-webkit-details-marker {
  display: none;
}

.add-form[open] > summary {
  margin-bottom: calc(var(--space) * 2.5);
}

/* ---------- GPU picker: what you can have, and why not ---------- */
.gpu-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem calc(var(--space) * 1.5);
  font-size: 0.8125rem;
}

.gpu-free {
  color: var(--status-ok);
}

.gpu-free--none,
.gpu-runs {
  color: var(--text-dim);
}

.gpu-why {
  font-size: 0.8125rem;
  color: var(--status-critical);
}

/* No GPU free: shown, greyed, not selectable. */
.gpu-option--unavailable {
  opacity: 0.55;
  cursor: not-allowed;
  background: transparent;
}

.gpu-option--unavailable:hover {
  border-color: var(--line);
}

/* The "can't run containers" reason only matters once a container is the
   choice; then those GPUs grey out too. */
.gpu-why--containers {
  display: none;
}

.model-new:has(input[name="kind"][value="container"]:checked) .gpu-option--weights-only {
  opacity: 0.55;
  background: transparent;
}

.model-new:has(input[name="kind"][value="container"]:checked) .gpu-why--containers {
  display: block;
}

/* GPUs per replica: one tap, not a dropdown. */
.size-picker {
  display: grid;
  gap: var(--space);
  margin: 0;
  padding: 0;
  border: 0;
}

.size-options {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space);
}

.size-option {
  position: relative;
  cursor: pointer;
}

.size-option input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}

.size-option span {
  display: grid;
  place-items: center;
  min-width: 3.25rem;
  height: 2.75rem;
  padding: 0 1rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: rgb(255 246 235 / 0.025);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  transition: border-color var(--transition), color var(--transition), background-color var(--transition);
}

.size-option:hover span {
  border-color: var(--line-hover);
  background: rgb(255 246 235 / 0.05);
}

.size-option input:checked + span {
  border-color: var(--lumen);
  background: var(--lumen-soft);
  color: var(--lumen);
}

.size-option input:focus-visible + span {
  outline: 2px solid var(--lumen);
  outline-offset: 2px;
}

/* ---------- Settings list: label and hint left, a small control right ---------- */
.settings {
  display: grid;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgb(0 0 0 / 0.16);
}

.setting {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space) calc(var(--space) * 3);
  margin: 0;
  padding: calc(var(--space) * 2) calc(var(--space) * 2.5);
  border: 0;
  min-width: 0;
}

.setting + .setting {
  border-top: 1px solid var(--line);
}

.setting-text {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.setting-label {
  color: var(--text);
  font-weight: var(--weight-medium);
}

.setting-hint {
  max-width: 52ch;
  font-size: 0.8125rem;
  color: var(--text-dim);
}

.setting-control {
  display: flex;
  align-items: center;
  gap: var(--space);
}

.setting-unit {
  font-size: 0.875rem;
  color: var(--text-muted);
}

input.num {
  width: 5.5rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 40rem) {
  .setting {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- A model row is one link ---------- */
.item--link {
  padding: 0;
}

.item-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, auto) auto;
  align-items: center;
  gap: calc(var(--space) * 3);
  width: 100%;
  padding: calc(var(--space) * 2) calc(var(--space) * 2.5);
  color: inherit;
  text-decoration: none;
  transition: background-color var(--transition);
}

.item-row:hover,
.item-row:focus-visible {
  background: rgb(255 246 235 / 0.045);
  color: inherit;
}

.item--link:first-child .item-row {
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.item--link:last-child .item-row {
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.item--link:only-child .item-row {
  border-radius: var(--radius-sm);
}

.item-row:hover .item-name {
  color: var(--lumen);
}

.item-row .item-name {
  font-size: 1.0714rem;
}

.item-row .item-meta code {
  font-size: 0.8125rem;
  border: 0;
  background: none;
  padding: 0;
  color: var(--text-muted);
}

.item-row .item-status {
  justify-items: end;
  max-width: 30rem;
  text-align: right;
}

.item-row .item-detail {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.item-chevron {
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-dim);
  transition: transform var(--transition), color var(--transition);
}

.item-row:hover .item-chevron {
  color: var(--lumen);
  transform: translateX(2px);
}

@media (max-width: 40rem) {
  .item-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .item-row .item-status {
    grid-column: 1;
    justify-items: start;
    text-align: left;
  }
}

/* ---------- Model status: a sentence, an icon, progress ---------- */
.panel-header .banner {
  flex: 1 1 28rem;
}

.banner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: calc(var(--space) * 2);
  align-items: start;
}

.banner-text {
  display: grid;
  gap: calc(var(--space) * 0.75);
}

.banner-text h2 {
  margin: 0;
}

.panel .banner-text p {
  margin: 0;
  max-width: 64ch;
}

/* What can be done with the job, under what it's doing: the next step
   first (in Lumen when there is one), the rest as matching outlines. */
.job-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space);
  margin-top: calc(var(--space) * 1.5);
}

.job-actions .action-launch {
  height: var(--control-height-sm);
  padding: 0 0.75rem;
  gap: 0.375rem;
  font-size: 0.8125rem;
}

.action-danger.action-sm {
  font-size: 0.8125rem;
}

.panel .banner-next {
  margin-top: calc(var(--space) / 2);
  color: var(--text);
}

.panel .banner-live {
  font-size: 0.8125rem;
  color: var(--text-dim);
}

.banner-icon {
  width: 1.5rem;
  height: 1.5rem;
  margin-top: 0.25rem;
  border-radius: 50%;
  border: 2px solid var(--text-dim);
}

.banner--working .banner-icon {
  border-color: color-mix(in srgb, var(--lumen) 25%, transparent);
  border-top-color: var(--lumen);
  animation: spin 900ms linear infinite;
}

.banner--serving .banner-icon {
  border-color: var(--status-ok);
  background: var(--status-ok);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--status-ok) 22%, transparent);
  animation: live-pulse 2.4s ease-in-out infinite;
}

@keyframes live-pulse {
  50% {
    box-shadow: 0 0 0 7px color-mix(in srgb, var(--status-ok) 8%, transparent);
  }
}

.banner--failed .banner-icon {
  border-color: var(--status-critical);
  background: var(--status-critical);
}

/* Finished: a green disc with a drawn tick, like a passed check. */
.banner--done .banner-icon {
  display: grid;
  place-items: center;
  border-color: var(--status-ok);
  background: var(--status-ok);
}

.banner--done .banner-icon::after {
  content: "";
  width: 0.35rem;
  height: 0.65rem;
  margin-top: -0.15rem;
  border: solid var(--graphite);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Stopped early or at a limit: an amber ring, kept work. */
.banner--warning .banner-icon {
  border-color: var(--status-warn);
}

.banner-progress {
  width: min(100%, 28rem);
  height: 0.375rem;
  appearance: none;
  border: 0;
  border-radius: var(--radius-control);
  background: rgb(255 246 235 / 0.09);
  overflow: hidden;
}

.banner-progress::-webkit-progress-bar {
  background: rgb(255 246 235 / 0.09);
  border-radius: var(--radius-control);
}

.banner-progress::-webkit-progress-value {
  background: var(--lumen);
  border-radius: var(--radius-control);
  transition: width 400ms ease;
}

.banner-progress::-moz-progress-bar {
  background: var(--lumen);
  border-radius: var(--radius-control);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- Revision checks with icons ---------- */
.revision-added {
  margin-left: auto;
  font-size: 0.8125rem;
  color: var(--text-dim);
}

.panel .revision-source {
  margin: 0;
  max-width: none;
  overflow-wrap: anywhere;
}

.revision-facts {
  margin-left: var(--space);
  font-size: 0.8125rem;
  color: var(--text-dim);
}

.checks .check {
  grid-template-columns: 1.25rem 9rem minmax(0, auto) 1fr;
  align-items: center;
}

.check-icon {
  width: 0.875rem;
  height: 0.875rem;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
}

.check--running .check-icon {
  border-color: color-mix(in srgb, var(--lumen) 25%, transparent);
  border-top-color: var(--lumen);
  animation: spin 900ms linear infinite;
}

.check-icon {
  display: grid;
  place-items: center;
}

/* Passed: a green disc with a drawn tick (two borders of a rotated box);
   passed with a warning, the same in amber. */
.check--passed .check-icon {
  border-color: var(--status-ok);
  background: var(--status-ok);
}

.check--warning .check-icon {
  border-color: var(--status-warn);
  background: var(--status-warn);
}

.check--passed .check-icon::after,
.check--warning .check-icon::after {
  content: "";
  width: 0.2rem;
  height: 0.4rem;
  margin-top: -0.1rem;
  border: solid var(--graphite);
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}

.check--done .check-icon {
  border-color: var(--status-ok);
  background: var(--status-ok);
}

.check--done .check-icon::after {
  content: "";
  width: 0.2rem;
  height: 0.4rem;
  margin-top: -0.1rem;
  border: solid var(--graphite);
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}

.check--failed .check-icon {
  border-color: var(--status-critical);
  background: var(--status-critical);
}

.check--skipped .check-icon {
  border-style: dashed;
}

.check-state {
  font-size: 0.8125rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.check--running .check-state {
  color: var(--lumen);
}

.check--failed .check-state,
.check--failed .check-detail {
  color: var(--status-critical);
}

.check--running .check-step,
.check--passed .check-step,
.check--failed .check-step {
  color: var(--text);
}

@media (prefers-reduced-motion: reduce) {
  .banner--working .banner-icon,
  .check--running .check-icon {
    animation: none;
  }
}

@media (max-width: 40rem) {
  .checks .check {
    grid-template-columns: 1.25rem minmax(0, 1fr) auto;
  }

  .checks .check-detail {
    grid-column: 2 / -1;
  }
}

/* ---------- Model header: settings in one strip ---------- */
.spec-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr));
  gap: calc(var(--space) * 2) calc(var(--space) * 3);
  margin: 0;
  padding-top: calc(var(--space) * 2);
  border-top: 1px solid var(--line);
}

/* Heading a panel, the strip needs no rule above it. */
.panel > .spec-strip:first-child {
  padding-top: 0;
  border-top: 0;
}

.spec-strip dt {
  font-family: var(--font-mono);
  font-size: 0.7857rem;
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-tag);
  text-transform: uppercase;
  color: var(--text-dim);
}

.spec-strip dd {
  margin: 0.25rem 0 0;
  overflow-wrap: anywhere;
}

/* ---------- Verification as a horizontal tracker ---------- */
.stepper {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(6.5rem, 1fr));
  gap: var(--space);
  margin: 0;
  padding: 0;
  list-style: none;
}

.stepper-item {
  position: relative;
  display: grid;
  justify-items: start;
  gap: 0.35rem;
  padding-top: 0.25rem;
}

/* The line to the next step. */
.stepper-item:not(:last-child)::after {
  content: "";
  position: absolute;
  top: calc(0.25rem + 0.4375rem);
  left: 1.25rem;
  right: 0.25rem;
  height: 1px;
  background: var(--line-strong);
}

.stepper-item.check--passed:not(:last-child)::after,
.stepper-item.check--warning:not(:last-child)::after {
  background: var(--status-ok);
}

.stepper-name {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.stepper-item.check--running .stepper-name,
.stepper-item.check--passed .stepper-name,
.stepper-item.check--failed .stepper-name {
  color: var(--text);
}

.panel .check-problem {
  margin: 0;
  max-width: none;
  padding: calc(var(--space) * 1.5) calc(var(--space) * 2);
  border: 1px solid color-mix(in srgb, var(--status-critical) 35%, transparent);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--status-critical) 9%, transparent);
  color: var(--text);
}

.check-details {
  display: grid;
  gap: 0.35rem;
  margin: 0;
  font-size: 0.8125rem;
}

.check-details div {
  display: grid;
  grid-template-columns: 8rem minmax(0, 1fr);
  gap: var(--space);
}

.check-details dt {
  color: var(--text-dim);
}

.check-details dd {
  margin: 0;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

/* ---------- Settings controls sized to their values ---------- */
/* Same height as the size buttons; no spinner arrows eating the width. */
.setting input.num {
  width: 4rem;
  height: 2.5rem;
  padding: 0 0.5rem;
  appearance: textfield;
  -moz-appearance: textfield;
}

.setting input.num::-webkit-outer-spin-button,
.setting input.num::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.setting .size-option span {
  min-width: 2.75rem;
  height: 2.5rem;
  padding: 0 0.75rem;
}

/* A unit inside the box ("15 min"), so every control ends at the same edge. */
.num-field {
  display: inline-flex;
  align-items: center;
  height: 2.5rem;
  padding-right: 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-inset);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.num-field:focus-within {
  border-color: var(--lumen);
  box-shadow: 0 0 0 3px var(--lumen-soft);
}

.num-field input.num {
  width: 3rem;
  border: 0;
  background: transparent;
  box-shadow: none;
  text-align: right;
  padding-right: 0.35rem;
}

.num-unit {
  font-size: 0.875rem;
  color: var(--text-dim);
}

.setting-unit {
  padding: 0 0.15rem;
}

/* ---------- Private models page: full-width rows, a pair of equal cards ---------- */
.panel-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: calc(var(--space) * 3);
  align-items: stretch;
}

/* The cards are half width: their forms take one column. */
.panel-pair .fields {
  grid-template-columns: minmax(0, 1fr);
}

.panel-pair .field--wide {
  grid-column: auto;
}

.panel .ns-name {
  margin: 0;
  font-size: 1.25rem;
}

.panel .ns-name code {
  color: var(--lumen);
}

@media (max-width: 56rem) {
  .panel-pair {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- Expanding forms: the button closes what it opened ---------- */
.add-form > summary .when-open,
.add-form[open] > summary .when-closed {
  display: none;
}

.add-form[open] > summary .when-open {
  display: inline;
}

/* ---------- Training (PRD section 14) ---------- */
.panel-intro {
  display: grid;
  gap: var(--space);
  flex: 1 1 24rem;
  min-width: 0;
}

.panel-intro p {
  margin: 0;
}

/* Filters and chart choices: plain links, the current one filled. */
.filter-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.125rem;
  padding: 0.1875rem;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius-control) + 2px);
  background: var(--surface-inset);
}

.filter-links a {
  padding: 0.3rem 0.85rem;
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 0.8929rem;
  font-weight: var(--weight-medium);
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}

.filter-links a:hover {
  color: var(--text);
}

.filter-links a[aria-current] {
  background: var(--surface-hover);
  color: var(--text);
  box-shadow: 0 0 0 1px var(--line-strong), 0 1px 2px rgb(0 0 0 / 0.4);
}

.how-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr));
  gap: calc(var(--space) * 2);
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: how;
}

.how-steps li {
  display: grid;
  align-content: start;
  gap: var(--space);
  padding: 0.875rem 1rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgb(0 0 0 / 0.18);
  color: var(--text-muted);
  font-size: 0.9286rem;
  counter-increment: how;
}

.how-steps .tag {
  color: var(--text);
}

.how-steps .tag::before {
  content: counter(how, decimal-leading-zero) "  ";
  color: var(--lumen);
}

.spec-note {
  display: block;
  margin-top: 0.2rem;
  color: var(--text-dim);
  font-size: 0.8125rem;
}

.stepper-item.check--skipped .stepper-name {
  color: var(--text-dim);
}

/* The metric chart: drawn on the server; Lumen for the line. */
.metric-chart {
  display: block;
  width: 100%;
  height: auto;
}

.metric-chart .chart-label {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.metric-step {
  text-anchor: middle;
}

/* The end labels sit inside the chart, not half off its edges. */
.metric-step--first {
  text-anchor: start;
}

.metric-step--last {
  text-anchor: end;
}

.metric-grid {
  stroke: var(--line);
  stroke-width: 1;
}

.metric-line {
  fill: none;
  stroke: var(--lumen);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.metric-dot {
  fill: var(--surface);
  stroke: var(--text);
  stroke-width: 1.5;
}

.metric-swatch {
  display: inline-block;
  width: 0.9rem;
  height: 0.5rem;
  margin-right: 0.35rem;
  vertical-align: middle;
}

.metric-swatch--line {
  height: 2px;
  background: var(--lumen);
}

.metric-swatch--dot {
  width: 0.5rem;
  border: 1.5px solid var(--text);
  border-radius: 50%;
}

.panel .stat-value {
  max-width: none;
  color: var(--text);
}

.metric-swatch--dot {
  margin-left: 0.875rem;
}

.stat-value small {
  font-size: 1rem;
  font-weight: var(--weight-regular);
  color: var(--text-dim);
  letter-spacing: 0;
}

.checkpoint-state--saving {
  color: var(--lumen);
}

.checkpoint-state--failed {
  color: var(--status-critical);
}

.data-table.checkpoints th {
  padding-right: 1rem;
}

.data-table.checkpoints .figure,
.data-table.checkpoints .row-actions {
  white-space: nowrap;
}

.data-table.checkpoints .row-actions {
  justify-content: flex-end;
}

/* A wide table scrolls inside its panel rather than the page. */
.table-scroll {
  overflow-x: auto;
}

/* A long one scrolls there too, under headings that stay put. */
.table-scroll--tall {
  max-height: min(46rem, 80dvh);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgb(0 0 0 / 0.16);
  scrollbar-width: thin;
}

.table-scroll--tall .data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 0.75rem 1rem;
  border-bottom: 0;
  background: var(--surface-raised);
  box-shadow: 0 1px 0 var(--line-strong);
}

.table-scroll--tall .data-table td {
  padding: 0.625rem 1rem;
}

.table-scroll--tall .data-table tbody tr:hover td {
  background: rgb(255 246 235 / 0.03);
}

/* Logs: relayed from the API service, never stored. */
.job-log {
  max-height: 28rem;
  margin: 0;
  padding: calc(var(--space) * 2);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-inset);
  color: var(--text-muted);
  font-size: 0.8571rem;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.log-time {
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.log-line--marin .log-source {
  color: var(--lumen);
}

.code-input {
  font-family: var(--font-mono);
  font-size: 0.875rem;
}

.estimate {
  margin: 0;
  padding: calc(var(--space) * 1.5) calc(var(--space) * 2);
  border: 1px solid var(--lumen-line);
  border-radius: var(--radius-sm);
  background: rgb(251 231 8 / 0.06);
}

.estimate strong {
  font-weight: var(--weight-semibold);
}

.upload-status {
  display: block;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.upload-status:empty {
  display: none;
}

/* ---------- Datasets: adding files ---------- */
/* A dataset's Files panel (and the new-dataset form's box) takes dropped
   files; while files are dragged over it, it lights up. */
.drop-target {
  transition: border-color var(--transition), background-color var(--transition);
}

.drop-target.is-dragover {
  border-color: var(--lumen);
  background: color-mix(in srgb, var(--lumen) 5%, var(--surface));
}

.drop-zone {
  display: grid;
  justify-items: center;
  gap: var(--space);
  padding: calc(var(--space) * 4) calc(var(--space) * 2);
  border: 1px dashed var(--line-hover);
  border-radius: var(--radius-sm);
  background: rgb(0 0 0 / 0.16);
  text-align: center;
}

.panel .drop-zone p {
  max-width: 52ch;
}

.panel .drop-zone-title {
  color: var(--text);
  font-size: 1.0714rem;
  font-weight: var(--weight-medium);
}

.panel .drop-zone-or {
  color: var(--text-dim);
  font-size: 0.8125rem;
  letter-spacing: var(--tracking-tag);
  text-transform: uppercase;
}

.drop-zone-link {
  width: min(100%, 32rem);
  text-align: left;
}

.drop-zone .add-files-row {
  justify-content: center;
}

.add-files {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  gap: calc(var(--space) * 2) calc(var(--space) * 3);
  padding-top: calc(var(--space) * 2);
  border-top: 1px solid var(--line);
}

.add-files-heading {
  grid-column: 1 / -1;
}

.add-files-way {
  display: grid;
  align-content: start;
  gap: var(--space);
}

.panel .add-files-label {
  color: var(--text);
  font-size: 0.875rem;
}

.add-files-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space) calc(var(--space) * 1.5);
}

.add-files-row[hidden],
[data-upload-fallback][hidden] {
  display: none;
}

/* The file input stays in the page for keyboards and screen readers; its
   label is the visible button. */
.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.file-pick {
  cursor: pointer;
}

.file-input:focus-visible + .file-pick {
  outline: 2px solid var(--lumen);
  outline-offset: 2px;
}

.file-input:disabled + .file-pick {
  opacity: 0.5;
  cursor: progress;
}

.new-dataset {
  display: grid;
  gap: calc(var(--space) * 2);
}

/* Two ways in, side by side and equal: a drop target for files, and a
   link. Each says what it is with an icon and a title. */
.data-sources {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.data-sources-title {
  padding: 0;
  font-size: 1rem;
  font-weight: var(--weight-medium);
  color: var(--text);
}

.panel .data-sources-hint {
  margin: calc(var(--space) / 2) 0 calc(var(--space) * 1.5);
}

.data-source-pair {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: calc(var(--space) * 1.5);
}

.data-source {
  display: grid;
  align-content: start;
  justify-items: start;
  gap: calc(var(--space) * 0.75);
  padding: calc(var(--space) * 2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: rgb(255 246 235 / 0.025);
}

.data-source--drop {
  border-style: dashed;
  border-color: var(--line-hover);
}

.data-source-icon {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--lumen-line);
  border-radius: 10px;
  background: var(--lumen-soft);
  color: var(--lumen);
  font-size: 1.125rem;
}

.panel .data-source-title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: var(--weight-medium);
  color: var(--text);
}

.data-source .field-hint {
  margin: 0;
}

.data-source input[type="url"] {
  width: 100%;
  margin-top: calc(var(--space) / 2);
}

.data-source .add-files-row {
  margin-top: calc(var(--space) / 2);
}

/* The file list: where each file came from, and what the check says. */
.dataset-file-table td {
  vertical-align: top;
}

.file-source {
  display: block;
  margin-top: 0.125rem;
  color: var(--text-dim);
  font-size: 0.75rem;
  overflow-wrap: anywhere;
}

.file-check {
  font-size: 0.875rem;
}

.file-check--ok {
  color: var(--status-ok);
}

.file-check--warn {
  color: var(--status-warn);
}

.file-check--bad {
  color: var(--status-critical);
}

.file-check--quiet {
  color: var(--text-dim);
}

.file-row--fetching code {
  color: var(--text-muted);
}

.row-action {
  text-align: right;
}

/* The next step, once there's something to do with it. */
.next-step {
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: calc(var(--space) * 2);
  border-color: var(--lumen-line);
  background:
    radial-gradient(40rem 14rem at 100% 0%, rgb(251 231 8 / 0.07), transparent 70%),
    var(--surface);
}

.next-step-text {
  display: grid;
  gap: var(--space);
}

.next-step-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space);
}

/* Deleting stays out of the way, under everything else. */
.danger-footer {
  display: grid;
  justify-items: start;
  gap: var(--space);
  margin-top: calc(var(--space) * 2);
  padding: 0 0.125rem;
}

.danger-footer .inline-form {
  display: grid;
  gap: var(--space);
  width: min(100%, 36rem);
}

@media (max-width: 40rem) {
  .next-step {
    grid-template-columns: 1fr;
  }

  .row-action {
    text-align: left;
  }
}

/* Serving a LoRA checkpoint as an adapter reserves nothing: the recipe,
   revision, and GPU settings apply only to the dedicated choices. */
.serve-form:has(input[name="mode"][value="adapter"]:checked) .serve-dedicated {
  display: none;
}

/* The allowlist only matters when it's chosen. */
.model-new .job-hosts {
  display: none;
}

.model-new:has(input[name="internet"][value="allowlist"]:checked) .job-hosts {
  display: grid;
}

/* ---------- Fine-tuning (PRD section 14, phase 3a) ---------- */
/* The form shows what applies to the choices made: the typed repo for
   "another Hugging Face model", the adapter's rank for an adapter, and
   each method's data hint and settings. */
.fine-tune:has(input[name="train"][value="full"]:checked) .fine-tune-lora,
.fine-tune:not(:has(input[name="method"][value="dpo"]:checked)) .fine-tune-dpo,
.fine-tune:not(:has(input[name="method"][value="sft"]:checked)) .fine-tune-sft {
  display: none;
}

/* Fields hold a name or a number; their hints keep the row. */
.fine-tune .key-field input[type="text"],
.fine-tune .key-field select {
  max-width: 28rem;
}

.fine-tune .key-field input[type="number"],
.fine-tune #ft-cap {
  max-width: 10rem;
}

.fine-tune-check,
.fine-tune-estimate {
  display: grid;
  gap: var(--space);
}

/* The checkpoint a fine-tune's eval metric picks. */
.checkpoint-best {
  margin-left: calc(var(--space) * 0.75);
  color: var(--lumen);
}

/* The run's outcome, above the record of every checkpoint: which one is
   best, why, and the button to launch it. */
.best-checkpoint {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: calc(var(--space) * 1.5) calc(var(--space) * 3);
  margin: calc(var(--space) * 1.5) 0;
  padding: calc(var(--space) * 1.75) calc(var(--space) * 2);
  border: 1px solid var(--lumen-line);
  border-radius: var(--radius);
  background:
    radial-gradient(36rem 12rem at 0% 0%, rgb(251 231 8 / 0.09), transparent 70%),
    rgb(251 231 8 / 0.03);
}

.best-checkpoint-text {
  display: grid;
  gap: calc(var(--space) / 2);
  min-width: 0;
  max-width: 44rem;
}

.panel .best-checkpoint-title {
  margin: 0;
  font-size: 1rem;
  font-weight: var(--weight-medium);
  color: var(--text);
}

.panel .best-checkpoint-facts {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* The best row, marked at its edge to match the card above. */
.checkpoint-row--best td:first-child {
  box-shadow: inset 3px 0 0 var(--lumen);
  padding-left: calc(var(--space) * 1.25);
}

.checkpoint-actions {
  display: inline-flex;
  justify-content: flex-end;
  gap: var(--space);
  white-space: nowrap;
}

/* Before and after: each sample is the customer's message, then the two
   replies side by side. What fine-tuning changed is lit in Lumen. */
.sample-list {
  display: grid;
  gap: calc(var(--space) * 2);
  margin: calc(var(--space) * 1.5) 0 0;
  padding: 0;
  list-style: none;
}

.sample-list > .sample {
  display: grid;
  gap: calc(var(--space) * 1.5);
  padding: calc(var(--space) * 2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgb(0 0 0 / 0.16);
}

.sample-prompt {
  margin: 0;
  padding-left: calc(var(--space) * 1.5);
  border-left: 2px solid var(--line-strong);
}

.sample-prompt p {
  margin: 0;
  max-width: 64ch;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--text);
}

.sample-pair {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: calc(var(--space) * 1.5);
}

.sample-answer {
  display: grid;
  align-content: start;
  gap: var(--space);
  min-width: 0;
  padding: calc(var(--space) * 1.5);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.sample-answer--tuned {
  border-color: var(--lumen-line);
  background: linear-gradient(rgb(251 231 8 / 0.05), rgb(251 231 8 / 0.05)), var(--surface);
}

.sample-who {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: var(--weight-medium);
  color: var(--text-muted);
}

.sample-answer--tuned .sample-who {
  color: var(--lumen);
}

/* Short fields (a queue, a priority) as label-and-value tags. */
.answer-tags {
  display: flex;
  flex-wrap: wrap;
  gap: calc(var(--space) * 0.75);
  margin: 0;
}

.answer-tag {
  display: inline-flex;
  align-items: baseline;
  gap: 0.375rem;
  padding: 0.125rem 0.5rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  font-size: 0.8125rem;
}

.answer-tag dt {
  color: var(--text-dim);
}

.answer-tag dd {
  margin: 0;
  color: var(--text);
}

.answer-tag--changed {
  border-color: var(--lumen);
  background: color-mix(in srgb, var(--lumen) 12%, transparent);
}

.answer-tag--changed dd {
  color: var(--lumen);
}

/* Long fields (the reply itself) read as prose. */
.answer-long {
  display: grid;
  gap: 0.25rem;
}

.panel .answer-long-label {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.panel .answer-text {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--text);
}

.panel .answer-text--none {
  color: var(--text-dim);
  font-style: italic;
}

/* A model's reasoning, folded under its answer: there if wanted. */
.answer-reasoning > summary {
  width: fit-content;
  cursor: pointer;
  font-size: 0.8125rem;
  color: var(--text-dim);
}

.answer-reasoning > summary:hover {
  color: var(--text-muted);
}

.answer-reasoning p {
  max-height: 16rem;
  margin: calc(var(--space) / 2) 0 0;
  padding-left: var(--space);
  overflow: auto;
  border-left: 2px solid var(--line);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 0.8125rem;
  color: var(--text-dim);
}

/* ---------- Narrow screens: tables and long lines ---------- */
/* A code sample on its own (a model's "Call it"): boxed like the others,
   scrolling sideways rather than widening the page. */
pre.sample-code {
  margin: 0;
  padding: calc(var(--space) * 2);
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-inset);
  color: var(--text-muted);
  font-size: 0.8929rem;
  line-height: 1.65;
}

.tag {
  white-space: nowrap;
}

/* A benchmark is three short columns: it needn't span the panel. */
.data-table.bench {
  max-width: 44rem;
}

.revision {
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
}

/* Chat: nothing in a message may be wider than the thread. */
.chat-messages {
  grid-template-columns: minmax(0, 1fr);
}

.chat-messages > li,
.chat-message,
.chat-answer {
  min-width: 0;
}

/* Activity: when and who read quieter than what happened. */
.activity-table td:nth-child(1) {
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.8571rem;
}

.activity-table td:nth-child(2) {
  color: var(--text-muted);
}

/* On a phone a wide table scrolls sideways inside its panel while the
   panel's heading and notes stay where they are. */
@container app-main (max-width: 44rem) {
  .panel:has(> .data-table) > :not(.data-table) {
    position: sticky;
    left: 0;
    max-width: calc(100cqi - 2.5rem - 2px);
  }

  /* Activity: each event as a block, who and when over what happened. */
  .activity-table thead {
    display: none;
  }

  .activity-table,
  .activity-table tbody {
    display: block;
  }

  .activity-table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.125rem 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--line);
  }

  .activity-table tr:last-child {
    border-bottom: 0;
  }

  .activity-table td {
    padding: 0;
    border: 0;
    overflow-wrap: anywhere;
  }

  .activity-table td:nth-child(1) {
    grid-area: 1 / 2;
    color: var(--text-dim);
    font-size: 0.8571rem;
  }

  .activity-table td:nth-child(2) {
    grid-area: 1 / 1;
    color: var(--text-muted);
    font-size: 0.8571rem;
  }

  .activity-table td:nth-child(3) {
    grid-column: 1 / -1;
  }

  .panel:has(> .data-table) {
    scrollbar-width: thin;
  }

  .dataset-file-table {
    min-width: 38rem;
  }

  .data-table.checkpoints {
    min-width: 40rem;
  }

  .data-table.bench {
    display: block;
    overflow-x: auto;
  }
}

/* Phones: panels and tiles close up a little. */
@media (max-width: 40rem) {
  .panel {
    padding: 1.125rem 1.25rem;
  }

  .stat {
    padding: 1rem 1.25rem;
  }

  .empty-state {
    padding: 1.75rem 1.25rem;
  }

  .stat-value {
    font-size: 2rem;
  }

  .app-main {
    gap: calc(var(--space) * 2);
    padding-top: calc(var(--space) * 2.5);
  }
}

/* ---------- Staff console (PRD section 15) ---------- */
.staff-badge {
  margin-left: auto;
  padding: 0.0625rem 0.5rem;
  border: 1px solid var(--lumen-line);
  border-radius: var(--radius-pill);
  color: var(--lumen);
}

/* Where a dated billing term stands. */
.term-status {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.0625rem 0.5rem;
  border-radius: var(--radius-pill);
  font-size: 0.7143rem;
  white-space: nowrap;
}

.term-status::before {
  content: "";
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 50%;
  background: currentColor;
}

.term-status--active {
  background: color-mix(in srgb, var(--status-ok) 13%, transparent);
  color: var(--status-ok);
}

.term-status--scheduled {
  background: color-mix(in srgb, var(--status-info) 13%, transparent);
  color: var(--status-info);
}

.term-status--ended,
.term-status--withdrawn {
  background: rgb(255 246 235 / 0.07);
  color: var(--text-muted);
}

.section-note,
.row-note,
.unit-per {
  color: var(--text-dim);
}

.row-note {
  margin: 0.25rem 0 0;
  font-size: 0.8571rem;
}

.unit-per {
  display: block;
  font-size: 0.8571rem;
}

.term-price {
  white-space: nowrap;
}

.term-form {
  margin-top: calc(var(--space) * 1.5);
}

.step-up {
  border-color: var(--lumen-line);
}

.confirm-actions {
  justify-content: flex-start;
  gap: var(--space);
  margin-top: calc(var(--space) * 2);
}

.market-baseline {
  margin: calc(var(--space) * 2) 0;
  padding: calc(var(--space) * 1.5) calc(var(--space) * 2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-inset);
}

.market-baseline h3 {
  margin: 0 0 0.5rem;
  font-size: 0.9286rem;
}

.market-baseline p {
  margin: 0;
}

.csv-paste {
  margin-top: calc(var(--space) * 3);
}

.csv-paste summary {
  cursor: pointer;
  color: var(--text-muted);
}

.csv-paste textarea {
  font-family: var(--font-mono);
}
