/*
 * Undertow Tide. The look comes from sea charts: cool chart paper, deep-water
 * ink, and the magenta that charts use for marks. One typeface (Archivo,
 * served from here) set wide for headings and normal for text.
 */
@font-face {
  font-family: 'Archivo';
  src: url('/assets/archivo.woff2') format('woff2');
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

:root {
  --paper: #edf2f1; --surface: #fbfdfc; --ink: #0e2a35; --muted: #56707a; --line: #c9d6d6;
  --tide: #1c6e8c; --shallows: #d5e7e6; --mark: #b0206f;
  --good: #1f7a55; --warn: #8f5a00; --bad: #b3261e;
  --deep: #0e2a35; --on-deep: #edf2f1; --deep-muted: #9fb6bc; --deep-line: #2a4854; --deep-mark: #f27dbb;
  --radius: 14px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0a1d25; --surface: #10272f; --ink: #e4eeee; --muted: #8fa6ad; --line: #23404a;
    --tide: #6fbfd8; --shallows: #153640; --mark: #f27dbb;
    --good: #5fc491; --warn: #e0b060; --bad: #f08a80;
    --deep: #061419; --deep-line: #1c343d;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.55 Archivo, ui-sans-serif, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
main, .top, footer .inner, .band .inner { max-width: 1120px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
main { padding-bottom: 96px; }
main.narrow { max-width: 560px; }

h1, h2, h3 { margin: 0; text-wrap: balance; }
h1 { font-size: clamp(38px, 6.4vw, 78px); line-height: 0.98; font-weight: 760; font-stretch: 125%; letter-spacing: -0.025em; }
h2 { font-size: clamp(24px, 3vw, 34px); line-height: 1.1; font-weight: 720; font-stretch: 118%; letter-spacing: -0.015em; }
h3 { font-size: 17px; font-weight: 680; font-stretch: 110%; }
p { margin: 0 0 12px; }
.lead { font-size: clamp(18px, 2vw, 21px); line-height: 1.45; color: var(--muted); max-width: 56ch; }
.muted { color: var(--muted); } .small { font-size: 13.5px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.86em; overflow-wrap: anywhere; }
.num { font-variant-numeric: tabular-nums; }
a { color: var(--tide); text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; transition: text-decoration-color .15s; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--mark); outline-offset: 2px; border-radius: 4px; }
.good { color: var(--good); } .bad { color: var(--bad); } .warn { color: var(--warn); }

/* --- top bar ---------------------------------------------------------------- */
.top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; padding-top: 18px; padding-bottom: 18px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 760; font-stretch: 122%; font-size: 18px; letter-spacing: -0.01em; margin-right: auto; text-decoration: none; }
.brand img { width: 28px; height: 28px; display: block; }
.brand span { font-weight: 420; color: var(--muted); }
.top a.plain { color: var(--ink); font-weight: 520; }
.tag { font-size: 12.5px; font-weight: 600; color: var(--warn); border: 1px solid currentColor; border-radius: 99px; padding: 2px 10px; }
.chip { font-size: 13px; border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 4px 12px; }

.tabs { display: flex; gap: 2px; order: 3; width: 100%; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--muted); font-weight: 560; white-space: nowrap; text-decoration: none; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -3px 0 var(--mark); }
.tabs .count { font-size: 12px; font-weight: 600; background: var(--shallows); border-radius: 99px; padding: 1px 7px; margin-left: 6px; }
.tabs .count.bad { background: var(--bad); color: var(--surface); }

/* --- buttons and fields ------------------------------------------------------- */
button, .button { font: inherit; font-weight: 620; cursor: pointer; border-radius: 8px; padding: 11px 18px; border: 1px solid var(--ink);
  background: var(--ink); color: var(--paper); display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; white-space: nowrap; transition: transform .12s, background .15s, color .15s; }
