:root {
  --bg: #f4f1ea;
  --surface: #fffdf8;
  --surface-2: #f9f6ee;
  --surface-3: #ede8dc;
  --ink: #161713;
  --ink-2: #3f413a;
  --muted: #74766d;
  --line: rgba(22, 23, 19, 0.12);
  --line-strong: rgba(22, 23, 19, 0.2);
  --teal: #0c6f68;
  --teal-2: #084f4a;
  --teal-soft: rgba(12, 111, 104, 0.1);
  --gold: #b28a36;
  --red: #b42318;
  --green: #12734d;
  --radius: 8px;
  --shadow: 0 24px 80px rgba(25, 24, 19, 0.12);
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sans: "HarmonyOS Sans SC", "MiSans", "PingFang SC", "Microsoft YaHei", ui-sans-serif, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  min-height: 100%;
}

body {
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    linear-gradient(115deg, rgba(12, 111, 104, 0.1), transparent 30%),
    linear-gradient(240deg, rgba(178, 138, 54, 0.12), transparent 26%),
    var(--bg);
  font-family: var(--sans);
  letter-spacing: 0;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(22, 23, 19, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(22, 23, 19, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), transparent 78%);
}

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

button {
  cursor: pointer;
}

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

body.landing-mode {
  color: #f7fbff;
  background:
    radial-gradient(circle at 76% 30%, rgba(18, 184, 170, 0.16), transparent 28rem),
    radial-gradient(circle at 18% 18%, rgba(47, 115, 255, 0.12), transparent 26rem),
    #070b17;
}

body.landing-mode::before {
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.05) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.55), transparent 76%);
}

.landing-page {
  min-height: 100dvh;
  overflow-x: hidden;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.82) 0%, rgba(7, 11, 23, 0.98) 52%, #070b17 100%);
}

.landing-nav {
  display: flex;
  width: min(1240px, calc(100% - 48px));
  height: 64px;
  margin: 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.landing-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #ffffff;
  font-size: 16px;
  font-weight: 900;
}

.landing-logo {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(45, 212, 191, 0.26);
  border-radius: 10px;
  color: #5eead4;
  background: rgba(20, 184, 166, 0.12);
  box-shadow: 0 10px 26px rgba(20, 184, 166, 0.16);
}

.landing-links {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 6px;
  border: 1px solid rgba(148, 163, 184, 0.08);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.5);
}

.landing-links a,
.landing-ghost {
  min-height: 36px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  border: 0;
  border-radius: 9px;
  color: #cbd5e1;
  background: transparent;
  font-size: 14px;
  font-weight: 800;
}

.landing-links a:hover,
.landing-ghost:hover {
  color: #ffffff;
  background: rgba(45, 212, 191, 0.1);
}

.landing-actions,
.hero-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.landing-primary,
.landing-secondary {
  display: inline-flex;
  min-height: 40px;
  padding: 0 18px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 900;
  transition: transform 140ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.landing-primary {
  border: 1px solid rgba(45, 212, 191, 0.28);
  color: #042f2e;
  background: linear-gradient(180deg, #38f6db 0%, #14b8a6 100%);
  box-shadow: 0 18px 34px rgba(20, 184, 166, 0.26);
}

.landing-secondary {
  border: 1px solid rgba(45, 212, 191, 0.28);
  color: #eef8ff;
  background: rgba(15, 23, 42, 0.72);
}

.landing-primary:hover,
.landing-secondary:hover {
  transform: translateY(-1px);
}

.landing-primary.large,
.landing-secondary.large {
  min-height: 48px;
  padding: 0 24px;
}

.landing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 0.86fr);
  gap: 64px;
  width: min(1240px, calc(100% - 48px));
  min-height: 636px;
  margin: 0 auto;
  padding: 72px 0 64px;
  align-items: center;
}

.hero-copy,
.gateway-preview {
  min-width: 0;
}

.hero-pill {
  display: inline-flex;
  min-height: 28px;
  padding: 0 14px;
  align-items: center;
  border: 1px solid rgba(45, 212, 191, 0.28);
  border-radius: 999px;
  color: #5eead4;
  background: rgba(20, 184, 166, 0.1);
  font-size: 13px;
  font-weight: 900;
}

