/* Editor: phone-first form; on wide screens the preview phone sits beside it. */
:root {
  color-scheme: dark;
  --bg: #1A0910; --card: #261018; --card-2: #311520; --line: rgba(251, 239, 220, 0.12);
  --ink: #FBEFDC; --muted: rgba(251, 239, 220, 0.62); --gold: #E2B04A; --gold-hi: #F6D67A; --red: #E0455F; --green: #6FD39A;
  --f-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --f-story: "Fraunces", Georgia, serif;
  --f-display: "Bodoni Moda", Didot, Georgia, serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html.locked { overflow: hidden; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--f-ui); -webkit-font-smoothing: antialiased; }
a { color: var(--gold-hi); }
button { font: inherit; color: inherit; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--card-2); color: var(--ink); font-weight: 600; font-size: 0.88rem; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn.gold { background: linear-gradient(180deg, var(--gold-hi), var(--gold)); color: #2A0610; border: 0; box-shadow: 0 6px 18px rgba(226, 176, 74, 0.25); }
.btn.ghost { background: transparent; }
.btn.small { padding: 7px 12px; font-size: 0.8rem; border-radius: 10px; }
.btn.big { width: 100%; padding: 15px; font-size: 1rem; border-radius: 14px; }
.btn:disabled { opacity: 0.45; cursor: default; }

.bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: rgba(26, 9, 16, 0.92); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.brand { font-family: var(--f-display); font-style: italic; font-weight: 500; font-size: 1.15rem; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand i { color: var(--gold); }
.brand .short { display: none; }
@media (max-width: 480px) {
  .brand .full { display: none; }
  .brand .short { display: inline; font-size: 1.25rem; }
  .bar { gap: 8px; }
  .bar .btn { padding: 9px 12px; font-size: 0.82rem; }
}
.save { margin-left: auto; font-size: 0.75rem; color: var(--muted); white-space: nowrap; }

.layout { max-width: 1240px; margin: 0 auto; }
.form { padding: 18px 16px 120px; max-width: 640px; margin: 0 auto; }
.welcome h1 { margin: 6px 0 8px; font: 400 2rem/1.1 var(--f-story); font-variation-settings: "SOFT" 100; }
.welcome p { margin: 0 0 10px; color: var(--muted); }
.welcome .tip { font-size: 0.85rem; }
code { padding: 1px 6px; border-radius: 6px; background: var(--card-2); color: var(--gold-hi); font-size: 0.85em; }
.editlink { display: flex; align-items: center; gap: 12px; margin: 14px 0 6px; padding: 12px 14px; border-radius: 14px; background: var(--card); border: 1px dashed rgba(226, 176, 74, 0.4); font-size: 0.82rem; color: var(--muted); }
.loading { color: var(--muted); }

.sec { margin-top: 12px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); overflow: hidden; }
.sec summary { display: flex; align-items: center; gap: 12px; padding: 15px 16px; cursor: pointer; list-style: none; }
.sec summary::-webkit-details-marker { display: none; }
.sec summary::after { content: ""; width: 8px; height: 8px; margin-left: 4px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); rotate: 45deg; translate: 0 -2px; transition: rotate 0.2s; }
.sec[open] summary::after { rotate: 225deg; translate: 0 2px; }
.sec-n { font: 600 0.72rem/1 ui-monospace, Menlo, monospace; color: var(--gold); }
.sec-t { font-weight: 600; }
.sec-b { margin-left: auto; font-size: 0.72rem; color: var(--gold-hi); white-space: nowrap; }
.sec-body { display: grid; gap: 16px; padding: 4px 16px 18px; }

.field { display: grid; gap: 6px; position: relative; }
.lbl { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.02em; color: var(--muted); }
.help { font-size: 0.76rem; color: var(--muted); opacity: 0.85; }
.count { position: absolute; right: 8px; top: 0; font-size: 0.7rem; color: var(--gold); }
input[type="text"], input[type="tel"], input[type="date"], textarea, .slug input {
  width: 100%; padding: 11px 12px; border-radius: 11px; border: 1px solid var(--line); background: #1B0B11; color: var(--ink);
  font: 400 1rem/1.4 var(--f-story); font-variation-settings: "SOFT" 100; outline: none; resize: none;
}
input:focus, textarea:focus { border-color: rgba(226, 176, 74, 0.7); box-shadow: 0 0 0 3px rgba(226, 176, 74, 0.15); }
.field.empty input, .field.empty textarea { border-color: var(--red); }
.field.empty::after { content: "This can't be empty."; font-size: 0.74rem; color: var(--red); }
input[type="range"] { width: 100%; accent-color: var(--gold); }

