/* Mobile first: big tap targets, nothing slow to download. The brand matches the public
   site (docs/BRAND.md, round 5): night blue, gold and cream, Outfit type. Outfit is served
   from here (32 KB, swaps in once loaded), so pay pages still ask nothing of other sites. */
@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url("fonts/outfit-latin.woff2") format("woff2");
}

:root {
  --night: #0E2238;
  --night-2: #16324F;
  --gold: #F4C95D;
  --mist: #C9D6E5;
  --ink: #0E2238;
  --muted: #3D5068;
  --bg: #F6F3EC;
  --surface: #FFFFFF;
  --line: #D6DCE4;
  --accent: #0E2238;
  --accent-ink: #FFFFFF;
  --link: #1E5A96;
  --error: #B42318;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #FFFFFF;
    --muted: #C9D6E5;
    --bg: #0E2238;
    --surface: #16324F;
    --line: #2A4B6E;
    --accent: #F4C95D;
    --accent-ink: #0E2238;
    --link: #F4C95D;
    --error: #FF8A80;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 18px/1.5 "Outfit", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

main { max-width: 32rem; margin: 0 auto; padding: 8px 16px 32px; }

.top, .bottom { max-width: 32rem; margin: 0 auto; padding: 16px; }
/* The top bar is night blue edge to edge, as on the public site. */
.top { background: var(--night); color: #FFFFFF; box-shadow: 0 0 0 100vmax var(--night); clip-path: inset(0 -100vmax); border-bottom: 1px solid rgba(255, 255, 255, 0.10); margin-bottom: 16px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 19px; color: #FFFFFF; text-decoration: none; }
.brand svg path { fill: none; stroke: var(--gold); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.brand svg .tick { stroke-width: 2.4; }
.bottom { color: var(--muted); border-top: 1px solid var(--line); margin-top: 16px; }

h1 { font-size: 1.9rem; font-weight: 500; line-height: 1.15; letter-spacing: -0.01em; margin: 8px 0 12px; }

a { color: var(--link); }

.stack { display: flex; flex-direction: column; gap: 12px; }

fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px 16px; margin: 0; display: flex; flex-direction: column; gap: 8px; }
legend { font-weight: 700; padding: 0 4px; }

label { font-weight: 600; }

input[type="text"], input:not([type]), input[type="tel"] {
  font: inherit;
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
}

input.short { width: 4.5rem; text-align: center; text-transform: uppercase; }

.choice {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-weight: 500;
}

.choice input { width: 22px; height: 22px; flex: none; }
.choice-text { display: flex; flex-direction: column; }
.fee { color: var(--muted); font-size: 0.9rem; font-weight: 400; }

button.big, a.button.big {
  display: block;
  width: 100%;
  min-height: 56px;
  font: inherit;
  font-weight: 600;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  text-align: center;
  text-decoration: none;
  padding: 14px;
}

.muted { color: var(--muted); font-size: 0.95rem; }
.error { color: var(--error); font-weight: 600; }
.big-text { font-size: 1.3rem; font-weight: 600; }
.secondary { margin-top: 24px; }

/* Demo and payee preview */
.demo-banner { background: var(--gold); color: var(--night); padding: 8px 16px; font-size: 0.95rem; text-align: center; }
.demo-banner a { color: inherit; font-weight: 600; }
.demo-links { margin-top: 32px; border-top: 1px solid var(--line); padding-top: 8px; }
.demo-links ul { padding-left: 20px; }

h2 { font-size: 1.15rem; margin: 24px 0 8px; }

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.tile-label { color: var(--muted); font-size: 0.85rem; }
.tile-value { font-size: 1.3rem; font-weight: 700; font-variant-numeric: tabular-nums; }

table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.amount { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ledger { display: block; overflow-x: auto; }
.lines tfoot th { font-size: 1.1rem; border-bottom: 0; }

.checkout { display: flex; flex-direction: column; gap: 12px; }
button.secondary-button { background: transparent; color: var(--accent); border: 2px solid var(--accent); }
.link-button { background: none; border: 0; padding: 0 0 0 6px; color: var(--accent); font: inherit; font-size: 0.85rem; text-decoration: underline; cursor: pointer; }
details summary { cursor: pointer; }

/* Public pages */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.top-links { display: flex; gap: 16px; font-size: 0.95rem; }
.top-links a { color: var(--mist); text-decoration: none; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 8px; }
.footer-links a { color: var(--muted); }

.prose { line-height: 1.6; }
.prose h2 { margin-top: 28px; }
.prose h3 { font-size: 1rem; margin: 20px 0 6px; }
.prose ol, .prose ul { padding-left: 22px; }
.prose li { margin: 6px 0; }
.prose table { margin: 8px 0 12px; }
.lead { font-size: 1.1rem; }
.legal { font-size: 0.97rem; }
.draft-notice { background: color-mix(in srgb, var(--gold) 35%, var(--surface)); color: var(--ink); border-radius: 12px; padding: 10px 12px; font-weight: 600; }
.contact dt { font-weight: 700; margin-top: 10px; }
.contact dd { margin: 2px 0 0; }
code { font-size: 0.9em; }

/* Payee area */
.pays-to { border-left: 4px solid var(--accent); padding: 4px 0 4px 12px; }
.notice { background: color-mix(in srgb, var(--accent) 15%, transparent); border-radius: 10px; padding: 10px 12px; font-weight: 600; }
.house-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.house-list a { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; text-decoration: none; color: var(--ink); }
.small-link { font-size: 0.85rem; margin-left: 6px; }
.inline-form { display: inline; }
.fine-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.fine-row input:not([type]) { flex: 1 1 10rem; width: auto; }
.fine-row input.short { flex: 0 0 6rem; }
label.inline { display: flex; align-items: center; gap: 6px; font-weight: 500; }
.text-consent { min-height: 44px; margin-top: 8px; }
.text-consent input[type=checkbox] { width: 22px; height: 22px; flex: none; }
.fine-print { color: var(--muted); font-size: 0.85rem; margin: 0; }
.pay-for { margin: 0; font-size: 0.95rem; }
.pay-for a { display: inline-block; min-height: 44px; padding: 10px 0; }
button.small { font: inherit; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--accent); background: transparent; color: var(--accent); }
select { font: inherit; min-height: 48px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); }
input.short { width: 6rem; }
.add-fine { margin-top: 16px; }

.onboarding { min-height: 320px; margin-top: 12px; }

/* What members' statements show, with a Stripe explainer */
.statement-preview { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin: 8px 0 16px; }
.statement-heading { margin: 0 0 8px; font-weight: 600; font-size: 0.95rem; }
.statement-preview dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 0 0 8px; align-items: baseline; }
.statement-preview dt { color: var(--muted); font-size: 0.9rem; }
.statement-preview dd { margin: 0; min-width: 0; }
.statement-line { font: 600 0.95rem/1.3 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--accent); overflow-wrap: anywhere; }
.info summary { color: var(--accent); font-size: 0.95rem; min-height: 44px; display: flex; align-items: center; gap: 8px; list-style: none; }
.info summary::-webkit-details-marker { display: none; }
.info-icon { display: inline-grid; place-items: center; width: 1.3em; height: 1.3em; border: 2px solid currentColor; border-radius: 50%; font: italic 700 0.8rem/1 Georgia, serif; flex: none; }
.info p { font-size: 0.95rem; margin: 6px 0; }

