/* Unlockd by Mao. Light theme for the dashboard, dark theme for buyer galleries.
   Rules of the system:
   - Hierarchy comes from type and space, not from boxes. Surfaces have no border or shadow.
   - One accent. Lime means "action, selected or live" and nothing else.
   - Press feedback is instant; release is gentler. Only transform and opacity animate.
   - Sizes are in rem, so the layout grows with the reader's text size. */
:root {
  /* colour */
  --bg: #f5f5f7;
  --surface: #ffffff;
  --ink: #1d1d1f;
  --muted: #6a6a6f;
  --line: rgba(0,0,0,.09);
  --field-line: rgba(0,0,0,.16);
  --fill: rgba(0,0,0,.05);
  --fill-strong: rgba(0,0,0,.09);
  --accent: #d4ff3a;          /* lime */
  --accent-ink: #16161a;
  --accent-soft: rgba(212,255,58,.14);
  --primary-bg: #1d1d1f;
  --primary-ink: #ffffff;
  --selected: #1d1d1f;
  --focus: #1d1d1f;
  --danger: #c2272d;
  --ok: #1d7a3e;
  --warn-bg: #fff6d6;
  --alert-bg: #fdeaea;
  --alert-ink: #8a1c20;
  --success-bg: #e5f6ea;
  --success-ink: #14532d;
  --material: rgba(245,245,247,.72);
  --material-solid: #f5f5f7;

  /* type */
  --font: -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* space: a 4 pt scale */
  --s1: .25rem; --s2: .5rem; --s3: .75rem; --s4: 1rem; --s5: 1.25rem; --s6: 1.5rem; --s8: 2rem; --s12: 3rem;
  --gutter: var(--s4);

  /* shape */
  --radius: 1.125rem;
  --radius-control: .75rem;
  --radius-small: .5rem;
  --tap: 2.75rem;

  /* motion */
  --ease: cubic-bezier(.2,.8,.2,1);
  --release: .22s;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #000000;
  --surface: #1c1c1e;
  --ink: #f5f5f7;
  --muted: #a1a1a6;
  --line: rgba(255,255,255,.12);
  --field-line: rgba(255,255,255,.2);
  --fill: rgba(255,255,255,.09);
  --fill-strong: rgba(255,255,255,.15);
  --primary-bg: var(--accent);
  --primary-ink: #0e0e10;
  --selected: var(--accent);
  --focus: var(--accent);
  --danger: #ff7b7b;
  --ok: #58d68d;
  --warn-bg: #2a2614;
  --alert-bg: #3a1517;
  --alert-ink: #ffb4b4;
  --success-bg: #12301d;
  --success-ink: #b7f0c8;
  --material: rgba(28,28,30,.72);
  --material-solid: #1c1c1e;
  color-scheme: dark;
}

/* ---------- base */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 1.0625rem; line-height: 1.47; font-optical-sizing: auto; -webkit-font-smoothing: antialiased; }
main { max-width: 70rem; margin: 0 auto; padding: var(--s4) var(--gutter) 7.5rem; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .16em; }
a.muted { text-decoration: none; }
p { margin: 0 0 var(--s3); text-wrap: pretty; }
p:last-child { margin-bottom: 0; }
img { max-width: 100%; }
button, .btn, .chip, .card, a, label, summary { touch-action: manipulation; }

/* Tracking and leading both tighten as the type grows. */
h1 { font-size: clamp(1.75rem, 1.5rem + 1.2vw, 2.25rem); line-height: 1.12; font-weight: 700; letter-spacing: -.024em; margin: 0 0 var(--s3); text-wrap: balance; }
h2 { font-size: 1.25rem; line-height: 1.25; font-weight: 600; letter-spacing: -.016em; margin: 0 0 var(--s3); text-wrap: balance; }
h2 .muted { font-weight: 400; }

