/*!
 * Limitless AI web client — styles
 * ==============================
 * Dark-first design system with a persisted light mode.
 * Tokens live in :root; everything else composes from them.
 */

/* ===================================================================== */
/* 1. Tokens                                                              */
/* ===================================================================== */

:root {
  color-scheme: dark;

  --bg: #05080f;
  --bg-deep: #03060c;
  --panel: rgba(13, 21, 36, 0.82);
  --panel-solid: #0c1524;
  --panel-2: #111c30;
  --panel-3: #16233a;
  --line: rgba(148, 180, 220, 0.14);
  --line-strong: rgba(148, 180, 220, 0.28);

  --text: #e7eef9;
  --text-dim: #b6c7de;
  --muted: #8296b3;

  --accent: #22d3ee;
  --accent-2: #2dd4bf;
  --accent-soft: rgba(34, 211, 238, 0.14);
  --accent-ink: #03121a;

  --good: #34d399;
  --good-soft: rgba(52, 211, 153, 0.14);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, 0.14);
  --bad: #fb7185;
  --bad-soft: rgba(251, 113, 133, 0.14);

  --radius: 14px;
  --radius-sm: 9px;
  --radius-lg: 20px;
  --shadow: 0 22px 60px -30px rgba(0, 0, 0, 0.95);
  --shadow-sm: 0 10px 30px -22px rgba(0, 0, 0, 0.9);

  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --maxw: 1180px;
  --nav-h: 66px;

  --grad: linear-gradient(120deg, var(--accent) 0%, var(--accent-2) 100%);
  --grad-panel: linear-gradient(160deg, rgba(34, 211, 238, 0.07), rgba(45, 212, 191, 0.02) 45%, transparent 70%);
}

[data-theme="light"] {
  color-scheme: light;

  --bg: #f5f8fc;
  --bg-deep: #eaf0f8;
  --panel: rgba(255, 255, 255, 0.9);
  --panel-solid: #ffffff;
  --panel-2: #f3f7fc;
  --panel-3: #e8eff8;
  --line: rgba(20, 44, 76, 0.12);
  --line-strong: rgba(20, 44, 76, 0.24);

  --text: #0d1a2b;
  --text-dim: #29405c;
  --muted: #5b7189;

  --accent: #0891b2;
  --accent-2: #0d9488;
  --accent-soft: rgba(8, 145, 178, 0.12);
  --accent-ink: #ffffff;

  --good: #047857;
  --good-soft: rgba(4, 120, 87, 0.12);
  --warn: #b45309;
  --warn-soft: rgba(180, 83, 9, 0.12);
  --bad: #be123c;
  --bad-soft: rgba(190, 18, 60, 0.1);

  --shadow: 0 20px 50px -34px rgba(13, 26, 43, 0.45);
  --shadow-sm: 0 10px 26px -22px rgba(13, 26, 43, 0.4);
  --grad-panel: linear-gradient(160deg, rgba(8, 145, 178, 0.06), rgba(13, 148, 136, 0.02) 45%, transparent 70%);
}

/* ===================================================================== */
/* 2. Base                                                                */
/* ===================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(1100px 620px at 12% -10%, rgba(34, 211, 238, 0.13), transparent 60%),
    radial-gradient(900px 520px at 92% 4%, rgba(45, 212, 191, 0.1), transparent 62%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
  background-attachment: fixed;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

[data-theme="light"] body {
  background-image:
    radial-gradient(1100px 620px at 12% -10%, rgba(8, 145, 178, 0.1), transparent 60%),
    radial-gradient(900px 520px at 92% 4%, rgba(13, 148, 136, 0.08), transparent 62%),
    linear-gradient(180deg, #fbfdff 0%, var(--bg) 100%);
}

h1,
h2,
h3,
h4 {
  margin: 0 0 0.5em;
  line-height: 1.2;
  letter-spacing: -0.018em;
  font-weight: 650;
}

p {
  margin: 0 0 1em;
}

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

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  display: block;
}

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

::selection {
  background: var(--accent-soft);
}

/* ===================================================================== */
/* 3. Utilities                                                           */
/* ===================================================================== */

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

.page {
  flex: 1 0 auto;
  padding: calc(var(--nav-h) + 34px) 0 72px;
  outline: none;
}

.page__inner {
  display: block;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

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

.spacer {
  flex: 1 1 auto;
}

.mono {
  font-family: var(--mono);
  font-size: 0.9em;
  font-variant-ligatures: none;
}

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

.small {
  font-size: 0.86rem;
}

.text-good {
  color: var(--good);
}

.text-bad {
  color: var(--bad);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--panel-solid);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 12px;
}

.linkish {
  background: none;
  border: 0;
  padding: 0;
  color: var(--accent);
  cursor: pointer;
  text-align: left;
}

.linkish:hover {
  text-decoration: underline;
}

