/* Skyline Privacy AI — web console styles (hand-written, no build step).
 *
 * Dark, green-tinted surfaces with one accent colour and pixel details: pixel fonts for
 * headings, labels and controls, notched 2 px "pixel" edges on buttons, corner brackets
 * on panels, segmented meters and the generated skyline (components/pixel.rs). The admin
 * site swaps the accent for amber (html[data-site="admin"]) so it never looks like the user
 * site. Pixel fonts are crisp at multiples of 6 px (the Chinese face is drawn on 12 px). */

@font-face {
  font-family: "Geist Pixel";
  src: url("/fonts/geist-pixel-square-1.9.1.woff2") format("woff2");
  font-display: swap;
}

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

/* Simplified Chinese glyph forms: GB2312 level 1, kana, Cyrillic and every character of the texts in
   every language but zh-TW (web/assets/README.md). */
@font-face {
  font-family: "Fusion Pixel";
  src: url("/fonts/fusion-pixel-12px-2026.10.16-sc-v4.woff2") format("woff2");
  font-display: swap;
  unicode-range: U+00B7, U+0400-04FF, U+2010-2027, U+2030-205E, U+2190-21FF, U+25A0-25FF, U+3000-30FF, U+4E00-9FFF,
    U+FF01-FF5E;
}

/* Taiwan glyph forms for zh-TW pages only: Big5 level 1 and every character of the zh-TW texts. */
@font-face {
  font-family: "Fusion Pixel TC";
  src: url("/fonts/fusion-pixel-12px-2026.10.16-tc.woff2") format("woff2");
  font-display: swap;
  unicode-range: U+00B7, U+0400-04FF, U+2010-2027, U+2030-205E, U+2190-21FF, U+25A0-25FF, U+3000-30FF, U+4E00-9FFF,
    U+FF01-FF5E;
}

:root {
  color-scheme: dark;
  --bg: #090c09;
  --bg-2: #0c110c;
  --field: #0a0f0a;
  --surface: #0f150f;
  --surface-2: #141c14;
  --surface-3: #1a241a;
  --border: #1d281d;
  --border-strong: #2b3a2b;
  --text: #e4ede1;
  --muted: #93a38f;
  --dim: #66765f;
  --primary: #8ef06c;
  --primary-hover: #aaff8c;
  --primary-shade: #4e9e39;
  --primary-ink: #071006;
  --primary-soft: rgba(142, 240, 108, 0.09);
  --primary-line: rgba(142, 240, 108, 0.35);
  --primary-glow: rgba(142, 240, 108, 0.16);
  --green: #6fe08b;
  --green-soft: rgba(111, 224, 139, 0.1);
  --green-line: rgba(111, 224, 139, 0.35);
  --amber: #ffc857;
  --amber-soft: rgba(255, 200, 87, 0.1);
  --amber-line: rgba(255, 200, 87, 0.35);
  --red: #ff7070;
  --red-soft: rgba(255, 112, 112, 0.1);
  --red-line: rgba(255, 112, 112, 0.38);
  --blue: #7cbcff;
  --blue-soft: rgba(124, 188, 255, 0.1);
  --blue-line: rgba(124, 188, 255, 0.35);
  --gray-soft: rgba(255, 255, 255, 0.05);
  --gray-line: rgba(255, 255, 255, 0.14);
  --shadow: 6px 6px 0 rgba(0, 0, 0, 0.45);
  --sidebar: 232px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    "Noto Sans CJK SC", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --pixel: "Geist Pixel", "Fusion Pixel", "Geist Mono", ui-monospace, monospace;
  /* Size of pixel-font labels and controls; Latin pixel glyphs need a little more. */
  --px-text: 12px;
  /* A text field's height: its padding, one 1.6 line and its border. */
  --field-h: calc(1.1rem + 1.6rem + 2px);
}

:root:lang(en) {
  --px-text: 13px;
}

/* Traditional Chinese: the Taiwan pixel face and Traditional Chinese system fonts first. */
:root:lang(zh-TW) {
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang TC", "Microsoft JhengHei", "Noto Sans CJK TC",
    Roboto, "Helvetica Neue", Arial, sans-serif;
  --pixel: "Geist Pixel", "Fusion Pixel TC", "Geist Mono", ui-monospace, monospace;
}

/* Japanese system fonts first, so kanji take Japanese glyph forms outside the pixel face. */
:root:lang(ja) {
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI",
    Meiryo, "Noto Sans CJK JP", Roboto, "Helvetica Neue", Arial, sans-serif;
}

:root[data-site="admin"] {
  --primary: #ffb84d;
  --primary-hover: #ffcd80;
  --primary-shade: #a8701d;
  --primary-ink: #150c00;
  --primary-soft: rgba(255, 184, 77, 0.09);
  --primary-line: rgba(255, 184, 77, 0.38);
  --primary-glow: rgba(255, 184, 77, 0.14);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body {
  background-image: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.045) 1px, transparent 0);
  background-size: 24px 24px;
}