/* Admin: wider, for tables */
main.admin, .admin-top { max-width: 80rem; }
.admin table { margin: 8px 0 16px; }
.admin .row-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.admin .row-form input, .admin .row-form select { flex: 0 0 auto; width: 7rem; min-height: 40px; padding: 6px 8px; font-size: 0.95rem; }
.admin .row-form input[name="Reason"], .admin .row-form input[name$="Note"], .admin .row-form input[name$="Reason"] { flex: 1 1 10rem; width: auto; }
.admin .row-form select { width: auto; }
.admin .checklist label { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; }
.admin .checklist input[type=checkbox] { width: 22px; height: 22px; flex: none; margin-top: 3px; }
.status { display: inline-block; border-radius: 999px; padding: 1px 10px; font-size: 0.85rem; border: 1px solid var(--line); white-space: nowrap; }
.status.good { border-color: var(--accent); color: var(--accent); }
.status.bad { border-color: var(--error); color: var(--error); }

/* Pay page (design pass 2026-10-28): fewest taps for a returning member on a small phone. */
.house-title { margin-bottom: 4px; }
.house-title .muted { display: block; font-size: 0.95rem; font-weight: 400; margin-top: 2px; }
.payer-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; }
.name-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; }
.name-row label { display: block; margin-bottom: 8px; }
.name-row input.short { width: 4.5rem; }
.confirm { background: color-mix(in srgb, var(--accent) 12%, transparent); border-radius: 10px; padding: 10px 12px; }

