/* Layout: storefront grid for the public, dense tables for the admin, one shared token set */
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --ink: #1b2233;
  --muted: #5d6578;
  --line: #dfe3ea;
  --red: #CD4446;
  --red-dark: #b3373a;
  --navy: #0A3161;
  --navy-dark: #082647;
  --cream: #FAF2EA;
  --sky: #e8f1fb;
  --good: #1f7a4a;
  --good-bg: #e6f4ec;
  --warn: #8a5a00;
  --warn-bg: #fff4dc;
  --bad: #a3262c;
  --bad-bg: #fde8e8;
  --display: "Roboto", "Helvetica Neue", Arial, sans-serif;
  --body: "Inter", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.5; }
img { max-width: 100%; display: block; }
a { color: var(--navy); }
button, input, select, textarea { font: inherit; }
h1, h2, h3 { font-family: var(--display); line-height: 1.2; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; }
p { margin: 0; }
.small { font-size: 13px; color: var(--muted); }
.mono { font-family: var(--mono); font-size: 13px; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }

.mockbar { background: var(--navy); color: #fff; font-size: 13px; padding: 6px 16px; display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap; }
.mockbar a { color: #fff; }
.mockbar button { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.5); border-radius: 4px; padding: 1px 8px; cursor: pointer; font-size: 12px; }

header.site { background: #fff; box-shadow: 0 1px 0 rgba(10,49,97,.08); position: sticky; top: 0; z-index: 20; }
header.site .hwrap { max-width: 1140px; margin: 0 auto; min-height: 87px; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
header.site .logo img { width: 160px; height: auto; display: block; }
header.site nav { display: flex; align-items: center; gap: 4px; }
header.site nav a { font-family: "Roboto", sans-serif; font-size: 14px; font-weight: 700; color: #54595F; text-decoration: none; padding: 10px 8px; position: relative; letter-spacing: .01em; }
header.site nav a:hover, header.site nav a.active { color: var(--red); }
header.site nav a.active::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: 2px; height: 2px; background: var(--red); }
header.site nav a.gi { color: var(--navy); margin-left: 16px; border-radius: 8px; padding: 8px 12px; }
header.site nav a.gi:hover { background: var(--navy-dark); color: #fff; }
header.site nav a.donate { background: var(--red); color: #fff; border-radius: 8px; padding: 8px 18px; margin-left: 6px; }
header.site nav a.donate:hover { color: #fff; filter: brightness(.95); }
header.site .cartlink { display: inline-flex; align-items: center; gap: 2px; color: var(--navy); text-decoration: none; padding: 10px 6px; min-height: 44px; order: 3; }
header.site .logo { order: 1; } header.site nav { order: 2; } header.site .menutoggle { order: 4; }
.cartlink span { display: inline-block; min-width: 20px; text-align: center; background: var(--red); color: #fff; border-radius: 10px; font-size: 11px; line-height: 18px; padding: 0 5px; }
.menutoggle { display: none; background: none; border: 0; color: var(--navy); cursor: pointer; padding: 6px; }
@media (max-width: 1024px) {
  .menutoggle { display: block; min-width: 44px; min-height: 44px; }
  header.site .logo { margin-right: auto; }
  header.site .logo img { width: 140px; }
  header.site nav { order: 5; }
  header.site .hwrap { min-height: 64px; }
  header.site .hwrap { flex-wrap: wrap; }
  header.site nav { display: none; flex-basis: 100%; flex-direction: column; align-items: stretch; padding-bottom: 12px; }
  header.site nav.open { display: flex; }
  header.site nav a { font-size: 18px; font-weight: 300; padding: 12px 8px; }
  header.site nav a.active { background: var(--navy); color: #fff; }
  header.site nav a.active::after { display: none; }
  header.site nav a.gi, header.site nav a.donate { margin-left: 0; }
  header.site nav a.donate { text-align: center; font-weight: 700; }
}

main { max-width: 72rem; margin: 0 auto; padding-inline: 16px; padding-block: 24px 48px; display: grid; gap: 28px; }
footer.site { background: var(--navy) url(img/wp-footer-bkg.png) center bottom / cover no-repeat; color: #fff; font-size: 15px; }
footer.site .fwrap { max-width: 1140px; margin: 0 auto; padding: 48px 16px 32px; display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 32px; }
footer.site .fcol { display: grid; gap: 8px; align-content: start; }
footer.site h4 { font-family: "Roboto", sans-serif; font-weight: 900; font-size: 15px; margin: 6px 0 4px; color: #fff; }
footer.site a { color: #fff; text-decoration: none; font-family: "Roboto", sans-serif; font-weight: 300; }
footer.site a:hover { text-decoration: underline; }
footer.site p { margin: 0; color: rgba(255,255,255,.85); }
footer.site .flogo { width: 180px; height: auto; }
footer.site .fmail { display: inline-flex; align-items: center; gap: 8px; font-weight: 400; }
footer.site .fbtn { display: inline-block; justify-self: start; background: var(--red); color: #fff; font-weight: 700; padding: 8px 22px; border-radius: 4px; margin-bottom: 8px; }
footer.site .social { display: flex; gap: 14px; }
footer.site .fbottom { background: var(--navy-dark); text-align: center; font-size: 11px; padding: 12px 16px; color: rgba(255,255,255,.85); }

.hero { border-radius: 10px; overflow: hidden; position: relative; background: var(--navy) url(img/hero.jpg) center/cover; color: #fff; padding: 40px 28px; display: grid; gap: 10px; }
.hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(29,43,74,.92), rgba(29,43,74,.55)); }
.hero > * { position: relative; max-width: 36rem; }
.hero h1 { color: #fff; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 18px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; display: grid; grid-template-rows: auto 1fr; text-decoration: none; color: inherit; }
.card:hover { border-color: var(--red); }
.card .body { padding: 12px 14px 14px; display: grid; gap: 6px; align-content: start; }
.cover { aspect-ratio: 5.5 / 8.5; width: 100%; height: auto; max-width: 100%; object-fit: contain; background: var(--sky); }
.cover.ph { display: grid; place-items: center; text-align: center; padding: 16px; font-family: var(--display); font-weight: 800; font-size: 1.3rem; color: #fff; }
.cover.ph small { display: block; font-family: var(--body); font-weight: 600; font-size: 12px; opacity: .85; margin-top: 8px; }

.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 10px; letter-spacing: .02em; justify-self: start; }
.pill.free { background: var(--good-bg); color: var(--good); }
.pill.pwyc { background: var(--sky); color: var(--navy); }
.pill.set { background: #eef0f4; color: var(--ink); }
.pill.st-received { background: #eef0f4; color: var(--ink); }
.pill.st-held { background: var(--warn-bg); color: var(--warn); }
.pill.st-sent { background: var(--sky); color: var(--navy); }
.pill.st-invoiced { background: var(--sky); color: var(--navy); }
.pill.st-shipped { background: var(--good-bg); color: var(--good); }
.pill.st-refunded { background: var(--bad-bg); color: var(--bad); }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 18px; display: grid; gap: 14px; min-width: 0; }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.cols-main { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 48rem) { .two, .cols-main { grid-template-columns: 1fr; } }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--red); color: #fff; border: 0; border-radius: 6px; padding: 10px 18px; font-weight: 700; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--red-dark); }
.btn.secondary { background: var(--surface); color: var(--navy); border: 1px solid var(--navy); }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid #f2b8bb; outline-offset: 2px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

label { display: grid; gap: 4px; font-weight: 600; font-size: 14px; }
input, select, textarea { border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; background: #fff; color: var(--ink); width: 100%; font-weight: 400; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.row > * { flex: 1 1 8rem; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 22px; padding: 5px 16px; min-height: 44px; cursor: pointer; font-weight: 600; }
.chip.on { border-color: var(--red); background: var(--red); color: #fff; }

.tablewrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; white-space: nowrap; }
tr.total td { font-weight: 700; border-top: 2px solid var(--ink); }

.sum { display: grid; gap: 6px; }
.sum div { display: flex; justify-content: space-between; gap: 12px; }
.sum .grand { border-top: 2px solid var(--ink); padding-top: 8px; font-weight: 700; font-size: 1.1rem; }

.note { border-left: 4px solid var(--navy); background: var(--sky); padding: 10px 14px; font-size: 14px; border-radius: 0 6px 6px 0; }
.note.warn { border-color: var(--warn); background: var(--warn-bg); }
.note.good { border-color: var(--good); background: var(--good-bg); }
.note.bad { border-color: var(--bad); background: var(--bad-bg); }

.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.tabs a { padding: 8px 14px; text-decoration: none; font-weight: 700; color: var(--muted); border-bottom: 3px solid transparent; }
.tabs a.on { color: var(--ink); border-color: var(--red); }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 12px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; display: grid; gap: 2px; }
.tile b { font-family: var(--display); font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.tile span { font-size: 13px; color: var(--muted); }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.steps li { display: grid; grid-template-columns: 1.6rem 1fr; gap: 8px; padding: 6px 0; }
.steps li::before { content: "○"; color: var(--muted); }
.steps li.done::before { content: "●"; color: var(--good); }
.check { color: var(--good); font-weight: 700; }
.x { color: var(--bad); font-weight: 700; }
pre.payload { background: #0f1626; color: #d8e2f2; padding: 14px; border-radius: 6px; overflow-x: auto; font-family: var(--mono); font-size: 12.5px; line-height: 1.5; margin: 0; }
@media (prefers-reduced-motion: no-preference) { .card, .btn { transition: border-color .15s, background .15s; } }
main { grid-template-columns: minmax(0, 1fr); }
main > *, .two > *, .cols-main > *, .panel > * { min-width: 0; }
.mockbar { text-align: center; }
.mockbar > * { min-width: 0; }
pre.payload { white-space: pre; max-width: 100%; }

/* Phone-first touch and layout rules */
.btn { min-height: 44px; }
input, select, textarea { min-height: 44px; font-size: 16px; }
input[type=checkbox] { min-height: 0; }
@media (max-width: 600px) {
  main { padding-block: 16px 32px; gap: 20px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .card .body { padding: 10px; }
  .card h3 { font-size: 15px; }
  .hero { padding: 24px 18px; }
  .hero h1 { font-size: 1.5rem; }
  .two { grid-template-columns: 1fr !important; }
  .two > div > .cover { max-width: 260px; margin: 0 auto; display: block; }
  .row { flex-direction: column; align-items: stretch; }
  .row > * { flex: 0 0 auto; }
  .btn { width: 100%; }
  footer.site .fwrap { padding: 32px 16px 24px; gap: 24px; }
}