/* ===================================================================== */
/* 4. Buttons                                                             */
/* ===================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--panel-2);
  color: var(--text);
  font-weight: 560;
  font-size: 0.94rem;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.16s ease, border-color 0.16s ease, opacity 0.16s ease;
  white-space: nowrap;
}

.btn:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  text-decoration: none;
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  border-color: var(--line);
}

.btn--primary {
  background: var(--grad);
  border-color: transparent;
  color: var(--accent-ink);
  font-weight: 640;
  box-shadow: 0 12px 30px -18px rgba(34, 211, 238, 0.7);
}

.btn--primary:hover {
  border-color: transparent;
  filter: brightness(1.06);
}

.btn--ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text-dim);
}

.btn--ghost:hover {
  background: var(--panel-2);
  color: var(--text);
}

.btn--danger {
  background: transparent;
  border-color: rgba(251, 113, 133, 0.45);
  color: var(--bad);
}

.btn--danger:hover {
  background: var(--bad-soft);
  border-color: var(--bad);
}

.btn--sm {
  padding: 6px 11px;
  font-size: 0.85rem;
  border-radius: 8px;
}

.btn--lg {
  padding: 13px 22px;
  font-size: 1rem;
}

.btn--block {
  width: 100%;
}

/* ===================================================================== */
/* 5. Header / nav                                                        */
/* ===================================================================== */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 40;
  height: var(--nav-h);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--line);
}

@supports not (backdrop-filter: blur(2px)) {
  .site-header {
    background: var(--panel-solid);
  }
}

.nav {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 1.06rem;
  flex: 0 0 auto;
}

.brand:hover {
  text-decoration: none;
}

.brand__logo {
  width: 30px;
  height: 30px;
  border-radius: 9px;
}

.brand__name {
  white-space: nowrap;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 10px;
}

.nav__link {
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--text-dim);
  font-weight: 520;
  font-size: 0.94rem;
}

.nav__link:hover {
  background: var(--panel-2);
  color: var(--text);
  text-decoration: none;
}

.nav__link.is-active {
  color: var(--text);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.25);
}

.nav__actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav__toggle {
  display: none;
  margin-left: auto;
  width: 40px;
  height: 40px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  padding: 10px 9px;
  flex-direction: column;
  justify-content: space-between;
}

.nav__toggle-bar {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text-dim);
  border-radius: 2px;
}

.credits-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--panel-2);
  color: var(--text);
  font-weight: 580;
  font-size: 0.88rem;
  font-family: var(--mono);
}

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

.credits-chip__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--grad);
  box-shadow: 0 0 10px rgba(34, 211, 238, 0.8);
}

.account {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.account__email {
  color: var(--text-dim);
  font-size: 0.88rem;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.theme-toggle {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--text-dim);
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--text);
}

/* ===================================================================== */
/* 6. Footer                                                              */
/* ===================================================================== */

.footer {
  margin-top: 40px;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-deep) 82%, transparent);
  padding: 44px 0 26px;
}

.footer__inner {
  display: grid;
  grid-template-columns: minmax(240px, 1.2fr) 2fr;
  gap: 36px;
}

.footer__brand .brand {
  margin-bottom: 12px;
}

.footer__tagline {
  color: var(--muted);
  max-width: 42ch;
  margin-bottom: 10px;
}

.footer__model {
  color: var(--muted);
  font-size: 0.82rem;
}

.footer__cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 24px;
}

.footer__col-title {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
  margin-bottom: 12px;
  font-weight: 620;
}

.footer__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer__link {
  color: var(--text-dim);
  font-size: 0.92rem;
}

.footer__link:hover {
  color: var(--accent);
}

.footer__meta {
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 0.84rem;
}

.footer__sep {
  opacity: 0.5;
}

/* ===================================================================== */
/* 7. Sections, page headers, cards, stats                                */
/* ===================================================================== */

.section {
  margin-bottom: 56px;
}

.section__head {
  margin-bottom: 22px;
  max-width: 70ch;
}

.section__title {
  font-size: clamp(1.4rem, 1.1rem + 1.3vw, 1.9rem);
  margin-bottom: 8px;
}

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

.section__slot {
  min-height: 60px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 30px;
}

.page-head__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 640;
  color: var(--accent);
  margin-bottom: 8px;
}

.page-head__title {
  font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.2rem);
  margin-bottom: 6px;
}

.page-head__sub {
  color: var(--muted);
  margin: 0;
  max-width: 70ch;
}

.page-head__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.card {
  background: var(--panel);
  background-image: var(--grad-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  overflow: hidden;
}

.card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px 0;
}

.card__heading {
  min-width: 0;
}

.card__title {
  font-size: 1.06rem;
  margin: 0 0 4px;
}

.card__subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.card__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.card__actions--inline {
  padding-top: 4px;
}

.card__body {
  padding: 18px 22px 22px;
}

.card__foot {
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel-2) 60%, transparent);
  display: flex;
  gap: 10px;
  align-items: center;
}

.card__slot {
  min-height: 80px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}

.stats-grid--tight {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.stat--accent {
  border-color: rgba(34, 211, 238, 0.35);
}

.stat--accent::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--grad);
}