.week-picks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.week-pick { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 64px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; font-weight: 500; cursor: pointer; }
.week-pick input { position: absolute; opacity: 0; pointer-events: none; }
.week-pick strong { font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.week-pick:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }

.choice:has(input:checked), .week-pick:has(input:checked) { border-color: var(--accent); border-width: 2px; background: color-mix(in srgb, var(--accent) 10%, transparent); }
.choice-text.row { flex: 1; flex-direction: row; justify-content: space-between; align-items: baseline; gap: 12px; }
.choice-text.row strong, .choice-text.row .fee { font-variant-numeric: tabular-nums; white-space: nowrap; }

details.more { border-top: 1px solid var(--line); padding-top: 4px; display: flex; flex-direction: column; gap: 8px; }
details.more > summary { min-height: 44px; display: flex; align-items: center; font-weight: 600; color: var(--accent); }
details.more[open] > summary { margin-bottom: 4px; }
details.more > .choice + .choice { margin-top: 8px; }

.refunds { font-size: 0.85rem; }
.pay-bar { display: flex; flex-direction: column; gap: 8px; }
.pay-total { margin: 0; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Receipt */
.receipt-badge { display: inline-block; margin: 8px 0 0; padding: 2px 12px; border-radius: 999px; border: 1px solid var(--line); font-weight: 700; }
.receipt-badge.good { border-color: var(--accent); color: var(--accent); }
.receipt-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; }
.receipt-facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; }
.receipt-facts dt { color: var(--muted); }
.receipt-facts dd { margin: 0; }
.reference { font: 700 1.15rem/1.3 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: 0.04em; }
a.button.secondary-button { background: transparent; color: var(--accent); border: 2px solid var(--accent); }

/* Owner pages (design pass 2026-10-28) */
.action-links { display: flex; gap: 8px; margin: 4px 0 12px; }
.action-links a.button { flex: 1; text-align: center; padding: 10px 12px; border: 1px solid var(--accent); border-radius: 10px; color: var(--accent); text-decoration: none; font-weight: 600; }
h2 .muted { font-weight: 400; font-size: 0.9rem; }
.tile-of { font-size: 0.85rem; font-weight: 400; color: var(--muted); }
.share-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin-top: 16px; }
.share-card p { margin: 0 0 8px; }
.payment-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; }
.payment-list li { border-bottom: 1px solid var(--line); padding: 10px 0; display: flex; flex-direction: column; gap: 2px; }
.payment-main, .payment-detail { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.payment-main .amount { font-weight: 700; }
.payment-detail { font-size: 0.95rem; }
.payment-detail.muted { font-size: 0.85rem; }
.house-list .status { align-self: flex-start; margin-top: 4px; }
.house-list li.archived a { opacity: 0.7; }
/* A long option (refund policies) must not push a form wider than the phone. */
fieldset { min-width: 0; }
select { max-width: 100%; text-overflow: ellipsis; }

/* Admin (design pass 2026-10-28) */
.admin-top .top-links { flex-wrap: wrap; }
.admin-top .top-links a.active { color: #FFFFFF; font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }
.admin td .row-form + .row-more, .admin td .row-form + .row-form { margin-top: 6px; }
.row-more > summary { font-size: 0.85rem; color: var(--accent); margin-top: 6px; }
.row-more[open] > summary { margin-bottom: 6px; }
.admin table td:last-child { min-width: 18rem; }
/* Wide screens: admin tables fill the page and line up; narrow ones still scroll sideways. */
@media (min-width: 900px) {
  .admin table.ledger { display: table; width: 100%; }
  .admin table.ledger th:first-child, .admin table.ledger td:first-child { width: 32%; }
}
/* Wide screens: admin tables fill the page and line up; narrow ones still scroll sideways. */
@media (min-width: 900px) {
  .admin table.ledger { display: table; width: 100%; }
  .admin table.ledger th:first-child, .admin table.ledger td:first-child { width: 32%; }
}

/* Brand (2026-10-30): white cards on cream (night-2 in dark mode), as on the public site. */
fieldset, .choice, .week-pick, .tile, .receipt-card, .share-card { background: var(--surface); }
fieldset .choice, fieldset .week-pick { background: transparent; }
.top-links { align-items: center; }
.top .link-button { color: var(--mist); }
.admin-top .top-links a { color: var(--mist); }
.receipt-badge.good { background: color-mix(in srgb, var(--gold) 30%, transparent); border-color: var(--gold); color: var(--ink); }