::selection {
  background: var(--primary);
  color: var(--primary-ink);
}

* {
  scrollbar-color: var(--border-strong) transparent;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

h1,
h2,
h3,
h4 {
  margin: 0 0 0.5em;
  line-height: 1.25;
  font-family: var(--pixel);
  font-weight: 400;
  font-synthesis: none;
  letter-spacing: 0.01em;
}

h1 {
  font-size: 24px;
}

h2 {
  font-size: 18px;
}

h3 {
  font-size: 18px;
}

h4 {
  font-size: var(--px-text);
  margin-top: 1rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

p {
  margin: 0 0 0.75em;
}

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

code {
  background: var(--surface-3);
  color: #cfe6c7;
  padding: 0.1em 0.35em;
}

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

strong {
  font-weight: 600;
}

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

.small {
  font-size: 0.85em;
}

.center {
  text-align: center;
}

.wrap {
  word-break: break-all;
}

.pos {
  color: var(--green);
}

.neg {
  color: var(--red);
}

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

.link {
  display: inline-block;
  margin-top: 0.5rem;
}

.px-icon {
  display: inline-block;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  vertical-align: -3px;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* ---- buttons ------------------------------------------------------------------------- */

/* The 2 px edge (corner pixels left out), the bottom bevel and the fill are drawn inside the button's
   own box: a button covers nothing outside it, so it lines up with the fields beside it and never
   lands on a neighbour's or a panel's border. Sizes include the edge. */
.btn {
  --edge: var(--border-strong);
  --fill: var(--surface-2);
  --ink: var(--text);
  --bevel: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: calc(2.25rem + 4px);
  padding: calc(0.5rem + 2px) calc(1rem + 2px);
  border: 0;
  background:
    linear-gradient(var(--edge), var(--edge)) 2px 0 / calc(100% - 4px) 2px no-repeat,
    linear-gradient(var(--edge), var(--edge)) 2px 100% / calc(100% - 4px) 2px no-repeat,
    linear-gradient(var(--edge), var(--edge)) 0 2px / 2px calc(100% - 4px) no-repeat,
    linear-gradient(var(--edge), var(--edge)) 100% 2px / 2px calc(100% - 4px) no-repeat,
    linear-gradient(var(--bevel), var(--bevel)) 2px calc(100% - 2px) / calc(100% - 4px) 3px no-repeat,
    linear-gradient(var(--fill), var(--fill)) 2px 2px / calc(100% - 4px) calc(100% - 4px) no-repeat;
  color: var(--ink);
  font-family: var(--pixel);
  font-size: var(--px-text);
  font-weight: 400;
  font-synthesis: none;
  line-height: 1.2;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.12s steps(2);
}

.btn:hover {
  --edge: var(--primary);
  --ink: var(--primary);
  text-decoration: none;
}

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

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  --edge: var(--primary);
  --fill: var(--primary);
  --ink: var(--primary-ink);
  --bevel: var(--primary-shade);
}

.btn-primary:hover {
  --edge: var(--primary-hover);
  --fill: var(--primary-hover);
  --ink: var(--primary-ink);
}

.btn-danger {
  --edge: var(--red);
  --fill: var(--red);
  --ink: #1d0505;
  --bevel: #b04545;
}

.btn-danger:hover {
  --edge: #ff8f8f;
  --fill: #ff8f8f;
  --ink: #1d0505;
}

.btn-danger-ghost {
  --ink: var(--red);
}

.btn-danger-ghost:hover {
  --edge: var(--red);
  --fill: var(--red-soft);
  --ink: var(--red);
}

.btn-ghost {
  --edge: transparent;
  --fill: transparent;
}

.btn-ghost:hover {
  --edge: transparent;
  --fill: var(--surface-2);
}

.btn-sm {
  min-height: calc(1.75rem + 4px);
  padding: calc(0.3rem + 2px) calc(0.65rem + 2px);
}

.btn-lg {
  min-height: calc(2.9rem + 4px);
  padding: calc(0.75rem + 2px) calc(1.4rem + 2px);
  font-size: calc(var(--px-text) + 2px);
}

.btn-block {
  width: 100%;
}

.btn-group,
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.btn-row.center {
  justify-content: center;
  margin-top: 1rem;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  min-height: 2rem;
  border: none;
  background: transparent;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
  padding: 0.25rem 0.5rem;
}

.icon-btn:hover {
  background: var(--surface-2);
  color: var(--primary);
}

/* ---- forms --------------------------------------------------------------------------- */

.form {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.field-label {
  font-family: var(--pixel);
  font-size: var(--px-text);
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.field-hint {
  color: var(--dim);
  font-size: 0.8rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="url"],
input[type="date"],
input[type="datetime-local"],
select,
textarea {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border-strong);
  border-radius: 0;
  background: var(--field);
  color: var(--text);
  font: inherit;
  transition:
    border-color 0.12s steps(2),
    box-shadow 0.12s steps(2);
}

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

input:hover,
select:hover,
textarea:hover {
  border-color: #3a4c3a;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 3px 3px 0 var(--primary-soft);
}

input:disabled {
  background: var(--surface-2);
  color: var(--muted);
}

textarea {
  resize: vertical;
}

textarea.codes {
  font-family: var(--mono);
  font-size: 0.9rem;
  margin: 0.75rem 0;
}

.input-sm {
  max-width: 7rem;
}

.input-prefix {
  display: flex;
  align-items: stretch;
}

.input-prefix span {
  display: flex;
  align-items: center;
  padding: 0 0.65rem;
  border: 1px solid var(--border-strong);
  border-right: none;
  background: var(--surface-2);
  color: var(--muted);
  font-family: var(--pixel);
  font-size: var(--px-text);
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.check input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--primary);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--border-strong);
  background: var(--field);
  font-family: var(--pixel);
  font-size: var(--px-text);
  cursor: pointer;
}

.chip:hover {
  border-color: var(--primary-line);
}

.chip:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.rule-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
  margin-bottom: 1rem;
}