button:hover, .button:hover { background: var(--tide); border-color: var(--tide); }
button:active, .button:active { transform: translateY(1px); }
button.quiet, .button.quiet { background: transparent; color: var(--ink); border-color: var(--line); }
button.quiet:hover, .button.quiet:hover { border-color: var(--ink); background: var(--surface); }
button.danger { background: transparent; color: var(--bad); border-color: var(--bad); }
button.danger:hover { background: var(--bad); color: var(--surface); }
button.link { border: 0; background: none; color: var(--tide); padding: 0; font-weight: 520; }
button.link:hover { background: none; text-decoration: underline; text-underline-offset: 3px; }
button.small, .button.small { padding: 6px 12px; font-size: 13.5px; }
button:disabled { opacity: .55; cursor: progress; }
button img { width: 22px; height: 22px; border-radius: 5px; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.row.end { justify-content: flex-end; }
.spread { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: end; justify-content: space-between; }
.stack { display: grid; gap: 16px; }

label { display: grid; gap: 5px; font-size: 14.5px; font-weight: 600; }
label small { font-weight: 400; color: var(--muted); font-size: 13.5px; line-height: 1.4; }
label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
label.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--tide); }
input, select, textarea { font: inherit; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); width: 100%; transition: border-color .15s; }
input:hover, select:hover { border-color: var(--muted); }
input:focus-visible, select:focus-visible { outline: 2px solid var(--tide); outline-offset: 0; border-color: var(--tide); }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; align-items: end; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.filters input { flex: 1 1 220px; max-width: 340px; }
.filters select { width: auto; }
.filters input, .filters select { height: 44px; }
.more { padding: 14px; text-align: center; border-top: 1px solid var(--line); }
.filters .push { margin-left: auto; }

/* --- surfaces ------------------------------------------------------------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.panel.flush { padding: 0; overflow-x: auto; }
.panel > .empty:only-child { padding: 6px 0; }
.panel.flush > .empty:only-child { padding: 28px 22px; }
.panel > h3 { margin-bottom: 4px; }
.notice { border: 1px solid var(--line); border-left: 4px solid var(--tide); background: var(--surface); border-radius: 8px; padding: 12px 16px; margin: 16px 0; overflow-wrap: anywhere; }
.notice.bad { border-left-color: var(--bad); color: var(--ink); } .notice.good { border-left-color: var(--good); color: var(--ink); } .notice.warn { border-left-color: var(--warn); color: var(--ink); }
.empty { padding: 28px 22px; color: var(--muted); }
.empty b { display: block; color: var(--ink); font-size: 17px; font-stretch: 110%; margin-bottom: 4px; }

table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 14.5px; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: top; }
th { font-size: 13px; color: var(--muted); font-weight: 600; background: color-mix(in srgb, var(--shallows) 45%, transparent); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: color-mix(in srgb, var(--shallows) 30%, transparent); }
td.num, th.num { text-align: right; }
td.wrap { white-space: normal; min-width: 200px; }
td .sub { display: block; color: var(--muted); font-size: 13px; }

.pill { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.pill::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pill.muted { font-weight: 500; }

/* --- landing ---------------------------------------------------------------- */
.hero { padding: 56px 0 8px; display: grid; gap: 22px; }
.hero h1 { max-width: 15ch; }
.section { padding-top: 96px; }
.section > h2 { max-width: 22ch; margin-bottom: 14px; }
.section > .lead { margin-bottom: 36px; }

