:root {
  --bg: #f4f7f8;
  --surface: #ffffff;
  --surface-2: #eef3f4;
  --border: #d7e0e4;
  --border-strong: #b8c6cc;
  --ink: #18232b;
  --muted: #5b6870;
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --accent-soft: #dbeafe;
  --warn: #b45309;
  --warn-soft: #fdf0d7;
  --danger: #c53030;
  --danger-soft: #fdeaea;
  --ok: #15803d;
  --ok-soft: #e3f4e8;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(15, 30, 40, 0.06), 0 8px 24px rgba(15, 30, 40, 0.05);
  --shadow-strong: 0 2px 4px rgba(15, 30, 40, 0.08), 0 16px 36px rgba(15, 30, 40, 0.1);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
}

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

a:hover {
  color: var(--accent-strong);
}

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

button {
  cursor: pointer;
}

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 1px 2px rgba(15, 30, 40, 0.04);
}

.site-header .inner,
.wrap {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header .inner {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.site-nav {
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--muted);
  font-weight: 600;
  padding: 6px 8px;
  border-radius: 6px;
}

.site-nav a:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 15px;
}

.brand-mark {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  box-shadow: 0 4px 10px -4px rgba(37, 99, 235, 0.7);
}

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

.wrap {
  padding: 26px 0 64px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  white-space: nowrap;
  transition: background 120ms ease, border-color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}

.button:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 6px 14px -10px rgba(37, 99, 235, 0.8);
}

.button:active {
  transform: translateY(1px);
  box-shadow: none;
}

.button:focus-visible,
.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible,
.tab:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.5);
  outline-offset: 2px;
}

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

.button.primary:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  box-shadow: 0 8px 18px -10px rgba(37, 99, 235, 0.9);
}

.button.danger {
  color: var(--danger);
  border-color: #efb7b7;
  background: #fff;
}

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

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

.button.ghost:hover {
  background: var(--accent-soft);
}

.button.small {
  min-height: 30px;
  padding: 0 10px;
  font-size: 13px;
}

.button.icon-only {
  width: 34px;
  padding: 0;
}

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

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: center;
  padding: 28px 30px;
  border-radius: var(--radius);
  background: #172554;
  color: #eef7f7;
  position: relative;
  overflow: hidden;
  margin-bottom: 22px;
  box-shadow: var(--shadow);
}

.hero::after {
  content: "API";
  position: absolute;
  right: 18px;
  bottom: -30px;
  font-size: 150px;
  font-weight: 900;
  line-height: 1;
  color: rgba(255, 255, 255, 0.045);
  pointer-events: none;
  user-select: none;
  letter-spacing: 0;
}

.hero-copy,
.hero-stats {
  position: relative;
  z-index: 1;
}

.hero-copy {
  min-width: 0;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #d7f1ed;
  font-size: 12px;
  font-weight: 700;
}

.hero h1 {
  margin: 12px 0 8px;
  font-size: 30px;
  line-height: 1.2;
  color: #fff;
}

.hero p {
  margin: 0;
  max-width: 620px;
  color: #c6dcdd;
  font-size: 14px;
}

.hero-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.hero-meta code {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.16);
  color: #dff5f2;
}

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

.hero-stats div {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 14px 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(6px);
}

.hero-stats span {
  font-size: 23px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.hero-stats label {
  color: #bfd4d6;
  font-size: 12px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin: 24px 0 14px;
}

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

#plans,
#usage,
#recharge,
#account,
#docs {
  scroll-margin-top: 76px;
}

.usage-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 28px;
  align-items: center;
  padding: 22px;
  margin-bottom: 20px;
}

.usage-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
}

.usage-copy h2 {
  margin: 12px 0 8px;
}

.usage-copy p {
  margin: 0 0 14px;
  color: var(--muted);
}

.usage-metrics {
  display: grid;
  gap: 10px;
}

.usage-metrics div {
  display: grid;
  gap: 2px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.usage-metrics strong {
  font-size: 14px;
}

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

.plans-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.plan-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.plan-card:hover {
  border-color: #9bc8c1;
  box-shadow: var(--shadow-strong);
  transform: translateY(-2px);
}

.plan-card.featured {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12), var(--shadow);
}

.plan-card.selected {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent), var(--shadow);
}