.hero-copy h1 {
  max-width: 720px;
  margin: 22px 0 0;
  color: #ffffff;
  font-size: clamp(48px, 7vw, 82px);
  line-height: 0.96;
  letter-spacing: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.hero-copy h1 span {
  display: block;
}

.hero-copy p {
  max-width: 650px;
  margin: 24px 0 0;
  color: #d4deec;
  font-size: 20px;
  line-height: 1.75;
}

.hero-actions {
  margin-top: 32px;
}

.hero-feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 32px;
}

.hero-feature-grid div {
  min-height: 88px;
  padding: 16px 18px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.62);
}

.hero-feature-grid strong,
.hero-feature-grid span {
  display: block;
}

.hero-feature-grid strong {
  color: #ffffff;
  font-size: 15px;
}

.hero-feature-grid span {
  margin-top: 8px;
  color: #98a8bc;
  font-size: 13px;
  line-height: 1.5;
}

.gateway-preview {
  overflow: hidden;
  border: 1px solid rgba(45, 212, 191, 0.18);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.92) 0%, rgba(15, 23, 42, 0.94) 100%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.02), 0 26px 80px rgba(20, 184, 166, 0.12);
}

.preview-head {
  display: flex;
  padding: 20px 22px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.preview-head strong,
.preview-head span {
  display: block;
}

.preview-head strong {
  color: #ffffff;
  font-size: 18px;
}

.preview-head span {
  margin-top: 6px;
  color: #9aa9bb;
}

.preview-head em {
  flex: 0 0 auto;
  padding: 6px 10px;
  border-radius: 999px;
  color: #5eead4;
  background: rgba(20, 184, 166, 0.12);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.preview-field {
  padding: 20px 22px 0;
}

.preview-field label {
  display: block;
  margin-bottom: 8px;
  color: #738197;
  font-size: 12px;
  font-weight: 900;
}

.preview-field code {
  display: block;
  overflow: hidden;
  padding: 14px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  color: #eaf2ff;
  background: rgba(2, 6, 23, 0.72);
  font-family: var(--mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-routes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 16px 22px;
}

.preview-routes div {
  padding: 14px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.72);
}

.preview-routes span,
.preview-routes strong {
  display: block;
}

.preview-routes span {
  color: #8796ac;
  font-size: 13px;
  font-weight: 800;
}

.preview-routes strong {
  margin-top: 8px;
  color: #ffffff;
  font-family: var(--mono);
  font-size: 13px;
}

.preview-code {
  margin: 0 22px 22px;
  padding: 16px;
  overflow-x: auto;
  border-radius: 8px;
  color: #e6edf8;
  background: #020617;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.7;
}

.landing-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid rgba(148, 163, 184, 0.14);
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(15, 23, 42, 0.72);
}

.landing-stats div {
  width: min(310px, 100%);
  min-height: 120px;
  margin: 0 auto;
  padding: 28px 24px;
}

.landing-stats span,
.landing-stats strong {
  display: block;
}

.landing-stats span {
  color: #90a0b5;
  font-size: 13px;
  font-weight: 800;
}

.landing-stats strong {
  margin-top: 10px;
  color: #ffffff;
  font-size: 28px;
}

.landing-section {
  width: min(1240px, calc(100% - 48px));
  margin: 0 auto;
  padding: 72px 0;
}

.section-kicker {
  color: #5eead4;
  font-size: 13px;
  font-weight: 900;
}

.landing-section h2 {
  max-width: 720px;
  margin: 14px 0 0;
  color: #ffffff;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.08;
  letter-spacing: 0;
}

.landing-section p {
  max-width: 560px;
  color: #a7b5c9;
  font-size: 16px;
  line-height: 1.75;
}

.problem-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 40px;
}

.problem-grid article,
.pricing-card {
  min-height: 170px;
  padding: 22px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.72);
}

.problem-grid span {
  display: block;
  color: #ffffff;
  font-size: 18px;
  font-weight: 900;
}

.problem-grid p {
  margin: 14px 0 0;
  color: #9aa9bb;
  font-size: 14px;
}

.landing-section.split,
.landing-section.pricing {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(360px, 1fr);
  gap: 48px;
  align-items: center;
}

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

