/* tema: hijau segar bergradasi ke ungu */
:root {
  --bg: #f4f8f7;
  --panel: #ffffff;
  --ink: #17132e;
  --muted: #625f80;
  --line: #e4e8f1;
  --violet: #7c3aed;
  --violet-d: #5b21b6;
  --coral: #10b981;      /* aksen utama (hijau) */
  --coral-d: #059669;
  --lemon: #ffd23f;
  --soft: #f1edff;
  --mint: #e6f9f1;
  --grad: linear-gradient(120deg, #12c98a 0%, #1fb5a5 30%, #5b6cf0 68%, #8b3dff 100%);
  --grad-soft: linear-gradient(120deg, #e3f9ef 0%, #ece9ff 100%);
  --panel2: #ffffff;     /* tombol/kotak di dalam kartu */
  --field: #f6f8fc;      /* kolom isian & latar kecil */
  --thumb: #eef2f0;
  --hover: #ecfaf3;
  --seg-on: #ffffff;
  --ghost-hover: #e2dcff;
  --topbar: rgba(255, 255, 255, 0.88);
  --glow1: #dff8ec;
  --glow2: #ece4ff;
  --dot: #d6cdea;
  --sel-bg: #17132e;     /* pilihan aktif (tombol gelap) */
  --sel-fg: #ffffff;
  --sel-muted: #d9d2ea;
  --stage-bg: linear-gradient(180deg, #eafaf2, #efeaff);
  --stage-a: #effbf5; --stage-b: #ebe6fb;   /* latar pratinjau pembuat karakter (dibaca JS) */
  --ok-bg: #e9fbf1; --ok-fg: #166534; --ok-line: #c8f0d5;
  --bad-bg: #ffe4e6; --bad-fg: #be123c;
  --warm-bg: #fff7eb; --warm-fg: #9a3412; --warm-line: #fde3c2;
  --radius: 16px;
  --fs: 1;               /* skala huruf: membesar otomatis di layar lebar */
  color-scheme: light;
}
@media (min-width: 1500px) { :root { --fs: 1.08; } }
@media (min-width: 1700px) { :root { --fs: 1.16; } }
@media (min-width: 2000px) { :root { --fs: 1.26; } }
@media (min-width: 2500px) { :root { --fs: 1.4; } }
/* ---- tema gelap ---- */
:root[data-theme="dark"] {
  --bg: #0e1016;
  --panel: #161922;
  --panel2: #1d212c;
  --field: #12151d;
  --thumb: #232734;
  --hover: #17282a;
  --ink: #e8e6f4;
  --muted: #9b98b6;
  --line: #2a2e3c;
  --violet: #a78bfa;
  --violet-d: #c4b5fd;
  --coral: #34d399;
  --coral-d: #10b981;
  --soft: #221e36;
  --mint: #12302a;
  --seg-on: #2b2f3f;
  --ghost-hover: #2e2850;
  --grad-soft: linear-gradient(120deg, #13302a 0%, #262045 100%);
  --topbar: rgba(16, 18, 26, 0.86);
  --glow1: rgba(18, 201, 138, 0.13);
  --glow2: rgba(139, 61, 255, 0.16);
  --dot: #4a4660;
  --sel-bg: #7c5cf5;
  --sel-fg: #ffffff;
  --sel-muted: #e4dcff;
  --stage-bg: linear-gradient(180deg, #13241f, #1c1930);
  --stage-a: #15261f; --stage-b: #1d1a31;
  --ok-bg: #11291f; --ok-fg: #6ee7b7; --ok-line: #1d4a37;
  --bad-bg: #351820; --bad-fg: #fda4af;
  --warm-bg: #2e2112; --warm-fg: #fdba74; --warm-line: #4a3418;
  color-scheme: dark;
}
:root[data-theme="dark"] .card { box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35); }
:root[data-theme="dark"] .modal { background: rgba(4, 4, 10, 0.7); }
:root[data-theme="dark"] .phone { background: #05060a; box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6), 0 0 0 1px #2a2e3c; }
:root[data-theme="dark"] .cp-thumb img, :root[data-theme="dark"] .opt canvas { filter: brightness(0.92); }
:root[data-theme="dark"] .navbtn { color: var(--ink); }
/* tombol ganti tema */
.themebtn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel2); cursor: pointer; font-size: calc(17px * var(--fs)); line-height: 1; display: grid; place-items: center; flex: none; }
.themebtn:hover { border-color: var(--violet); }
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: radial-gradient(1200px 600px at 0% 0%, var(--glow1) 0%, transparent 60%), radial-gradient(1000px 700px at 100% 0%, var(--glow2) 0%, transparent 60%), var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  font-family: 'Plus Jakarta Sans', 'Segoe UI', Arial, sans-serif;
  font-size: calc(14px * var(--fs));
}
button, input, select, textarea { font: inherit; color: inherit; }

/* ---- header ---- */
.topbar {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 10px 20px; background: var(--topbar); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5; backdrop-filter: blur(10px);
}
.topbar::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: var(--grad); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-text b { font-weight: 800; font-size: calc(18px * var(--fs)); }
.brand-text i { font-style: normal; font-weight: 800; font-size: calc(18px * var(--fs)); color: var(--violet); background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.steps { display: flex; gap: 6px; flex-wrap: wrap; }
.step { padding: 7px 12px; border-radius: 999px; background: var(--soft); color: var(--muted); font-weight: 700; font-size: calc(13px * var(--fs)); }
.step.active { background: var(--grad); color: #fff; box-shadow: 0 4px 14px rgba(91, 108, 240, 0.3); }
.step.soon { opacity: 0.6; }
.badge { margin-left: auto; font-size: calc(12px * var(--fs)); font-weight: 700; color: var(--violet-d); background: var(--mint); padding: 6px 10px; border-radius: 999px; }

/* ---- layout ---- */
.layout { display: grid; grid-template-columns: minmax(290px, 22%) minmax(360px, 1fr) minmax(420px, 30%); gap: 20px; padding: 18px 24px 40px; max-width: 2600px; margin: 0 auto; }
.panel { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: 0 6px 20px rgba(60, 30, 120, 0.05); }
.card h3 { margin: 0 0 8px; font-size: calc(15px * var(--fs)); font-weight: 800; }
details.card summary { cursor: pointer; list-style: none; }
details.card summary h3 { display: inline; }
details.card summary::after { content: ' ▾'; color: var(--muted); }
details[open].card summary { margin-bottom: 8px; }
.muted { color: var(--muted); margin: 0 0 10px; }
.hint { color: var(--muted); font-size: calc(12px * var(--fs)); margin: 8px 0 0; }
.lbl { display: block; font-size: calc(12px * var(--fs)); font-weight: 700; color: var(--muted); margin: 10px 0 4px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.check { display: flex; gap: 8px; align-items: center; margin: 6px 0; font-weight: 600; }
textarea, input[type=text], input[type=number], input[type=password], select {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: var(--field);
}
textarea.code { font-family: 'Cascadia Code', Consolas, monospace; font-size: calc(12px * var(--fs)); line-height: 1.45; white-space: pre; tab-size: 2; }
input[type=range] { width: 100%; accent-color: var(--violet); }
input[type=file] { width: 100%; font-size: calc(12px * var(--fs)); }
.btn { border: 0; background: var(--grad); color: #fff; font-weight: 800; padding: 9px 14px; border-radius: 10px; cursor: pointer; box-shadow: 0 4px 12px rgba(91, 108, 240, 0.22); }
.btn:hover { filter: brightness(1.07) saturate(1.05); }
.btn.ghost { background: var(--grad-soft); color: var(--violet-d); box-shadow: none; }
.btn.ghost:hover { background: var(--ghost-hover); filter: none; }
code { background: var(--soft); padding: 1px 5px; border-radius: 5px; }

/* ---- stage ---- */
.stagewrap { display: flex; flex-direction: column; align-items: center; gap: 12px; min-width: 0; }
.phone { background: #1c1433; padding: 10px; border-radius: 30px; box-shadow: 0 18px 50px rgba(40, 20, 90, 0.25); width: clamp(280px, calc((100vh - 330px) * 9 / 16 + 20px), 420px); max-width: 100%; }
.phone canvas { display: block; width: 100%; height: auto; aspect-ratio: 9 / 16; border-radius: 22px; background: #f4efe6; }
.controls { display: flex; align-items: center; gap: 10px; width: min(100%, 820px); }
.round { width: 52px; height: 52px; flex: none; border-radius: 50%; border: 0; background: var(--grad); color: #fff; font-size: calc(20px * var(--fs)); cursor: pointer; box-shadow: 0 6px 16px rgba(16, 185, 129, 0.35); }
.round.small { width: 38px; height: 38px; font-size: calc(18px * var(--fs)); background: var(--soft); color: var(--violet-d); box-shadow: none; }
.time { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 700; white-space: nowrap; }
.timeline { display: flex; gap: 4px; width: min(100%, 820px); position: relative; }
.chip { height: 46px; border-radius: 10px; border: 2px solid transparent; cursor: pointer; position: relative; overflow: hidden; display: flex; align-items: flex-end; padding: 4px 6px; font-size: calc(11px * var(--fs)); font-weight: 800; color: #1c1433; min-width: 26px; }
.chip.paper { background: linear-gradient(#fff1c9, #ffd7a8); }
.chip.dusk { background: linear-gradient(#cff5e7, #9fe3d2); }
.chip.night { background: linear-gradient(#3b2a66, #1b1236); color: #fff; }
.chip.sel { border-color: var(--violet); box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.25); }
.chip.err::after { content: '!'; position: absolute; top: 3px; right: 6px; color: #e11d48; font-weight: 900; }
.playhead { position: absolute; top: -4px; bottom: -4px; width: 3px; background: var(--coral); border-radius: 2px; pointer-events: none; }

/* ---- scene editor ---- */
.scenehead { display: flex; align-items: center; gap: 8px; }
.scenehead h3 { margin: 0; flex: 1; }
.mini { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel2); cursor: pointer; font-size: calc(18px * var(--fs)); line-height: 1; }
.pill { font-size: calc(12px * var(--fs)); font-weight: 800; padding: 4px 10px; border-radius: 999px; background: var(--ok-bg); color: var(--ok-fg); }
.pill.bad { background: var(--bad-bg); color: var(--bad-fg); }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 90px; gap: 8px; }
.visual { margin: 0; padding: 8px 10px; background: var(--field); border-radius: 10px; color: var(--muted); font-size: calc(12px * var(--fs)); max-height: 110px; overflow: auto; }

/* ---- langkah 1-3 ---- */
[hidden] { display: none !important; }
.step { border: 0; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.step .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dot); }
.step.done .dot { background: #22c55e; }
.step.active .dot { background: var(--panel2); }
.projname { font-weight: 700; color: var(--ink); max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .btn.small { margin-left: 4px; }
.keypanel { position: absolute; right: 20px; top: 64px; width: min(360px, calc(100vw - 32px)); z-index: 20; box-shadow: 0 20px 50px rgba(40, 20, 90, 0.25); }
.view.two { display: grid; grid-template-columns: minmax(400px, 30%) minmax(0, 1fr); gap: 20px; padding: 18px 24px 40px; max-width: 2600px; margin: 0 auto; }
.panel.wide { min-width: 0; }
.btn.small { padding: 6px 10px; font-size: calc(12px * var(--fs)); }
.btn.big { padding: 12px 20px; font-size: calc(15px * var(--fs)); background: var(--grad); }
.btn.big:hover { filter: brightness(1.08); }
.btn.full { width: 100%; margin-top: 12px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.seg { display: flex; background: var(--soft); border-radius: 12px; padding: 4px; gap: 4px; flex-wrap: wrap; }
.seg button { flex: 1; border: 0; background: transparent; padding: 8px 10px; border-radius: 9px; font-weight: 700; color: var(--muted); cursor: pointer; white-space: nowrap; }
.seg button.on { background: var(--seg-on); color: var(--violet-d); box-shadow: 0 2px 8px rgba(60, 30, 120, 0.12); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cardhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.cardhead h3 { margin: 0; }
select.tiny { width: auto; padding: 4px 8px; font-size: calc(12px * var(--fs)); }
.row.between { justify-content: space-between; align-items: center; }
.tag { display: inline-block; font-size: calc(11px * var(--fs)); font-weight: 800; color: var(--coral); background: var(--mint); padding: 3px 8px; border-radius: 999px; margin-bottom: 6px; }
.styles { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.style { border: 2px solid var(--line); border-radius: 12px; padding: 10px; background: var(--panel2); cursor: pointer; text-align: left; }
.style.on { border-color: var(--violet); background: var(--soft); }
.style b { display: block; font-size: calc(13px * var(--fs)); }
.style small { color: var(--muted); font-size: calc(11px * var(--fs)); }
.sw { display: flex; gap: 3px; margin-bottom: 6px; }
.sw i { width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, 0.1); }
.ideas { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.idea { border: 2px solid var(--line); border-radius: 14px; padding: 12px 14px; cursor: pointer; background: var(--panel2); text-align: left; position: relative; }
.idea.on { border-color: var(--coral); box-shadow: 0 8px 22px rgba(16, 185, 129, 0.2); }
.idea .num { font-size: calc(11px * var(--fs)); font-weight: 800; color: var(--coral); }
.idea h4 { margin: 4px 0 8px; font-size: calc(15px * var(--fs)); }
.idea q { display: block; font-family: 'Caveat', cursive; font-size: calc(19px * var(--fs)); line-height: 1.15; background: var(--mint); border-radius: 10px; padding: 8px 10px; margin-bottom: 8px; quotes: none; }
.idea p { margin: 0; color: var(--muted); font-size: calc(12.5px * var(--fs)); }
.nextbar { display: flex; justify-content: flex-end; }
.nextbar.side { margin-top: 14px; }
/* tombol yang ditunjuk panah: bersinar berdenyut */
.btn.go { animation: go-glow 1.6s ease-in-out infinite; }
@keyframes go-glow { 0%, 100% { box-shadow: 0 0 0 0 rgba(18, 201, 138, 0.55), 0 4px 12px rgba(91, 108, 240, 0.25); } 50% { box-shadow: 0 0 0 8px rgba(18, 201, 138, 0), 0 6px 22px rgba(91, 108, 240, 0.5); } }
/* tanda panah "klik untuk lanjut" yang mengikuti tombolnya */
.gotip { position: fixed; z-index: 35; display: flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; background: var(--sel-bg); color: var(--sel-fg); font-weight: 800; font-size: calc(13px * var(--fs)); white-space: nowrap; pointer-events: none; box-shadow: 0 10px 24px rgba(20, 10, 60, 0.3); animation: go-bounce 1.1s ease-in-out infinite; }
.gotip[hidden] { display: none; }
.gotip i { font-style: normal; font-size: 16px; }
.gotip.below i { transform: rotate(180deg); }
@keyframes go-bounce { 0%, 100% { translate: 0 0; } 50% { translate: 0 6px; } }
.gotip.below { animation-name: go-bounce-up; }
@keyframes go-bounce-up { 0%, 100% { translate: 0 0; } 50% { translate: 0 -6px; } }
@media (prefers-reduced-motion: reduce) { .btn.go, .gotip { animation: none; } }
.pbox .row { margin-top: 6px; }
.pbox textarea { margin-top: 10px; }
.pbox .status { min-height: 18px; }
.sc { border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; margin-bottom: 10px; background: var(--panel2); }
.sc .schead { display: flex; align-items: center; gap: 8px; }
.sc .no { width: 26px; height: 26px; border-radius: 8px; background: var(--soft); color: var(--violet-d); font-weight: 800; display: grid; place-items: center; flex: none; }
.sc .schead .sp { flex: 1; }
.sc textarea.t { font-weight: 700; }
.sc .meta { display: grid; grid-template-columns: 1fr 1fr 1fr 80px; gap: 6px; margin-top: 6px; }
.sc .meta select, .sc .meta input { padding: 5px 7px; font-size: calc(12px * var(--fs)); }
.sc textarea.v { font-size: calc(12px * var(--fs)); color: var(--muted); margin-top: 6px; }
#wave { width: 100%; height: 150px; display: block; margin: 10px 0 6px; border-radius: 12px; background: var(--field); touch-action: none; cursor: ew-resize; }
#narr { width: 100%; }
@media (max-width: 1280px) { .topbar { gap: 10px; } .projbtn .projname { max-width: 130px; } }
@media (max-width: 1100px) { .projbtn .projname { display: none; } }
/* ---- pustaka efek suara ---- */
.sfxcats { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.sfxcats button { border: 1px solid var(--line); background: var(--panel2); border-radius: 999px; padding: 4px 10px; font-size: calc(11.5px * var(--fs)); font-weight: 700; cursor: pointer; color: var(--muted); }
.sfxcats button.on { background: var(--grad); color: #fff; border-color: transparent; }
.sfxgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-top: 8px; max-height: 260px; overflow: auto; }
.sfxitem { display: flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: var(--panel2); }
.sfxitem .sfxplay { flex: 1; min-width: 0; border: 0; background: none; text-align: left; padding: 6px 8px; cursor: pointer; font-size: calc(12px * var(--fs)); font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sfxitem .sfxplay:hover { background: var(--hover); }
.sfxitem .sfxadd { border: 0; border-left: 1px solid var(--line); background: var(--mint); color: var(--coral); font-weight: 900; width: 30px; cursor: pointer; }
.sfxused { display: flex; flex-wrap: wrap; gap: 5px; }
.sfxused .muted { margin: 0; font-size: calc(12px * var(--fs)); }
.sfxchip { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 999px; padding: 2px 4px 2px 2px; background: var(--panel2); font-size: calc(12px * var(--fs)); }
.sfxchip b { font-weight: 700; } .sfxchip small { color: var(--muted); }
.sfxchip button { width: 22px; height: 22px; border-radius: 50%; border: 0; background: var(--soft); color: var(--violet-d); cursor: pointer; font-size: 10px; }
/* ---- tab Subtitle & Teks ---- */
.subsec { padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.subsec:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.subsec h3 { margin: 0; }
.subgal { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 10px; max-height: 520px; overflow: auto; padding: 2px; }
.subcard { border: 2px solid var(--line); background: var(--panel2); border-radius: 12px; padding: 6px; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 3px; }
.subcard canvas { width: 100%; aspect-ratio: 32 / 15; border-radius: 8px; display: block; }
.subcard b { font-size: calc(13px * var(--fs)); }
.subcard small { color: var(--muted); font-size: calc(11px * var(--fs)); line-height: 1.3; }
.subcard.on { border-color: var(--coral); box-shadow: 0 0 0 1px var(--coral) inset; }
.subdetail { margin-top: 10px; }
.subdetail summary { cursor: pointer; font-weight: 700; color: var(--violet-d); font-size: calc(13px * var(--fs)); }
#tabSub .subed { width: 100%; }
#tabSub #tabText .cardhead { margin-bottom: 4px; }
/* ---- tombol buka deskripsi/kode + pop-up samping ---- */
.openbtns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.openbtns .btn { padding: 12px; }
.modal.side { place-items: stretch end; padding: 0; background: rgba(8, 6, 20, 0.35); }
.codebox { width: min(620px, 100vw); height: 100%; max-height: none; border-radius: 0; display: flex; flex-direction: column; gap: 10px; overflow: auto; padding: 16px 18px; }
.codebox .scenehead h3 { min-width: 120px; text-align: center; }
.cmtext { margin: 0; font-weight: 700; padding: 8px 10px; border-radius: 10px; background: var(--field); }
.codebox textarea { width: 100%; }
#cmCodeBox textarea { min-height: 52vh; }
#cmVisualBox textarea { min-height: 30vh; line-height: 1.5; }
/* ---- thumbnail ---- */
.thcard { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 8px 0 12px; background: var(--panel2); }
.check.big { font-size: calc(15px * var(--fs)); font-weight: 800; }
.thstep { display: flex; gap: 10px; align-items: flex-start; margin: 16px 0 6px; }
.thstep .num { width: 26px; height: 26px; border-radius: 8px; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 800; flex: none; }
.thstep .hint { margin-top: 2px; }
.thstyles { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px; }
.thsty { display: flex; align-items: center; gap: 8px; border: 2px solid var(--line); background: var(--panel2); border-radius: 10px; padding: 6px 8px; cursor: pointer; font-weight: 700; font-size: calc(12.5px * var(--fs)); text-align: left; }
.thsty i { width: 22px; height: 22px; border-radius: 6px; flex: none; }
.thsty.on { border-color: var(--coral); }
.thcolors { display: grid; grid-template-columns: repeat(3, 60px); gap: 6px; margin-top: 6px; }
#thText { margin-top: 6px; }
.thbox { display: grid; grid-template-columns: 96px 1fr; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: var(--panel2); }
.thbox .row { margin-top: 6px; }
.thimg { width: 96px; aspect-ratio: 9 / 16; border-radius: 10px; overflow: hidden; background: var(--thumb); display: grid; place-items: center; text-align: center; font-size: calc(11px * var(--fs)); color: var(--muted); padding: 4px; }
.thimg img { width: 100%; height: 100%; object-fit: cover; }
/* ---- pilihan proyek di header ---- */
.projsel { position: relative; margin-left: auto; min-width: 0; }
.projbtn { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--panel2); border-radius: 999px; padding: 6px 12px; cursor: pointer; max-width: 360px; font-weight: 700; color: var(--ink); }
.projbtn .projname { margin: 0; max-width: 280px; }
.projbtn .caret { color: var(--muted); font-size: calc(11px * var(--fs)); }
.projmenu { position: absolute; right: 0; top: calc(100% + 8px); width: min(420px, calc(100vw - 24px)); max-height: min(70vh, 640px); overflow: auto; z-index: 30; padding: 8px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3); }
.pmact { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pmact button { border: 1px solid var(--line); background: var(--panel2); border-radius: 10px; padding: 9px 10px; cursor: pointer; font-weight: 700; text-align: left; }
.pmact button:first-child { background: var(--grad); color: #fff; border: 0; }
.pmsec { font-size: calc(11px * var(--fs)); font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; padding: 12px 6px 4px; }
.pmrow { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 10px; cursor: pointer; }
.pmrow:hover { background: var(--hover); }
.pmrow.on { background: var(--mint); }
.pmrow .pt { flex: 1; min-width: 0; }
.pmrow b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pmrow small { color: var(--muted); }
/* ---- suara manual (AI Studio) ---- */
.manualtts summary { cursor: pointer; list-style: none; }
.manualtts summary h3 { display: inline; }
.steps3 { padding-left: 18px; margin: 10px 0; display: flex; flex-direction: column; gap: 10px; }
.steps3 li { line-height: 1.5; }
.steps3 .row { margin-top: 6px; }
.manualview summary { cursor: pointer; }
.manualview textarea { margin-top: 6px; font-family: 'Cascadia Code', Consolas, monospace; font-size: calc(12px * var(--fs)); }
@media (max-width: 640px) {
  .projsel { margin-left: 0; }
  .projbtn .projname { display: none; }
  .projbtn { padding: 6px 10px; }
  #btnFull { display: none; }
  .brand { min-width: 0; overflow: hidden; }
  .themebtn { width: 34px; height: 34px; }
  .codebox { width: 100vw; }
  .subgal { grid-template-columns: 1fr 1fr; max-height: 60vh; }
  .thbox { grid-template-columns: 80px 1fr; } .thimg { width: 80px; }
  .pmact { grid-template-columns: 1fr; }
}
/* ---- editor subtitle per scene ---- */
.subed { width: min(100%, 820px); }
.subnav { display: flex; align-items: center; gap: 8px; } .subnav b { font-size: calc(13px * var(--fs)); min-width: 92px; text-align: center; }
.selane { position: relative; height: 92px; margin-top: 10px; border-radius: 12px; background: var(--field); border: 1px solid var(--line); overflow: hidden; touch-action: none; cursor: pointer; }
.selane canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.seblocks { position: absolute; left: 0; right: 0; top: 8px; height: 34px; }
.seblk { position: absolute; top: 0; height: 34px; border-radius: 8px; background: #7c5cf5; color: #fff; font-size: calc(11px * var(--fs)); font-weight: 700; line-height: 34px; padding: 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: grab; user-select: none; box-shadow: inset -2px 0 0 rgba(0, 0, 0, 0.25); }
.seblk.mod { background: linear-gradient(90deg, #12c98a, #6d5cf0); }
.seph { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--coral); pointer-events: none; }
.sebtns { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.selist { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; max-height: 340px; overflow: auto; }
.serow { display: grid; grid-template-columns: 30px 22px 72px 30px 30px 1fr 30px; gap: 5px; align-items: center; padding: 3px; border-radius: 9px; }
.serow.mod { background: var(--mint); }
.serow .no { font-weight: 800; color: var(--violet); text-align: center; font-size: calc(12px * var(--fs)); }
.serow input { padding: 5px 7px; }
@media (max-width: 640px) {
  .serow { grid-template-columns: 30px 74px 30px 30px 1fr 30px; border-bottom: 1px dashed var(--line); padding-bottom: 6px; }
  .serow .no { display: none; }
  .serow .tx { grid-column: 1 / -1; order: 9; }
  .serow [data-a=r] { grid-column: 6; }
  .sebtns .btn { flex: 1 1 auto; }
  .selane { height: 80px; }
}
/* ---- aset gambar & video ---- */
.assetgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 10px; }
.asset { border: 1px solid var(--line); border-radius: 12px; padding: 6px; background: var(--panel2); display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.asset.on { border-color: var(--coral); box-shadow: 0 0 0 1px var(--coral) inset; }
.asset .th { position: relative; border-radius: 9px; overflow: hidden; background: var(--thumb); aspect-ratio: 4 / 3; }
.asset .th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.asset .kd { position: absolute; left: 5px; bottom: 5px; font-size: calc(10.5px * var(--fs)); font-weight: 800; color: #fff; background: rgba(0, 0, 0, 0.6); padding: 2px 6px; border-radius: 6px; }
.asset input { padding: 5px 7px; font-size: calc(12px * var(--fs)); }
.asset .nm { font-weight: 700; }
.asset .ab { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.asset .ab .btn { flex: 1; }
.asset .tg { color: var(--muted); font-size: calc(11px * var(--fs)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.passets { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-top: 8px; }
.passets .muted { grid-column: 1 / -1; margin: 0; }
.assetbox { width: min(980px, 100%); height: min(820px, calc(100vh - 32px)); display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.assetbox > .cardhead { padding: 14px 18px; border-bottom: 1px solid var(--line); margin: 0; }
.amtools { display: flex; gap: 8px; align-items: center; }
.ambody { flex: 1; overflow: auto; padding: 12px 18px 18px; }
.mediabox { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--grad-soft); }
.mediabox .cardhead { margin: 0; } .mediabox .cardhead .lbl { margin: 0; }
.mediarow { display: grid; grid-template-columns: 1.4fr 1fr; gap: 6px; margin-top: 6px; }
.sizerow { display: flex; gap: 8px; align-items: center; }
.blk.med { background: linear-gradient(90deg, #12c98a, #6d5cf0); }
.blk.med.on { outline: 2px solid var(--ink); }
.pixrow { display: grid; grid-template-columns: 1fr auto auto auto; gap: 6px; margin-top: 8px; }
.pixrow select.tiny { height: 100%; }
.mediarow { display: grid; grid-template-columns: 1.4fr 1fr 70px; gap: 6px; }
.linkbtn { border: 0; background: none; color: var(--violet); font-weight: 700; font-size: calc(12px * var(--fs)); cursor: pointer; padding: 0 0 0 6px; }
@media (max-width: 640px) { .pixrow { grid-template-columns: 1fr 1fr; } .mediarow { grid-template-columns: 1fr 1fr; } .mediarow select:first-child { grid-column: 1 / -1; } .assetgrid { grid-template-columns: 1fr 1fr; } }
/* ---- daftar kunci API ---- */
.keypanel { max-height: calc(100vh - 80px); overflow: auto; }
.keylist { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.keyrow { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 12px; padding: 7px 9px; background: var(--panel2); }
.keyrow.on { border-color: var(--coral); box-shadow: 0 0 0 1px var(--coral) inset; }
.keyrow code { background: none; font-size: calc(12.5px * var(--fs)); font-weight: 700; }
.keyrow .sp { flex: 1; }
.kradio { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--muted); background: transparent; cursor: pointer; padding: 0; flex: none; }
.keyrow.on .kradio { border-color: var(--coral); background: radial-gradient(circle, var(--coral) 0 45%, transparent 50%); }
.kb { font-size: calc(10.5px * var(--fs)); font-weight: 800; padding: 3px 8px; border-radius: 999px; background: var(--soft); color: var(--muted); }
.kb.ok, .kb.use { background: var(--ok-bg); color: var(--ok-fg); }
.kb.bad { background: var(--bad-bg); color: var(--bad-fg); }
.kb.warn { background: var(--warm-bg); color: var(--warm-fg); }
.keysep { height: 1px; background: var(--line); margin: 14px 0 10px; }
.syncbox { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--grad-soft); }
.syncbox .row { margin-top: 0; }
label.btn { display: inline-flex; align-items: center; }
.seg-row { display: grid; grid-template-columns: 30px 28px 120px 1fr; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: calc(13px * var(--fs)); }
.seg-row .no { font-weight: 800; color: var(--coral); }
.seg-row .tm { color: var(--muted); font-variant-numeric: tabular-nums; }
.grp { border: 1px solid var(--line); border-radius: 12px; margin-top: 8px; padding: 8px 10px; }
.grp summary { cursor: pointer; display: flex; justify-content: space-between; font-weight: 800; list-style: none; }
.seg.small { padding: 3px; }
.seg.small button { padding: 4px 10px; font-size: calc(12px * var(--fs)); }
.voices { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; max-height: 260px; overflow: auto; padding: 2px; }
.voice { display: flex; align-items: center; gap: 8px; border: 2px solid var(--line); border-radius: 12px; padding: 6px 8px; cursor: pointer; background: var(--panel2); position: relative; }
.voice.on { border-color: var(--violet); background: var(--soft); }
.voice b { display: block; font-size: calc(13px * var(--fs)); }
.voice small { color: var(--muted); font-size: calc(11px * var(--fs)); }
.voice i { position: absolute; right: 8px; top: 6px; font-style: normal; color: var(--violet); font-weight: 900; }
.voice .play { width: 28px; height: 28px; flex: none; border-radius: 50%; border: 0; background: var(--coral); color: #fff; cursor: pointer; font-size: calc(11px * var(--fs)); }
.style canvas { display: block; width: 100%; aspect-ratio: 9 / 16; border-radius: 9px; margin-bottom: 6px; background: var(--thumb); }
.modal { position: fixed; inset: 0; background: rgba(28, 20, 51, 0.55); z-index: 40; display: grid; place-items: center; padding: 16px; }
.modalbox { width: min(520px, 100%); max-height: calc(100vh - 32px); overflow: auto; }
/* jendela "Beri nama proyekmu" */
.npbox { width: min(440px, 100%); text-align: center; padding: 28px 24px 22px; }
.npbox h3 { font-size: calc(21px * var(--fs)); margin: 8px 0 6px; }
.npbox > .muted { margin: 0 0 14px; }
.npbox .lbl, .npbox input { text-align: left; }
.npbox input { width: 100%; font-size: calc(15px * var(--fs)); padding: 12px 14px; }
.npbox .btn { margin-top: 16px; }
.npicon { display: inline-grid; place-items: center; width: 58px; height: 58px; border-radius: 18px; background: var(--grad); font-size: 28px; box-shadow: 0 12px 28px rgba(91, 108, 240, 0.4); animation: np-bob 2.6s ease-in-out infinite; }
.npmsg { margin: 8px 0 0; text-align: left; color: var(--bad-fg); font-weight: 700; font-size: calc(13px * var(--fs)); }
@keyframes np-bob { 50% { transform: translateY(-5px) rotate(-5deg); } }
.gpu { background: var(--soft); border-radius: 12px; padding: 10px 12px; font-size: calc(13px * var(--fs)); line-height: 1.5; margin-bottom: 4px; }
.gpu b { color: var(--violet-d); }
.gpu .ok { color: var(--ok-fg); font-weight: 800; }
.gpu .warn { color: var(--warm-fg); font-weight: 800; }
.spec { font-size: calc(12.5px * var(--fs)); font-weight: 700; color: var(--ink); background: var(--field); border-radius: 10px; padding: 8px 10px; margin: 10px 0 4px; }
.bar { height: 12px; background: var(--soft); border-radius: 999px; overflow: hidden; margin-top: 12px; }
.bar i { display: block; height: 100%; width: 0; background: var(--grad); transition: width 0.2s; }
#exVideo { width: 100%; max-height: 50vh; border-radius: 12px; background: #000; margin-top: 8px; }
a.btn { display: inline-block; text-align: center; text-decoration: none; }
.controls .btn { flex: none; }
/* ---- gaya video ---- */
.stylecur { display: grid; grid-template-columns: 110px 1fr; gap: 12px; align-items: start; }
.stylecur canvas { width: 110px; aspect-ratio: 9 / 16; border-radius: 12px; display: block; background: var(--thumb); }
.stylecur b { display: block; font-size: calc(16px * var(--fs)); margin: 4px 0; }
.stylebox { width: min(1180px, 100%); height: min(860px, calc(100vh - 32px)); display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.stylebox > .cardhead { padding: 14px 18px; border-bottom: 1px solid var(--line); margin: 0; }
.stbody { flex: 1; display: grid; grid-template-columns: minmax(260px, 400px) 1fr; min-height: 0; }
.stleft { padding: 18px; display: grid; place-items: center; border-right: 1px solid var(--line); min-height: 0; }
.stleft canvas { height: 100%; max-height: 640px; max-width: 100%; aspect-ratio: 9 / 16; border-radius: 18px; box-shadow: 0 14px 40px rgba(40, 20, 90, 0.2); }
.stright { padding: 16px 18px; overflow: auto; min-height: 0; }
.stright h2 { margin: 4px 0 4px; font-size: calc(26px * var(--fs)); }
.sw.big i { width: 20px; height: 20px; }
.stinfo { margin: 10px 0 12px; }
.info { border-radius: 12px; padding: 8px 10px; font-size: calc(12px * var(--fs)); background: var(--ok-bg); color: var(--ok-fg); border: 1px solid var(--ok-line); }
.info.warm { background: var(--warm-bg); color: var(--warm-fg); border-color: var(--warm-line); }
.info b { display: block; font-size: calc(13px * var(--fs)); }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs button { border: 1px solid var(--line); background: var(--panel2); padding: 7px 12px; border-radius: 999px; font-weight: 700; cursor: pointer; font-size: calc(13px * var(--fs)); }
.tabs button.on { background: var(--sel-bg); color: var(--sel-fg); border-color: var(--sel-bg); }
.tabs button small { opacity: 0.6; margin-left: 4px; }
.stgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; margin-top: 14px; }
.stcard { border: 0; background: none; padding: 0; cursor: pointer; text-align: left; }
.stcard img { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 12px; display: block; border: 3px solid transparent; background: var(--thumb); }
.stcard.on img { border-color: var(--coral); }
.stcard.used img { box-shadow: 0 0 0 2px #22c55e; }
.stcard span { display: block; font-weight: 700; font-size: calc(12.5px * var(--fs)); margin-top: 5px; }
.stcard.on span { color: var(--coral); }
.stfoot { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--line); }
.stfoot .sp { flex: 1; }
/* ---- panel kanan: tab & teks ---- */
.panel.right .tabs { margin-bottom: -4px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { border: 1px solid var(--line); background: var(--panel2); border-radius: 10px; padding: 6px 10px; cursor: pointer; font-size: calc(13px * var(--fs)); }
.grid3c { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
input[type=color] { width: 100%; height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 2px; background: var(--panel2); }
.titem { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin-top: 6px; cursor: pointer; }
.titem.on { border-color: var(--violet); background: var(--soft); }
.titem span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.titem small { color: var(--muted); }
/* ---- jalur timeline ---- */
.tracks { width: min(100%, 820px); display: flex; flex-direction: column; gap: 4px; }
.trk { display: grid; grid-template-columns: 54px 1fr; align-items: center; gap: 6px; }
.tl { font-size: calc(11px * var(--fs)); font-weight: 800; color: var(--muted); }
.lane { position: relative; height: 26px; background: var(--field); border-radius: 8px; overflow: hidden; touch-action: none; }
.blk { position: absolute; top: 3px; height: 20px; border-radius: 6px; font-size: calc(10px * var(--fs)); line-height: 20px; padding: 0 5px; white-space: nowrap; overflow: hidden; cursor: grab; user-select: none; color: #fff; }
.blk.sub { background: #7c5cf5; }
.blk.txt { background: var(--coral); }
.blk.txt.on { outline: 2px solid var(--ink); }
.blk .h { position: absolute; top: 0; bottom: 0; width: 7px; cursor: ew-resize; background: rgba(0, 0, 0, 0.18); }
.blk .h.l { left: 0; } .blk .h.r { right: 0; }
.hint.center { text-align: center; max-width: 820px; }
#stage.drag-ok { cursor: move; }
@media (max-width: 860px) { .stbody { grid-template-columns: 1fr; } .stleft { max-height: 46vh; border-right: 0; border-bottom: 1px solid var(--line); } }
/* ---- pemilih karakter ---- */
.charpick { position: relative; }
.cp-trigger { width: 100%; display: flex; align-items: center; gap: 10px; border: 2px solid var(--line); border-radius: 14px; background: var(--panel2); padding: 6px 10px; cursor: pointer; text-align: left; }
.cp-trigger.open { border-color: var(--coral); }
.cp-trigger b { display: block; font-size: calc(14px * var(--fs)); }
.cp-trigger small { color: var(--muted); font-size: calc(12px * var(--fs)); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 240px; }
.cp-trigger .caret { margin-left: auto; color: var(--muted); }
.cp-thumb { width: 44px; height: 44px; border-radius: 10px; flex: none; background: var(--thumb); display: grid; place-items: center; overflow: hidden; font-size: calc(20px * var(--fs)); color: var(--coral); }
.cp-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cp-menu { position: absolute; left: 0; top: calc(100% + 6px); width: min(560px, 92vw); max-height: 440px; overflow: auto; background: var(--panel2); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 20px 50px rgba(40, 20, 90, 0.22); z-index: 30; padding: 8px; }
.cp-sec { font-size: calc(11px * var(--fs)); font-weight: 800; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; padding: 10px 10px 4px; }
.cp-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 12px; cursor: pointer; }
.cp-item:hover { background: var(--hover); }
.cp-item.on { background: var(--mint); }
.cp-item .txt { flex: 1; min-width: 0; }
.cp-item .txt b { display: block; font-size: calc(14px * var(--fs)); }
.cp-item.on .txt b { color: var(--coral); }
.cp-item .txt small { display: block; color: var(--muted); font-size: calc(12px * var(--fs)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-item.locked .txt small { color: var(--warm-fg); }
.cp-item .demo { border: 1px solid var(--line); background: var(--panel2); border-radius: 999px; padding: 4px 12px; font-size: calc(12px * var(--fs)); font-weight: 700; cursor: pointer; flex: none; }
.cp-item .mini { flex: none; }
.cp-add { display: block; width: 100%; text-align: left; border: 0; background: var(--mint); color: var(--coral); font-weight: 800; padding: 10px 12px; border-radius: 12px; cursor: pointer; margin-top: 6px; }
/* ---- demo karakter ---- */
.demobox { width: min(420px, 100%); display: flex; flex-direction: column; gap: 10px; max-height: calc(100vh - 32px); overflow: auto; }
.cdstage { position: relative; display: grid; place-items: center; background: #111; border-radius: 16px; padding: 0; }
.cdstage canvas { height: min(52vh, 500px); aspect-ratio: 9 / 16; display: block; }
.navbtn { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--panel2); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2); font-size: calc(22px * var(--fs)); cursor: pointer; z-index: 2; }
.navbtn.l { left: 8px; } .navbtn.r { right: 8px; }
.posechips { display: flex; flex-wrap: wrap; gap: 6px; max-height: 120px; overflow: auto; }
.posechips button { border: 1px solid var(--line); background: var(--panel2); border-radius: 999px; padding: 5px 11px; font-size: calc(12.5px * var(--fs)); cursor: pointer; }
.posechips button.on { background: var(--coral); color: #fff; border-color: var(--coral); font-weight: 800; }
/* ---- character builder ---- */
.builderbox { width: min(1220px, 100%); height: min(860px, calc(100vh - 32px)); display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.builderbox > .cardhead { padding: 14px 18px; border-bottom: 1px solid var(--line); margin: 0; }
.cbbody { flex: 1; display: grid; grid-template-columns: minmax(240px, 360px) 180px 1fr; min-height: 0; }
.cbleft { background: var(--stage-bg); display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px; min-height: 0; }
.cbleft canvas { flex: 1 1 0; min-height: 0; height: 100%; width: auto; max-width: 100%; aspect-ratio: 5 / 8; display: block; }
.cbcats { border-right: 1px solid var(--line); padding: 10px; overflow: auto; background: var(--panel2); }
.cbcats button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 9px 12px; border-radius: 12px; cursor: pointer; margin-bottom: 4px; }
.cbcats button b { display: block; font-size: calc(14px * var(--fs)); }
.cbcats button small { color: var(--muted); font-size: calc(11.5px * var(--fs)); }
.cbcats button.on { background: var(--sel-bg); color: var(--sel-fg); }
.cbcats button.on small { color: var(--sel-muted); }
.cbright { padding: 14px 16px; overflow: auto; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
.cbhead { display: flex; align-items: baseline; gap: 8px; } .cbhead h3 { margin: 0; }
.optgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.opt { border: 2px solid transparent; background: var(--field); border-radius: 14px; padding: 6px; cursor: pointer; text-align: center; position: relative; }
.opt canvas { width: 100%; aspect-ratio: 1; background: var(--panel2); border-radius: 10px; display: block; }
.opt span { display: block; font-size: calc(12px * var(--fs)); margin-top: 4px; line-height: 1.2; }
.opt.on { border-color: var(--sel-bg); background: var(--panel2); }
.opt.on::after { content: '✓'; position: absolute; top: 4px; right: 6px; background: var(--sel-bg); color: var(--sel-fg); border-radius: 50%; width: 20px; height: 20px; font-size: calc(12px * var(--fs)); line-height: 20px; }
.optrow { display: flex; gap: 8px; flex-wrap: wrap; }
.optrow button { border: 2px solid var(--line); background: var(--panel2); border-radius: 12px; padding: 8px 14px; cursor: pointer; font-weight: 700; }
.optrow button.on { border-color: var(--sel-bg); background: var(--sel-bg); color: var(--sel-fg); }
.skinrow { display: flex; gap: 10px; }
.skinrow button, .swrow button { width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--panel); box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.skinrow button.on, .swrow button.on { box-shadow: 0 0 0 3px var(--ink); }
.cbcolors { background: var(--field); border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.cbcolors:empty { display: none; }
.colrow { display: grid; grid-template-columns: 110px 1fr 40px; gap: 8px; align-items: center; font-size: calc(13px * var(--fs)); font-weight: 700; }
.swrow { display: flex; flex-wrap: wrap; gap: 5px; }
.swrow button { width: 22px; height: 22px; }
.colrow input[type=color] { height: 30px; }
.cbfoot { display: flex; gap: 12px; align-items: flex-end; padding: 12px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.cbfoot .grow { flex: 1; min-width: 220px; }
.cbbtns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
@media (max-width: 900px) { .cbbody { grid-template-columns: 1fr; overflow: auto; } .cbleft { max-height: 40vh; } .cbcats { display: flex; overflow-x: auto; border-right: 0; } .cbcats button { white-space: nowrap; width: auto; } }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--sel-bg); color: var(--sel-fg); padding: 10px 16px; border-radius: 12px; font-weight: 700; z-index: 50; max-width: calc(100vw - 32px); }

@media (max-width: 980px) {
  .view.two { grid-template-columns: 1fr; padding: 14px 16px 30px; }
  .projbtn .projname { max-width: 170px; }
}
@media (max-width: 1180px) {
  .layout { grid-template-columns: 1fr 1fr; }
  .stagewrap { grid-column: 1 / -1; order: -1; }
}
@media (max-width: 720px) {
  .badge { margin-left: 0; }
  .layout { grid-template-columns: 1fr; padding: 14px 16px 30px; }
  .grid3 { grid-template-columns: 1fr 1fr; }
}

/* ---- tampilan HP ---- */
@media (max-width: 640px) {
  body { font-size: calc(15px * var(--fs)); }
  /* header ringkas: logo + Kunci AI di atas, langkah bisa digeser di bawahnya */
  .topbar { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto auto; gap: 6px; padding: 8px 12px 10px; align-items: center; }
  .brand { gap: 7px; }
  .brand .logo { width: 32px; height: 32px; }
  .brand-text b, .brand-text i { font-size: calc(13.5px * var(--fs)); }
  .steps { grid-column: 1 / -1; order: 3; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -12px; padding: 0 12px 2px; }
  .steps::-webkit-scrollbar { display: none; }
  .step { flex: none; padding: 8px 13px; }
  .keypanel { left: 12px; right: 12px; top: 54px; width: auto; }
  .view.two, .layout { padding: 12px 12px 28px; gap: 12px; }
  .card { padding: 12px 13px; }
  /* cegah zoom otomatis saat mengetik di HP */
  textarea, input[type=text], input[type=number], input[type=password], select { font-size: calc(16px * var(--fs)); }
  select.tiny { font-size: calc(14px * var(--fs)); }
  .seg button { padding: 8px 6px; }
  .grid3 { grid-template-columns: 1fr 1fr; }
  .grid3c { grid-template-columns: 1fr 1fr; }
  .sc .meta { grid-template-columns: 1fr 1fr; }
  .seg-row { grid-template-columns: 26px 24px 1fr; }
  .seg-row > :nth-child(n + 4) { grid-column: 1 / -1; }
  .voices { grid-template-columns: 1fr; max-height: 300px; }
  .ideas { grid-template-columns: 1fr; }
  .stylecur { grid-template-columns: 92px 1fr; }
  .stylecur canvas { width: 92px; }
  .nextbar .btn { width: 100%; }
  /* pratinjau video */
  .phone { padding: 6px; border-radius: 22px; width: min(100%, 280px, calc(50dvh * 9 / 16 + 12px)); }
  .phone canvas { border-radius: 17px; }
  .controls, .timeline, .tracks { width: 100%; }
  .chip { height: 40px; }
  /* jendela pop-up jadi layar penuh */
  .modal { padding: 0; place-items: stretch; }
  .modal > .card { width: 100% !important; max-width: none; height: 100dvh !important; max-height: none !important; border-radius: 0; }
  .modalbox, .demobox { overflow: auto; }
  .stbody { grid-template-rows: auto minmax(0, 1fr); }
  .stleft { height: 36dvh; max-height: none; padding: 10px; overflow: hidden; }
  .stleft canvas { height: calc(36dvh - 20px); width: auto; max-width: none; }
  .stright { padding: 12px; }
  .stright h2 { font-size: calc(22px * var(--fs)); }
  .stgrid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
  .stfoot { padding: 10px 12px; flex-wrap: wrap; }
  .cdstage canvas { height: min(58vh, 560px); }
  /* pembuat karakter: satu halaman bergulir, pratinjau tetap terlihat di atas */
  .builderbox { overflow-y: auto; display: block; }
  .builderbox > .cardhead { padding: 10px 12px; }
  .cbbody { display: block; overflow: visible; }
  .cbleft { position: sticky; top: 0; z-index: 3; height: 40dvh; max-height: none; padding: 8px; box-shadow: 0 6px 14px rgba(40, 30, 90, 0.08); }
  .cbleft canvas { flex: 1 1 0; height: auto; min-height: 0; }
  .cbcats { padding: 8px; gap: 6px; }
  .cbcats button { margin-bottom: 0; padding: 7px 11px; }
  .cbright { padding: 12px; overflow: visible; }
  .cbfoot { padding: 10px 12px; gap: 8px; }
  .cbfoot .grow { min-width: 100%; }
  .cbbtns { width: 100%; }
  .cbbtns .btn.big { flex: 1; }
  .optgrid { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
  .colrow { grid-template-columns: 1fr 40px; }
  .colrow .swrow { grid-column: 1 / -1; order: 3; }
  .cp-menu { width: calc(100vw - 24px); max-height: 60vh; }
  .cp-trigger small { max-width: 52vw; }
}

/* ---- musik latar (BGM) & posisi wajah per scene ---- */
.bgmlist { display: grid; gap: 5px; max-height: 262px; overflow: auto; margin-top: 8px; padding-right: 2px; }
.bgmitem { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--panel2); transition: border-color 0.2s ease, box-shadow 0.2s ease; }
.bgmitem.on { border-color: var(--coral); box-shadow: 0 0 0 1px var(--coral) inset; }
.bgmitem .bgmplay { width: 38px; flex: none; border: 0; border-right: 1px solid var(--line); background: var(--mint); color: var(--coral); font-weight: 900; cursor: pointer; transition: background-color 0.2s ease, color 0.2s ease; }
.bgmitem .bgmplay:hover { background: var(--coral); color: #fff; }
.bgmitem .bgmpick { flex: 1; min-width: 0; border: 0; background: none; text-align: left; padding: 6px 9px; cursor: pointer; display: flex; flex-direction: column; gap: 1px; transition: background-color 0.2s ease; }
.bgmitem .bgmpick:hover { background: var(--hover); }
.bgmpick b { font-size: calc(13px * var(--fs)); }
.bgmpick small { color: var(--muted); font-size: calc(11px * var(--fs)); line-height: 1.3; }
.sfxmain { display: flex; align-items: center; gap: 12px; padding: 6px 10px; border-radius: 10px; background: var(--field); border: 1px solid var(--line); margin-bottom: 8px; }
.sfxmain .check { margin: 0; white-space: nowrap; }
.sfxmain input[type=range] { flex: 1; min-width: 60px; }
/* pemberitahuan saat dibuka di HP & peringatan di jendela export */
.devnote { display: flex; align-items: center; gap: 10px; margin: 10px 12px 0; padding: 10px 12px; border-radius: 12px; background: var(--warm-bg); color: var(--warm-fg); border: 1px solid var(--warm-line); font-size: calc(13px * var(--fs)); line-height: 1.45; animation: view-in 0.32s var(--soft-out); }
.devnote span { flex: 1; min-width: 0; }
.devnote .btn { flex: none; }
.exwarn { margin: 6px 0 4px; padding: 8px 10px; border-radius: 10px; background: var(--warm-bg); color: var(--warm-fg); border: 1px solid var(--warm-line); font-size: calc(12.5px * var(--fs)); line-height: 1.5; }
@media (max-width: 640px) {
  /* tab kanan cukup satu baris, digeser ke samping seperti langkah di atas */
  .panel.right .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -12px -4px; padding: 0 12px 2px; }
  .panel.right .tabs::-webkit-scrollbar { display: none; }
  .panel.right .tabs button { flex: none; }
  .panel.right .bgmlist, .panel.right .sfxgrid { max-height: 50dvh; }
}
.panel.right .bgmlist { max-height: min(52vh, 520px); }
.panel.right .sfxgrid { max-height: min(46vh, 460px); }
.spkbox { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--field); border: 1px solid var(--line); }
.spkbox .lbl { margin-top: 0; }
.spkbox .hint { margin: 0 0 6px; }

/* ================= gerak & rasa hidup ================= */
:root { --spring: cubic-bezier(0.34, 1.56, 0.64, 1); --soft-out: cubic-bezier(0.22, 1, 0.36, 1); }

/* ---- logo & nama aplikasi ---- */
.brand { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.logo { display: block; flex: none; overflow: visible; transform-origin: 50% 60%; filter: drop-shadow(0 3px 7px rgba(91, 108, 240, 0.28)); transition: transform 0.35s var(--spring), filter 0.3s ease; }
.logo .lg-a, .logo .lg-play, .logo .lg-spark { transform-box: fill-box; transform-origin: center; }
.logo .lg-a { transform-origin: 50% 100%; }
.logo .lg-play { transition: fill 0.25s ease; }
.logo .lg-line { stroke-dasharray: 1; stroke-dashoffset: 0; }
.logo .lg-spark { animation: lg-twinkle 4.5s ease-in-out infinite; }   /* kilau berkedip sendiri sesekali */
.brand-text .ch { display: inline-block; }
.brand-text.split i { background: none; }
.brand-text.split i .ch { background: var(--grad); background-size: calc(var(--n) * 100%) 100%; background-position: calc(var(--k) / (var(--n) - 1) * 100%) 0; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.brand:hover .logo, .brand.pop .logo { transform: scale(1.06); filter: drop-shadow(0 5px 14px rgba(139, 61, 255, 0.5)); animation: lg-boing 0.75s var(--soft-out); }
.brand:hover .lg-a, .brand.pop .lg-a { animation: lg-hop 0.65s var(--soft-out); }
.brand:hover .lg-play, .brand.pop .lg-play { fill: #ffd23f; animation: lg-pulse 0.9s ease-in-out 0.3s infinite; }
.brand:hover .lg-spark, .brand.pop .lg-spark { animation: lg-spin 0.85s var(--soft-out); }
.brand:hover .lg-line, .brand.pop .lg-line { animation: lg-draw 0.5s var(--soft-out) both; }
.brand:hover .lg-line.l2, .brand.pop .lg-line.l2 { animation-delay: 0.14s; }
.brand:hover .ch, .brand.pop .ch { animation: ch-hop 0.55s var(--soft-out) both; animation-delay: calc(var(--i) * 36ms); }
.brand.re .logo, .brand.re .logo *, .brand.re .ch { animation: none !important; }
@keyframes lg-twinkle { 0%, 80%, 100% { transform: scale(1) rotate(0deg); } 87% { transform: scale(1.4) rotate(45deg); } 94% { transform: scale(0.85) rotate(90deg); } 99.9% { transform: scale(1) rotate(90deg); } }
@keyframes lg-boing { 0% { transform: scale(1) rotate(0deg); } 25% { transform: scale(1.2) rotate(-11deg); } 50% { transform: scale(0.97) rotate(7deg); } 74% { transform: scale(1.09) rotate(-3deg); } 100% { transform: scale(1.06) rotate(0deg); } }
@keyframes lg-hop { 0% { transform: none; } 30% { transform: translateY(-9%) scale(0.95, 1.06); } 62% { transform: translateY(0) scale(1.06, 0.93); } 100% { transform: none; } }
@keyframes lg-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.28); } }
@keyframes lg-spin { 0% { transform: scale(1) rotate(0deg); } 45% { transform: scale(1.7) rotate(120deg); } 100% { transform: scale(1) rotate(180deg); } }
@keyframes lg-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes ch-hop { 0% { transform: none; } 35% { transform: translateY(-6px) scale(1.14) rotate(-5deg); color: var(--coral); filter: brightness(1.25); } 70% { transform: translateY(1px); } 100% { transform: none; } }

/* ---- semua yang bisa diklik: halus saat disentuh, membal saat ditekan ---- */
.btn, .themebtn, .projbtn, .step, .mini, .round, .navbtn, .cp-add, .cp-trigger,
.seg button, .tabs button, .chips button, .sfxcats button, .posechips button, .optrow button, .pmact button, .cbcats button,
.cp-item .demo, .voice .play, .sfxchip button, .skinrow button, .swrow button, .sfxitem .sfxadd,
.style, .idea, .subcard, .thsty, .opt, .voice, .titem, .chip, .pmrow, .cp-item, .stcard img {
  transition: transform 0.22s var(--spring), box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, filter 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn, .step, .round { position: relative; overflow: hidden; }
.btn:not(.ghost)::before { content: ''; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 34%, rgba(255, 255, 255, 0.4) 50%, transparent 66%); transform: translateX(-130%); pointer-events: none; }   /* kilau menyapu */
.projbtn .pic, .projbtn .caret { display: inline-block; transition: transform 0.25s var(--spring); }
.themebtn.off { opacity: 0.6; }
.step.active { background-size: 220% 100%; animation: grad-flow 6s ease-in-out infinite alternate; }   /* gradasi mengalir pelan */
@keyframes grad-flow { from { background-position: 0% 0; } to { background-position: 100% 0; } }
@media (hover: hover) {
  .btn:not(:disabled):hover { transform: translateY(-2px); box-shadow: 0 9px 22px rgba(91, 108, 240, 0.36); }
  .btn.ghost:not(:disabled):hover { box-shadow: 0 5px 14px rgba(91, 108, 240, 0.16); }
  .btn:not(.ghost):not(:disabled):hover::before { transform: translateX(130%); transition: transform 0.65s var(--soft-out); }
  .round:hover { transform: translateY(-2px) scale(1.07); }
  .round.small:hover { background: var(--ghost-hover); }
  .themebtn:hover { transform: rotate(-14deg) scale(1.14); box-shadow: 0 5px 14px rgba(124, 58, 237, 0.28); }
  .projbtn:hover { transform: translateY(-1px); border-color: var(--violet); box-shadow: 0 5px 14px rgba(124, 58, 237, 0.18); }
  .projbtn:hover .pic { transform: rotate(-12deg) scale(1.2); }
  .projbtn:hover .caret { transform: translateY(2px); }
  .step:not(.active):hover { transform: translateY(-2px); background: var(--ghost-hover); color: var(--violet-d); }
  .step.active:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(91, 108, 240, 0.42); }
  :is(.mini, .seg button, .tabs button, .chips button, .sfxcats button, .posechips button, .optrow button, .pmact button, .cbcats button, .cp-item .demo):not(.on):hover { transform: translateY(-1px); border-color: var(--violet); color: var(--violet-d); }
  :is(.style, .idea, .subcard, .thsty, .opt, .voice, .titem, .cp-trigger):hover { transform: translateY(-3px); }
  :is(.style, .idea, .subcard, .thsty, .voice, .titem, .cp-trigger):not(.on):hover { border-color: var(--violet); box-shadow: 0 10px 24px rgba(60, 30, 120, 0.16); }
  .opt:not(.on):hover { border-color: var(--violet); }
  .stcard:hover img { transform: translateY(-3px) scale(1.02); box-shadow: 0 10px 24px rgba(60, 30, 120, 0.22); }
  .chip:hover { transform: translateY(-3px); filter: brightness(1.07); }
  .pmrow:hover, .cp-item:hover { transform: translateX(3px); }
  .navbtn:hover { transform: translateY(-50%) scale(1.14); }
  .linkbtn:hover { text-decoration: underline; }
  .cp-add:hover { transform: translateY(-1px); filter: brightness(1.05); }
  :is(.voice .play, .sfxchip button, .skinrow button, .swrow button):hover { transform: scale(1.16); }
  .sfxitem .sfxadd:hover { background: var(--coral); color: #fff; }
}
:is(.btn, .round, .themebtn, .projbtn, .step, .mini, .cp-add, .cp-trigger, .seg button, .tabs button, .chips button, .sfxcats button, .posechips button, .optrow button, .pmact button, .cbcats button, .cp-item .demo, .voice .play, .sfxchip button, .skinrow button, .swrow button, .style, .idea, .subcard, .thsty, .opt, .voice, .titem, .chip):not(:disabled):not(.x):active { transform: scale(0.95); transition-duration: 0.07s; }
.navbtn:active { transform: translateY(-50%) scale(0.92); transition-duration: 0.07s; }
.rip { position: absolute; border-radius: 50%; background: rgba(255, 255, 255, 0.45); transform: scale(0); pointer-events: none; animation: rip 0.55s ease-out forwards; }
.btn.ghost .rip, .step:not(.active) .rip, .round.small .rip { background: rgba(124, 58, 237, 0.24); }
@keyframes rip { to { transform: scale(1); opacity: 0; } }
:is(button, summary, a, .btn):focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }

/* ---- panduan singkat (tur) & tombol "?" ---- */
.themebtn { position: relative; }
.themebtn.wait::after { content: ''; position: absolute; top: -2px; right: -2px; width: 10px; height: 10px; border-radius: 50%; background: var(--lemon); box-shadow: 0 0 0 2px var(--panel); }   /* suara menunggu klik pertama */
.helpbtn { font-weight: 900; color: var(--violet-d); position: relative; }
.helpbtn.new::after { content: ''; position: absolute; top: -2px; right: -2px; width: 11px; height: 11px; border-radius: 50%; background: #ff4d6d; box-shadow: 0 0 0 2px var(--panel); animation: help-ping 1.6s ease-in-out infinite; }
@keyframes help-ping { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.35); } }
.tour { position: fixed; inset: 0; z-index: 60; }
.tour-block { position: absolute; inset: 0; }
.tour-hole { position: fixed; border-radius: 14px; box-shadow: 0 0 0 9999px rgba(8, 6, 22, 0.74), 0 0 0 3px var(--coral), 0 0 26px 4px rgba(18, 201, 138, 0.55); pointer-events: none; transition: left 0.35s var(--soft-out), top 0.35s var(--soft-out), width 0.35s var(--soft-out), height 0.35s var(--soft-out), opacity 0.25s ease; }
.tour-tip { position: fixed; width: min(360px, calc(100vw - 20px)); padding: 16px 18px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45); border: 2px solid transparent; background: linear-gradient(var(--panel), var(--panel)) padding-box, var(--grad) border-box; transition: left 0.35s var(--soft-out), top 0.35s var(--soft-out); }
.tour-tip.pop { animation: modal-in 0.3s var(--spring); }
.tour-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.tour-count { font-size: calc(12px * var(--fs)); font-weight: 800; color: var(--coral-d); }
:root[data-theme="dark"] .tour-count { color: var(--coral); }
.tour-tip h3 { margin: 0 0 6px; font-size: calc(17px * var(--fs)); font-weight: 800; }
.tour-tip p { margin: 0; color: var(--muted); font-size: calc(14px * var(--fs)); line-height: 1.55; }
.tour-tip p b { color: var(--ink); }
.tour-dots { display: flex; gap: 5px; margin: 14px 0 12px; }
.tour-dots i { flex: 1; height: 4px; border-radius: 2px; background: var(--line); transition: background-color 0.25s ease; }
.tour-dots i.on { background: var(--grad); }
.tour-btns { display: flex; justify-content: space-between; gap: 8px; }
.tour-btns .btn { padding: 8px 14px; font-size: calc(13.5px * var(--fs)); }
@media (max-width: 640px) {
  .topbar { grid-template-columns: minmax(0, 1fr) auto auto auto auto auto; gap: 5px; }
  .topbar .themebtn { width: 32px; height: 32px; font-size: calc(15px * var(--fs)); }
  .topbar .btn.small { margin-left: 0; padding: 6px 8px; }
}

/* ---- akun, jendela masuk, dan jendela paket ---- */
.acctbtn.in { background: var(--grad); color: #fff; font-weight: 800; border-color: transparent; }
.aclogin { width: min(420px, 100%); text-align: center; position: relative; padding: 28px 24px 22px; }
.aclogin h3 { font-size: calc(20px * var(--fs)); margin: 4px 26px 8px; }
.acx { position: absolute; top: 12px; right: 12px; }
.acgoogle { display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.acg { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #fff; color: #4285f4; font-weight: 900; font-family: Arial, sans-serif; font-size: 15px; flex: none; }
.acnote { text-align: left; background: var(--field); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; margin-top: 14px; line-height: 1.5; }
/* halaman masuk yang menutupi studio sampai login */
html.ca-gate, html.ca-gate body { overflow: hidden; }
html.ca-gate body::before { content: ''; position: fixed; inset: 0; z-index: 69; background: var(--bg); }
html.ca-gate .toast { z-index: 80; }
.acgate { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 16px; overflow: auto; background: radial-gradient(ellipse at 20% 0%, rgba(18, 201, 138, 0.18), transparent 55%), radial-gradient(ellipse at 90% 100%, rgba(139, 61, 255, 0.2), transparent 55%), var(--bg); }
.acgate[hidden] { display: none; }
.acgate-box { width: min(430px, 100%); text-align: center; padding: 30px 26px 22px; box-shadow: 0 30px 80px rgba(40, 20, 90, 0.22); animation: drop-in 0.35s var(--soft-out); }
.acgate-logo { width: 64px; height: 64px; display: block; margin: 0 auto 10px; filter: drop-shadow(0 8px 18px rgba(91, 108, 240, 0.35)); }
.acgate-box h2 { margin: 0 0 6px; font-size: calc(24px * var(--fs)); }
.acgate-box > .muted { margin: 0 0 16px; }
.acgate-msg { background: var(--warm-bg); color: var(--warm-fg); border: 1px solid var(--warm-line); border-radius: 10px; padding: 8px 10px; margin: 0 0 14px; font-weight: 700; font-size: calc(13px * var(--fs)); }
.acgbtn { display: flex; justify-content: center; align-items: center; min-height: 44px; }
.acgbtn[hidden] { display: none; }
.acgwait { color: var(--muted); font-weight: 700; font-size: calc(13.5px * var(--fs)); }
.acgate-list { list-style: none; padding: 0; margin: 16px 0 0; text-align: left; display: grid; gap: 7px; font-size: calc(13.5px * var(--fs)); }
.acgate-list li { padding-left: 26px; position: relative; line-height: 1.45; }
.acgate-list li::before { content: '✓'; position: absolute; left: 0; top: 0; width: 18px; height: 18px; border-radius: 50%; background: var(--grad); color: #fff; font-size: 11px; font-weight: 900; display: grid; place-items: center; }
.acgate-back { display: inline-block; margin-top: 14px; color: var(--muted); font-weight: 700; font-size: calc(13px * var(--fs)); text-decoration: none; }
.acgate-back:hover { color: var(--ink); }
.acplans { width: min(520px, 100%); }
.acwhy { background: var(--warm-bg); color: var(--warm-fg); border: 1px solid var(--warm-line); border-radius: 10px; padding: 8px 10px; margin: 0 0 10px; font-weight: 700; font-size: calc(13px * var(--fs)); }
.acstat { display: flex; justify-content: space-between; align-items: baseline; gap: 4px 10px; flex-wrap: wrap; padding: 9px 12px; border-radius: 10px; background: var(--soft); font-size: calc(13px * var(--fs)); }
.acstat span { color: var(--muted); font-weight: 700; }
.acmail { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--mint); border: 1px solid var(--ok-line); font-size: calc(13px * var(--fs)); line-height: 1.5; }
.acmailrow { display: flex; gap: 8px; align-items: center; margin: 6px 0 4px; }
.acmailrow code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 6px 9px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; font-weight: 700; }
.acmail small { color: var(--muted); }
.aclist { display: grid; gap: 9px; margin-top: 14px; }
.acplan { position: relative; display: flex; align-items: center; gap: 10px; text-align: left; border: 2px solid var(--line); background: var(--panel2); border-radius: 14px; padding: 10px 12px; cursor: pointer; transition: transform 0.22s var(--spring), border-color 0.2s ease, box-shadow 0.2s ease; }
.acplan:hover:not(:disabled) { border-color: var(--violet); transform: translateY(-2px); box-shadow: 0 10px 24px rgba(60, 30, 120, 0.16); }
.acplan.best { border-color: transparent; background: linear-gradient(var(--panel2), var(--panel2)) padding-box, var(--grad) border-box; }
.acplan:disabled { cursor: not-allowed; opacity: 0.8; }
.acplan-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.acplan-name b { font-size: calc(15px * var(--fs)); }
.acplan-name small { color: var(--muted); font-size: calc(12px * var(--fs)); line-height: 1.35; }
.acplan-price { text-align: right; white-space: nowrap; }
.acplan-price s { display: block; color: var(--muted); font-size: calc(12px * var(--fs)); }
.acplan-price b { font-size: calc(18px * var(--fs)); }
.acplan em { position: absolute; top: -9px; right: 10px; font-style: normal; font-size: 11px; font-weight: 800; background: var(--lemon); color: #3a2a00; padding: 2px 8px; border-radius: 999px; }
.acwait { display: flex; gap: 8px; align-items: center; color: var(--ok-fg); font-weight: 700; font-size: calc(13px * var(--fs)); margin: 12px 0 0; }
.acwait i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--ok-fg); border-top-color: transparent; animation: ac-spin 0.8s linear infinite; flex: none; }
@keyframes ac-spin { to { transform: rotate(360deg); } }
.acfoot { justify-content: space-between; }
.acfoot a.btn { text-decoration: none; }
.acmenu { position: fixed; z-index: 45; width: min(280px, calc(100vw - 16px)); display: grid; gap: 8px; padding: 12px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3); animation: drop-in 0.2s var(--soft-out); }
.acmenu-mail { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acmenu-stat { color: var(--muted); font-size: calc(12.5px * var(--fs)); line-height: 1.4; }
.acmenu .btn.full { margin-top: 0; }
@media (max-width: 640px) {
  .topbar { grid-template-columns: minmax(0, 1fr) repeat(6, auto); }
  .topbar:has(#btnAcct:not([hidden])) .brand-text { display: none; }   /* beri tempat untuk tombol akun */
}

/* ---- jendela, menu, dan pesan muncul dengan halus ---- */
.toast { animation: toast-in 0.3s var(--spring); }
.keypanel, .projmenu, .cp-menu { animation: drop-in 0.2s var(--soft-out); }
.modal { animation: fade-in 0.18s ease; }
.modal:not(.side) > .card { animation: modal-in 0.28s var(--spring); }
.modal.side > .card { animation: side-in 0.3s var(--soft-out); }
.view { animation: view-in 0.32s var(--soft-out); }
@keyframes toast-in { from { opacity: 0; transform: translateX(-50%) translateY(14px) scale(0.94); } }
@keyframes drop-in { from { opacity: 0; transform: translateY(-8px) scale(0.97); } }
/* tanda "klik untuk menyalakan suara" di bawah lonceng */
.sndhint { position: fixed; z-index: 55; border: 0; cursor: pointer; font: inherit; font-weight: 700; font-size: calc(12.5px * var(--fs)); color: var(--sel-fg); background: var(--sel-bg); padding: 8px 12px; border-radius: 10px; box-shadow: 0 10px 26px rgba(20, 10, 60, 0.28); white-space: nowrap; animation: drop-in 0.3s var(--soft-out), snd-nudge 2.4s 1s ease-in-out infinite; transition: opacity 0.25s, transform 0.25s; }
.sndhint::before { content: ''; position: absolute; top: -5px; left: var(--ax, 50%); width: 10px; height: 10px; background: inherit; transform: translateX(-50%) rotate(45deg); border-radius: 2px; }
.sndhint.bye { opacity: 0; transform: translateY(-6px); pointer-events: none; }
@keyframes snd-nudge { 0%, 70%, 100% { transform: none; } 80% { transform: translateY(-3px); } 90% { transform: translateY(1px); } }
@media (prefers-reduced-motion: reduce) { .sndhint { animation: none; } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(16px) scale(0.96); } }
@keyframes side-in { from { opacity: 0; transform: translateX(48px); } }
@keyframes view-in { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001s !important; animation-iteration-count: 1 !important; transition-duration: 0.001s !important; }
}