.plan-card.selected .button {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.plan-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.plan-top strong {
  font-size: 15px;
}

.plan-tag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.plan-card.featured .plan-tag {
  background: #fdf0d7;
  color: var(--warn);
}

.plan-price {
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.plan-currency {
  font-size: 15px;
  vertical-align: top;
  margin-right: 2px;
}

.plan-card p {
  min-height: 42px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.plan-card .button {
  width: 100%;
  margin-top: auto;
}

.purchase-panel {
  padding: 20px;
  margin-bottom: 20px;
}

.purchase-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.purchase-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  grid-column: 1 / -1;
}

.payment-hint {
  color: var(--muted);
  font-size: 12px;
}

.console-band {
  padding: 20px;
}

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

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 24px;
  line-height: 1.25;
}

h2 {
  font-size: 18px;
  line-height: 1.3;
}

h3 {
  font-size: 14px;
}

.base-url {
  margin: 6px 0 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 13px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.badge.ok {
  color: var(--ok);
  background: var(--ok-soft);
  border-color: #bcddc5;
}

.badge.warn {
  color: var(--warn);
  background: var(--warn-soft);
  border-color: #ecd7a8;
}

.badge.danger {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: #efc3c3;
}

.console-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 0.7fr);
  gap: 12px;
  align-items: start;
}

.field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.field.full {
  grid-column: 1 / -1;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 7px 10px;
  outline: none;
}

.field textarea {
  min-height: 78px;
  resize: vertical;
  font-family: var(--sans);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.field input::placeholder,
.field select::placeholder,
.field textarea::placeholder {
  color: #93a0a7;
}

.console-actions {
  display: flex;
  gap: 8px;
  grid-column: 1 / -1;
}

.output {
  margin: 16px 0 0;
  min-height: 132px;
  max-height: 340px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #0f172a;
  color: #d6e4e8;
  padding: 14px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.account-panel {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-2);
}

.account-item {
  display: grid;
  gap: 3px;
}

.account-item strong {
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}

.quickstart,
.models-band,
.recharge-band {
  margin-top: 20px;
  padding: 20px;
}

.quickstart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.tabs {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 7px;
}

.tab {
  min-height: 28px;
  padding: 0 11px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  transition: background 120ms ease, color 120ms ease;
}

.tab.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(15, 30, 40, 0.12);
}

.code-block {
  margin: 0;
  padding: 16px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #0f172a;
  color: #d6e4e8;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

.recharge-grid {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  align-items: end;
}

.recharge-action {
  display: flex;
  align-items: center;
}

.recharge-action .button {
  min-width: 108px;
}

#rechargeOrderPanel {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

#rechargeOrderPanel .recharge-action {
  grid-column: 1 / -1;
}

.account-band {
  padding: 20px;
  margin-bottom: 20px;
}

.account-query {
  display: grid;
  grid-template-columns: minmax(220px, 420px) auto;
  gap: 12px;
  align-items: end;
}

.account-query .button {
  min-height: 36px;
}

.account-panel {
  background: #f7fbfa;
}

.account-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.account-metrics div {
  display: grid;
  gap: 3px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.account-metrics strong {
  font-size: 19px;
  font-variant-numeric: tabular-nums;
}

.account-keys-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0 12px;
}

.account-keys-head h3 {
  margin: 0 0 2px;
  font-size: 15px;
}

.account-keys-head .muted {
  font-size: 12px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
}

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

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

th {
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

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

tbody tr:hover td {
  background: #f8fbfb;
}

code {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
}

.model-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

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

/* Admin */
.admin-shell {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  min-height: 100vh;
}

.admin-sidebar {
  background: #1e293b;
  color: #dbe7ea;
  padding: 18px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.admin-sidebar .brand {
  color: #fff;
  margin: 0 6px 20px;
}

.admin-nav {
  display: grid;
  gap: 4px;
}

.admin-nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #aebfc6;
  font-weight: 600;
  text-align: left;
}

.admin-nav button:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.admin-nav button.active {
  background: rgba(37, 99, 235, 0.28);
  color: #fff;
}

.admin-nav svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.admin-sidebar .logout {
  margin-top: 22px;
}

.admin-main {
  padding: 26px 28px 60px;
  min-width: 0;
}

.admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
}

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

.stat-card {
  padding: 14px 16px;
}

.stat-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.stat-value {
  margin-top: 4px;
  font-size: 22px;
  font-weight: 750;
  letter-spacing: 0;
}

