:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --ink: #141922;
  --muted: #667085;
  --line: #d7dee8;
  --panel: #ffffff;
  --panel-soft: #f9fbfd;
  --accent: #0b7a75;
  --accent-strong: #075f5b;
  --blue: #2458d3;
  --danger: #b42318;
  --success: #14804a;
  --shadow: 0 14px 36px rgba(20, 25, 34, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 64px;
  padding: 12px clamp(16px, 4vw, 44px);
  border-bottom: 1px solid var(--line);
  background: rgba(244, 246, 248, 0.94);
  backdrop-filter: blur(12px);
}

.brand,
nav,
.actions,
.admin-head,
.summary-row {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 800;
}

.mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--ink);
  color: white;
  font-size: 12px;
}

nav {
  gap: 14px;
  color: var(--muted);
  font-size: 14px;
}

nav a:hover {
  color: var(--ink);
}

.site-shell,
.app-shell,
.docs-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.site-shell {
  padding-bottom: 56px;
}

.app-shell {
  padding: 36px 0 64px;
}

.docs-shell {
  padding: 42px 0 72px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 1.05fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
  min-height: calc(100vh - 112px);
  padding: 38px 0 52px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 16px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.02;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 12px;
  font-size: 24px;
  line-height: 1.18;
}

h3 {
  margin-bottom: 6px;
  font-size: 17px;
}

.lede,
.subcopy,
.section p,
.api-layout p,
.info-card p,
.usage-card p {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

.subcopy {
  max-width: 680px;
  margin-bottom: 22px;
}

.actions {
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font: inherit;
  font-weight: 760;
  cursor: pointer;
}

.button:hover {
  border-color: #a8b3c2;
}

.button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.button.primary:hover {
  background: var(--accent-strong);
}

.button.danger {
  color: var(--danger);
}

.console-card,
.code-panel,
.auth-card,
.workspace,
.generated,
.model-card,
.doc-block,
.panel-block,
.info-card,
.usage-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.console-card,
.code-panel {
  overflow: hidden;
}

.summary-row {
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-soft);
}

.summary-row span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.summary-row strong {
  overflow-wrap: anywhere;
  font-size: 15px;
}

pre {
  margin: 0;
  overflow-x: auto;
  padding: 18px;
  background: #101621;
  color: #d7dee8;
  font-size: 13px;
  line-height: 1.65;
}

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.section {
  padding: 56px 0;
}

.band {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section-head {
  margin-bottom: 20px;
}

.model-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.model-card {
  min-height: 142px;
  padding: 18px;
  box-shadow: none;
}

.model-card span {
  color: var(--muted);
  font-size: 13px;
}

.model-card > code {
  display: inline-block;
  margin: 10px 0;
  color: var(--blue);
  overflow-wrap: anywhere;
}

.model-card p {
  margin: 0;
  font-size: 13px;
}

.api-layout {
  display: grid;
  grid-template-columns: 0.75fr 1.25fr;
  gap: 24px;
  align-items: start;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 32px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.docs-hero {
  padding: 10px 0 24px;
}

.docs-hero h1 {
  font-size: clamp(32px, 4.5vw, 52px);
}

.quick-panel,
.docs-grid,
.admin-overview,
.usage-layout,
.playground-grid,
.two-col {
  display: grid;
  gap: 14px;
}

.quick-panel {
  grid-template-columns: 1.25fr 0.85fr 0.9fr;
  margin-bottom: 16px;
}

.quick-panel > div {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--ink);
  color: white;
}

.quick-panel span,
.info-card span,
.usage-card span,
.stat-card span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.quick-panel span {
  color: #9ee7df;
  text-transform: uppercase;
}

.quick-panel strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 18px;
}

.docs-grid {
  grid-template-columns: 0.95fr 1.05fr;
  margin-bottom: 16px;
}

.playground-grid {
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  align-items: start;
  margin-bottom: 16px;
}

.two-col {
  grid-template-columns: minmax(0, 1fr) 160px;
}

.auth-card,
.workspace,
.panel-block,
.doc-block {
  padding: clamp(20px, 4vw, 30px);
}

.auth-card {
  max-width: 760px;
  margin: 18px auto 0;
}