.toolbar .field {
  width: auto;
}

.toolbar select {
  width: auto;
}

/* Controls in one row are one height: a select's text box ignores line-height, and a button that
   stands next to fields matches them. */
.field select,
.toolbar .btn {
  min-height: var(--field-h);
}

.grow {
  flex: 1;
  min-width: 12rem;
}

.grid-2,
.grid-3 {
  display: grid;
  gap: 0.95rem 1rem;
}

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

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

.align-start {
  align-items: start;
}

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

/* Corner brackets: four 10×2 / 2×10 strokes over the panel's own background. */
.card,
.feature,
.product-card,
.hero-code,
.modal {
  --corner: var(--border-strong);
  background:
    linear-gradient(var(--corner), var(--corner)) top left / 10px 2px no-repeat,
    linear-gradient(var(--corner), var(--corner)) top left / 2px 10px no-repeat,
    linear-gradient(var(--corner), var(--corner)) bottom right / 10px 2px no-repeat,
    linear-gradient(var(--corner), var(--corner)) bottom right / 2px 10px no-repeat,
    var(--panel, var(--surface));
}

.card {
  border: 1px solid var(--border);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.card.narrow {
  max-width: 560px;
}

.card.narrow.center {
  margin-left: auto;
  margin-right: auto;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.card-header h2 {
  margin: 0;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px dashed var(--border-strong);
}

.page-header h1 {
  margin-bottom: 0.3rem;
}

.page-header h1::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 0.6rem;
  vertical-align: 0.2em;
  background: var(--primary);
}

.page-header p {
  margin: 0;
}

.page-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
}

