:root {
  --bg: #f3f4f6;
  --bg-alt: #ffffff;
  --bg-sunken: #eef0f3;
  --fg: #14202b;
  --fg-2: #243240;
  --fg-mute: #3a4a58;
  --fg-sub: #3a4a58;
  --border: #e4e7ec;
  --ink: #1c2430;
  --ink-deep: #121820;
  --arctic: #f3f4f6;
  --cta: #0b7ea8;
  --cta-hover: #086888;
  --cta-soft: #e7f4f9;
  --font-display: "Inter", "Helvetica Neue", Arial, sans-serif;
  --font-sans: "Inter", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "IBM Plex Mono", "Courier New", monospace;
  --radius: 10px;
  --sidebar: 248px;
  --control: 42px;
}
* { box-sizing: border-box; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--cta); text-decoration: none; }
a:hover { color: var(--cta-hover); }
::selection { background: #d6eef6; color: var(--fg); }

.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.side {
  background: var(--bg-alt);
  color: var(--fg);
  border-right: 1px solid var(--border);
  padding: 18px 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}
.nav { overflow: auto; min-height: 0; padding-right: 2px; display: flex; flex-direction: column; gap: 2px; }
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--fg);
  padding: 4px 8px 12px;
}
.brand .mark { width: 56px; height: 56px; object-fit: contain; flex: none; }
.brand-name { font-weight: 700; font-size: 22px; letter-spacing: -0.03em; color: var(--fg); }
.nav-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--fg);
  margin: 16px 8px 4px;
}
.nav a, .nav-logout {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-decoration: none;
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: var(--fg);
  font: inherit;
  font-size: 15px;
  cursor: pointer;
}
.nav a:hover, .nav-logout:hover { background: var(--bg-sunken); color: var(--fg); }
.nav a.active { background: var(--cta-soft); color: var(--cta-hover); font-weight: 700; }
.ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding: 8px; border-top: 1px solid var(--border); }
.side label { color: var(--fg-mute); margin: 0 0 4px; }
.side select { background: var(--bg); }
.who-row { display: flex; align-items: center; gap: 8px; }
.who { flex: 1; min-width: 0; font-size: 14px; margin: 0; color: var(--fg); }
.nav-logout.icon-only { width: 36px; height: 36px; padding: 0; justify-content: center; flex: none; }
.who small { display: block; color: var(--fg-2); font-size: 13px; font-family: var(--font-sans); }
.side-foot form { margin: 0; }
.side-foot hr { width: 100%; height: 0; margin: 4px 0; border: 0; border-top: 1px solid var(--border); }
.nav-toggle { display: none; }

.main {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 28px 32px 64px;
  min-width: 0;
}
.main > * { margin-block: 0; }
.page-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 28px;
  row-gap: 6px;
  align-items: center;
  margin: 0;
  padding: 20px 24px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.page-head > h1 { grid-column: 1; grid-row: 1; }
.page-head > .lead { grid-column: 1; grid-row: 2; margin: 0; }
.page-head > div:not(.page-actions) { grid-column: 1; grid-row: 1 / span 2; min-width: 0; }
.page-head > .page-actions { grid-column: 2; grid-row: 1 / span 2; }
.page-head > .hint { grid-column: 1 / -1; grid-row: 3; margin: 4px 0 0; padding-top: 12px; border-top: 1px solid var(--border); color: var(--fg-2); font-size: 14px; }
.eyebrow { display: none; }
h1 {
  font-weight: 700;
  font-size: 24px;
  letter-spacing: -0.015em;
  line-height: 1.15;
  margin: 0;
}
.page-head .lead, .lead { color: var(--fg-2); margin: 6px 0 0; max-width: 68ch; font-size: 15px; line-height: 1.45; }
.endpoints { list-style: none; margin: 14px 0 0; padding: 12px 0 0; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.endpoints li { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.endpoints li > span { font-weight: 700; color: var(--fg); }
.endpoints code { font-size: 14px; }
.endpoints em { font-style: normal; color: var(--fg-2); font-size: 14px; }
.snippet .field-help { margin: 2px 0 0; max-width: 52ch; }
.page-actions { display: flex; gap: 8px; flex: none; align-items: center; }
.hint { margin: 0; color: var(--fg); font-size: 15px; }
.field-help { margin: 6px 0 0; color: var(--fg-2); font-size: 14px; }

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 0; }
.stat {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.stat b { display: block; font-size: 26px; letter-spacing: -0.015em; margin: 0; }
.stat span { font-size: 14px; font-weight: 700; color: var(--fg); }
.stat .field-help { margin: 0; }

.card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin: 0;
  min-width: 0;
}
.card > * { margin: 0; }
.card h2 { font-size: 15px; margin: 0; }
.status-line { display: flex; align-items: center; gap: 12px; }

.split { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.8fr); gap: 16px; align-items: start; }
.snippets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }

table { width: 100%; border-collapse: collapse; table-layout: fixed; }
td, th { overflow-wrap: anywhere; }
th {
  font-size: 14px;
  font-weight: 700;
  color: var(--fg);
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}
td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: middle; color: var(--fg); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.model-name { display: flex; align-items: flex-start; gap: 10px; }
.model-name strong { display: block; font-weight: 600; }
.model-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 3px; min-width: 0; }
.model-meta code { color: var(--fg-2); }
.eu-flag { width: 24px; height: 16px; flex: none; margin-top: 3px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(20, 32, 43, 0.12); }
table:has(.model-name) { table-layout: auto; }
table:has(.model-name) td:first-child,
table:has(.model-name) th:first-child,
table:has(.model-name) td.num,
table:has(.model-name) th.num { width: 1%; white-space: nowrap; }
tr[hidden] { display: none; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fafbfc; }
.table-wrap { overflow-x: auto; }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 168px; margin-top: 8px; }
.bar-col { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; }
.bar-track { flex: 1; width: 100%; display: flex; align-items: flex-end; }
.bar-fill { display: block; width: 100%; height: 0; border-radius: 4px 4px 0 0; background: var(--cta); }
.bar-label { height: 16px; font-size: 11px; color: var(--fg-2); white-space: nowrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  background: transparent;
  color: var(--fg);
}
.btn--primary { background: var(--cta); color: #fff; }
.btn--primary:hover { background: var(--cta-hover); color: #fff; }
.btn--dark { background: var(--ink); color: #fff; }
.btn--dark:hover { color: #fff; }
.btn--outline { border-color: var(--border); background: #fff; color: var(--fg); }
.btn--outline:hover { border-color: #c9cdd4; background: var(--bg-sunken); color: var(--fg); }
.btn--ghost { color: var(--fg-mute); }

label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--fg);
  margin: 16px 0 6px;
}
form > label:first-child { margin-top: 0; }
form.fields {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 640px;
}
form.fields label { margin: 0; }
form.fields .field, .card > .field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.card > .field { max-width: 360px; }
.card > .field label { margin: 0; }
form.fields .field-help { margin: 0; }
form.fields .actions { margin: 0; }
input, select, textarea {
  width: 100%;
  height: var(--control);
  font-family: inherit;
  font-size: 15px;
  line-height: 1.3;
  padding: 0 12px;
  border: 1px solid #8b98a5;
  border-radius: 8px;
  background: #fff;
  color: var(--fg);
}
textarea { height: auto; min-height: 96px; padding: 10px 12px; }
input[type="checkbox"], input[type="radio"], input[type="hidden"] {
  width: auto;
  height: auto;
  min-height: 0;
  padding: 0;
}
input:focus, select:focus, textarea:focus { outline: 2px solid #7ec4dc; border-color: var(--cta); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; align-items: start; }
.grid-2 > div > label:first-child { margin-top: 0; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row input, .row select { width: 180px; flex: none; }

.flash {
  padding: 10px 12px;
  border-radius: 8px;
  margin: 0;
  background: #fff;
  border: 1px solid var(--border);
}
.flash.error { background: #fdf2f2; border-color: #f0c9c9; }
.flash.ok { background: #f1f8f4; border-color: #c9e6d4; }

.secret {
  font-family: var(--font-mono);
  background: var(--ink-deep);
  color: #f4f7f8;
  padding: 12px 14px;
  border-radius: 8px;
  word-break: break-all;
  margin: 0;
}
.pill {
  display: inline-flex;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 13px;
  font-weight: 700;
  background: var(--bg-sunken);
  color: var(--fg-2);
  white-space: nowrap;
}
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 32px; }
.login-stack { display: flex; flex-direction: column; align-items: center; gap: 14px; width: min(400px, 100%); }
.login-legal { margin: 0; font-size: 13px; line-height: 1; }
.login-legal a { color: var(--fg-mute); }
.login-legal a:hover { color: var(--fg-2); }
.login-card {
  width: 100%;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px 28px;
}
.login-mark { width: 88px; height: auto; display: block; margin: 0 0 16px; }
.muted { color: var(--fg-2); }
.login-card h1 { font-size: 32px; }
code { font-family: var(--font-mono); font-size: 13px; color: var(--fg); }
td form { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
td form.row { flex-direction: row; align-items: center; }

.section-title { font-size: 18px; margin: 8px 0 0; }
.secret-row { display: flex; gap: 12px; align-items: stretch; }
.secret-row .secret { flex: 1; margin: 0; }
.secret-row .btn { align-self: stretch; height: auto; padding-inline: 16px; white-space: nowrap; }
.note {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--cta-soft);
  border: 1px solid #c5e4f0;
  border-radius: 10px;
  color: var(--fg);
  text-decoration: none;
}
.note:hover { color: var(--fg); border-color: var(--cta); }
.note .ico { width: 22px; height: 22px; margin-top: 1px; color: var(--cta-hover); }
.note strong { display: block; color: var(--fg); font-size: 15px; }
.note span { color: var(--fg-2); font-size: 14px; line-height: 1.45; }
.try-answer { margin: 0; padding: 12px 14px; border-radius: 8px; background: var(--bg); color: var(--fg); line-height: 1.45; }
.try-answer--bad { background: #fdf2f2; }
.snippet {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 0;
}
.snippet header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
}
.snippet h2 { font-size: 15px; margin: 0; }
.snippet pre {
  margin: 0;
  padding: 14px 16px 16px;
  background: var(--ink-deep);
  color: #e8eef2;
  overflow-x: auto;
}
.snippet--wide { grid-column: 1 / -1; }
.snippet code { color: inherit; font-size: 13.5px; line-height: 1.6; }
.tok-kw { color: #7ec8e3; }
.tok-fn { color: #d7b4f3; }
.tok-str { color: #9ddeb5; }
.tok-cmt { color: #8b9bab; font-style: italic; }
.tok-num { color: #e6c07b; }
.tok-key { color: #7ec8e3; }
details.more { margin-top: 8px; border-top: 1px solid var(--border); padding-top: 4px; }
details.more summary { cursor: pointer; font-weight: 700; padding: 8px 0; font-size: 14px; }
.check { display: flex; align-items: flex-start; gap: 8px; font-weight: 400; font-size: 14px; color: var(--fg); }
.check input { width: auto; margin-top: 3px; }

@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; align-content: start; }
  .side { position: relative; height: auto; overflow: visible; padding: 12px 16px; }
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    height: var(--control);
    margin: 0;
    font: inherit;
    font-weight: 700;
    font-size: 14px;
    line-height: 1;
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 8px;
    padding: 0 14px;
    cursor: pointer;
  }
  .brand { padding: 0 8px; align-self: center; }
  .side {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 12px;
    row-gap: 12px;
  }
  .side .nav, .side .side-foot { display: none; grid-column: 1 / -1; width: 100%; }
  .side.is-open .nav { display: flex; }
  .side.is-open .side-foot { display: flex; }
  .main { padding: 20px 16px 48px; }
  .split, .snippets, .stats, .grid-2, .secret-row, .snippet header { display: grid; grid-template-columns: 1fr; }
  .page-head { grid-template-columns: 1fr; }
  .page-head > .page-actions { grid-column: 1; grid-row: auto; }
}
