/* Westside Book Club · Dark Arts bottle order */
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; }
img { max-width: 100%; }
[hidden] { display: none !important; }
/* Layout: a reading-room ledger. Seal masthead, one narrow column of bottle rows grouped by menu section, a sticky tally bar at the foot, and the club's combined order below. */
:root {
  --bg: #EDF0EA;
  --surface: #F8F9F5;
  --ink: #1B2520;
  --muted: #58665D;
  --line: #C9D1C6;
  --accent: #8A5718;
  --green: #1F4A36;
  --on-green: #F3F5EF;
  --chip: #E0E6DC;
  --ok: #2D6B47;
  --warn: #8A4B12;
  --font-display: "Libre Caslon Display", "Big Caslon", "Hoefler Text", Georgia, serif;
  --font-body: "Libre Franklin", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F1612; --surface: #16201A; --ink: #E5EAE2; --muted: #9BA89F; --line: #2B3A31;
    --accent: #D9A55C; --green: #3E8862; --on-green: #0D1410; --chip: #1F2B24; --ok: #6BC191; --warn: #E2A15E;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0F1612; --surface: #16201A; --ink: #E5EAE2; --muted: #9BA89F; --line: #2B3A31;
  --accent: #D9A55C; --green: #3E8862; --on-green: #0D1410; --chip: #1F2B24; --ok: #6BC191; --warn: #E2A15E;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { font-size: 15px; }
body { background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 15px; line-height: 1.5; }
.wrap { max-width: 760px; margin: 0 auto; padding-block: 40px 140px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
h1, h2, h3 { font-family: var(--font-display); font-weight: 400; text-wrap: balance; margin: 0; }
.mono { font-family: var(--font-mono); }
.label { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Masthead */
.mast { display: grid; grid-template-columns: 132px 1fr; gap: 24px; align-items: center; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.seal { width: 132px; height: 132px; color: var(--ink); }
.seal svg { width: 100%; height: 100%; display: block; }
.mast h1 { font-size: clamp(30px, 6vw, 44px); line-height: 1.05; }
.mast p { margin: 10px 0 0; color: var(--muted); max-width: 52ch; }
.mast .meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 14px; font-size: 13px; }
.mast .meta span { color: var(--muted); }
.mast .meta b { color: var(--ink); font-weight: 600; }
@media (max-width: 520px) { .mast { grid-template-columns: 1fr; justify-items: start; } .seal { width: 104px; height: 104px; } }

/* Member details */
.who { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 28px; }
.who .full { grid-column: 1 / -1; }
.field { display: grid; gap: 6px; min-width: 0; }
.field input, .field textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; width: 100%; }
.field textarea { min-height: 64px; resize: vertical; }
.field .req { color: var(--accent); letter-spacing: .08em; font-weight: 500; margin-left: 4px; }
.field .hint { font-size: 12px; color: var(--muted); }
.field input.bad { border-color: var(--warn); }
.field input:focus, .field textarea:focus { border-color: var(--accent); outline: none; }
@media (max-width: 520px) { .who { grid-template-columns: 1fr; } }

/* Section nav */
.nav { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--bg); margin-top: 28px; padding-block: 10px; border-bottom: 1px solid var(--line); display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.nav a { flex: none; font-size: 13px; text-decoration: none; color: var(--ink); background: var(--chip); padding: 5px 11px; border-radius: 999px; white-space: nowrap; }
.nav a:hover { background: var(--line); }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--bg); }