.stat__label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 620;
  margin-bottom: 8px;
}

.stat__value {
  font-size: 1.5rem;
  font-weight: 660;
  font-family: var(--mono);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.stat__hint {
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 6px;
}

/* ===================================================================== */
/* 8. Badges, chips, dots, kv                                             */
/* ===================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 640;
  letter-spacing: 0.03em;
  text-transform: lowercase;
  border: 1px solid var(--line-strong);
  background: var(--panel-2);
  color: var(--text-dim);
  white-space: nowrap;
}

.badge--accent {
  border-color: rgba(34, 211, 238, 0.4);
  background: var(--accent-soft);
  color: var(--accent);
}

.badge--good {
  border-color: rgba(52, 211, 153, 0.4);
  background: var(--good-soft);
  color: var(--good);
}

.badge--warn {
  border-color: rgba(251, 191, 36, 0.4);
  background: var(--warn-soft);
  color: var(--warn);
}

.badge--bad {
  border-color: rgba(251, 113, 133, 0.4);
  background: var(--bad-soft);
  color: var(--bad);
}

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

.chip {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text-dim);
  font-size: 0.82rem;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--muted);
  flex: 0 0 auto;
}

.dot--lg {
  width: 12px;
  height: 12px;
}

.dot--good {
  background: var(--good);
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.7);
}

.dot--warn {
  background: var(--warn);
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.6);
}

.dot--bad {
  background: var(--bad);
  box-shadow: 0 0 10px rgba(251, 113, 133, 0.6);
}

.dot--muted {
  background: var(--muted);
}

.health {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.kv {
  display: grid;
  grid-template-columns: minmax(120px, 40%) 1fr;
  gap: 6px 14px;
  margin: 0;
  font-size: 0.9rem;
}

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

.kv__v {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}

.kv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
}

.spec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}

.spec {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  background: color-mix(in srgb, var(--panel-2) 55%, transparent);
}

.spec__label {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin-bottom: 4px;
}

.spec__value {
  font-family: var(--mono);
  font-size: 0.92rem;
  overflow-wrap: anywhere;
}

/* ===================================================================== */
/* 9. Hero                                                                */
/* ===================================================================== */

.hero {
  position: relative;
  margin: calc(-1 * var(--nav-h) - 34px) 0 60px;
  padding: calc(var(--nav-h) + 76px) 20px 60px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.hero__inner {
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin: 0 auto;
  text-align: center;
}

.hero__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
  pointer-events: none;
}

.hero__glow--one {
  width: 520px;
  height: 520px;
  top: -180px;
  left: -80px;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.45), transparent 68%);
}

.hero__glow--two {
  width: 460px;
  height: 460px;
  top: -120px;
  right: -60px;
  background: radial-gradient(circle, rgba(45, 212, 191, 0.4), transparent 68%);
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--text-dim);
  font-size: 0.82rem;
  margin-bottom: 24px;
}

.hero__title {
  font-size: clamp(2.1rem, 1.4rem + 3.6vw, 4rem);
  line-height: 1.05;
  margin-bottom: 18px;
  letter-spacing: -0.03em;
  background: linear-gradient(180deg, var(--text) 30%, color-mix(in srgb, var(--accent) 60%, var(--text)) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__tagline {
  max-width: 60ch;
  margin: 0 auto 14px;
  color: color-mix(in srgb, var(--accent) 72%, var(--text));
  font-size: clamp(1.05rem, 0.98rem + 0.5vw, 1.45rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.hero__sub {
  max-width: 64ch;
  margin: 0 auto 30px;
  color: var(--text-dim);
  font-size: clamp(1rem, 0.96rem + 0.3vw, 1.14rem);
}

.hero__cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 44px;
}

.hero__stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  max-width: 900px;
  margin: 0 auto;
}

.hero-stat {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 16px 14px;
  text-align: left;
}

.hero-stat__label {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 6px;
}

.hero-stat__value {
  font-family: var(--mono);
  font-size: 1.3rem;
  font-weight: 660;
}

.hero-stat__hint {
  color: var(--muted);
  font-size: 0.78rem;
}

/* ===================================================================== */
/* 10. Model card, prices, features                                       */
/* ===================================================================== */

.model-card__body {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.model-card__desc {
  color: var(--text-dim);
  max-width: 90ch;
  margin: 0;
}

.price-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}

.price {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  background: color-mix(in srgb, var(--panel-2) 60%, transparent);
}

.price__label {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 6px;
}

.price__value {
  font-family: var(--mono);
  font-size: 1.16rem;
  font-weight: 640;
  color: var(--accent);
}

.price__hint {
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 4px;
}

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

.feature {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.16s ease, transform 0.16s ease;
}

.feature:hover {
  border-color: rgba(34, 211, 238, 0.4);
  transform: translateY(-2px);
}

.feature__icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  border: 1px solid rgba(34, 211, 238, 0.3);
  color: var(--accent);
  font-family: var(--mono);
  font-weight: 700;
  margin-bottom: 14px;
}

.feature__title {
  font-size: 1rem;
  margin-bottom: 8px;
}

.feature__body {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0;
}

.cta-band {
  border: 1px solid rgba(34, 211, 238, 0.3);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(600px 240px at 20% 0%, rgba(34, 211, 238, 0.16), transparent 70%),
    var(--panel);
  padding: 40px 28px;
  text-align: center;
  margin-bottom: 20px;
}

.cta-band__title {
  font-size: clamp(1.4rem, 1.1rem + 1.4vw, 2rem);
  margin-bottom: 10px;
}

.cta-band__sub {
  color: var(--text-dim);
  max-width: 60ch;
  margin: 0 auto 22px;
}

.cta-band__actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ===================================================================== */
/* 11. Tabs & code                                                        */
/* ===================================================================== */

.tabs-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.tabs {
  display: flex;
  gap: 2px;
  padding: 8px 8px 0;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}

.tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 10px 16px;
  border-radius: 9px 9px 0 0;
  cursor: pointer;
  font-weight: 560;
  font-size: 0.9rem;
  white-space: nowrap;
  position: relative;
}

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

