:root {
  --bg: #f6f2ea;
  --bg-deep: #efe9de;
  --surface: #fffdf8;
  --surface-2: #faf6ef;
  --ink: #1f1c18;
  --ink-2: #3b362f;
  --muted: #6e665c;
  --faint: #9a9185;
  --line: #e4ddd0;
  --line-strong: #d4cbbb;
  --accent: #c8402d;
  --accent-hover: #b23824;
  --accent-ink: #fff;
  --accent-soft: #f7e3dc;
  --accent-line: #ecc4b8;
  --ok: #3f7a3a;
  --ok-soft: #e3efe2;
  --ok-ink: #2f5a2c;
  --warn: #b7791f;
  --warn-soft: #f6ead2;
  --warn-ink: #7a4f0e;
  --bar: #dfa99b;
  --bar-strong: #c8402d;
  --grid: #ece6db;
  /* Categorical colors for breakdowns, checked for color-blind separation
     against the surface; more rows fold into "Other". */
  --s1: #c8402d;
  --s2: #0b8fa3;
  --s3: #6b5fd0;
  --s0: #b9b0a3;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(60, 40, 20, .04), 0 1px 1px rgba(60, 40, 20, .03);
  --shadow-lift: 0 4px 16px rgba(60, 40, 20, .08), 0 1px 3px rgba(60, 40, 20, .05);
  --ring: 0 0 0 3px rgba(200, 64, 45, .28);
  --highlight: inset 0 1px 0 rgba(255, 255, 255, .7);
  --glow: rgba(200, 64, 45, .09);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --ease-spring: cubic-bezier(.3, 1.4, .5, 1);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Hiragino Mincho ProN", "Songti SC", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161412;
    --bg-deep: #110f0e;
    --surface: #201d1a;
    --surface-2: #1b1917;
    --ink: #ede7de;
    --ink-2: #d6cec2;
    --muted: #a39a8e;
    --faint: #7b7369;
    --line: #322d28;
    --line-strong: #443d36;
    --accent: #e0563f;
    --accent-hover: #ea6a54;
    --accent-soft: #3a211b;
    --accent-line: #5a2e24;
    --ok: #86c07f;
    --ok-soft: #1f2e1e;
    --ok-ink: #a7d1a2;
    --warn: #e0a64a;
    --warn-soft: #34291a;
    --warn-ink: #ecc286;
    --bar: #8c4434;
    --bar-strong: #e0563f;
    --grid: #2b2723;
    --s1: #d9563f;
    --s2: #1a9db0;
    --s3: #7c78e0;
    --s0: #5c554d;
    --shadow: 0 1px 2px rgba(0, 0, 0, .25);
    --shadow-lift: 0 8px 24px rgba(0, 0, 0, .38), 0 1px 3px rgba(0, 0, 0, .3);
    --ring: 0 0 0 3px rgba(224, 86, 63, .35);
    --highlight: inset 0 1px 0 rgba(255, 255, 255, .035);
    --glow: rgba(224, 86, 63, .07);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

/* The gutter stays, so pages with and without a scrollbar line up. */
html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  /* A faint vermilion glow behind the header, as light through a gate. */
  background: radial-gradient(1100px 420px at 50% -160px, var(--glow), transparent 72%) no-repeat, var(--bg);
  color: var(--ink);
  font: 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; text-underline-offset: 3px; }
a:hover { text-decoration: underline; }
a.plain { color: inherit; }
code { font-family: var(--mono); font-size: .88em; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.005em; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }
main:focus { outline: none; }

/* Skip link: out of sight until a keyboard reaches it. */
.skip {
  position: fixed;
  top: 10px;
  left: 50%;
  z-index: 100;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: .9rem;
  font-weight: 500;
  transform: translate(-50%, -160%);
  transition: transform .2s var(--ease);
}
.skip:focus { transform: translate(-50%, 0); text-decoration: none; }

/* A page that takes a moment to come shows a thin bar along the top. */
.progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: 2px;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}
.progress.on { opacity: 1; animation: load 8s cubic-bezier(.1, .6, .2, 1) forwards; }
::selection { background: var(--accent-soft); }

