:root {
  /* palette: sky #bbc9d6 · sage #8cbab7 · rose #e7adac · mint #b2d0ce · slate #546b7d · sand #dbd6d2 */
  --bg: #f3f0ec;
  --surface: #ffffff;
  --surface-2: #ebe7e3;
  --border: #dbd6d2;
  --text: #2c3a46;
  --muted: #5f7383;
  --primary: #546b7d;
  --primary-2: #a9504f;
  --rose: #e7adac;
  --rose-ink: #4a2626;
  --sage: #8cbab7;
  --mint: #b2d0ce;
  --sky: #bbc9d6;
  --sand: #dbd6d2;
  --shadow: 0 1px 3px rgba(84, 107, 125, .12), 0 4px 14px rgba(84, 107, 125, .08);
  --radius: 14px;
  --nav-h: 56px;
  --bottom-h: 58px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Noto Sans Thai', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  padding-bottom: calc(var(--bottom-h) + env(safe-area-inset-bottom));
}
a { color: inherit; text-decoration: none; }
svg { width: 1em; height: 1em; fill: currentColor; flex-shrink: 0; }
svg[fill="none"] { fill: none; }
h1, h2, h3 { margin: 0; line-height: 1.35; }
.container { max-width: 1280px; margin: 0 auto; padding: 24px 16px 40px; min-height: 70vh; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.empty { color: var(--muted); text-align: center; padding: 48px 0; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-radius: 999px; padding: 8px 18px;
  font: inherit; font-size: 14px; font-weight: 600; color: #fff; cursor: pointer;
  transition: transform .15s, filter .15s, background .15s;
  white-space: nowrap;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--primary); }