.tab.is-active {
  color: var(--text);
  background: var(--panel-2);
}

.tab.is-active::after {
  content: "";
  position: absolute;
  inset: auto 10px -1px 10px;
  height: 2px;
  background: var(--grad);
  border-radius: 2px;
}

.tabpanel {
  padding: 0;
}

.code {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: color-mix(in srgb, var(--bg-deep) 80%, var(--panel-2));
}

.tabs-wrap > .tabpanel > .code {
  border: 0;
  border-radius: 0;
}

.code__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px 7px 14px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel-2) 70%, transparent);
}

.code__lang {
  font-family: var(--mono);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.copy-btn {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-dim);
  border-radius: 7px;
  padding: 4px 10px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.copy-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.copy-btn.is-copied {
  border-color: var(--good);
  color: var(--good);
}

.codeblock,
pre.md-pre {
  margin: 0;
  padding: 16px 18px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.84rem;
  line-height: 1.65;
  color: var(--text-dim);
  tab-size: 2;
}

.codeblock code {
  font-family: inherit;
}

/* ===================================================================== */
/* 12. Tables                                                             */
/* ===================================================================== */

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--panel-2) 35%, transparent);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  min-width: 540px;
}

.table th {
  text-align: left;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  font-weight: 640;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel-2) 60%, transparent);
  white-space: nowrap;
  position: sticky;
  top: 0;
}

.table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

.table tbody tr.is-odd {
  background: color-mix(in srgb, var(--panel-2) 30%, transparent);
}

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

.table .is-right,
.table th.is-right {
  text-align: right;
}

.table .is-center,
.table th.is-center {
  text-align: center;
}

.table-note {
  margin: 12px 2px 0;
}

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

.cell-strong {
  font-weight: 580;
}

.row-actions {
  display: inline-flex;
  gap: 6px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

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

.pricing-table td:first-child {
  font-weight: 560;
}

.pricing-table__note {
  color: var(--muted);
  font-size: 0.86rem;
  margin-top: 14px;
  max-width: 80ch;
}

/* ===================================================================== */
/* 13. Forms                                                              */
/* ===================================================================== */

.form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.form__errors:empty {
  display: none;
}

.form__errors {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.form__legal {
  margin: 0;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

/* An author `display` beats the UA `[hidden] { display: none }` rule, so a
   `.field` that JS marks hidden (the register-only Name field on login) would
   otherwise still paint. */
.field[hidden] {
  display: none;
}

.field__label {
  font-size: 0.86rem;
  font-weight: 580;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 8px;
}

.field__optional {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 7px;
}

.field__hint {
  color: var(--muted);
  font-size: 0.8rem;
  margin: 0;
}

.field__error {
  color: var(--bad);
  font-size: 0.82rem;
  margin: 0;
}

.field__error[hidden] {
  display: none;
}

.input,
.select,
textarea.input {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: color-mix(in srgb, var(--bg-deep) 60%, var(--panel-2));
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input::placeholder,
textarea::placeholder {
  color: color-mix(in srgb, var(--muted) 80%, transparent);
}

.input:hover,
.select:hover {
  border-color: var(--muted);
}

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

.input.is-invalid,
.select.is-invalid {
  border-color: var(--bad);
}

.input:disabled,
.select:disabled,
textarea:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 34px;
}

.slider {
  width: 100%;
  appearance: none;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  cursor: pointer;
  margin: 4px 0 2px;
}

.slider::-webkit-slider-thumb {
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--panel-solid);
  border: 2px solid var(--accent);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  cursor: grab;
}

.slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--panel-solid);
  border: 2px solid var(--accent);
  cursor: grab;
}

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--text-dim);
  cursor: pointer;
  user-select: none;
}

.checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

.checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: var(--text-dim);
  font-size: 0.92rem;
}