/* The tide chart: each crest is a payment arriving. */
.tide { margin: 36px 0 0; overflow: hidden; border-top: 1px solid var(--line); }
.tide svg { display: block; width: 100%; min-width: 820px; height: auto; }
.tide .water { fill: var(--shallows); }
.tide .curve { fill: none; stroke: var(--tide); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
.tide .depth { fill: none; stroke: var(--tide); stroke-width: 1; opacity: .28; }
.tide .axis { stroke: var(--ink); stroke-width: 1.5; }
.tide .tick { stroke: var(--ink); stroke-width: 1; opacity: .5; }
.tide .drop { stroke: var(--mark); stroke-width: 1.2; stroke-dasharray: 3 5; }
.tide .ring { fill: var(--surface); stroke: var(--mark); stroke-width: 2.5; }
.tide .dot { fill: var(--mark); }
.tide text { font-family: Archivo, sans-serif; fill: var(--ink); text-anchor: middle; }
.tide .amount { font-size: 22px; font-weight: 720; font-stretch: 115%; }
.tide .date { font-size: 16px; fill: var(--muted); }
.tide .signed { fill: var(--mark); font-size: 16px; font-weight: 600; text-anchor: start; }
.tide-note { display: flex; flex-wrap: wrap; gap: 6px 32px; justify-content: space-between; padding-top: 14px; color: var(--muted); font-size: 14.5px; }
@media (prefers-reduced-motion: no-preference) {
  .tide .curve { animation: draw 2.4s cubic-bezier(.5, 0, .2, 1) both; }
  .tide .water, .tide .depth { animation: rise 1.6s ease-out .5s both; }
  .tide .crest { animation: land .5s ease-out both; }
  .tide .crest:nth-of-type(1) { animation-delay: .55s; } .tide .crest:nth-of-type(2) { animation-delay: 1.05s; }
  .tide .crest:nth-of-type(3) { animation-delay: 1.55s; } .tide .crest:nth-of-type(4) { animation-delay: 2.05s; }
}
@keyframes draw { from { stroke-dashoffset: 1; } }
@keyframes rise { from { opacity: 0; } }
@keyframes land { from { opacity: 0; transform: translateY(10px); } }

.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; border-top: 1px solid var(--ink); }
.steps li { counter-increment: step; display: grid; grid-template-columns: minmax(70px, 150px) minmax(0, 1fr) minmax(0, 1.4fr); gap: 8px 32px; padding: 26px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.steps li::before { content: counter(step); font-size: clamp(40px, 6vw, 68px); line-height: .9; font-weight: 300; font-stretch: 125%; color: var(--tide); }
.steps p { margin: 0; color: var(--muted); max-width: 52ch; }

/* What happens when a payment fails, as a line through time. */
.course { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); }
.course li { position: relative; padding: 34px 24px 0 0; border-top: 2px solid var(--line); }
.course li::before { content: ''; position: absolute; top: -9px; left: 0; width: 16px; height: 16px; border-radius: 50%; background: var(--paper); border: 2.5px solid var(--bad); }
.course li.wait::before { border-color: var(--warn); }
.course li.ok::before { border-color: var(--good); background: var(--good); }
.course time { display: block; font-size: 13.5px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.course b { display: block; font-size: 17px; font-stretch: 110%; margin-bottom: 4px; }
.course p { margin: 0; color: var(--muted); font-size: 15px; }

.band { background: var(--deep); color: var(--on-deep); padding: 88px 0; }
.band h2 { max-width: 20ch; margin-bottom: 16px; }
.split h2 { margin-bottom: 14px; } .split h1 { font-size: clamp(34px, 5vw, 58px); margin-bottom: 18px; } .split .lead { margin: 0; }
.band .lead, .band .muted { color: var(--deep-muted); }
.band .facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 48px; margin: 40px 0 28px; }
.band .facts div { border-top: 1px solid var(--deep-line); padding: 20px 0; }
.band .facts b { display: block; font-size: 19px; font-stretch: 112%; margin-bottom: 6px; }
.band .facts b::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 50%; border: 2.5px solid var(--deep-mark); margin-right: 10px; }
.band .facts p { margin: 0; color: var(--deep-muted); }
.band .mono { color: var(--on-deep); }

.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 28px 56px; align-items: center; }
.search { display: flex; gap: 10px; flex-wrap: wrap; } .search input { flex: 1 1 260px; }
footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
footer .inner { display: flex; flex-wrap: wrap; gap: 8px 28px; padding-top: 28px; padding-bottom: 44px; }
footer .inner > :first-child { margin-right: auto; }