.model-cloud span {
  padding: 12px 14px;
  border: 1px solid rgba(45, 212, 191, 0.2);
  border-radius: 999px;
  color: #d9fff9;
  background: rgba(20, 184, 166, 0.09);
  font-family: var(--mono);
  font-size: 13px;
}

.pricing-card span,
.pricing-card strong {
  display: block;
}

.pricing-card span {
  color: #5eead4;
  font-weight: 900;
}

.pricing-card strong {
  margin-top: 12px;
  color: #ffffff;
  font-size: 56px;
}

.pricing-card .landing-primary {
  margin-top: 12px;
}

.shell {
  min-height: 100dvh;
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(360px, 0.72fr);
  gap: 48px;
  width: min(1180px, calc(100% - 48px));
  min-height: 100dvh;
  margin: 0 auto;
  padding: 40px 0;
  align-items: center;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
}

.brand-sigil {
  display: grid;
  width: 36px;
  height: 36px;
  color: #fffdf8;
  place-items: center;
  border-radius: 10px;
  background: var(--ink);
  box-shadow: 0 12px 26px rgba(22, 23, 19, 0.18);
}

.auth-copy {
  max-width: 700px;
}

.eyebrow {
  margin: 80px 0 16px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.auth-copy h1 {
  max-width: 720px;
  margin: 0;
  font-size: clamp(42px, 6vw, 76px);
  line-height: 0.95;
  letter-spacing: 0;
}

.auth-copy h1 span,
.auth-copy h1 strong {
  display: block;
}

.auth-copy h1 span {
  margin-bottom: 16px;
  color: var(--teal);
  font-size: 18px;
  line-height: 1;
  font-weight: 900;
}

.auth-copy h1 strong {
  font: inherit;
}

.auth-copy p {
  max-width: 620px;
  margin: 24px 0 0;
  color: var(--ink-2);
  font-size: 18px;
  line-height: 1.75;
}

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

.proof {
  min-height: 112px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.72);
  backdrop-filter: blur(14px);
}

.proof strong {
  display: block;
  margin-bottom: 12px;
  font-size: 22px;
}

.proof span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.auth-panel {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 253, 248, 0.88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.auth-panel h2,
.panel-title h2 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 0;
}

.auth-panel p,
.panel-title p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.form {
  display: grid;
  gap: 16px;
  margin-top: 28px;
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 700;
}

.form-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.form-hint.strong {
  padding: 10px 12px;
  border: 1px solid rgba(12, 111, 104, 0.14);
  border-radius: var(--radius);
  color: var(--teal-2);
  background: var(--teal-soft);
  font-weight: 800;
}

.check-row {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-weight: 700;
}