.checklist li {
  position: relative;
  padding-left: 26px;
}

.checklist li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent);
  font-weight: 700;
}

.control {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.control__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.control__value {
  color: var(--accent);
  font-size: 0.86rem;
}

.session-id {
  display: block;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--line-strong);
  background: color-mix(in srgb, var(--bg-deep) 55%, transparent);
  font-size: 0.76rem;
  color: var(--text-dim);
  overflow-wrap: anywhere;
}

/* ===================================================================== */
/* 14. Toasts, banners, modal, loading, empty                             */
/* ===================================================================== */

.toasts {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(380px, calc(100vw - 32px));
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--panel-solid);
  box-shadow: var(--shadow);
  animation: toast-in 0.18s ease;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.toast__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 7px;
  background: var(--accent);
  flex: 0 0 auto;
}

.toast--success .toast__dot {
  background: var(--good);
}

.toast--error .toast__dot {
  background: var(--bad);
}

.toast__msg {
  flex: 1 1 auto;
  font-size: 0.9rem;
}

.toast__close {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}

.banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--panel-2);
  font-size: 0.9rem;
}

.banner__body {
  flex: 1 1 auto;
}

.banner--error {
  border-color: rgba(251, 113, 133, 0.45);
  background: var(--bad-soft);
  color: var(--bad);
}

.banner--success {
  border-color: rgba(52, 211, 153, 0.45);
  background: var(--good-soft);
  color: var(--good);
}

.banner--warn {
  border-color: rgba(251, 191, 36, 0.45);
  background: var(--warn-soft);
  color: var(--warn);
}

.banner--info {
  border-color: rgba(34, 211, 238, 0.35);
  background: var(--accent-soft);
  color: var(--text-dim);
}

.banner__close {
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 1.1rem;
  cursor: pointer;
  line-height: 1;
}

.modal__backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(2, 6, 14, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fade-in 0.15s ease;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal__panel {
  width: 100%;
  max-width: 520px;
  max-height: min(88vh, 900px);
  overflow: auto;
  background: var(--panel-solid);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  animation: modal-in 0.18s ease;
}

.modal__panel--wide {
  max-width: 680px;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.modal__title {
  font-size: 1.06rem;
  margin: 0;
}

.modal__close {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.modal__body {
  padding: 20px;
}

.modal__text {
  margin: 0;
  color: var(--text-dim);
}

.modal__foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel-2) 50%, transparent);
}

.modal__inline-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
}

.reveal {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.address {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--line-strong);
  background: color-mix(in srgb, var(--bg-deep) 60%, transparent);
}

.address__value {
  flex: 1 1 auto;
  overflow-wrap: anywhere;
  font-size: 0.88rem;
}

.loading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  padding: 18px 2px;
  font-size: 0.92rem;
}

.spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  border-top-color: var(--accent);
  animation: spin 0.7s linear infinite;
  flex: 0 0 auto;
}

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

.skeleton-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.skeleton {
  border-radius: 7px;
  background: linear-gradient(90deg, var(--panel-2) 25%, var(--panel-3) 50%, var(--panel-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite linear;
}

.skeleton--text {
  height: 12px;
  width: 100%;
}

.skeleton--short {
  width: 62%;
}

.skeleton--value {
  height: 26px;
  width: 70%;
}

.skeleton--row {
  height: 38px;
}

.skeleton--card {
  height: 140px;
}

.skeleton--chart {
  height: 220px;
}

@keyframes shimmer {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}

.empty {
  text-align: center;
  padding: 44px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--panel-2) 30%, transparent);
}

.empty__icon {
  font-size: 1.8rem;
  margin-bottom: 10px;
}

.empty__title {
  font-size: 1.06rem;
  margin-bottom: 6px;
}

.empty__body {
  color: var(--muted);
  max-width: 52ch;
  margin: 0 auto 16px;
  font-size: 0.92rem;
}

/* ===================================================================== */
/* 15. Chart                                                              */
/* ===================================================================== */

.chart {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chart__svg {
  width: 100%;
  height: 220px;
  overflow: visible;
}

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

.chart__axis {
  fill: var(--muted);
  font-size: 10px;
  font-family: var(--mono);
}

.chart__bar {
  fill: url(#none);
  fill: var(--accent);
  opacity: 0.85;
}

.chart__bar:hover {
  opacity: 1;
}

.chart__bar--error {
  fill: var(--bad);
  opacity: 0.95;
}

.chart__line {
  stroke: var(--accent-2);
  stroke-width: 2;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 6px rgba(45, 212, 191, 0.35));
}

.chart__legend {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: var(--muted);
}

.chart__legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.chart__swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
}

.chart__swatch--bar {
  background: var(--accent);
}

.chart__swatch--line {
  background: var(--accent-2);
}

.chart__swatch--error {
  background: var(--bad);
}

.usage-summary {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.84rem;
  color: var(--muted);
}

