:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-muted: #f3f4f8;
  --surface-raised: #fafbff;
  --border: #e4e7ee;
  --border-strong: #cfd5e1;
  --text: #14151d;
  --muted: #7a7f8e;
  --muted-strong: #555b6d;
  --accent: #6467f2;
  --accent-strong: #4f52de;
  --accent-soft: #eef0ff;
  --danger: #c23535;
  --success: #147a4a;
  --warning: #9f6407;
  --shadow: 0 16px 36px rgba(18, 23, 38, 0.08);
  --shadow-soft: 0 1px 2px rgba(18, 23, 38, 0.04);
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100dvh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: 0;
}

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

button {
  cursor: pointer;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 10px 12px;
  outline: none;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(100, 103, 242, 0.24);
  outline-offset: 2px;
}

a {
  color: inherit;
}

.app-root {
  min-height: 100dvh;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--accent);
  font-weight: 800;
}

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

.button,
.icon-button,
.search-box,
.workspace-picker,
.sidebar-nav button,
.credit-pack {
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.button-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 18px rgba(100, 103, 242, 0.18);
}

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

.button-secondary:hover,
.icon-button:hover,
.search-box:hover,
.credit-pack:hover {
  border-color: var(--border-strong);
  background: var(--surface-muted);
}

.button-google {
  width: 100%;
  border-color: var(--border-strong);
}

.button-google span {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-muted);
  color: var(--accent);
}

.icon-button {
  display: inline-grid;
  width: 44px;
  height: 44px;
  place-items: center;
  padding: 0;
  font-size: 20px;
  line-height: 1;
}

.public-home {
  min-height: 100dvh;
  background:
    linear-gradient(rgba(228, 231, 238, 0.72) 1px, transparent 1px),
    linear-gradient(90deg, rgba(228, 231, 238, 0.72) 1px, transparent 1px),
    linear-gradient(180deg, #ffffff 0%, #f6f7fb 100%);
  background-size: 64px 64px, 64px 64px, auto;
}

.public-topbar {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid rgba(228, 231, 238, 0.9);
  background: rgba(255, 255, 255, 0.88);
  padding: 14px clamp(18px, 4vw, 64px);
  backdrop-filter: blur(16px);
}

.public-nav {
  display: flex;
  align-items: center;
  gap: 18px;
}

.public-nav a:not(.button) {
  color: var(--muted-strong);
  font-weight: 700;
  text-decoration: none;
}

.public-nav a:not(.button):hover {
  color: var(--text);
}

.public-hero {
  display: grid;
  width: min(100%, 1280px);
  min-height: calc(100dvh - 72px);
  grid-template-columns: minmax(0, 0.94fr) minmax(360px, 1.06fr);
  align-items: center;
  gap: clamp(28px, 5vw, 72px);
  margin: 0 auto;
  padding: clamp(36px, 6vw, 78px) clamp(18px, 4vw, 64px) clamp(28px, 5vw, 58px);
}

.public-hero-copy h1 {
  margin: 0;
  max-width: 9ch;
  font-size: clamp(54px, 9vw, 112px);
  line-height: 0.9;
  letter-spacing: 0;
}

.public-lede {
  max-width: 58ch;
  margin: 24px 0 0;
  color: var(--muted-strong);
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.55;
}

.public-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.public-metric-strip {
  display: grid;
  max-width: 620px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin: 34px 0 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--border);
  box-shadow: var(--shadow-soft);
}

.public-metric-strip div {
  background: rgba(255, 255, 255, 0.92);
  padding: 16px;
}

.public-metric-strip dt,
.public-endpoint-card span,
.public-signal-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.public-metric-strip dd {
  margin: 8px 0 0;
  font-size: 22px;
  font-weight: 800;
}

.public-route-visual {
  position: relative;
  min-height: 560px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background:
    linear-gradient(rgba(228, 231, 238, 0.78) 1px, transparent 1px),
    linear-gradient(90deg, rgba(228, 231, 238, 0.78) 1px, transparent 1px),
    rgba(255, 255, 255, 0.94);
  background-size: 48px 48px;
  box-shadow: var(--shadow);
  transform: translateY(calc(var(--scroll-progress, 0) * -12px));
  transform-style: preserve-3d;
  transition: transform 180ms ease;
}

.public-route-visual canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.route-core,
.route-node {
  position: absolute;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 44px rgba(18, 23, 38, 0.1);
}