.section-block {
  margin-bottom: 1.5rem;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.card .stats {
  margin-bottom: 0.75rem;
}

.stat {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.95rem 1rem 1rem;
}

.stat::before {
  content: "";
  position: absolute;
  left: -1px;
  top: -1px;
  width: 18px;
  height: 2px;
  background: var(--primary);
}

.card .stat {
  background: var(--bg-2);
}

.stat-label {
  font-family: var(--pixel);
  font-size: var(--px-text);
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.stat-value {
  font-family: var(--pixel);
  font-size: 24px;
  line-height: 1.2;
  color: var(--primary);
  margin-top: 0.35rem;
  font-variant-numeric: tabular-nums;
  word-break: break-all;
}

.stat-hint {
  color: var(--dim);
  font-size: 0.8rem;
  margin-top: 0.15rem;
}

.notice {
  border: 1px solid var(--border);
  border-left-width: 4px;
  padding: 0.75rem 0.95rem;
  margin: 0 0 1rem;
}

.notice p:last-child {
  margin-bottom: 0.5rem;
}

.notice-warn {
  background: var(--amber-soft);
  border-color: var(--amber-line);
  border-left-color: var(--amber);
  color: #ffe1a3;
}

.notice-success {
  background: var(--green-soft);
  border-color: var(--green-line);
  border-left-color: var(--green);
  color: #c4f5cf;
}

.notice-info {
  background: var(--blue-soft);
  border-color: var(--blue-line);
  border-left-color: var(--blue);
  color: #cde5ff;
}

.summary {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.5rem 1.25rem;
  margin: 0 0 1rem;
}

.summary dt {
  font-family: var(--pixel);
  font-size: var(--px-text);
  color: var(--muted);
  letter-spacing: 0.04em;
  line-height: 1.8;
}

.summary dd {
  margin: 0;
  word-break: break-word;
}

.inline-copy {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}

.inline-copy code.big {
  font-size: 1.15rem;
  letter-spacing: 0.08em;
  color: var(--primary);
}

.secret-box {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
  padding: 0.75rem;
  background: var(--field);
  border: 1px dashed var(--primary-line);
}

code.secret {
  flex: 1;
  min-width: 0;
  word-break: break-all;
  background: transparent;
  color: var(--primary);
  font-size: 0.95rem;
}

.preview {
  min-height: 1.4em;
  color: var(--muted);
}

.preview strong {
  color: var(--text);
}

/* Segmented, like a health bar. */
.meter {
  height: 10px;
  padding: 2px;
  background: var(--field);
  border: 1px solid var(--border-strong);
  margin: 0.5rem 0;
}

.meter-fill {
  height: 100%;
  background: repeating-linear-gradient(90deg, var(--primary) 0 6px, transparent 6px 8px);
}

.account-details {
  max-width: 18rem;
  font-size: 0.8rem;
  background: var(--surface-2);
  padding: 0.35rem 0.5rem;
}

code.detail {
  display: inline-block;
  max-width: 24rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
}

/* ---- tables -------------------------------------------------------------------------- */

.table-wrap {
  overflow-x: auto;
  margin: 0 -0.25rem;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.table th,
.table td {
  padding: 0.65rem 0.7rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.table th {
  color: var(--dim);
  font-family: var(--pixel);
  font-size: var(--px-text);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
  border-bottom-color: var(--border-strong);
}

.table tbody tr:hover {
  background: var(--primary-soft);
}

.table tbody tr:hover td:first-child {
  box-shadow: inset 2px 0 0 var(--primary);
}

.table.compact th,
.table.compact td {
  padding: 0.4rem 0.45rem;
}

.table .num {
  text-align: right;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.table th.num {
  font-family: var(--pixel);
}

.table .actions {
  white-space: nowrap;
  text-align: right;
}

.table .actions .btn + .btn {
  margin-left: 0.5rem;
}

.cell-title {
  font-weight: 600;
  display: flex;
  gap: 0.45rem;
  align-items: center;
  flex-wrap: wrap;
}

.cell-title code {
  white-space: nowrap;
}

/* The model name is a code chip; its name and the lines under it start at the same x. */
.model-cell {
  --chip-pad: 0.35rem;
}

.model-cell code {
  padding-left: var(--chip-pad);
  padding-right: var(--chip-pad);
}

.model-cell .model-sub {
  padding-left: var(--chip-pad);
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

/* Model price tables, one per kind (components/model_tables.rs): landing #models and /docs/video. */
.models-table .model-input {
  min-width: 9rem;
}

/* Headers may wrap (a label and its field name), and long model ids break after their hyphens
   (id_chip), so a wide table keeps its prices in view. */
.models-table th {
  white-space: normal;
}

/* A header's field name keeps its case: the API reads `resolution`, not RESOLUTION. */
.models-table th code {
  text-transform: none;
  letter-spacing: 0;
}

.models-table .model-cell {
  min-width: 12rem;
  max-width: 17rem;
}

.models-table .model-cell code {
  white-space: normal;
}

.unit-prices > div {
  white-space: nowrap;
}

.value-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.model-kind + .model-kind {
  margin-top: 2.5rem;
}

.model-kind h3 {
  margin-bottom: 0.35rem;
}

.model-kind > p {
  margin: 0 0 0.9rem;
}

/* ---- badges -------------------------------------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.12rem 0.45rem;
  border: 1px solid var(--gray-line);
  background: var(--gray-soft);
  color: var(--muted);
  font-family: var(--pixel);
  font-size: var(--px-text);
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.badge-green {
  background: var(--green-soft);
  border-color: var(--green-line);
  color: var(--green);
}

.badge-amber {
  background: var(--amber-soft);
  border-color: var(--amber-line);
  color: var(--amber);
}

.badge-red {
  background: var(--red-soft);
  border-color: var(--red-line);
  color: var(--red);
}

.badge-blue {
  background: var(--blue-soft);
  border-color: var(--blue-line);
  color: var(--blue);
}

.badge-gray {
  background: var(--gray-soft);
  border-color: var(--gray-line);
  color: var(--muted);
}

.badge .dot {
  width: 6px;
  height: 6px;
  background: currentColor;
}

/* ---- states -------------------------------------------------------------------------- */

.state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  padding: 2rem 1rem;
  color: var(--muted);
  font-family: var(--pixel);
  font-size: var(--px-text);
  letter-spacing: 0.04em;
}

.state-empty::before {
  content: "[ ]";
  color: var(--dim);
}

.state-error {
  color: var(--red);
}

/* A ring of eight 4 px cells, turned a quarter at a time. */
.spinner {
  width: 4px;
  height: 4px;
  margin: 6px;
  box-shadow:
    -6px -6px 0 0 var(--primary),
    0 -6px 0 0 var(--primary),
    6px -6px 0 0 var(--primary-line),
    6px 0 0 0 var(--primary-line),
    6px 6px 0 0 var(--border-strong),
    0 6px 0 0 var(--border-strong),
    -6px 6px 0 0 var(--border-strong),
    -6px 0 0 0 var(--primary-line);
  animation: spin 0.9s steps(4) infinite;
}

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

.load-more {
  display: flex;
  justify-content: center;
  padding-top: 1rem;
}

.fullscreen-center {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

/* A pixel tick drawn with 6 px cells. */
.success-mark {
  width: 4rem;
  height: 4rem;
  margin: 0.5rem auto 1.25rem;
  background: var(--green-soft);
  border: 1px solid var(--green-line);
  position: relative;
}

.success-mark::after {
  content: "";
  position: absolute;
  left: 11px;
  top: 33px;
  width: 6px;
  height: 6px;
  background: var(--green);
  box-shadow:
    6px 6px 0 var(--green),
    12px 0 0 var(--green),
    18px -6px 0 var(--green),
    24px -12px 0 var(--green),
    30px -18px 0 var(--green);
}

/* ---- tabs ---------------------------------------------------------------------------- */

.tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--border-strong);
  margin-bottom: 1rem;
  overflow-x: auto;
}

.tab {
  border: none;
  background: transparent;
  font-family: var(--pixel);
  font-size: var(--px-text);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.65rem 0.95rem;
  cursor: pointer;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}

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

.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: var(--primary-soft);
}

/* ---- playground ---------------------------------------------------------------------- */

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

/* Each playground panel is a stack (`.card.form`): its rows sit a field's gap apart, so a price hint,
   a note or a button's edge never touches the row below, and a paragraph, header or toolbar in it adds
   no margin of its own. */
.card.form > p,
.card.form > .card-header,
.card.form > .toolbar {
  margin: 0;
}

.playground-chat {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.chat-list ul {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  max-height: 60vh;
  overflow-y: auto;
}

.chat-list li {
  display: flex;
  align-items: center;
  border-left: 2px solid transparent;
}

.chat-list li.active {
  border-left-color: var(--primary);
  background: var(--primary-soft);
}

.chat-title {
  flex: 1;
  min-width: 0;
  text-align: left;
  border: none;
  background: transparent;
  color: var(--text);
  padding: 0.45rem 0.5rem;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-log {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-height: 60vh;
  overflow-y: auto;
}

.msg {
  border: 1px solid var(--border);
  padding: 0.6rem 0.75rem;
  max-width: 90%;
}

.msg-user {
  align-self: flex-end;
  background: var(--primary-soft);
  border-color: var(--primary-line);
}

.msg-assistant {
  align-self: flex-start;
  background: var(--surface-2);
}

.msg.streaming {
  border-style: dashed;
}

.code-block {
  background: var(--bg-2);
  border: 1px solid var(--border-strong);
  padding: 0.6rem 0.75rem;
  margin: 0 0 0.5rem;
  overflow-x: auto;
}

.code-block code {
  background: transparent;
  padding: 0;
}

.chat-input textarea {
  width: 100%;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.media-item {
  margin: 0;
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  flex-direction: column;
}

.media-item img,
.media-item video {
  width: 100%;
  display: block;
  background: var(--bg-2);
}

.media-item figcaption {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem;
}

.media-item figcaption .btn {
  align-self: flex-start;
}

.file-btn input[type="file"] {
  display: none;
}

/* A video model's sound checkbox, aligned with the selects next to it. */
.field-check {
  justify-content: flex-end;
  padding-bottom: 0.55rem;
}

/* The first frame of an image-to-video request: the scaled copy that is sent. */
.image-input {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
}

.image-input[hidden] {
  display: none;
}

.image-preview {
  max-width: 12rem;
  max-height: 9rem;
  border: 1px solid var(--border);
  background: var(--bg-2);
}

.transcript {
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

.playground-history .check {
  margin-right: 0.5rem;
}

/* ---- toasts & modals ----------------------------------------------------------------- */

.toasts {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-width: min(420px, calc(100vw - 2rem));
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 0.95rem;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-left-width: 4px;
  box-shadow: var(--shadow);
  animation: toast-in 0.18s steps(3);
}

.toast span {
  flex: 1;
  word-break: break-word;
}

.toast-success {
  border-left-color: var(--green);
}

.toast-error {
  border-left-color: var(--red);
}

.toast-info {
  border-left-color: var(--blue);
}

.toast-close {
  border: none;
  background: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
}

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

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(12px);
  }
}

/* Scanlines over a dimmed page. */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.22) 0 1px, transparent 1px 3px),
    rgba(4, 7, 4, 0.72);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 6vh 1rem 1rem;
  overflow-y: auto;
}

.modal {
  --corner: var(--primary);
  width: 100%;
  max-width: 520px;
  border: 1px solid var(--border-strong);
  box-shadow: 10px 10px 0 rgba(0, 0, 0, 0.55);
}

.modal-wide {
  max-width: 820px;
}

.modal-sm {
  max-width: 420px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem 0.75rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.75rem;
}

.modal-header h3 {
  margin: 0;
}

.modal-body {
  padding: 0.25rem 1.25rem 1.25rem;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  padding-top: 1rem;
}

.modal-sm .modal-footer {
  padding: 0 1.25rem 1.25rem;
}

/* ---- console layout ------------------------------------------------------------------ */

.console {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar);
  flex-shrink: 0;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  padding: 1rem 0.75rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  font-family: var(--pixel);
  font-size: 15px;
  letter-spacing: 0.02em;
  padding: 0.25rem 0.5rem 1.1rem;
}

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

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  background: var(--primary);
  color: var(--primary-ink);
  box-shadow: 3px 3px 0 var(--primary-shade);
}

