:root {
  --bg: #f7f4ef; --surface: #ffffff; --ink: #2b2420; --muted: #6b605a; --line: #e4ddd5;
  --accent: #8a5a3c; --accent-ink: #ffffff; --good: #2f7a4b; --bad: #b4362c;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1d1916; --surface: #28221e; --ink: #efe7df; --muted: #b0a59c; --line: #3d352f;
    --accent: #d9a27c; --accent-ink: #1d1916; --good: #6cc48f; --bad: #ef7f74;
  }
}
:root[data-theme="dark"] {
  --bg: #1d1916; --surface: #28221e; --ink: #efe7df; --muted: #b0a59c; --line: #3d352f;
  --accent: #d9a27c; --accent-ink: #1d1916; --good: #6cc48f; --bad: #ef7f74;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 Inter, system-ui, sans-serif; }
.top { max-width: 1080px; margin: 0 auto; padding: 24px 16px 0; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.mark { font-weight: 700; font-size: 20px; }
.tag { font-size: 12px; letter-spacing: .12em; color: var(--accent); font-weight: 600; }
.layout { max-width: 1080px; margin: 0 auto; padding: 32px 16px 48px; display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: start; }
h1 { font-size: clamp(28px, 4vw, 40px); line-height: 1.15; margin: 0 0 16px; letter-spacing: -.01em; }
.lead { color: var(--muted); font-size: 18px; margin: 0 0 24px; }
.points { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 10px; }
.points li { padding-left: 22px; position: relative; color: var(--muted); }
.points li::before { content: ""; position: absolute; left: 0; top: .6em; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.points strong { color: var(--ink); font-weight: 600; }
.trial { font-weight: 600; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 0 0 20px; }
.plan { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.plan > strong { display: block; font-size: 15px; }
.plan .price { display: block; font-size: 24px; font-weight: 700; margin-top: 4px; }
.plan .price.add { font-size: 18px; margin-top: 10px; }
.plan .price small { font-size: 13px; font-weight: 500; color: var(--muted); }
.plan > small { display: block; color: var(--muted); font-size: 13px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 28px; }
.card h2 { margin: 0 0 16px; font-size: 22px; }
.editions { border: 0; padding: 0; margin: 0 0 4px; display: grid; gap: 10px; }
.editions legend { font-weight: 500; font-size: 14px; margin-bottom: 6px; padding: 0; }
.edition { display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: var(--bg); }
.edition:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.edition input { width: auto; margin-top: 4px; accent-color: var(--accent); }
.edition strong { display: block; font-size: 15px; }
.edition small { display: block; color: var(--muted); font-size: 13px; font-weight: 400; line-height: 1.4; margin-top: 2px; }
label { display: block; font-weight: 500; font-size: 14px; margin: 14px 0 6px; }
.optional { color: var(--muted); font-weight: 400; }
input { width: 100%; font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.address { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.address input { border: 0; background: transparent; min-width: 0; }
.address input:focus { outline: none; }
.address:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.address span { padding: 0 12px; color: var(--muted); white-space: nowrap; font-size: 14px; }
.note { display: block; margin-top: 6px; color: var(--muted); font-size: 13px; }
.note.good { color: var(--good); }
.note.bad, .error { color: var(--bad); }
.error { min-height: 1.5em; margin: 12px 0 0; font-size: 14px; }
button, .button { display: inline-block; width: 100%; margin-top: 8px; text-align: center; text-decoration: none; font: inherit; font-weight: 600; color: var(--accent-ink); background: var(--accent); border: 0; border-radius: 8px; padding: 12px 16px; cursor: pointer; }
button:disabled { opacity: .7; cursor: wait; }
.ready a:not(.button) { color: var(--accent); word-break: break-all; }
/* Wins over any layout rule (.pay-grid, .tabs…) so hidden parts never show half-filled. */
.hidden { display: none !important; }
.foot { max-width: 1080px; margin: 0 auto; padding: 0 16px 32px; color: var(--muted); font-size: 13px; }
/* /admin */
.admin { max-width: 1200px; margin: 0 auto; padding: 24px 16px 48px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.stat span { display: block; font-size: 12px; color: var(--muted); }
.stat strong { font-size: 22px; }
.admin-bar { display: flex; gap: 12px; flex-wrap: wrap; }
.admin-bar input { flex: 1 1 240px; width: auto; }
select { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.shops { width: 100%; border-collapse: collapse; font-size: 14px; }
.shops th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.shops td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.shops tr:last-child td { border-bottom: 0; }
.shops td small { display: block; color: var(--muted); font-size: 12px; }
.shops td small.soon { color: var(--bad); display: inline; }
.shops a { color: var(--accent); font-weight: 500; }
.shops .empty { text-align: center; color: var(--muted); padding: 24px; }
.shops .actions { white-space: nowrap; }
.shops .actions button { width: auto; margin: 0 4px 4px 0; padding: 6px 10px; font-size: 13px; font-weight: 500; background: transparent; color: var(--ink); border: 1px solid var(--line); }
.shops .actions button:hover { border-color: var(--accent); color: var(--accent); }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid currentColor; }
.pill.open { color: var(--good); }
.pill.expired, .pill.suspended { color: var(--bad); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
/* /pay */
.pay { max-width: 1080px; margin: 0 auto; padding: 24px 16px 48px; }
.pay h1 { font-size: 26px; margin: 0 0 4px; }
.pay-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; align-items: start; }
.pay .periods { margin-top: 14px; grid-template-columns: 1fr 1fr; }
.pay select { width: 100%; }
.pay select:disabled { opacity: .75; }
.sub { font-size: 16px; margin: 28px 0 0; padding-top: 20px; border-top: 1px solid var(--line); }
.tabs { display: flex; gap: 8px; margin: 16px 0 4px; flex-wrap: wrap; }
.tabs button { width: auto; margin: 0; padding: 8px 14px; font-weight: 500; background: transparent; color: var(--ink); border: 1px solid var(--line); }
.tabs button[aria-selected="true"] { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.summary { position: sticky; top: 16px; }
.summary h2 { margin-bottom: 8px; }
.bill { width: 100%; border-collapse: collapse; font-size: 14px; }
.bill td { padding: 8px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.bill td small { display: block; color: var(--muted); font-size: 12px; }
.bill tfoot td { border-bottom: 0; padding: 4px 0; color: var(--muted); }
.bill tfoot tr:first-child td { padding-top: 10px; }
.bill .grand td { color: var(--ink); font-weight: 700; font-size: 18px; padding-top: 8px; }
.num { text-align: right; white-space: nowrap; padding-left: 12px; }
/* The GST invoice: always light, made to print on A4 */
.invoice-page { background: #fff; color: #222; }
.invoice { max-width: 800px; margin: 0 auto; padding: 32px 16px; font-size: 14px; }
.invoice h1 { font-size: 20px; letter-spacing: .06em; text-transform: uppercase; margin: 0 0 8px; color: #8a5a3c; }
.invoice p { margin: 2px 0; }
.invoice-top { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; border-bottom: 2px solid #222; padding-bottom: 14px; }
.invoice-top strong { font-size: 16px; }
.invoice dl { display: grid; grid-template-columns: auto auto; gap: 2px 14px; margin: 0; align-content: start; }
.invoice dt { color: #666; }
.invoice dd { margin: 0; font-weight: 600; }
.invoice-to { padding: 14px 0; }
.invoice-to span { display: block; font-size: 12px; color: #666; text-transform: uppercase; letter-spacing: .06em; }
.invoice table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.invoice th { text-align: left; font-size: 12px; color: #666; border-bottom: 1px solid #222; padding: 6px 4px; }
.invoice td { padding: 6px 4px; border-bottom: 1px solid #ddd; vertical-align: top; }
.invoice td small { display: block; color: #666; font-size: 12px; }
.invoice tfoot td { border-bottom: 0; text-align: right; }
.invoice .num { text-align: right; }
.invoice tfoot td.num { width: 140px; }
.invoice .grand td { font-weight: 700; font-size: 16px; border-top: 2px solid #222; }
.invoice .words { font-weight: 600; margin-top: 12px; }
.invoice .paid { color: #2f7a4b; margin-top: 8px; }
.invoice .small { color: #666; font-size: 12px; margin-top: 16px; }
.invoice #print { width: auto; margin-top: 20px; }
@media print { .no-print { display: none; } .invoice { padding: 0; } }
/* /admin: payments */
.admin h2 { font-size: 18px; margin: 28px 0 10px; }
.admin .pay-off { color: var(--bad); }
@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; gap: 32px; padding-top: 24px; }
  .card { padding: 20px; }
  .pay-grid { grid-template-columns: 1fr; }
  .summary { position: static; }
}
/* What do you sell? */
#appChoices { display: grid; gap: 10px; }
.editions.apps { margin-bottom: 14px; }
