:root {
  color-scheme: dark;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: #060e14;
  color: #f1f6f5;
  --ink: #f1f6f5;
  --muted: #a8b6bc;
  --line: #26373d;
  --surface: #0d181e;
  --raised: #142129;
  --accent: #75d1ad;
  --accent-hover: #91e1c1;
  --accent-ink: #092019;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 300px; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
button, input { font: inherit; }
button { cursor: pointer; }
a { color: var(--accent); text-underline-offset: 4px; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--accent-hover); outline-offset: 4px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(2.2rem, 4.4vw, 3.6rem); font-weight: 760; line-height: 1.04; letter-spacing: -.046em; }
h2 { font-size: 1.34rem; line-height: 1.22; letter-spacing: -.025em; }
p, dd { line-height: 1.55; }
code, pre { font-family: Consolas, "Cascadia Code", monospace; }
.shell { width: min(1280px, calc(100% - 64px)); margin-inline: auto; }
.muted { color: var(--muted); }

.topbar, .footer { background: #0a141a; }
.topbar { border-bottom: 1px solid var(--line); }
.topbar-inner, .footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px 28px; }
.topbar-inner { min-height: 78px; }
.brand { color: var(--ink); font-size: 1.12rem; font-weight: 800; letter-spacing: -.025em; text-transform: uppercase; display: inline-flex; align-items: center; gap: 10px; text-decoration: none; white-space: nowrap; }
.brand:hover { color: var(--ink); }
.brand b { display: inline-block; margin-left: 3px; padding: 0 5px; border: 1px solid #49786b; border-radius: 4px; color: var(--accent); font-size: .88em; }
.brand-mark { position: relative; display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid #477369; border-radius: 50%; background: linear-gradient(145deg, #224a41, #102327); }
.brand-mark::before { content: ""; width: 14px; height: 18px; border: solid var(--accent); border-width: 0 3px 3px 0; transform: translate(-1px, -2px) rotate(45deg); border-radius: 1px; }
.brand-mark::after { content: ""; width: 4px; height: 4px; position: absolute; right: 8px; top: 8px; border-radius: 50%; background: #d1f6e7; }
.nav, .footer nav { display: flex; align-items: center; gap: clamp(12px, 2.4vw, 30px); }
.nav a, .quiet, .footer a { color: var(--muted); font-size: .94rem; text-decoration: none; font-weight: 640; }
.nav a:hover, .quiet:hover, .nav a[aria-current], .footer a:hover { color: var(--accent-hover); }
.nav a.nav-cta { color: var(--accent-ink); }
.quiet, .text-button { padding: 0; border: 0; background: transparent; }
.text-button { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }
.text-button:hover { color: var(--accent-hover); }
.footer { margin-top: 52px; border-top: 1px solid var(--line); }
.footer-inner { min-height: 84px; padding-block: 16px; }
.footer .footer-store { color: var(--ink); font-weight: 750; }

.button { display: inline-flex; justify-content: center; align-items: center; min-height: 46px; padding: 10px 17px; border: 1px solid transparent; border-radius: 10px; text-decoration: none; font-size: .94rem; font-weight: 720; line-height: 1.25; text-align: center; white-space: nowrap; }
.primary { background: var(--accent); color: var(--accent-ink); box-shadow: inset 0 -3px #215c4c4f; }
.primary:hover { background: var(--accent-hover); color: var(--accent-ink); }
.outline { background: #14232bd9; color: var(--ink); border-color: #34474e; }
.outline:hover { background: #22363e; color: var(--ink); border-color: #567078; }
.compact { min-height: 39px; padding: 6px 11px; border-radius: 8px; font-size: .875rem; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }

.home { padding-top: 30px; }
.hero { position: relative; isolation: isolate; overflow: hidden; display: grid; align-items: center; min-height: 390px; padding: clamp(28px, 4.5vw, 63px); border: 1px solid var(--line); border-radius: 25px; background: #081216; }
.hero-art { position: absolute; z-index: -2; inset: 0 0 0 auto; width: min(72%, 920px); height: 100%; object-fit: cover; object-position: center 49%; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, #0b171d 0%, #0b171df7 29%, #0b171d72 56%, transparent 80%); }
.hero h1 { font-size: clamp(2.4rem, 5.2vw, 4.35rem); }
.hero h1 span { color: var(--accent); }
.hero p { max-width: 510px; margin: 19px 0 25px; color: #c9d4d8; font-size: 1.12rem; }
.hero .button { min-height: 48px; }
.packages { margin-top: 36px; scroll-margin-top: 20px; }
.catalog-heading { margin-bottom: 15px; display: flex; align-items: baseline; flex-wrap: wrap; gap: 5px 20px; }
.catalog-heading h2 { font-size: clamp(1.65rem, 3.6vw, 2.15rem); }
.catalog-heading p, .catalog-checkout p { color: var(--muted); }
.catalog-panel + .catalog-panel { margin-top: 15px; }
.catalog-panel h3 { margin: 0 0 13px; }
.package-list { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.package-list li { padding: 12px 15px; border: 1px solid var(--line); border-radius: 11px; background: var(--raised); }
.package-list strong, .package-list span { display: block; }
.package-list strong { color: var(--accent); font-size: clamp(1.1rem, 2.2vw, 1.55rem); font-weight: 740; letter-spacing: -.03em; }
.package-list span { color: var(--muted); font-size: .88rem; }
.catalog-checkout { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 17px; }

.narrow { width: min(512px, calc(100% - 36px)); padding-top: clamp(30px, 7vw, 78px); }
.panel { min-width: 0; padding: clamp(16px, 2.6vw, 26px); border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.auth { padding: clamp(25px, 5vw, 40px); }
.auth h1 { font-size: clamp(1.85rem, 4vw, 2.45rem); }
.auth h1 + p, .auth .actions, .auth p + a { margin-top: 14px; }
.auth-links { color: var(--muted); margin-top: 20px; }
.form { display: grid; gap: 15px; margin-top: 22px; }
.form label, .connection label { font-size: .94rem; font-weight: 680; }
input:not([type="hidden"]) { display: block; background: #081218; border: 1px solid #344950; border-radius: 9px; padding: 10px 11px; width: 100%; min-width: 0; color: var(--ink); }
.form label input { margin-top: 6px; }
.field-hint { font-size: .88rem; color: var(--muted); margin-top: -8px; }
.notice { padding: 11px 15px; border: 1px solid #36505d; border-radius: 10px; margin-bottom: 14px; background: #152731; color: #cfe8f2; }
.notice.success { background: #112c25; border-color: #315f50; color: #b0ead7; }
.notice.error { background: #321e22; border-color: #653a42; color: #ffd0cc; }

.dashboard { padding-top: 36px; }
.page-heading { margin-bottom: 23px; }
.page-heading p { margin-top: 7px; overflow-wrap: anywhere; }
.section-heading, .connection-actions { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.summary-grid { display: grid; grid-template-columns: .95fr 1.55fr; gap: 15px; }
.balance { background: radial-gradient(ellipse at 100% 0%, #224237, transparent 70%), #101e24; border: 1px solid #35544b; border-radius: 18px; padding: clamp(19px, 3vw, 34px); }
.balance h2 { font-size: 1rem; color: #c0d6cf; }
.balance-number { font-size: clamp(1.85rem, 5.1vw, 3.6rem); line-height: 1.1; letter-spacing: -.07em; margin-top: 20px; font-weight: 760; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.balance-unit { color: #b9d2ca; margin: 5px 0 20px; }
.connection h2, .guide h2 { margin-bottom: 12px; }
.copy-row { display: flex; gap: 6px; margin: 5px 0 11px; }
.copy-row input { font-family: Consolas, monospace; font-size: .89rem; }
.copy-row .button { flex: 0 0 auto; }
.connection-actions { flex-wrap: wrap; font-size: .88rem; margin-top: 15px; }
.history, .guide { margin-top: 15px; scroll-margin-top: 15px; }
.section-heading p { margin-top: 6px; font-size: .91rem; }
.table-scroll { overflow-x: auto; margin-top: 16px; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--line); }
th { color: #c0cdd2; font-weight: 650; background: var(--raised); }
.numeric { text-align: right; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.model-cell { font-family: Consolas, monospace; }
.status { padding: 3px 8px; border-radius: 12px; display: inline-block; white-space: nowrap; background: #20313a; color: #d4e3e5; }
.status.success { background: #1a3a30; color: #b6ebd7; }
.status.failed, .status.invalid_usage { background: #3b2227; color: #ffd0cc; }
.pagination { display: flex; gap: 14px; margin-top: 14px; }
.empty { margin-top: 16px; padding: 23px; border-radius: 11px; border: 1px dashed #334950; background: #09141a; text-align: center; }
.empty p { margin-bottom: 4px; font-weight: 650; }
.endpoints { display: grid; gap: 9px; }
.endpoints div { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; }
.endpoints dd { margin: 0; color: var(--muted); font-size: .94rem; }
.endpoints code { padding: 3px 6px; background: #1a362f; color: #bbead7; border-radius: 5px; font-size: .88rem; }
.model-list { display: flex; flex-wrap: wrap; gap: 8px; }
.model-list > span { border: 1px solid var(--line); border-radius: 7px; padding: 6px 10px; background: var(--raised); font-size: .9rem; }
.sample { border: 1px solid var(--line); background: #081217; color: #e6f5f0; border-radius: 10px; overflow: hidden; margin-top: 16px; }
.sample-header { padding: 9px 12px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sample pre { margin: 0; padding: 14px 12px; overflow-x: auto; font-size: .89rem; line-height: 1.55; }

@media (max-width: 820px) {
  .shell { width: calc(100% - 36px); }
  .summary-grid { grid-template-columns: 1fr; }
  .package-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .shell { width: calc(100% - 28px); }
  .narrow { width: min(512px, calc(100% - 28px)); }
  .topbar-inner { min-height: 65px; }
  .brand-mark { width: 29px; height: 29px; }
  .brand-mark::before { width: 10px; height: 14px; }
  .brand-mark::after { right: 6px; top: 6px; }
  .brand { gap: 6px; font-size: .95rem; }
  .nav a[href="/#packages"] { display: none; }
  .nav, .footer nav { gap: 10px; }
  .nav a, .quiet, .footer a { font-size: .88rem; }
  .nav-cta { min-height: 38px; padding-inline: 10px; }
  .home { padding-top: 18px; }
  .hero { min-height: 0; padding: 174px 20px 25px; border-radius: 18px; }
  .hero-art { inset: 0 0 auto; width: 100%; height: 230px; object-position: center 48%; }
  .hero::before { background: linear-gradient(0deg, #0b171d 38%, #0b171d 45%, #0b171d18 75%, transparent 100%); }
  .hero h1 { font-size: clamp(2.05rem, 8.5vw, 3.2rem); }
  .hero p { margin: 13px 0 18px; font-size: 1rem; }
  .desktop-break { display: none; }
  .packages { margin-top: 24px; }
  .package-list { gap: 7px; }
  .package-list li { padding: 9px 8px; }
  .page-heading { margin-bottom: 17px; }
  .footer-inner { align-items: start; flex-direction: column; justify-content: center; }
}

@media (max-width: 390px) {
  .topbar-inner { gap: 8px; }
  .brand-mark { display: none; }
  .nav a[href="/activate"] { display: none; }
  .copy-row { flex-wrap: wrap; }
  .copy-row input { flex: 1 0 100%; }
}