.photo .ph { position: relative; display: block; width: 100%; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; background: #12070B; border: 1px solid var(--line); cursor: pointer; }
.photo .ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo .ph img:not([src]) { display: none; }
.ph-btn { position: absolute; right: 10px; bottom: 10px; padding: 8px 12px; border-radius: 10px; background: rgba(20, 8, 12, 0.78); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); font-size: 0.8rem; font-weight: 600; }
.sample { position: absolute; left: 10px; top: 10px; padding: 4px 8px; border-radius: 8px; background: rgba(226, 176, 74, 0.92); color: #2A0610; font-size: 0.68rem; font-style: normal; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.field.busy { opacity: 0.55; pointer-events: none; }
.field.busy .ph-btn::after { content: " · uploading…"; }
.au { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.au audio { width: 100%; height: 36px; }

.fp { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.fp-photo { position: relative; border-radius: 12px; overflow: hidden; background: #12070B; cursor: crosshair; touch-action: none; user-select: none; -webkit-user-select: none; }
.fp-photo img { display: block; width: 100%; height: auto; pointer-events: none; }
.fp-dot { position: absolute; width: 26px; height: 26px; translate: -50% -50%; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.45), inset 0 0 0 2px rgba(0, 0, 0, 0.35); pointer-events: none; }
.fp-dot::after { content: ""; position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; translate: -50% -50%; border-radius: 50%; background: var(--gold-hi); }
.fp-out { display: grid; gap: 8px; justify-items: center; text-align: center; }
.fp-out small { font-size: 0.72rem; color: var(--muted); }
/* a close crop of the Devi painting around her head (image px 369–609 × 196–484) */
.fp-devi { position: relative; width: 100%; aspect-ratio: 240 / 288; overflow: hidden; border-radius: 12px; outline: 1.5px solid rgba(226, 176, 74, 0.7); outline-offset: 3px; background: #3A160B; }
.fp-devi-in { position: absolute; left: -153.75%; top: -68.06%; width: 403.33%; height: 564.24%; }
.fp-devi-in .d-art { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.fp-devi-in .d-face { position: absolute; overflow: hidden; background: #2A1812; }
.fp-devi-in .d-face img { display: block; filter: sepia(0.12) saturate(1.08) contrast(1.04) brightness(1.03); }
.fp-devi-in .d-top { position: absolute; display: block; }

/* preview: full screen on phones, a sticky phone beside the form on wide screens */
.preview { position: fixed; inset: 0; z-index: 40; display: none; flex-direction: column; background: #0D0408; }
.preview.open { display: flex; }
.pv-bar { display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 12px 10px; }
.seg { display: flex; padding: 3px; border-radius: 12px; background: var(--card); }
.seg button { padding: 7px 12px; border: 0; border-radius: 9px; background: none; font-size: 0.8rem; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--card-2); color: var(--ink); }
.pv-close { margin-left: auto; width: 38px; height: 38px; border: 0; border-radius: 50%; background: var(--card); font-size: 1rem; cursor: pointer; }
.phone { flex: 1; min-height: 0; }
.phone iframe { width: 100%; height: 100%; border: 0; display: block; background: #14070C; }
.pv-note { margin: 0; padding: 8px; text-align: center; font-size: 0.72rem; color: var(--muted); }

@media (min-width: 960px) {
  .only-phone { display: none !important; }
  .layout { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 32px; padding: 0 24px; }
  .form { margin: 0; max-width: none; }
  .preview { position: sticky; top: 64px; height: calc(100vh - 80px); display: flex; background: none; padding-top: 14px; }
  .pv-bar { padding: 0 0 10px; }
  .phone { flex: none; width: 390px; height: min(780px, calc(100vh - 170px)); margin: 0 auto; border-radius: 42px; padding: 12px; background: #050203; box-shadow: 0 0 0 2px #3A2A2E, 0 30px 60px rgba(0, 0, 0, 0.5); }
  .phone iframe { border-radius: 30px; }
}

.sheet { position: fixed; inset: 0; z-index: 60; display: grid; align-items: end; background: rgba(5, 2, 3, 0.6); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.sheet-card { position: relative; width: 100%; max-width: 520px; margin: 0 auto; padding: 26px 20px calc(24px + env(safe-area-inset-bottom)); border-radius: 22px 22px 0 0; background: #24101A; border: 1px solid var(--line); display: grid; gap: 14px; animation: up 0.3s ease; }
@media (min-width: 600px) { .sheet { align-items: center; } .sheet-card { border-radius: 22px; } }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
.sheet-card h2 { margin: 0; font: 400 1.7rem/1.15 var(--f-story); font-variation-settings: "SOFT" 100; }
.sheet-card p { margin: 0; color: var(--muted); }
.kicker { font-size: 0.7rem !important; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold) !important; }
.x { position: absolute; right: 12px; top: 12px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--card-2); cursor: pointer; }
.slug { display: flex; align-items: center; border-radius: 12px; border: 1px solid var(--line); background: #1B0B11; overflow: hidden; }
.slug span { padding-left: 12px; font-size: 0.8rem; color: var(--muted); white-space: nowrap; }
.slug input { border: 0; background: none; padding-left: 2px; box-shadow: none !important; }
.slug-msg { font-size: 0.78rem; margin-top: -6px; }
.slug-msg.good { color: var(--green); }
.slug-msg.bad { color: var(--red); }
.warn { padding: 12px 14px; border-radius: 12px; background: rgba(226, 176, 74, 0.12); border: 1px solid rgba(226, 176, 74, 0.35); font-size: 0.85rem; color: var(--ink); }
.ticks { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 0.88rem; }
.ticks li::before { content: "✓  "; color: var(--gold); }
.fine { font-size: 0.74rem !important; }
.live { display: block; padding: 14px; border-radius: 12px; background: #1B0B11; border: 1px solid rgba(226, 176, 74, 0.45); font: 500 1.05rem/1.3 var(--f-story); word-break: break-all; text-decoration: none; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row .btn { flex: 1; }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 80; translate: -50% 0; max-width: calc(100% - 32px); padding: 12px 16px; border-radius: 12px; background: #FBEFDC; color: #2A0610; font-size: 0.88rem; font-weight: 600; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); }