.brand-name {
  white-space: nowrap;
}

.brand .badge {
  border-color: var(--primary-line);
  background: var(--primary-soft);
  color: var(--primary);
}

/* The admin console's badge does not fit beside the name in the sidebar: it goes under it. */
.sidebar .brand {
  flex-wrap: wrap;
  row-gap: 0.45rem;
}

.sidebar .brand .badge {
  margin-left: calc(26px + 0.6rem);
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-section {
  color: var(--dim);
  font-family: var(--pixel);
  font-size: var(--px-text);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.9rem 0.6rem 0.5rem;
}

.nav-section::before {
  content: "// ";
}

.nav a {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0.65rem;
  color: var(--muted);
  font-family: var(--pixel);
  font-size: var(--px-text);
  letter-spacing: 0.04em;
}

.nav a .px-icon {
  opacity: 0.7;
}

.nav a:hover {
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
}

.nav a[aria-current="page"] {
  background: var(--primary-soft);
  color: var(--primary);
  box-shadow: inset 2px 0 0 var(--primary);
}

.nav a[aria-current="page"] .px-icon {
  opacity: 1;
}

.console-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.6rem 1.5rem;
  background: rgba(9, 12, 9, 0.86);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-spacer {
  flex: 1;
}

.nav-toggle {
  display: none;
}

.balance-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--border-strong);
  background: var(--field);
  color: var(--primary);
  font-family: var(--pixel);
  font-size: var(--px-text);
  font-variant-numeric: tabular-nums;
}

