:root {
  color-scheme: light;
  --ink: #1f2933;
  --muted: #667085;
  --line: #d7dde5;
  --surface: #ffffff;
  --wash: #f5f7fa;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --coin: #b7791f;
  --button-ink: #ffffff;
  --status-bg: #e6fffb;
  --method-bg: #fff7e6;
  --state-bg: #dff3ed;
  --state-ink: #145b4c;
  --flash-bg: #e9f6f2;
  --panel-shadow: 0 14px 36px rgba(31, 41, 51, 0.08);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f0f4f1;
  --muted: #b5c1b9;
  --line: #405047;
  --surface: #252b27;
  --wash: #171b18;
  --accent: #67d4ae;
  --accent-strong: #91e8c7;
  --coin: #f1cd80;
  --button-ink: #10231a;
  --status-bg: #244c3d;
  --method-bg: #493b27;
  --state-bg: #2b4939;
  --state-ink: #c3f1d5;
  --flash-bg: #293d31;
  --panel-shadow: 0 14px 36px rgba(0, 0, 0, 0.22);
}

* {
  box-sizing: border-box;
}

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

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 64px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.brand {
  color: var(--ink);
  font-size: 20px;
  font-weight: 800;
  text-decoration: none;
}

.product,
.description,
.eyebrow {
  color: var(--muted);
}

.topbar-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
}

.topnav {
  display: flex;
  gap: 20px;
}

.topnav a,
.section-heading a,
.notice a {
  color: var(--accent-strong);
  font-weight: 700;
  text-decoration: none;
}

.topbar-logout {
  margin: 0;
}

.theme-toggle {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

.theme-toggle:hover {
  background: var(--wash);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.theme-icon-moon,
:root[data-theme="dark"] .theme-icon-sun {
  display: none;
}

:root[data-theme="dark"] .theme-icon-moon {
  display: block;
}

.text-button {
  min-height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
}

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

.checkout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 440px);
  gap: 32px;
  align-items: start;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.15;
}

.amount {
  margin: 18px 0 0;
  font-size: 28px;
  font-weight: 800;
  color: var(--accent-strong);
}

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

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

button,
.button-link {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: var(--button-ink);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

button.secondary {
  background: var(--surface);
  color: var(--accent-strong);
}

.details {
  display: grid;
  gap: 14px;
  margin: 0;
}

.option-list {
  display: grid;
  gap: 12px;
}

.pay-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  text-decoration: none;
}

.pay-option small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.details div {
  display: grid;
  gap: 4px;
}

dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

dd {
  margin: 0;
}

.mono {
  overflow-wrap: anywhere;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
}

.dashboard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.status,
.method {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--status-bg);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
}

.method {
  margin-right: 4px;
  background: var(--method-bg);
  color: var(--coin);
}

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

.signin {
  padding: 72px 0;
  max-width: 520px;
}

.signin h1 {
  font-size: 44px;
}

.lead {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.6;
}

.button-link.outline {
  background: transparent;
  color: var(--accent-strong);
}

.account-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.account-email {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.account-tabs {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.account-tabs a {
  padding: 12px 0;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  font-weight: 700;
  text-decoration: none;
}

.account-tabs a[aria-current="page"] {
  border-bottom-color: var(--accent);
  color: var(--ink);
}

.notice {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin: 24px 0;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 28px 0 36px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.metrics div {
  display: grid;
  gap: 8px;
  padding: 20px 24px;
  border-right: 1px solid var(--line);
}

.metrics div:first-child {
  padding-left: 0;
}

.metrics div:last-child {
  border-right: 0;
}

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

.metrics strong {
  color: var(--ink);
  font-size: 28px;
}

.account-section {
  padding: 28px 0;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-heading h2 {
  margin: 0;
  font-size: 20px;
}

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

.account-table {
  min-width: 720px;
  border-radius: 0;
  box-shadow: none;
}

.account-table td strong,
.account-table td small {
  display: block;
}

.account-table td small,
.muted {
  margin-top: 4px;
  color: var(--muted);
}

.state-pill {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 4px;
  background: var(--state-bg);
  color: var(--state-ink);
  font-size: 12px;
  font-weight: 700;
}

.empty-state {
  margin: 0;
  padding: 32px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.method-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}

.method-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.flash-stack {
  margin-bottom: 16px;
}

.flash {
  padding: 12px 16px;
  border-left: 3px solid var(--accent);
  background: var(--flash-bg);
}

.method-item {
  display: grid;
  gap: 22px;
  min-height: 150px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.method-item div,
.method-item strong,
.method-item span,
.method-item small {
  display: block;
}

.method-item strong {
  margin-top: 12px;
}

.method-item span,
.method-item small {
  color: var(--muted);
}

.method-brand {
  color: var(--accent-strong) !important;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.connection-section {
  max-width: 760px;
  border-bottom: 1px solid var(--line);
}

.connection-id {
  font-family: Consolas, monospace;
  overflow-wrap: anywhere;
}

.connection-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.connection-row span {
  color: var(--muted);
}

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

  .dashboard-head {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
  }

  .topbar {
    flex-wrap: wrap;
    padding: 12px 16px;
  }

  .product {
    display: none;
  }

  .topbar-controls {
    flex: 1;
    justify-content: flex-end;
    flex-wrap: wrap;
    min-width: 0;
    gap: 10px;
  }

  .topnav {
    order: 3;
    flex-basis: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 12px;
  }

  .account-heading,
  .notice {
    align-items: flex-start;
    flex-direction: column;
  }

  .metrics div {
    padding: 16px 12px;
  }

  .metrics strong {
    font-size: 23px;
  }

  table {
    display: block;
    overflow-x: auto;
  }
}

/* ---- information pages (about, policies, status, changelog) ---- */
.prose { max-width: 52rem; line-height: 1.6; }
.prose h1 { margin: 0.2rem 0 0.6rem; }
.prose h2 { margin: 1.5rem 0 0.4rem; font-size: 1.05rem; }
.prose p { margin: 0.55rem 0; }
.prose ul { padding-left: 1.2rem; margin: 0.4rem 0; }
.prose li { margin: 0.28rem 0; }
.prose .lead { font-size: 1.05rem; }
.policy-meta { margin: 0.2rem 0 1.2rem; font-size: 0.9rem; }
.statusline { margin: 0.4rem 0 1rem; }
.state-pill.ok { background: #124b3c; color: #b8ffe9; }
.state-pill.bad { background: #5a1f2a; color: #ffd0d6; }
.changelog section { margin: 1.5rem 0; }
.changelog section h2 { border-bottom: 1px solid var(--line); padding-bottom: 0.3rem; }
.site-footer { margin: 2.5rem auto 1.5rem; padding: 0 1rem; text-align: center; font-size: 0.85rem; }
.site-footer p { margin: 0.4rem 0 0; }
.footlinks { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; }
.footlinks a { color: var(--muted); text-decoration: none; }
.footlinks a:hover { color: var(--ink); text-decoration: underline; }