.route-core {
  top: 50%;
  left: 50%;
  width: min(48%, 260px);
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translate(-50%, -50%) translateZ(34px);
}

.route-core span {
  align-self: end;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.route-core strong {
  align-self: start;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1;
}

.route-node {
  min-width: 124px;
  min-height: 56px;
  border-radius: 999px;
  color: var(--text);
  font-weight: 800;
  transform: translateZ(48px);
}

.node-credit {
  top: 18%;
  left: 15%;
}

.node-key {
  right: 14%;
  bottom: 22%;
}

.node-model {
  top: 25%;
  right: 16%;
}

.node-support {
  bottom: 20%;
  left: 18%;
}

.public-section {
  width: min(100%, 1280px);
  margin: 0 auto;
  padding: 72px clamp(18px, 4vw, 64px);
}

.public-section-head {
  display: grid;
  max-width: 720px;
  gap: 10px;
}

.public-section-head h2 {
  margin: 0;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 0.98;
  letter-spacing: 0;
}

.public-section-head p:not(.eyebrow) {
  margin: 0;
  color: var(--muted-strong);
  font-size: 17px;
}

.public-endpoint-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
  margin-top: 24px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  padding: 18px;
  box-shadow: var(--shadow-soft);
}

.public-endpoint-card span {
  grid-column: 1 / -1;
}

.public-endpoint-card code {
  min-width: 0;
  overflow-wrap: anywhere;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-muted);
  padding: 12px;
  font-size: 16px;
  font-weight: 700;
}

.public-signal-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
}

.public-signal-grid div {
  display: grid;
  gap: 8px;
  min-height: 142px;
  align-content: start;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  padding: 18px;
  box-shadow: var(--shadow-soft);
}

.public-signal-grid strong {
  font-size: 24px;
  line-height: 1.1;
}

.public-signal-grid small {
  color: var(--muted-strong);
}

.public-routing {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  border-top: 1px solid var(--border);
}

.auth-shell {
  display: grid;
  min-height: 100dvh;
  grid-template-columns: minmax(320px, 460px) minmax(0, 1fr);
  background:
    radial-gradient(circle at 74% 20%, rgba(100, 103, 242, 0.12), transparent 28%),
    linear-gradient(135deg, #fff 0%, #f9f9fc 100%);
}

.auth-panel {
  display: flex;
  min-height: 100dvh;
  flex-direction: column;
  justify-content: center;
  gap: 22px;
  border-right: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.88);
  padding: clamp(24px, 5vw, 56px);
}

.auth-copy h1 {
  margin: 0;
  max-width: 11ch;
  font-size: clamp(32px, 4vw, 54px);
  line-height: 0.98;
  letter-spacing: 0;
}

.auth-copy p {
  max-width: 48ch;
  margin: 16px 0 0;
  color: var(--muted-strong);
  font-size: 15px;
}

.auth-divider {
  position: relative;
  display: flex;
  justify-content: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.auth-divider::before {
  position: absolute;
  top: 50%;
  right: 0;
  left: 0;
  height: 1px;
  background: var(--border);
  content: "";
}

.auth-divider span {
  position: relative;
  background: #fff;
  padding: 0 12px;
}

.auth-form {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 700;
}

.auth-status,
.workspace-message,
.notice {
  min-height: 22px;
  margin: 0;
  color: var(--muted-strong);
  overflow-wrap: anywhere;
}

.workspace-message {
  width: fit-content;
  max-width: 100%;
  border: 1px solid rgba(20, 122, 74, 0.14);
  border-radius: 999px;
  background: rgba(20, 122, 74, 0.07);
  padding: 5px 10px;
  color: var(--success);
  font-size: 13px;
}

.auth-status.is-error,
.workspace-message.is-error {
  border-color: rgba(194, 53, 53, 0.2);
  background: rgba(194, 53, 53, 0.07);
  color: var(--danger);
}

.auth-status.is-success,
.workspace-message.is-success {
  color: var(--success);
}

.auth-link {
  color: var(--accent);
  font-weight: 700;
}

.auth-aside {
  display: grid;
  align-content: center;
  gap: 18px;
  padding: clamp(24px, 6vw, 80px);
}

.preview-card,
.preview-grid div,
.table-card,
.inline-card,
.subscription-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
}

.preview-card {
  max-width: 620px;
  padding: 28px;
}

.preview-card span,
.preview-grid span,
.stat-strip span,
.table-head span,
.record-list small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.preview-card strong {
  display: block;
  margin-top: 12px;
  font-size: clamp(30px, 5vw, 72px);
  line-height: 0.95;
  letter-spacing: 0;
}