.auth-switch {
  margin-top: 18px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.auth-switch button {
  min-height: 36px;
  margin-left: 4px;
  padding: 0 8px;
  border: 0;
  border-radius: 7px;
  color: var(--teal);
  background: transparent;
  font-weight: 900;
}

.auth-switch button:hover {
  background: var(--teal-soft);
}

.input {
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: none;
  background: #fffefa;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

textarea.input {
  min-height: 124px;
  padding: 12px 14px;
  resize: vertical;
}

.input:focus {
  border-color: rgba(12, 111, 104, 0.52);
  box-shadow: 0 0 0 4px rgba(12, 111, 104, 0.11);
}

.button {
  display: inline-flex;
  min-height: 40px;
  padding: 0 16px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 800;
  transition: transform 120ms ease, background 150ms ease, border-color 150ms ease, color 150ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

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

.button.primary {
  color: #fffdf8;
  background: var(--teal);
  box-shadow: 0 12px 28px rgba(12, 111, 104, 0.18);
}

.button.primary:hover {
  background: var(--teal-2);
}

.button.secondary {
  color: var(--ink);
  border-color: var(--line);
  background: rgba(255, 253, 248, 0.82);
}

.button.secondary:hover {
  border-color: rgba(12, 111, 104, 0.32);
  background: var(--teal-soft);
}

.button.ghost {
  color: var(--muted);
  background: transparent;
}

.button.danger {
  color: var(--red);
  border-color: rgba(180, 35, 24, 0.18);
  background: rgba(180, 35, 24, 0.06);
}

.button.full {
  width: 100%;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.app-layout {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  min-height: 100dvh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100dvh;
  padding: 24px 16px;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.78);
  backdrop-filter: blur(18px);
}

.nav {
  display: grid;
  gap: 6px;
  max-height: calc(100dvh - 280px);
  margin-top: 32px;
  padding-right: 2px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  min-height: 42px;
  padding: 0 12px;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  font-weight: 800;
  text-align: left;
}

.nav-item:hover {
  color: var(--ink);
  background: rgba(22, 23, 19, 0.04);
}

.nav-item.active {
  color: var(--teal-2);
  border-color: rgba(12, 111, 104, 0.12);
  background: var(--teal-soft);
}

.nav-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: rgba(22, 23, 19, 0.05);
  font-size: 12px;
}

.sidebar-footer {
  display: grid;
  gap: 10px;
  margin-top: auto;
}

.user-mini {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.76);
}

.user-mini strong,
.user-mini span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-mini span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.main {
  min-width: 0;
  padding: 24px;
}

.topbar {
  display: flex;
  min-height: 56px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.topbar h1 {
  margin: 0;
  font-size: 28px;
  letter-spacing: 0;
}

.topbar p {
  margin: 6px 0 0;
  color: var(--muted);
}

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

.grid {
  display: grid;
  gap: 16px;
}

.grid.cols-2 {
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr);
}

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

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.82);
  box-shadow: 0 14px 40px rgba(22, 23, 19, 0.06);
  backdrop-filter: blur(16px);
}

.panel.pad {
  padding: 20px;
}

.panel-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.app-mode .section-kicker {
  display: block;
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
}

.token-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
  background:
    linear-gradient(135deg, rgba(12, 111, 104, 0.12), transparent 36%),
    linear-gradient(315deg, rgba(178, 138, 54, 0.12), transparent 34%),
    rgba(255, 253, 248, 0.88);
}

.token-hero h2,
.token-create h2,
.model-head h2,
.doc-hero h2,
.doc-card h2 {
  margin: 8px 0 0;
  font-size: 24px;
  letter-spacing: 0;
}

.token-hero p,
.token-create p,
.model-head p,
.doc-hero p,
.endpoint-card p,
.model-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.token-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(88px, 1fr));
  gap: 8px;
  width: min(520px, 100%);
}

.token-stat-grid div {
  min-height: 74px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.72);
}

.token-stat-grid span,
.token-stat-grid strong {
  display: block;
}

.token-stat-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.token-stat-grid strong {
  margin-top: 8px;
  overflow: hidden;
  font-size: 20px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.token-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.36fr) minmax(320px, 0.64fr);
  gap: 16px;
  align-items: start;
}

.token-panel {
  overflow: hidden;
}

.token-list {
  display: grid;
  gap: 12px;
  padding: 0 16px 16px;
}

.token-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.72);
}

.token-card-main {
  min-width: 0;
}

.token-name-row,
.token-key-row,
.quota-line,
.token-meta,
.token-actions,
.model-card-top,
.doc-card-head,
.copy-row {
  display: flex;
  align-items: center;
}

.token-name-row {
  gap: 10px;
}

.token-name-row h3 {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-size: 16px;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(178, 138, 54, 0.12);
}

.status-dot.on {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(18, 115, 77, 0.12);
}

.status-dot.off {
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.1);
}

.token-key-row {
  gap: 10px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

.token-key-row code {
  min-width: 0;
  max-width: 460px;
  overflow: hidden;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(249, 246, 238, 0.72);
  font-family: var(--mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quota-line {
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 800;
}

.quota-track {
  height: 8px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(22, 23, 19, 0.08);
}

.quota-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--gold));
}

.quota-track.unlimited span {
  width: 100% !important;
  background: linear-gradient(90deg, rgba(12, 111, 104, 0.42), rgba(178, 138, 54, 0.42));
}

.token-meta {
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.token-actions {
  align-self: start;
  gap: 8px;
}

.token-create {
  position: sticky;
  top: 24px;
}

.model-browser {
  overflow: hidden;
}

.model-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
}