/* ---------- helpers */
.muted { color: var(--muted); }
.small { font-size: .875rem; line-height: 1.43; }
.big { font-size: 1.75rem; line-height: 1.15; font-weight: 700; letter-spacing: -.022em; font-variant-numeric: tabular-nums; }
.center { text-align: center; }
.mono { font-family: var(--mono); }
.narrow { max-width: 33.75rem; margin: 0 auto; }
.row { display: flex; align-items: center; gap: var(--s3); }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.gap { gap: var(--s2); }
.inline { display: inline; }
.stack { display: flex; flex-direction: column; gap: var(--s4); }
.stack > * { margin-bottom: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
@media (max-width: 35rem) { .grid2 { grid-template-columns: 1fr; } }
.wrap-any { overflow-wrap: anywhere; }

/* ---------- top bar: a translucent layer that content scrolls under */
.testmode { background: var(--warn-bg); color: var(--ink); text-align: center; font-size: .75rem; line-height: 1.35; font-weight: 500; padding: var(--s1) var(--s4); }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; justify-content: space-between; align-items: center; gap: var(--s1) var(--s4); padding: var(--s2) max(var(--gutter), calc((100% - 70rem) / 2 + var(--gutter))); flex-wrap: wrap; background: var(--material); -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%); box-shadow: 0 1px 0 var(--line); }
.brand { display: flex; align-items: center; gap: var(--s2); min-height: var(--tap); text-decoration: none; font-weight: 600; letter-spacing: -.016em; font-size: 1.0625rem; }
.brand-mark { display: inline-grid; place-items: center; width: 1.625rem; height: 1.625rem; border-radius: .4375rem; background: var(--ink); color: var(--accent); font-weight: 700; font-size: .875rem; letter-spacing: 0; }
.brand-by { font-weight: 400; color: var(--muted); font-size: .875rem; letter-spacing: 0; }
.topbar nav { display: flex; align-items: center; gap: var(--s1); font-size: .875rem; overflow-x: auto; scrollbar-width: none; margin-inline: calc(var(--s3) * -1); padding-inline: var(--s1); }
.topbar nav::-webkit-scrollbar { display: none; }
.topbar nav a, .topbar nav .link { display: inline-flex; align-items: center; min-height: 2.25rem; padding: 0 var(--s3); border-radius: 999px; text-decoration: none; color: var(--muted); white-space: nowrap; font-size: .875rem; transition: background-color var(--release) var(--ease), color var(--release) var(--ease); }
.topbar nav a[aria-current="page"] { color: var(--ink); background: var(--fill); font-weight: 500; }
.topbar nav form { flex: none; }
/* Logged in, the links get their own swipeable row on phones. Logged out, the one link stays beside the brand. */
@media (max-width: 40rem) { .topbar nav:has(form) { flex: 1 1 100%; } }

/* ---------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-height: var(--tap); padding: 0 var(--s4); border-radius: var(--radius-control); border: 0; background: var(--fill); color: var(--ink); font-family: var(--font); font-size: .9375rem; font-weight: 500; letter-spacing: -.005em; text-decoration: none; cursor: pointer; white-space: nowrap; transition: transform var(--release) var(--ease), background-color var(--release) var(--ease), opacity var(--release) var(--ease); }
.btn.primary { background: var(--primary-bg); color: var(--primary-ink); font-weight: 600; }
.btn.ghost { background: transparent; }
.btn.danger, .link.danger { color: var(--danger); }
.btn.small { min-height: 2.25rem; padding: 0 var(--s3); font-size: .875rem; border-radius: .625rem; }
.btn[disabled] { opacity: .4; cursor: not-allowed; }
.big-btn { min-height: 3.25rem; font-size: 1.0625rem; border-radius: .875rem; }
.link { background: none; border: 0; padding: 0; color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .16em; cursor: pointer; font: inherit; }
.topbar nav .link { text-decoration: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* Instant on press, gentle on release. */
.btn:not([disabled]):active, .chip:active, .card:active, .event-tile:active { transform: scale(.97); transition-duration: .05s; }
.card:active, .event-tile:active { transform: scale(.985); }
.btn:not([disabled]):active { background-color: var(--fill-strong); }
.btn.primary:not([disabled]):active { background-color: var(--primary-bg); opacity: .82; }
@media (hover: hover) {
  .btn:not([disabled]):hover { background-color: var(--fill-strong); }
  .btn.primary:not([disabled]):hover { background-color: var(--primary-bg); opacity: .88; }
  .btn.ghost:not([disabled]):hover { background-color: var(--fill); }
  .topbar nav a:hover, .topbar nav .link:hover { color: var(--ink); }
  .card:hover { box-shadow: inset 0 0 0 1px var(--line); }
}
/* Small controls still get a full-size tap target on touch screens. */
@media (pointer: coarse) {
  .btn.small { min-height: var(--tap); }
  .thumbs figcaption .link { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 var(--s2); }
}