.preview-card p {
  max-width: 52ch;
  color: var(--muted-strong);
}

.preview-grid {
  display: grid;
  max-width: 620px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.preview-grid div {
  padding: 16px;
}

.preview-grid strong {
  display: block;
  margin-top: 8px;
  font-size: 20px;
}

.workspace-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(246, 247, 251, 0) 220px),
    var(--bg);
}

.workspace-sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100dvh;
  flex-direction: column;
  gap: 12px;
  border-right: 1px solid var(--border);
  background: rgba(250, 251, 255, 0.95);
  padding: 16px 12px;
  overflow-y: auto;
  z-index: 20;
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-close {
  display: none;
}

.workspace-picker {
  display: grid;
  width: 100%;
  min-height: 52px;
  border-color: var(--border);
  background: #fff;
  padding: 9px 11px;
  text-align: left;
  box-shadow: var(--shadow-soft);
}

.workspace-picker span {
  font-weight: 700;
}

.workspace-picker small {
  color: var(--muted);
}

.sidebar-nav {
  display: grid;
  gap: 2px;
}

.sidebar-nav button {
  width: 100%;
  border-color: transparent;
  background: transparent;
  color: var(--muted-strong);
  min-height: 38px;
  border-radius: 7px;
  padding: 8px 10px;
  text-align: left;
  font-size: 13px;
  font-weight: 700;
}

.sidebar-nav button.is-active {
  border-color: #dfe3ff;
  background: var(--accent-soft);
  color: var(--text);
  box-shadow: none;
}

.nav-group-title {
  margin-top: 18px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.workspace-main {
  min-width: 0;
  min-height: 100dvh;
}

.workspace-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  padding: 8px clamp(14px, 2.2vw, 26px);
  backdrop-filter: blur(16px);
}

.mobile-sidebar-toggle {
  display: none;
}

.search-box {
  display: flex;
  width: min(470px, 44vw);
  align-items: center;
  gap: 10px;
  justify-content: flex-start;
  color: var(--muted);
  min-height: 40px;
  padding: 8px 11px;
}

.search-box kbd {
  margin-left: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-muted);
  padding: 1px 6px;
  color: var(--muted);
  font-size: 11px;
}

.topbar-account {
  display: grid;
  margin-left: auto;
  text-align: right;
}

.topbar-account span {
  font-weight: 800;
}

.topbar-credit-action {
  min-height: 38px;
}