.model-search {
  display: flex;
  min-width: min(420px, 100%);
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.model-search .input {
  max-width: 300px;
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(249, 246, 238, 0.5);
}

.filter-pill {
  display: inline-flex;
  min-height: 36px;
  padding: 0 12px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink-2);
  background: rgba(255, 253, 248, 0.76);
  font-size: 13px;
  font-weight: 900;
}

.filter-pill span {
  color: var(--muted);
  font-size: 12px;
}

.filter-pill:hover,
.filter-pill.active {
  color: var(--teal-2);
  border-color: rgba(12, 111, 104, 0.26);
  background: var(--teal-soft);
}

.model-square {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  padding: 20px;
}

.model-card {
  min-height: 154px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.74);
}

.model-card:hover {
  border-color: rgba(12, 111, 104, 0.24);
  background: rgba(255, 253, 248, 0.92);
}

.model-card-top {
  justify-content: space-between;
  gap: 10px;
}

.model-family,
.model-endpoint {
  display: inline-flex;
  min-height: 24px;
  padding: 0 8px;
  align-items: center;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.model-family {
  color: var(--teal-2);
  background: var(--teal-soft);
}

.model-family.media {
  color: #7a4b00;
  background: rgba(178, 138, 54, 0.14);
}

.model-family.code {
  color: #245a86;
  background: rgba(36, 90, 134, 0.12);
}

.model-family.claude,
.model-family.deepseek {
  color: #6a4631;
  background: rgba(106, 70, 49, 0.1);
}

.model-endpoint {
  color: var(--muted);
  border: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.72);
}

.model-card h3 {
  margin: 18px 0 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1.35;
}

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

.audit-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.metric.compact {
  padding: 16px;
}

.metric.compact strong {
  font-size: 24px;
}

.panel-title.flush {
  padding: 0 0 16px;
  border-bottom: 0;
}

.billing-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(520px, 1.1fr);
  gap: 24px;
  align-items: center;
  margin-bottom: 16px;
  background:
    linear-gradient(135deg, rgba(12, 111, 104, 0.12), transparent 38%),
    linear-gradient(315deg, rgba(178, 138, 54, 0.1), transparent 36%),
    rgba(255, 253, 248, 0.88);
}

.billing-hero h2 {
  margin: 8px 0 0;
  font-size: 24px;
  letter-spacing: 0;
}

.billing-hero p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

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

.billing-metrics div,
.billing-rules div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.74);
}

.billing-metrics span,
.billing-metrics strong,
.billing-metrics small,
.billing-rules span,
.billing-rules strong {
  display: block;
}

.billing-metrics span,
.billing-rules span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.billing-metrics strong,
.billing-rules strong {
  margin-top: 8px;
  overflow: hidden;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.billing-rules strong {
  white-space: normal;
}

.billing-metrics small {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.billing-grid {
  margin-top: 16px;
}

.wallet-bar {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(22, 23, 19, 0.08);
}

.wallet-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.wallet-used {
  background: linear-gradient(90deg, var(--teal), var(--gold));
}

.wallet-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.wallet-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
}

.legend-dot.allocated {
  background: var(--teal);
}

.legend-dot.free {
  background: rgba(22, 23, 19, 0.16);
}

.allocation-list,
.usage-list,
.billing-rules {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

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

.allocation-item {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.72);
}

.allocation-item div {
  min-width: 0;
}

.allocation-item strong,
.allocation-item span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.allocation-item strong {
  font-size: 14px;
}

.allocation-item span {
  margin-top: 4px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
}

.allocation-item b {
  flex: 0 0 auto;
  font-size: 14px;
}

.usage-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.72);
}