/* ---------- forms */
label { display: flex; flex-direction: column; gap: var(--s2); font-weight: 500; font-size: .875rem; }
input:not([type=checkbox]):not([type=radio]):not([type=file]), textarea, select {
  width: 100%; min-height: var(--tap); padding: .625rem var(--s3); border: 1px solid var(--field-line); border-radius: var(--radius-control); background: var(--surface); color: var(--ink); font-family: var(--font); font-size: 1rem; font-weight: 400; line-height: 1.35; transition: border-color var(--release) var(--ease);
}
input:not([type=checkbox]):not([type=radio]):not([type=file]), textarea { -webkit-appearance: none; appearance: none; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--focus); outline-offset: -1px; border-color: transparent; }
::placeholder { color: var(--muted); opacity: .75; }
textarea { min-height: 6rem; resize: vertical; }
.hint { font-weight: 400; color: var(--muted); font-size: .8125rem; line-height: 1.38; }
fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--s3); min-width: 0; }
legend { font-size: 1rem; font-weight: 600; letter-spacing: -.008em; padding: 0; margin-bottom: var(--s3); }
legend .small { font-weight: 400; letter-spacing: 0; }
label.check { flex-direction: row; align-items: flex-start; gap: var(--s3); font-weight: 400; font-size: .9375rem; line-height: 1.4; }
label.check.small { font-size: .875rem; }
label.check input { margin: .125rem 0 0; width: 1.125rem; height: 1.125rem; flex: none; accent-color: var(--selected); }
.indent { margin-left: 1.875rem; }
.prefix-input { display: flex; align-items: stretch; border: 1px solid var(--field-line); border-radius: var(--radius-control); overflow: hidden; background: var(--surface); }
.prefix-input:focus-within { outline: 2px solid var(--focus); outline-offset: -1px; }
.prefix-input span { display: flex; align-items: center; padding: 0 var(--s1) 0 var(--s3); color: var(--muted); font-weight: 400; white-space: nowrap; }
.prefix-input input { border: 0 !important; padding-left: 0 !important; outline: 0 !important; }

/* ---------- messages */
.alert, .success, .notice { border-radius: var(--radius-control); padding: var(--s3) var(--s4); margin: 0 0 var(--s4); font-size: .9375rem; line-height: 1.4; }
.alert { background: var(--alert-bg); color: var(--alert-ink); }
.success { background: var(--success-bg); color: var(--success-ink); }
.notice { background: var(--warn-bg); display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; justify-content: space-between; }

/* ---------- panels, cards, pills: a surface on the page is enough, no border or shadow */
.panel { background: var(--surface); border-radius: var(--radius); padding: var(--s5); margin: var(--s3) 0; }
.panel:not(.row) > * + * { margin-top: var(--s3); }
details.panel { padding: 0; }
details.panel > *:not(summary) { margin: 0 var(--s5) var(--s5); }
details.panel summary { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); min-height: 3.5rem; padding: var(--s2) var(--s5); cursor: pointer; list-style: none; }
details.panel summary::-webkit-details-marker { display: none; }
details.panel summary h2 { margin: 0; }
details.panel summary::after { content: ""; flex: none; width: .5rem; height: .5rem; margin-right: .125rem; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform var(--release) var(--ease); }
details.panel[open] summary::after { transform: rotate(45deg); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(17.5rem, 1fr)); gap: var(--s3); }
.card { display: flex; flex-direction: column; gap: var(--s1); background: var(--surface); border-radius: var(--radius); padding: var(--s4) var(--s5); text-decoration: none; transition: transform var(--release) var(--ease), box-shadow var(--release) var(--ease); }
.card .row { align-items: flex-start; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(6.5rem, 1fr)); gap: var(--s4); }
.stats > div { display: flex; flex-direction: column; gap: 2px; }
.event-card .stats { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s4); margin-top: var(--s2); color: var(--muted); font-variant-numeric: tabular-nums; }
.pill { display: inline-block; flex: none; font-size: .75rem; line-height: 1.5; font-weight: 500; padding: .125rem .625rem; border-radius: 999px; background: var(--fill); color: var(--ink); white-space: nowrap; }
.pill.live { background: var(--accent); color: var(--accent-ink); }
.pill.closed { background: transparent; box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); }
.pill.tiny { font-size: .6875rem; padding: 0 .4375rem; }
.empty { text-align: center; padding: var(--s12) var(--s4); background: var(--surface); border-radius: var(--radius); }