.topbar-account small {
  color: var(--muted);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-content {
  display: grid;
  gap: 14px;
  width: min(100%, 1280px);
  margin: 0 auto;
  padding: clamp(16px, 2.4vw, 26px);
}

.workspace-panel {
  display: grid;
  gap: 16px;
}

.workspace-panel[hidden] {
  display: none;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 14px;
}

.page-head h2 {
  margin: 0;
  font-size: clamp(24px, 2.2vw, 31px);
  line-height: 1.12;
  letter-spacing: 0;
}

.page-head p:not(.eyebrow) {
  max-width: 64ch;
  margin: 8px 0 0;
  color: var(--muted-strong);
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.api-page-head {
  position: sticky;
  top: 58px;
  z-index: 8;
  background: rgba(246, 247, 251, 0.92);
  backdrop-filter: blur(14px);
}

.developer-strip {
  display: grid;
  grid-template-columns: minmax(260px, 1.4fr) auto minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  box-shadow: var(--shadow-soft);
}

.developer-endpoint {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.developer-endpoint span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

code {
  border: 1px solid #e7eaf2;
  border-radius: 6px;
  background: #f8f9fc;
  color: #202334;
  padding: 2px 5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  overflow-wrap: anywhere;
}

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

.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.stat-strip div {
  display: grid;
  gap: 4px;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 11px 12px;
  box-shadow: var(--shadow-soft);
}

.stat-strip strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 16px;
}

.stat-strip small {
  color: var(--muted);
  font-size: 11px;
}

.quickstart-panel,
.key-detail-panel,
.legacy-key-panel,
.admin-checklist {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.quickstart-grid,
.key-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
}

.quickstart-grid > div,
.key-detail-grid > div {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  border-right: 1px solid var(--border);
  padding: 12px;
}

.quickstart-grid > div:last-child,
.key-detail-grid > div:last-child {
  border-right: 0;
}

.quickstart-grid span,
.key-detail-grid span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

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

.key-detail-grid p {
  margin: 0;
  color: var(--muted-strong);
}

.rename-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.rename-row input {
  min-height: 36px;
  padding: 7px 9px;
}

.rename-row button {
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #fff;
  padding: 7px 10px;
  font-weight: 700;
}

.legacy-key-row,
.checklist-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(0, 1.2fr) minmax(0, 1.6fr);
  gap: 10px;
  align-items: center;
  border-top: 1px solid var(--border);
  padding: 10px 14px;
}

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

.legacy-key-row small {
  color: var(--muted);
}

.table-card {
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  padding: 12px 14px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--border);
  padding: 10px 14px;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.data-table th {
  color: var(--muted);
  background: #fafbfe;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

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

.data-table td small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.key-limits {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  color: var(--muted-strong);
  font-size: 11px;
}

.limit-badge {
  display: inline-flex;
  max-width: 100%;
  border: 1px solid #e7eaf2;
  border-radius: 999px;
  background: #f8f9fc;
  padding: 2px 7px;
  overflow-wrap: anywhere;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 8px;
  background: var(--surface-muted);
  color: var(--muted-strong);
  font-size: 11px;
  font-weight: 800;
  text-transform: capitalize;
}

.status-active {
  border-color: rgba(20, 122, 74, 0.22);
  background: rgba(20, 122, 74, 0.08);
  color: var(--success);
}

.status-revoked,
.status-expired {
  border-color: rgba(194, 53, 53, 0.16);
  background: rgba(194, 53, 53, 0.07);
  color: var(--danger);
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.data-table button,
.record-list button {
  min-height: 32px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #fff;
  padding: 6px 10px;
  font-weight: 700;
}

.data-table button:hover,
.record-list button:hover {
  border-color: var(--border-strong);
  background: var(--surface-muted);
}

.offer-list,
.record-list {
  display: grid;
  gap: 10px;
}

.offer-list > div,
.record-list > div {
  display: grid;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 12px 14px;
  overflow-wrap: anywhere;
  box-shadow: var(--shadow-soft);
}

.offer-list span,
.record-list span {
  color: var(--muted-strong);
}

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

.credit-pack {
  display: grid;
  gap: 6px;
  padding: 14px;
  text-align: left;
}

.credit-pack.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.credit-pack span,
.credit-pack small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.credit-pack strong {
  font-size: 18px;
}

.inline-card,
.subscription-card,
.settings-grid {
  display: grid;
  gap: 12px;
  align-items: end;
  padding: 16px;
}

.inline-card {
  grid-template-columns: minmax(180px, 260px) auto minmax(0, 1fr);
}

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

.subscription-card h3 {
  margin: 0 0 8px;
  font-size: 20px;
}

.subscription-card p {
  margin: 0;
  color: var(--muted-strong);
}

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

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

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

.command-dialog {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: start center;
  background: rgba(20, 20, 28, 0.22);
  padding: 12vh 16px;
}

.command-dialog[hidden] {
  display: none;
}

.command-surface {
  width: min(620px, 100%);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.command-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  padding: 12px;
}

.command-input-row input {
  border: 0;
}

.command-input-row button {
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #fff;
  padding: 4px 9px;
}

.command-list {
  display: grid;
  padding: 8px;
}

.command-list button {
  min-height: 40px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  padding: 10px;
  text-align: left;
}

.command-list button:hover {
  background: var(--surface-muted);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  background: rgba(20, 20, 28, 0.28);
  padding: 24px;
}

.modal-sheet {
  width: min(620px, 100%);
  max-height: min(760px, calc(100dvh - 48px));
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.modal-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  padding: 18px;
}

.modal-head h2,
.modal-head p {
  margin: 0;
}

.modal-head h2 {
  font-size: 24px;
  line-height: 1.15;
}

.modal-head p:not(.eyebrow),
.modal-hint {
  color: var(--muted-strong);
}

.modal-form {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.modal-hint {
  margin: 0;
  font-size: 13px;
}

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

@media (max-width: 1020px) {
  .public-hero {
    min-height: auto;
    grid-template-columns: 1fr;
  }

  .public-route-visual {
    min-height: 460px;
  }

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

  .public-routing {
    display: grid;
  }

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

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

  .developer-strip .developer-endpoint:nth-of-type(2) {
    grid-column: 1 / -1;
  }

  .quickstart-grid,
  .key-detail-grid {
    grid-template-columns: 1fr;
  }

  .quickstart-grid > div,
  .key-detail-grid > div {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .quickstart-grid > div:last-child,
  .key-detail-grid > div:last-child {
    border-bottom: 0;
  }

  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-panel {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .auth-aside {
    align-content: start;
  }
}

@media (max-width: 820px) {
  body {
    font-size: 13px;
  }

  .public-topbar {
    position: static;
    align-items: flex-start;
    padding: 14px;
  }

  .public-nav {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
  }

  .public-hero,
  .public-section {
    padding-right: 14px;
    padding-left: 14px;
  }

  .public-hero-copy h1 {
    font-size: 48px;
  }

  .public-lede {
    font-size: 16px;
  }

  .public-route-visual {
    min-height: 380px;
  }

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

  .public-endpoint-card {
    grid-template-columns: 1fr;
  }

  .public-endpoint-card .button {
    width: 100%;
  }

  .workspace-shell {
    grid-template-columns: 1fr;
  }

  .workspace-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(82vw, 300px);
    transform: translateX(-105%);
    transition: transform 180ms ease;
    box-shadow: var(--shadow);
  }

  .workspace-shell.sidebar-open .workspace-sidebar {
    transform: translateX(0);
  }

  .sidebar-close,
  .mobile-sidebar-toggle {
    display: inline-grid;
  }

  .workspace-topbar {
    gap: 8px;
    padding: 8px 12px;
  }

  .search-box {
    flex: 1;
    width: auto;
    min-width: 0;
  }

  .search-box span:nth-child(2),
  .search-box kbd,
  .topbar-account small {
    display: none;
  }

  .topbar-account {
    margin-left: 0;
    font-size: 12px;
  }

  .workspace-content {
    padding: 14px;
  }

  .page-head {
    display: grid;
    gap: 12px;
  }

  .api-page-head {
    position: static;
    background: transparent;
    backdrop-filter: none;
  }

  .page-head h2 {
    font-size: 24px;
  }

  .page-actions {
    justify-content: stretch;
  }

  .page-actions .button {
    flex: 1 1 160px;
  }

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

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

  .developer-strip .button {
    width: 100%;
  }

  .inline-card,
  .subscription-card,
  .form-grid,
  .settings-grid,
  .legacy-key-row {
    grid-template-columns: 1fr;
  }

  .data-table thead {
    display: none;
  }

  .data-table,
  .data-table tbody,
  .data-table tr,
  .data-table td {
    display: block;
    width: 100%;
  }

  .data-table tr {
    border-bottom: 1px solid var(--border);
    padding: 8px 0;
  }

  .data-table td {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 8px;
    border-bottom: 0;
    padding: 6px 10px;
  }

  .data-table td::before {
    color: var(--muted);
    content: attr(data-label);
    font-size: 11px;
    font-weight: 800;
  }
}

@media (max-width: 520px) {
  .public-topbar {
    display: grid;
  }

  .public-nav {
    justify-content: flex-start;
  }

  .public-hero-copy h1 {
    font-size: 44px;
  }

  .public-actions .button {
    width: 100%;
  }

  .public-route-visual {
    min-height: 320px;
  }

  .route-core {
    width: 58%;
  }

  .route-node {
    min-width: 92px;
    min-height: 44px;
    font-size: 12px;
  }

  .node-credit {
    top: 12%;
    left: 8%;
  }

  .node-model {
    top: 18%;
    right: 8%;
  }

  .node-support {
    bottom: 14%;
    left: 9%;
  }

  .node-key {
    right: 8%;
    bottom: 16%;
  }

  .public-signal-grid {
    grid-template-columns: 1fr;
  }

  .auth-panel,
  .auth-aside {
    padding: 20px;
  }

  .auth-copy h1 {
    max-width: 12ch;
    font-size: 32px;
  }

  .preview-grid,
  .credit-pack-grid {
    grid-template-columns: 1fr;
  }

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

  .workspace-content {
    padding: 10px;
  }

  .page-head h2 {
    font-size: 22px;
  }

  .workspace-message {
    width: 100%;
    border-radius: 8px;
  }

  .button {
    width: 100%;
  }

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

  .row-actions button {
    width: 100%;
  }

  .workspace-topbar .button {
    width: auto;
    padding-inline: 10px;
  }

  .modal-backdrop {
    align-items: end;
    padding: 10px;
  }

  .modal-sheet {
    max-height: calc(100dvh - 20px);
  }

  .modal-head,
  .modal-form {
    padding: 14px;
  }

  .modal-actions {
    display: grid;
  }
}

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