/* Sections */
section.menu { padding-top: 36px; scroll-margin-top: 56px; }
.sec-head { display: grid; gap: 4px; margin-bottom: 8px; }
.sec-head h2 { font-size: 28px; }
.sec-head p { margin: 0; color: var(--muted); max-width: 60ch; }
.element { margin-top: 22px; display: flex; align-items: baseline; gap: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.element h3 { font-size: 20px; }
.element span { font-size: 13px; color: var(--muted); }

.row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 20px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.row.on { background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 9%, transparent), transparent 70%); }
.row .name { font-weight: 600; font-size: 15px; letter-spacing: .01em; }
.row .name .code { font-family: var(--font-mono); font-weight: 500; color: var(--accent); margin-right: 6px; }
.row .spec { font-size: 12px; color: var(--muted); letter-spacing: .03em; text-transform: uppercase; margin-top: 2px; }
.row .notes { font-style: italic; margin-top: 4px; }
.row .price { font-size: 13px; color: var(--muted); margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.row .price b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.row .price .tbc { color: var(--warn); }
.row.out .name, .row.out .spec, .row.out .notes { opacity: .55; }
.row.out .price b { text-decoration: line-through; }
.qtys { display: grid; gap: 8px; align-content: start; justify-items: end; }
.qty { display: flex; align-items: center; gap: 8px; }
.qty .sz { font-size: 12px; color: var(--muted); font-family: var(--font-mono); min-width: 52px; text-align: right; }
.step { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.step button { width: 34px; height: 34px; border: 0; background: none; font-size: 18px; line-height: 1; color: var(--ink); }
.step button:disabled { color: var(--line); cursor: default; }
.step output { min-width: 26px; text-align: center; font-variant-numeric: tabular-nums; font-weight: 600; }
@media (max-width: 520px) { .row { grid-template-columns: 1fr; } .qtys { justify-items: start; } .qty .sz { text-align: left; } }

/* Tally bar */
.bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 8; background: var(--green); color: var(--on-green); padding-bottom: env(safe-area-inset-bottom, 0px); }
.bar .in { max-width: 760px; margin: 0 auto; padding-block: 12px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.bar .sum { font-variant-numeric: tabular-nums; }
.bar .sum b { font-size: 18px; }
.bar .sum small { opacity: .8; display: block; font-size: 12px; }
.bar button { background: var(--on-green); color: var(--green); border: 0; border-radius: 6px; padding: 10px 16px; font-weight: 700; }

/* Review */
.panel { margin-top: 44px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 22px; scroll-margin-top: 60px; }
.panel h2 { font-size: 26px; }
.panel .sub { color: var(--muted); margin: 4px 0 0; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 8px 10px 8px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tablebox { overflow-x: auto; margin-top: 14px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; align-items: center; }
.btn { border-radius: 6px; padding: 10px 16px; font-weight: 600; border: 1px solid var(--line); background: var(--bg); }
.btn.primary { background: var(--green); color: var(--on-green); border-color: var(--green); }
.btn.quiet { background: none; border-color: transparent; color: var(--muted); text-decoration: underline; padding-inline: 4px; }
.btn:disabled { opacity: .5; cursor: default; }
.status { font-size: 13px; }
.status.ok { color: var(--ok); }
.status.err { color: var(--warn); }
.empty { color: var(--muted); font-style: italic; padding: 12px 0; margin: 0; }
.copybox { width: 100%; min-height: 160px; font-family: var(--font-mono); font-size: 12px; margin-top: 12px; background: var(--bg); color: var(--ink); border: 1px solid var(--line); border-radius: 6px; padding: 10px; }
.members { display: grid; gap: 14px; margin-top: 18px; }
.member { border-top: 1px solid var(--line); padding-top: 12px; }
.member .mh { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.member .mh b { font-size: 15px; }
.member .mh span { font-size: 12px; color: var(--muted); }
.member ul { margin: 6px 0 0; padding-left: 18px; }
.member .mnote { font-size: 13px; color: var(--muted); font-style: italic; margin-top: 4px; }
.fine { font-size: 12px; color: var(--muted); margin-top: 28px; max-width: 64ch; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

/* Login */
.login { min-height: 100vh; display: grid; place-items: center; padding-block: 40px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.login form { width: 100%; max-width: 360px; display: grid; gap: 16px; justify-items: center; text-align: center; }
.login .seal { width: 120px; height: 120px; }
.login h1 { font-size: 30px; }
.login p { margin: 0; color: var(--muted); }
.login .field { width: 100%; text-align: left; }
.login .btn { width: 100%; }
.login .err { color: var(--warn); font-size: 14px; }

/* Top links */
.toplinks { display: flex; justify-content: flex-end; gap: 14px; font-size: 13px; margin-bottom: 16px; }
.toplinks a { color: var(--muted); }

/* Saved-order notice */
.notice { margin-top: 14px; padding: 12px 14px; border: 1px solid var(--accent); border-radius: 8px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; font-size: 14px; }

/* Club order (organizer) */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 24px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 14px; }
.stat b { display: block; font-family: var(--font-display); font-size: 28px; font-weight: 400; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--muted); }
.pill { display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; background: var(--chip); color: var(--muted); }
.pill.paid { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.pill.changed { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.member .mtools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; align-items: center; }
.member .mtools label { display: inline-flex; gap: 6px; align-items: center; font-size: 14px; }


/* The seal is drawn as a mask so it takes the ink color in light and dark mode. */
.seal { background: var(--ink); -webkit-mask: url(/seal.svg) center / contain no-repeat; mask: url(/seal.svg) center / contain no-repeat; }