/* ---------- tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9375rem; line-height: 1.4; }
th, td { text-align: left; padding: var(--s3) var(--s2); border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
th:first-child, td:first-child { padding-left: 0; }
th { color: var(--muted); font-weight: 500; font-size: .8125rem; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.actions { display: flex; gap: var(--s2); flex-wrap: wrap; }
.wrap-cell { max-width: 17.5rem; white-space: pre-wrap; }
tr.muted td { color: var(--muted); }

/* ---------- tokens and payments */
.ledger { list-style: none; margin: 0; padding: 0; }
.ledger li { padding: var(--s3) 0; border-bottom: 1px solid var(--line); }
.ledger li:last-child { border-bottom: 0; }
.ledger .plus { color: var(--ok); }
.pay-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.pay-list > li { padding: var(--s4) 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: var(--s2); }
.pay-list > li:first-child { padding-top: 0; }
.pay-list > li:last-child { border-bottom: 0; padding-bottom: 0; }
/* Tappable choices: a token pack, or how to pay. The ring is drawn inside, so nothing shifts. */
.choices { display: flex; flex-direction: column; gap: var(--s2); }
.choices label { position: relative; font-weight: 400; font-size: 1rem; }
.choices input { position: absolute; opacity: 0; pointer-events: none; }
.choices .choice { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); min-height: 3.25rem; padding: var(--s2) var(--s4); border-radius: var(--radius-control); cursor: pointer; background: var(--fill); transition: box-shadow var(--release) var(--ease), background-color var(--release) var(--ease), transform var(--release) var(--ease); }
.choices .choice:active { transform: scale(.985); transition-duration: .05s; }
.choices .choice strong { font-weight: 600; white-space: nowrap; }
.choices .choice .small { text-align: right; }
.choices input:checked + .choice { box-shadow: inset 0 0 0 2px var(--selected); background: var(--surface); }
[data-theme="dark"] .choices input:checked + .choice { background: var(--accent-soft); }
.choices input:focus-visible + .choice { outline: 2px solid var(--focus); outline-offset: 2px; }
.pay-thumbs { display: flex; gap: var(--s1); overflow-x: auto; scrollbar-width: none; }
.pay-thumbs:empty { display: none; }
.pay-thumbs img { width: 3.5rem; height: 3.5rem; object-fit: cover; border-radius: var(--radius-small); flex: none; }
.check-first { background: var(--warn-bg); border-radius: var(--radius-small); padding: var(--s2) var(--s3); margin: 2px 0; }
.select-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); min-height: var(--tap); }
.select-bar .link { min-height: var(--tap); }
.select-actions { display: flex; flex-wrap: wrap; gap: var(--s2); margin-left: auto; }
.qs-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(6rem, 1fr)); gap: 2px; }
.qs-photo { position: relative; display: block; aspect-ratio: 1; overflow: hidden; cursor: pointer; background: var(--fill); }
.qs-photo input { position: absolute; opacity: 0; }
.qs-photo img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform var(--release) var(--ease); }
.qs-photo span { position: absolute; top: var(--s2); right: var(--s2); width: 1.5rem; height: 1.5rem; border-radius: 50%; display: grid; place-items: center; background: rgba(0,0,0,.35); color: transparent; box-shadow: inset 0 0 0 1.5px #fff; font-weight: 700; font-size: .75rem; }
.qs-photo input:checked ~ span { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
.qs-photo input:checked ~ img { transform: scale(.9); }
.qs-photo input:focus-visible ~ span { outline: 2px solid var(--focus); outline-offset: 2px; }
.pay-handle { font-size: 1.375rem; line-height: 1.2; font-weight: 600; letter-spacing: -.016em; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.pay-code { font-size: 1.625rem; line-height: 1.2; font-weight: 600; letter-spacing: .01em; }

/* ---------- dashboard: share, upload, thumbs */
.share-row { display: flex; gap: var(--s2); flex-wrap: wrap; }
.share-row input { flex: 1 1 16rem; font-family: var(--mono); }
.dropzone { border: 1.5px dashed var(--field-line); border-radius: var(--radius-control); padding: var(--s6) var(--s4); text-align: center; transition: border-color var(--release) var(--ease), background-color var(--release) var(--ease); }
.dropzone.over { border-color: var(--ink); background: var(--accent-soft); }
.dropzone p { margin: var(--s1) 0; }
.dropzone label.link { display: inline; font-size: inherit; font-weight: inherit; }
.upload-progress { margin-top: var(--s3); display: flex; flex-direction: column; gap: var(--s2); align-items: center; }
.upload-progress progress { width: 100%; max-width: 26rem; accent-color: var(--selected); }
.upload-errors { text-align: left; color: var(--danger); font-size: .875rem; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr)); gap: var(--s3) var(--s1); margin-top: var(--s4); }
.thumbs figure { margin: 0; }
.thumbs img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-small); display: block; background: var(--fill); }
.thumbs figcaption { display: flex; flex-wrap: wrap; gap: 0 var(--s2); align-items: center; justify-content: center; padding-top: var(--s1); }
.thumbs figure.is-hidden img { opacity: .3; }
.logo-row { display: flex; align-items: center; gap: var(--s3); margin-top: var(--s4); }
.logo-preview { width: 3.5rem; height: 3.5rem; border-radius: var(--radius-control); object-fit: cover; }