.balance-chip strong {
  font-weight: 400;
}

.balance-chip:hover {
  text-decoration: none;
  border-color: var(--primary);
}

.lang-switch {
  width: auto;
  padding: 0.3rem 0.5rem;
  font-family: var(--pixel);
  font-size: var(--px-text);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.user-email {
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.85rem;
}

.user-email:hover {
  color: var(--primary);
}

.console-content {
  padding: 1.75rem 1.75rem 2.5rem;
  max-width: 1280px;
  width: 100%;
}

.nav-scrim {
  display: none;
}

/* ---- products ------------------------------------------------------------------------ */

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.product-card {
  border: 1px solid var(--border);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.product-card:hover {
  --corner: var(--primary);
}

.product-topup {
  border-top: 2px solid var(--primary);
}

.product-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.product-head h3 {
  margin: 0;
}

.product-details,
.bonus-rules {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
  list-style: square;
}

.bonus-rules {
  color: var(--green);
  font-size: 0.88rem;
}

.product-prices {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: auto;
}

.price-big {
  font-family: var(--pixel);
  font-size: 36px;
  line-height: 1.15;
  color: var(--primary);
}

.pay-methods {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}

/* ---- sign-in pages ------------------------------------------------------------------- */

.auth-page {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.25rem 1rem 170px;
  background: radial-gradient(900px 420px at 50% -8%, var(--primary-glow), transparent 70%);
}

.auth-top {
  width: 100%;
  max-width: 980px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8vh;
}

.auth-top .brand {
  padding: 0;
}

.auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  padding: 1.75rem;
  box-shadow: var(--shadow);
}

.auth-card h1 {
  margin-bottom: 1.25rem;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--dim);
  font-size: 0.75rem;
}

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

.btn-google {
  gap: 0.6rem;
}

.google-g {
  width: 16px;
  height: 16px;
  flex: none;
}

.captcha-note {
  margin: 0.2rem 0 0;
  color: var(--dim);
  font-size: 0.75rem;
}

.captcha-note a {
  color: var(--muted);
}

.auth-links {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.1rem;
  font-size: 0.9rem;
}

