:root {
  --bg: #111418; --panel: #1b1f26; --panel2: #232833; --line: #2e3542; --text: #eef1f6; --muted: #98a1b3;
  --accent: #ff5a7a; --accent2: #ffb14a; --ok: #3ecf8e; --danger: #ff5555; --radius: 16px;
  font-family: 'Prompt', system-ui, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); overscroll-behavior: none; }
body { user-select: none; -webkit-user-select: none; }
input, select, textarea { user-select: text; -webkit-user-select: text; }
#app { position: fixed; inset: 0; overflow: hidden; }
#app.screen-admin, #app.screen-gallery, #app.screen-frameEdit { overflow: auto; }
h1, h2, h3, h4 { margin: 0 0 .4em; font-weight: 600; }
p { margin: .3em 0 .7em; }
.muted { color: var(--muted); }
.small, small { font-size: .82em; }
.center { text-align: center; }
.warn { color: var(--accent2); }
.row { display: flex; align-items: center; flex-wrap: wrap; }
.gap { gap: 12px; }

/* buttons */
.btn { font: inherit; border: 1px solid var(--line); background: var(--panel2); color: var(--text); padding: 10px 18px;
  border-radius: 12px; cursor: pointer; font-size: 16px; min-height: 44px; transition: transform .08s, background .2s; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2, #ff7a59)); border-color: transparent; color: #fff; font-weight: 600; }
.btn.ghost { background: transparent; }
.btn.danger { background: transparent; border-color: #6b2b33; color: #ff8a8a; }
.btn.big { font-size: 22px; padding: 16px 30px; min-height: 64px; border-radius: 18px; }
.icon-btn { background: rgba(0,0,0,.35); color: #fff; border: 0; width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer; backdrop-filter: blur(6px); opacity: .55; }
.icon-btn:active { opacity: 1; }
.chip { font: inherit; font-size: 20px; padding: 12px 26px; border-radius: 40px; border: 2px solid rgba(255,255,255,.3);
  background: rgba(255,255,255,.08); color: inherit; cursor: pointer; }
.chip.on { background: #fff; color: #1a1030; border-color: #fff; font-weight: 600; }

/* toast / modal */
.toast { position: fixed; left: 50%; bottom: 30px; transform: translate(-50%, 30px); background: #fff; color: #111;
  padding: 12px 22px; border-radius: 30px; font-size: 17px; opacity: 0; transition: .3s; z-index: 1000; box-shadow: 0 8px 30px rgba(0,0,0,.4); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: grid; place-items: center; z-index: 900; padding: 16px; }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 22px; width: min(460px, 100%);
  max-height: 92vh; overflow: auto; }
.modal.wide { width: min(1000px, 100%); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.modal.pin { width: 340px; text-align: center; }
.pin-dots { font-size: 30px; letter-spacing: 10px; height: 44px; }
.pin-dots.shake { animation: shake .35s; color: var(--danger); }
@keyframes shake { 25% { transform: translateX(-10px) } 75% { transform: translateX(10px) } }
.pin-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px; }
.pin-key { font: inherit; font-size: 26px; height: 66px; border-radius: 16px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); }

/* forms */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; flex: 1; min-width: 120px; }
.field-label { font-size: 14px; color: var(--muted); }
.hint { color: var(--muted); }
input[type=text], input[type=number], input[type=date], input[type=password], input[type=email], input[type=tel], input[type=url], input:not([type]), select, textarea {
  font: inherit; font-size: 16px; background: var(--bg); color: var(--text); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; min-height: 44px; width: 100%; }
input[type=color] { width: 60px; height: 44px; border: 1px solid var(--line); border-radius: 10px; background: none; padding: 2px; }
input[type=range] { width: 100%; accent-color: var(--accent); }
.toggle { display: flex; align-items: center; gap: 12px; margin: 10px 0; cursor: pointer; }
.toggle input { display: none; }
.switch { width: 48px; height: 28px; border-radius: 20px; background: var(--line); position: relative; flex: none; transition: .2s; }
.switch::after { content: ''; position: absolute; width: 22px; height: 22px; top: 3px; left: 3px; border-radius: 50%; background: #fff; transition: .2s; }
.toggle input:checked + .switch { background: var(--ok); }
.toggle input:checked + .switch::after { left: 23px; }

/* shared page */
.page { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; }
.has-bg { background-size: cover; }
.bg-media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; pointer-events: none; }
.page > *:not(.bg-media), .welcome > *:not(.bg-media) { position: relative; z-index: 1; }
.page-title { font-size: 34px; text-shadow: 0 2px 10px rgba(0,0,0,.5); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.bottom-bar { position: absolute !important; left: 20px; bottom: 20px; }
.corner-menu { position: absolute !important; top: 16px; right: 16px; display: flex; gap: 10px; z-index: 5 !important; }
.center-msg { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; padding: 30px; }
.error-box { background: var(--panel); padding: 30px; border-radius: 20px; margin: 40px auto; max-width: 700px; }
.error-box pre { white-space: pre-wrap; font-size: 12px; color: var(--muted); max-height: 40vh; overflow: auto; }

/* welcome */
.welcome { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; cursor: pointer; overflow: hidden; }
.welcome-default { background: radial-gradient(circle at 30% 20%, #3b1d4d, transparent 60%), radial-gradient(circle at 80% 80%, #5a1f2e, transparent 55%), #111418; }
.welcome-content { text-align: center; padding: 30px; margin-bottom: 12vh; }
.welcome-title { font-size: clamp(40px, 7vw, 96px); font-weight: 700; text-shadow: 0 4px 30px rgba(0,0,0,.5); line-height: 1.15; }
.welcome-sub { font-size: clamp(20px, 2.6vw, 34px); text-shadow: 0 2px 12px rgba(0,0,0,.6); }
.pulse { animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45 } }
.feature-btns { display: flex; gap: 24px; justify-content: center; margin-top: 30px; flex-wrap: wrap; }
.feature-btn { font: inherit; font-size: 28px; font-weight: 600; color: #fff; border: 2px solid rgba(255,255,255,.5); cursor: pointer;
  background: rgba(0,0,0,.35); backdrop-filter: blur(8px); border-radius: 28px; padding: 26px 46px; display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 220px; }
.feature-btn:active { transform: scale(.97); }
.recent-strip { position: absolute !important; left: 0; right: 0; bottom: 0; height: 22vh; overflow: hidden; pointer-events: none;
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.recent-track { display: flex; gap: 14px; height: 100%; padding: 10px 0; width: max-content; animation: marquee linear infinite; }
.recent-track img { height: 100%; border-radius: 10px; box-shadow: 0 6px 20px rgba(0,0,0,.4); transform: rotate(-2deg); background: #fff; }
.recent-track img:nth-child(even) { transform: rotate(2deg); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* payment */
.pay-card { text-align: center; max-width: 520px; width: 100%; color: #111; background: #fff; border: 0; }
.pay-card .muted { color: #666; }
.pp-head { display: flex; justify-content: center; align-items: center; gap: 10px; background: #0e3d6b; color: #fff; margin: -20px -20px 16px; padding: 14px; border-radius: 16px 16px 0 0; font-size: 18px; }
.pp-logo { font-weight: 700; letter-spacing: .5px; }
.pp-amount { font-size: 54px; font-weight: 700; color: #0e3d6b; }
.pp-qr { width: min(340px, 70vw); height: auto; image-rendering: pixelated; }
.pay-card .btn.ghost { color: #333; border-color: #ccc; }
.pay-card .row { justify-content: center; }

/* select frame */
.select { justify-content: flex-start; padding-top: 30px; }
.frame-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; width: 100%; max-width: 1400px; overflow: auto; padding: 10px 10px 90px; }
.frame-card { font: inherit; background: rgba(255,255,255,.08); border: 2px solid rgba(255,255,255,.15); border-radius: 18px; padding: 14px;
  color: #fff; display: flex; flex-direction: column; align-items: center; gap: 10px; cursor: pointer; backdrop-filter: blur(6px); }
.frame-card:active { border-color: var(--accent); transform: scale(.98); }
.frame-thumb { max-width: 100%; max-height: 300px; border-radius: 6px; box-shadow: 0 6px 20px rgba(0,0,0,.4); }

/* capture */
.capture { padding: 0; }
.live-wrap { position: absolute !important; inset: 3vh 2vw 7vh; display: grid; place-items: center; }
.live { max-width: 100%; max-height: 100%; box-shadow: 0 10px 40px rgba(0,0,0,.6); }
.count-overlay { position: absolute !important; inset: 0; display: grid; place-items: center; font-size: 28vh; font-weight: 700; color: #fff;
  text-shadow: 0 0 40px rgba(0,0,0,.7); pointer-events: none; }
.count-overlay.pop { animation: pop 1s ease-out; }
@keyframes pop { 0% { transform: scale(1.6); opacity: 0 } 20% { opacity: 1; transform: scale(1) } 100% { opacity: .2; transform: scale(.8) } }
.flash { position: absolute !important; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 10 !important; }
.flash.go { animation: flash .5s ease-out; }
@keyframes flash { 0% { opacity: 1 } 100% { opacity: 0 } }
.cap-status { position: absolute !important; bottom: 2vh; left: 0; right: 0; text-align: center; font-size: 24px; color: #fff; text-shadow: 0 2px 8px #000; }

/* review / done */
.review-wrap, .done-wrap { display: flex; align-items: center; justify-content: center; gap: 40px; width: 100%; height: 100%; }
.review-img { max-height: 86vh; max-width: 55vw; box-shadow: 0 10px 40px rgba(0,0,0,.6); border-radius: 6px; background: #fff; }
.review-side { display: flex; flex-direction: column; gap: 16px; min-width: 280px; }
.review-side h2 { font-size: 44px; }
.print-status { font-size: 20px; color: var(--accent2); min-height: 1.5em; }
.done-wrap { cursor: pointer; text-align: center; }
.done-wrap h1 { font-size: 64px; }
.done-wrap p { font-size: 22px; }
.done-img { max-height: 70vh; max-width: 40vw; border-radius: 6px; transform: rotate(-3deg); box-shadow: 0 10px 40px rgba(0,0,0,.6); }
@media (orientation: portrait) {
  .review-wrap, .done-wrap { flex-direction: column; gap: 20px; }
  .review-img { max-width: 90vw; max-height: 60vh; }
  .done-img { max-width: 70vw; max-height: 45vh; }
}

/* fortune */
.fortune { color: #fff; overflow: auto; }
.fortune-card { background: rgba(20,10,40,.7); border-color: rgba(255,255,255,.15); backdrop-filter: blur(10px); text-align: center; max-width: 720px; width: 100%; }
.fortune-card h2 { font-size: 40px; }
.fortune-card .muted, .fortune-result .muted { color: #c9bfe6; }
.fortune-card .row { justify-content: center; margin-bottom: 14px; }
.big-select { font-size: 22px !important; min-height: 60px !important; width: auto !important; flex: 1; min-width: 100px; }
.palm-page { gap: 10px; }
.palm-pad { position: relative; width: min(58vh, 80vw); aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle, rgba(170,120,255,.25), rgba(170,120,255,.05) 70%); touch-action: none; }
.palm-pad.active { background: radial-gradient(circle, rgba(255,210,120,.45), rgba(170,120,255,.1) 70%); }
.palm-ring, .palm-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.palm-ring svg { transform: rotate(-90deg); }
.palm-ring circle { fill: none; stroke-width: 3; }
.palm-ring .bg { stroke: rgba(255,255,255,.15); }
.palm-ring .fg { stroke: #ffd36e; stroke-linecap: round; transition: stroke-dashoffset .1s linear; }
.palm-hand { width: 45%; color: rgba(255,255,255,.75); animation: pulse 2.2s infinite; pointer-events: none; }
.palm-pad.active .palm-hand { color: #ffd36e; animation: none; }
.palm-msg { font-size: 24px; text-align: center; }
.fortune-result { background: rgba(20,10,40,.8); border-color: rgba(255,255,255,.15); backdrop-filter: blur(10px); max-width: 900px; width: 100%; max-height: 94vh; overflow: auto; }
.f-head { display: flex; gap: 20px; align-items: center; margin-bottom: 14px; }
.f-score { width: 110px; height: 110px; border-radius: 50%; border: 3px solid #ffd36e; display: grid; place-content: center; text-align: center; flex: none; }
.f-score b { font-size: 40px; color: #ffd36e; line-height: 1; }
.f-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.f-cat { background: rgba(255,255,255,.06); border-radius: 12px; padding: 12px 14px; }
.f-cat-head { display: flex; justify-content: space-between; font-size: 18px; }
.stars { color: #ffd36e; letter-spacing: 2px; }
.f-lucky { display: flex; gap: 12px; margin: 14px 0; }
.f-lucky > div { flex: 1; background: rgba(255,211,110,.1); border-radius: 12px; padding: 10px; text-align: center; }
.f-lucky b { display: block; font-size: 24px; }
.f-advice { font-size: 18px; }
.fortune-result .row { justify-content: center; }

/* gallery */
.gallery { justify-content: flex-start; align-items: stretch; position: relative; min-height: 100%; }
.gal-head { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin-bottom: 18px; }
.gal-title { flex: 1; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.gal-title h2 { margin: 0; }
.gal-title select { width: auto; }
.gal-stats { display: flex; gap: 16px; }
.gal-stats span { background: var(--panel); padding: 8px 14px; border-radius: 10px; }
.gal-stats b { color: var(--accent2); }
.gal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.gal-item { font: inherit; color: var(--text); border: 1px solid var(--line); background: var(--panel); border-radius: 12px; padding: 8px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; }
.gal-item img { width: 100%; aspect-ratio: 3/4; object-fit: contain; background: #fff; border-radius: 6px; }
.gal-meta { font-size: 13px; color: var(--muted); }
.viewer { display: flex; gap: 20px; flex-wrap: wrap; }
.viewer-img { max-height: 70vh; max-width: 100%; flex: 1 1 300px; object-fit: contain; background: #fff; border-radius: 6px; min-width: 0; }
.viewer-side { flex: 0 1 260px; display: flex; flex-direction: column; gap: 8px; }

/* admin */
.admin { display: flex; flex-direction: row; align-items: stretch; justify-content: flex-start; padding: 0; min-height: 100%; position: relative; }
.admin-nav { width: 230px; flex: none; background: var(--panel); border-right: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column; gap: 6px;
  position: sticky; top: 0; height: 100vh; }
.brand { font-weight: 700; font-size: 18px; margin-bottom: 16px; }
.brand small { display: block; color: var(--muted); font-weight: 400; }
.nav-btn { font: inherit; text-align: left; background: none; border: 0; color: var(--text); padding: 12px 14px; border-radius: 10px; cursor: pointer; font-size: 16px; }
.nav-btn.on { background: var(--panel2); color: var(--accent); font-weight: 600; }
.nav-spacer { flex: 1; }
.admin-body { flex: 1; padding: 24px; min-width: 0; padding-bottom: 100px; }
.admin-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.admin-top h2 { margin: 0; }
.admin-top.sticky { position: sticky; top: 0; background: var(--bg); padding: 10px 0; z-index: 5; }
.event-list { display: flex; flex-direction: column; gap: 14px; }
.event-card.active { border-color: var(--accent); }
.ev-head { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.badge { background: var(--accent); color: #fff; font-size: 12px; padding: 3px 10px; border-radius: 20px; margin-left: 10px; vertical-align: middle; }
.stat-row { display: flex; gap: 12px; flex-wrap: wrap; margin: 10px 0; }
.stat { background: var(--bg); border-radius: 12px; padding: 10px 16px; min-width: 110px; }
.stat b { display: block; font-size: 26px; color: var(--accent2); }
.stat small { color: var(--muted); }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; }
.settings-grid .span2 { grid-column: 1 / -1; }
.settings-grid h4 { margin-top: 14px; color: var(--muted); font-weight: 400; }
.media-pick { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.media-thumb { height: 60px; max-width: 110px; object-fit: cover; border-radius: 8px; }
.frame-pick { display: flex; flex-wrap: wrap; gap: 12px; }
.fp-item { font: inherit; position: relative; background: var(--bg); border: 2px solid var(--line); border-radius: 12px; padding: 8px; color: var(--text); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 6px; width: 150px; }
.fp-item canvas { max-width: 130px; max-height: 150px; opacity: .45; }
.fp-item.on { border-color: var(--accent); }
.fp-item.on canvas { opacity: 1; }
.fp-num { position: absolute; top: 6px; left: 6px; background: var(--accent); color: #fff; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; }
.bg-row { display: grid; grid-template-columns: 140px 70px 1fr; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.qr-preview canvas { margin-top: 8px; border-radius: 8px; }
.save-bar { position: fixed; right: 24px; bottom: 20px; z-index: 20; }
.frames-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.frame-tile { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.frame-tile canvas { align-self: center; max-width: 100%; max-height: 240px; margin-bottom: 8px; box-shadow: 0 4px 14px rgba(0,0,0,.4); }
.conn { padding: 8px 14px; border-radius: 10px; font-size: 14px; }
.conn.ok { background: rgba(62,207,142,.15); color: var(--ok); }
.conn.no { background: rgba(255,85,85,.12); color: #ff9a9a; }
.mono-preview { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.mono-canvas { max-width: 100%; max-height: 70vh; image-rendering: pixelated; border: 1px solid var(--line); }
.cam-preview { width: 100%; max-height: 60vh; object-fit: contain; background: #000; border-radius: 10px; }

/* editor */
.editor { display: block; padding: 20px; overflow: auto; }
.ed-body { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.ed-left { flex: 1 1 400px; display: flex; flex-direction: column; align-items: center; min-width: 0; }
.ed-stage { position: relative; box-shadow: 0 6px 30px rgba(0,0,0,.5); touch-action: none; }
.ed-canvas { width: 100%; height: 100%; display: block; }
.ed-boxes { position: absolute; inset: 0; }
.ed-box { position: absolute; border: 2px dashed rgba(255,90,122,.8); cursor: move; touch-action: none; }
.ed-box.sel { border: 2px solid var(--accent); background: rgba(255,90,122,.12); }
.ed-num { position: absolute; top: 4px; left: 4px; background: var(--accent); color: #fff; font-size: 13px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; }
.ed-handle { position: absolute; right: -10px; bottom: -10px; width: 26px; height: 26px; background: var(--accent); border: 3px solid #fff; border-radius: 50%; cursor: nwse-resize; }
.ed-panel { flex: 0 1 400px; display: flex; flex-direction: column; gap: 14px; }
.ed-panel section { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.slot-fields { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }

@media (max-width: 800px) {
  .admin { flex-direction: column; }
  .admin-nav { width: 100%; height: auto; position: static; flex-direction: row; flex-wrap: wrap; }
  .nav-spacer, .brand { display: none; }
  .bg-row { grid-template-columns: 1fr 70px; }
}

/* thermal tuning */
.tune { display: grid; grid-template-columns: minmax(300px, 1fr) minmax(300px, 1.2fr); gap: 24px; align-items: start; }
.tune-previews { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; position: sticky; top: 10px; }
.tune-previews .mono-canvas { max-height: 62vh; background: #fff; }
.tune-previews b { font-weight: 600; font-size: 14px; color: var(--muted); }
.sl-row { margin-bottom: 14px; }
.sl-head { display: flex; justify-content: space-between; font-size: 15px; }
.sl-val { color: var(--accent2); min-width: 44px; text-align: right; }
.sl-ctrl { display: flex; align-items: center; gap: 10px; }
.sl-btn { font: inherit; font-size: 22px; width: 42px; height: 42px; flex: none; border-radius: 10px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); }
.preset-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip.small-chip { font-size: 14px; padding: 8px 14px; border-width: 1px; }
.tune h4 { margin: 16px 0 8px; }
.tune .row .sl-row { flex: 1; min-width: 180px; margin: 0; }
@media (max-width: 900px) { .tune { grid-template-columns: 1fr; } }

/* decorate */
.decorate { padding: 16px; }
.deco-wrap { display: flex; gap: 20px; width: 100%; height: 100%; align-items: stretch; }
.deco-stage { flex: 1; min-width: 0; display: grid; place-items: center; }
.deco-canvas { touch-action: none; box-shadow: 0 10px 40px rgba(0,0,0,.6); border-radius: 4px; cursor: crosshair; }
.deco-panel { width: 340px; flex: none; background: rgba(20,22,28,.85); backdrop-filter: blur(10px); border: 1px solid var(--line);
  border-radius: 20px; padding: 18px; display: flex; flex-direction: column; gap: 16px; overflow: auto; }
.deco-head { display: flex; justify-content: space-between; align-items: center; }
.deco-head h2 { margin: 0; }
.deco-timer { font-size: 18px; color: var(--muted); }
.deco-timer.warn { color: var(--danger); font-weight: 700; }
.deco-tools { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.deco-tool { font: inherit; background: var(--panel2); color: var(--text); border: 2px solid transparent; border-radius: 14px; padding: 10px 4px;
  display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; }
.deco-tool.on { border-color: var(--accent); color: var(--accent); background: rgba(255,90,122,.1); }
.swatches { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.swatch { aspect-ratio: 1; border-radius: 50%; border: 2px solid rgba(255,255,255,.25); cursor: pointer; }
.swatch.on { outline: 3px solid #fff; outline-offset: 3px; }
.size-row { display: flex; align-items: center; gap: 12px; }
.size-dot { border-radius: 50%; flex: none; border: 1px solid rgba(255,255,255,.4); }
.deco-size { flex: 1; }
.text-opts { display: flex; flex-direction: column; gap: 10px; }
.font-row { display: flex; gap: 8px; flex-wrap: wrap; }
.text-opts .chip.on { background: #fff; color: #111; }
.icon-text { display: inline-flex; align-items: center; gap: 6px; }
.deco-actions .btn { flex: 1; justify-content: center; }
.deco-bottom { margin-top: auto; display: flex; gap: 10px; }
.deco-bottom .btn.big { flex: 1; }
.deco-input { font: inherit; font-size: 24px; width: 100%; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
@media (orientation: portrait) {
  .deco-wrap { flex-direction: column; }
  .deco-panel { width: 100%; max-height: 42vh; }
  .deco-tools { grid-template-columns: repeat(4, 1fr); }
  .swatches { grid-template-columns: repeat(12, 1fr); gap: 6px; }
}

/* backup */
.prog { height: 14px; background: var(--bg); border-radius: 10px; overflow: hidden; margin: 14px 0 8px; }
.prog-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent2)); transition: width .2s; }
.backup-warn { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 14px; border-color: var(--accent2); background: rgba(255,177,74,.08); }
.backup-status.warn { border-color: var(--accent2); }
.backup-status .stat b { font-size: 20px; }
.tips { margin: 0; padding-left: 20px; line-height: 1.8; }
.tpl-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; max-height: 55vh; overflow: auto; }
.tpl-item { display: flex; flex-direction: column; align-items: center; gap: 6px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 10px; cursor: pointer; }
.tpl-item canvas { max-height: 100px; }
.restore-sum .stat b { font-size: 22px; }

/* cloud / QR */
.done-qr-box { background: #fff; color: #111; border-radius: 22px; padding: 22px 22px 16px; display: flex; flex-direction: column; align-items: center; gap: 10px; box-shadow: 0 10px 40px rgba(0,0,0,.5); cursor: default; }
.done-qr { width: min(36vh, 60vw); height: auto; image-rendering: pixelated; }
.done-qr-box b { font-size: 20px; }
.sql { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px; font-size: 12px; overflow: auto; white-space: pre; user-select: text; -webkit-user-select: text; }
.album-row { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.album-row canvas { border-radius: 8px; flex: none; }
.album-row > div { flex: 1; min-width: 220px; }
.viewer-share { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-top: 8px; }
.viewer-qr { border-radius: 8px; width: 160px; height: auto; image-rendering: pixelated; }
hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
.done-img.with-qr { max-height: 62vh; max-width: 30vw; }
@media (orientation: portrait) { .done-img.with-qr { max-height: 32vh; max-width: 60vw; } .done-qr { width: min(28vh, 55vw); } }
.ed-box.fortune { border-color: rgba(167,123,255,.9); }
.ed-box.fortune.sel { border-color: #a77bff; background: rgba(167,123,255,.12); }
.ed-box.fortune .ed-num { background: #a77bff; width: 28px; height: 28px; font-size: 15px; }
.ed-box.fortune .ed-handle { background: #a77bff; }
.fortune-sec { border-color: rgba(167,123,255,.5) !important; }
.palm-dots { position: absolute; inset: 0; pointer-events: none; }
.touch-dot { position: absolute; width: 70px; height: 70px; margin: -35px 0 0 -35px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,211,110,.9), rgba(255,211,110,.25) 60%, transparent 70%); animation: tdot 1s ease-in-out infinite; }
@keyframes tdot { 50% { transform: scale(1.15); } }
.finger-bar { display: flex; gap: 12px; justify-content: center; margin-top: 4px; }
.fdot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(255,255,255,.4); transition: .15s; }
.fdot.on { background: #ffd36e; border-color: #ffd36e; box-shadow: 0 0 12px #ffd36e; }

/* account / membership */
.account { overflow: auto; background: radial-gradient(circle at 20% 10%, #2a1740, transparent 60%), #111418; }
.auth-card, .status-card { width: min(520px, 100%); }
.brand-big { font-size: 26px; font-weight: 700; text-align: center; margin-bottom: 14px; }
.tabs { display: flex; background: var(--bg); border-radius: 12px; padding: 4px; margin-bottom: 16px; }
.tab { flex: 1; font: inherit; font-size: 16px; padding: 10px; border: 0; border-radius: 10px; background: none; color: var(--muted); cursor: pointer; }
.tab.on { background: var(--panel2); color: var(--text); font-weight: 600; }
.auth-card .btn.big { width: 100%; margin-top: 8px; }
.agree { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
.agree input { width: 20px; height: 20px; }
.agree a { color: var(--accent2); }
.terms { line-height: 1.8; padding-left: 20px; }
.status-head { display: flex; gap: 14px; align-items: center; }
.status-icon { font-size: 42px; }
.plans { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0; }
.plan-btn { flex: 1; min-width: 130px; font: inherit; color: var(--text); background: var(--bg); border: 2px solid var(--line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 4px; cursor: pointer; }
.plan-btn b { font-size: 22px; color: var(--accent2); }
.plan-btn.on { border-color: var(--accent); }
.plan-qr { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.plan-qr canvas { border-radius: 10px; }
.nav-acc { margin-top: 8px; font-size: 12px; line-height: 1.4; color: var(--muted); }
.member-list { display: flex; flex-direction: column; gap: 10px; }
.member-row { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; align-items: center; }
.m-info { display: flex; flex-direction: column; gap: 4px; min-width: 240px; flex: 1; }
.m-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.m-badge { font-size: 12px; padding: 2px 10px; border-radius: 20px; background: var(--panel2); }
.m-badge.pending { background: rgba(255,177,74,.2); color: var(--accent2); }
.m-badge.active { background: rgba(62,207,142,.18); color: var(--ok); }
.m-badge.expired, .m-badge.suspended { background: rgba(255,85,85,.15); color: #ff9a9a; }
.m-badge.admin { background: rgba(167,123,255,.2); color: #c7a8ff; }
.filter-bar { margin-bottom: 14px; }
.filter-bar select, .filter-bar input { width: auto; flex: 1; min-width: 200px; }
.owner-only { border-color: rgba(167,123,255,.5); }

/* owner tools: cloud gallery + packs */
.m-tools { margin-top: 6px; }
.small-btn { padding: 6px 12px; font-size: 14px; min-height: 0; }
.warn-card { border-color: var(--accent2); margin-bottom: 14px; }
.cg { min-height: 200px; max-height: 70vh; overflow: auto; display: flex; flex-direction: column; gap: 10px; }
.cg-event { display: flex; flex-direction: column; gap: 6px; padding: 14px; }
.cg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.cg-item { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 12px; text-decoration: none; }
.cg-item img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 10px; background: var(--panel2); }
.pack-events { display: flex; flex-direction: column; gap: 6px; max-height: 30vh; overflow: auto; }
.chk-row { display: flex; align-items: center; gap: 6px; padding: 6px 4px; }
.chk-row input, .tpl-item input { width: 20px; height: 20px; }
.pack-sent { display: flex; flex-direction: column; gap: 4px; }
.pack-row { justify-content: space-between; align-items: center; font-size: 14px; border-bottom: 1px solid var(--line); padding: 4px 0; }

/* ---------- add-on activities ---------- */
.feature-btns.many { gap: 16px; max-width: 1100px; }
.feature-btns.many .feature-btn { min-width: 170px; padding: 18px 26px; font-size: 22px; }
.fe-emoji { font-size: 44px; line-height: 1; display: block; }
.big-input { font-size: 22px !important; min-height: 60px; width: 100%; margin: 6px 0 14px; text-align: center; }
textarea.big-input { text-align: left; min-height: 110px; resize: none; }
.center-row { justify-content: center; }
.act-result { justify-content: center; }
.act-card { background: rgba(20,10,40,.8); border-color: rgba(255,255,255,.15); backdrop-filter: blur(10px); text-align: center; max-width: 760px; width: 100%;
  max-height: 96vh; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.act-card h2 { font-size: 34px; }
.slip-wrap { overflow: auto; max-height: 58vh; border-radius: 8px; }
.slip-preview { width: min(420px, 80vw); height: auto; display: block; border-radius: 6px; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.slip-preview.small { width: 260px; }

/* two-pad touch (love match) */
.pads { display: flex; gap: 4vw; justify-content: center; align-items: center; }
.palm-two .palm-pad { width: min(40vh, 40vw); }
.pad-name { position: absolute; bottom: -40px; left: 0; right: 0; text-align: center; font-size: 22px; font-weight: 600; }
.palm-pad.touched { box-shadow: 0 0 0 3px #ffd36e inset; }
.love-people { display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; margin-bottom: 10px; }
.love-person { flex: 1; min-width: 280px; background: rgba(255,255,255,.06); border-radius: 16px; padding: 14px; }
.love-person h3 { font-size: 24px; margin-bottom: 6px; }
.love-card { max-width: 980px; }

/* siamsi */
.siamsi-page { gap: 8px; }
.cup-stage { position: relative; height: 56vh; aspect-ratio: 2 / 3; display: grid; place-items: center; }
.siamsi-cup { background: none; border: 0; padding: 0; cursor: pointer; width: 100%; height: 100%; touch-action: none; transform-origin: 50% 90%; }
.cup-svg { width: 100%; height: 100%; filter: drop-shadow(0 18px 30px rgba(0,0,0,.5)); }
.siamsi-cup.shake { animation: cupShake .45s ease-in-out; }
.siamsi-cup.shake-long { animation: cupShake .3s ease-in-out 4; }
@keyframes cupShake { 0%,100% { transform: rotate(0) } 20% { transform: rotate(-9deg) translateY(-6px) } 50% { transform: rotate(8deg) } 75% { transform: rotate(-5deg) translateY(-3px) } }
.siamsi-stick { position: absolute; left: 50%; top: 12%; width: 34px; height: 46%; margin-left: -17px; border-radius: 6px; opacity: 0; pointer-events: none;
  background: linear-gradient(90deg, #c99547, #f1cd85, #c99547); border: 2px solid #a87a35; color: #7d0f18; font-weight: 700; font-size: 26px;
  display: flex; align-items: flex-start; justify-content: center; padding-top: 8px; }
.siamsi-stick.out { animation: stickOut 1.2s cubic-bezier(.2,.9,.3,1.2) forwards; }
@keyframes stickOut { 0% { opacity: 1; transform: translateY(30%) } 60% { opacity: 1; transform: translateY(-62%) rotate(4deg) } 100% { opacity: 1; transform: translateY(-55%) rotate(-3deg) scale(1.15) } }

/* quiz */
.quiz-page { justify-content: center; }
.quiz-card { background: rgba(20,10,40,.8); border-color: rgba(255,255,255,.15); backdrop-filter: blur(10px); text-align: center; max-width: 900px; width: 100%;
  display: flex; flex-direction: column; gap: 14px; align-items: stretch; max-height: 96vh; overflow: auto; }
.quiz-card h2 { font-size: 36px; }
.quiz-q { font-size: clamp(26px, 3.4vw, 42px) !important; line-height: 1.35; margin: 6px 0 10px; }
.quiz-choices { display: grid; gap: 14px; }
.quiz-choices.grid2 { grid-template-columns: 1fr 1fr; }
.quiz-choice { font: inherit; font-size: 26px; font-weight: 600; color: #fff; background: rgba(255,255,255,.1); border: 2px solid rgba(255,255,255,.25);
  border-radius: 18px; padding: 22px 16px; cursor: pointer; transition: .15s; }
.quiz-choice:active { transform: scale(.98); }
.quiz-choice.right { background: #1f9d63; border-color: #3ecf8e; }
.quiz-choice.wrong { background: #a3303b; border-color: #ff5555; }
.quiz-progress { display: flex; gap: 6px; justify-content: center; }
.quiz-progress span { width: 34px; height: 6px; border-radius: 3px; background: rgba(255,255,255,.2); }
.quiz-progress span.done { background: #ffd36e; } .quiz-progress span.now { background: #fff; }
.quiz-score b { display: block; font-size: 90px; line-height: 1; color: #ffd36e; }
.quiz-score span { font-size: 30px; font-weight: 600; }
.quiz-board { background: rgba(255,255,255,.06); border-radius: 14px; padding: 12px 16px; text-align: left; }
.quiz-board h3, .quiz-board h4 { margin-bottom: 6px; }
.qb-row { display: grid; grid-template-columns: 1fr auto auto; gap: 14px; padding: 5px 0; border-bottom: 1px solid rgba(255,255,255,.08); align-items: baseline; }
.qb-row.me { color: #ffd36e; font-weight: 600; }
.quiz-board.qb-admin { background: var(--panel2); margin-top: 10px; }

/* guestbook */
.wish-text { margin-top: 0; }
.wish-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 14px; }
.wish-chips .chip { font-size: 17px; padding: 8px 16px; }

/* video wish */
.video-page { justify-content: center; }
.dur-row { display: flex; gap: 14px; justify-content: center; margin: 6px 0 18px; flex-wrap: wrap; }
.dur-btn { font: inherit; color: #fff; background: rgba(255,255,255,.08); border: 2px solid rgba(255,255,255,.25); border-radius: 20px; width: 120px; padding: 14px 0;
  display: flex; flex-direction: column; align-items: center; cursor: pointer; }
.dur-btn b { font-size: 46px; line-height: 1.1; } .dur-btn small { font-size: 16px; opacity: .8; }
.dur-btn.on { background: #fff; color: #1a1030; border-color: #fff; }
.vw-stage { position: relative; width: min(94vw, 150vh); aspect-ratio: 16 / 9; max-height: 82vh; border-radius: 14px; overflow: hidden; background: #000; }
.vw-live { width: 100%; height: 100%; object-fit: cover; display: block; }
.vw-live.mirror { transform: scaleX(-1); }
.vw-ring { position: absolute; right: 2vw; top: 2vw; width: 110px; height: 110px; display: grid; place-items: center; }
.vw-ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.vw-ring circle { fill: rgba(0,0,0,.35); stroke-width: 6; } .vw-ring .bg { stroke: rgba(255,255,255,.25); } .vw-ring .fg { fill: none; stroke: #ff3b30; stroke-linecap: round; }
.vw-ring b { position: relative; font-size: 40px; color: #fff; }
.vw-rec { position: absolute; left: 2vw; top: 2vw; color: #fff; background: rgba(0,0,0,.45); padding: 6px 14px; border-radius: 999px; font-weight: 600; opacity: 0; }
.recording .vw-rec { opacity: 1; animation: pulse 1s infinite; color: #ff6b6b; }
.vw-stop { margin-top: 14px; visibility: hidden; }
.recording .vw-stop { visibility: visible; }
.vw-review { display: flex; gap: 30px; align-items: center; justify-content: center; width: 100%; height: 100%; }
.vw-play { max-width: 60vw; max-height: 82vh; border-radius: 12px; background: #000; }
@media (orientation: portrait) { .vw-review { flex-direction: column; } .vw-play { max-width: 92vw; max-height: 55vh; } }

/* gallery badges */
.gal-item { position: relative; }
.gal-kind { position: absolute; top: 12px; left: 12px; font-size: 20px; background: rgba(0,0,0,.55); border-radius: 10px; padding: 2px 6px; }
.vid-badge { position: absolute; top: 12px; right: 12px; font-size: 13px; color: #fff; background: rgba(0,0,0,.6); border-radius: 10px; padding: 3px 8px; }
.vid-ph { aspect-ratio: 3/4; display: grid; place-items: center; font-size: 50px; background: #000; border-radius: 6px; }
.gal-item.vid img { object-fit: cover; background: #000; }

/* admin add-on menu */
.addon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; align-items: start; }
.addon-tile { background: var(--panel2); border: 1px solid var(--line); border-radius: 14px; padding: 14px; transition: border-color .2s; }
.addon-tile.on { border-color: var(--ok); box-shadow: 0 0 0 1px var(--ok) inset; }
.addon-tile.open { grid-column: 1 / -1; }
.addon-head { display: flex; gap: 12px; align-items: flex-start; }
.addon-icon { font-size: 32px; line-height: 1; }
.addon-text { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.addon-text b { font-size: 18px; }
.addon-head .toggle { margin: 0; }
.addon-foot { display: flex; justify-content: flex-end; margin-top: 6px; }
.addon-body { display: flex; flex-direction: column; gap: 10px; }
.addon-tile.open .addon-body { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 8px; }
.price-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.mono-area { font-family: ui-monospace, Menlo, monospace; font-size: 14px; }
.receipt-prev { display: flex; justify-content: center; background: var(--bg); padding: 12px; border-radius: 10px; }
.quiz-edit { display: flex; flex-direction: column; gap: 10px; }
.qe-item { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.qe-item .row { align-items: center; flex-wrap: nowrap; }
.qe-q { flex: 1; }
.qe-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; }
.qe-choice { display: flex; gap: 6px; align-items: center; border-radius: 10px; padding: 2px 4px; }
.qe-choice.right { background: rgba(62,207,142,.15); }
.qe-choice input[type=radio] { width: 22px; height: 22px; accent-color: var(--ok); flex: none; }
.warn.small { font-size: 13px; }
.logo-pick { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.logo-item { position: relative; width: 90px; height: 90px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; display: grid; place-items: center; }
.logo-item img { max-width: 80px; max-height: 80px; object-fit: contain; }
.logo-item button { position: absolute; top: -8px; right: -8px; padding: 2px 8px; }

/* ---------- AI Portrait ---------- */
.ai-page { gap: 14px; }
.ai-consent { display: flex; gap: 12px; align-items: center; max-width: 860px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.2);
  border-radius: 14px; padding: 12px 18px; font-size: 18px; cursor: pointer; }
.ai-consent input { width: 28px; height: 28px; flex: none; accent-color: #ffd36e; }
.ai-consent.shake { animation: cupShake .4s; border-color: #ffd36e; }
.ai-themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; width: 94vw; justify-content: center; max-height: 72vh; overflow: auto; padding: 4px; margin: 0 auto; }
.ai-themes.locked .ai-theme { opacity: .45; }
.ai-theme { font: inherit; color: #fff; background: rgba(255,255,255,.08); border: 2px solid rgba(255,255,255,.18); border-radius: 18px; padding: 10px;
  display: flex; flex-direction: column; align-items: center; gap: 8px; cursor: pointer; transition: .15s; }
.ai-theme:active { transform: scale(.97); border-color: #ffd36e; }
.ai-theme img { width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: 12px; }
.ai-emoji { width: 100%; aspect-ratio: 3/4; display: grid; place-items: center; font-size: 64px; border-radius: 12px;
  background: radial-gradient(circle at 30% 20%, rgba(255,211,110,.35), rgba(140,90,255,.25) 60%, rgba(0,0,0,.2)); }
.ai-theme b { font-size: 20px; }
.ai-proc { gap: 12px; }
.ai-stage { position: relative; height: 62vh; aspect-ratio: 3/4; border-radius: 16px; overflow: hidden; box-shadow: 0 0 60px rgba(140,90,255,.5); }
.ai-stage img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.7) brightness(.85); }
.ai-scan { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, transparent 0%, rgba(255,211,110,.0) 40%, rgba(255,211,110,.55) 50%, rgba(140,90,255,.0) 60%, transparent 100%);
  background-size: 100% 220%; animation: aiScan 2.2s linear infinite; mix-blend-mode: screen; }
@keyframes aiScan { from { background-position: 0 120% } to { background-position: 0 -120% } }
.ai-msg { font-size: 26px; font-weight: 600; animation: pulse 2s infinite; }
.ai-result { display: flex; gap: 34px; align-items: center; justify-content: center; width: 100%; height: 100%; }
.ai-pair { display: flex; gap: 18px; align-items: flex-end; }
.ai-pair figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.ai-before img { height: 26vh; border-radius: 10px; opacity: .85; }
.ai-after img { height: 82vh; max-width: 50vw; object-fit: contain; border-radius: 12px; box-shadow: 0 10px 50px rgba(255,211,110,.35); background: #fff; }
.ai-pair figcaption { font-size: 18px; }
@media (orientation: portrait) { .ai-result { flex-direction: column; } .ai-after img { height: 52vh; max-width: 80vw; } .ai-before img { height: 16vh; } }
/* admin */
.ai-mode-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ai-mode { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.ai-mode.on { border-color: var(--ok); box-shadow: 0 0 0 1px var(--ok) inset; }
.ai-own summary { cursor: pointer; color: var(--accent2); margin: 6px 0; }
.ai-own input { width: 100%; margin: 8px 0; }
.ai-theme-edit { display: flex; flex-direction: column; gap: 10px; }
.ai-te { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.ai-te.off { opacity: .55; }
.ai-te-head { display: flex; gap: 10px; }
.ai-te-prev { width: 72px; height: 96px; flex: none; border-radius: 8px; overflow: hidden; display: grid; place-items: center; background: var(--panel2); font-size: 36px; }
.ai-te-prev img { width: 100%; height: 100%; object-fit: cover; }
.ai-te-fields { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.ai-te-fields .row { align-items: center; flex-wrap: nowrap; }
.ai-te-emoji { width: 56px !important; text-align: center; }
.ai-te-name { flex: 1; }
.ai-te-prompt { width: 100%; font-size: 14px; }

/* guest theme fonts (set by the event's ready-made theme) */
.welcome-title, .page-title, .done-wrap h1, .review-side h2, .fortune-card h2, .act-card h2, .quiz-card h2, .deco-head h2 {
  font-family: var(--guest-font, 'Prompt'), 'Prompt', sans-serif; }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.theme-tile { background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.theme-tile.on { border-color: var(--ok); box-shadow: 0 0 0 1px var(--ok) inset; }
.theme-tile canvas { width: 100%; height: auto; border-radius: 10px; }
.theme-tile b { font-size: 17px; }

/* ---- devices / view-only device ---- */
.dev-list{display:flex;flex-direction:column;gap:8px;margin:8px 0}
.dev-row{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;background:rgba(255,255,255,.05);border:1px solid rgba(255,255,255,.08);border-radius:12px;padding:10px 12px}
.dev-row.main{border-color:rgba(255,122,89,.55)}
.dev-info{display:flex;flex-direction:column;gap:2px;min-width:0}
.dev-me{margin-left:8px;font-size:12px;font-weight:600;background:#2f6bff;color:#fff;border-radius:999px;padding:1px 8px}
.page.viewer-home{display:flex;align-items:center;justify-content:center;padding:24px;min-height:100%;background:radial-gradient(circle at 30% 20%,#232a3a,#0e1117)}
.viewer-card{max-width:560px;width:100%;display:flex;flex-direction:column;gap:12px;text-align:center}
.viewer-card .field{text-align:left}
.viewer-badge{align-self:center;background:#2f6bff;color:#fff;font-weight:600;border-radius:999px;padding:4px 14px}
.viewer-btns{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.viewer-btns .btn.primary{grid-column:span 2}
.archive-line{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.dot{width:10px;height:10px;border-radius:50%;display:inline-block;background:#777}.dot.ok{background:#3ccf6e}.dot.bad{background:#ff5a5a}
.quota{display:flex;flex-direction:column;gap:4px;margin:6px 0 10px}
.quota-bar{height:12px;border-radius:999px;background:rgba(255,255,255,.1);overflow:hidden}
.quota-bar i{display:block;height:100%;background:linear-gradient(90deg,#3ccf6e,#2fb3ff);border-radius:999px}
.quota-bar.high i{background:linear-gradient(90deg,#ffb020,#ff7a59)}.quota-bar.full i{background:#ff4d4d}
.arc-events{display:flex;flex-direction:column;gap:6px;max-height:340px;overflow:auto}
.arc-ev{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 10px;border-radius:10px;background:rgba(255,255,255,.04)}
.arc-policy{margin-top:12px;border-top:1px solid rgba(255,255,255,.08);padding-top:8px}

/* ---- filter picker (after shooting) ---- */
.filter-pick { padding: 2.5vh 2.5vw; }
.fp-wrap { display: flex; gap: 2.5vw; width: 100%; height: 100%; align-items: stretch; }
.fp-left { flex: 1 1 46%; display: grid; place-items: center; min-width: 0; min-height: 0; }
.fp-preview { max-width: 100%; max-height: 92vh; border-radius: 10px; box-shadow: 0 14px 40px rgba(0,0,0,.35); background: #fff; }
.fp-right { flex: 1 1 54%; display: flex; flex-direction: column; gap: 10px; min-width: 0; min-height: 0; background: rgba(255,255,255,.1); backdrop-filter: blur(10px); border-radius: 24px; padding: 20px; overflow: hidden; }
.fp-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.fp-head .page-title { margin: 0; }
.fp-timer { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.fp-sub { margin: 0; opacity: .75; }
.fp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; flex: 1 1 auto; min-height: 0; overflow: auto; align-content: start; padding: 4px; }
.fp-tile { font: inherit; color: inherit; background: rgba(255,255,255,.12); border: 3px solid transparent; border-radius: 14px; padding: 6px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.fp-tile.on { border-color: var(--accent); background: rgba(255,255,255,.3); box-shadow: 0 6px 18px rgba(0,0,0,.15); }
.fp-tile span { font-weight: 600; font-size: 14px; }
.fp-tile small { opacity: .6; font-size: 11px; letter-spacing: .5px; }
.fp-thumb { width: 100%; aspect-ratio: 1; border-radius: 10px; object-fit: cover; }
.fp-levels { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fp-lv { font: inherit; color: inherit; border: 2px solid rgba(255,255,255,.3); background: transparent; border-radius: 999px; padding: 8px 18px; cursor: pointer; }
.fp-lv.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.fp-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: auto; }
@media (orientation: portrait) { .fp-wrap { flex-direction: column; } .fp-left { flex: 0 0 48%; } .fp-preview { max-height: 46vh; } }
.fp-admin-grid { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.fp-admin-grid .chk { display: flex; align-items: center; gap: 6px; }

/* ---- light guest screens (minimal Korean / Japanese themes) ---- */
#app[data-ui="light"] { --text: var(--ink, #222); --muted: #777; --panel: rgba(255,255,255,.88); --panel2: #ffffff; --line: rgba(0,0,0,.12); color: var(--ink, #222); }
#app[data-ui="light"] .page-title, #app[data-ui="light"] .welcome-title, #app[data-ui="light"] .welcome-sub,
#app[data-ui="light"] .review-side h2, #app[data-ui="light"] .done-wrap h1 { text-shadow: none; }
#app[data-ui="light"] .page:not(.capture) { color: var(--ink, #222); }
#app[data-ui="light"] .feature-btn { color: var(--ink, #222); background: rgba(255,255,255,.82); border: 1.5px solid rgba(0,0,0,.14); box-shadow: 0 10px 30px rgba(0,0,0,.08); }
#app[data-ui="light"] .frame-card { color: var(--ink, #222); background: #fff; border-color: rgba(0,0,0,.08); box-shadow: 0 8px 24px rgba(0,0,0,.08); }
#app[data-ui="light"] .frame-thumb { box-shadow: 0 2px 10px rgba(0,0,0,.12); }
#app[data-ui="light"] .btn:not(.primary):not(.danger) { background: rgba(255,255,255,.9); color: var(--ink, #222); border-color: rgba(0,0,0,.15); }
#app[data-ui="light"] .fp-right { background: rgba(255,255,255,.78); box-shadow: 0 14px 40px rgba(0,0,0,.08); }
#app[data-ui="light"] .fp-tile { background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
#app[data-ui="light"] .fp-lv { border-color: rgba(0,0,0,.18); }
#app[data-ui="light"] .icon-btn { background: rgba(0,0,0,.12); color: var(--ink, #222); }
#app[data-ui="light"] .capture .cap-status, #app[data-ui="light"] .capture .count-overlay { color: #fff; }
.br-scene { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.br-scene img { height: 110px; border-radius: 10px; box-shadow: 0 4px 14px rgba(0,0,0,.3); }
.br-test-wrap { display: grid; place-items: center; border-radius: 12px; overflow: hidden; }
.br-test-wrap.checker { background: repeating-conic-gradient(#bbb 0 25%, #eee 0 50%) 0 0 / 24px 24px; }
.br-test { max-width: 100%; max-height: 62vh; display: block; }
.face-pick { position: relative; display: block; width: fit-content; margin: 8px auto; cursor: crosshair; touch-action: manipulation; }
.face-pick img { display: block; max-height: 62vh; max-width: 100%; user-select: none; }
.face-ring { position: absolute; aspect-ratio: 1 / 1.3; transform: translate(-50%, -50%); border: 3px solid #39ff88; border-radius: 50%; box-shadow: 0 0 0 2000px rgba(0,0,0,.35); pointer-events: none; }
.face-pick { overflow: hidden; }
.small-sel { font-size: 14px; padding: 6px 8px; max-width: 100%; }
/* on-screen camera adjustment */
.cam-adj-btn { position: absolute !important; top: 2vh; right: 2vw; z-index: 30; width: 56px; height: 56px; border-radius: 50%; border: 1px solid rgba(255,255,255,.35);
  background: rgba(0,0,0,.45); color: #fff; font-size: 26px; cursor: pointer; backdrop-filter: blur(6px); }
.cam-adj { position: absolute !important; top: 2vh; right: 2vw; bottom: 2vh; z-index: 31; width: min(360px, 92vw); display: flex; flex-direction: column; gap: 10px;
  background: rgba(16,18,24,.92); border: 1px solid rgba(255,255,255,.15); border-radius: 18px; padding: 14px; color: #fff; backdrop-filter: blur(10px); }
.cam-adj-head { display: flex; flex-direction: column; gap: 2px; }
.cam-adj-body { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.cam-adj-body .field span { font-size: 14px; }
.cam-adj-body select, .cam-adj-body input[type=range] { width: 100%; }
.cam-adj-body h4 { margin: 8px 0 0; font-size: 14px; opacity: .8; }
.cam-adj-body .field { margin: 0 0 4px; min-height: 0; }
/* downloads tab */
.dot.warn { background: #f5b942; }
.dl-card h4 { margin: 18px 0 6px; }
.dl-top { align-items: center; flex-wrap: wrap; margin: 10px 0; }
.dl-status { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dl-steps { padding-left: 22px; display: flex; flex-direction: column; gap: 8px; line-height: 1.55; }
.dl-steps ul { margin: 6px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.dl-alt { margin-top: 14px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.dl-alt summary { cursor: pointer; font-weight: 600; }
.dl-alt ul { line-height: 1.6; }
.dl-cmd { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 8px 0 4px; }
.dl-cmd code { flex: 1; min-width: 0; overflow-wrap: anywhere; background: rgba(127,127,127,.15); padding: 10px 12px; border-radius: 8px; font-size: 13px; user-select: all; }
.dl-card a.btn { text-decoration: none; }
.dl-steps a { color: #ff8a9a; font-weight: 600; }
.merge-box { display: flex; flex-direction: column; gap: 8px; }
.merge-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; }
.merge-add input { flex: 1; min-width: 200px; }
.about-ver { display: flex; align-items: baseline; gap: 10px; }
.about-ver b { font-size: 28px; }
/* event page: frame tools + edit buttons under each frame */
.frame-tools { flex-wrap: wrap; margin: 6px 0 10px; }
/* frames grid: tall frames ~5-8 per row, wide (landscape) frames take two columns */
.frame-pick { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 12px 10px; align-items: start; }
.frp-wrap { display: flex; flex-direction: column; align-items: stretch; gap: 4px; min-width: 0; }
.frp-wrap.wide { grid-column: span 2; }
.frp-wrap .fp-item { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px; }
.frp-wrap .fp-item canvas { max-width: 100%; max-height: 170px; height: auto; }
.frp-wrap .fp-item span { font-size: 12px; line-height: 1.3; text-align: center; word-break: break-word; }
.frp-wrap .fp-print select { width: 100%; }
.fp-acts { display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; }
.fp-acts .small-btn { padding: 4px 8px; font-size: 13px; }
/* folded card (ready-made themes) */
.fold-card > summary { list-style: none; cursor: pointer; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.fold-card > summary::-webkit-details-marker { display: none; }
.fold-card > summary h3 { margin: 0; }
.fold-card > summary::after { content: '▾'; margin-left: auto; opacity: .6; }
.fold-card[open] > summary::after { content: '▴'; }
.fold-card[open] > summary { margin-bottom: 10px; }

/* "ซ่อนข้อความ" per page: keep buttons, QR and the countdown numbers */
.page.no-text .page-title, .page.no-text .review-side h2, .page.no-text .print-status, .page.no-text .review-side > small,
.page.no-text .done-wrap > div:last-child, .page.no-text .cap-status, .page.no-text .ai-msg, .page.no-text.ai-proc > small,
.page.no-text figcaption { display: none !important; }

/* welcome blocks placed where the owner dragged them */
.welcome > .welcome-content.free { position: absolute !important; inset: 0; margin: 0; padding: 0; }
.welcome-content.free > .wl-title, .welcome-content.free > .feature-btns { position: absolute; transform: translate(-50%, -50%); margin: 0; width: max-content; max-width: 94vw; }
.welcome-content.free > .warn { position: absolute; left: 50%; bottom: 8%; transform: translateX(-50%); }
/* welcome layout editor */
.wl-stage-wrap { display: flex; justify-content: center; margin-top: 10px; }
.wl-stage { position: relative; height: min(62vh, 640px); max-width: 100%; border-radius: 12px; overflow: hidden; background: #111418; touch-action: none; user-select: none; }
.wl-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.wl-chip { position: absolute; transform: translate(-50%, -50%); cursor: grab; padding: 8px 12px; border: 2px dashed #ffd36e; border-radius: 12px; background: rgba(0,0,0,.25);
  display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; max-width: 92%; touch-action: none; }
.wl-chip:active { cursor: grabbing; background: rgba(0,0,0,.4); }
.wl-chip-title b { font-size: clamp(16px, 2.6vh, 28px); text-shadow: 0 2px 8px rgba(0,0,0,.6); }
.wl-chip-title small { font-size: 12px; opacity: .9; }
.wl-chip-btns { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 6px; }
.wl-fb { background: rgba(0,0,0,.45); border: 1px solid rgba(255,255,255,.5); color: #fff; border-radius: 10px; padding: 6px 10px; font-size: 13px; white-space: nowrap; }
.wl-labels { display: flex; flex-direction: column; gap: 6px; margin: 6px 0; }
.wl-labels h4 { margin: 4px 0 0; }
.wl-label-row { display: grid; grid-template-columns: 140px 1fr; align-items: center; gap: 8px; }
.wl-stage.welcome-default { background: radial-gradient(circle at 30% 20%, #3b1d4d, transparent 60%), radial-gradient(circle at 80% 80%, #5a1f2e, transparent 55%), #111418; }
/* "ข้อความของฉัน" on any page */
.page > .page-free-text { position: absolute !important; z-index: 5; transform: translate(-50%, -50%); text-align: center; white-space: pre-line; pointer-events: none;
  font-weight: 700; line-height: 1.25; text-shadow: 0 2px 14px rgba(0,0,0,.55); max-width: 92vw; }
.page-free-text.size-s { font-size: clamp(18px, 2.4vw, 28px); }
.page-free-text.size-m { font-size: clamp(26px, 3.8vw, 46px); }
.page-free-text.size-l { font-size: clamp(36px, 5.6vw, 72px); }
.page-free-text.size-xl { font-size: clamp(48px, 8vw, 110px); }
.wl-free-text { font-weight: 700; white-space: pre-line; text-shadow: 0 2px 10px rgba(0,0,0,.6); line-height: 1.25; }
/* 📷 capture skin: picture around the live view */
.page > .skin-box { position: absolute !important; z-index: 1; }
.skin-box .skin-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; pointer-events: none; z-index: 1; }
.skin-box .skin-win { position: absolute; z-index: 2; overflow: hidden; background: #000; display: grid; place-items: center; }
.skin-box.on-top .skin-img { z-index: 3; }
.skin-box .skin-win canvas.skin-live { width: 100%; height: 100%; max-width: none; max-height: none; object-fit: contain; box-shadow: none; }
.skin-box .skin-win.cover canvas.skin-live { object-fit: cover; }
/* skin editor */
.sk-dialog { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 800px) { .sk-dialog { grid-template-columns: 1fr; } }
.sk-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.sk-pic { position: relative; width: 100%; max-height: 52vh; background: repeating-conic-gradient(#2a2d33 0% 25%, #1d2025 0% 50%) 0 0 / 18px 18px; border-radius: 10px; touch-action: none; user-select: none; }
.sk-pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; pointer-events: none; }
.sk-rect { position: absolute; border: 3px solid #ffd36e; background: rgba(255,211,110,.18); cursor: move; touch-action: none; }
.sk-label { position: absolute; left: 4px; top: 2px; font-size: 12px; color: #ffd36e; text-shadow: 0 1px 3px #000; }
.sk-handle { position: absolute; right: -9px; bottom: -9px; width: 18px; height: 18px; border-radius: 50%; background: #ffd36e; cursor: nwse-resize; }
.sk-screen { height: min(46vh, 480px); background: #000; }
.sk-skin { position: absolute; cursor: grab; touch-action: none; }
.sk-skin img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; pointer-events: none; z-index: 1; }
.sk-skin .sk-live { position: absolute; z-index: 2; background: linear-gradient(135deg, #3a6ea5, #1b2f4f); color: #fff; display: grid; place-items: center; font-size: 12px; pointer-events: none; }
.sk-skin.on-top img { z-index: 3; }
.sk-section { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
/* ===== theme skin: Retro Desktop 98 (guest screens) ===== */
#app[data-skin="retro98"] .feature-btn, #app[data-skin="retro98"] .btn, #app[data-skin="retro98"] .ai-theme, #app[data-skin="retro98"] .frame-card {
  background: #c0c0c0 !important; color: #000 !important; border: none !important; border-radius: 0 !important; backdrop-filter: none;
  box-shadow: inset -3px -3px #000, inset 3px 3px #fff, inset -6px -6px #808080, inset 6px 6px #dfdfdf !important; text-shadow: none; }
#app[data-skin="retro98"] .feature-btn:active, #app[data-skin="retro98"] .btn:active, #app[data-skin="retro98"] .ai-theme:active {
  box-shadow: inset 3px 3px #000, inset -3px -3px #fff, inset 6px 6px #808080, inset -6px -6px #dfdfdf !important; transform: none; }
#app[data-skin="retro98"] .btn.primary { font-weight: 700; outline: 2px dotted #000; outline-offset: -10px; }
#app[data-skin="retro98"] .ai-theme img, #app[data-skin="retro98"] .frame-thumb { border-radius: 0; }
#app[data-skin="retro98"] .welcome-content:not(.free) { background: #c0c0c0; color: #000 !important; padding: 0 28px 28px; border-radius: 0; margin-bottom: 14vh;
  box-shadow: inset -3px -3px #000, inset 3px 3px #fff, inset -6px -6px #808080, inset 6px 6px #dfdfdf, 0 18px 40px rgba(0,0,0,.35); }
#app[data-skin="retro98"] .welcome-content:not(.free)::before { content: 'PhotoBooth.exe'; display: block; margin: 6px -22px 22px; padding: 8px 14px; text-align: left; color: #fff; font-weight: 600;
  background: linear-gradient(90deg, #000080, #1084d0); }
#app[data-skin="retro98"] .welcome-content:not(.free) .welcome-title, #app[data-skin="retro98"] .welcome-content:not(.free) .welcome-sub { color: #000; text-shadow: none; }
#app[data-skin="retro98"] .count-overlay { font-family: "IBM Plex Sans Thai", monospace; }
/* system status panel */
.dot.off { background: #9aa0a6; opacity: .5; }
.sp-head { align-items: baseline; flex-wrap: wrap; }
.sp-head h3 { margin: 0; }
.sp-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.sp-row { display: grid; grid-template-columns: 14px 1fr auto auto; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.sp-row .dot { width: 12px; height: 12px; }
.sp-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sp-main small { overflow-wrap: anywhere; }
.sp-ms { white-space: nowrap; }
@media (max-width: 640px) { .sp-row { grid-template-columns: 14px 1fr; } .sp-row > .sp-ms, .sp-row > a { grid-column: 2; justify-self: start; } }
/* gallery: select to delete */
.gal-pick { align-items: center; flex-wrap: wrap; }
.gal-item.picking { position: relative; }
.gal-item.picking::after { content: ''; position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border-radius: 50%; border: 3px solid #fff; background: rgba(0,0,0,.35); box-shadow: 0 1px 4px rgba(0,0,0,.5); }
.gal-item.picked::after { content: '✓'; background: var(--danger); color: #fff; font-weight: 700; display: grid; place-items: center; font-size: 18px; }
.gal-item.picked img { opacity: .6; }
/* retake one shot */
.page > .retake-bar { position: absolute !important; left: 50%; bottom: 3vh; transform: translateX(-50%); z-index: 20; width: min(96vw, 900px);
  background: rgba(10,12,16,.88); border: 1px solid rgba(255,255,255,.18); border-radius: 18px; padding: 14px 16px; color: #fff; display: flex; flex-direction: column; gap: 10px; align-items: center; backdrop-filter: blur(8px); }
.retake-bar > b { font-size: clamp(16px, 2.2vw, 22px); }
.rs-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.rs-thumb { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px; border-radius: 12px; border: 2px solid rgba(255,255,255,.25); background: rgba(255,255,255,.06); color: #fff; font: inherit; font-size: 14px; cursor: pointer; }
.rs-thumb canvas { border-radius: 6px; max-height: 18vh; width: auto; }
.rs-thumb:active { border-color: var(--accent); transform: scale(.97); }
#app[data-skin="retro98"] .page > .retake-bar { background: #c0c0c0; color: #000; border-radius: 0; box-shadow: inset -3px -3px #000, inset 3px 3px #fff; }
#app[data-skin="retro98"] .rs-thumb { color: #000; border-radius: 0; background: #c0c0c0; box-shadow: inset -2px -2px #000, inset 2px 2px #fff; border: none; }

/* photo printer (DNP / Epson) */
.pp-mac { border: 1px dashed var(--line, #ccc); border-radius: 12px; padding: 10px 12px; margin: 6px 0 10px; }
.pp-edit { background: rgba(127,127,127,.06); border-radius: 10px; padding: 8px 10px; margin: 8px 0; }
.pp-opts { display: grid; gap: 2px; }
.pp-more summary { cursor: pointer; font-size: .9em; opacity: .75; margin: 6px 0; }

/* GIF / video in the frame */
.review-main { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.motion-row { display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap; color: inherit; }
.motion-row figure { margin: 0; text-align: center; position: relative; }
.motion-row img, .motion-row video { height: 18vh; max-width: 30vw; object-fit: contain; border-radius: 6px; background: #000; box-shadow: 0 4px 16px rgba(0,0,0,.5); display: block; }
.motion-row figcaption { position: absolute; left: 6px; top: 6px; font-size: .75em; font-weight: 700; color: #fff; background: rgba(0,0,0,.6); padding: 1px 8px; border-radius: 999px; }
.motion-row > small, .motion-row > span { flex-basis: 100%; text-align: center; font-size: .85em; }
/* GIF/video sits beside the photo so everything fits on one screen */
.review-main:has(.motion-row) { flex-direction: row; justify-content: center; align-items: center; gap: 16px; }
.review-main:has(.motion-row) .review-img { max-height: 84vh; max-width: 40vw; min-width: 0; }
.review-main .motion-row { flex-direction: column; flex-wrap: nowrap; max-width: 22vw; }
.review-main .motion-row > small, .review-main .motion-row > span { flex-basis: auto; }
.review-main .motion-row img, .review-main .motion-row video { height: auto; max-height: 34vh; width: auto; max-width: 22vw; }
@media (orientation: portrait) {
  .review-main:has(.motion-row) { max-width: 94vw; }
  .review-main:has(.motion-row) .review-img { max-height: 54vh; max-width: 58vw; }
  .review-main .motion-row { max-width: 32vw; }
  .review-main .motion-row img, .review-main .motion-row video { max-height: 24vh; max-width: 32vw; }
}
.page > .rec-badge { position: absolute !important; top: 18px; left: 50%; transform: translateX(-50%); z-index: 30; display: flex; align-items: center; gap: 8px;
  background: rgba(0,0,0,.65); color: #fff; font-weight: 700; padding: 8px 18px; border-radius: 999px; font-size: 1.4em; letter-spacing: .05em; }
.rec-badge i { width: 14px; height: 14px; border-radius: 50%; background: #ff2d3d; animation: recblink 1s infinite; }
@keyframes recblink { 50% { opacity: .2; } }
.page.capture.recording .live-wrap { box-shadow: 0 0 0 4px #ff2d3d; border-radius: 4px; }
.gal-item .mo-badge { position: absolute; right: 6px; top: 6px; background: rgba(0,0,0,.65); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 9px; }
.gal-motion { color: inherit; justify-content: flex-start; margin: 6px 0; }
.gal-motion img, .gal-motion video { height: 110px; max-width: 160px; }
.gal-motion figure { display: flex; flex-direction: column; gap: 4px; align-items: center; }

/* payment overlay */
.pay-overlay { position: fixed !important; inset: 0; z-index: 900; display: flex; align-items: center; justify-content: center; background: #111418; overflow: auto; padding: 16px; }
.pay-overlay .pay-card { position: relative; z-index: 2; }
.pay-qr-box { min-height: 200px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
.pay-qr-box .spin { width: 46px; height: 46px; border: 5px solid #ddd; border-top-color: #0e3d6b; border-radius: 50%; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.pay-ok { width: 120px; height: 120px; border-radius: 50%; background: #16a34a; color: #fff; font-size: 70px; display: flex; align-items: center; justify-content: center; }
.pay-test { background: #fff3cd; color: #7a5b00; border-radius: 8px; padding: 4px 10px; font-size: 13px; }
.pay-was { color: #999; font-size: .5em; font-weight: 400; }
.pay-coupon { margin: 6px 0 10px; }
.pay-coupon-btn { color: #0e3d6b !important; border-color: #b9c8d8 !important; }
.pay-code { font-size: 28px; letter-spacing: .15em; text-transform: uppercase; width: 200px; text-align: center; padding: 8px; border: 2px solid #0e3d6b; border-radius: 10px; font-family: 'Courier New', monospace; font-weight: 700; color: #111; background: #fff; }
.pay-coupon-ok { background: #e8f7ee; color: #166534; border-radius: 10px; padding: 8px 12px; font-weight: 600; }
.pay-coupon .warn { display: block; margin-top: 6px; }
.done-extra { margin: 10px 0; }
/* back office payment */
.pay-sub { border: 1px dashed var(--line, #ccc); border-radius: 12px; padding: 10px 12px; margin: 6px 0 10px; }
.pay-mode { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 9px; background: #16a34a; color: #fff; }
.pay-mode.test { background: #d97706; }
.pay-how summary { cursor: pointer; font-weight: 600; margin: 8px 0; }
.danger-text { color: #e11d48 !important; }
.cp-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0 12px; align-items: end; }
.cp-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--line, #333); }
.cp-row select { width: auto; }
.cp-codes { display: flex; flex-wrap: wrap; gap: 6px; max-height: 60vh; overflow: auto; font-family: 'Courier New', monospace; font-weight: 700; }
.cp-codes span { border: 1px solid var(--line, #555); border-radius: 6px; padding: 3px 8px; }
.cp-codes span.used { opacity: .5; text-decoration: line-through; }
.cp-codes small { font-family: Prompt, sans-serif; font-weight: 400; text-decoration: none; display: inline-block; }
.cp-preview { width: min(900px, 86vw); height: 70vh; border: 0; background: #fff; border-radius: 8px; }
/* per-shot check after each pose */
.page > .shot-check { top: 50%; bottom: auto !important; transform: translate(-50%, -50%) !important; width: min(92vw, 760px); }
.shot-check .sc-img { display: flex; justify-content: center; margin: 8px 0 12px; }
.shot-check .sc-img canvas { max-width: 100%; max-height: 52vh; border-radius: 8px; box-shadow: 0 6px 24px rgba(0,0,0,.5); }
.fp-print { display: flex; flex-direction: column; gap: 4px; margin: 4px 0; }
.fp-print select { font-size: 12px; padding: 4px 6px; }
/* on-screen camera panel: no stretched gaps, readable dropdowns */
.cam-adj-body > *, .cam-adj-body .field { flex: 0 0 auto !important; }
.cam-adj-body select, .dslr-set select { color: #fff; background: #23262d; border: 1px solid rgba(255,255,255,.28); }
.cam-adj-body select:disabled, .dslr-set select:disabled { opacity: .5; }
.dslr-note { display: block; min-height: 1.2em; margin-bottom: 4px; }
/* review: guest chooses the number of prints */
.copies-pick { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 4px 0 10px; }
.copies-pick .cp-num { font-size: 40px; min-width: 64px; text-align: center; }
.copies-pick .btn.big { min-width: 64px; font-size: 28px; padding: 6px 0; }
/* capture: back button */
.page > .cap-back { position: absolute !important; top: 2vh; left: 2vw; z-index: 32; background: rgba(0,0,0,.45); color: #fff; border-color: rgba(255,255,255,.35); backdrop-filter: blur(4px); }
.page > .cam-stale { position: absolute !important; left: 50%; top: 2vh; transform: translateX(-50%); z-index: 33; display: none; background: #b42318; color: #fff; padding: 8px 16px; border-radius: 12px; font-weight: 600; max-width: 80vw; text-align: center; }
.cam-stuck p { margin: 6px 0; }
.page > .cam-stuck { z-index: 40; }

/* photo packages */
.pkg-pick { display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; padding: 24px; max-width: 960px; margin: auto; }
.pkg-grid { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; }
.pkg-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 200px; padding: 28px 26px 22px; border-radius: 18px;
  border: 2px solid rgba(255,255,255,.25); background: rgba(0,0,0,.45); color: #fff; font: inherit; cursor: pointer; box-shadow: 0 8px 30px rgba(0,0,0,.35); }
.pkg-card.best { border-color: #ffcc33; background: rgba(40,30,0,.6); }
.pkg-card:active { transform: scale(.97); }
.pkg-n { font-size: 30px; }
.pkg-price { font-size: 40px; font-weight: 700; }
.pkg-save { position: absolute; top: -14px; right: -10px; background: #ff3b5c; color: #fff; font-weight: 700; font-size: 14px; padding: 4px 12px; border-radius: 999px; }
.credit-bar { position: fixed !important; left: 0 !important; right: 0 !important; top: auto !important; bottom: 6vh; margin: 0 auto; width: max-content; max-width: 92vw; transform: none !important; z-index: 20; display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: rgba(0,0,0,.6); color: #fff; padding: 16px 22px; border-radius: 18px; }
.credit-bar small { opacity: .85; }
.done-next { margin-top: 12px; display: block; }
.pkg-box { margin-top: 10px; }
.pkg-rows { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 10px; }
.pkg-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pkg-row input { width: 90px; }
.pkg-row small { flex-basis: 100%; }

/* add-ons allowed per member */
.addon-tile.locked { opacity: .5; filter: grayscale(.6); }
.addon-lock { font-size: 22px; padding: 0 6px; }
.addon-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px 14px; margin: 10px 0; }
.addon-pick-row { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.nav-badge { display: inline-block; min-width: 20px; margin-left: 8px; padding: 0 6px; border-radius: 999px; background: #ff3b5c; color: #fff; font-size: 12px; font-weight: 700; line-height: 20px; text-align: center; }
.dl-fix { margin: 14px 0; padding: 12px 14px; border-radius: 12px; background: rgba(255,200,0,.08); border: 1px solid rgba(255,200,0,.3); }
.rot-field { margin: 8px 0; }
.rot-field .row { flex-wrap: wrap; margin-top: 6px; }
.rot-row input[type=range] { flex: 1; min-width: 140px; }
.rot-row input[type=number] { width: 80px; }
.ed-guide { position: absolute; display: none; pointer-events: none; z-index: 5; background: #2ec5ff; box-shadow: 0 0 4px rgba(46,197,255,.8); }
.ed-guide.v { top: 0; bottom: 0; width: 2px; margin-left: -1px; }
.ed-guide.h { left: 0; right: 0; height: 2px; margin-top: -1px; }
.link-btn { background: none; border: 0; padding: 4px 0 0; color: var(--accent); font: inherit; font-size: 12px; cursor: pointer; text-decoration: underline; }
.dev-online { color: #3ccf7a; }

/* tarot / lenormand card picker */
.cards-page { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; }
.card-fan { display: grid; grid-template-columns: repeat(6, minmax(70px, 120px)); gap: 14px 12px; perspective: 1200px; max-width: 92vw; }
.card-pick { position: relative; aspect-ratio: 5 / 8; padding: 0; border: 0; background: none; cursor: pointer; transform: rotate(var(--r)); transition: transform .3s; }
.card-pick:hover:not(.flipped) { transform: rotate(var(--r)) translateY(-8px); }
.card-inner { position: absolute; inset: 0; transition: transform .7s cubic-bezier(.2,.8,.2,1); transform-style: preserve-3d; }
.card-pick.flipped { transform: rotate(0) scale(1.12); z-index: 2; }
.card-pick.flipped .card-inner { transform: rotateY(180deg); }
.card-side { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 8px; overflow: hidden; box-shadow: 0 6px 18px rgba(0,0,0,.45); }
.card-side.front { transform: rotateY(180deg); background: #000; }
.card-side svg, .card-side canvas { width: 100%; height: 100%; display: block; }
.card-fan.done .card-pick:not(.flipped) { opacity: .25; filter: grayscale(1); }
.card-pos { position: absolute; left: 50%; top: -14px; transform: translateX(-50%); z-index: 3; white-space: nowrap; font-weight: 700; font-size: 14px; color: #2a1a00; background: #f3d68a; padding: 2px 12px; border-radius: 999px; box-shadow: 0 2px 6px rgba(0,0,0,.5); }
@media (orientation: portrait) { .card-fan { grid-template-columns: repeat(4, minmax(70px, 140px)); } }

/* project backups on the Mac mini */
.proj-list { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; max-height: 420px; overflow: auto; }
.proj-day { border: 1px solid var(--line, #2a2f37); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; }
.proj-file { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.proj-file > div { min-width: 0; }
.proj-evs { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60ch; }
.proj-pick { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.proj-pick small { flex: 0 1 auto; }