/* Header: sticks to the top, frosted, with a hairline once the page scrolls. */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid transparent;
  transition: border-color .2s, box-shadow .2s, background-color .2s;
  view-transition-name: top-bar;
}
.top-bar.scrolled {
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  backdrop-filter: saturate(1.6) blur(14px);
  border-bottom-color: var(--line);
  box-shadow: 0 6px 20px -16px rgba(0, 0, 0, .35);
}
.top-bar > .top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 880px;
  width: 100%;
  margin: 0 auto;
  padding: 14px 16px;
}
.wide-page .top-bar > .top, .wide-page main { max-width: 1120px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font: 600 1.25rem var(--serif); letter-spacing: .005em; }
.brand:hover { text-decoration: none; }
.brand img { transition: transform .5s var(--ease-spring); }
.brand:hover img { transform: rotate(-8deg) scale(1.06); }
.top nav { display: flex; align-items: center; gap: 6px; min-width: 0; }
.top nav form { margin: 0; }
.top nav > a, .top nav button.link {
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-size: .95rem;
  transition: background .15s, color .15s;
}
.top nav > a:hover, .top nav button.link:hover { background: var(--bg-deep); color: var(--ink); text-decoration: none; }
.top nav > a[aria-current] { color: var(--ink); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.top nav > a.who { display: flex; align-items: center; gap: 8px; color: var(--ink); min-width: 0; padding: 4px 12px 4px 4px; }
.who .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who .avatar { width: 28px; height: 28px; font-size: .8rem; }

main {
  flex: 1;
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 16px 16px 64px;
}

footer {
  text-align: center;
  color: var(--faint);
  font-size: .85rem;
  padding: 24px 16px 32px;
}

.muted { color: var(--muted); }
.faint { color: var(--faint); }
.fine { color: var(--muted); font-size: .85rem; margin: 1.25em 0 0; }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }

.flash {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  margin: 0 auto 20px;
  border: 1px solid transparent;
}
.flash::before { content: ""; flex: none; width: 8px; height: 8px; margin-top: .55em; border-radius: 50%; background: currentColor; }
.flash > span { flex: 1; min-width: 0; }
.flash-x {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin: -1px -6px -1px 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: inherit;
  opacity: .6;
  transition: opacity .15s, background-color .15s;
}
.flash-x:hover { opacity: 1; background: color-mix(in srgb, currentColor 12%, transparent); }
.flash-x svg { width: 14px; height: 14px; }
.notice { background: var(--ok-soft); color: var(--ok-ink); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.alert { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }

/* Buttons */
.button, button {
  font: inherit;
  cursor: pointer;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
  box-shadow: var(--shadow), var(--highlight);
  transition: border-color .15s, background-color .15s, color .15s, box-shadow .2s, transform .2s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.button:hover { border-color: var(--muted); text-decoration: none; }
.button:active { transform: scale(.97); transition-duration: .06s; }
.button.primary {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 88%, #fff), var(--accent));
  border-color: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 1px 2px color-mix(in srgb, var(--accent) 35%, transparent), inset 0 1px 0 rgba(255, 255, 255, .22);
}
.button.primary:hover {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent-hover) 90%, #fff), var(--accent-hover));
  border-color: var(--accent-hover);
  box-shadow: 0 4px 14px -2px color-mix(in srgb, var(--accent) 45%, transparent), inset 0 1px 0 rgba(255, 255, 255, .22);
  transform: translateY(-1px);
}
.button.primary:active { transform: scale(.97); }
.button:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.button.danger:disabled:hover { background: var(--surface); border-color: var(--accent-line); color: var(--accent); }
.button.large { padding: 12px 24px; font-size: 1.05rem; }
.button.large svg { transition: transform .25s var(--ease); }
.button.large:hover svg { transform: translateX(3px); }
.button.small { padding: 6px 14px; font-size: .88rem; }
.button.tiny { padding: 3px 10px; font-size: .8rem; box-shadow: none; }
.button.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--muted); }
.button.ghost:hover { background: var(--bg-deep); color: var(--ink); }
.button.danger { color: var(--accent); border-color: var(--accent-line); }
.button.danger:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.button.provider { width: 100%; padding: 12px 18px; }
.button.provider:hover { transform: translateY(-1px); box-shadow: var(--shadow-lift); }
/* A form being sent: its button spins and can't be pressed twice. */
.button.busy { pointer-events: none; color: transparent !important; position: relative; }
.button.busy > * { visibility: hidden; }
.button.busy::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 1em;
  height: 1em;
  border: 2px solid var(--muted);
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.button.primary.busy::after { border-color: var(--accent-ink); border-right-color: transparent; }
.button.copy.copied { color: var(--ok-ink); border-color: color-mix(in srgb, var(--ok) 40%, transparent); background: var(--ok-soft); animation: bump .3s var(--ease-spring); }
button.link { background: none; border: 0; padding: 0; color: var(--muted); }
button.link:hover { color: var(--ink); }
.icon { width: 20px; height: 20px; flex: none; }
.button svg { width: 15px; height: 15px; flex: none; }