.usage-row {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.usage-row strong {
  min-width: 0;
  overflow: hidden;
  font-family: var(--mono);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.usage-row span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.usage-meter {
  height: 7px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(22, 23, 19, 0.08);
}

.usage-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

.usage-meta {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.pricing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.62fr);
  gap: 24px;
  align-items: center;
  margin-bottom: 16px;
}

.pricing-hero h2,
.announcement-card h2 {
  margin: 8px 0 0;
  font-size: 24px;
  letter-spacing: 0;
}

.pricing-hero p,
.announcement-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.pricing-formula,
.balance-focus {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(249, 246, 238, 0.72);
}

.pricing-formula span,
.pricing-formula strong,
.pricing-formula small,
.balance-focus span,
.balance-focus strong,
.balance-focus small {
  display: block;
}

.pricing-formula span,
.balance-focus span {
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
}

.pricing-formula strong,
.balance-focus strong {
  margin-top: 8px;
  font-size: 24px;
  line-height: 1.2;
}

.pricing-formula small,
.balance-focus small {
  margin-top: 8px;
  color: var(--muted);
}

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

.plan-card,
.family-price-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.82);
  box-shadow: 0 14px 40px rgba(22, 23, 19, 0.04);
}

.plan-card span,
.plan-card strong,
.plan-card small,
.family-price-card span,
.family-price-card strong,
.family-price-card small {
  display: block;
}

.plan-card span,
.family-price-card span {
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
}

.plan-card strong,
.family-price-card strong {
  margin-top: 10px;
  font-size: 26px;
}

.plan-card p {
  min-height: 44px;
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.plan-card small,
.family-price-card small {
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

.family-price-grid,
.step-list,
.security-list,
.action-stack,
.faq-list {
  display: grid;
  gap: 10px;
}

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

.step-list div,
.security-list div,
.faq-list div {
  display: flex;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.72);
}

.step-list div {
  align-items: center;
}

.step-list b {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 999px;
  color: #fffdf8;
  background: var(--teal);
  font-size: 13px;
}

.step-list span,
.faq-list span {
  color: var(--muted);
  line-height: 1.55;
}

.copy-block {
  display: grid;
  gap: 12px;
}

.copy-block pre {
  overflow-x: auto;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(249, 246, 238, 0.72);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.65;
}

.security-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.55fr);
  gap: 16px;
}

.security-list div {
  align-items: center;
  justify-content: space-between;
}

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

.security-list strong {
  font-size: 14px;
}

.action-stack .button {
  width: 100%;
}

.announcement-list {
  display: grid;
  gap: 16px;
}

.announcement-card span {
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
}

.faq-list div {
  align-items: flex-start;
  flex-direction: column;
}

.faq-list strong {
  font-size: 15px;
}

.empty.compact {
  padding: 24px 12px;
}

.doc-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.72fr);
  gap: 20px;
  align-items: center;
  margin-bottom: 16px;
}

.copy-row {
  min-width: 0;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(249, 246, 238, 0.72);
}

.copy-row code {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  font-family: var(--mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.endpoint-grid,
.doc-grid {
  display: grid;
  gap: 16px;
}

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

.endpoint-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.82);
  box-shadow: 0 14px 40px rgba(22, 23, 19, 0.04);
}

.endpoint-card span {
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
}

.endpoint-card strong {
  display: block;
  margin-top: 10px;
  overflow-wrap: anywhere;
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.4;
}

.endpoint-card p {
  font-size: 13px;
}

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

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

.doc-card-head {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.metric {
  padding: 20px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.metric strong {
  display: block;
  margin-top: 12px;
  font-size: 30px;
  letter-spacing: 0;
}

.metric small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.table-wrap {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table th,
.table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(249, 246, 238, 0.78);
}

.table tr:hover td {
  background: rgba(12, 111, 104, 0.045);
}

.code {
  display: block;
  overflow-x: auto;
  padding: 16px;
  color: #efe9da;
  border-radius: var(--radius);
  background: #161713;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.65;
}

.inline-code {
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 253, 248, 0.78);
  font-family: var(--mono);
  font-size: 12px;
}

.badge {
  display: inline-flex;
  min-height: 26px;
  padding: 0 9px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 253, 248, 0.74);
  font-size: 12px;
  font-weight: 800;
}

.badge.good {
  color: var(--green);
  border-color: rgba(18, 115, 77, 0.18);
  background: rgba(18, 115, 77, 0.08);
}

.badge.warn {
  color: var(--gold);
  border-color: rgba(178, 138, 54, 0.24);
  background: rgba(178, 138, 54, 0.1);
}

.models {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
}

