:root {
  --bg: #07080b;
  --panel: #0e1013;
  --panel-2: #14161a;
  --line: #1f2227;
  --gold: #d8c49a;
  --gold-2: #a99570;
  --text: #f4f2ec;
  --muted: #868b94;
  --ok: #8fbf9a;
  --warn: #d9b46a;
  --bad: #d98c84;
  --info: #8fb0d9;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 14px; line-height: 1.5; }
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: 0.01em; margin: 0; }
h1 { font-size: 30px; line-height: 1.15; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
p { margin: 0 0 8px; }
.num, table td, table th, .kv dd { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }

/* shell */
.shell { display: flex; min-height: 100vh; }
.side { width: 220px; flex: none; background: var(--bg); border-right: 1px solid var(--line); position: sticky; top: 0; height: 100vh; }
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 22px 20px 18px; }
.wordmark { font-family: var(--serif); font-size: 22px; color: var(--text); font-weight: 600; }
.wordmark:hover { text-decoration: none; }
.menu-btn { display: none; background: none; border: 1px solid var(--line); color: var(--text); border-radius: 6px; padding: 4px 10px; font-size: 16px; }
.side nav { display: flex; flex-direction: column; padding: 4px 0; }
.side nav a { color: var(--muted); padding: 9px 20px; border-left: 2px solid transparent; font-weight: 500; }
.side nav a:hover { color: var(--text); text-decoration: none; background: var(--panel); }
.side nav a.active { color: var(--gold); border-left-color: var(--gold); background: var(--panel); }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 28px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: rgba(7, 8, 11, 0.94); z-index: 5; flex-wrap: wrap; }
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.content { padding: 24px 28px 64px; max-width: 1280px; width: 100%; }

/* header */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-head p { margin-top: 4px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* badges & pills */
.badge { display: inline-flex; align-items: center; font-family: var(--sans); font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); }
.badge-dev { color: var(--muted); border-color: var(--line); background: var(--panel); }
.badge-prod { color: var(--gold); border-color: var(--gold); }
.badge-unknown { color: var(--muted); border-style: dashed; }
.badge-mock { color: #1a1206; background: var(--warn); border-color: var(--warn); font-size: 10px; }
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 999px; border: 1px solid; white-space: nowrap; }
.pill-gold { color: var(--gold); border-color: var(--gold-2); }
.pill-ok { color: var(--ok); border-color: rgba(143, 191, 154, 0.45); }
.pill-muted { color: var(--muted); border-color: var(--line); }
.pill-warn { color: var(--warn); border-color: rgba(217, 180, 106, 0.45); }
.pill-bad { color: var(--bad); border-color: rgba(217, 140, 132, 0.45); }
.pill-info { color: var(--info); border-color: rgba(143, 176, 217, 0.45); }

/* notices */
.notice { border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 10px 14px; margin-bottom: 16px; }
.notice-mock { border-color: rgba(217, 180, 106, 0.5); }
.notice-mock strong { color: var(--warn); }
.error-note { border: 1px solid rgba(217, 140, 132, 0.35); background: rgba(217, 140, 132, 0.06); border-radius: 8px; padding: 10px 14px; margin: 10px 0; }
.error-note p:last-of-type { margin-bottom: 0; }
.error-note .btn { margin-top: 8px; }
.empty { color: var(--muted); padding: 18px 0; }
.loading { padding: 12px 0; }