.usage-summary strong {
  color: var(--text);
  font-family: var(--mono);
}

/* ===================================================================== */
/* 16. Auth                                                               */
/* ===================================================================== */

.auth {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(280px, 0.9fr);
  gap: 28px;
  align-items: start;
  max-width: 1000px;
  margin: 20px auto 0;
}

.auth__card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 30px;
  box-shadow: var(--shadow);
}

.auth__title {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.auth__sub {
  color: var(--muted);
  margin-bottom: 22px;
}

.auth__alt {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.auth__aside {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--panel-2) 45%, transparent);
  padding: 26px;
}

.auth__aside-title {
  font-size: 1.05rem;
  margin-bottom: 16px;
}

.auth__aside-note {
  margin: 18px 0 0;
}

/* ===================================================================== */
/* 17. Dashboard, keys, credits                                           */
/* ===================================================================== */

.dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 2.1fr) minmax(240px, 1fr);
  gap: 18px;
  align-items: start;
}

.quick-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quick-link {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 10px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  background: color-mix(in srgb, var(--panel-2) 40%, transparent);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.quick-link:hover {
  border-color: var(--accent);
  text-decoration: none;
  transform: translateX(2px);
}

.quick-link__title {
  font-weight: 580;
}

.quick-link__body {
  grid-column: 1 / 2;
  color: var(--muted);
  font-size: 0.84rem;
}

.quick-link__arrow {
  grid-row: 1 / 3;
  align-self: center;
  color: var(--accent);
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
}

.credits-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(320px, 1.15fr);
  gap: 18px;
  align-items: start;
}

.topup-form {
  gap: 14px;
}

.quote {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--panel-2) 45%, transparent);
  padding: 14px 16px;
  min-height: 96px;
}

.quote__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quote__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.9rem;
}

.quote__row.is-strong .quote__value {
  font-size: 1.05rem;
  font-weight: 660;
}

.quote__row.is-accent .quote__value {
  color: var(--accent);
  font-weight: 660;
}

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

.quote__note {
  margin: 6px 0 0;
}

.quote__loading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

.dev-hint {
  border: 1px dashed rgba(251, 191, 36, 0.4);
  background: var(--warn-soft);
  color: var(--text-dim);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin: 0;
}

.dev-hint code {
  color: var(--warn);
}

.invoice-panel {
  min-height: 60px;
}

.invoice__placeholder {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 30px 22px;
  text-align: center;
}

.invoice__body {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.invoice__send {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}

.invoice__send-label {
  margin: 0;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 0.74rem;
  letter-spacing: 0.1em;
}

.invoice__amount {
  display: flex;
  align-items: center;
  gap: 12px;
}

.invoice__crypto {
  font-size: 1.24rem;
  font-weight: 660;
  color: var(--accent);
}

.invoice__hint {
  margin: 0;
}

.invoice__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.invoice__settled {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: color-mix(in srgb, var(--panel-2) 50%, transparent);
}

.invoice__settled--good {
  border-color: rgba(52, 211, 153, 0.45);
  background: var(--good-soft);
}

.invoice__settled--bad {
  border-color: rgba(251, 113, 133, 0.45);
  background: var(--bad-soft);
}

.invoice__settled--warn {
  border-color: rgba(251, 191, 36, 0.45);
  background: var(--warn-soft);
}

.invoice__settled-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  background: var(--panel-solid);
  border: 1px solid var(--line-strong);
  flex: 0 0 auto;
}

.invoice__settled-title {
  font-size: 1rem;
  margin: 0 0 4px;
}

.invoice__settled p {
  margin: 0;
  font-size: 0.88rem;
}

.invoice__meta {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

/* ===================================================================== */
/* 18. Playground                                                         */
/* ===================================================================== */

.playground {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr);
  gap: 18px;
  align-items: start;
}

.chat {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  min-height: 620px;
  overflow: hidden;
}

.chat__log {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 60vh;
  scroll-behavior: smooth;
}

.chat__msg {
  max-width: 88%;
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel-2) 55%, transparent);
}

.chat__msg--user {
  align-self: flex-end;
  background: var(--accent-soft);
  border-color: rgba(34, 211, 238, 0.32);
  border-bottom-right-radius: 5px;
}

.chat__msg--assistant {
  align-self: flex-start;
  border-bottom-left-radius: 5px;
}

.chat__msg--system {
  align-self: center;
  max-width: 100%;
  border-style: dashed;
  color: var(--muted);
  font-size: 0.88rem;
}

.chat__meta {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.chat__meta-usage {
  font-family: var(--mono);
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-dim);
}

.chat__content {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.65;
}

.chat__cursor {
  display: inline-block;
  animation: blink 1s steps(2, start) infinite;
  color: var(--accent);
}

@keyframes blink {
  to {
    visibility: hidden;
  }
}

.chat__reasoning {
  margin: 0 0 8px;
  font-size: 0.84rem;
  color: var(--muted);
}