/* --- merchant dashboard --------------------------------------------------- */
.page-head { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: end; justify-content: space-between; padding: 36px 0 22px; }
.page-head h1 { font-size: clamp(30px, 4vw, 44px); }
.page-head p { margin: 6px 0 0; }
.figures { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.figures > div { padding: 20px 22px; border-left: 1px solid var(--line); }
.figures > div:first-child { border-left: 0; }
.figures span { display: block; color: var(--muted); font-size: 14px; font-weight: 520; }
.figures b { display: block; font-size: clamp(26px, 3.2vw, 38px); line-height: 1.15; font-weight: 700; font-stretch: 118%; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; margin-top: 6px; }
.figures b small { font-size: 14px; font-weight: 520; font-stretch: 100%; letter-spacing: 0; color: var(--muted); margin-left: 4px; }
.figures em { display: block; font-style: normal; font-size: 13px; color: var(--muted); margin-top: 2px; }
.cols { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; margin-top: 20px; align-items: start; }
.cols.even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.panel-head { display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.panel.flush .panel-head { padding: 18px 22px 0; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .bar { fill: var(--tide); transition: fill .12s; }
.chart .bar:hover, .chart .bar:focus { fill: var(--mark); outline: none; }
.chart .zero { fill: var(--line); }
.chart .base { stroke: var(--line); stroke-width: 1; }
.chart text { font-family: Archivo, sans-serif; font-size: 11px; fill: var(--muted); }
.chart text.end { text-anchor: end; } .chart text.mid { text-anchor: middle; }
.readout { min-height: 1.5em; font-size: 14px; color: var(--muted); margin: 8px 0 0; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; gap: 12px; justify-content: space-between; align-items: baseline; padding: 11px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.list li:first-child { border-top: 0; padding-top: 0; }
.list b { white-space: nowrap; }
.figures:empty { display: none; }
.list .sub { display: block; color: var(--muted); font-size: 13px; }
.share { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px 20px; align-items: center; padding: 20px 22px; border-top: 1px solid var(--line); }
.share:first-child { border-top: 0; }
.share h3 { margin-bottom: 2px; }
.share .price { font-weight: 640; }
.share .link { grid-column: 1 / -1; display: flex; gap: 8px; }
.share .link input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; background: var(--paper); }
.share details { grid-column: 1 / -1; font-size: 14px; }
.share .fate { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 14.5px; max-width: 70ch; }
.share h3 .pill { vertical-align: 3px; margin-left: 6px; }
.share .close-plan { grid-column: 1 / -1; justify-self: start; color: var(--muted); font-size: 14px; }
.share .close-plan:hover { color: var(--bad); }
#confirm-body p { margin: 0; }
.share summary { cursor: pointer; color: var(--tide); font-weight: 560; width: fit-content; }
.share pre { margin: 10px 0 0; padding: 14px; background: var(--deep); color: var(--on-deep); border-radius: 8px; overflow-x: auto; font-size: 12.5px; line-height: 1.5; }
.share .snippet { margin-top: 14px; }
.share .snippet .link { margin-top: 8px; }
.share .snippet p { margin: 0; color: var(--muted); display: flex; gap: 16px; justify-content: space-between; align-items: baseline; }
.share .snippet p.field-state { display: block; margin-top: 8px; font-size: 13.5px; font-weight: 520; }
.share .snippet p.field-state.good { color: var(--good); } .share .snippet p.field-state.bad { color: var(--bad); } .share .snippet p.field-state.warn { color: var(--warn); }
.field-state.good::before { content: '✓ '; }
@keyframes saved { from { box-shadow: 0 0 0 3px var(--good); } to { box-shadow: 0 0 0 3px transparent; } }
@media (prefers-reduced-motion: no-preference) { .just-saved input { animation: saved 1.4s ease-out both; } }
.welcome { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px 48px; align-items: center; padding: 36px; }
.welcome ol { margin: 0; padding-left: 20px; color: var(--muted); } .welcome li { margin-bottom: 6px; }
.settings { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); gap: 12px 40px; padding: 28px 0; border-top: 1px solid var(--line); }
.settings:first-of-type { border-top: 0; }
.settings #new-key input { flex: 1 1 220px; }
.settings #key-value { word-break: break-all; }
.api-docs summary { cursor: pointer; color: var(--tide); font-weight: 560; width: fit-content; font-size: 14px; }
.api-docs pre { margin: 10px 0 0; padding: 14px; background: var(--deep); color: var(--on-deep); border-radius: 8px; overflow-x: auto; font-size: 12.5px; line-height: 1.5; }
button.quiet-danger { color: var(--muted); }
button.quiet-danger:hover { color: var(--bad); }
.settings > div:first-child p { color: var(--muted); font-size: 14px; margin: 6px 0 0; }
.hint { font-size: 13.5px; color: var(--tide); font-weight: 520; }
.hint.warn { color: var(--warn); }

dialog { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); padding: 28px; width: min(560px, calc(100vw - 32px)); box-shadow: 0 30px 80px -20px rgb(6 20 25 / .55); }
dialog::backdrop { background: rgb(6 20 25 / .55); backdrop-filter: blur(3px); }
dialog h2 { font-size: 26px; margin-bottom: 4px; }
.preview { background: var(--shallows); border-radius: 8px; padding: 12px 14px; font-weight: 560; }
.toast { position: fixed; left: 50%; bottom: 28px; translate: -50% 0; background: var(--deep); color: var(--on-deep); padding: 10px 18px; border-radius: 99px; font-size: 14.5px; font-weight: 560; z-index: 10; }
@media (prefers-reduced-motion: no-preference) { .toast { animation: land .2s ease-out both; } }

/* --- checkout ---------------------------------------------------------------- */
.ticket { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; margin-top: 28px; box-shadow: 0 24px 60px -36px rgb(6 20 25 / .5); }
.ticket-head { background: var(--deep); color: var(--on-deep); padding: 26px 28px 0; }
.ticket-head .who { color: var(--deep-muted); font-size: 14.5px; margin: 0 0 6px; }
.ticket-head h1 { font-size: clamp(26px, 5vw, 34px); line-height: 1.08; }
.ticket-head .about { color: var(--deep-muted); margin: 8px 0 0; }
.ticket-head .price { font-size: clamp(40px, 9vw, 56px); line-height: 1; font-weight: 740; font-stretch: 120%; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; margin-top: 22px; }
.ticket-head .price small { font-size: 16px; font-weight: 480; font-stretch: 100%; letter-spacing: 0; color: var(--deep-muted); margin-left: 6px; }
.ticket-head svg { display: block; width: calc(100% + 56px); margin: 18px -28px 0; height: 34px; }
.ticket-head svg path { fill: var(--surface); }
.ticket-body { padding: 14px 28px 28px; display: grid; gap: 18px; }
.ticket-body .notice { margin: 0; }
.terms { list-style: none; margin: 0; padding: 0; font-size: 14.5px; color: var(--muted); }
.terms li { padding: 8px 0 8px 22px; position: relative; border-top: 1px solid var(--line); }
.terms li:first-child { border-top: 0; }
.terms li::before { content: ''; position: absolute; left: 0; top: 15px; width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--mark); }
fieldset.reach { border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin: 0; display: grid; gap: 12px; min-width: 0; }
fieldset.reach legend { font-weight: 640; padding: 0 6px; }
fieldset.reach p { margin: 0; }
.choice { width: 100%; justify-content: flex-start; padding: 12px 14px; }
.choice::before { content: ''; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--muted); flex: none; }
.choice[aria-pressed="true"] { border-color: var(--good); color: var(--good); }
.choice[aria-pressed="true"]::before { border-color: var(--good); background: var(--good); box-shadow: inset 0 0 0 3px var(--surface); }
/* The payer's own page: one card per subscription. */
.gate { max-width: 560px; padding-top: clamp(40px, 9vh, 96px); display: grid; gap: 18px; }
.gate h1 { font-size: clamp(34px, 5vw, 52px); }
.gate p { margin: 0; }
.gate #wallets { display: grid; gap: 10px; margin-top: 6px; }
.gate #wallets button { width: 100%; padding: 14px 18px; font-size: 17px; }
.subs { display: grid; gap: 14px; margin-top: 22px; }
.subscription { display: grid; grid-template-columns: minmax(0, 1.2fr) 190px minmax(0, 1.6fr); gap: 18px 32px; align-items: start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px 0; }
.subscription.failing { border-color: var(--bad); }
.subscription.ended, .subscription.cancelling { background: transparent; }
.subscription h3 { font-size: 21px; margin: 0 0 2px; }
.subscription p { margin: 0; }
.sub-price b { display: block; font-size: 30px; line-height: 1.05; font-weight: 700; font-stretch: 118%; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.sub-price span { color: var(--muted); font-size: 14px; }
.sub-next { display: grid; gap: 6px; justify-items: start; }
.sub-foot { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: center; border-top: 1px solid var(--line); padding: 14px 0; font-size: 14px; }
.sub-foot > span:first-child { margin-right: auto; }
.finish { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; justify-content: space-between; border: 1px solid var(--tide); background: var(--shallows); border-radius: 12px; padding: 14px 16px; }
.finish p { margin: 0; flex: 1 1 240px; }
.reach-now { display: flex; gap: 12px; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--line); padding-top: 14px; }
.reach-now p { margin: 0; }
.ticket-body #contact button[type="submit"] { width: auto; padding: 8px 16px; font-size: 14.5px; }
.ticket-body button[type="submit"], .ticket-body #wallets button { width: 100%; padding: 14px 18px; font-size: 17px; }
.ticket-body #wallets { display: grid; gap: 10px; }
.under { text-align: center; margin-top: 18px; }