.model-chip {
  overflow: hidden;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.72);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 12px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.empty {
  padding: 44px 20px;
  color: var(--muted);
  text-align: center;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 50;
  width: min(420px, calc(100% - 40px));
  padding: 14px 16px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

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

.mobile-bar {
  display: none;
}

.hide {
  display: none !important;
}

@media (max-width: 980px) {
  .landing-nav {
    width: calc(100vw - 32px);
    max-width: calc(100vw - 32px);
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    overflow: hidden;
  }

  .landing-actions {
    min-width: 0;
    justify-self: end;
  }

  .landing-links {
    display: none;
  }

  .landing-hero,
  .landing-section.split,
  .landing-section.pricing {
    grid-template-columns: 1fr;
  }

  .landing-hero {
    width: min(100% - 32px, 720px);
    max-width: calc(100vw - 32px);
    gap: 32px;
    padding: 48px 0;
  }

  .hero-copy h1 {
    width: calc(100vw - 32px);
    font-size: clamp(34px, 10vw, 44px);
    line-height: 1;
    max-width: calc(100vw - 32px);
    word-break: break-all;
  }

  .hero-copy p {
    width: calc(100vw - 32px);
    max-width: calc(100vw - 32px);
    overflow-wrap: anywhere;
    word-break: break-all;
  }

  .gateway-preview {
    order: 2;
  }

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

  .landing-section {
    width: min(100% - 32px, 720px);
    padding: 56px 0;
  }

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

  .auth-copy h1 {
    font-size: clamp(36px, 12vw, 56px);
  }

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

  .app-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 30;
    width: 280px;
    transform: translateX(-100%);
    transition: transform 180ms ease;
  }

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

  .mobile-bar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    padding: 12px 16px;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 253, 248, 0.86);
    backdrop-filter: blur(16px);
  }

  .main {
    padding: 16px;
  }

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

  .token-hero,
  .model-head,
  .billing-hero,
  .pricing-hero,
  .doc-hero {
    align-items: stretch;
    flex-direction: column;
    grid-template-columns: 1fr;
  }

  .token-stat-grid,
  .billing-metrics,
  .billing-rules,
  .plan-grid,
  .family-price-grid,
  .security-grid,
  .endpoint-grid,
  .doc-grid,
  .audit-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .token-layout {
    grid-template-columns: 1fr;
  }

  .token-create {
    position: static;
  }

  .model-search {
    justify-content: flex-start;
  }

  .model-search .input {
    max-width: none;
  }
}

@media (max-width: 640px) {
  .landing-actions .landing-ghost {
    display: none;
  }

  .landing-nav > .landing-actions {
    display: none;
  }

  .landing-actions .landing-primary {
    min-height: 38px;
    padding: 0 14px;
    font-size: 13px;
    white-space: nowrap;
  }

  .hero-actions,
  .landing-actions {
    align-items: stretch;
  }

  .hero-actions {
    flex-direction: column;
  }

  .hero-feature-grid,
  .landing-stats,
  .problem-grid,
  .preview-routes {
    grid-template-columns: 1fr;
  }

  .preview-code {
    white-space: pre-wrap;
    word-break: break-all;
  }

  .gateway-preview,
  .preview-field code,
  .preview-routes,
  .preview-code {
    max-width: 100%;
  }

  .landing-stats div {
    min-height: auto;
    padding: 20px 24px;
  }

  .auth-shell {
    width: min(100% - 32px, 520px);
    padding: 24px 0;
  }

  .proof-grid {
    display: none;
  }

  .auth-panel {
    padding: 20px;
  }

  .top-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .top-actions .button {
    flex: 1;
  }

  .token-stat-grid,
  .billing-metrics,
  .billing-rules,
  .plan-grid,
  .family-price-grid,
  .security-grid,
  .endpoint-grid,
  .doc-grid,
  .audit-strip,
  .model-square {
    grid-template-columns: 1fr;
  }

  .token-card,
  .copy-row {
    grid-template-columns: 1fr;
  }

  .token-card {
    display: block;
  }

  .token-actions {
    margin-top: 14px;
  }

  .token-actions .button,
  .copy-row .button {
    flex: 1;
  }

  .token-key-row,
  .quota-line,
  .doc-card-head,
  .copy-row {
    align-items: stretch;
    flex-direction: column;
  }

  .token-key-row code {
    max-width: 100%;
  }
}
