:root {
  --cream: #f8f3ec;
  --paper: #fffdf9;
  --ink: #3b2420;
  --ink-soft: #6f5a52;
  --line: #e6dbcf;
  --accent: #7a2e3a;
  --accent-soft: #f1e1e0;
  --ok: #3f6b4a;
  --warn: #9a5b12;
  --danger: #a23131;
  --radius: 16px;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--cream); color: var(--ink);
  font: 16px/1.5 var(--sans); min-height: 100vh; min-height: 100dvh;
}
a { color: var(--accent); }
img, video { max-width: 100%; display: block; }
.wrap { max-width: 560px; margin: 0 auto; padding: 24px max(16px, env(safe-area-inset-right)) calc(64px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
.wrap.wide { max-width: 1100px; }

/* hero */
.hero { text-align: center; padding: 28px 8px 20px; }
.pill {
  display: inline-block; padding: 5px 14px; border-radius: 999px; background: var(--paper);
  border: 1px solid var(--line); font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
}
.hero h1 { font: 500 44px/1.1 var(--serif); margin: 14px 0 8px; }
.meta { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }
.lede { font: italic 20px/1.4 var(--serif); color: var(--ink-soft); margin: 18px 0 0; }

/* cards & forms */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.stack > * + * { margin-top: 14px; }
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
input[type=text], input[type=password], input[type=date], textarea {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--field, #fff); color: var(--ink); font: 16px var(--sans);
}
textarea { min-height: 84px; resize: vertical; }
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.hint { font-size: 12px; color: var(--ink-soft); margin-top: 6px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 18px; border-radius: 999px; border: 1px solid transparent; cursor: pointer;
  font: 600 15px var(--sans); text-decoration: none; background: var(--accent); color: var(--on-accent, #fff);
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .5; cursor: default; }
.btn.block { width: 100%; }
.btn.ghost { background: var(--paper); color: var(--ink); border-color: var(--line); }
.btn.small { padding: 8px 12px; font-size: 13px; }
.btn.danger { background: var(--paper); color: var(--danger); border-color: #e9c9c9; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }
.center { text-align: center; }
.muted { color: var(--ink-soft); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* upload queue */
.queue { list-style: none; padding: 0; margin: 0; }
.queue li { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.queue li:first-child { border-top: 0; }
.queue .thumb { width: 52px; height: 52px; border-radius: 10px; background: var(--accent-soft); object-fit: cover; flex: none; }
.queue .info { flex: 1; min-width: 0; }
.queue .name { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.queue .status { font-size: 12px; color: var(--ink-soft); }
.queue .status.ok { color: var(--ok); }
.queue .status.err { color: var(--danger); }
.bar { height: 6px; background: var(--accent-soft); border-radius: 99px; overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }

.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(140px);
  background: #2a201d; color: #fff; padding: 12px 18px; border-radius: 999px; font-size: 14px;
  transition: transform .25s; z-index: 50; max-width: calc(100% - 32px); text-align: center;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* gallery */
.grid { columns: 2; column-gap: 10px; }
@media (min-width: 700px) { .grid { columns: 3; } }
@media (min-width: 1000px) { .grid { columns: 4; } }
.tile {
  break-inside: avoid; margin-bottom: 10px; border-radius: 14px; overflow: hidden; background: var(--paper);
  border: 1px solid var(--line); position: relative; cursor: pointer;
}
.tile img, .tile video { width: 100%; height: auto; background: var(--accent-soft); }
.tile .play {
  position: absolute; top: 10px; right: 10px; background: rgba(0,0,0,.55); color: #fff; border-radius: 99px;
  font-size: 11px; padding: 3px 9px;
}
.tile .cap { padding: 8px 10px 10px; font-size: 12px; color: var(--ink-soft); }
.tile .cap b { display: block; font-weight: 600; color: var(--ink); }
.tile .cap i { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin-top: 2px; font: italic 15px/1.3 var(--serif); color: var(--ink); }
.tile.wish { padding: 16px; cursor: default; background: var(--accent-soft); border-color: transparent; }
.tile.wish p { font: italic 19px/1.35 var(--serif); margin: 0 0 8px; color: var(--ink); }
.tile.wish span { font-size: 12px; color: var(--ink-soft); }
.tile.noprev { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; text-align: center; padding: 12px; font-size: 13px; color: var(--ink-soft); }
.tile.new { animation: pop .5s ease; }
@keyframes pop { from { transform: scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }

.lightbox {
  position: fixed; inset: 0; background: rgba(20,12,10,.94); z-index: 40; display: none;
  flex-direction: column; align-items: center; justify-content: center; padding: 56px 12px 16px;
}
.lightbox.open { display: flex; }
.lightbox .media { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; width: 100%; }
.lightbox img, .lightbox video { max-height: 100%; max-width: 100%; object-fit: contain; border-radius: 8px; }
.lightbox .lb-cap { color: #f3e8e0; text-align: center; padding: 12px 8px 4px; font-size: 14px; }
.lightbox .lb-cap em { font: italic 18px var(--serif); display: block; }
.lb-btn {
  position: absolute; background: rgba(255,255,255,.12); color: #fff; border: 0; width: 44px; height: 44px;
  border-radius: 99px; font-size: 22px; cursor: pointer;
}
.lb-close { top: 10px; right: 10px; }
.lb-prev { left: 10px; top: 50%; }
.lb-next { right: 10px; top: 50%; }

.empty { text-align: center; padding: 48px 16px; color: var(--ink-soft); }
.empty h2 { font: 500 28px var(--serif); color: var(--ink); margin: 0 0 6px; }

/* admin */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 10px; text-align: center; }
.stat b { display: block; font: 600 22px var(--serif); }
.stat span { font-size: 11px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .08em; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; }
.switch input { width: 46px; height: 26px; accent-color: var(--accent); flex: none; }
.switch .hint { display: block; margin-top: 2px; }
.admin-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 700px) { .admin-grid { grid-template-columns: repeat(4, 1fr); } }
.aitem { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.aitem.hidden { opacity: .55; }
.aitem .pv { text-decoration: none; color: var(--ink); aspect-ratio: 1; background: var(--accent-soft); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.aitem .pv img, .aitem .pv video { width: 100%; height: 100%; object-fit: cover; }
.aitem .pv p { font: italic 15px var(--serif); padding: 10px; margin: 0; }
.aitem .ab { padding: 8px; font-size: 12px; }
.aitem { min-width: 0; }
.aitem .acts { display: flex; gap: 6px; padding: 0 8px 8px; margin-top: auto; }
.aitem .acts .btn { flex: 1 1 0; min-width: 0; padding: 8px 4px; font-size: 12px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs button { border: 1px solid var(--line); background: var(--paper); border-radius: 99px; padding: 7px 14px; font: 600 13px var(--sans); color: var(--ink); cursor: pointer; }
.tabs button.on { background: var(--ink); color: var(--on-ink, #fff); border-color: var(--ink); }
.linkrow { display: flex; gap: 8px; align-items: center; }
.linkrow code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px; font-size: 12px; }
.qr { width: 160px; border-radius: 12px; border: 1px solid var(--line); background: #fff; }
.evlist .card + .card { margin-top: 10px; }
.evlist h3 { font: 500 24px var(--serif); margin: 0; }

/* guest cancel / remove */
.qact {
  flex: none; width: 40px; height: 40px; border-radius: 99px; border: 1px solid var(--line); background: var(--paper);
  color: var(--ink-soft); font-size: 15px; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.qact.text { width: auto; padding: 0 12px; font: 600 13px var(--sans); color: var(--danger); border-color: #e9c9c9; }
.qact[disabled] { opacity: .5; }
.queue li.gone { opacity: .5; }
.queue .wishthumb { display: flex; align-items: center; justify-content: center; font-size: 22px; }
.queue .retry { margin-top: 8px; }
.tile .mine {
  position: absolute; top: 8px; left: 8px; z-index: 2; border: 0; border-radius: 99px; padding: 5px 10px;
  background: rgba(255,255,255,.92); color: var(--danger); font: 600 12px var(--sans); cursor: pointer;
}
.tile.wish .mine { top: auto; bottom: 8px; left: auto; right: 8px; }
.tile.removing { opacity: .4; pointer-events: none; }
.lb-cap .lb-remove { margin-top: 10px; background: rgba(255,255,255,.14); color: #fff; border: 0; border-radius: 99px; padding: 8px 14px; font: 600 13px var(--sans); cursor: pointer; }

select {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--field, #fff);
  color: var(--ink); font: 16px var(--sans); appearance: auto;
}
.evlist .settings select { padding: 8px 10px; font-size: 13px; border-radius: 99px; }
.hint.warn, .banner.warn { color: var(--warn); }
.banner { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 14px; }
.banner.warn { background: #fbf1e2; border-color: #ecd6b3; }

/* language switch */
.wrap { position: relative; }
.langsw { position: absolute; top: 14px; right: 16px; display: flex; background: var(--paper); border: 1px solid var(--line); border-radius: 99px; padding: 3px; z-index: 3; }
.langsw button { border: 0; background: transparent; color: var(--ink-soft); font: 600 12px var(--sans); letter-spacing: .06em; padding: 6px 11px; border-radius: 99px; cursor: pointer; }
.langsw button.on { background: var(--ink); color: var(--on-ink, #fff); }

/* themes: hide the page until its theme is applied (theme.js removes this, max 2.5s) */
html.theming body { visibility: hidden; }
html.dark-theme input::placeholder, html.dark-theme textarea::placeholder { color: var(--ink-soft); opacity: .8; }
html.dark-theme select { color-scheme: dark; }

/* theme picker */
.tp-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 18px; align-items: start; }
.tp-left { min-width: 0; }
@media (max-width: 640px) {
  .tp-wrap { grid-template-columns: minmax(0, 1fr); }
  .tp-preview { justify-self: center; order: -1; transform: scale(.85); transform-origin: top center; margin-bottom: -54px; }
}
.tp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.tp-sw {
  border: 2px solid var(--line); border-radius: 12px; background: var(--p); color: var(--i); padding: 10px 8px 8px;
  cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px; -webkit-tap-highlight-color: transparent;
}
.tp-sw[aria-checked="true"] { border-color: var(--ink); box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--ink); }
.tp-dots { display: flex; }
.tp-dots i { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--p); margin-left: -6px; box-shadow: 0 0 0 1px rgba(0,0,0,.08); }
.tp-dots i:first-child { margin-left: 0; }
.tp-name { font-size: 14px; line-height: 1.15; text-align: center; }
.tp-colour { display: flex; gap: 8px; align-items: center; }
.tp-colour input[type=color] { width: 48px; height: 42px; border: 1px solid var(--line); border-radius: 10px; padding: 2px; background: #fff; }
.tp-preview { width: 220px; border-radius: 28px; padding: 8px; background: #1b1b1b; box-shadow: 0 10px 30px rgba(0,0,0,.18); }
.tp-screen { border-radius: 21px; background: var(--cream); color: var(--ink); padding: 18px 12px 14px; text-align: center; min-height: 360px; }
.tp-screen .pill { font-size: 9px; padding: 3px 9px; background: var(--paper); border-color: var(--line); color: var(--ink); }
.tp-h { font: 500 28px/1.1 var(--serif); margin: 10px 0 6px; }
.tp-lede { font: italic 14px var(--serif); color: var(--ink-soft); margin-bottom: 12px; }
.tp-card { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 10px; text-align: left; }
.tp-field { background: var(--field, #fff); border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; font-size: 11px; color: var(--ink-soft); margin-bottom: 8px; }
.tp-btn { padding: 9px 10px; font-size: 11px; }
.tp-wish { margin-top: 10px; background: var(--accent-soft); border-radius: 10px; padding: 10px; text-align: left; }
.tp-wish i { display: block; font: italic 15px/1.3 var(--serif); color: var(--ink); }
.tp-wish span { font-size: 10px; color: var(--ink-soft); }
.tp-opts { display: grid; grid-template-columns: 1fr auto; gap: 12px; margin-top: 14px; align-items: end; }
@media (max-width: 640px) { .tp-opts { grid-template-columns: 1fr; } }

/* ============ Design styles (themes.json → styles). Classic = the base look above. ============ */
/* Backgrounds apply to the page body or the picker's phone preview — never to the dark live wall. */

/* Minimal: no boxes, hairlines, lots of air */
.style-minimal :is(.card, .tp-card) { background: transparent; border-color: transparent; box-shadow: none; }
.style-minimal .card { padding-left: 2px; padding-right: 2px; }
.style-minimal .pill { border-color: transparent; background: transparent; padding: 0; }
.style-minimal :is(input[type=text], textarea, .tp-field) { background: transparent; border-width: 0 0 1px; border-radius: 0; padding-left: 0; }
.style-minimal :is(.btn, .tp-btn) { border-radius: 10px; }
.style-minimal :is(.hero h1, .tp-h) { font-weight: 400; }
.style-minimal .tile { border-color: transparent; border-radius: 6px; }

/* Gradient: colour fade background, frosted cards, gradient buttons */
.style-gradient:is(body:not(.wall), .tp-screen) {
  background: var(--cream);
  background: linear-gradient(165deg, var(--accent-soft) 0%, var(--cream) 45%, color-mix(in srgb, var(--accent) 18%, var(--cream)) 100%);
}
body.style-gradient:not(.wall) { background-attachment: fixed; }
.style-gradient :is(.card, .tp-card, .tile:not(.wish), .pill) {
  background: color-mix(in srgb, var(--paper) 70%, transparent);
  border-color: color-mix(in srgb, #ffffff 50%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.style-gradient :is(.card, .tp-card) { box-shadow: 0 10px 30px rgba(0,0,0,.07); }
.style-gradient :is(.btn:not(.ghost):not(.danger), .tp-btn) {
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 62%, #000));
}
.wall.style-gradient { background: linear-gradient(160deg, var(--wbg) 30%, color-mix(in srgb, var(--accent) 35%, var(--wbg))); }

/* Elegant: dotted paper, ornament under the title, double-framed cards */
.style-elegant:is(body:not(.wall), .tp-screen) {
  background-color: var(--cream);
  background-image: radial-gradient(color-mix(in srgb, var(--accent) 16%, transparent) 1px, transparent 1.5px);
  background-size: 18px 18px;
}
.style-elegant .hero::before {
  content: ""; display: block; width: 140px; height: 1px; margin: 0 auto 16px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}
.style-elegant :is(.hero h1, .tp-h)::after {
  content: "❦"; display: block; font-size: .42em; line-height: 1; margin-top: .35em; color: var(--accent); font-style: normal;
}
.style-elegant :is(.card, .tp-card) {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow: inset 0 0 0 4px var(--paper), inset 0 0 0 5px color-mix(in srgb, var(--accent) 30%, transparent);
}
.style-elegant .card { padding: 22px; }
.style-elegant .pill { border-color: var(--accent); }
.style-elegant .tile { border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.wall.style-elegant .w-side { background-image: radial-gradient(color-mix(in srgb, var(--wgold) 18%, transparent) 1px, transparent 1.5px); background-size: 18px 18px; }

/* Modern: bold ink borders and offset block shadows */
.style-modern :is(.card, .tp-card, .tile) { border: 2px solid var(--ink); border-radius: 8px; box-shadow: 5px 5px 0 var(--accent); }
.style-modern .tile.wish { box-shadow: 5px 5px 0 var(--ink); }
.style-modern :is(.btn, .tp-btn) { border-radius: 8px; border: 2px solid var(--ink); }
.style-modern :is(input[type=text], textarea, .tp-field) { border: 2px solid var(--ink); border-radius: 6px; }
.style-modern .pill { border: 2px solid var(--ink); border-radius: 6px; font-weight: 600; }
.style-modern :is(.hero h1, .tp-h) { font-weight: 700; letter-spacing: -.01em; }
.style-modern .langsw { border: 2px solid var(--ink); }

/* Songket: woven diamond lattice, accent bands */
.style-songket:is(body:not(.wall), .tp-screen) {
  background-color: var(--cream);
  background-image:
    repeating-linear-gradient(45deg, color-mix(in srgb, var(--accent) 11%, transparent) 0 1px, transparent 1px 15px),
    repeating-linear-gradient(-45deg, color-mix(in srgb, var(--accent) 11%, transparent) 0 1px, transparent 1px 15px);
}
.style-songket :is(.card, .tp-card) { border-top: 4px solid var(--accent); }
.style-songket .pill { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.style-songket :is(.hero h1, .tp-h) { text-shadow: 0 1px 0 var(--paper); }
.wall.style-songket .w-side {
  background-image:
    repeating-linear-gradient(45deg, color-mix(in srgb, var(--wgold) 12%, transparent) 0 1px, transparent 1px 15px),
    repeating-linear-gradient(-45deg, color-mix(in srgb, var(--wgold) 12%, transparent) 0 1px, transparent 1px 15px);
}
.tp-styles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.tp-st {
  border: 2px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--ink); padding: 10px 12px;
  text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 2px; -webkit-tap-highlight-color: transparent;
}
.tp-st b { font-size: 14px; }
.tp-st span { font-size: 11px; color: var(--ink-soft); }
.tp-st[aria-checked="true"] { border-color: var(--ink); box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--ink); }
.tp-screen { overflow: hidden; }


/* ============ Layout pieces added in the audit ============ */
.hero.compact { padding: 12px 8px 4px; }
.hero.compact h1 { font-size: 38px; margin: 10px 0 6px; }

/* Form rows that stack on narrow screens instead of squeezing text */
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }

/* Button groups: equal widths, never wrap mid-label */
.btn-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.btn-grid.two { grid-template-columns: 1fr 1fr; }
.btn-grid .btn { white-space: nowrap; }

/* Folded setup sections on the event admin page */
.sections { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.sec, .sec-body, .card { min-width: 0; }
.sec { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.sec > summary {
  list-style: none; cursor: pointer; padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  -webkit-tap-highlight-color: transparent; border-radius: var(--radius);
}
.sec > summary::-webkit-details-marker { display: none; }
.sec > summary b { display: block; font-size: 15px; }
.sec > summary .hint { display: block; margin-top: 2px; }
.sec > summary::after {
  content: ""; flex: none; width: 9px; height: 9px; margin-right: 4px;
  border-right: 2px solid var(--ink-soft); border-bottom: 2px solid var(--ink-soft); transform: rotate(45deg) translateY(-3px); transition: transform .2s;
}
.sec[open] > summary::after { transform: rotate(-135deg) translateY(-2px); }
.sec[open] > summary { border-bottom: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0; }
.sec-body { padding: 16px 18px 18px; }
.share { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 14px; }
.share .qr { width: 132px; flex: none; }
@media (max-width: 480px) { .share .qr { width: 160px; margin: 0 auto; } .share > .stack { flex-basis: 100%; } }

.media-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.media-head h2 { font: 500 26px var(--serif); margin: 0; }
.tabs { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: none; }

/* Events page cards */
.ev h3 { margin-bottom: 2px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips a {
  font: 600 13px var(--sans); color: var(--ink); text-decoration: none; padding: 7px 12px;
  border: 1px solid var(--line); border-radius: 99px; background: var(--paper);
}
.settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.mini { display: block; margin: 0; }
.mini > span { display: block; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 4px; }
.evlist .settings select { width: 100%; padding: 9px 10px; font-size: 14px; border-radius: 10px; }
.linklike { justify-self: start; align-self: flex-start; background: none; border: 0; padding: 4px 0; font: 600 13px var(--sans); cursor: pointer; color: var(--ink-soft); }
.linklike.danger { color: var(--danger); }

/* Accessibility */
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.sec > summary:focus-visible { outline-offset: -3px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Never let the page scroll sideways on a phone ("clip" keeps sticky headers working; "hidden" is the fallback) */
html, body { overflow-x: hidden; }
@supports (overflow-x: clip) { html, body { overflow-x: clip; } }


/* ============ Phase 1: cover, gallery polish, frames, blessings ============ */

/* Cover photo behind the guest-page title */
body.cover-banner .hero {
  position: relative; isolation: isolate; color: #fff; margin: -24px calc(-1 * max(16px, env(safe-area-inset-left))) 18px;
  padding: calc(76px + env(safe-area-inset-top)) 22px 34px; min-height: 340px; min-height: min(62vh, 520px);
  display: flex; flex-direction: column; justify-content: flex-end;
  background: #222 var(--cover) center / cover no-repeat;
  border-radius: 0 0 28px 28px; overflow: hidden;
}
body.cover-banner .hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(0,0,0,.18) 0%, rgba(0,0,0,.05) 35%, rgba(0,0,0,.62) 100%);
}
body.has-cover .hero::before { display: none; }
body.has-cover .hero h1 { color: #fff; text-shadow: 0 2px 18px rgba(0,0,0,.35); }
body.has-cover .hero h1::after { color: #fff !important; }
body.has-cover .hero .meta, body.has-cover .hero .lede { color: rgba(255,255,255,.9); }
body.has-cover .hero .pill { align-self: center; background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.5); color: #fff; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
body.has-cover .wrap > .langsw { background: rgba(255,255,255,.9); }
@media (min-width: 600px) { body.cover-banner .hero { margin-left: 0; margin-right: 0; border-radius: 0 0 28px 28px; } }

/* Admin cover picker */
.cover-row { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.cover-pv { width: 180px; aspect-ratio: 16 / 10; border-radius: 12px; background: var(--accent-soft); overflow: hidden; display: flex; align-items: center; justify-content: center; flex: none; border: 1px solid var(--line); }
.cover-pv img { width: 100%; height: 100%; object-fit: cover; }
.cover-pv span { font-size: 12px; color: var(--ink-soft); }
@media (max-width: 480px) { .cover-pv { width: 100%; } }

/* Checkbox row */
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 500; font-size: 13px; color: var(--ink-soft); margin: 8px 0 0; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--accent); flex: none; }

/* Gallery: sticky header + sticky share button */
.topbar {
  position: sticky; top: 0; z-index: 20; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 8px;
  padding: calc(8px + env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--cream) 88%, transparent); border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: saturate(1.4) blur(12px); backdrop-filter: saturate(1.4) blur(12px);
}
.tb-back { width: 40px; height: 40px; border-radius: 99px; display: flex; align-items: center; justify-content: center; text-decoration: none; color: var(--ink); font-size: 30px; line-height: 1; padding-bottom: 3px; }
.tb-back:hover { background: var(--accent-soft); }
.tb-title { min-width: 0; text-align: center; line-height: 1.2; }
.tb-title b { display: block; font: 500 19px var(--serif); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-title span { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); }
.topbar .langsw { position: static; }
.gallery-page { padding-top: 6px; padding-bottom: calc(110px + env(safe-area-inset-bottom)); }
body.no-cta .gallery-page { padding-bottom: calc(40px + env(safe-area-inset-bottom)); }
.cta-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: center;
  padding: 12px max(16px, env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--cream) 92%, transparent) 35%);
  pointer-events: none;
}
.cta-bar .btn { max-width: 420px; pointer-events: auto; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.lightbox { z-index: 40; }
body.lb-open :is(.cta-bar, .topbar) { visibility: hidden; }

/* Captions + likes */
.cap-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.cap-row > b, .cap-row > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .cap b.anon { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); font-weight: 600; }
.like {
  flex: none; display: inline-flex; align-items: center; gap: 4px; border: 0; background: transparent; color: var(--ink-soft);
  font: 600 12px var(--sans); padding: 6px 4px 6px 8px; margin: -6px -4px -6px 0; cursor: pointer; -webkit-tap-highlight-color: transparent; border-radius: 99px;
}
.like .heart { font-size: 17px; line-height: 1; }
.like[aria-pressed="true"] { color: #d23b5a; }
.like[aria-pressed="true"] .heart { animation: beat .3s ease; }
@keyframes beat { 50% { transform: scale(1.3); } }
.tile.wish .cap-row { margin-top: 4px; }
.lb-row { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 4px; }
.lightbox .like { color: #f3e8e0; font-size: 14px; }
.lightbox .like[aria-pressed="true"] { color: #ff7d97; }

/* Shared modal sheet (frame chooser, blessing recorder) */
.fr-modal {
  position: fixed; inset: 0; z-index: 60; background: rgba(15,10,8,.6); display: flex; align-items: flex-end; justify-content: center;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); animation: fadein .2s ease;
}
@keyframes fadein { from { opacity: 0; } }
.fr-sheet {
  width: 100%; max-width: 520px; max-height: 100%; max-height: 100dvh; overflow-y: auto; background: var(--paper); color: var(--ink);
  border-radius: 24px 24px 0 0; padding: 16px 18px calc(18px + env(safe-area-inset-bottom)); animation: up .25s ease;
}
@keyframes up { from { transform: translateY(40px); } }
@media (min-width: 600px) { .fr-modal { align-items: center; padding: 20px; } .fr-sheet { border-radius: 24px; } }
.fr-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.fr-head b { font: 500 24px var(--serif); }
.fr-x { width: 38px; height: 38px; border-radius: 99px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); font-size: 15px; cursor: pointer; }
.fr-stage { display: grid; grid-template-columns: 36px minmax(0, 1fr) 36px; align-items: center; gap: 4px; }
.fr-view { display: flex; justify-content: center; min-width: 0; }
.fr-canvas { max-width: 100%; max-height: 52vh; max-height: 52dvh; width: auto; height: auto; border-radius: 6px; box-shadow: 0 10px 30px rgba(0,0,0,.22); }
.fr-arrow { width: 36px; height: 36px; border-radius: 99px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); font-size: 22px; line-height: 1; cursor: pointer; padding-bottom: 3px; }
.fr-note { text-align: center; font-size: 12px; color: var(--ink-soft); margin: 10px 0 0; min-height: 1em; }
.fr-chips { display: flex; gap: 6px; overflow-x: auto; padding: 10px 2px 14px; scrollbar-width: none; justify-content: safe center; }
.fr-chips::-webkit-scrollbar { display: none; }
.fr-chip { flex: none; border: 1px solid var(--line); background: var(--paper); color: var(--ink); border-radius: 99px; padding: 8px 14px; font: 600 13px var(--sans); cursor: pointer; }
.fr-chip[aria-checked="true"] { background: var(--ink); color: var(--on-ink, #fff); border-color: var(--ink); }

/* Blessing entry + recorder */
button.blessing {
  width: 100%; margin-top: 14px; display: flex; align-items: center; gap: 14px; text-align: left; cursor: pointer; color: var(--ink); font: inherit;
  -webkit-tap-highlight-color: transparent;
}
button.blessing b { display: block; font-size: 15px; }
button.blessing .hint { display: block; margin: 2px 0 0; }
.bl-ico { width: 46px; height: 46px; flex: none; border-radius: 99px; background: var(--accent-soft); display: flex; align-items: center; justify-content: center; font-size: 22px; }
button.blessing > span:nth-child(2) { flex: 1; min-width: 0; }
.bl-go { font-size: 24px; color: var(--ink-soft); }
.bl-tabs { justify-content: center; margin-bottom: 12px; }
.bl-stage { display: flex; justify-content: center; align-items: center; min-height: 140px; border-radius: 16px; background: var(--accent-soft); overflow: hidden; }
.bl-live { width: 100%; max-height: 38vh; max-height: 38dvh; object-fit: cover; background: #000; transform: scaleX(-1); }
.bl-live[controls] { transform: none; object-fit: contain; }
.bl-mic { font-size: 52px; }
.bl-audio { width: calc(100% - 24px); }
.bl-status { text-align: center; font-size: 14px; color: var(--ink-soft); margin: 12px 0 4px; min-height: 1.5em; }
.bl-ctrl { display: flex; justify-content: center; padding: 6px 0 12px; }
.bl-rec { width: 74px; height: 74px; border-radius: 99px; border: 4px solid var(--ink); background: var(--paper); display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.bl-rec i { width: 50px; height: 50px; border-radius: 99px; background: #d23b3b; transition: all .2s; }
.bl-rec.on i { width: 26px; height: 26px; border-radius: 6px; }
.bl-rec[disabled] { opacity: .4; }

/* Admin: private + voice cards */
.aitem.private { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.badge { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; background: var(--accent); color: var(--on-accent, #fff); border-radius: 99px; padding: 2px 8px; margin: 0 4px 4px 0; }
.badge.soft { background: var(--accent-soft); color: var(--ink); }
.voice-pv { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 10px; }
.voice-pv span { font-size: 34px; }
.voice-pv audio { width: 100%; }
.stats { grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)); }

/* Cover as the whole page background: photo stays put, the page scrolls over a darkening fade */
body.cover-full { background: #171210; }
body.cover-full::before {
  content: ""; position: fixed; inset: 0; z-index: 0;
  background: #171210 var(--cover) center 30% / cover no-repeat;
}
body.cover-full::after {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(10,6,5,.22) 0%, rgba(10,6,5,.08) 28%, rgba(10,6,5,.55) 52%, rgba(10,6,5,.82) 75%, rgba(10,6,5,.9) 100%);
}
body.cover-full .wrap { position: relative; z-index: 1; }
body.cover-full .hero {
  min-height: 58vh; min-height: 58svh; display: flex; flex-direction: column; justify-content: flex-end;
  padding-bottom: 26px; background: none; color: #fff;
}
body.cover-full .hero::before { display: none; }
body.cover-full .hero h1 { color: #fff; text-shadow: 0 2px 18px rgba(0,0,0,.4); }
body.cover-full .hero h1::after { color: #fff !important; }
body.cover-full .hero .meta, body.cover-full .hero .lede { color: rgba(255,255,255,.9); }
body.cover-full .hero .pill { align-self: center; background: rgba(255,255,255,.92); border-color: transparent; color: #2a201d; }
body.cover-full .wrap > .langsw { background: rgba(255,255,255,.92); }
body.cover-full :is(.card, button.blessing) { box-shadow: 0 12px 34px rgba(0,0,0,.28); border-color: transparent; }
body.cover-full.style-minimal .card { padding-left: 18px; padding-right: 18px; }
body.cover-full .wrap > .hint, body.cover-full .wrap > p.hint { color: rgba(255,255,255,.82); }

/* Cover settings: photo space + form see-through */
body.has-cover .hero .pill { padding: 5px 14px; }
body.cover-banner.cover-h-tall .hero { min-height: 72vh; min-height: 72svh; }
body.cover-banner.cover-h-screen .hero { min-height: 92vh; min-height: 92svh; }
body.cover-full.cover-h-tall .hero { min-height: 76vh; min-height: 76svh; }
body.cover-full.cover-h-screen .hero { min-height: 94vh; min-height: 94svh; }
body.cover-full :is(.card, button.blessing) { background: color-mix(in srgb, var(--paper) var(--card-mix, 100%), transparent); }
body.cover-full.cards-see-through :is(.card, button.blessing) { -webkit-backdrop-filter: blur(16px) saturate(1.2); backdrop-filter: blur(16px) saturate(1.2); }
body.cover-full.cards-see-through:not(.style-minimal) :is(input[type=text], textarea) { background: color-mix(in srgb, var(--field, #fff) calc(var(--card-mix, 100%) + 10%), transparent); }
.range { width: 100%; accent-color: var(--accent); height: 28px; }

/* ============ One-screen guest page (default) ============ */
.q-head { display: none; }
body.fit .wrap {
  min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column;
  padding-top: 12px; padding-bottom: calc(12px + env(safe-area-inset-bottom));
}
body.fit .hero {
  flex: 1 1 auto; min-height: 190px !important; display: flex; flex-direction: column; justify-content: flex-end;
  padding: 64px 8px 18px;
}
body.fit.cover-banner .hero { margin-top: -12px; margin-bottom: 12px; padding: 70px 20px 22px; }
body.fit.cover-full .hero { padding-bottom: 20px; }
body.fit .hero h1 { margin: 10px 0 6px; }
body.fit .lede { margin-top: 10px; }
body.fit #form { padding: 14px; }
body.fit #form.stack > * + * { margin-top: 10px; }
body.fit #form > div:first-child label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
body.fit #name { padding: 11px 14px; }
body.fit #pickBtn { padding: 15px 18px; font-size: 16px; }
body.fit .tiles { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; }
body.fit .tiles > [hidden] { display: none !important; }
.tile-btn {
  flex-direction: column; gap: 5px; padding: 12px 6px; border-radius: 16px; font-size: 13px; line-height: 1.2;
  min-height: 76px; white-space: normal; text-align: center;
}
.tile-btn .ti { font-size: 21px; line-height: 1; }
body.fit #limits { margin: 0; font-size: 11px; }
body.fit #blessBtn { display: none !important; }
body.fit .foot { display: flex; flex-direction: column; align-items: center; gap: 2px; margin-top: 8px; }
body.fit .foot p { margin: 0 !important; }
body.fit #galleryLink { background: none; border: 0; box-shadow: none; padding: 8px 12px; font-size: 14px; color: inherit; text-decoration: underline; text-underline-offset: 3px; }
body.fit.cover-full #galleryLink { color: #fff; }
body.fit .foot .hint { margin: 0; font-size: 11px; }
body.fit #closed { margin-top: 0; }
/* Upload progress slides up from the bottom instead of pushing the page down */
body.fit #queueCard {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; margin: 0 auto !important; max-width: 560px;
  max-height: 46vh; max-height: 46svh; overflow-y: auto; border-radius: 22px 22px 0 0;
  padding: 10px 16px calc(12px + env(safe-area-inset-bottom)); box-shadow: 0 -10px 34px rgba(0,0,0,.22); animation: up .25s ease;
  background: var(--paper);
}
body.fit .q-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 0 6px; position: sticky; top: -10px; background: var(--paper); z-index: 1; }
body.fit .q-head b { font: 500 20px var(--serif); }
@media (max-height: 620px) { body.fit .hero h1 { font-size: 34px; } body.fit .lede { display: none; } body.fit .tile-btn { min-height: 64px; padding: 9px 4px; } }
body.fit.style-elegant #form { padding: 14px; }
@media (max-height: 700px) {
  body.fit .hero { min-height: 140px !important; padding-top: 52px; padding-bottom: 12px; }
  body.fit.style-elegant .hero::before { margin-bottom: 8px; }
  body.fit.style-elegant .hero h1::after { display: none; }
  body.fit .foot .hint { display: none; }
}
body.fit .hero .pill { align-self: center; }
body.cover-full .foot .hint { color: rgba(255,255,255,.8); }

/* 4 tiles on the one-screen page */
body.fit .tiles .tile-btn { font-size: 12.5px; padding: 11px 4px; }
@media (max-width: 359px) { body.fit .tiles { gap: 6px; } body.fit .tiles .tile-btn { font-size: 11px; padding: 10px 2px; } body.fit .tile-btn .ti { font-size: 19px; } }
#frameBtn { margin-top: 10px; }
/* Lightbox save button */
.lb-actions { display: flex; gap: 8px; justify-content: center; margin-top: 10px; flex-wrap: wrap; }
.lb-save { background: rgba(255,255,255,.92); color: #1d1513; border: 0; border-radius: 99px; padding: 9px 16px; font: 600 13px var(--sans); cursor: pointer; }
.lb-save[disabled] { opacity: .6; }

/* ============ Line icons ============ */
svg.ic { width: 1.25em; height: 1.25em; flex: none; display: inline-block; vertical-align: -0.22em; }
.btn svg.ic { width: 20px; height: 20px; }
.tile-btn .ti svg.ic { width: 24px; height: 24px; color: var(--accent); }
.tile-btn .ti { display: flex; }
.queue .wishthumb svg.ic { width: 24px; height: 24px; color: var(--accent); }
.bl-ico svg.ic { width: 24px; height: 24px; color: var(--accent); }
.bl-go svg.ic { width: 20px; height: 20px; }
.bl-mic svg.ic { width: 56px; height: 56px; color: var(--accent); stroke-width: 1.2; }
.bl-tabs button { display: inline-flex; align-items: center; gap: 6px; }
.bl-tabs svg.ic { width: 17px; height: 17px; }
.bl-note { display: flex; align-items: center; gap: 6px; margin: 0 0 12px; }
.bl-note svg.ic { width: 15px; height: 15px; }
#galleryLink { gap: 8px; }

/* ============ Museum style: gallery lighting, gilded frame, gold buttons ============ */
.style-museum:is(body:not(.wall), .tp-screen) {
  background-color: var(--cream);
  background-image:
    radial-gradient(120% 70% at 50% -10%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%),
    radial-gradient(140% 90% at 50% 120%, rgba(0,0,0,.28), transparent 60%);
}
body.style-museum:not(.wall) { background-attachment: fixed; }
.style-museum :is(.hero h1, .tp-h) { font-weight: 400; letter-spacing: .005em; }
.style-museum .hero .meta { color: var(--accent); letter-spacing: .2em; }
.style-museum .lede { font-style: italic; }
.style-museum .pill { background: transparent; border: 1px solid color-mix(in srgb, var(--accent) 60%, transparent); color: var(--accent); letter-spacing: .26em; }
.style-museum :is(.card, .tp-card, button.blessing) {
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 32%, transparent); border-radius: 22px;
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: 0 18px 40px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.06);
}
.style-museum :is(.btn:not(.ghost):not(.danger), .tp-btn) {
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 55%, #fff6dc), var(--accent) 45%, color-mix(in srgb, var(--accent) 70%, #000));
  color: #1b140b; border: 0; letter-spacing: .02em;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 30%, transparent), inset 0 1px 0 rgba(255,255,255,.35);
}
.style-museum .btn.ghost { background: color-mix(in srgb, var(--paper) 60%, transparent); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.style-museum :is(input[type=text], textarea, .tp-field) { border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.style-museum .tile { border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.style-museum .tile.wish { background: color-mix(in srgb, var(--accent) 12%, var(--paper)); }
.style-museum .topbar { border-bottom-color: color-mix(in srgb, var(--accent) 25%, transparent); }
.style-museum .langsw { border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.style-museum .langsw button.on { background: var(--accent); color: #1b140b; }
.wall.style-museum { background: radial-gradient(120% 80% at 50% -10%, color-mix(in srgb, var(--wgold) 18%, var(--wbg)), var(--wbg) 60%); }

/* Museum + cover photo: the photo hangs in a gilded frame; the page behind is a dim, blurred copy */
body.cover-framed::before {
  content: ""; position: fixed; inset: -60px; z-index: 0; pointer-events: none;
  background: var(--cover) center / cover no-repeat; filter: blur(34px) saturate(1.1) brightness(.42); transform: scale(1.1);
}
body.cover-framed::after {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(90% 55% at 50% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%),
              linear-gradient(180deg, rgba(0,0,0,.05), rgba(0,0,0,.45));
}
body.cover-framed .wrap { position: relative; z-index: 1; }
body.cover-framed .hero { color: #fff; }
body.cover-framed .hero h1 { color: #fbf3e2; text-shadow: 0 2px 20px rgba(0,0,0,.45); }
body.cover-framed .hero .lede { color: rgba(255,255,255,.85); }
body.cover-framed .hero .pill { align-self: center; }
body.cover-framed .foot .hint { color: rgba(255,255,255,.75); }
body.cover-framed #galleryLink { color: #fbf3e2; }
.gilt-wrap { display: flex; justify-content: center; margin: 4px 0 18px; }
.gilt {
  position: relative; padding: 13px; border-radius: 3px;
  background: linear-gradient(135deg, #7d5f27 0%, #f1d993 18%, #b08636 34%, #fbe8b0 50%, #9b7431 66%, #e7c777 82%, #7a5c25 100%);
  box-shadow: 0 34px 70px rgba(0,0,0,.6), 0 0 0 1px rgba(0,0,0,.45), inset 0 0 0 1px rgba(255,255,255,.35), inset 0 0 10px rgba(60,40,10,.55);
}
.gilt::before { /* raised inner moulding */
  content: ""; position: absolute; inset: 6px; border-radius: 2px; pointer-events: none;
  border: 2px solid rgba(255,240,200,.55); box-shadow: inset 0 0 0 1px rgba(80,55,15,.6);
}
.gilt::after { /* little rosettes in the corners */
  content: ""; position: absolute; inset: -4px; pointer-events: none;
  background:
    radial-gradient(circle at 9px 9px, #fff1c2 0 3px, #b08636 3.5px 6px, transparent 6.5px),
    radial-gradient(circle at calc(100% - 9px) 9px, #fff1c2 0 3px, #b08636 3.5px 6px, transparent 6.5px),
    radial-gradient(circle at 9px calc(100% - 9px), #fff1c2 0 3px, #b08636 3.5px 6px, transparent 6.5px),
    radial-gradient(circle at calc(100% - 9px) calc(100% - 9px), #fff1c2 0 3px, #b08636 3.5px 6px, transparent 6.5px);
}
.gilt .mat { padding: 5px; background: linear-gradient(180deg, #2b2010, #5a4520); box-shadow: inset 0 0 8px rgba(0,0,0,.8); }
.gilt img {
  display: block; height: clamp(220px, 52vh, 520px); height: clamp(220px, 52svh, 520px); width: auto; max-width: min(78vw, 440px);
  aspect-ratio: 4 / 5; object-fit: cover; background: #222;
}
body.fit .gilt-wrap { margin: 0 0 12px; }
body.fit .gilt img { height: clamp(160px, 46svh, 440px); }
body.fit.cover-framed .hero h1 { font-size: clamp(30px, 9vw, 40px); }
body.fit.cover-framed .hero { padding-top: 56px; }
@media (max-height: 700px) { body.fit .gilt { padding: 9px; } body.fit .gilt::before { inset: 4px; } }
@media (max-height: 700px) {
  body.fit.cover-framed .lede { display: none; }
  body.fit.cover-framed .hero { padding-top: 50px; padding-bottom: 10px; }
  body.fit.cover-framed .hero h1 { font-size: 30px; margin: 8px 0 4px; }
  body.fit.cover-framed .gilt-wrap { margin-bottom: 8px; }
}
/* Museum on a light theme (Ivory Gallery): bright, airy wall instead of a dim one */
html:not(.dark-theme) body.cover-framed::before { filter: blur(40px) saturate(.85) brightness(1.15); opacity: .55; }
html:not(.dark-theme) body.cover-framed::after {
  background: radial-gradient(90% 55% at 50% 0%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 70%),
              linear-gradient(180deg, color-mix(in srgb, var(--cream) 55%, transparent), color-mix(in srgb, var(--cream) 85%, transparent));
}
html:not(.dark-theme) body.cover-framed .hero { color: var(--ink); }
html:not(.dark-theme) body.cover-framed .hero h1 { color: var(--ink); text-shadow: none; }
html:not(.dark-theme) body.cover-framed .hero .lede { color: var(--ink-soft); }
html:not(.dark-theme) body.cover-framed :is(.foot .hint, #galleryLink) { color: var(--ink-soft); }
html:not(.dark-theme) body.cover-framed #galleryLink { color: var(--ink); }
html:not(.dark-theme) .style-museum .pill { color: var(--accent); }
body.cover-framed .hero .meta { color: color-mix(in srgb, var(--accent) 80%, #fff); }
body.cover-framed .hero .pill { background: rgba(0,0,0,.22); border-color: color-mix(in srgb, var(--accent) 70%, transparent); color: color-mix(in srgb, var(--accent) 75%, #fff); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
html:not(.dark-theme) body.cover-framed .hero .meta { color: color-mix(in srgb, var(--accent) 85%, #000); }
html:not(.dark-theme) body.cover-framed .hero .pill { background: rgba(255,255,255,.5); color: color-mix(in srgb, var(--accent) 85%, #000); }
html.dark-theme .hint.warn { color: #f0b86e; }
.admin-grid .more-btn { grid-column: 1 / -1; }

/* Couple admin: limits set by the owner, shown read-only */
.owner-set { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; padding: 10px 12px; border-radius: 12px; background: var(--accent-soft); }
.owner-set span { display: block; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-soft); }
.owner-set b { font-size: 14px; }

/* Upload panel close button */
.q-x { width: 34px; height: 34px; border-radius: 99px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); font-size: 14px; cursor: pointer; flex: none; display: flex; align-items: center; justify-content: center; }
body.fit .q-head { padding-right: 2px; }

/* ---------- live photobooth ---------- */
.bo-modal { position: fixed; inset: 0; z-index: 60; background: var(--cream); color: var(--ink); overflow-y: auto; -webkit-overflow-scrolling: touch; }
.bo-body { max-width: 520px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; padding: max(10px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)); }
.bo-head { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; min-height: 52px; }
.bo-head b { text-align: center; font: 500 24px var(--serif); }
.bo-icon { width: 40px; height: 40px; border-radius: 99px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); font-size: 18px; line-height: 1; cursor: pointer; }
.bo-head .bo-icon:first-child { font-size: 26px; padding-bottom: 3px; }
.bo-icon.light { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.3); color: #fff; font-size: 22px; }
.bo-pad { padding: 4px 0 8px; }
.bo-lede { font: italic 19px/1.35 var(--serif); color: var(--ink-soft); text-align: center; margin: 6px 8px 18px; }
.bo-layouts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.bo-layout { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 18px 10px 14px; border-radius: 18px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); font: 600 14px var(--sans); cursor: pointer; transition: transform .15s; }
.bo-layout:active { transform: scale(.97); }
.bo-layout.first { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.bo-mini { display: grid; gap: 3px; width: 44px; height: 62px; padding: 4px; background: #fff; border-radius: 4px; box-shadow: 0 3px 10px rgba(0,0,0,.12); }
.bo-mini i { background: var(--accent); opacity: .75; border-radius: 1px; }
.bo-alt { margin-top: 18px; }
.bo-stage { position: relative; flex: 1 1 auto; min-height: 300px; max-height: 66vh; max-height: 66dvh; border-radius: 22px; overflow: hidden; background: #0e0b0a; }
.bo-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.bo-video.mirror { transform: scaleX(-1); }
.bo-stage.nocam::after { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 50% 45%, rgba(255,255,255,.08), transparent 60%); }
.bo-count { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font: 500 140px/1 var(--serif); color: #fff; text-shadow: 0 6px 30px rgba(0,0,0,.45); pointer-events: none; }
.bo-count.pop { animation: bo-pop .9s ease-out; }
@keyframes bo-pop { from { transform: scale(1.5); opacity: 0; } 25% { opacity: 1; } to { transform: scale(1); opacity: .9; } }
.bo-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.bo-flash.go { animation: bo-flash .45s ease-out; }
@keyframes bo-flash { from { opacity: .95; } to { opacity: 0; } }
.bo-dots { display: flex; justify-content: center; gap: 8px; margin: 14px 0 4px; }
.bo-dots i { width: 9px; height: 9px; border-radius: 99px; background: var(--line); }
.bo-dots i.now { background: var(--accent); transform: scale(1.3); }
.bo-dots i.on { background: var(--accent); opacity: .55; }
.bo-note { text-align: center; font-size: 14px; color: var(--ink-soft); min-height: 1.4em; margin: 6px 12px; }
.bo-ctrl { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; justify-items: center; padding: 6px 0 4px; }
.bo-ctrl .bo-icon.light { background: var(--paper); border-color: var(--line); color: var(--ink); }
.bo-pill { min-width: 56px; height: 40px; border-radius: 99px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); font: 600 14px var(--sans); cursor: pointer; }
.bo-shutter { width: 78px; height: 78px; border-radius: 99px; border: 4px solid var(--accent); background: var(--paper); padding: 6px; cursor: pointer; }
.bo-shutter i { display: block; width: 100%; height: 100%; border-radius: 99px; background: var(--accent); transition: transform .2s, border-radius .2s; }
.bo-shutter.busy i { transform: scale(.55); border-radius: 10px; }
.bo-shutter:disabled { cursor: default; }
.bo-thumbs { display: grid; gap: 10px; margin-bottom: 20px; grid-template-columns: repeat(3, 1fr); }
.bo-thumbs.n1 { grid-template-columns: minmax(0, 300px); justify-content: center; }
.bo-thumbs.n2, .bo-thumbs.n4 { grid-template-columns: repeat(2, 1fr); }
.bo-thumb { position: relative; padding: 0; border: 0; border-radius: 12px; overflow: hidden; aspect-ratio: 3 / 4; background: var(--accent-soft); cursor: pointer; }
.bo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bo-thumb span { position: absolute; left: 6px; bottom: 6px; background: rgba(0,0,0,.55); color: #fff; font: 600 11px var(--sans); padding: 4px 8px; border-radius: 99px; }
.bo-preview { display: flex; justify-content: center; }
.bo-preview .fr-canvas { max-height: 46vh; max-height: 46dvh; }
.bo-form input { width: 100%; }
.bo-done-img { max-width: 70%; max-height: 40vh; border-radius: 6px; box-shadow: 0 10px 30px rgba(0,0,0,.2); margin: 6px auto 4px; display: block; }
.bo-done h2 { font: 500 34px var(--serif); margin: 14px 0 0; }
@media (prefers-reduced-motion: reduce) { .bo-count.pop, .bo-flash.go { animation: none; } }
.tile .cap .capt, #lbCap .capt { display: block; margin-top: 3px; font-size: 13px; color: var(--ink); }
/* admin: search, select */
.find { display: grid; grid-template-columns: 1fr auto auto auto; gap: 8px; align-items: center; }
.find input { min-width: 0; padding: 9px 10px; font-size: 14px; }
.find input[type=search] { border: 1px solid var(--line); border-radius: 12px; background: var(--field, #fff); color: var(--ink); font: 15px var(--sans); }
.find .btn.on { background: var(--ink); color: var(--on-ink, #fff); }
@media (max-width: 560px) { .find { grid-template-columns: 1fr 1fr; } .find input[type=search] { grid-column: 1 / -1; } .find #selBtn { grid-column: 1 / -1; } }
.selbar { position: sticky; top: 8px; z-index: 5; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; box-shadow: 0 6px 20px rgba(0,0,0,.08); }
.selbar span { font-weight: 600; margin-right: auto; }
.aitem .pv { position: relative; }
.aitem .pick { position: absolute; top: 8px; left: 8px; width: 30px; height: 30px; border-radius: 99px; border: 2px solid #fff; background: rgba(0,0,0,.25); color: #fff; font-weight: 700; cursor: pointer; }
.aitem .pick.on { background: var(--accent); }
.aitem.picked { outline: 3px solid var(--accent); outline-offset: -1px; }
.consent { margin-top: 4px; }
.linkbtn { border: 0; background: none; padding: 0; color: var(--accent); font: inherit; text-decoration: underline; cursor: pointer; }
.privacy { margin: 4px 0 18px; padding-left: 20px; font-size: 15px; line-height: 1.5; }
.privacy li + li { margin-top: 8px; }

/* ===== Phase 2 ===== */
/* waveform + play button (voice wishes, living photos) */
.wave { display: flex; align-items: center; gap: 2px; height: 34px; flex: 1; min-width: 0; }
.wave i { flex: 1; min-width: 2px; background: var(--accent); opacity: .35; border-radius: 2px; transition: opacity .15s; }
.wave i.done { opacity: 1; }
.sndbtn { flex: none; width: 40px; height: 40px; border-radius: 99px; border: 0; background: var(--accent); color: var(--on-accent, #fff); font: 600 14px var(--sans); cursor: pointer; display: grid; place-items: center; }
.sndbtn.on { background: var(--ink); }

/* gallery tabs */
.gtabs { display: flex; gap: 6px; overflow-x: auto; margin: 0 0 14px; padding: 2px 0 4px; scrollbar-width: none; position: sticky; top: 58px; z-index: 4; background: var(--cream); }
.gtabs::-webkit-scrollbar { display: none; }
.gtabs button { flex: 1 0 auto; border: 1px solid var(--line); background: var(--paper); border-radius: 99px; padding: 9px 14px; font: 600 14px var(--sans); color: var(--ink); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; justify-content: center; }
.gtabs button small { font-size: 11px; font-weight: 700; color: var(--ink-soft); }
.gtabs button.on { background: var(--ink); color: var(--on-ink, #fff); border-color: var(--ink); }
.gtabs button.on small { color: inherit; opacity: .75; }
.grid.tab-voices { columns: 1; max-width: 640px; margin: 0 auto; }
@media (min-width: 900px) { .grid.tab-voices { columns: 2; max-width: 980px; } }
.tile.voice { padding: 12px 14px; cursor: default; }
.tile.voice .cap-row { margin-bottom: 8px; }
.tile.voice .vc-play { display: flex; align-items: center; gap: 10px; }
.tile.voice .vc-d { flex: none; font-size: 12px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.tile .snd { position: absolute; right: 8px; top: 8px; background: rgba(255,255,255,.92); border-radius: 99px; padding: 3px 8px; font-size: 13px; }
.lb-snd { display: block; margin: 0 auto 8px; background: rgba(255,255,255,.92); color: #1d1513; border: 0; border-radius: 99px; padding: 8px 14px; font: 600 13px var(--sans); cursor: pointer; }

/* gallery code (PIN) */
body.locked { overflow: hidden; }
body.locked main, body.locked .cta-bar { filter: blur(8px); pointer-events: none; }
.pin-gate { position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; padding: 20px; background: color-mix(in srgb, var(--cream) 82%, transparent); }
.pin-card { width: min(380px, 100%); text-align: center; }
.pin-card h2 { font: 500 30px var(--serif); margin: 0; }
.pin-card .pill { margin: 0 auto; }
.pin-in { width: 100%; text-align: center; font: 600 34px var(--sans); letter-spacing: .5em; padding: 12px 0 12px .5em; border: 1.5px solid var(--ink); border-radius: 14px; background: var(--field, #fff); color: var(--ink); }
.pin-msg { min-height: 1.2em; margin: 0; color: var(--danger); font-size: 14px; }

/* guest: Suara Majlis */
.wish-tabs { justify-content: center; margin: 0 0 12px; }
.say-it { margin-top: 10px; }
.bl-public .bl-everyone { background: var(--accent-soft); color: var(--accent); border-radius: 12px; padding: 10px 12px; font-weight: 600; }
.bl-name { width: 100%; margin: 0 0 10px; }
.bl-private { display: block; margin: 12px auto 0; font-size: 14px; }

/* booth: room sound, pose cards, moments */
.bo-extras { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 8px 0 2px; }
.bo-extras .bo-pill { padding: 0 14px; }
.bo-pill.on { background: var(--ink); color: var(--on-ink, #fff); border-color: var(--ink); }
.pose-wrap { position: absolute; left: 10px; top: 10px; z-index: 3; width: min(150px, 42%); border: 0; padding: 0; background: none; cursor: pointer; text-align: center; }
.pose-card { background: rgba(255,253,249,.94); color: #3b2420; border-radius: 12px; padding: 6px 8px 8px; box-shadow: 0 6px 18px rgba(0,0,0,.25); font: 12px/1.3 var(--sans); }
.pose-card .pose-pic svg { width: 100%; height: auto; display: block; }
.pose-card b { display: block; font: 600 14px/1.2 var(--serif); margin-top: 2px; }
.pose-card span { display: block; font-size: 11px; color: #6f5a52; }
.bo-mini.bo-vid { display: grid; place-items: center; font-size: 22px; color: var(--accent); }
.bo-layout.bo-moment { border-style: dashed; }
.bo-shutter.rec i { background: #d23b3b; }
.bo-shutter.recording { border-color: #d23b3b; animation: recpulse 1s infinite; }
@keyframes recpulse { 50% { box-shadow: 0 0 0 10px rgba(210,59,59,.2); } }
.bo-clip { position: relative; border-radius: 16px; overflow: hidden; background: #0e0b0a; margin-bottom: 16px; display: flex; justify-content: center; }
.bo-clip video { display: block; width: 100%; max-height: 52vh; max-height: 52dvh; object-fit: contain; }
.bo-clip video.mirror { transform: scaleX(-1); }
.bo-clip .bo-band { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.bo-room { margin: -6px 0 16px; }
@media (prefers-reduced-motion: reduce) { .bo-shutter.recording { animation: none; } }

/* host + owner pages */
.pinrow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 4px 0 6px; }
.pinrow input { width: 150px; font: 600 18px var(--sans); letter-spacing: .2em; text-align: center; }
.badge.pub { background: var(--ok, #3f6b4a); }
.feats { margin: 2px 0; }
.feats summary { cursor: pointer; font-size: 14px; color: var(--ink-soft); }
.feats .chips { margin-top: 8px; }
.featchip { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 99px; padding: 5px 10px; font-size: 13px; background: var(--paper); cursor: pointer; }

/* v3: back to the first page; "look here" pulse for the upload button */
.backfirst { position: absolute; left: 14px; top: max(14px, env(safe-area-inset-top)); z-index: 3; display: inline-flex; align-items: center; gap: 2px; height: 36px; padding: 0 14px; border-radius: 99px; background: rgba(255,253,249,.92); color: var(--ink); text-decoration: none; font: 600 14px var(--sans); box-shadow: 0 2px 10px rgba(0,0,0,.12); }
.btn.pulse { animation: pulse 0.8s ease 3; }
@keyframes pulse { 50% { box-shadow: 0 0 0 10px color-mix(in srgb, var(--accent) 25%, transparent); transform: scale(1.02); } }
.acts .btn.star { min-width: 40px; padding: 0 10px; font-size: 18px; } .acts .btn.star.on { color: #b8893b; border-color: #e6cf9f; background: #fbf4e6; }
.stbadge { display: inline-block; vertical-align: middle; margin-left: 8px; font: 700 10px/1 var(--sans); letter-spacing: .06em; text-transform: uppercase; padding: 4px 8px; border-radius: 99px; }
.stbadge.st-live { background: #E3EADB; color: #3f6b4a; } .stbadge.st-ongoing { background: #F3E6D3; color: #8a5a1f; }
.stbadge.st-previous { background: #EDE5DA; color: #5d544d; } .stbadge.st-upcoming { background: #F8DDE8; color: #7A2948; }
.bgpick { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; }
.bgpick button { height: 58px; border-radius: 12px; border: 2px solid transparent; color: #fff; font: 600 12px var(--sans); text-shadow: 0 1px 3px rgba(0,0,0,.4); cursor: pointer; background-color: #8a8077; }
.bgpick button.on { border-color: var(--accent, #7A2948); box-shadow: 0 0 0 2px #fff inset; }
.bgpick button:disabled { opacity: .45; cursor: not-allowed; }
.bgpick button[data-bg="ivory"], .bgpick button[data-bg="blush"], .bgpick button[data-bg="sage"] { text-shadow: none; border-color: #e2d9cd; }
.bgpick button[data-bg="ivory"].on, .bgpick button[data-bg="blush"].on, .bgpick button[data-bg="sage"].on { border-color: var(--accent, #7A2948); }

/* admin: switch state, page-design controls */
.sw-state { font: 700 10.5px/1 var(--sans); letter-spacing: .06em; padding: 4px 7px; border-radius: 99px; background: #ece7e1; color: #6b625b; font-style: normal; flex: none; margin-left: auto; }
.sw-state.on { background: #E3EADB; color: #3f6b4a; }
.switch .sw-state + input { margin-left: 0; }
.dslots { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0 8px; }
.dslot { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.dthumb { aspect-ratio: 92 / 118; border-radius: 8px; border: 1px solid var(--line); background: #f3eee8 center / cover no-repeat; display: grid; place-items: center; font: 500 12px var(--sans); color: var(--ink-soft); }
.dbtns { display: flex; gap: 6px; flex-wrap: wrap; } .dbtns .btn { flex: 1; }
.btn.danger-t { color: #a23a3a; border-color: #ebc9c9; }
.dsep { border: 0; border-top: 1px solid var(--line); margin: 4px 0; width: 100%; }
.dheart { position: relative; width: 132px; aspect-ratio: 720 / 636; flex: none; }
.dheart.big { width: min(78vw, 320px); margin: 0 auto; touch-action: none; cursor: grab; }
.dheart .pic { position: absolute; inset: 0; background: #e9d4d8 center / cover no-repeat; -webkit-mask: var(--mask) center / 100% 100% no-repeat; mask: var(--mask) center / 100% 100% no-repeat; }
.dheart .lace { position: absolute; inset: 0; background: var(--frame) center / 100% 100% no-repeat; pointer-events: none; }
.dheart:not([style*="--frame"]) .lace { background-image: url(/assets/art/lace-heart.webp); }
.dheart:not([style*="--mask"]) .pic { -webkit-mask-image: url(/assets/art/heart-mask.png); mask-image: url(/assets/art/heart-mask.png); }
.bgpick button[hidden] { display: none; }
.colrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.colrow input[type=color] { width: 46px; height: 38px; padding: 2px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.swatches button { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.slide { display: grid; grid-template-columns: 60px 1fr 40px; align-items: center; gap: 8px; margin: 0; font-size: 13px; } .slide b { text-align: right; font: 600 12px var(--sans); }

/* ---- responsive & touch pass (Nov 2026) ---- */
.langsw button { min-height: 36px; min-width: 42px; padding: 8px 12px; }
.btn-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.btn-grid .btn { white-space: normal; text-align: center; line-height: 1.2; min-width: 0; }
input[type=datetime-local], input[type=date], input[type=time] { min-height: 44px; box-sizing: border-box; }
.swatches button { width: 32px; height: 32px; }
.linklike { min-height: 40px; padding: 8px 6px; display: inline-flex; align-items: center; }
.chips a, .chips .linklike { min-height: 36px; display: inline-flex; align-items: center; }
.tabs { -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); }
.tabs button { min-height: 38px; flex: none; }

/* font picker (host page): tabs by style, each choice shown in its own font */
.fgrp { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 8px; scrollbar-width: none; }
.fgrp .chip { flex: none; min-height: 36px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); font: 600 13px var(--sans); cursor: pointer; }
.fgrp .chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.fgrp .chip.has:not(.on)::after { content: " •"; color: var(--accent); }
.fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.fcard { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 76px; padding: 8px 6px; border: 2px solid var(--line); border-radius: 12px; background: #fff; color: #b0466f; cursor: pointer; text-align: center; min-width: 0; }
.fcard .fs { line-height: 1.2; max-width: 100%; overflow-wrap: anywhere; }
.fcard .fn { font: 600 11.5px/1.25 var(--sans); color: var(--ink); }
.fcard .fn small { display: block; font-weight: 500; color: var(--ink-soft); }
.fcard.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); background: #fff9fb; }
.fcard.on .fn::before { content: "✓ "; color: var(--accent); }
@media (max-width: 380px) { .fgrid { grid-template-columns: 1fr 1fr; } }
#dFontNow { font-size: 12.5px; margin: 6px 0 0; }

/* initials (host page): segmented choices + a live preview in the page's colours */
.seg { display: inline-flex; flex-wrap: wrap; gap: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--paper); max-width: 100%; }
.seg button { min-height: 40px; padding: 0 14px; border: 0; border-right: 1px solid var(--line); background: none; color: var(--ink); font: 600 13.5px var(--sans); cursor: pointer; flex: 1 1 auto; }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--accent); color: #fff; }
.seg button:disabled { opacity: .5; }
.mini-l { display: block; font: 600 12.5px var(--sans); color: var(--ink-soft); margin: 0 0 4px; }
.monorow { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 12px; margin-top: 10px; align-items: start; }
.monoset input[type=text] { flex: 1; min-width: 0; }
.monoset select { width: 100%; min-height: 44px; }
.monoprev { height: 132px; border-radius: 14px; border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; color: var(--ink-m, #b0466f); }
.mp { --msz: 1; display: flex; flex-direction: column; align-items: center; line-height: .8; font-size: calc(30px * var(--mfz, 1) * var(--msz)); color: var(--ink-m, #b0466f); }
.mp.sz-s { --msz: .8; } .mp.sz-l { --msz: 1.3; }
.mp .amp { font-size: .6em; } .mp .one { font-size: 1.33em; }
.mp.st-stacked .a { margin-right: .53em; } .mp.st-stacked .b { margin-left: .73em; }
.mp.st-line { flex-direction: row; align-items: baseline; gap: .16em; line-height: 1; }
.mp.st-ring { flex-direction: row; align-items: center; justify-content: center; gap: .08em; line-height: 1; width: 2.3em; height: 2.3em; border: 1.5px solid currentColor; border-radius: 50%; outline: 1px solid currentColor; outline-offset: 3px; font-size: calc(24px * var(--mfz, 1) * var(--msz)); }
.mp.st-ring .a, .mp.st-ring .b { font-size: 1em; } .mp.st-ring .amp { font-size: .55em; } .mp.st-ring .one { font-size: 1em; }
.mp.is-img { width: auto; height: auto; border: 0; outline: 0; }
.mp .mimg { display: block; height: calc(64px * var(--msz)); width: auto; max-width: 118px; object-fit: contain; }
.mp .mimg.tint { background: currentColor; -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; aspect-ratio: 1; }
.mp-none { font: 600 12px var(--sans); color: var(--ink-soft); }
@media (max-width: 420px) { .monorow { grid-template-columns: 1fr; } .monoprev { height: 110px; } .seg { display: flex; } }

/* ===== design system pass (admin): real toggle switches, status colours, owner dashboard ===== */
/* toggle: the checkbox itself becomes a switch (still a real checkbox: keyboard, screen readers, forms) */
label.switch input[type=checkbox] { -webkit-appearance: none; appearance: none; width: 48px; height: 28px; margin: 0; border-radius: 99px; background: #cfc5ba; position: relative; cursor: pointer; transition: background .18s; flex: none; border: 0; }
label.switch input[type=checkbox]::before { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .18s; }
label.switch input[type=checkbox]:checked { background: var(--ok); }
label.switch input[type=checkbox]:checked::before { transform: translateX(20px); }
label.switch input[type=checkbox]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
label.switch input[type=checkbox]:disabled { opacity: .5; cursor: not-allowed; }
label.switch { cursor: pointer; min-height: 44px; }
.sw-state { min-width: 34px; text-align: center; }
/* statuses: green = live, amber = coming soon / waiting, grey = completed — always with words */
.stbadge.st-live, .stbadge.st-ongoing { background: #E3EADB; color: #2f5a3a; }
.stbadge.st-upcoming { background: #F6E7C8; color: #7a4a0c; }
.stbadge.st-previous { background: #ECE7E1; color: #5d544d; }

/* owner dashboard */
.lead { max-width: 620px; margin: 0 auto; color: var(--ink-soft); font-size: 15px; }
.login { max-width: 420px; margin: 0 auto; width: 100%; }
.ov { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 8px; }
.ovt { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 12px 10px; text-align: center; font: inherit; color: inherit; min-height: 76px; display: flex; flex-direction: column; justify-content: center; }
button.ovt { cursor: pointer; } button.ovt:hover { border-color: var(--accent); }
.ovt b { font: 600 24px/1.1 var(--serif); }
.ovt span { font-size: 11.5px; color: var(--ink-soft); letter-spacing: .03em; }
.ovt.is-live b { color: #2f5a3a; } .ovt.is-soon b { color: #8a5410; } .ovt.is-done b { color: #6b625b; }
.otools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.otools input[type=search] { flex: 1 1 240px; min-width: 0; min-height: 44px; }
.otools .seg { flex: 0 1 auto; }
.ocols { display: grid; gap: 12px; align-items: start; }
@media (min-width: 900px) { .ocols { grid-template-columns: 1fr 1fr; } }
details.card > summary { cursor: pointer; list-style: none; min-height: 32px; }
details.card > summary::-webkit-details-marker { display: none; }
#createCard > summary b, #colCard > summary b { font-size: 16px; }
.colrow { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.evgroup { font: 500 22px var(--serif); margin: 18px 2px 8px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.evgroup > span { font: 700 10.5px var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); }
.evgroup-l { font: 600 13px var(--sans); }
.evgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 12px; align-items: start; }
.ev { gap: 12px; }
.ev h3 { font: 500 24px/1.15 var(--serif); margin: 0 0 2px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; }
.ev .meta { font-size: 13px; color: var(--ink-soft); }
.evnums { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; color: var(--ink-soft); margin-top: 4px; align-items: center; }
.evnums .warn { color: var(--warn); }
.evset > summary, .feats > summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--ink); min-height: 36px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.evset > summary .hint { font-weight: 500; margin: 0; }
.evset .settings { margin-top: 8px; }
.mini small.hint { display: block; margin: 3px 0 0; font-size: 11px; }
.evfoot { justify-content: space-between; border-top: 1px solid var(--line); padding-top: 8px; }
.empty { text-align: center; } .empty b { font: 500 22px var(--serif); display: block; }
@media (max-width: 420px) { .otools .seg { width: 100%; display: flex; } }

/* host dashboard: status line, card titles, stats that never wrap badly, labelled date filters, empty state */
.hstatus { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 10px; margin-top: 10px; }
.hstatus .stbadge { margin: 0; font-size: 11px; padding: 5px 10px; }
.hstatus .hint { margin: 0; }
.cardhead { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.cardhead h2 { font: 500 22px var(--serif); margin: 0; }
.cardhead .hint { margin: 0; }
#stats.stats { grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); }
#stats .stat { padding: 10px 6px; min-width: 0; }
#stats .stat b { font-size: 21px; white-space: nowrap; }
#stats .stat span { display: block; font-size: 10.5px; letter-spacing: .05em; line-height: 1.3; }
#stats .stat.warn { border-color: #e7c98f; background: #fbf3e4; } #stats .stat.warn b { color: #8a5410; }
@media (max-width: 480px) { #stats.stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.find { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.find input[type=search] { flex: 1 1 220px; min-width: 0; min-height: 44px; }
.dfield { display: flex; flex-direction: column; gap: 2px; margin: 0; flex: 1 1 140px; min-width: 0; }
.dfield > span { font: 600 11px var(--sans); color: var(--ink-soft); letter-spacing: .04em; text-transform: uppercase; }
.dfield input { width: 100%; min-height: 44px; }
.find #selBtn { min-height: 44px; flex: 0 0 auto; }
.empty-s { padding: 24px 12px; text-align: center; border: 1px dashed var(--line); border-radius: 14px; background: var(--paper); }
.empty-s b { font: 500 20px var(--serif); display: block; } .empty-s .hint { margin: 4px 0 0; }
/* gallery tabs: on small phones all four share the width (no half-hidden last tab) */
@media (max-width: 420px) { .gtabs { gap: 4px; } .gtabs button { flex: 1 1 0; min-width: 0; padding: 9px 4px; font-size: 13px; gap: 3px; } .gtabs button small { font-size: 10px; } }
/* date + time boxes can't shrink below ~210px on phones: stack them instead of overflowing */
.fields > * { min-width: 0; }
input[type=datetime-local] { width: 100%; min-width: 0; }
@media (max-width: 520px) { .fields:has(input[type=datetime-local]) { grid-template-columns: 1fr; } }
.evgroup-l { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 99px; background: var(--paper); text-decoration: none; }
.otools input[type=search] { border: 1px solid var(--line); border-radius: 12px; background: var(--field, #fff); color: var(--ink); font: 15px var(--sans); padding: 10px 12px; }
.ovt span { line-height: 1.25; }
@media (max-width: 560px) { .ov { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; } .ovt { min-height: 62px; padding: 8px 4px; } .ovt b { font-size: 20px; } .ovt span { font-size: 10.5px; letter-spacing: 0; } }
.unsaved { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 12px; background: #fbf3e4; border: 1px solid #e7c98f; color: #7a4a0c; font: 600 13px var(--sans); }
/* Page design: Card / Picture layout tiles */
.lay2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lay2 button { border: 2px solid var(--line); border-radius: 14px; background: #fff; padding: 8px; cursor: pointer; text-align: center; font: 600 14px var(--sans); color: var(--ink); min-width: 0; }
.lay2 button.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.lay2 button.on b::before { content: "✓ "; color: var(--accent); }
.lay2 small { display: block; font-weight: 500; color: var(--ink-soft); font-size: 11.5px; line-height: 1.3; margin-top: 2px; }
.lay2 .th { display: block; height: 96px; border-radius: 10px; margin-bottom: 6px; position: relative; overflow: hidden; }
.th-card { background: #e9e3da url(/assets/art/paper.svg); }
.th-card::after { content: ""; position: absolute; left: 24%; right: 24%; top: 12%; bottom: 12%; border: 2px solid #d3c8bb; border-radius: 50%; }
.th-pic { background: #6f7a58 url(/assets/art/meadow.jpg) center / cover; }
.th-pic::before { content: "A & B"; position: absolute; left: 0; right: 0; top: 14px; color: #fff; font: 600 20px Caveat, cursive; text-shadow: 0 1px 6px rgba(0,0,0,.4); }
.th-pic i { position: absolute; left: 18%; right: 18%; bottom: 12px; height: 16px; border-radius: 99px; background: #784B59; }
.sepseg button { flex: 1 0 auto; min-width: 38px; padding: 0 8px; font-size: 16px; } .sepseg button:last-child { font-size: 13px; }
.seg.sepseg { display: grid; grid-template-columns: repeat(5, 1fr); width: 100%; } .sepseg button { border-bottom: 1px solid var(--line); min-height: 42px; } .sepseg button:nth-child(5n) { border-right: 0; } .sepseg button:nth-last-child(-n+5) { border-bottom: 0; }

/* ===== icon buttons: centred the same on every browser (iPhone adds its own padding to buttons otherwise) ===== */
.bo-icon, .icon-only { -webkit-appearance: none; appearance: none; padding: 0; display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
.bo-icon { width: 44px; height: 44px; flex: none; }
.bo-icon svg.ic { width: 22px; height: 22px; vertical-align: 0; margin: 0; }
.bo-head .bo-icon:first-child { padding-bottom: 0; }
.bo-alt { display: flex; align-items: center; justify-content: center; gap: 8px; -webkit-appearance: none; appearance: none; }
.bo-alt svg.ic { width: 20px; height: 20px; vertical-align: 0; }

/* ===== the booth in one colour: the couple's text colour (or the original pink when that's too light) ===== */
.bo-modal { --bo-ink: #B0466F; }
.bo-modal .bo-head b { color: var(--bo-ink); }
.bo-modal .bo-icon, .bo-modal .bo-ctrl .bo-icon.light { color: var(--bo-ink); border-color: color-mix(in srgb, var(--bo-ink) 35%, transparent); background: #fff; }
.bo-modal .bo-alt { color: var(--bo-ink); border-color: color-mix(in srgb, var(--bo-ink) 45%, transparent); background: #fff; font-weight: 600; }
.bo-modal .bo-pill { color: var(--bo-ink); border-color: color-mix(in srgb, var(--bo-ink) 35%, transparent); background: #fff; }
.bo-modal .bo-pill.on { background: var(--bo-ink); border-color: var(--bo-ink); color: #fff; }
.bo-modal .bo-shutter { border-color: var(--bo-ink); }
.bo-modal .bo-shutter i { background: var(--bo-ink); }
.bo-modal .bo-dots i.now { border-color: var(--bo-ink); }
.bo-modal .bo-shutter.rec i { background: #d23b3b; } .bo-modal .bo-shutter.recording { border-color: #d23b3b; }
.bo-modal .btn.ghost { color: var(--bo-ink); border-color: color-mix(in srgb, var(--bo-ink) 35%, transparent); }
.bo-modal .btn:not(.ghost) { background: var(--bo-ink); border-color: var(--bo-ink); color: #fff; }
.lay2.lay3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.th-story { background: #540f1f; }
.th-story::before { content: ""; position: absolute; inset: 7px; background: #ece8df url(/assets/art/linen.jpg) center / 200px; }
.th-story::after { content: ""; position: absolute; left: 36%; right: 36%; top: 30%; bottom: 26%; border-radius: 50%; background: #3a302c; box-shadow: 0 0 0 5px #e2dacb, 0 0 0 6px #b3a590; }
.th-story i { position: absolute; left: 26%; right: 26%; bottom: 13%; height: 7px; border-radius: 99px; background: #74250f; z-index: 1; }
@media (max-width: 400px) { .lay2.lay3 small { display: none; } }
.storyprev { position: relative; width: 150px; margin-top: 8px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.storyprev img { display: block; width: 100%; }
.storyprev i { position: absolute; border: 2px solid #e0457b; border-radius: 4px; box-sizing: border-box; }
.storyprev i.zl { border-color: #2e9d5b; }

/* English only: no BM / EN switch on guest pages */
html.en-only .langsw, html.en-only .kn-lang { display: none !important; }
/* long wishes (even one long unbroken word) wrap inside their note instead of running out of it */
.tile.wish, .tile.wish p, .tile .cap i, #lbCap em, .kn-wish-in { overflow-wrap: anywhere; word-break: break-word; min-width: 0; }
.tile.wish { overflow: hidden; }
.fr-modal.fr-top { z-index: 75; } /* “How it works” opens above the upload sheet */
/* private message (24 Nov): full screen; the camera preview shows the whole frame that is saved (no cropping),
   so what the guest sees is what the couple and the gallery get */
.fr-modal:has(.bl-sheet:not(.bl-public)) { padding: 0; align-items: stretch; }
.bl-sheet:not(.bl-public) { width: 100%; max-width: 640px; height: 100vh; height: 100dvh; max-height: none; border-radius: 0 !important; margin: 0 auto;
  display: flex; flex-direction: column; overflow: hidden; padding-bottom: max(12px, env(safe-area-inset-bottom)); box-sizing: border-box; }
.bl-sheet:not(.bl-public) .bl-stage { flex: 1 1 auto; min-height: 120px; }
.bl-stage.bl-cam { background: #000; border-radius: 14px; }
.bl-stage.bl-cam .bl-live { width: 100%; height: 100%; max-height: none; object-fit: contain; }
.bl-stage .bl-still { transform: none; }
.bl-rec.bl-shot i { background: var(--accent, #b0466f); }
.bl-pub { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 2px 0 10px; font-size: 14px; color: var(--ink); cursor: pointer; }
.bl-pub[hidden] { display: none; }
.bl-pub input { width: 20px; height: 20px; accent-color: var(--accent, #b0466f); }
.bl-sheet .bl-tabs button { min-height: 40px; }

/* ---- dashboard revamp (24 Nov): groups inside a section, and the Design controls ---- */
.sub { border: 1px solid var(--line); border-radius: 14px; background: color-mix(in srgb, var(--paper) 70%, var(--cream, #faf6ef)); }
.sub > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; min-height: 48px; box-sizing: border-box; }
.sub > summary::-webkit-details-marker { display: none; }
.sub > summary b { display: block; font-size: 14.5px; }
.sub > summary .hint { display: block; margin-top: 2px; }
.sub > summary::after { content: '▾'; color: var(--ink-soft); transition: transform .2s; flex: none; }
.sub[open] > summary::after { transform: rotate(180deg); }
.sub > .sub-body, .sub > form.sub-body, .sub > .stack.sub-body { padding: 4px 14px 16px; }
.dz { display: flex; flex-direction: column; gap: 12px; }
.dz-h { margin: 6px 0 0; font-size: 14px; }
.dz-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.dz > .dz-row:first-child { border-top: 0; padding-top: 2px; }
.dz-row-tight { border-top: 0; padding: 6px 0 0; }
.dz-name { flex: 1 1 100%; display: flex; flex-direction: column; }
.dz-name b { font-size: 14px; }
.dz-fontrow { display: flex; align-items: center; gap: 8px; flex: 1 1 220px; min-width: 0; }
.dz-font { flex: 0 1 170px; min-width: 0; padding: 8px 10px; border-radius: 10px; font-size: 14px; }
.dz-pv { flex: 1 1 auto; min-width: 0; font-size: 20px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.dz-colrow { display: flex; align-items: center; gap: 6px; }
.dz-col { width: 44px; height: 38px; padding: 2px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); cursor: pointer; }
.dz-col.unset { opacity: .45; }
.dz-def[hidden] { display: none; }
.dz-strip { padding: 12px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.dz-des3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.dz-des3 select { min-width: 0; padding: 8px 6px; border-radius: 10px; font-size: 13.5px; }
.dz-wishpv { margin-top: 4px; padding: 18px 16px 14px; border-radius: 4px; text-align: center; color: #F3D9A4; max-width: 300px;
  background: #CC7F96 radial-gradient(rgba(255,255,255,.09) 1px, transparent 1px) 0 0 / 5px 5px; box-shadow: 0 6px 18px rgba(60,20,30,.25); }
.dz-w-in { border: 2px solid currentColor; border-radius: 10px; padding: 10px; text-align: left; font: 500 16px/1.35 var(--script, cursive); color: inherit; }
.dz-w-ap { margin: 8px 0 6px; font: 600 15px var(--script, cursive); }
.dz-w-done { display: inline-block; min-width: 90px; padding: 4px 12px; border: 2px solid #F3D9A4; border-radius: 10px; color: #F3D9A4; font: 600 22px/1.1 var(--script, cursive); }
#secMore:has(#featBox[hidden]) { display: none; }
#designOpen { font-weight: 600; }