/* ---------- home */
.hero { max-width: 42rem; padding: clamp(var(--s6), 6vw, 4.5rem) 0 var(--s8); }
.hero h1 { font-size: clamp(2.25rem, 1.6rem + 3.4vw, 3.5rem); line-height: 1.06; letter-spacing: -.032em; margin-bottom: var(--s4); }
.eyebrow { font-size: .875rem; line-height: 1.3; font-weight: 500; color: var(--muted); margin: 0 0 var(--s2); }
.lead { font-size: clamp(1.125rem, 1.05rem + .4vw, 1.3125rem); line-height: 1.42; letter-spacing: -.008em; color: var(--muted); margin-bottom: var(--s6); }
.features { list-style: none; padding: 0; margin: var(--s12) 0 var(--s6); }
.features li { padding: var(--s4) 0; border-top: 1px solid var(--line); color: var(--muted); }
.features li strong { display: block; color: var(--ink); font-weight: 600; letter-spacing: -.008em; }
.prose p { color: var(--ink); }
.prose h2 { margin-top: var(--s8); }

/* ---------- buyer gallery (dark) */
[data-theme="dark"] main { max-width: 80rem; padding-top: var(--s2); }
.gallery-head { padding: var(--s2) 0 var(--s1); }
.pg-brand { display: inline-flex; align-items: center; gap: var(--s3); min-height: var(--tap); text-decoration: none; font-weight: 600; font-size: 1rem; letter-spacing: -.008em; }
.pg-brand img, .pg-initial { width: 2.25rem; height: 2.25rem; border-radius: 50%; object-fit: cover; }
.pg-initial { display: inline-grid; place-items: center; background: var(--surface); color: var(--ink); font-weight: 600; text-transform: uppercase; }
.pg-title { margin-top: var(--s6); }
.gallery-intro { padding: var(--s3) 0 var(--s3); }
.gallery-intro h1 { margin-bottom: var(--s1); }
.gallery-intro p { margin: 2px 0; }
.price-line { font-weight: 500; margin-top: var(--s2) !important; font-variant-numeric: tabular-nums; }
/* Filters float over the photos as a material, running edge to edge. */
.chips { display: flex; gap: var(--s2); overflow-x: auto; margin-inline: calc(var(--gutter) * -1); padding: var(--s2) var(--gutter); scrollbar-width: none; position: sticky; top: 0; z-index: 5; background: rgba(0,0,0,.66); -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%); }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 2.25rem; border: 0; background: var(--fill); color: var(--ink); border-radius: 999px; padding: 0 var(--s3); font-family: var(--font); font-size: .875rem; font-weight: 500; font-variant-numeric: tabular-nums; cursor: pointer; transition: transform var(--release) var(--ease), background-color var(--release) var(--ease), color var(--release) var(--ease); }
.chip span { color: var(--muted); font-weight: 400; margin-left: var(--s1); }
.chip.active { background: var(--ink); color: var(--bg); }
.chip.active span { color: inherit; opacity: .65; }
/* Photos are the interface: tight, square, no decoration. Runs to the screen edge on phones. */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: 2px; scroll-margin-top: 3.5rem; }
@media (max-width: 30rem) { .grid { grid-template-columns: repeat(3, 1fr); margin-inline: calc(var(--gutter) * -1); } }
.tile { position: relative; background: var(--surface); aspect-ratio: 1; overflow: hidden; }
.tile[hidden] { display: none; }
.tile-open { display: block; width: 100%; height: 100%; border: 0; padding: 0; background: none; cursor: zoom-in; }
.tile-open:focus-visible { outline-offset: -3px; }
.tile img, .lightbox img, .order-grid img, .event-tile img {
  -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; pointer-events: none;
}
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform var(--release) var(--ease), opacity .3s ease; }
.tile img.loading { opacity: 0; }
.tile-open:active img { transform: scale(.97); transition-duration: .05s; }
/* The circle is its own button with a 44 px tap area; the visible dot is the span inside. */
.tile .tick { position: absolute; top: 0; right: 0; width: 2.75rem; height: 2.75rem; padding: 0; border: 0; background: none; cursor: pointer; display: grid; place-items: center; }
.tile .tick span { width: 1.5rem; height: 1.5rem; border-radius: 50%; display: grid; place-items: center; background: rgba(0,0,0,.3); color: transparent; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.95), 0 0 2px rgba(0,0,0,.4); font-weight: 700; font-size: .75rem; transition: transform var(--release) var(--ease), background-color .12s linear; }
.tile .tick:active span { transform: scale(.82); transition-duration: .05s; }
.tile.in-cart .tick span { background: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 2px #000; }
/* A selected photo steps back from the edge of its square. */
.tile.in-cart img { transform: scale(.88); }
.tile.in-cart { background: var(--fill); }
.wm-note { margin-top: var(--s6); }
.powered { text-align: center; color: var(--muted); font-size: .8125rem; padding: var(--s8) 0 var(--s2); }
.powered a { color: var(--muted); text-decoration: none; }
.event-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: var(--s4); }
.event-tile { display: block; text-decoration: none; transition: transform var(--release) var(--ease); }
.event-tile img, .event-tile .ph-missing { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; background: var(--surface); border-radius: var(--radius-control); }
.event-tile div:not(.ph-missing) { padding: var(--s2) 0 0; display: flex; flex-direction: column; }
.remove-thumbs { display: flex; flex-wrap: wrap; gap: var(--s1); }
.remove-thumb { width: 10rem; border-radius: var(--radius-small); }
.remove-thumbs .remove-thumb:not(:only-of-type) { width: 4.75rem; height: 4.75rem; object-fit: cover; }

