/* Invitation editor UI (from build/invite/editor.html) + site rules. */
.inv-editor-page { --bg:#f6f7fb; --fg:#0f172a; --muted:#64748b; --line:#e2e8f0; --btn:#f1f5f9; --panel:#fff; --accent:#1d4ed8; --gold:#b8860b; --inv-top:0px; }
.inv-editor-page, .inv-editor-page * { box-sizing:border-box; }
.inv-editor-page { margin:0; background:var(--bg); color:var(--fg); font-family:"Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif; }
.inv-editor-page .app { display:grid; grid-template-columns:auto minmax(360px, 760px); gap:20px; justify-content:center; align-items:start;
         padding:12px 16px; height:calc(100dvh - var(--inv-top)); }
.inv-editor-page .stage { --cvh:calc(100dvh - var(--inv-top) - 108px); width:min(calc(var(--cvh) * 9 / 16), 380px); display:flex; flex-direction:column; align-items:center; gap:6px; min-width:0; container-type:inline-size; }
.inv-editor-page h1 { font-weight:800; margin:0; font-size:18px; }
.inv-editor-page canvas#cv { display:block; width:100%; height:auto; aspect-ratio:9/16;
              border-radius:14px; box-shadow:0 12px 40px #0f172a40; background:#000; cursor:pointer; touch-action:manipulation; }
.inv-editor-page .ctl { display:flex; gap:6px; align-items:center; width:100%; max-width:100%; }
.inv-editor-page .ctl input { flex:1; min-width:60px; }
.inv-editor-page .ctl button { padding:6px 10px; min-width:38px; font-size:16px; }
.inv-editor-page #clock { font-size:12px; min-width:74px; text-align:right; color:var(--muted); font-variant-numeric:tabular-nums; }
@container (max-width: 300px) {
.inv-editor-page #clock { display:none; }
.inv-editor-page .ctl button { min-width:32px; padding:6px 7px; }
 }
.inv-editor-page .sub { display:flex; gap:10px; justify-content:center; align-items:center; font-size:12px; color:var(--muted); min-height:1.3em; text-align:center; }
.inv-editor-page #scene { text-transform:uppercase; letter-spacing:.1em; }
.inv-editor-page button, .inv-editor-page select, .inv-editor-page label.up { background:var(--btn); color:var(--fg); border:1px solid var(--line); border-radius:8px;
                   padding:8px 12px; font-size:14px; font-weight:600; font-family:inherit; cursor:pointer; }
.inv-editor-page button:hover, .inv-editor-page label.up:hover { border-color:#cbd5e1; }
.inv-editor-page button.primary { background:var(--accent); color:#fff; border-color:var(--accent); }
.inv-editor-page label.up { display:block; }
.inv-editor-page label.up input { display:none; }
.inv-editor-page [hidden] { display:none !important; }
.inv-editor-page label.up.done { border-color:#16a34a; background:#f0fdf4; }
.inv-editor-page button:disabled { opacity:.5; cursor:wait; }
.inv-editor-page .panel { width:100%; height:calc(100dvh - var(--inv-top) - 24px); display:flex; flex-direction:column; background:var(--panel);
           border:1px solid var(--line); border-radius:14px; overflow:hidden; box-shadow:0 4px 20px #0f172a0d; }
.inv-editor-page .price { background:#fff7e6; color:#7c4a03; border-bottom:1px solid #fde7b5; padding:7px 12px; text-align:center;
           font:600 14px 'Tiro Devanagari Hindi', serif; }
.inv-editor-page .side { display:flex; align-items:center; gap:6px; padding:8px 12px; border-bottom:1px solid var(--line); flex:none; }
.inv-editor-page .side span { font-size:12px; color:var(--muted); margin-right:4px; }
.inv-editor-page .side button { flex:1; padding:7px 10px; font-size:13px; background:#fff; white-space:nowrap; }
.inv-editor-page .side button.on { background:var(--accent); border-color:var(--accent); color:#fff; }
.inv-editor-page .tabs { display:flex; overflow-x:auto; border-bottom:1px solid var(--line); flex:none; }
.inv-editor-page .tabs button { flex:1; border:0; border-radius:0; border-bottom:2px solid transparent; background:none; white-space:nowrap; padding:10px 8px; color:var(--muted); }
.inv-editor-page .tabs button.on { border-bottom-color:var(--accent); color:var(--accent); }
.inv-editor-page .pane { display:none; padding:10px 16px 16px; flex:1; min-height:0; overflow:auto; }
.inv-editor-page .pane.on { display:block; }
.inv-editor-page .field label, .inv-editor-page .lbl { display:block; font-size:12px; color:var(--muted); margin:8px 0 3px; }
.inv-editor-page input[type=text], .inv-editor-page textarea, .inv-editor-page .pane select { width:100%; background:#fff; color:var(--fg); border:1px solid #cbd5e1;
           border-radius:8px; padding:7px 9px; font:15px 'Tiro Devanagari Hindi', system-ui, sans-serif; }
.inv-editor-page input[type=text]:focus, .inv-editor-page .pane select:focus { outline:2px solid #bfdbfe; border-color:var(--accent); }
.inv-editor-page fieldset { border:1px solid var(--line); border-radius:10px; margin:10px 0; padding:2px 12px 10px;
             display:grid; grid-template-columns:repeat(auto-fill, minmax(220px, 1fr)); column-gap:14px; }
.inv-editor-page fieldset > legend { font-weight:700; font-size:13px; padding:0 6px; }
.inv-editor-page fieldset > label.chk, .inv-editor-page fieldset > .hint, .inv-editor-page fieldset > .field.wide { grid-column:1 / -1; }
.inv-editor-page #pane-style fieldset, .inv-editor-page #pane-look fieldset { display:block; }
.inv-editor-page fieldset.off { opacity:.45; }
.inv-editor-page .row { display:flex; gap:8px; align-items:center; }
.inv-editor-page .row > * { flex:1; }
.inv-editor-page input[type=range] { width:100%; accent-color:var(--accent); }
.inv-editor-page input[type=color] { flex:0 0 48px; width:48px; height:36px; padding:0; border:1px solid var(--line); border-radius:8px; background:none; }
.inv-editor-page label.chk { display:flex; gap:8px; align-items:center; font-size:14px; margin:8px 0; cursor:pointer; }
.inv-editor-page .hint { font-size:12.5px; color:var(--muted); margin:6px 0; line-height:1.45; }
.inv-editor-page .bank-list { display:grid; gap:6px; margin:6px 0; }
.inv-editor-page .bank-item { display:flex; justify-content:space-between; align-items:center; gap:10px; text-align:left; padding:8px 10px; }
.inv-editor-page .bank-item span { font-size:12px; color:var(--muted); white-space:nowrap; }
.inv-editor-page .bank-item.on { background:var(--accent); border-color:var(--accent); color:#fff; }
.inv-editor-page .bank-item.on span { color:#dbeafe; }
.inv-editor-page #wave { width:100%; height:110px; background:#0f172a; border-radius:8px; cursor:grab; touch-action:none; display:block; }
.inv-editor-page .stack { display:flex; flex-direction:column; gap:8px; }
.inv-editor-page .lblrow { display:flex; justify-content:space-between; align-items:center; gap:8px; margin:8px 0 3px; }
.inv-editor-page .lblrow span { font-size:12px; color:var(--muted); }
.inv-editor-page button.lang { padding:1px 8px; font:600 12px 'Tiro Devanagari Hindi', serif; color:var(--muted); background:#fff; }
.inv-editor-page button.lang.on { border-color:var(--gold); color:#7c4a03; background:#fff7e6; }
.inv-editor-page .chips { display:flex; gap:6px; flex-wrap:wrap; margin-top:5px; }
.inv-editor-page .chips:empty { display:none; }
.inv-editor-page .chips button { padding:3px 10px; font:16px 'Tiro Devanagari Hindi', serif; background:#fff; }
.inv-editor-page .chips button:first-child { border-color:var(--gold); background:#fff7e6; }
.inv-editor-page .nudge button { padding:7px 0; font-size:17px; }
.inv-editor-page .nudge #st-center { flex:2; font-size:14px; }
.inv-editor-page canvas#cv.dragging { cursor:grabbing; }
.inv-editor-page .stage:fullscreen, .inv-editor-page .stage.fs-fake { background:#000; justify-content:center; padding:12px; gap:8px; }
.inv-editor-page .stage.fs-fake { position:fixed; inset:0; z-index:1000; }
.inv-editor-page .stage:fullscreen, .inv-editor-page .stage.fs-fake { width:100%; align-items:center; }
.inv-editor-page .stage:fullscreen canvas#cv, .inv-editor-page .stage.fs-fake canvas#cv { width:auto; height:calc(100dvh - 90px); max-width:100vw; box-shadow:none; }
.inv-editor-page .stage:fullscreen .ctl, .inv-editor-page .stage.fs-fake .ctl { max-width:min(560px, 100vw); }
.inv-editor-page .stage:fullscreen .sub, .inv-editor-page .stage.fs-fake .sub { color:#cbd5e1; }
.inv-editor-page .stage:fullscreen h1, .inv-editor-page .stage.fs-fake h1 { display:none; }
@media (max-width: 899px) {
.inv-editor-page .app { display:flex; flex-direction:column; align-items:stretch; height:auto; padding:8px 10px 16px; gap:12px; }
.inv-editor-page .stage { --cvh:calc(100dvh - 104px); width:min(calc(var(--cvh) * 9 / 16), 100%, 380px); align-self:center; }
.inv-editor-page .panel { height:auto; max-height:none; }
.inv-editor-page .pane { overflow:visible; }
.inv-editor-page fieldset { grid-template-columns:1fr; }
.inv-editor-page .tabs button { padding:10px 7px; font-size:13px; }

  }
.inv-editor-page.embed .stage h1 { display:none; }
.inv-editor-page.embed .app { padding-top:8px; }
.inv-editor-page.thumb { background:#000; }
.inv-editor-page.thumb .app { padding:0; display:block; height:auto; }
.inv-editor-page.thumb .stage > :not(canvas), .inv-editor-page.thumb .panel { display:none; }
.inv-editor-page.thumb .stage { width:auto; }
.inv-editor-page.thumb canvas#cv { height:100vh; width:auto; max-width:none; border-radius:0; box-shadow:none; display:block; }


/* ---- site integration (gcpwork.com) ---- */
/* The editor sits inside the site layout under the white site header; site.js sets --inv-top (header + bar height)
   so preview + panel fill exactly one screen. */
.inv-editor-page { background: #f6f7fb; }
.inv-editor-page .stage h1 { display: none; }   /* the site bar above already names the invitation */
.inv-bar { background: #fff; border-bottom: 1px solid #e2e8f0; color: #0f172a; font-family: "Plus Jakarta Sans", "Jakarta", system-ui, sans-serif; }
.inv-bar .container { display: flex; align-items: center; gap: 10px 18px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
.inv-bar .inv-crumb { font-size: 13px; color: #64748b; }
.inv-bar .inv-crumb a { color: #1d4ed8; }
.inv-bar .inv-name { font-weight: 800; font-size: 16px; }
.inv-bar #site-saved { color: #15803d; font-size: 14px; }
.inv-bar .inv-spacer { flex: 1; }
.inv-steps { display: flex; gap: 6px; font-size: 13px; font-weight: 600; }
.inv-steps span { padding: 4px 10px; border-radius: 999px; background: #e2e8f0; color: #334155; }
.inv-steps span.on { background: #0f172a; color: #fff; }
.inv-steps span.done { background: #dcfce7; color: #166534; }
/* one compact row on laptops, so the preview gets the height */
@media (min-width: 700px) { .inv-bar .container { flex-wrap: nowrap; padding-top: 8px; padding-bottom: 8px; } .inv-bar .btn { white-space: nowrap; } }
@media (max-width: 1150px) { .inv-steps { display: none; } }
@media (max-width: 900px) { .inv-bar #site-saved { display: none; } }
/* phones: the tall site header must not stay stuck over the preview */
@media (max-width: 699px) { body:has(.inv-editor-page) .site-header { position: static; } }
@media (max-width: 699px) { .inv-bar .inv-crumb { display: none; } .inv-bar .container { padding-top: 8px; padding-bottom: 8px; } }

/* Paid download page: the same engine, without the editing panel */
body.dl-mode .panel, body.dl-mode #replay { display: none; }
.inv-dl { display: grid; grid-template-columns: auto minmax(260px, 420px); gap: 24px; justify-content: center; align-items: start; padding: 16px; }
.inv-dl-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 18px; color: #0f172a; max-width: 460px; }
.inv-dl-card h2 { font-weight: 800; margin: 0 0 10px; font-size: 20px; }
.inv-dl-card dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0 0 14px; }
.inv-dl-card dt { color: #64748b; } .inv-dl-card dd { margin: 0; font-weight: 600; }
.inv-dl-card .hint { margin: 10px 0 0; }
#make-video { width: 100%; padding: 14px; font-size: 17px; }
@media (max-width: 820px) { .inv-dl { grid-template-columns: 1fr; } }
/* paid invitation: what's left + the limits warning (editor bar and download card) */
.inv-bar .inv-usage { font-size: 13px; font-weight: 700; color: #0f172a; background: #f1f5f9; border-radius: 999px; padding: 5px 12px; white-space: nowrap; }
.inv-dl-card .inv-usage { font-weight: 700; margin: 0 0 8px; }
.inv-limit-warn { background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; border-radius: 10px; padding: 10px 12px; line-height: 1.5; font-size: 13px; }
@media (max-width: 699px) { .inv-bar .inv-usage { white-space: normal; } }