/* Home */
.hero { text-align: center; padding: 56px 0 48px; }
.hero h1 { font-size: clamp(2.1rem, 6.5vw, 3.4rem); letter-spacing: -.015em; margin-bottom: .4em; }
.crest-wrap { position: relative; width: 96px; height: 96px; margin: 0 auto 28px; }
.crest-wrap::before {
  content: "";
  position: absolute;
  inset: -28px;
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 22%, transparent), transparent);
  animation: breathe 5s ease-in-out infinite;
}
.crest { position: relative; display: block; }
.lede { max-width: 34em; margin: 0 auto 32px; font-size: 1.12rem; color: var(--muted); }
.kanji { font-family: var(--serif); color: var(--accent); white-space: nowrap; }
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 16px;
}
.features div {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow), var(--highlight);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s;
}
.features div:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift), var(--highlight); border-color: var(--line-strong); }
.features p { color: var(--muted); margin: 0; }
.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  margin-bottom: 14px;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent-line);
}
.feature-icon svg { width: 20px; height: 20px; }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow), var(--highlight);
  min-width: 0;
}
.card > :last-child { margin-bottom: 0; }
.card > h2:first-child, .card-head h2 { margin-bottom: .35em; }
h2.with-icon { display: flex; align-items: center; gap: 10px; }
.h-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--bg-deep);
  color: var(--muted);
  box-shadow: inset 0 0 0 1px var(--line);
}
.h-icon svg { width: 17px; height: 17px; }
.card:hover .h-icon { color: var(--accent); }
.h-icon { transition: color .2s; }
.danger-zone .h-icon { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent-line); }
.card-sub { color: var(--muted); font-size: .92rem; margin: -.15em 0 16px; }
.narrow { max-width: 420px; margin: 40px auto; }
/* Sign-in and device pages sit a little above the middle of the window. */
main:has(> .auth) { display: flex; flex-direction: column; justify-content: center; padding-bottom: 12vh; }
main:has(> .auth) > .narrow { width: 100%; }
main:has(> .auth) > .flash { width: 100%; max-width: 420px; margin: 0 auto -20px; }
.auth { padding: 32px; box-shadow: var(--shadow-lift), var(--highlight); }
.auth-crest { display: block; margin-bottom: 18px; }
.prose { max-width: 680px; margin: 24px auto; overflow-wrap: anywhere; }
.prose h2 { margin-top: 1.6em; }
.prose li { margin-bottom: .5em; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.stack form { margin: 0; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.grid-2 > div { display: flex; flex-direction: column; gap: 16px; }
.grid-2 > div > .card { margin-bottom: 0; }
.grid-2 > div > .card:last-child { flex: 1; }
.grid-2 > .card { margin-bottom: 0; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 16px; align-items: start; margin-bottom: 16px; }
.grid-main > .card, .grid-main > div > .card:last-child { margin-bottom: 0; }

/* Account */
.profile { display: flex; align-items: center; gap: 18px; margin: 16px 0 28px; min-width: 0; }
.profile > div { min-width: 0; flex: 1; }
.profile h1 { margin: 0 0 .15em; overflow-wrap: anywhere; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.profile p { margin: 0; overflow-wrap: anywhere; }
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--accent-soft);
  color: var(--accent);
  font: 600 1.5rem var(--serif);
  box-shadow: 0 0 0 1px var(--accent-line);
}
/* An initial takes its tone from the name; a photo keeps its own colors. */
span.avatar[class*=tone-] {
  background: color-mix(in srgb, var(--tone) 16%, var(--surface));
  color: color-mix(in srgb, var(--tone) 82%, var(--ink));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--tone) 30%, var(--surface));
}
.tone-0 { --tone: var(--accent); }
.tone-1 { --tone: #0b8fa3; }
.tone-2 { --tone: #6b5fd0; }
.tone-3 { --tone: #b7791f; }
.tone-4 { --tone: #3f8a3a; }
.tone-5 { --tone: #b0457f; }
.profile .avatar { width: 72px; height: 72px; font-size: 1.7rem; box-shadow: 0 0 0 4px var(--surface), 0 0 0 5px var(--line-strong); }
.rows { list-style: none; margin: 0; padding: 0; }
.rows li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.rows li:first-child { border-top: 0; padding-top: 0; }
.rows li:last-child { padding-bottom: 0; }
.rows form { margin: 0; }
.row-icon { display: flex; }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row-main > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-main .muted { font-size: .9rem; }
.row-actions { display: flex; gap: 8px; align-items: center; flex: none; }
.device { font-weight: 400; color: var(--muted); }

.danger-zone { border-color: var(--accent-line); }
.danger-zone h2 { color: var(--accent); }
.confirm-form label { display: block; margin-bottom: 8px; font-size: .9rem; color: var(--muted); }
.confirm-form label strong { color: var(--ink); font-weight: 600; }
.confirm-form .inline { max-width: 520px; }
.inline { display: flex; gap: 10px; flex-wrap: wrap; }
.inline input { flex: 1 1 200px; min-width: 0; }

input, select {
  font: inherit;
  line-height: 1.3;
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder { color: var(--faint); }
input:hover, select:hover { border-color: var(--muted); }
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
input[type=checkbox] { width: 18px; height: 18px; padding: 0; accent-color: var(--accent); }
input[type=search] { padding-left: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%239a9185' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='9' cy='9' r='6'/%3E%3Cpath d='m14 14 4 4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: 13px center; background-size: 16px; }

/* Device */
.code-input { text-align: center; font: 600 1.5rem var(--mono); letter-spacing: .15em; text-transform: uppercase; }
.code {
  text-align: center;
  font: 600 2rem var(--mono);
  letter-spacing: .15em;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px dashed var(--line-strong);
}
.actions { display: flex; gap: 10px; }
.actions .button { flex: 1; }
.done {
  width: 56px;
  height: 56px;
  margin-bottom: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ok-soft);
  color: var(--ok-ink);
  animation: pop .5s var(--ease-spring) both;
}
.done svg { width: 28px; height: 28px; }
.done path { stroke-dasharray: 24; stroke-dashoffset: 24; animation: draw .45s .25s var(--ease) forwards; }

/* AI and API keys */
.add-key { margin-top: 16px; }
.add-key label.check { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.add-key label.check input { flex: none; }
.new-key {
  background: var(--ok-soft);
  border: 1px solid color-mix(in srgb, var(--ok) 30%, transparent);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  margin-bottom: 20px;
}
.new-key > :last-child { margin-bottom: 0; }
.new-key strong { color: var(--ok-ink); }
.secret { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 8px 8px 12px; }
.secret code { flex: 1; min-width: 0; font-size: .95rem; overflow-wrap: anywhere; user-select: all; }
pre { position: relative; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; overflow-x: auto; font-size: .85rem; line-height: 1.6; margin: 0 0 1em; }
.snippet { position: relative; }
.snippet .copy { position: absolute; top: 7px; right: 7px; }
.snippet pre { padding-right: 72px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 22px 0 10px; }
.section-title h3 { margin: 0; }
.account-chart { margin-bottom: 22px; }
.account-chart .chart, .account-chart .chart-y { height: 110px; }
.models-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }

/* Usage meter */
.quota { margin: 4px 0 18px; }
.quota-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.quota-head strong { font-size: 1.35rem; font-family: var(--serif); font-variant-numeric: tabular-nums; }
.meter { display: block; width: 100%; height: 8px; border-radius: 999px; overflow: hidden; }
.meter .track { fill: var(--line); }
/* Green while there is room, amber past 80%, red at the limit. */
.meter .fill { fill: var(--ok); transform-box: fill-box; transform-origin: left; animation: grow-x .9s .15s var(--ease) both; }
.meter.warn .fill { fill: var(--warn); }
.meter.full .fill { fill: var(--accent); }

/* Admin */
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 8px 0 22px; }
.admin-head h1 { margin: 0; font-size: 1.75rem; }
.admin-head p { margin: 2px 0 0; color: var(--muted); }
.tabs { display: inline-flex; gap: 2px; padding: 3px; background: var(--bg-deep); border: 1px solid var(--line); border-radius: 999px; }
.tabs a { padding: 6px 16px; border-radius: 999px; color: var(--muted); font-size: .92rem; font-weight: 500; transition: color .15s, background .15s; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.current { color: var(--ink); background: var(--surface); box-shadow: var(--shadow), var(--highlight), 0 0 0 1px var(--line); view-transition-name: admin-tab; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 12px; flex-wrap: wrap; margin-bottom: 14px; }
.card-head h1 { font-size: 1.5rem; margin: 0; }
.card-head h2 { margin: 0; }
.card-head .card-sub { margin: 4px 0 0; }
.card-head-tight { margin-bottom: 4px; align-items: center; }
.card-head p { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .92rem; margin-bottom: 4px; }
.back:hover { color: var(--ink); text-decoration: none; }

/* Stat tiles */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 12px; margin-bottom: 16px; }
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow), var(--highlight);
  min-width: 0;
  transition: border-color .2s, transform .3s var(--ease);
}
.stat:hover { border-color: var(--line-strong); }
.stat .label { display: block; color: var(--muted); font-size: .8rem; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; }
.stat .value { display: block; margin: 6px 0 2px; font: 600 1.75rem/1.1 var(--serif); font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat .note { display: block; color: var(--muted); font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat .note.bad, .stat .note .bad { color: var(--accent); }
.stat .meter { margin-top: 10px; height: 6px; }

/* Chart */
.chart-box { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; }
.chart-y { position: relative; height: 160px; min-width: 28px; color: var(--faint); font-size: .72rem; font-variant-numeric: tabular-nums; text-align: right; }
.chart-y .tick { position: absolute; right: 0; line-height: 1; transform: translateY(-50%); }
.chart-y .top { top: 0; }
.chart-y .mid { top: 50%; }
.chart-y .zero { top: 100%; }
.chart-plot { position: relative; min-width: 0; }
.chart { display: block; width: 100%; height: 160px; overflow: visible; }
.chart .grid { stroke: var(--grid); stroke-width: 1; stroke-dasharray: 3 4; }
.chart .hit { fill: transparent; }
.chart .day:hover .hit, .chart .day.active .hit { fill: var(--bg-deep); opacity: .6; }
.chart .bar, .chart .err { transform-box: fill-box; transform-origin: bottom; animation: grow-y .6s var(--ease) both; animation-delay: var(--d, 0s); }
.chart .bar { fill: var(--bar); transition: fill .12s; }
.chart .bar.today { fill: var(--bar-strong); }
.chart .err { fill: var(--warn); pointer-events: none; }
.chart .day:hover .bar, .chart .day.active .bar { fill: var(--accent-hover); }
.chart .base { stroke: var(--line-strong); stroke-width: 1; }
.chart-axis { display: flex; justify-content: space-between; color: var(--faint); font-size: .75rem; margin-top: 8px; }
.chart-tip {
  position: absolute;
  bottom: calc(100% - 8px);
  z-index: 2;
  min-width: 150px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--bg);
  font-size: .8rem;
  line-height: 1.45;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: var(--shadow-lift);
  transform: translateX(-50%);
  transition: left .12s var(--ease);
  animation: tip-in .15s var(--ease);
}
.chart-tip::after { content: ""; position: absolute; top: 100%; left: calc(50% + var(--caret, 0px)); margin-left: -5px; border: 5px solid transparent; border-top-color: var(--ink); }
.chart-tip strong { display: block; font-weight: 600; }
.chart-tip .bad { color: var(--warn); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; color: var(--muted); font-size: .82rem; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--bar); }
.legend i.today { background: var(--bar-strong); }
.legend i.err { background: var(--warn); }

/* Breakdowns: a stacked bar and its legend */
.eyebrow { margin: 0 0 10px; font: 600 .75rem var(--sans); letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.eyebrow.spaced { margin-top: 22px; }
.stackbar { display: block; width: 100%; height: 10px; border-radius: 999px; overflow: hidden; background: var(--bg-deep); }
.stackbar .seg { stroke: var(--surface); stroke-width: 2px; }
.stackbar { animation: grow-x .8s .1s var(--ease) both; transform-origin: left; }
.s0 { fill: var(--s0); background: var(--s0); }
.s1 { fill: var(--s1); background: var(--s1); }
.s2 { fill: var(--s2); background: var(--s2); }
.s3 { fill: var(--s3); background: var(--s3); }
.breakdown { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: .9rem; }
.breakdown li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto 3.2em; align-items: center; gap: 10px; }
.breakdown .swatch { width: 10px; height: 10px; border-radius: 3px; }
.breakdown .label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.breakdown .value { color: var(--ink-2); }
.breakdown .share { color: var(--muted); text-align: right; }
/* Pointing at a row picks out its share of the bar. */
.breakdown li { transition: opacity .15s; }
.breakdown:hover li:not(:hover) { opacity: .55; }
.stackbar .seg { transition: opacity .15s; }
.stackbar:has(+ .breakdown li:hover) .seg { opacity: .3; }
.stackbar:has(+ .breakdown li:nth-child(1):hover) .seg:nth-child(1),
.stackbar:has(+ .breakdown li:nth-child(2):hover) .seg:nth-child(2),
.stackbar:has(+ .breakdown li:nth-child(3):hover) .seg:nth-child(3),
.stackbar:has(+ .breakdown li:nth-child(4):hover) .seg:nth-child(4),
.stackbar:has(+ .breakdown li:nth-child(5):hover) .seg:nth-child(5) { opacity: 1; }
.empty-line { display: flex; align-items: center; gap: 10px; margin: 0; padding: 12px 14px; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); color: var(--muted); font-size: .92rem; }
.empty-line::before { content: ""; width: 6px; height: 6px; flex: none; border-radius: 50%; background: var(--line-strong); }

/* Leaderboard */
.leaders { list-style: none; margin: 0; padding: 0; counter-reset: rank; }
.leaders li { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); counter-increment: rank; min-width: 0; }
.leaders li:first-child { border-top: 0; padding-top: 0; }
.leaders li::before { content: counter(rank); width: 22px; height: 22px; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--bg-deep); color: var(--muted); font-size: .75rem; font-weight: 600; }
.leaders li:first-child::before { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent-line); }
.leaders li { transition: background-color .15s; }
.leaders .who-cell { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.leaders .who-cell > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leaders .who-cell .muted { font-size: .82rem; }
.leaders .num { text-align: right; font-size: .9rem; white-space: nowrap; }
.leaders .sub { display: block; font-size: .78rem; }

/* Filters */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .search { flex: 1 1 280px; display: flex; gap: 8px; margin: 0; max-width: 460px; }
.toolbar .search input { flex: 1; min-width: 0; }
.pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pills a { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: .88rem; background: var(--surface); transition: border-color .15s, color .15s; }
.pills a:hover { color: var(--ink); border-color: var(--line-strong); text-decoration: none; }
.pills a.current { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.pills .count { font-variant-numeric: tabular-nums; color: inherit; opacity: .75; font-size: .82rem; }

/* Tables */
.table-wrap { overflow-x: auto; margin-left: -24px; margin-right: -24px; padding: 0 24px; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { text-align: left; padding: 10px 14px; border-top: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
.table th:first-child, .table td:first-child { padding-left: 0; }
.table th:last-child, .table td:last-child { padding-right: 0; }
.table th { color: var(--muted); font-weight: 500; font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; border-top: 0; padding-top: 0; }
.table .num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table tbody tr { transition: background .12s; }
.table tfoot td { font-weight: 600; border-top: 1px solid var(--line-strong); }
.table td.bad { color: var(--accent); }
.table td.ellipsis { max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.table td.time { font-variant-numeric: tabular-nums; }
.table th a.sort { color: inherit; display: inline-flex; align-items: center; gap: 4px; }
.table th a.sort:hover { color: var(--ink); text-decoration: none; }
.table th a.sort.on { color: var(--ink); }
.table th a.sort.on::after { content: "↓"; font-size: .9em; }
.table th[aria-sort=ascending] a.sort.on::after { content: "↑"; }
.name-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.name-line a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.name-line .badge { flex: none; }
.table .show-sm, .name-line .show-sm { display: none; }
.table td.empty { text-align: center; color: var(--muted); padding: 28px 0; white-space: normal; }
.table .sub { display: block; color: var(--muted); font-size: .82rem; }
.users-table tbody tr:hover, .requests tbody tr:hover { background: var(--surface-2); }
.users-table tr[data-href] { cursor: pointer; }
.user-cell { display: flex; align-items: center; gap: 12px; min-width: 0; max-width: 340px; }
.user-cell .avatar { width: 36px; height: 36px; font-size: .95rem; }
.user-cell > div { min-width: 0; display: flex; flex-direction: column; }
.user-cell > div > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-cell a { color: var(--ink); font-weight: 600; }
.user-cell .muted { font-size: .85rem; }
.usage-col { width: 1%; }
.usage-cell { display: grid; grid-template-columns: 3.4em 72px auto; align-items: center; gap: 10px; }
.usage-cell .num { text-align: right; }
.usage-cell .meter { height: 5px; }
.usage-cell .limit { font-size: .78rem; }
.usage-cell .limit:only-of-type { grid-column: 2 / 4; }

.status { display: inline-block; min-width: 3.2em; padding: 0 7px; border-radius: 6px; font: 500 .78rem/1.7 var(--mono); text-align: center; }
.status.ok { background: var(--ok-soft); color: var(--ok-ink); }
.status.warn { background: var(--warn-soft); color: var(--warn-ink); }
.status.bad { background: var(--accent-soft); color: var(--accent); }
.requests td { padding-top: 8px; padding-bottom: 8px; }
.requests a, .leaders .who-cell a { color: var(--ink); font-weight: 500; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 1px 9px;
  border-radius: 999px;
  background: var(--bg-deep);
  color: var(--muted);
  font: 500 .75rem/1.6 var(--sans);
  letter-spacing: .01em;
  vertical-align: middle;
  white-space: nowrap;
}
.badge.ok { background: var(--ok-soft); color: var(--ok-ink); }
.badge.alert { background: var(--accent-soft); color: var(--accent); }
.badge.warn { background: var(--warn-soft); color: var(--warn-ink); }
.badge.accent { background: var(--accent); color: var(--accent-ink); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.dot.off { background: var(--faint); box-shadow: 0 0 0 3px var(--bg-deep); }
.filters { justify-content: flex-start; }
.select-label { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: .85rem; font-weight: 500; }
.select-label select { padding-top: 6px; padding-bottom: 6px; font-size: .9rem; min-width: 0; max-width: 220px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 3px 6px 3px 3px; border: 1px solid var(--accent-line); border-radius: 999px; background: var(--accent-soft); color: var(--ink); font-size: .88rem; font-weight: 500; min-width: 0; max-width: 260px; }
.chip .avatar { width: 24px; height: 24px; font-size: .7rem; }
.chip-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-x { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; flex: none; border-radius: 50%; color: var(--muted); font-size: 1.05rem; line-height: 1; }
.chip-x:hover { background: var(--surface); color: var(--ink); text-decoration: none; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 18px; }
.pager .muted { font-size: .88rem; }

.fields { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin: 12px 0 0; }
.fields label { display: flex; flex-direction: column; gap: 6px; font-size: .82rem; font-weight: 500; color: var(--muted); flex: 1 1 180px; min-width: 0; }
.fields label.check { flex-direction: row; align-items: center; gap: 8px; flex: 0 0 auto; color: var(--ink); font-size: .95rem; font-weight: 400; padding-bottom: 11px; }
.fields input:not([type=checkbox]), .fields select { width: 100%; }
.fields .button { flex: none; }
select {
  appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%239a9185' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 8 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
}
.hint { display: block; font-weight: 400; color: var(--faint); font-size: .78rem; }

details summary { cursor: pointer; }
details summary::-webkit-details-marker { display: none; }
details summary { list-style: none; }
details[open] > summary ~ * { animation: fade-down .22s var(--ease); }

/* Providers and models */
.items { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.items > li { border-top: 1px solid var(--line); background: var(--surface); }
.items > li:first-child { border-top: 0; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; min-width: 0; }
.item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.item-main > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-main strong { display: flex; align-items: center; gap: 8px; }
.item-main .muted { font-size: .85rem; }
.item form { margin: 0; }
.items details > summary { transition: background .12s; }
.items details > summary:hover { background: var(--surface-2); }
.items details[open] > summary { background: var(--surface-2); border-bottom: 1px solid var(--line); }
.chev { width: 16px; height: 16px; flex: none; color: var(--faint); transition: transform .25s var(--ease); }
details[open] > summary .chev { transform: rotate(90deg); }
.item-edit { padding: 4px 16px 16px; background: var(--surface-2); }
.item-edit .fields { margin-top: 8px; }
.item-edit-foot { display: flex; justify-content: flex-end; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.item-edit-foot form { margin: 0; }
.empty-state { text-align: center; padding: 28px 16px; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); }
/* An empty tray, drawn as a mask so it takes the text's color. */
.empty-state::before {
  content: "";
  display: block;
  width: 36px;
  height: 36px;
  margin: 0 auto 10px;
  border-radius: 11px;
  background: var(--bg-deep);
  box-shadow: inset 0 0 0 1px var(--line);
}
.empty-state { position: relative; }
.empty-state::after {
  content: "";
  position: absolute;
  top: 37px;
  left: 50%;
  width: 18px;
  height: 18px;
  margin-left: -9px;
  background: var(--faint);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 13h5l1.5 3h5l1.5-3h5'/%3E%3Cpath d='M5.5 6.5 3 13v5a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-5l-2.5-6.5A2 2 0 0 0 16.6 5H7.4a2 2 0 0 0-1.9 1.5z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 13h5l1.5 3h5l1.5-3h5'/%3E%3Cpath d='M5.5 6.5 3 13v5a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-5l-2.5-6.5A2 2 0 0 0 16.6 5H7.4a2 2 0 0 0-1.9 1.5z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.empty-state p { margin: 0; }
.empty-state p + p { margin-top: 4px; font-size: .9rem; }

details.add { margin-top: 14px; }
details.add > summary { display: inline-flex; }
details.add[open] > summary { margin-bottom: 2px; }
.add-form { margin-top: 10px; padding: 16px; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); background: var(--surface-2); }
.add-form .fields { margin-top: 0; }
.spaced { margin-top: 1.4em; }
.split { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.split > div { flex: 1 1 280px; min-width: 0; }
.split > div > :last-child, .split > form { margin-bottom: 0; }
.split > form.fields { flex: 1 1 340px; margin-top: 0; }
.split > form:not(.fields) { flex: none; align-self: center; margin: 0; }
.split + .split { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line); }
.divider { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
.kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 16px; margin: 0; font-size: .92rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.endpoint { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 6px 6px 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.endpoint code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.endpoint .badge { flex: none; }

[hidden] { display: none !important; }

@media (max-width: 860px) {
  .grid-2, .grid-main { grid-template-columns: minmax(0, 1fr); }
  .hide-md { display: none; }
}

@media (max-width: 520px) {
  .who .name { display: none; }
  .top nav > a.who { padding: 4px; }
  .card { padding: 18px; }
  .table-wrap { margin-left: -18px; margin-right: -18px; padding: 0 18px; }
  .stats .stat:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .rows li { flex-wrap: wrap; }
  .inline input { flex-basis: 100%; }
  .hero { padding-top: 32px; }
  .hide-sm { display: none; }
  .table .show-sm { display: table-cell; }
  .name-line .show-sm { display: inline-flex; }
  .select-label > span { display: none; }
  .select-label { flex: 1 1 30%; }
  .select-label select { width: 100%; max-width: none; }
  .stat .value { font-size: 1.45rem; }
  .stats { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
  .admin-head h1 { font-size: 1.5rem; }
  .item { flex-wrap: wrap; }
  .stat .note { white-space: normal; }
  .table th, .table td { padding-left: 8px; padding-right: 8px; }
  .user-cell { max-width: 190px; }
  .table td.ellipsis { max-width: 110px; }
  .table .usage-col { padding-right: 0; }
  .user-cell .avatar { display: none; }
  .usage-cell { display: block; text-align: right; }
  .usage-cell .meter, .usage-cell .limit { display: none; }
  .chart-y { min-width: 22px; }
}

/* Motion: short, on transform and opacity alone, so the compositor does it. */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes fade-down { from { opacity: 0; transform: translateY(-4px); } }
@keyframes grow-x { from { transform: scaleX(0); } }
@keyframes grow-y { from { transform: scaleY(0); } }
@keyframes pop { from { opacity: 0; transform: scale(.6); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes spin { to { transform: rotate(1turn); } }
@keyframes breathe { 50% { opacity: .55; transform: scale(.92); } }
@keyframes tip-in { from { opacity: 0; } }
@keyframes bump { 40% { transform: scale(1.08); } }
@keyframes load { 0% { transform: scaleX(0); } 8% { transform: scaleX(.3); } 100% { transform: scaleX(.92); } }
@keyframes float-in { from { opacity: 0; transform: translateY(10px) scale(.92); } }

/* Each block of the page rises in, one after another. */
main > * { animation: rise .45s var(--ease) both; }
main > :nth-child(2) { animation-delay: .04s; }
main > :nth-child(3) { animation-delay: .08s; }
main > :nth-child(4) { animation-delay: .12s; }
main > :nth-child(5) { animation-delay: .16s; }
main > :nth-child(6) { animation-delay: .2s; }
main > :nth-child(n+7) { animation-delay: .24s; }
.hero .crest-wrap { animation: float-in .7s var(--ease-spring) both; }
.hero h1, .hero .lede, .hero .button { animation: rise .55s var(--ease) both; }
.hero h1 { animation-delay: .08s; }
.hero .lede { animation-delay: .14s; }
.hero .button { animation-delay: .2s; }
.features > div { animation: rise .55s var(--ease) both; }
.features > div:nth-child(1) { animation-delay: .26s; }
.features > div:nth-child(2) { animation-delay: .32s; }
.features > div:nth-child(3) { animation-delay: .38s; }
.flash { animation: fade-down .3s var(--ease) both; }

/* Moving between pages crossfades, keeping the header still. */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .18s; }
/* The admin tab's pill slides to the tab that was picked. */
::view-transition-group(admin-tab) { animation-duration: .3s; animation-timing-function: cubic-bezier(.2, .7, .2, 1); }
::view-transition-old(admin-tab), ::view-transition-new(admin-tab) { height: 100%; animation-duration: .2s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .done path { stroke-dashoffset: 0; }
  .progress.on { transform: scaleX(.6); }
  @view-transition { navigation: none; }
}

/* Crashes */
.crash-title { color: var(--ink); display: block; max-width: 560px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: .9rem; }
.crash-heading { font: 600 1.15rem/1.4 var(--mono); overflow-wrap: anywhere; margin-top: 0; }
.crash-log { max-height: 70vh; overflow: auto; }
.crash-fixed { align-items: center; }
.crash-fixed input { flex: 0 1 160px; }

/* Feedback */
.feedback-title { color: var(--ink); display: block; max-width: 560px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feedback-message { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 1rem; line-height: 1.55; margin-top: 0; }
.feedback-files { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.feedback-files li { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.feedback-files a { display: flex; flex-direction: column; gap: 6px; min-width: 0; overflow-wrap: anywhere; }
.feedback-files img { width: 100%; height: 120px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.feedback-files .muted { font-size: .85rem; }