.chat__reasoning pre {
  white-space: pre-wrap;
  font-family: var(--mono);
  max-height: 220px;
  overflow: auto;
  margin: 6px 0 0;
}

.chat__composer {
  border-top: 1px solid var(--line);
  padding: 14px;
  background: color-mix(in srgb, var(--panel-2) 40%, transparent);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat__input {
  resize: vertical;
  min-height: 74px;
  font-family: var(--sans);
}

.chat__composer-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.chat__footer {
  border-top: 1px solid var(--line);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  background: color-mix(in srgb, var(--bg-deep) 40%, transparent);
}

.chat__usage {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: var(--muted);
}

.chat__usage-item strong {
  color: var(--text);
  font-family: var(--mono);
}

.chat__usage-item--cost strong {
  color: var(--accent);
}

.chat__controls {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.curl-slot .codeblock {
  max-height: 320px;
}

/* ===================================================================== */
/* 19. Status                                                             */
/* ===================================================================== */

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

.status-head__label {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 4px;
}

.status-head__value {
  font-family: var(--mono);
  font-size: 1.1rem;
  font-weight: 640;
}

.status-head__state {
  display: flex;
  align-items: center;
  gap: 12px;
}

.uptime-bar {
  display: flex;
  gap: 3px;
  padding: 6px 0;
  flex-wrap: wrap;
}

.uptime-bar--empty {
  padding: 10px 0;
}

.uptime-seg {
  height: 34px;
  flex: 1 1 18px;
  min-width: 14px;
  border-radius: 5px;
  background: var(--muted);
  opacity: 0.85;
}

.uptime-seg--good {
  background: var(--good);
}

.uptime-seg--warn {
  background: var(--warn);
}

.uptime-seg--bad {
  background: var(--bad);
}

.uptime-seg--muted {
  background: var(--muted);
}

.econ {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ===================================================================== */
/* 20. Docs                                                               */
/* ===================================================================== */

.docs {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

.docs__sidebar {
  position: sticky;
  top: calc(var(--nav-h) + 24px);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.docs__sidebar-foot {
  padding-top: 4px;
}

.sidebar {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--panel-2) 40%, transparent);
  padding: 16px;
}

.sidebar__group {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-weight: 640;
  margin: 14px 0 8px;
}

.sidebar__group:first-child {
  margin-top: 0;
}

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

.sidebar__link {
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 0.9rem;
  border-left: 2px solid transparent;
}

.sidebar__link:hover {
  background: var(--panel-2);
  color: var(--text);
  text-decoration: none;
}

.sidebar__link.is-active {
  background: var(--accent-soft);
  border-left-color: var(--accent);
  color: var(--text);
  font-weight: 580;
}

.docs__main {
  min-width: 0;
}

.docs__mobile-nav {
  display: none;
  margin-bottom: 18px;
}

.docs__content {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 34px 34px;
  box-shadow: var(--shadow-sm);
  max-width: 88ch;
}

.docs__footer {
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Rendered markdown -------------------------------------------------- */

.markdown {
  color: var(--text-dim);
  font-size: 0.95rem;
  line-height: 1.72;
}

.markdown > *:first-child {
  margin-top: 0;
}

.markdown h1,
.markdown h2,
.markdown h3,
.markdown h4,
.markdown h5,
.markdown h6 {
  color: var(--text);
  margin: 1.7em 0 0.6em;
  line-height: 1.25;
  position: relative;
  scroll-margin-top: calc(var(--nav-h) + 20px);
}

.markdown h1 {
  font-size: 1.85rem;
  padding-bottom: 0.4em;
  border-bottom: 1px solid var(--line);
}

.markdown h2 {
  font-size: 1.35rem;
  padding-bottom: 0.3em;
  border-bottom: 1px solid var(--line);
}

.markdown h3 {
  font-size: 1.12rem;
}

.markdown h4 {
  font-size: 1rem;
}

.markdown p {
  margin: 0 0 1.1em;
}

.markdown a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent);
  text-underline-offset: 2px;
}

.markdown a:hover {
  text-decoration-color: var(--accent);
}

.markdown strong {
  color: var(--text);
  font-weight: 640;
}

.markdown ul,
.markdown ol {
  margin: 0 0 1.1em;
  padding-left: 1.5em;
}

.markdown li {
  margin-bottom: 0.35em;
}

.markdown li > ul,
.markdown li > ol {
  margin-top: 0.35em;
  margin-bottom: 0.2em;
}

.markdown blockquote {
  margin: 0 0 1.1em;
  padding: 2px 0 2px 16px;
  border-left: 3px solid var(--accent);
  background: color-mix(in srgb, var(--accent-soft) 60%, transparent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-dim);
}

.markdown blockquote p:last-child {
  margin-bottom: 0;
}

.markdown hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2em 0;
}

.markdown .md-code {
  font-family: var(--mono);
  font-size: 0.86em;
  padding: 2px 6px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--panel-3) 80%, transparent);
  border: 1px solid var(--line);
  color: var(--accent);
  overflow-wrap: anywhere;
}