.auth-page .skyline {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 120px;
  z-index: -1;
}

.auth-page .skyline svg {
  width: 1440px;
  height: 120px;
}

/* ---- skyline (components/pixel.rs; 4 px per cell, centred and cropped) --------------- */

.skyline {
  position: relative;
  height: 160px;
  overflow: hidden;
  pointer-events: none;
}

.skyline svg {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 1920px;
  height: 160px;
  transform: translateX(-50%);
}

.sky-stars {
  fill: rgba(255, 255, 255, 0.28);
}

.sky-back {
  fill: #0e150e;
}

.sky-front {
  fill: #131d13;
}

.sky-roof {
  fill: var(--border-strong);
}

.sky-dim {
  fill: var(--primary);
  opacity: 0.22;
}

.sky-lit {
  fill: var(--primary);
  opacity: 0.75;
}

.sky-blink {
  fill: var(--primary);
  animation: blink 2.4s steps(1) infinite;
}

.sky-blink.d1 {
  animation-delay: -0.4s;
}

.sky-blink.d2 {
  animation-delay: -0.8s;
  animation-duration: 3.1s;
}

.sky-blink.d3 {
  animation-delay: -1.2s;
}

.sky-blink.d4 {
  animation-delay: -1.6s;
  animation-duration: 1.7s;
}

.sky-blink.d5 {
  animation-delay: -2s;
  animation-duration: 3.6s;
}

/* ---- public site --------------------------------------------------------------------- */

.public {
  min-height: 100vh;
}

.public-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem max(2rem, calc((100% - 1200px) / 2 + 2rem));
  background: rgba(9, 12, 9, 0.82);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.public-header .brand {
  padding: 0;
}

.public-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.public-nav > a:not(.btn) {
  color: var(--muted);
  font-family: var(--pixel);
  font-size: var(--px-text);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.public-nav > a:not(.btn):hover {
  color: var(--primary);
  text-decoration: none;
}

.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 3rem;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 5rem 2rem 2.5rem;
}

.hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 10%;
  right: 10%;
  top: -10%;
  height: 560px;
  background: radial-gradient(closest-side, var(--primary-glow), transparent);
  pointer-events: none;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--primary);
  border: 1px solid var(--primary-line);
  background: var(--primary-soft);
  padding: 0.3rem 0.75rem;
  font-family: var(--pixel);
  font-size: var(--px-text);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--primary);
  animation: blink 1.2s steps(1) infinite;
}

.hero h1 {
  font-size: 48px;
  line-height: 1.2;
  margin-bottom: 1.25rem;
  text-wrap: balance;
}

.cursor {
  display: inline-block;
  width: 0.5em;
  height: 0.9em;
  margin-left: 0.2em;
  vertical-align: -0.08em;
  background: var(--primary);
  animation: blink 1s steps(1) infinite;
}

.lead {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 36rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 2rem;
}

.hero-code {
  --corner: var(--primary);
  --panel: #060906;
  border: 1px solid var(--border-strong);
  box-shadow:
    10px 10px 0 rgba(0, 0, 0, 0.5),
    0 0 80px -20px var(--primary-glow);
  min-width: 0;
}

.hero-code pre {
  padding: 1.1rem 1.25rem 1.4rem;
}

.hero-code pre code {
  background: transparent;
  color: #cfe6c7;
  padding: 0;
  font-size: 0.85rem;
  line-height: 1.75;
}

.hero-code .prompt {
  color: var(--primary);
}

.code-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem 0.6rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
}

.code-title {
  flex: 1;
  font-family: var(--pixel);
  font-size: var(--px-text);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.term-dots {
  display: inline-flex;
  gap: 6px;
}

.term-dots i {
  width: 8px;
  height: 8px;
  background: var(--border-strong);
}

.term-dots i:first-child {
  background: var(--red);
}

.term-dots i:nth-child(2) {
  background: var(--amber);
}

.term-dots i:last-child {
  background: var(--primary);
}

.spec-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.spec-strip > div {
  padding: 1.75rem 1.5rem 2rem;
  border-left: 1px solid var(--border);
}

.spec-strip > div:first-child {
  border-left: none;
  padding-left: 0;
}

.spec-strip dt {
  font-family: var(--pixel);
  font-size: 36px;
  line-height: 1.1;
  color: var(--primary);
}

.spec-strip dd {
  margin: 0.4rem 0 0;
  color: var(--muted);
}

/* Three cards: let them share the row instead of leaving a fourth track empty. Two classes,
   because .feature-grid comes later in this file. */
.feature-grid.research-grid,
.feature-grid.unbounded-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.research-note {
  margin-top: 1.25rem;
}

.section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3.5rem 2rem;
}