/* cart bar: floats above the photos, moved by gallery.js */
.cartbar { position: fixed; left: var(--s3); right: var(--s3); bottom: calc(var(--s3) + env(safe-area-inset-bottom)); max-width: 40rem; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s2) var(--s2) var(--s2) var(--s4); background: var(--material); -webkit-backdrop-filter: blur(30px) saturate(180%); backdrop-filter: blur(30px) saturate(180%); border-radius: 1.25rem; box-shadow: inset 0 0 0 1px var(--line), 0 .75rem 2.5rem rgba(0,0,0,.5); z-index: 20; will-change: transform; }
.cart-info { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px var(--s2); font-variant-numeric: tabular-nums; }
.cart-info strong { font-weight: 600; }
.cart-actions { display: flex; gap: var(--s1); }
@media (max-width: 35rem) {
  .cartbar { padding: var(--s3) var(--s2) var(--s2); gap: var(--s2); }
  .cart-info { padding: 0 var(--s2); flex: 1 1 100%; }
  .cart-actions { flex: 1 1 100%; }
  .cart-actions .btn { flex: 0 0 auto; }
  .cart-actions .btn.primary { flex: 1; }
}

/* lightbox: the track holds three slides and follows the finger */
.lightbox { position: fixed; inset: 0; z-index: 30; background: rgba(0,0,0,var(--lb-o, 1)); overflow: hidden; }
.lightbox.passthrough { pointer-events: none; }
.lb-stage { position: absolute; inset: 0; touch-action: pinch-zoom; -webkit-user-select: none; user-select: none; }
.lb-track { position: absolute; inset: 0; will-change: transform; }
.lb-slide { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: calc(var(--s12) + var(--s2) + env(safe-area-inset-top)) 0 calc(7.5rem + env(safe-area-inset-bottom)); will-change: transform; }
.lb-slide img { width: 100%; max-width: 87.5rem; height: 100%; object-fit: contain; display: block; }
.lb-slide img:not([src]) { visibility: hidden; }
.lb-track.solo .lb-slide:not(.is-center) { visibility: hidden; }
.lb-close, .lb-prev, .lb-next { position: absolute; display: grid; place-items: center; width: 2.75rem; height: 2.75rem; padding: 0; background: rgba(120,120,128,.32); color: #fff; border: 0; border-radius: 50%; cursor: pointer; z-index: 2; opacity: var(--lb-o, 1); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); transition: background-color var(--release) var(--ease); }
.lb-close svg, .lb-prev svg, .lb-next svg { width: 1.125rem; height: 1.125rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lb-close:active, .lb-prev:active, .lb-next:active { background: rgba(120,120,128,.6); }
.lb-close { top: calc(var(--s2) + env(safe-area-inset-top)); right: var(--s3); }
.lb-prev { left: var(--s3); top: 50%; margin-top: -1.375rem; }
.lb-next { right: var(--s3); top: 50%; margin-top: -1.375rem; }
.lb-bar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: var(--s3) var(--s4) calc(var(--s4) + env(safe-area-inset-bottom)); display: flex; align-items: center; justify-content: space-between; gap: var(--s2) var(--s3); flex-wrap: wrap; opacity: var(--lb-o, 1); font-variant-numeric: tabular-nums; }
.lb-bar .btn { min-width: 12.5rem; }
.lb-bar.in-cart .btn { background: rgba(120,120,128,.32); color: var(--accent); }
.lb-bar a { display: inline-flex; align-items: center; min-height: 2.25rem; text-decoration: none; }
@media (max-width: 35rem) { .lb-prev, .lb-next { display: none; } .lb-bar .btn { flex: 1 1 100%; order: -1; } }

/* checkout sheet: rises from the bottom edge, and can be pulled back down by its handle */
.sheet { position: fixed; inset: 0; background: rgba(0,0,0,calc(.55 * var(--sheet-o, 1))); z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.sheet-body { width: 100%; max-width: 35rem; max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain; background: var(--surface); border-radius: 1.375rem 1.375rem 0 0; padding: 0 var(--s5) calc(var(--s5) + env(safe-area-inset-bottom)); will-change: transform; }
@media (min-width: 43.75rem) { .sheet { align-items: center; } .sheet-body { border-radius: 1.375rem; } .sheet-grab { display: none; } }
.sheet-body:focus { outline: 0; }
.sheet-body > * { flex: none; }
.sheet-head { position: sticky; top: 0; z-index: 1; margin: 0 calc(var(--s5) * -1); padding: var(--s2) var(--s5) var(--s3); background: var(--material); -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%); touch-action: none; cursor: grab; -webkit-user-select: none; user-select: none; }
@media (min-width: 43.75rem) { .sheet-head { touch-action: auto; cursor: auto; padding-top: var(--s4); } }
.sheet-grab { width: 2.25rem; height: .3125rem; margin: 0 auto var(--s2); border-radius: 999px; background: var(--fill-strong); }
.sheet-head .row { min-height: var(--s8); }
.sheet-head .link { text-decoration: none; color: var(--muted); font-size: .9375rem; padding: var(--s2) 0 var(--s2) var(--s3); }
.sheet-body h2 { margin: 0; }
.sheet-photos { display: flex; gap: var(--s1); overflow-x: auto; scrollbar-width: none; margin-inline: calc(var(--s5) * -1); padding-inline: var(--s5); }
.sheet-photos:empty { display: none; }
.sheet-photos img { width: 4rem; height: 4rem; object-fit: cover; border-radius: var(--radius-small); flex: none; pointer-events: none; }
.sum-row { display: flex; justify-content: space-between; font-variant-numeric: tabular-nums; }
.sum-row.total { font-size: 1.25rem; font-weight: 600; letter-spacing: -.016em; box-shadow: 0 -1px 0 var(--line); padding-top: var(--s3); }
.tip-choices { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--s1); }
.tip-choices label { font-weight: 500; position: relative; }
.tip-choices input { position: absolute; opacity: 0; pointer-events: none; }
.tip-choices span { display: grid; place-items: center; min-height: var(--tap); border-radius: var(--radius-control); background: var(--fill); font-size: .875rem; font-variant-numeric: tabular-nums; cursor: pointer; text-align: center; transition: box-shadow var(--release) var(--ease), background-color var(--release) var(--ease); }
.tip-choices input:checked + span { box-shadow: inset 0 0 0 2px var(--selected); background: var(--accent-soft); }
.tip-choices input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
@media (max-width: 26.25rem) { .tip-choices { grid-template-columns: repeat(3, 1fr); } }