.stat-note {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

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

.form-grid .field.full {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  gap: 8px;
  grid-column: 1 / -1;
}

.key-form {
  margin-bottom: 18px;
  padding: 18px;
}

.key-reveal {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid #a8d5cf;
  border-radius: 6px;
  background: var(--accent-soft);
}

.key-reveal .key-value {
  font-family: var(--mono);
  font-size: 13px;
  word-break: break-all;
  margin: 6px 0;
}

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

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.pill.on {
  background: var(--ok-soft);
  color: var(--ok);
}

.pill.off {
  background: var(--danger-soft);
  color: var(--danger);
}

.pill.warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.settings-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.section {
  margin-bottom: 20px;
  padding: 18px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(380px, 100%);
  padding: 26px;
}

.login-card h1 {
  font-size: 20px;
  margin-bottom: 18px;
}

.notice {
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13px;
  margin-top: 10px;
}

.notice.error {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid #efc3c3;
}

.notice.ok {
  background: var(--ok-soft);
  color: var(--ok);
  border: 1px solid #bcddc5;
}

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

.log-status {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
}

.hidden {
  display: none !important;
}

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

.hero-actions .button.ghost {
  color: #d7f1ed;
  border-color: rgba(255, 255, 255, 0.35);
  background: transparent;
}

.hero-actions .button.ghost:hover {
  background: rgba(255, 255, 255, 0.1);
}

.landing-band {
  margin-bottom: 22px;
}

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

.benefit-card {
  display: grid;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.benefit-card strong {
  font-size: 15px;
}

.benefit-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.benefit-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
}

.model-preview {
  margin-top: 12px;
  padding: 20px;
}

.model-preview h3 {
  margin: 0 0 14px;
}

.contact-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 20px;
  margin-top: 20px;
}

.contact-band h2 {
  margin: 10px 0 6px;
}

.contact-band p {
  margin: 0;
  color: var(--muted);
}

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

.usage-note {
  display: grid;
  gap: 3px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.usage-note strong {
  font-size: 13px;
}

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

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

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 18px 0;
}

.site-footer .inner {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.login-wrap {
  min-height: calc(100vh - 120px);
  display: grid;
  place-items: start center;
  padding-top: 64px;
}

.login-wrap .login-card {
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
}

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

.login-brand h1 {
  font-size: 20px;
}

.login-brand p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.login-actions .button {
  width: 100%;
  min-height: 40px;
}

.login-modes {
  width: 100%;
}

.login-modes .tab {
  flex: 1;
}

.login-help {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px dashed var(--border-strong);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .usage-band {
    grid-template-columns: 1fr;
    gap: 16px;
  }

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

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

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

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

  .admin-sidebar {
    position: static;
    height: auto;
  }

  .admin-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .admin-nav button {
    justify-content: center;
  }

  .admin-sidebar .logout {
    margin-top: 10px;
  }

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

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

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

  .contact-band {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .wrap {
    width: min(100% - 20px, 1120px);
  }

  .site-header .inner {
    flex-wrap: wrap;
    padding: 8px 0;
  }

  .site-nav {
    width: 100%;
    justify-content: flex-end;
  }

  .site-nav a {
    padding: 5px 7px;
    font-size: 13px;
  }

  .site-nav .button {
    min-height: 28px;
    padding: 0 9px;
    font-size: 13px;
  }

  .console-grid,
  .form-grid,
  .settings-row,
  .recharge-grid,
  .purchase-grid,
  #rechargeOrderPanel {
    grid-template-columns: 1fr;
  }

  .console-actions,
  .form-actions {
    flex-direction: column;
  }

  .console-actions .button,
  .form-actions .button {
    width: 100%;
  }

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

  .hero {
    padding: 22px 18px;
  }

  .hero h1 {
    font-size: 25px;
  }

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

  .hero-stats div {
    padding: 12px 8px;
  }

  .hero-stats span {
    font-size: 19px;
  }

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

  .purchase-actions {
    align-items: stretch;
    flex-direction: column;
  }

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

  .account-query {
    grid-template-columns: 1fr;
  }

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

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

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

  .purchase-grid-logged {
    grid-template-columns: 1fr;
  }

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

  .admin-main {
    padding: 18px 14px 40px;
  }

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

  .site-header .inner {
    min-height: 52px;
  }
}