.kicker {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--muted);
  font-family: var(--pixel);
  font-size: var(--px-text);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.kicker span {
  color: var(--primary);
  border: 1px solid var(--primary-line);
  padding: 0.05rem 0.4rem;
}

.section h2 {
  font-size: 36px;
  line-height: 1.2;
}

.section-lead {
  max-width: 44rem;
  font-size: 1.02rem;
  margin-bottom: 2rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.feature {
  border: 1px solid var(--border);
  padding: 1.4rem;
  transition: transform 0.12s steps(2);
}

.feature:hover {
  --corner: var(--primary);
  transform: translateY(-2px);
}

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-bottom: 1rem;
  border: 1px solid var(--primary-line);
  background: var(--primary-soft);
  color: var(--primary);
}

.feature-icon .px-icon {
  width: 24px;
  height: 24px;
}

.feature p {
  color: var(--muted);
  margin: 0;
}

.privacy-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 1.75rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.privacy-legend > div {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.25rem;
}

.footer-links a {
  color: var(--muted);
}

.footer-links a:hover {
  color: var(--primary);
}

.legal {
  max-width: 820px;
}

.legal h1 {
  margin-bottom: 0.25rem;
}

.legal h2 {
  margin-top: 2rem;
  font-size: 18px;
}

.legal p,
.legal li {
  line-height: 1.7;
  color: var(--text);
}

.legal ul {
  padding-left: 1.25rem;
}

/* The API docs (/docs/video): wider than the legal pages for the model table and code. */
.docs {
  max-width: 1040px;
}

.docs h1 {
  margin-bottom: 0.5rem;
}

.docs h2 {
  margin-top: 2.75rem;
  font-size: 20px;
}

.docs h3 {
  margin-top: 1.5rem;
  font-size: 15px;
}

.docs p {
  line-height: 1.7;
}

.docs-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0.75rem;
  list-style: none;
  padding: 0;
  margin: 1.75rem 0 1rem;
}

.docs-steps li {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border-strong);
}

.docs-steps code,
.docs-kv code {
  align-self: flex-start;
  word-break: break-all;
}

.docs-kv,
.docs-endpoint {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0.75rem 0;
}

.docs-code {
  margin: 0.75rem 0 1.25rem;
  background: var(--bg-2);
  border: 1px solid var(--border-strong);
  min-width: 0;
}

.docs-code pre {
  padding: 0.9rem 1rem;
  overflow-x: auto;
  white-space: pre;
  word-break: normal;
}

.docs-code pre code {
  background: transparent;
  padding: 0;
  font-size: 0.85rem;
  line-height: 1.65;
}

.docs-table td {
  vertical-align: top;
}

.public-footer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.9rem;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--pixel);
  font-size: var(--px-text);
  letter-spacing: 0.04em;
}

.footer-brand .brand-mark {
  width: 20px;
  height: 20px;
  box-shadow: none;
}

.footer-brand .brand-mark .px-icon {
  width: 16px;
  height: 16px;
}

/* ---- motion & responsive ------------------------------------------------------------- */

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

@media (max-width: 960px) {
  .playground-chat {
    grid-template-columns: 1fr;
  }

  .hero {
    grid-template-columns: 1fr;
    padding-top: 3rem;
  }

  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .spec-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .spec-strip > div:nth-child(3) {
    border-left: none;
    padding-left: 0;
  }
}

@media (max-width: 820px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.16s steps(4);
    box-shadow: var(--shadow);
  }

  .console.nav-open .sidebar {
    transform: translateX(0);
  }

  .console.nav-open .nav-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(4, 7, 4, 0.6);
  }

  .nav-toggle {
    display: inline-flex;
  }

  .topbar {
    padding: 0.5rem 0.75rem;
    gap: 0.5rem;
  }

  .user-email {
    display: none;
  }

  .console-content {
    padding: 1.1rem 1rem 2rem;
  }

  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .public-header,
  .section,
  .hero,
  .spec-strip {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .hero h1 {
    font-size: 36px;
  }

  .section h2 {
    font-size: 24px;
  }

  .spec-strip {
    grid-template-columns: 1fr;
  }

  .spec-strip > div,
  .spec-strip > div:first-child {
    padding: 1.1rem 0;
    border-left: none;
    border-top: 1px solid var(--border);
  }

  .spec-strip > div:first-child {
    border-top: none;
  }

  .spec-strip dt {
    font-size: 24px;
  }

  .skyline {
    height: 120px;
  }

  .skyline svg {
    width: 1440px;
    height: 120px;
  }
}

@media (max-width: 520px) {
  .balance-chip .muted {
    display: none;
  }

  .summary {
    grid-template-columns: 1fr;
    gap: 0.1rem;
  }

  .summary dd {
    margin-bottom: 0.4rem;
  }

  .public-nav > a:not(.btn) {
    display: none;
  }

  .hero h1 {
    font-size: 30px;
  }
}