.workspace {
  box-shadow: none;
}

.panel-block,
.doc-block {
  margin-bottom: 16px;
  box-shadow: none;
}

.doc-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.key-input {
  max-width: 720px;
}

.kv {
  display: grid;
  grid-template-columns: 136px minmax(0, 1fr);
  gap: 12px;
  margin: 0;
}

.kv dt {
  color: var(--muted);
  font-weight: 800;
}

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

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

.model-list span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.steps {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 22px;
  color: var(--muted);
  line-height: 1.65;
}

.steps li::marker {
  color: var(--accent);
  font-weight: 800;
}

.admin-overview {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 16px;
}

.usage-layout {
  grid-template-columns: minmax(0, 1.4fr) minmax(220px, 0.6fr);
  margin-bottom: 16px;
}

.usage-card,
.info-card {
  padding: 20px;
  box-shadow: none;
}

.usage-card strong,
.info-card strong,
.stat-card strong {
  display: block;
  font-size: 36px;
  line-height: 1.05;
}

.usage-card strong small {
  color: var(--muted);
  font-size: 18px;
  font-weight: 700;
}

.usage-card em {
  font-style: normal;
}

.meter {
  width: 100%;
  height: 12px;
  margin: 18px 0 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8edf3;
}

.meter span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 180ms ease;
}

.hidden {
  display: none !important;
}

.form-row,
.create-grid {
  display: grid;
  gap: 14px;
}

.form-row {
  grid-template-columns: 1fr auto;
  align-items: end;
}

.create-grid {
  grid-template-columns: 1fr 180px;
}

label,
fieldset {
  display: grid;
  gap: 8px;
  margin: 0;
  border: 0;
  padding: 0;
}

label span,
legend {
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

input {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font: inherit;
}

select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font: inherit;
}

select {
  min-height: 42px;
  padding: 0 12px;
}

textarea {
  min-height: 92px;
  resize: vertical;
  padding: 12px;
  line-height: 1.55;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(11, 122, 117, 0.16);
  border-color: var(--accent);
}

fieldset,
.create-grid .button {
  grid-column: 1 / -1;
}

.checks {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.checks label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.checks input {
  width: 16px;
  min-height: 16px;
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.switch-row input {
  width: 18px;
  min-height: 18px;
}

.switch-row span {
  margin: 0;
  color: var(--ink);
}

.admin-head {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.admin-head h1 {
  margin-bottom: 0;
  font-size: clamp(28px, 4vw, 42px);
}

.generated {
  margin: 16px 0;
  padding: 16px;
  box-shadow: none;
  border-color: #8bd6a7;
  background: #f0fbf4;
}

.generated p {
  margin-bottom: 8px;
  color: #21633f;
}

.generated code {
  display: block;
  color: #14532d;
  overflow-wrap: anywhere;
}

.playground-form {
  display: grid;
  gap: 14px;
}

.compact-kv {
  grid-template-columns: 104px minmax(0, 1fr);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.status-pill.success {
  border-color: #8bd6a7;
  background: #f0fbf4;
  color: var(--success);
}

.status-pill.danger {
  border-color: #f4aaa4;
  background: #fff3f1;
  color: var(--danger);
}

.output-panel {
  min-height: 220px;
  white-space: pre-wrap;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 16px;
}

.panel-table {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: 14px;
}

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

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

td .button {
  min-height: 34px;
  margin: 3px 4px 3px 0;
  padding: 0 10px;
  font-size: 13px;
}

@media (max-width: 860px) {
  .hero,
  .api-layout,
  .docs-grid,
  .quick-panel,
  .form-row,
  .create-grid,
  .usage-layout,
  .playground-grid,
  .two-col {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-top: 28px;
  }

  h1 {
    font-size: 36px;
  }

  .model-grid,
  .checks,
  .admin-overview {
    grid-template-columns: 1fr;
  }

  .kv {
    grid-template-columns: 1fr;
  }

  footer,
  .admin-head,
  .doc-title-row {
    align-items: flex-start;
    flex-direction: column;
  }

  nav {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
}

@media (max-width: 560px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  nav {
    justify-content: flex-start;
  }

  pre {
    font-size: 12px;
  }
}
