/* Mizyan Konten: tema terang biru-indigo */
:root {
  color-scheme: light;
  --blue: #2563eb; --indigo: #4f46e5; --sky: #38bdf8;
  --ink: #0f1b3d; --muted: #5b6b8f; --faint: #8794b3;
  --bg: #f4f8ff; --panel: #ffffff; --line: #d8e3f6; --ice: #eaf1ff;
  --ok: #0f9d6b; --bad: #d63a4f; --warn: #b7791f;
  --grad: linear-gradient(135deg, #2563eb, #4f46e5);
  --radius: 16px;
  --shadow: 0 10px 30px -14px rgba(37, 60, 140, .35);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { min-height: 100vh; font: 15px/1.55 "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif; color: var(--ink); background: var(--bg); overflow-x: hidden; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
a { color: var(--blue); }
.muted { color: var(--muted); } .tiny { font-size: 12.5px; } .center { text-align: center; }
.spacer { flex: 1; }

.bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; background-image: radial-gradient(rgba(37, 99, 235, .09) 1px, transparent 1px); background-size: 22px 22px; }
.bg i { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .5; }
.bg .b1 { width: 55vw; height: 45vw; left: -15vw; top: -15vw; background: radial-gradient(circle, rgba(56, 189, 248, .55), transparent 65%); }
.bg .b2 { width: 50vw; height: 45vw; right: -15vw; top: 25vh; background: radial-gradient(circle, rgba(79, 70, 229, .35), transparent 65%); }
#loginView, #appView { position: relative; z-index: 1; }

/* ---------- Komponen dasar ---------- */
.mark { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 18px; background: var(--grad); color: #fff; font: 800 34px/1 "Segoe UI", sans-serif; box-shadow: 0 12px 28px -10px rgba(37, 99, 235, .7); }
.mark.sm { width: 32px; height: 32px; border-radius: 10px; font-size: 18px; box-shadow: none; }
.btn { appearance: none; border: 1px solid var(--line); background: #fff; color: var(--ink); font: inherit; font-weight: 600; padding: 10px 16px; border-radius: 12px; cursor: pointer; transition: transform .15s, box-shadow .15s, background .15s; }
.btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 8px 18px -10px rgba(37, 60, 140, .5); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { color: #fff; border: 0; background: var(--grad); box-shadow: 0 10px 24px -12px rgba(37, 99, 235, .8); }
.btn.soft { background: var(--ice); color: var(--blue); border-color: transparent; }
.btn.ghost { background: transparent; }
.btn.small { padding: 6px 12px; font-size: 13px; border-radius: 10px; }
.btn.wide { width: 100%; }
.btn.danger { color: var(--bad); }
.link { background: none; border: 0; color: var(--blue); font: inherit; font-size: 13px; cursor: pointer; justify-self: center; padding: 4px; }
input, select, textarea { width: 100%; font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; outline: none; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(37, 99, 235, .12); }
textarea { resize: vertical; line-height: 1.55; }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--blue); flex: none; padding: 0; }
input[type="range"] { padding: 0; accent-color: var(--blue); }
label { display: grid; gap: 5px; font-weight: 600; font-size: 13.5px; }
label.check { display: flex; align-items: center; gap: 10px; font-weight: 600; }
label.inline { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
label.inline select { width: auto; }
label .muted { font-weight: 400; }
.row { display: flex; align-items: center; } .gap { gap: 10px; } .wrapx { flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.msg { margin: 0; padding: 9px 12px; border-radius: 10px; font-size: 13.5px; }
.msg.bad { background: #fdecef; color: var(--bad); } .msg.ok { background: #e6f7f0; color: var(--ok); } .msg.warn { background: #fff6e0; color: var(--warn); }
.pill { font-size: 12.5px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--ice); color: var(--blue); }
.pill.low { background: #fff1dc; color: var(--warn); }
.seg { display: inline-flex; flex-wrap: wrap; padding: 3px; gap: 3px; border-radius: 12px; background: var(--ice); }
.seg button { border: 0; background: transparent; font: inherit; font-weight: 600; font-size: 13px; color: var(--muted); padding: 7px 12px; border-radius: 9px; cursor: pointer; }
.seg button.on { background: #fff; color: var(--blue); box-shadow: 0 2px 8px -3px rgba(37, 60, 140, .4); }

/* ---------- Masuk ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: min(420px, 100%); display: grid; gap: 12px; padding: 30px 26px 22px; background: rgba(255, 255, 255, .92); backdrop-filter: blur(14px); border: 1.5px solid transparent; border-radius: 24px;
  background-image: linear-gradient(#fff, #fff), conic-gradient(from var(--a, 0deg), #2563eb, #38bdf8, #4f46e5, #2563eb);
  background-origin: border-box; background-clip: padding-box, border-box; box-shadow: 0 30px 70px -30px rgba(37, 60, 140, .5); animation: spin 8s linear infinite; }
@property --a { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
@keyframes spin { to { --a: 360deg; } }
.login-card .mark { justify-self: center; }
.eyebrow { margin: 0; text-align: center; font: 700 11px/1 ui-monospace, Menlo, monospace; letter-spacing: .22em; color: var(--blue); }
.login-card h1 { text-align: center; font-size: 27px; line-height: 1.15; }
.login-card h1 em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.move { display: grid; gap: 10px; padding: 12px; border-radius: 14px; background: var(--ice); }
.move p { margin: 0; font-size: 13.5px; }

/* ---------- Aplikasi ---------- */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 10px 18px; background: rgba(255, 255, 255, .85); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-size: 16px; }
.warn { margin: 10px 18px 0; padding: 10px 14px; border-radius: 12px; background: #fff6e0; color: var(--warn); font-size: 13.5px; }
.stepper { display: flex; align-items: center; gap: 6px; max-width: 900px; margin: 18px auto 6px; padding: 0 14px; }
.stepper button { flex: none; display: flex; align-items: center; gap: 8px; padding: 8px 14px 8px 8px; border: 1px solid var(--line); background: #fff; border-radius: 14px; font: inherit; font-weight: 700; font-size: 13.5px; color: var(--muted); cursor: pointer; }
.stepper button b { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--ice); color: var(--blue); font-size: 13px; }
.stepper button.active { color: #fff; background: var(--grad); border-color: transparent; box-shadow: 0 10px 22px -12px rgba(37, 99, 235, .9); }
.stepper button.active b { background: rgba(255, 255, 255, .25); color: #fff; }
.stepper button.done b { background: #d9f3e8; color: var(--ok); }
.stepper button:disabled { opacity: .5; cursor: not-allowed; }
.stepper .line { flex: 1; height: 2px; min-width: 8px; background: var(--line); border-radius: 2px; }
.wrap { max-width: 900px; margin: 0 auto; padding: 8px 14px 60px; }
.panel { display: grid; gap: 14px; animation: rise .4s both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.panel > h2 { font-size: 21px; margin: 10px 0 0; }
.card { display: grid; gap: 12px; padding: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.card > h3 { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.card > h3 > b { display: grid; place-items: center; width: 24px; height: 24px; flex: none; border-radius: 50%; background: var(--grad); color: #fff; font-size: 12.5px; }
.card p { margin: 0; }
.actions { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.actions .btn:only-child { margin-left: auto; }

.styles { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.style { display: grid; gap: 6px; padding: 8px; border: 1.5px solid var(--line); border-radius: 14px; background: #fff; font: inherit; font-weight: 700; font-size: 13px; color: var(--ink); cursor: pointer; text-align: left; }
.style .sw { height: 54px; border-radius: 10px; }
.style[aria-pressed="true"] { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, .14); }
.aibox { display: grid; gap: 10px; padding: 12px; border-radius: 14px; background: var(--ice); }
.drop { display: grid; justify-items: center; gap: 4px; padding: 26px 16px; border: 2px dashed #a9c0f0; border-radius: 16px; background: linear-gradient(180deg, #f7faff, #eef3ff); cursor: pointer; text-align: center; transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--blue); background: #e9f0ff; }
.drop-icon { font-size: 28px; }
.drop.has { border-style: solid; border-color: #9fd9c1; background: #f1fbf6; }

.scene-list { display: grid; gap: 8px; }
.scene-row { display: grid; grid-template-columns: 34px 92px minmax(0, 1fr); gap: 10px; align-items: start; padding: 10px 12px; background: #fff; border: 1px solid var(--line); border-radius: 12px; font-size: 13.5px; }
.scene-row b { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--ice); color: var(--blue); font-size: 12.5px; }
.scene-row .tm { font: 600 12px ui-monospace, Menlo, monospace; color: var(--muted); padding-top: 5px; }
#wave { width: 100%; height: 120px; border-radius: 12px; background: #f7faff; border: 1px solid var(--line); }

.progress { height: 10px; border-radius: 999px; background: var(--ice); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #2563eb, #38bdf8, #4f46e5); background-size: 200% 100%; animation: flow 2s linear infinite; transition: width .3s; }
@keyframes flow { to { background-position: -200% 0; } }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.sc { display: grid; gap: 8px; padding: 10px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); min-width: 0; }
.sc .thumb { position: relative; display: grid; place-items: center; width: 100%; border-radius: 10px; overflow: hidden; background: linear-gradient(135deg, #dbe7ff, #cfd2ff); color: #6b7bb0; font-weight: 700; font-size: 13px; }
.sc .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sc .thumb .st { position: absolute; left: 8px; bottom: 8px; padding: 3px 8px; border-radius: 999px; background: rgba(255, 255, 255, .92); font-size: 11.5px; color: var(--ink); }
.sc .thumb .st.err { color: var(--bad); } .sc .thumb .st.busy { color: var(--blue); }
.sc .meta { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); font-weight: 600; }
.sc .narr { font-size: 13px; line-height: 1.45; max-height: 4.4em; overflow: auto; color: var(--ink); }
.sc details summary { cursor: pointer; font-size: 12.5px; color: var(--blue); font-weight: 600; }
.sc textarea { font-size: 12.5px; margin-top: 6px; }
.sc .acts { display: flex; gap: 6px; flex-wrap: wrap; }
.sc .err-t { font-size: 12px; color: var(--bad); }

.split { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.player { display: grid; place-items: center; padding: 6px; border-radius: 12px; background: #0b1230; }
.player canvas { max-width: 100%; max-height: 56vh; border-radius: 6px; background: #000; }
.card > h3:not(:first-child) { margin-top: 6px; }

.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(15, 27, 61, .45); }
.sheet { width: min(560px, 100%); max-height: 80vh; overflow: auto; display: grid; gap: 12px; padding: 18px; background: #fff; border-radius: 18px; }
.hist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.hist li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.hist li b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist li.cur { border-color: var(--blue); background: var(--ice); }

.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 60; max-width: min(92vw, 520px); padding: 12px 16px; border-radius: 14px; background: var(--ink); color: #fff; font-size: 14px; box-shadow: 0 16px 40px -14px rgba(0, 0, 0, .6); }
.toast.bad { background: #b3263a; }

@media (max-width: 760px) {
  .split { grid-template-columns: 1fr; }
  .grid3 { grid-template-columns: 1fr; }
  .stepper button span { display: none; }
  .stepper button { padding: 8px; }
  .scene-row { grid-template-columns: 30px minmax(0, 1fr); } .scene-row .tm { grid-column: 2; padding-top: 0; }
}
@media (prefers-reduced-motion: reduce) { .login-card, .panel, .progress i { animation: none !important; } }