@media (max-width: 860px) {
  .figures { grid-template-columns: repeat(2, 1fr); }
  .figures > div:nth-child(odd) { border-left: 0; }
  .figures > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .cols, .cols.even { grid-template-columns: minmax(0, 1fr); }
  .course { grid-template-columns: 1fr; }
  .course li { border-top: 0; border-left: 2px solid var(--line); padding: 0 0 26px 26px; }
  .course li::before { top: 0; left: -9px; }
  .steps li { grid-template-columns: 56px minmax(0, 1fr); }
  .steps li p { grid-column: 2; }
  .settings { grid-template-columns: minmax(0, 1fr); }
  .section { padding-top: 64px; } .band { padding: 56px 0; }
}
@media (max-width: 520px) {
  main, .top, footer .inner, .band .inner { padding-left: 16px; padding-right: 16px; }
  .share { grid-template-columns: minmax(0, 1fr); }
  .subscription { grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 18px 18px 0; }
  .sub-foot > span:first-child { margin-right: 0; flex-basis: 100%; }
  .sub-foot button { width: 100%; }
  .welcome { padding: 24px; }
}

/* --- developer guide: contents rail beside one readable column --- */
.guide { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 56px; padding-top: 40px; align-items: start; }
.guide-rail { position: sticky; top: 24px; display: grid; gap: 2px; border-left: 1px solid var(--line); }
.guide-rail a { display: block; padding: 7px 14px; margin-left: -1px; border-left: 2px solid transparent; color: var(--muted); font-size: 14.5px; font-weight: 520; text-decoration: none; }
.guide-rail a:hover { color: var(--ink); }
.guide-rail a[aria-current] { color: var(--ink); border-left-color: var(--mark); }
.guide-body { max-width: 720px; min-width: 0; }
.guide-body h1 { margin-bottom: 16px; }
.guide-body section { padding-top: 56px; scroll-margin-top: 8px; }
.guide-body h2 { font-size: clamp(22px, 2.4vw, 28px); margin-bottom: 14px; }
.guide-body p { margin: 0 0 14px; max-width: 68ch; }
.guide-body code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.86em; background: var(--shallows); padding: 1px 5px; border-radius: 4px; overflow-wrap: anywhere; }
.guide-body pre { margin: 4px 0 18px; padding: 16px 18px; background: var(--deep); color: var(--on-deep); border-radius: 10px; overflow-x: auto; font-size: 13px; line-height: 1.55; scrollbar-color: var(--deep-line) transparent; scrollbar-width: thin; }
.fields { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0 20px; margin: 4px 0 18px; border-top: 1px solid var(--line); }
.fields dt, .fields dd { margin: 0; padding: 10px 0; border-bottom: 1px solid var(--line); }
.fields dt { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13.5px; font-weight: 600; padding-top: 12px; }
.fields dd { color: var(--muted); }
.plain-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; max-width: 68ch; }
.plain-list li { padding-left: 16px; border-left: 2px solid var(--line); }
@media (max-width: 860px) {
  .guide { grid-template-columns: minmax(0, 1fr); gap: 0; padding-top: 24px; }
  .guide-rail { position: static; margin-bottom: 28px; }
  .guide-rail a { padding: 11px 14px; }
  .guide-body section { padding-top: 40px; }
  .fields { grid-template-columns: minmax(0, 1fr); }
  .fields dt { border-bottom: 0; padding-bottom: 0; }
  .fields dd { padding-top: 4px; }
}