/* panels */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; margin-bottom: 16px; }
.panel h2, .panel h3 { margin-bottom: 10px; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.panel-head h2, .panel-head h3 { margin: 0; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.stat-label { color: var(--muted); font-size: 12px; }
.stat-value { font-size: 22px; font-weight: 600; margin-top: 2px; }
.stat-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.tone-gold { color: var(--gold); }
.tone-bad { color: var(--bad); }

/* key/value */
.kv { margin: 0; display: grid; gap: 6px; }
.kv > div { display: grid; grid-template-columns: 180px 1fr; gap: 12px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: none; }
td.r, th.r { text-align: right; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--panel-2); }
tr.expanded td { background: var(--panel-2); }
.load-more { display: flex; justify-content: center; padding: 12px; }

/* forms */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 14px; }
.filters .field { min-width: 140px; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.filters .field { margin-bottom: 0; }
.field-label { font-size: 12px; color: var(--muted); font-weight: 600; }
.field-hint { font-size: 12px; color: var(--muted); }
.field-err { font-size: 12px; color: var(--bad); }
.field-bad input, .field-bad select, .field-bad textarea { border-color: var(--bad); }
input, select, textarea { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 7px 10px; font-variant-numeric: tabular-nums; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold-2); }
textarea { resize: vertical; min-height: 64px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > .field { flex: 1; min-width: 140px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { background: transparent; border: 0; color: var(--muted); padding: 6px 12px; font: inherit; cursor: pointer; border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button.on { color: var(--gold); background: var(--panel-2); }
.check { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }

/* buttons */
.btn { font: inherit; font-weight: 600; border-radius: 8px; padding: 7px 14px; cursor: pointer; border: 1px solid var(--line); background: var(--panel); color: var(--text); }
.btn:hover:not(:disabled) { border-color: var(--gold-2); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-gold { background: var(--gold); color: #13110b; border-color: var(--gold); }
.btn-gold:hover:not(:disabled) { background: #e2d1ab; }
.btn-quiet { background: transparent; }
.btn-danger { background: transparent; color: var(--bad); border-color: rgba(217, 140, 132, 0.5); }
.btn-small { padding: 3px 10px; font-size: 12px; }
.btn-block { width: 100%; margin-top: 6px; }
.btn-x { background: none; border: none; color: var(--muted); font-size: 24px; cursor: pointer; line-height: 1; }

/* tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 8px 14px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; font-weight: 600; }
.tabs a.on { color: var(--gold); border-bottom-color: var(--gold); }
.tabs a:hover { text-decoration: none; color: var(--text); }

/* modal */
.modal-back { position: fixed; inset: 0; background: rgba(7, 8, 11, 0.72); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; z-index: 20; overflow-y: auto; }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; width: 100%; max-width: 520px; }
.modal-wide { max-width: 680px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px 6px; }
.modal-body { padding: 8px 18px 4px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px 16px; }
.confirm-text { margin-bottom: 10px; }
.prod-gate { border: 1px solid var(--gold-2); border-radius: 8px; padding: 10px 12px; margin: 10px 0; }
.prod-gate input { width: 100%; letter-spacing: 0.08em; }
.preview { border: 1px solid var(--gold-2); border-radius: 8px; padding: 10px 12px; margin: 6px 0 12px; background: rgba(216, 196, 154, 0.05); }
.preview strong { color: var(--gold); }

/* sign-in, full page */
.full-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.full-card { width: 100%; max-width: 420px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 28px; }
.full-card .wordmark { display: block; margin-bottom: 18px; color: var(--gold); }
.full-card h1 { margin-bottom: 14px; }
.full-card .field input { width: 100%; }

/* details */
pre.details { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px; font-size: 12px; margin: 6px 0 0; }
.sample-text { white-space: pre-wrap; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }

/* chart */
.chart { width: 100%; height: auto; display: block; }
.chart text { fill: var(--muted); font-family: var(--sans); font-size: 11px; font-variant-numeric: tabular-nums; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }

.cap-bar { height: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; margin: 6px 0; }
.cap-bar > div { height: 100%; background: var(--gold-2); }
.cap-bar.near > div { background: var(--warn); }
.cap-bar.reached > div { background: var(--bad); }

@media (max-width: 860px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .kv > div { grid-template-columns: 130px 1fr; }
}
@media (max-width: 760px) {
  .shell { flex-direction: column; }
  .side { width: 100%; height: auto; position: sticky; top: 0; z-index: 10; border-right: 0; border-bottom: 1px solid var(--line); }
  .side-head { padding: 12px 16px; }
  .menu-btn { display: block; }
  .side nav { display: none; padding-bottom: 8px; }
  .side.open nav { display: flex; }
  .topbar { position: static; padding: 10px 16px; }
  .content { padding: 16px 16px 48px; }
  h1 { font-size: 26px; }
  .kv > div { grid-template-columns: 1fr; gap: 0; }
  .modal-back { padding: 16px; }
}
.sample-text + .sample-text { margin-top: 6px; }
details.raw-sample { margin-top: 6px; }
details.raw-sample summary { cursor: pointer; color: var(--gold); font-size: 13px; }

/* Environment bar: always visible, different colour per environment */
:root { --envbar-h: 40px; --prod: #7a2a26; --prod-line: #d98c84; }
.envbar { position: sticky; top: 0; z-index: 30; height: var(--envbar-h); box-sizing: border-box; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 20px; border-bottom: 1px solid var(--line); }
.envbar-development { background: var(--panel); }
.envbar-production { background: var(--prod); border-bottom-color: var(--prod-line); }
.envbar-word { font-size: 12px; font-weight: 800; letter-spacing: 0.14em; }
.envbar-development .envbar-word { color: var(--muted); }
.envbar-production .envbar-word { color: #fff4ef; }
.app.env-production::after { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 40; box-shadow: inset 4px 0 0 var(--prod-line), inset -4px 0 0 var(--prod-line), inset 0 -4px 0 var(--prod-line); }
.env-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--bg); }
.env-opt { font: inherit; font-size: 12px; font-weight: 600; color: var(--muted); background: transparent; border: 0; padding: 5px 12px; cursor: pointer; }
.env-opt + .env-opt { border-left: 1px solid var(--line); }
.env-opt.on.env-opt-development { color: var(--text); background: var(--panel-2); }
.env-opt.on.env-opt-production { color: #fff4ef; background: var(--prod); }
.env-opt:disabled { cursor: not-allowed; opacity: 0.6; }
.env-off { font-weight: 400; }
.side { top: var(--envbar-h); height: calc(100vh - var(--envbar-h)); }
.topbar { top: var(--envbar-h); }
.full-page { min-height: calc(100vh - var(--envbar-h)); }
@media (max-width: 760px) {
  .envbar { padding: 0 12px; }
  .env-off { display: none; }
  .side { top: var(--envbar-h); height: auto; }
}

/* Password field with Show / Hide */
.password-wrap { position: relative; display: block; }
.password-wrap input { width: 100%; box-sizing: border-box; padding-right: 64px; }
.password-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }
.link-btn { background: none; border: 0; padding: 0; color: var(--gold); font: inherit; font-size: 13px; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.auth-links { display: flex; justify-content: space-between; margin-top: 12px; }
.success-note { border: 1px solid rgba(143, 191, 143, 0.45); background: var(--panel-2); border-radius: 8px; padding: 10px 14px; margin-bottom: 12px; }

/* System page: world map of paying members */
.map-panel-body { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(220px, 1fr); gap: 20px; align-items: start; }
.world-map { width: 100%; height: auto; display: block; }
.country-list { list-style: none; margin: 0; padding: 0; }
.country-list li { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.country-list .share { color: var(--gold); font-weight: 600; min-width: 52px; text-align: right; }
.country-list .bar { grid-column: 1 / -1; height: 3px; background: var(--line); border-radius: 2px; overflow: hidden; }
.country-list .bar > i { display: block; height: 100%; background: var(--gold); }
.map-stats { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 14px; }
.map-stats .stat-value { font-size: 22px; }
@media (max-width: 860px) { .map-panel-body { grid-template-columns: 1fr; } }
.map-country { cursor: default; }
.map-country:hover circle[data-country] { fill-opacity: 1; }
.map-foot { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; }

/* Guided release flow and launch overview */
.section-title { font-size: 18px; margin: 22px 0 10px; }
.flow-steps { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 0; margin: 0 0 14px; color: var(--muted); font-size: 13px; }
.flow-steps li.current { color: var(--text, #f3efe6); font-weight: 600; }
.flow-steps li.done { color: var(--gold); }
.flow-steps .num { display: inline-block; min-width: 20px; height: 20px; line-height: 20px; text-align: center; border: 1px solid var(--line); border-radius: 50%; margin-right: 4px; font-size: 12px; }
.flow-body { display: grid; gap: 12px; max-width: 760px; }
.flow-body select, .flow-body input { max-width: 360px; }
.flow-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.flow-facts > div { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; display: grid; gap: 4px; }
.flow-cost { border: 1px solid rgba(220, 90, 90, 0.45); border-radius: 8px; padding: 10px 12px; margin: 10px 0; }
.flow-resume { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.flow-resume p { width: 100%; margin: 0; }
.field-problem { color: var(--bad, #e07a6f); margin: -6px 0 0; }
.launch-grid { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.launch-na { font-size: 15px; font-weight: 400; }
.flow-body > button, .flow-body > .page-actions { justify-self: start; }
.launch-warn { border-color: var(--warn); background: rgba(217, 180, 106, 0.08); }
.launch-warn .stat-value { color: var(--warn); }
.launch-errors { margin: 6px 0 0; padding-left: 16px; }
.launch-signups { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.launch-signups li { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; border-bottom: 1px solid var(--line); padding: 6px 0; }