.markdown .md-anchor {
  position: absolute;
  left: -0.85em;
  color: var(--muted);
  opacity: 0;
  font-weight: 400;
  text-decoration: none;
}

.markdown h1:hover .md-anchor,
.markdown h2:hover .md-anchor,
.markdown h3:hover .md-anchor,
.markdown h4:hover .md-anchor {
  opacity: 0.7;
}

.markdown .table-wrap {
  margin: 0 0 1.4em;
}

.markdown .md-table {
  min-width: 420px;
}

.markdown .code {
  margin: 0 0 1.4em;
}

.markdown pre.md-pre {
  background: transparent;
}

.markdown .md-pre code {
  color: var(--text-dim);
}

/* ===================================================================== */
/* 20b. Small component refinements                                       */
/* ===================================================================== */

.page-head__text {
  min-width: 0;
}

.card--wide {
  min-width: 0;
}

.credits-chip__value {
  font-variant-numeric: tabular-nums;
}

.credits-side {
  min-width: 0;
}

.cta-band__inner {
  max-width: 720px;
  margin: 0 auto;
}

.empty__action {
  margin-top: 6px;
}

.spec__hint {
  margin-top: 4px;
}

.model-detail .card__subtitle {
  font-family: var(--mono);
  font-size: 0.82rem;
}

.tabpanels {
  min-width: 0;
}

.chat__status {
  min-width: 0;
}

.theme-toggle__icon {
  line-height: 1;
}

.toast--info .toast__dot {
  background: var(--accent);
}

.docs__title {
  scroll-margin-top: calc(var(--nav-h) + 20px);
}

.markdown .md-h1,
.markdown .md-h2,
.markdown .md-h3,
.markdown .md-h4,
.markdown .md-h5,
.markdown .md-h6 {
  scroll-margin-top: calc(var(--nav-h) + 20px);
}

.markdown .chart__axis--right {
  text-anchor: start;
}

/* ===================================================================== */
/* 21. Responsive                                                         */
/* ===================================================================== */

@media (max-width: 1060px) {
  .dash-grid,
  .credits-grid,
  .playground {
    grid-template-columns: minmax(0, 1fr);
  }

  .chat {
    min-height: 520px;
  }

  .chat__log {
    max-height: 52vh;
  }
}

@media (max-width: 920px) {
  .auth {
    grid-template-columns: minmax(0, 1fr);
  }

  .docs {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }

  .docs__sidebar {
    display: none;
  }

  .docs__mobile-nav {
    display: block;
  }

  .docs__content {
    padding: 22px 20px 26px;
  }

  .footer__inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 26px;
  }
}

@media (max-width: 860px) {
  :root {
    --nav-h: 60px;
  }

  .nav {
    gap: 10px;
    position: relative;
  }

  .nav__toggle {
    display: flex;
    order: 3;
    margin-left: 0;
    /* Never let the flex line squeeze the menu button: it was shrinking to 20px
       and being pushed past the right edge, leaving it unreachable on a phone. */
    flex: 0 0 auto;
  }

  .nav__actions {
    margin-left: auto;
    order: 2;
    gap: 8px;
  }

  .brand {
    margin-right: auto;
  }

  .account__email {
    display: none;
  }

  .nav__links {
    position: absolute;
    top: calc(var(--nav-h) - 6px);
    left: 12px;
    right: 12px;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 10px;
    margin: 0;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--panel-solid);
    box-shadow: var(--shadow);
    display: none;
  }

  .site-header.is-open .nav__links {
    display: flex;
  }

  .nav__link {
    padding: 11px 12px;
  }

  .hero {
    padding-top: calc(var(--nav-h) + 52px);
  }

  .hero__stats {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }

  .usage-summary {
    width: 100%;
  }
}

@media (max-width: 480px) {
  /* At this width the logo, both calls to action and the menu button cannot all
     fit on one line. The logo mark stays (the link keeps its aria-label); the
     wordmark is what gives up its space. */
  .brand__name {
    display: none;
  }

  .nav {
    gap: 8px;
  }

  .nav__actions {
    gap: 6px;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 15px;
  }

  .container {
    padding: 0 14px;
  }

  .page {
    padding-top: calc(var(--nav-h) + 24px);
  }

  .section {
    margin-bottom: 40px;
  }

  .card__head {
    padding: 16px 16px 0;
  }

  .card__body {
    padding: 14px 16px 18px;
  }

  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }

  .stat__value {
    font-size: 1.24rem;
  }

  .hero__cta .btn {
    width: 100%;
  }

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

  .chat__msg {
    max-width: 100%;
  }

  .chat__footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .toasts {
    left: 12px;
    right: 12px;
    bottom: 12px;
    max-width: none;
  }
}

/* ===================================================================== */
/* 22. Motion & print                                                     */
/* ===================================================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  .site-header,
  .footer,
  .toasts,
  .docs__sidebar,
  .docs__mobile-nav {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  .page {
    padding: 0;
  }
}
