/* Site shell. Mobile-first at 430px; desktop is the same layout, wider. One file, no framework.
   Public pages, the portal and the admin console share this sheet. */
:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --ink: #1f2933;
  --muted: #5f6b7a;
  --line: #d9dde3;
  --accent: #1f2933;
  --link: #1558b0;
  --red: #b42318;    --red-bg: #fdecea;
  --amber: #8a5a00;  --amber-bg: #fff1c2;
  --green: #1b6e32;  --green-bg: #dff3e4;
  --blue: #1558b0;   --blue-bg: #dbeafe;
  --gray-bg: #e5e7eb;
  --max: 1040px;
  --narrow: 520px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
a { color: var(--link); }
h1, h2, h3, h4 { margin: 0 0 0.5em; line-height: 1.2; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.3rem; margin-top: 1.2em; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.skip { position: absolute; left: -999px; top: 0; background: #fff; padding: 8px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---- header / footer ---- */
.topbar { background: var(--accent); color: #fff; }
.bar-inner { max-width: var(--max); margin: 0 auto; padding: 10px 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.brand { color: #fff; font-weight: 700; text-decoration: none; font-size: 1.1rem; margin-right: auto; }
.brand .tag { font-size: 0.7rem; background: var(--red); padding: 1px 6px; border-radius: 999px; vertical-align: middle; }
/* Phone width: the links sit behind the menu button. site.js toggles .open; without JavaScript
   (no .js on <html>) focusing the button, or any link inside, shows them, so nothing shifts on load. */
.menu-btn { display: inline-block; background: none; border: 1px solid rgba(255,255,255,0.6); color: #fff; font-size: 1.2rem; min-width: 44px; min-height: 40px; padding: 2px 10px; border-radius: 6px; cursor: pointer; }
.menu-btn:focus-visible { outline: 3px solid #93c5fd; outline-offset: 2px; }
.topbar nav.links { display: none; width: 100%; flex-direction: column; gap: 2px; padding: 6px 0 4px; }
.topbar nav.links.open, html:not(.js) .menu-btn:focus + nav.links, html:not(.js) .topbar nav.links:focus-within, html:not(.js) .topbar nav.links:hover { display: flex; }
.topbar nav.links a, .topbar nav.links .linkbtn { color: #e5e7eb; text-decoration: none; padding: 6px 0; font-weight: 600; }
.topbar nav.links a[aria-current="page"] { color: #fff; text-decoration: underline; }
.topbar nav.links .btn { background: #fff; color: var(--ink); align-self: flex-start; padding: 6px 12px; white-space: nowrap; }
.linkbtn { background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; text-decoration: underline; }
form.inline { display: inline; }
.foot { margin-top: 48px; border-top: 1px solid var(--line); background: #fff; }
.foot .bar-inner { display: block; padding: 20px 16px; }
.foot nav a { display: inline-block; padding: 6px 2px; margin-right: 4px; }
@media (min-width: 760px) {
  .menu-btn { display: none; }
  .topbar nav.links { display: flex; width: auto; flex-direction: row; align-items: center; gap: 18px; padding: 0; }
  .topbar nav.links .btn { align-self: center; }
}

/* ---- page ---- */
.page { max-width: var(--max); margin: 0 auto; padding: 20px 16px 40px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 18px 16px; margin-bottom: 16px; }
.card.narrow, .narrow { max-width: var(--narrow); margin-left: auto; margin-right: auto; }
.grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .grid.cols-2 { grid-template-columns: 1fr 1fr; } .grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; } }
.hero { padding: 28px 0 10px; }
.hero h1 { font-size: 2rem; }
@media (min-width: 760px) { .hero h1 { font-size: 2.6rem; max-width: 760px; } .hero p.lead { font-size: 1.2rem; max-width: 640px; } }
.draft-banner { background: var(--amber-bg); color: var(--amber); padding: 10px 16px; text-align: center; border-bottom: 1px solid #f0d58a; }
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; border: 1px solid var(--line); background: var(--blue-bg); color: var(--blue); }
.flash-success { background: var(--green-bg); color: var(--green); }
.flash-error { background: var(--red-bg); color: var(--red); }
.flash-info { background: var(--blue-bg); color: var(--blue); }

/* ---- forms ---- */
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; margin-bottom: 4px; }
.field input, .field select, .field textarea { width: 100%; font: inherit; padding: 9px 10px; border: 1px solid #aab2bd; border-radius: 8px; background: #fff; color: var(--ink); }
.field input:focus, .field select:focus, .field textarea:focus, .btn:focus-visible, a:focus-visible, .linkbtn:focus-visible { outline: 3px solid #93c5fd; outline-offset: 1px; }
.field.has-error input, .field.has-error textarea { border-color: var(--red); }
.help { color: var(--muted); font-size: 0.875rem; margin: 4px 0 0; }
.error { color: var(--red); font-weight: 600; margin: 4px 0 0; }
.btn { display: inline-block; background: var(--accent); color: #fff; border: 1px solid var(--accent); padding: 10px 16px; border-radius: 8px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; line-height: 1.2; }
.btn.secondary { background: #fff; color: var(--ink); }
.btn.danger { background: var(--red); border-color: var(--red); }
.btn.small { padding: 6px 12px; font-size: 0.9rem; }
.btn.block { display: block; width: 100%; text-align: center; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 12px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---- tables / lists ---- */
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { text-align: left; padding: 8px 6px; border-top: 1px solid var(--line); vertical-align: top; }
th { border-top: 0; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.table-wrap { overflow-x: auto; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; background: var(--gray-bg); }
.badge.ok { background: var(--green-bg); color: var(--green); }
.badge.warn { background: var(--amber-bg); color: var(--amber); }
.badge.bad { background: var(--red-bg); color: var(--red); }
.badge.info { background: var(--blue-bg); color: var(--blue); }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
dl.kv dt { color: var(--muted); } dl.kv dd { margin: 0; }
ul.plain { list-style: none; margin: 0; padding: 0; }
ul.plain > li { padding: 8px 0; border-top: 1px solid var(--line); }
ul.plain > li:first-child { border-top: 0; }
.price { font-size: 2rem; font-weight: 700; }
.price small { font-size: 1rem; font-weight: 400; color: var(--muted); }
.qr { width: 200px; height: 200px; background: #fff; padding: 8px; border: 1px solid var(--line); }
.qr svg { width: 100%; height: 100%; }
code, .mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.95em; }
.legal h2 { margin-top: 1.6em; }
.legal ol, .legal ul { padding-left: 1.3em; }
.subnav { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 16px; font-size: 0.95rem; }
.subnav a[aria-current="page"] { font-weight: 700; color: var(--ink); text-decoration: none; }

/* ---- public pages ---- */
.eyebrow { text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.8rem; font-weight: 700; color: var(--muted); margin-bottom: 0.4em; }
.lead { font-size: 1.1rem; }
.hero .actions { margin-bottom: 8px; }
.promise { border-left: 4px solid var(--green); }
ul.checks { list-style: none; padding: 0; margin: 0 0 1em; }
ul.checks li { position: relative; padding: 4px 0 4px 28px; }
ul.checks li::before { content: ""; position: absolute; left: 4px; top: 0.55em; width: 12px; height: 7px; border-left: 3px solid var(--green); border-bottom: 3px solid var(--green); transform: rotate(-45deg); }
ol.steps { list-style: none; counter-reset: step; padding: 0; margin: 0 0 1em; display: grid; gap: 12px; }
ol.steps li { counter-increment: step; position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px 16px 12px 60px; }
ol.steps li::before { content: counter(step); position: absolute; left: 16px; top: 14px; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; }
ol.steps li p { margin-bottom: 0.4em; }
@media (min-width: 760px) { ol.steps { grid-template-columns: 1fr 1fr 1fr; } }
.tier h4 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin: 0.8em 0 0.2em; }
.tier p:last-child { margin-bottom: 0; }
.tier .badge { vertical-align: middle; }
ul.plain.card > li h3 { margin-top: 4px; }
ul.plain.card > li p:last-child { margin-bottom: 0; }
caption { text-align: left; font-weight: 600; padding-bottom: 6px; }
.page { overflow-wrap: anywhere; }
.card > :first-child { margin-top: 0; }

/* ---- portal ---- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.nowrap { white-space: nowrap; }
.subnav a { display: inline-block; padding: 6px 0; }
ul.plain > li.split, ul.members > li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 12px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
form.inline-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0; }
form.inline-form select { font: inherit; padding: 6px 8px; border: 1px solid #aab2bd; border-radius: 8px; background: #fff; color: var(--ink); }
form.inline-form select:focus { outline: 3px solid #93c5fd; outline-offset: 1px; }
.danger-zone { border-color: #f1b8b2; }
.card.filter { display: flex; flex-wrap: wrap; gap: 0 12px; align-items: flex-end; }
.card.filter .field { margin-bottom: 0; min-width: 200px; }
.card.filter .actions { margin-top: 0; }
h2 .badge { vertical-align: middle; font-size: 0.8rem; }