/* order page */
.order h1 { margin-top: 0; }
.order-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: var(--s4) var(--s2); margin: var(--s4) 0; }
.order-grid figure { margin: 0; display: flex; flex-direction: column; gap: var(--s2); }
.order-grid img, .ph-missing { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-small); background: var(--surface); display: grid; place-items: center; color: var(--muted); }

/* ---------- page changes cross-fade where the browser supports it */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .18s; }

/* ---------- reader settings */
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  /* No sliding or scaling. Colour and opacity changes stay, because they carry meaning. */
  *, *::before, *::after { scroll-behavior: auto !important; }
  .btn:active, .chip:active, .card:active, .event-tile:active, .choices .choice:active, .tile-open:active img, .tile .tick:active span { transform: none !important; }
  .tile.in-cart img, .qs-photo input:checked ~ img { transform: none; opacity: .7; }
  .lightbox, .sheet, .cartbar { animation: fade-in .2s ease; }
  @view-transition { navigation: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .topbar, .chips, .cartbar, .sheet-head, .lb-close, .lb-prev, .lb-next { background: var(--material-solid); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .chips { background: var(--bg); }
  .lb-close, .lb-prev, .lb-next { color: var(--ink); }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .topbar, .cartbar, .sheet-head { background: var(--material-solid); }
  .chips { background: var(--bg); }
}
@media (prefers-contrast: more) {
  :root { --muted: #48484d; --line: rgba(0,0,0,.4); --field-line: rgba(0,0,0,.6); }
  [data-theme="dark"] { --muted: #d0d0d5; --line: rgba(255,255,255,.45); --field-line: rgba(255,255,255,.65); }
  .topbar, .cartbar, .sheet-head { background: var(--material-solid); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .chips { background: var(--bg); }
  .panel, .card { box-shadow: inset 0 0 0 1px var(--line); }
  .btn:not(.primary) { box-shadow: inset 0 0 0 1px var(--field-line); }
}