.btn-ghost { background: var(--surface-2); color: var(--text); }
.btn-ghost:hover { background: #ded8d2; filter: none; }
.btn-vip { background: linear-gradient(90deg, #f0c2c1, var(--rose)); color: var(--rose-ink); box-shadow: 0 4px 16px rgba(231, 173, 172, .55); }
.btn-block { width: 100%; }
.btn-sm { padding: 4px 14px; font-size: 13px; }
.btn-lg { padding: 12px 26px; font-size: 16px; }
.btn-xl { padding: 12px 34px; border-radius: 999px; font-size: 22px; font-weight: 800; }
.btn-xl svg { font-size: 22px; }
.btn-xl span { display: flex; flex-direction: column; align-items: center; line-height: 1.2; }
.btn-xl small { font-size: 11px; font-weight: 500; opacity: .85; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .9); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1280px; margin: 0 auto; height: var(--nav-h);
  display: flex; align-items: center; gap: 16px; padding: 0 16px;
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; color: var(--primary); }
.logo img { width: 30px; height: 30px; }
.topnav { flex: 1; display: flex; justify-content: center; gap: 22px; font-size: 14px; }
.topnav a { color: var(--muted); padding: 4px 0; border-bottom: 2px solid transparent; }
.topnav a:hover, .topnav a.active { color: var(--text); border-color: var(--rose); }
.top-actions { display: flex; gap: 10px; }
.top-actions .btn { font-size: 13px; padding: 7px 14px; }

/* ---------- hero / search ---------- */
.hero {
  text-align: center; padding: 28px 16px 26px; border-radius: var(--radius);
  background: linear-gradient(115deg, var(--sky) 0%, var(--mint) 45%, var(--rose) 100%);
}
.hero h1 { font-size: clamp(17px, 2.4vw, 22px); font-weight: 800; color: var(--text); }
.hero p { font-size: 13px; color: #3f5363; margin: 12px 0 14px; }
.hero-banner { display: block; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: var(--sky); }
.hero-banner img { display: block; width: 100%; height: auto; aspect-ratio: 1672 / 941; transition: transform .4s; }
.hero-banner:hover img { transform: scale(1.015); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.search { position: relative; max-width: 460px; margin: 18px auto 22px; }
.search input {
  width: 100%; height: 44px; padding: 0 52px 0 18px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text); font: inherit; box-shadow: var(--shadow);
}
.search input:focus { outline: none; border-color: var(--sage); }
.search button {
  position: absolute; right: 6px; top: 6px; width: 32px; height: 32px; border-radius: 50%;
  border: 0; background: var(--primary); color: #fff; display: grid; place-items: center; cursor: pointer;
}

/* ---------- sections & cards ---------- */
.section { margin-bottom: 26px; }
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px 9px 14px; border-radius: 10px; margin-bottom: 12px;
  background: linear-gradient(90deg, var(--sage) 0%, var(--mint) 40%, var(--sky) 75%, rgba(187, 201, 214, 0) 100%);
}
.section-head h2 { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 700; }
.section-icon { display: grid; place-items: center; font-size: 14px; color: var(--primary); }
.more {
  display: flex; align-items: center; gap: 2px; font-size: 12px; color: var(--text);
  background: rgba(255, 255, 255, .75); padding: 3px 8px 3px 12px; border-radius: 999px;
}
.grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }

.card { display: block; background: var(--surface); border-radius: 10px; overflow: hidden; transition: transform .2s, box-shadow .2s; box-shadow: var(--shadow); }
.card:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(84, 107, 125, .18); }
.card:hover .poster { filter: brightness(1.04); }
.card-time { font-size: 11px; font-style: italic; color: var(--muted); text-align: center; padding: 3px 0; }
.card-thumb { position: relative; aspect-ratio: 3 / 4.4; }
.card-title { font-size: 13px; font-weight: 600; padding: 6px 8px 8px; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.badges { position: absolute; top: 6px; right: 6px; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.badge { font-size: 10.5px; font-weight: 600; padding: 2px 7px; border-radius: 6px; color: #fff; }
.badge-lang { background: var(--primary); }
.badge-ai { background: var(--rose); color: var(--rose-ink); }
.badge-hot { background: #c46f6e; padding: 3px 5px; display: grid; }
.card-eps {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 16px 8px 5px; font-size: 12px; color: #fff;
  background: linear-gradient(transparent, rgba(44, 58, 70, .7));
}

/* generated cover art (ui.js posterArt) — replaced by <img> when a poster is uploaded */
.poster {
  width: 100%; height: 100%; position: relative; overflow: hidden; transition: filter .2s; background: var(--primary);
  display: flex; align-items: flex-end; justify-content: center; padding: 0 8px 30px;
}
.poster-art { position: absolute; inset: 0; width: 100%; height: 100%; }
.poster::after { content: ''; position: absolute; inset: 45% 0 0; background: linear-gradient(transparent, rgba(30, 40, 50, .78)); }
.poster-title {
  position: relative; z-index: 1; text-align: center; font-weight: 800; font-size: clamp(13px, 1.5vw, 17px); line-height: 1.25;
  color: #fff; text-shadow: 0 2px 8px rgba(0, 0, 0, .45); letter-spacing: .01em;
}

/* ---------- drama detail ---------- */
.detail { display: flex; gap: 20px; margin-bottom: 26px; }
.detail-poster { width: 172px; aspect-ratio: 3 / 4.4; flex-shrink: 0; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
.detail-poster .poster-title { font-size: 20px; }
.detail-info h1 { font-size: 20px; font-weight: 700; margin-bottom: 10px; }
.stats { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.stats span { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 3px 10px; font-size: 13px; color: var(--muted); }
.stats b { color: var(--text); margin-left: 4px; }
.desc { margin: 0 0 8px; color: #3f5363; }
.detail-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 16px; }
.h2 { font-size: 17px; font-weight: 700; margin: 8px 0 12px; }
.eps { display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; }
.ep {
  display: flex; align-items: center; justify-content: center; gap: 4px; height: 36px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px; font-size: 13px; font-weight: 600;
}
.ep:hover { border-color: var(--sage); }
.ep.locked { color: #9eadb9; font-weight: 500; background: transparent; }
.ep.current { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------- watch ---------- */
.watch { max-width: 560px; margin: 0 auto; }
.back { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.back:hover { color: var(--text); }
.watch h1 { font-size: 18px; margin: 8px 0; }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; background: var(--surface); border: 1px solid var(--border); padding: 2px 10px; border-radius: 999px; }
.live i { width: 6px; height: 6px; border-radius: 50%; background: #d27b7a; animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.player {
  width: min(100%, 360px); aspect-ratio: 9 / 16; margin: 14px auto 8px;
  background: #1d2832; color: #fff; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow);
}
.player video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.player-placeholder, .player-locked {
  height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 20px;
}
.player-placeholder svg { font-size: 56px; color: var(--mint); }
.player-placeholder p { margin: 0; font-weight: 700; }
.player-placeholder small { color: #a9bac6; }
.player-locked { background: linear-gradient(180deg, var(--primary), #2c3a46); }
.player-locked > svg { font-size: 44px; color: var(--rose); }
.watch-nav { display: flex; justify-content: space-between; margin: 14px 0 22px; }
.watch .eps { grid-template-columns: repeat(6, 1fr); }

/* ---------- pricing ---------- */
.page-head { text-align: center; margin-bottom: 26px; }
.page-head h1 { font-size: 22px; margin-bottom: 8px; }
.page-head.row { display: flex; justify-content: space-between; align-items: center; text-align: left; }
.notice { display: inline-block; background: rgba(231, 173, 172, .3); color: #7e3938; padding: 6px 14px; border-radius: 8px; font-size: 13px; }
.plans { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.plan { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; transition: border-color .2s; box-shadow: var(--shadow); }
.plan:hover { border-color: var(--sage); }
.plan h3 { font-size: 16px; margin-bottom: 8px; }
.price { font-size: 26px; font-weight: 800; color: var(--primary); }
.price span { font-size: 14px; font-weight: 400; color: var(--muted); margin-left: 4px; }
.plan p { min-height: 40px; margin: 6px 0 16px; }

/* ---------- history / auth / profile / prose ---------- */
.history { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.history-item { display: flex; gap: 12px; background: var(--surface); border-radius: 12px; padding: 10px; box-shadow: var(--shadow); }
.history-item .card-title { padding: 0; }
.history-item p { margin: 4px 0 8px; }
.history-thumb { width: 70px; aspect-ratio: 3 / 4.4; border-radius: 8px; overflow: hidden; flex-shrink: 0; }
.history-thumb .poster { padding-bottom: 8px; }
.history-thumb .poster-title { font-size: 9px; }

.auth { max-width: 380px; margin: 20px auto; background: var(--surface); padding: 28px; border-radius: var(--radius); display: grid; gap: 14px; box-shadow: var(--shadow); }
.auth h1 { font-size: 20px; text-align: center; }
.auth label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.auth input { height: 42px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font: inherit; }
.auth input:focus { outline: none; border-color: var(--sage); }

.profile { max-width: 380px; margin: 20px auto; text-align: center; display: grid; gap: 12px; justify-items: center; }
.avatar { width: 84px; height: 84px; border-radius: 50%; background: var(--mint); display: grid; place-items: center; font-size: 44px; color: #fff; }
.profile h1 { font-size: 20px; }
.profile p { margin: 0; }
.vip-status { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border); padding: 10px 16px; border-radius: 10px; color: var(--muted); }
.vip-status.on { color: var(--rose-ink); border-color: transparent; background: linear-gradient(90deg, rgba(231, 173, 172, .55), rgba(178, 208, 206, .55)); }

.prose { max-width: 720px; margin: 0 auto; }
.prose h1 { font-size: 22px; margin-bottom: 12px; }

/* ---------- footer / bottom nav ---------- */
.footer { border-top: 1px solid var(--border); padding: 22px 16px; text-align: center; font-size: 12px; color: var(--muted); }
.footer-links { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; margin-bottom: 8px; }
.footer-links a:hover { color: var(--text); }
.footer p { margin: 0; }
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  height: calc(var(--bottom-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: rgba(255, 255, 255, .95); backdrop-filter: blur(10px); border-top: 1px solid var(--border);
  display: flex; justify-content: center; gap: clamp(20px, 8vw, 70px);
}
.bottom-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: 64px; font-size: 11px; color: #8597a5; }
.bottom-nav a svg { font-size: 20px; }
.bottom-nav a.active { color: var(--primary-2); }

/* ---------- responsive ---------- */
@media (max-width: 1024px) {
  .plans { grid-template-columns: repeat(3, 1fr); }
  .topnav { gap: 14px; }
}
@media (max-width: 760px) {
  .grid { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .topnav { display: none; }
  .topbar-inner { justify-content: space-between; }
  .container { padding-top: 16px; }
  .plans { grid-template-columns: repeat(2, 1fr); }
  .eps, .watch .eps { grid-template-columns: repeat(5, 1fr); }
  .detail { flex-direction: column; align-items: center; text-align: center; }
  .detail .stats, .detail-actions { justify-content: center; }
  .card-title { font-size: 12px; }
  .badge { font-size: 9.5px; padding: 1px 5px; }
}
@media (max-width: 520px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 420px) {
  .plans { grid-template-columns: 1fr; }
  .logo { gap: 6px; }
  .logo img { width: 26px; height: 26px; }
  .logo span { font-size: 15px; }
  .top-actions { gap: 6px; }
  .top-actions .btn { padding: 6px 11px; font-size: 12.5px; }
}

/* ---------- loading / toast / forms ---------- */
.loading { display: grid; place-items: center; min-height: 40vh; }
.loading span { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--sand); border-top-color: var(--sage); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast {
  position: fixed; left: 50%; bottom: calc(var(--bottom-h) + 18px); z-index: 100;
  transform: translate(-50%, 20px); opacity: 0; transition: .25s;
  background: var(--text); color: #fff; padding: 10px 18px; border-radius: 10px; font-size: 14px;
  max-width: calc(100% - 32px); box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast-error { background: #a9504f; }
.form-error { margin: 0; color: #b0403f; font-size: 13px; }
.link { color: var(--primary-2); }
.link:hover { text-decoration: underline; }
.nowrap { white-space: nowrap; }
.poster.has-img { padding: 0; background: var(--surface-2); }
.poster.has-img::after { display: none; }
.poster.has-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.auth h2 { font-size: 16px; }
.profile .auth { width: 100%; margin: 8px 0; text-align: left; }
.profile-links { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow); }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { color: var(--muted); font-weight: 500; font-size: 12.5px; background: #f7f5f2; }
.table tr:last-child td { border-bottom: 0; }
.table code { font-size: 12px; color: var(--primary); }
.table .btn + .btn { margin-left: 4px; }
.status { display: inline-block; font-size: 11.5px; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); }
.status-pending { background: rgba(231, 173, 172, .35); color: #7e3938; }
.status-paid { background: rgba(140, 186, 183, .35); color: #2c5b58; }
.status-cancelled { background: var(--surface-2); color: #7a8690; }

/* ---------- admin ---------- */
.admin { max-width: 1100px; margin: 0 auto; }
.admin-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.admin-tabs a { padding: 8px 14px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.admin-tabs a.active { color: var(--text); border-color: var(--rose); }
.admin-title { font-size: 20px; margin-bottom: 14px; }
.admin-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.admin-head .admin-title { margin: 0; }
.admin-search { margin-bottom: 12px; }
.admin-search input, .admin-form input:not([type=checkbox]), .admin-form select, .admin-form textarea {
  width: 100%; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font: inherit;
}
.admin-search input { max-width: 320px; background: var(--surface); }
.admin-form :is(input, select, textarea):focus, .admin-search input:focus { outline: none; border-color: var(--sage); }
.admin-form { display: grid; gap: 14px; background: var(--surface); padding: 20px; border-radius: var(--radius); margin-bottom: 18px; box-shadow: var(--shadow); }
.admin-form > label, .form-row label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.admin-form > .btn { justify-self: start; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.checks { display: flex; gap: 18px; flex-wrap: wrap; font-size: 14px; }
.checks label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.checks input { accent-color: var(--primary); width: 16px; height: 16px; }
.ep-urls { display: grid; gap: 8px; max-height: 480px; overflow-y: auto; padding-right: 4px; }
.ep-url { display: grid; grid-template-columns: 56px 1fr; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; display: grid; gap: 4px; box-shadow: var(--shadow); }
.stat:hover { border-color: var(--sage); }
.stat b { font-size: 26px; color: var(--primary); }
.chips { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.chip { padding: 5px 14px; border-radius: 999px; background: var(--surface-2); font-size: 13px; }
.chip.active { background: var(--primary); color: #fff; }
@media (max-width: 760px) {
  .form-row { grid-template-columns: 1fr; }
  .top-actions .btn-ghost { display: none; }
}

/* admin: VIP plan editor */
.plan-forms { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin-top: 14px; }
.plan-form { margin: 0; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); max-width: none; }
.plan-form .h2 { margin: 0 0 4px; font-size: 16px; }
.plan-form.is-off { opacity: .6; }
.form-row .check-inline { display: flex; flex-direction: row; align-items: center; gap: 8px; align-self: end; padding-bottom: 10px; }

/* install as app (PWA) */
.install-card { width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.install-card img { border-radius: 12px; flex: none; }
.install-text { flex: 1; display: grid; gap: 2px; min-width: 0; }
.install-text b { font-size: 14px; }
.install-card .btn { flex: none; }
.install-guide { width: min(360px, calc(100vw - 32px)); border: 0; border-radius: 18px; padding: 22px; background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(44, 58, 70, .25); }
.install-guide::backdrop { background: rgba(44, 58, 70, .45); }
.install-guide h2 { margin: 0 0 12px; font-size: 18px; }
.install-guide ol { margin: 0 0 12px; padding-left: 20px; display: grid; gap: 10px; font-size: 14.5px; line-height: 1.5; }
.install-guide p { margin: 0 0 14px; }
.share-ico { display: inline-block; padding: 0 5px; border: 1px solid var(--border); border-radius: 6px; color: var(--primary); }

/* checkout (/orders/:id) */
.checkout { max-width: 440px; margin: 0 auto; display: grid; gap: 14px; }
.checkout .page-head { margin-bottom: 0; }
.pay-summary, .pay-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.pay-summary { display: grid; gap: 10px; }
.pay-summary > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.pay-summary code { font-size: 12.5px; color: var(--primary); }
.pay-amount { border-top: 1px dashed var(--border); padding-top: 10px; }
.pay-amount b { font-size: 28px; color: var(--primary-2); }
.pay-amount small { font-size: 14px; font-weight: 500; }
.pay-card { display: grid; gap: 12px; margin: 0; }
.pay-step { display: flex; align-items: center; gap: 10px; font-size: 16px; margin: 0; }
.pay-step span { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--rose); color: var(--rose-ink); font-size: 14px; }
.qr-box { text-align: center; display: grid; justify-items: center; gap: 6px; }
.qr-box p { margin: 0; }
.qr { width: min(240px, 70vw); aspect-ratio: 1; background: #fff; border-radius: 12px; padding: 6px; border: 1px solid var(--border); object-fit: contain; }
.qr svg { width: 100%; height: 100%; display: block; }
.copy-list { display: grid; gap: 6px; }
.copy-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); font: inherit; color: var(--text); text-align: right; cursor: pointer; }
.copy-row .muted { text-align: left; }
.copy-row.static { grid-template-columns: auto 1fr; cursor: default; }
.copy-row:not(.static):hover { border-color: var(--sage); }
.copy-tag { font-size: 12px; color: var(--primary); padding: 2px 8px; border-radius: 999px; background: #fff; border: 1px solid var(--border); }
.pay-note { margin: 0; padding: 10px 12px; border-radius: 10px; background: rgba(187, 201, 214, .3); }
.slip-pick { display: grid; justify-items: center; gap: 8px; padding: 18px; border: 2px dashed var(--border); border-radius: 12px; cursor: pointer; text-align: center; color: var(--muted); }
.slip-pick:hover { border-color: var(--sage); }
.slip-pick input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.slip-preview { max-height: 260px; max-width: 100%; border-radius: 8px; }
.slip-sent { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 10px; background: rgba(140, 186, 183, .2); }
.slip-sent img { width: 64px; height: 84px; object-fit: cover; border-radius: 6px; flex: none; }
.slip-sent p { margin: 4px 0 0; }
.pay-done { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 18px; border-radius: var(--radius); background: rgba(140, 186, 183, .25); color: #2c5b58; font-size: 17px; }
.pay-done svg { width: 26px; height: 26px; fill: currentColor; }

/* admin: payment settings */
.pay-admin { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; align-items: start; }
.pay-admin .admin-form { margin: 0; }
.pay-admin .h2 { margin: 0; font-size: 16px; }
.pay-preview { position: sticky; top: 80px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; display: grid; gap: 8px; justify-items: center; text-align: center; }
.pay-preview p { margin: 0; }
.qr-modes { border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px 12px; display: grid; gap: 10px; margin: 0; }
.qr-modes legend { font-size: 13px; color: var(--muted); padding: 0 4px; }
.qr-modes .radio { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.qr-modes .radio input { margin-top: 4px; }
.qr-upload { display: flex; gap: 14px; align-items: center; }
.qr-upload > div { flex: 1; display: grid; gap: 8px; }
.qr-upload label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.qr-upload label.check-inline { display: flex; }
.qr-upload img, .qr-empty { width: 96px; height: 96px; object-fit: contain; border-radius: 10px; border: 1px solid var(--border); background: #fff; flex: none; }
.qr-upload img.dim { opacity: .45; }
.qr-empty { display: grid; place-items: center; font-size: 12px; color: var(--muted); background: var(--surface-2); }
.section-gap { margin-top: 28px; }
.slip-thumb img { width: 36px; height: 48px; object-fit: cover; border-radius: 4px; border: 1px solid var(--border); display: block; }
@media (max-width: 760px) {
  .pay-admin { grid-template-columns: 1fr; }
  .pay-preview { position: static; }
}
.admin-form :is(input[type=radio], input[type=checkbox]) { width: 16px; height: 16px; padding: 0; flex: none; accent-color: var(--primary); }
.admin-form input[type=file] { padding: 8px; background: var(--surface-2); }

/* admin: poster picker */
.poster-field { display: flex; gap: 14px; align-items: flex-start; }
.poster-now { width: 96px; aspect-ratio: 3 / 4.4; flex: none; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: var(--surface-2); display: grid; place-items: center; text-align: center; padding: 4px; }
.poster-now img { width: 100%; height: 100%; object-fit: cover; }
.poster-inputs { flex: 1; display: grid; gap: 10px; min-width: 0; }
.poster-inputs label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.poster-inputs label.check-inline { display: flex; }
