/* =========================================================
   MOTION LAB — style.css
   Design system: Dark (OLED) creative-tool.
   - Token warna semantik di :root (jangan pakai hex langsung di komponen)
   - Skala spasi 4/8px, radius & elevasi konsisten
   - MOBILE-FIRST → @media 700px (tablet) → @media 1024px (desktop)
   ========================================================= */

:root {
  /* Permukaan */
  --bg: #0a0b10;
  --surface: #12141c;
  --surface-2: #181b25;
  --surface-3: #20242f;
  --border: rgba(255, 255, 255, .07);
  --border-strong: rgba(255, 255, 255, .13);

  /* Teks (kontras ≥ 4.5:1 di atas --surface) */
  --text: #f1f3f9;
  --text-2: #b4bacb;
  --muted: #8b92a6;

  /* Brand & status */
  --primary: #2dd4bf;
  --primary-2: #38bdf8;
  --primary-soft: rgba(45, 212, 191, .14);
  --on-primary: #042f2e;
  --accent: #22d3ee;
  --success: #34d399;
  --success-soft: rgba(52, 211, 153, .12);
  --warning: #fbbf24;
  --warning-soft: rgba(251, 191, 36, .12);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, .12);
  --ring: #5eead4;
  --grad: linear-gradient(135deg, var(--primary), var(--primary-2));

  /* Bentuk & bayangan */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-2: 0 8px 24px rgba(0, 0, 0, .35);
  --shadow-3: 0 24px 64px rgba(0, 0, 0, .6);

  /* Gerak */
  --ease: cubic-bezier(.2, .8, .2, 1);
  --t-fast: 120ms;
  --t-med: 220ms;

  /* Layout */
  --top-h: 60px;
  --nav-h: 68px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --gutter: 16px;

  /* Lapisan z-index */
  --z-sticky: 20;
  --z-nav: 30;
  --z-float: 40;
  --z-toast: 60;

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
:root { color-scheme: dark; } /* tampilan sengaja gelap (satu tema) */
body {
  min-height: 100dvh;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(45, 212, 191, .10), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(56, 189, 248, .06), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
code { font-family: var(--mono); font-size: .88em; color: #99f6e4; background: var(--primary-soft); padding: 1px 5px; border-radius: 5px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
[hidden] { display: none !important; }

.i { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Focus yang jelas untuk keyboard */
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--surface-3); padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: var(--z-sticky);
  height: var(--top-h);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 var(--gutter);
  background: rgba(10, 11, 16, .78);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; gap: 10px; align-items: center; min-width: 0; }
.logo {
  width: 36px; height: 36px; border-radius: 11px;
  display: grid; place-items: center;
  background: var(--grad); color: #fff;
  box-shadow: 0 6px 20px rgba(45, 212, 191, .35);
}
.logo .i { width: 16px; height: 16px; margin-left: 2px; }
.brand-text strong { display: block; font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.brand-text small { display: block; color: var(--muted); font-size: 12px; margin-top: -2px; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

.chip-status {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 12px; border-radius: 99px;
  font-size: 12px; font-weight: 600; color: var(--muted);
  background: var(--surface-2); border: 1px solid var(--border);
  white-space: nowrap;
}
.chip-status .i { width: 15px; height: 15px; }
.chip-status.good { color: var(--success); border-color: rgba(52, 211, 153, .3); background: var(--success-soft); }
.chip-status.bad { color: var(--warning); border-color: rgba(251, 191, 36, .3); background: var(--warning-soft); }

.term-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 10px 0 12px; border-radius: 99px;
  background: var(--surface-2); border: 1px solid var(--border-strong);
  font-size: 13px; font-weight: 600; color: var(--text);
  transition: background var(--t-fast), border-color var(--t-fast);
}
.term-toggle:hover { background: var(--surface-3); }
.mini-switch { width: 30px; height: 18px; border-radius: 99px; background: var(--surface-3); position: relative; transition: background var(--t-med) var(--ease); }
.mini-switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); transition: transform var(--t-med) var(--ease), background var(--t-med); }
.term-toggle[aria-pressed="true"] .mini-switch { background: var(--primary); }
.term-toggle[aria-pressed="true"] .mini-switch::after { transform: translateX(12px); background: #fff; }

/* ---------- Layout ---------- */
.layout { padding: var(--gutter) var(--gutter) calc(var(--nav-h) + var(--safe-b) + 24px); }
.panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, .02), transparent 120px), var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 16px;
  display: none;           /* mobile: hanya panel tab aktif */
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  box-shadow: var(--shadow-1);
}
/* Visibilitas panel diatur oleh blok LAYOUT STUDIO di akhir file */
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 40px; }
.panel-head h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; font-weight: 700; letter-spacing: -.005em; }
.panel-head h2 .i { color: var(--primary); }
.head-actions { display: flex; align-items: center; gap: 6px; }
.hint { margin: 0; color: var(--muted); font-size: 13px; }
.hint.warn { color: var(--warning); }

/* ---------- Tombol ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px;
  border-radius: var(--r-md); border: 1px solid var(--border-strong);
  background: var(--surface-2);
  font-size: 14px; font-weight: 600; white-space: nowrap;
  transition: background var(--t-fast), border-color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
}
.btn:hover { background: var(--surface-3); border-color: rgba(255, 255, 255, .2); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--grad); border-color: transparent; color: var(--on-primary); box-shadow: 0 6px 20px rgba(45, 212, 191, .3); }
.btn.primary:hover { filter: brightness(1.08); box-shadow: 0 8px 26px rgba(45, 212, 191, .42); }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); border-color: rgba(248, 113, 113, .35); }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn.big { width: 100%; min-height: 52px; font-size: 15px; border-radius: var(--r-lg); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.icon-btn {
  width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: var(--r-md); border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text-2);
  transition: background var(--t-fast), color var(--t-fast);
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }

/* ---------- Form ---------- */
.input, .select-wrap select {
  width: 100%; min-height: 44px;
  background: var(--surface-2); border: 1px solid var(--border-strong);
  border-radius: var(--r-md); padding: 0 14px;
  font-size: 16px; /* ≥16px: HP tidak auto-zoom */
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.input:focus, .select-wrap select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.select-wrap { position: relative; display: flex; align-items: center; }
.select-wrap select { appearance: none; padding-right: 38px; cursor: pointer; }
.select-wrap .chev { position: absolute; right: 12px; pointer-events: none; color: var(--muted); width: 16px; height: 16px; }
.select-wrap.compact { gap: 0; }
.select-wrap.compact .i { position: absolute; left: 11px; width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.select-wrap.compact select { min-height: 40px; width: 132px; padding: 0 10px 0 34px; font-size: 13px; font-weight: 600; }

.label { font-size: 13px; color: var(--text-2); font-weight: 600; }
.row-label { display: flex; justify-content: space-between; align-items: baseline; }
.val { color: var(--text); font-size: 13px; font-weight: 600; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field.inline { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }

/* Range slider kustom */
input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 28px; background: transparent; cursor: pointer;
  --pct: 50%;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 6px; border-radius: 99px;
  background: linear-gradient(90deg, var(--primary) 0 var(--pct), var(--surface-3) var(--pct) 100%);
}
input[type="range"]::-moz-range-track { height: 6px; border-radius: 99px; background: var(--surface-3); }
input[type="range"]::-moz-range-progress { height: 6px; border-radius: 99px; background: var(--primary); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 20px; height: 20px; margin-top: -7px;
  border-radius: 50%; background: #fff; border: 0;
  box-shadow: 0 0 0 4px rgba(45, 212, 191, .35), 0 2px 6px rgba(0, 0, 0, .4);
  transition: transform var(--t-fast);
}
input[type="range"]::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 0 0 4px rgba(45, 212, 191, .35); }
input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.15); }
input[type="range"]:disabled { opacity: .5; cursor: not-allowed; }

/* Switch */
.switch { display: inline-flex; align-items: center; gap: 10px; min-height: 36px; font-size: 14px; color: var(--text-2); cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 40px; height: 24px; border-radius: 99px; background: var(--surface-3); border: 1px solid var(--border-strong); position: relative; flex-shrink: 0; transition: background var(--t-med) var(--ease); }
.switch .track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--muted); transition: transform var(--t-med) var(--ease), background var(--t-med); }
.switch input:checked + .track { background: var(--primary); border-color: transparent; }
.switch input:checked + .track::after { transform: translateX(16px); background: #fff; }
.switch input:focus-visible + .track { outline: 2px solid var(--ring); outline-offset: 2px; }

/* Warna */
.color-pick { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-2); cursor: pointer; }
.color-pick input { width: 44px; height: 44px; border: 1px solid var(--border-strong); border-radius: var(--r-md); background: var(--surface-2); padding: 4px; cursor: pointer; }
.color-pick input::-webkit-color-swatch-wrapper { padding: 0; }
.color-pick input::-webkit-color-swatch { border: 0; border-radius: 7px; }

/* Chip toggle */
.chips-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chips-row.tight { gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 0 14px; border-radius: 99px;
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 13px; font-weight: 600; color: var(--text-2); cursor: pointer; user-select: none;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.chip .i { width: 16px; height: 16px; }
.chip:hover { background: var(--surface-3); }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip:has(input:checked) { background: var(--primary-soft); color: #ccfbf1; border-color: rgba(45, 212, 191, .45); }
.chip:has(input:focus-visible) { outline: 2px solid var(--ring); outline-offset: 2px; }
.chip.action { margin-left: auto; }
.chip.on { background: var(--primary-soft); color: #ccfbf1; border-color: rgba(45, 212, 191, .45); }
#themeChips button { min-height: 34px; padding: 0 12px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); font-size: 13px; color: var(--text-2); transition: background var(--t-fast); }
#themeChips button:hover { background: var(--surface-3); color: var(--text); }

.tag { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 99px; font-size: 12px; font-weight: 600; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); white-space: nowrap; }
.tag.good { color: var(--success); background: var(--success-soft); border-color: rgba(52, 211, 153, .3); }
.tag.warn { color: var(--warning); background: var(--warning-soft); border-color: rgba(251, 191, 36, .3); }

/* ---------- Editor ---------- */
.editor-wrap {
  display: flex;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  background: #0c0d13;
  overflow: hidden;
  height: 52dvh; min-height: 260px;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.editor-wrap:focus-within { border-color: rgba(45, 212, 191, .6); box-shadow: 0 0 0 3px var(--primary-soft); }
.gutter {
  margin: 0; padding: 14px 10px 14px 8px; min-width: 44px;
  text-align: right; color: #4b5166;
  font: 13px/1.6 var(--mono);
  user-select: none; overflow: hidden;
  border-right: 1px solid var(--border);
  background: rgba(255, 255, 255, .015);
}
#code {
  flex: 1; resize: none; border: 0; outline: 0; background: transparent;
  padding: 14px; font: 13px/1.6 var(--mono); color: #e2e8f0;
  tab-size: 2; white-space: pre; overflow: auto; caret-color: var(--primary-2);
}
.status { display: flex; align-items: flex-start; gap: 8px; font: 12px/1.5 var(--mono); padding: 10px 12px; border-radius: var(--r-md); white-space: pre-wrap; word-break: break-word; }
.status::before { content: ''; width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.status.ok { color: var(--success); background: var(--success-soft); }
.status.ok::before { background: var(--success); }
.status.err { color: var(--danger); background: var(--danger-soft); }
.status.err::before { background: var(--danger); }
/* Toolbar editor: 1 tombol utama + 4 tombol ikon kecil dalam grid */
.toolbar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.toolbar .btn.primary { grid-column: 1 / -1; }
.toolbar .btn.ghost { flex-direction: column; gap: 3px; min-height: 56px; padding: 0 4px; font-size: 12px; }
.result-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.result-actions .btn { flex: 1 1 140px; }
#code, .gutter, .prompt-out { font-variant-ligatures: none; font-feature-settings: "liga" 0, "calt" 0; }
.panel-head h2 { white-space: nowrap; }

/* ---------- Preview ---------- */
.stage-wrap { display: flex; justify-content: center; }
.stage {
  /* lebar mengikuti rasio video, dibatasi tinggi maks → tidak pernah gepeng */
  --stage-max-h: 58dvh;
  position: relative;
  width: min(100%, calc(var(--stage-max-h) * var(--ar, 1.7778)));
  aspect-ratio: var(--ar, 1.7778);
  border-radius: var(--r-lg); overflow: hidden;
  background: conic-gradient(#1a1d27 25%, #12141c 0 50%, #1a1d27 0 75%, #12141c 0) 0 0 / 18px 18px;
  box-shadow: 0 0 0 1px var(--border-strong), var(--shadow-2);
}
.stage canvas { width: 100%; height: 100%; display: block; }
.rec-badge {
  position: absolute; top: 12px; left: 12px;
  display: flex; align-items: center; gap: 8px;
  background: rgba(10, 11, 16, .72); backdrop-filter: blur(8px);
  padding: 6px 12px; border-radius: 99px; border: 1px solid rgba(248, 113, 113, .35);
  font: 600 11px var(--mono); color: #fff; letter-spacing: .04em;
}
.rec-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 10px var(--danger); animation: blink 1.1s infinite; }
@keyframes blink { 50% { opacity: .25; } }

.transport { display: flex; align-items: center; gap: 12px; }
.play-btn {
  width: 48px; height: 48px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--text); color: var(--bg); border: 0;
  transition: transform var(--t-fast), background var(--t-fast);
}
.play-btn:hover { background: #fff; }
.play-btn:active { transform: scale(.93); }
.play-btn:disabled { opacity: .4; cursor: not-allowed; }
.play-btn .i { width: 18px; height: 18px; }
.time { font-size: 12px; color: var(--text-2); min-width: 96px; text-align: right; }

.quickrender {
  position: relative;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 14px; border-radius: var(--r-lg);
  background: linear-gradient(var(--surface-2), var(--surface-2)) padding-box,
              linear-gradient(135deg, rgba(45, 212, 191, .55), rgba(56, 189, 248, .35), rgba(255, 255, 255, .06)) border-box;
  border: 1px solid transparent;
}
.qr-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 180px; }
.qr-engine { font-size: 13px; font-weight: 700; color: #ccfbf1; }
.qr-spec { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qr-progress { height: 6px; background: var(--surface-3); border-radius: 99px; overflow: hidden; margin-top: 8px; }
.qr-progress div, .progress .bar div { height: 100%; width: 0; background: var(--grad); border-radius: 99px; transition: width 120ms linear; }
.qr-actions { display: flex; gap: 8px; }
.btn.cta { padding: 0 20px; }

/* ---------- Panel kanan ---------- */
.subtabs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; background: var(--surface-2); padding: 4px; border-radius: var(--r-lg); border: 1px solid var(--border); }
.subtab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: 52px; border: 0; background: none; border-radius: var(--r-md);
  font-size: 12px; font-weight: 600; color: var(--muted);
  transition: background var(--t-fast), color var(--t-fast);
}
.subtab .i { width: 17px; height: 17px; }
@media (max-width: 420px) { .subtab { font-size: 11px; } }
.subtab:hover { color: var(--text); }
.subtab.active { background: var(--surface-3); color: var(--text); box-shadow: inset 0 0 0 1px var(--border-strong), var(--shadow-1); }
.subtab.active .i { color: var(--primary); }
.sub { display: flex; flex-direction: column; gap: 14px; }

.group { display: flex; flex-direction: column; gap: 14px; padding: 14px; border-radius: var(--r-lg); background: rgba(255, 255, 255, .015); border: 1px solid var(--border); }
.group-title { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* Segmented control */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: var(--r-md); border: 1px solid var(--border); }
.seg button {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; border: 0; background: none; border-radius: 9px;
  font-size: 13px; font-weight: 600; color: var(--muted);
  transition: background var(--t-fast), color var(--t-fast);
}
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface-3); color: var(--text); box-shadow: inset 0 0 0 1px var(--border-strong); }
.ar { display: inline-block; border: 1.5px solid currentColor; border-radius: 2px; opacity: .8; }
.ar-169 { width: 16px; height: 9px; } .ar-916 { width: 8px; height: 14px; } .ar-11 { width: 11px; height: 11px; } .ar-45 { width: 10px; height: 12px; }
.seg-format button { flex-direction: column; gap: 0; min-height: 54px; line-height: 1.25; }
.seg-format small { font-size: 11px; font-weight: 500; opacity: .75; }

.engine-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.engine-cards button {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 12px; min-height: 84px; text-align: left;
  border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface-2);
  transition: border-color var(--t-fast), background var(--t-fast);
}
.engine-cards button .i { color: var(--muted); margin-bottom: 4px; }
.engine-cards b { font-size: 13px; }
.engine-cards small { font-size: 11px; color: var(--muted); }
.engine-cards button:hover { border-color: var(--border-strong); }
.engine-cards button.on { border-color: rgba(45, 212, 191, .6); background: var(--primary-soft); }
.engine-cards button.on .i { color: var(--primary); }
.engine-cards.disabled { opacity: .45; pointer-events: none; }

.detect { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--border); font-size: 13px; }
.detect.alpha { border-color: rgba(251, 191, 36, .35); }
.detect-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }

.summary { font-size: 12px; line-height: 1.85; background: #0c0d13; padding: 12px 14px; border-radius: var(--r-md); border: 1px solid var(--border); color: var(--muted); }
.summary b { color: var(--text); font-weight: 600; }
.summary .note { color: var(--warning); }
.summary .bad { color: var(--danger); }
.progress { display: flex; flex-direction: column; gap: 6px; }
.progress .bar { height: 8px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.progress-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.result { display: flex; flex-direction: column; gap: 12px; padding: 14px; border-radius: var(--r-lg); background: var(--success-soft); border: 1px solid rgba(52, 211, 153, .3); animation: fadeUp var(--t-med) var(--ease); }
.result video { width: 100%; border-radius: var(--r-md); background: #000; }
.result .file { font-size: 13px; word-break: break-all; }
.result .file small { color: var(--muted); }

.prompt-out { width: 100%; min-height: 220px; resize: vertical; background: #0c0d13; border: 1px solid var(--border-strong); border-radius: var(--r-md); padding: 12px; font-size: 12px; line-height: 1.6; color: var(--text-2); }
.log { margin: 0; min-height: 220px; max-height: 55dvh; overflow: auto; background: #0c0d13; border: 1px solid var(--border); border-radius: var(--r-md); padding: 12px; font-size: 11.5px; line-height: 1.7; color: var(--text-2); white-space: pre-wrap; }

/* ---------- Bottom nav (mobile) ---------- */
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-nav);
  height: calc(var(--nav-h) + var(--safe-b)); padding: 6px 12px var(--safe-b);
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
  background: rgba(14, 15, 21, .9); backdrop-filter: blur(16px) saturate(140%);
  border-top: 1px solid var(--border);
}
.bottomnav button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border: 0; background: none; border-radius: var(--r-md);
  color: var(--muted); font-size: 11px; font-weight: 600;
  transition: color var(--t-fast);
}
.bottomnav button .i { width: 22px; height: 22px; padding: 2px; border-radius: 99px; box-sizing: content-box; padding: 3px 16px; transition: background var(--t-med) var(--ease); }
.bottomnav button.on { color: var(--text); }
.bottomnav button.on .i { background: var(--primary-soft); color: #99f6e4; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + var(--safe-b) + 16px); z-index: var(--z-toast);
  transform: translate(-50%, 16px);
  background: var(--surface-3); border: 1px solid var(--border-strong);
  padding: 12px 18px; border-radius: var(--r-md); font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-3);
  opacity: 0; pointer-events: none; transition: opacity var(--t-med) var(--ease), transform var(--t-med) var(--ease);
  max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Editor FLOATING ---------- */
.panel.floating {
  display: flex !important;
  position: fixed; z-index: var(--z-float);
  top: calc(var(--top-h) + 16px); right: 24px;
  width: 460px; height: 620px;
  min-width: 320px; min-height: 300px;
  max-width: calc(100vw - 16px); max-height: calc(100dvh - 16px);
  resize: both; overflow: hidden;
  background: rgba(18, 20, 28, .96); backdrop-filter: blur(16px);
  border-color: rgba(45, 212, 191, .35);
  box-shadow: var(--shadow-3), 0 0 0 1px rgba(45, 212, 191, .15);
  animation: none;
}
.panel.floating .panel-head { cursor: grab; touch-action: none; user-select: none; }
.panel.floating.dragging .panel-head { cursor: grabbing; }
.panel.floating .editor-wrap { flex: 1; height: auto; min-height: 120px; }
.panel.floating .toolbar .btn.primary { flex: 0 1 auto; }
.panel.floating.dragging { opacity: .94; }
.panel.term-off { display: none !important; }

/* ---------- Tombol Prompt AI (topbar) ---------- */
.ai-btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 14px; border-radius: 99px; border: 0;
  background: var(--grad); color: #fff; font-size: 13px; font-weight: 700;
  box-shadow: 0 6px 18px rgba(56, 189, 248, .28);
  transition: filter var(--t-fast), transform var(--t-fast);
}
.ai-btn:hover { filter: brightness(1.08); }
.ai-btn:active { transform: scale(.96); }

/* ---------- Preview diperbesar ---------- */
.panel-preview.expanded {
  position: fixed !important; inset: 0; z-index: 80;
  display: flex !important; max-height: none; border-radius: 0; border: 0;
  padding: max(12px, env(safe-area-inset-top)) 16px max(12px, env(safe-area-inset-bottom));
  background: #050608; overflow: auto; animation: none;
}
.panel-preview.expanded .stage-wrap { flex: 1; align-items: center; min-height: 0; }
/* tinggi maks = layar dikurangi header + transport + chip + kartu render */
.panel-preview.expanded .stage { --stage-max-h: calc(100dvh - 400px); box-shadow: none; }
@media (max-width: 700px) { .panel-preview.expanded .stage { --stage-max-h: calc(100dvh - 430px); } }
.panel-preview.expanded .quickrender { max-width: 900px; width: 100%; margin: 0 auto; }
.panel-preview.expanded .transport,
.panel-preview.expanded .chips-row { max-width: 900px; width: 100%; margin: 0 auto; }
body.preview-expanded { overflow: hidden; }

/* ---------- MODAL ---------- */
.modal {
  padding: 0; border: 0; background: transparent; color: var(--text);
  width: min(760px, calc(100vw - 32px)); max-height: calc(100dvh - 48px);
}
.modal::backdrop { background: rgba(5, 6, 10, .72); backdrop-filter: blur(6px); }
.modal[open] { animation: modalIn var(--t-med) var(--ease); }
@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-card {
  display: flex; flex-direction: column; max-height: calc(100dvh - 48px);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 24px;
  box-shadow: var(--shadow-3), 0 0 0 1px rgba(45, 212, 191, .12);
  overflow: hidden;
}
.modal-head { display: flex; align-items: center; gap: 14px; padding: 18px 20px 14px; border-bottom: 1px solid var(--border); }
.modal-icon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--grad); color: #fff; flex-shrink: 0; box-shadow: 0 6px 20px rgba(45, 212, 191, .35); }
.modal-titles { flex: 1; min-width: 0; }
.modal-titles h2 { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: -.01em; }
.modal-titles p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }

.mode-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 14px 20px 0; }
.mode-tabs button {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; border-radius: var(--r-md); border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text-2); font-size: 13px; font-weight: 700;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.mode-tabs button:hover { color: var(--text); border-color: var(--border-strong); }
.mode-tabs button.on { background: var(--primary-soft); border-color: rgba(45, 212, 191, .6); color: #f0fdfa; }
.mode-tabs button.on .i { color: #99f6e4; }

.modal-body { flex: 1; overflow: auto; padding: 4px 20px 20px; display: flex; flex-direction: column; gap: 16px; scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
.mode-desc { margin: 10px 0 0; font-size: 13px; color: var(--text-2); background: var(--surface-2); border: 1px dashed var(--border-strong); padding: 10px 12px; border-radius: var(--r-md); }
.pm-sec { display: flex; flex-direction: column; gap: 12px; }
.pm-sec h3 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 14px; font-weight: 700; flex-wrap: wrap; }
.pm-sec .num { width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-3); color: #99f6e4; font-size: 12px; font-weight: 800; }
.tag.linked { height: 22px; font-size: 11px; color: #93c5fd; background: rgba(59, 130, 246, .12); border-color: rgba(59, 130, 246, .3); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.search-box { position: relative; display: flex; align-items: center; }
.search-box > .i { position: absolute; left: 13px; color: var(--muted); pointer-events: none; }
.search-box .input { padding-left: 40px; }
.search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 5;
  max-height: 280px; overflow: auto; padding: 6px;
  background: var(--surface-3); border: 1px solid var(--border-strong); border-radius: var(--r-md);
  box-shadow: var(--shadow-2);
}
.search-results button { display: flex; flex-direction: column; align-items: flex-start; width: 100%; min-height: 44px; padding: 6px 10px; border: 0; border-radius: 8px; background: none; text-align: left; }
.search-results button:hover, .search-results button.active { background: var(--primary-soft); }
.search-results b { font-size: 14px; font-weight: 600; }
.search-results small { font-size: 12px; color: var(--muted); }
.search-results .empty { padding: 10px; color: var(--muted); font-size: 13px; }

.bg-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.bg-card {
  position: relative; display: flex; align-items: center; gap: 10px;
  min-height: 52px; padding: 8px 12px; border-radius: var(--r-md);
  background: var(--surface-2); border: 1px solid var(--border); cursor: pointer;
  font-size: 13px; font-weight: 600; color: var(--text-2);
  transition: border-color var(--t-fast), background var(--t-fast);
}
.bg-card input { position: absolute; opacity: 0; pointer-events: none; }
.bg-card:hover { border-color: var(--border-strong); }
.bg-card:has(input:checked) { border-color: rgba(45, 212, 191, .65); background: var(--primary-soft); color: var(--text); }
.bg-card:has(input:focus-visible) { outline: 2px solid var(--ring); outline-offset: 2px; }
.swatch { width: 26px; height: 26px; border-radius: 8px; flex-shrink: 0; border: 1px solid rgba(255, 255, 255, .18); }
.sw-free { background: conic-gradient(#2dd4bf, #38bdf8, #22d3ee, #fbbf24, #2dd4bf); }
.sw-transparent { background: conic-gradient(#555 25%, #999 0 50%, #555 0 75%, #999 0) 0 0 / 10px 10px; }
.sw-green { background: #00ff00; }
.sw-dark { background: #0a0d14; }
.sw-light { background: #ffffff; }
.sw-gradient { background: linear-gradient(135deg, #6366f1, #38bdf8); }

.pm-preview { border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-2); }
.pm-preview summary { cursor: pointer; padding: 12px 14px; font-size: 13px; font-weight: 700; color: var(--text-2); display: flex; justify-content: space-between; align-items: center; list-style: none; }
.pm-preview summary::-webkit-details-marker { display: none; }
.pm-preview summary::after { content: '▾'; color: var(--muted); }
.pm-preview[open] summary::after { content: '▴'; }
.pm-preview summary .mono { font-size: 11px; color: var(--muted); font-weight: 500; margin-left: auto; margin-right: 8px; }
.pm-preview .prompt-out { border: 0; border-top: 1px solid var(--border); border-radius: 0 0 var(--r-md) var(--r-md); min-height: 260px; }

.modal-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 20px; border-top: 1px solid var(--border); background: rgba(255, 255, 255, .015); }
.open-ai { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.open-ai a { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 0 10px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); text-decoration: none; font-weight: 600; }
.open-ai a:hover { color: var(--text); border-color: var(--border-strong); }
.open-ai .i { width: 13px; height: 13px; }
.foot-actions { display: flex; gap: 8px; margin-left: auto; }

@media (max-width: 640px) {
  .modal { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; }
  .modal-card { height: 100dvh; max-height: 100dvh; border-radius: 0; border: 0; }
  .modal-head { padding: max(14px, env(safe-area-inset-top)) 16px 12px; }
  .mode-tabs { grid-template-columns: repeat(4, 1fr); padding: 12px 16px 0; gap: 4px; }
  .mode-tabs button { flex-direction: column; gap: 2px; font-size: 11px; min-height: 56px; }
  .modal-body { padding: 4px 16px 16px; }
  .grid2 { grid-template-columns: 1fr; }
  .bg-cards { grid-template-columns: 1fr 1fr; }
  .modal-foot { padding: 12px 16px max(12px, env(safe-area-inset-bottom)); }
  .foot-actions { width: 100%; }
  .foot-actions .btn { flex: 1; }
  .open-ai { width: 100%; justify-content: center; }
  .ai-btn .lbl { display: none; }
  .ai-btn { width: 40px; padding: 0; justify-content: center; }
}

.muted { color: var(--muted); font-weight: 500; }

/* Isi panel tidak boleh tertekan; hanya editor yang fleksibel */
.panel > * { flex-shrink: 0; }
.panel > .editor-wrap { flex-shrink: 1; }

/* ---------- Auto-Lint ---------- */
.lint { border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-2); overflow: hidden; }
.lint-head { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 40px; padding: 0 12px; border: 0; background: none; font-size: 13px; font-weight: 700; color: var(--text-2); text-align: left; }
.lint-head .i { width: 16px; height: 16px; }
.lint-head .chev { margin-left: 4px; transition: transform var(--t-med) var(--ease); }
.lint-head[aria-expanded="false"] .chev { transform: rotate(-90deg); }
.lint-counts { margin-left: auto; display: flex; gap: 6px; }
.lint-counts span { font: 600 11px var(--mono); padding: 2px 8px; border-radius: 99px; }
.lc-error { color: var(--danger); background: var(--danger-soft); }
.lc-warn { color: var(--warning); background: var(--warning-soft); }
.lc-info { color: #93c5fd; background: rgba(59, 130, 246, .12); }
.lc-ok { color: var(--success); background: var(--success-soft); }
.lint-list { list-style: none; margin: 0; padding: 0 6px 6px; max-height: 190px; overflow: auto; display: flex; flex-direction: column; gap: 4px; }
.lint-list[hidden] { display: none; }
.lint-list li button {
  display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; align-items: start;
  width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: rgba(255, 255, 255, .02);
  text-align: left; font-size: 12.5px; line-height: 1.45; color: var(--text-2);
}
.lint-list li button:hover { background: rgba(255, 255, 255, .05); }
.lint-list .sev { font: 700 10px var(--mono); padding: 2px 6px; border-radius: 5px; text-transform: uppercase; margin-top: 1px; }
.lint-list .loc { grid-column: 2; font: 11px var(--mono); color: var(--muted); }

/* ---------- Ukuran editor floating ---------- */
.size-seg { display: none; gap: 2px; padding: 3px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.size-seg button { min-width: 30px; height: 32px; border: 0; border-radius: 7px; background: none; color: var(--muted); font: 700 11px var(--mono); }
.size-seg button:hover { color: var(--text); }
.size-seg button.on { background: var(--surface-3); color: var(--text); }
@media (min-width: 1024px) { .panel.floating .size-seg { display: flex; } }

/* ---------- Riwayat & padding ---------- */
.history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.history li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--border); cursor: pointer; }
.history li.sel { border-color: rgba(45, 212, 191, .6); background: var(--primary-soft); }
.history .h-info { flex: 1; min-width: 0; font-size: 12px; }
.history .h-info b { display: block; font: 600 12px var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history .h-info small { color: var(--muted); }
.history .icon-btn { width: 36px; height: 36px; flex-shrink: 0; }
.pad-tool { display: flex; flex-direction: column; gap: 10px; padding-top: 4px; border-top: 1px solid var(--border); }
.pad-row { display: flex; gap: 8px; flex-wrap: wrap; }
.pad-input { display: inline-flex; align-items: center; gap: 8px; flex: 1 1 150px; min-height: 44px; padding: 0 12px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--border-strong); font-size: 13px; color: var(--muted); }
.pad-input input { flex: 1; min-width: 40px; border: 0; outline: 0; background: none; font: 600 16px var(--mono); color: var(--text); text-align: right; }
.pad-row .btn { flex: 1 1 160px; }

/* ---------- Bulk ---------- */
.bulk-tools { grid-template-columns: 1fr 1fr 1fr; }
.bulk-tools .btn.primary { grid-column: auto; }
.bulk-tools .btn { flex-direction: column; gap: 3px; min-height: 60px; padding: 0 4px; font-size: 12px; white-space: normal; text-align: center; }
.file-btn { cursor: pointer; }
.bulk-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.bulk-list:empty::before { content: 'Antrean kosong — tambahkan kode dari editor atau impor file.'; display: block; padding: 16px; text-align: center; font-size: 13px; color: var(--muted); border: 1px dashed var(--border-strong); border-radius: var(--r-md); }
.bulk-list li { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--border); }
.bulk-list .b-num { font: 700 11px var(--mono); color: var(--muted); width: 22px; }
.bulk-list input { flex: 1; min-width: 0; min-height: 36px; border: 0; background: none; font: 600 13px var(--font); color: var(--text); }
.bulk-list input:focus { outline: none; }
.bulk-list .b-state { font: 600 11px var(--mono); padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.bulk-list .b-state.ok { color: var(--success); background: var(--success-soft); }
.bulk-list .b-state.err { color: var(--danger); background: var(--danger-soft); }
.bulk-list .b-state.run { color: #99f6e4; background: var(--primary-soft); }
.bulk-list .icon-btn { width: 36px; height: 36px; }

/* ---------- Cover ---------- */
.cover-preview { border-radius: var(--r-md); overflow: hidden; background: conic-gradient(#1a1d27 25%, #12141c 0 50%, #1a1d27 0 75%, #12141c 0) 0 0 / 14px 14px; border: 1px solid var(--border-strong); }
.cover-preview canvas { display: block; width: 100%; height: auto; }
.cover-tools { grid-template-columns: 1fr 1fr; }
.cover-tools .btn.primary { grid-column: auto; }
.cover-tools .btn { flex-direction: row; min-height: 48px; font-size: 13px; }

/* ---------- Mode kerja (Kode ⇄ Visual Layer) ---------- */
.ws-switch { display: flex; gap: 4px; padding: 4px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); }
.ws-switch button {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px;
  border: 0; border-radius: 99px; background: none; color: var(--muted); font-size: 13px; font-weight: 700;
  transition: background var(--t-fast), color var(--t-fast);
}
.ws-switch button .i { width: 16px; height: 16px; }
.ws-switch button:hover { color: var(--text); }
.ws-switch button.on { background: var(--surface-3); color: var(--text); box-shadow: inset 0 0 0 1px var(--border-strong); }
.ws-switch button.on .i { color: #99f6e4; }
.layout.ws-layer #panel-editor { display: none !important; }
.layout:not(.ws-layer) #panel-layers { display: none !important; }

.kind-badge { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; margin-left: 4px; border-radius: 6px; font: 600 11px var(--mono); color: #93c5fd; background: rgba(59, 130, 246, .12); border: 1px solid rgba(59, 130, 246, .3); }
.kind-badge.svg { color: #fcd34d; background: var(--warning-soft); border-color: rgba(251, 191, 36, .3); }

/* ---------- Preview: svg, latar area transparan, opsi ---------- */
.preview-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: none; transform-origin: 50% 50%; }
.stage canvas { position: relative; }
.stage.pv-black { background: #000; }
.stage.pv-white { background: #fff; }
.stage.pv-green { background: #00ff00; }
.stage.pv-blue { background: #0000ff; }
.stage.dragging { cursor: grabbing; }
.layout.ws-layer .stage { cursor: grab; touch-action: none; }
.pv-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.mini-sel { display: inline-flex; align-items: center; gap: 8px; flex: 1 1 160px; min-height: 40px; padding: 0 4px 0 12px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--border); font-size: 12px; color: var(--muted); font-weight: 600; }
.mini-sel select { flex: 1; min-width: 0; min-height: 38px; border: 0; background: none; font-size: 13px; font-weight: 600; color: var(--text); cursor: pointer; }
.mini-sel select:focus { outline: none; }
.mini-sel:focus-within { border-color: var(--primary); }
.mini-sel option, .select-wrap option { background: var(--surface-2); color: var(--text); }
/* header editor: tombol tidak boleh terdorong keluar panel */
#editorHead { flex-wrap: nowrap; }
#editorHead h2 { min-width: 0; flex-shrink: 1; overflow: hidden; }
#editorHead .head-actions { flex-shrink: 0; }
#editorHead .select-wrap.compact select { width: 118px; text-overflow: ellipsis; }
.frame-label { margin-top: -6px; padding-left: 60px; font-size: 11px; color: var(--muted); letter-spacing: .02em; }
.layout.ws-svg #h-editor .grip-icon { color: #fcd34d; }
.qr-stale { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 12px; font-weight: 600; color: var(--warning); }
.qr-stale .i { width: 14px; height: 14px; }

/* ---------- Visual Layer ---------- */
.seg-small button { min-height: 36px; font-size: 12px; padding: 0 6px; }
#lyBgType { grid-auto-flow: row; grid-template-columns: repeat(3, 1fr); }
.compact-sel { flex: 1 1 140px; }
.compact-sel select { min-height: 44px; }
.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: 112px; padding: 16px; border-radius: var(--r-lg); cursor: pointer; text-align: center;
  border: 1.5px dashed rgba(45, 212, 191, .45); background: rgba(45, 212, 191, .05);
  transition: background var(--t-fast), border-color var(--t-fast);
}
.dropzone .i { width: 26px; height: 26px; color: #99f6e4; }
.dropzone b { font-size: 14px; }
.dropzone small { font-size: 12px; color: var(--muted); }
.dropzone:hover, .dropzone.over { background: var(--primary-soft); border-color: var(--primary); }
.dropzone:focus-within { outline: 2px solid var(--ring); outline-offset: 2px; }
.layer-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.layer-list li { display: flex; align-items: center; gap: 6px; padding: 6px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--border); cursor: pointer; transition: border-color var(--t-fast), background var(--t-fast); }
.layer-list li:hover { border-color: var(--border-strong); }
.layer-list li.sel { border-color: rgba(45, 212, 191, .65); background: var(--primary-soft); }
.layer-list li.off img, .layer-list li.off .ly-name { opacity: .45; }
.layer-list li.empty { justify-content: center; padding: 16px; font-size: 13px; color: var(--muted); cursor: default; border-style: dashed; }
.layer-list img { width: 44px; height: 44px; object-fit: contain; border-radius: 8px; flex-shrink: 0; background: conic-gradient(#2a2e3b 25%, #1c1f29 0 50%, #2a2e3b 0 75%, #1c1f29 0) 0 0 / 10px 10px; }
.ly-name { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ly-name small { display: block; font: 500 11px var(--mono); color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.layer-list .icon-btn { width: 34px; height: 34px; flex-shrink: 0; }
.icon-btn.danger { color: var(--danger); }
.icon-btn.danger:hover { background: var(--danger-soft); }
.ly-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.ly-grid .field:last-child { grid-column: 1 / -1; }
.ly-times { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.num-field { display: flex; flex-direction: column; gap: 4px; font-size: 11px; font-weight: 600; color: var(--muted); }
.num-field input { min-height: 44px; width: 100%; padding: 0 10px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--border-strong); font: 600 15px var(--mono); color: var(--text); }
.num-field input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
@media (max-width: 520px) {
  .ly-grid { grid-template-columns: 1fr; }
  .ly-times { grid-template-columns: 1fr 1fr; }
  .num-field input { font-size: 16px; }
}

/* ---------- Aset & panduan ---------- */
.assets-box, .guide { border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-2); }
.assets-box summary, .guide summary { display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 12px; cursor: pointer; font-size: 13px; font-weight: 700; color: var(--text-2); list-style: none; }
.assets-box summary::-webkit-details-marker, .guide summary::-webkit-details-marker { display: none; }
.assets-box summary .i { width: 16px; height: 16px; }
.assets-box summary .tag { margin-left: auto; }
.assets-box > .hint, .assets-box > ul { margin: 0 12px 12px; }
.asset-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.asset-list li { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.asset-list img { width: 32px; height: 32px; object-fit: contain; border-radius: 6px; background: var(--surface-3); }
.asset-list li .btn { margin-left: auto; }
.guide ol { margin: 0; padding: 0 14px 12px 32px; font-size: 13px; color: var(--text-2); line-height: 1.6; }
.guide li { margin: 4px 0; }
.sw-blue { background: #0000ff; }
#bgPresets .chip { min-height: 36px; padding: 0 12px 0 8px; }
#bgPresets .swatch { width: 18px; height: 18px; border-radius: 5px; }

/* ---------- Prompt: jenis kode ---------- */
.pm-engine { display: flex; align-items: center; gap: 12px; padding: 14px 20px 0; font-size: 12px; font-weight: 700; color: var(--muted); }
.pm-engine .seg { flex: 1; }
@media (max-width: 640px) { .pm-engine { padding: 12px 16px 0; flex-direction: column; align-items: stretch; gap: 6px; } }

/* ---------- Topbar responsif ---------- */
@media (max-width: 1180px) { .brand-text small { display: none; } }
@media (max-width: 860px) {
  .ws-switch button span { display: none; }
  .ws-switch button { padding: 0 12px; }
  .brand-text { display: none; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* =========================================================
   HP kecil
   ========================================================= */
@media (max-width: 520px) {
  #caps span { display: none; }
  #caps { width: 32px; padding: 0; justify-content: center; }
  .term-toggle .lbl { display: none; }
  .chip.action { margin-left: 0; }
  #code { font-size: 16px; } /* hindari auto-zoom iOS */
  .gutter { font-size: 16px; }
  .panel-head h2 { font-size: 13px; }
  .select-wrap.compact select { width: 112px; }
  .qr-actions { width: 100%; }
  .qr-actions .btn { flex: 1; }
}

/* =========================================================
   HP / TABLET: editor floating = bottom sheet, preview tetap kelihatan
   ========================================================= */
@media (max-width: 1023px) {
  .panel.floating {
    left: 0 !important; right: 0 !important; top: auto !important;
    bottom: calc(var(--nav-h) + var(--safe-b));
    width: auto !important; height: 50dvh !important; min-width: 0;
    resize: none; border-radius: var(--r-xl) var(--r-xl) 0 0;
    border-bottom: 0; padding-top: 22px;
  }
  .panel.floating::before {
    content: ''; position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
    width: 40px; height: 4px; border-radius: 4px; background: var(--border-strong);
  }
  .panel.floating .panel-head { cursor: default; }
  .panel.floating .hint,
  .panel.floating .switch { display: none; }
  .panel.floating { gap: 10px; }
  .panel.floating .status { padding: 6px 10px; }
  /* sheet: semua tombol satu baris ikon */
  .panel.floating .toolbar { grid-template-columns: 1.6fr repeat(4, 1fr); }
  .panel.floating .toolbar .btn.primary { grid-column: auto; min-height: 48px; }
  .panel.floating .toolbar .btn.ghost { min-height: 48px; font-size: 0; gap: 0; }
  .panel.floating .toolbar .btn.ghost .i { width: 20px; height: 20px; }
  .layout.sheet-open { padding-bottom: calc(50dvh + var(--nav-h) + var(--safe-b) + 16px); }
}

/* (layout tablet & desktop: lihat blok LAYOUT STUDIO di akhir file) */

/* =========================================================
   REFINE — lebih tenang & elegan
   - Warna aksen solid; gradien hanya untuk logo
   - Toolbar editor: 1 baris (Jalankan + ikon)
   - Perangkat mouse (pointer: fine): kontrol lebih ramping.
     Layar sentuh tetap ≥ 44px.
   ========================================================= */
.btn.primary, .btn.primary:hover { background: var(--primary); box-shadow: none; filter: none; }
.btn.primary:hover { background: #14b8a6; }
.ai-btn { background: var(--primary-soft); color: #ccfbf1; box-shadow: inset 0 0 0 1px rgba(45, 212, 191, .45); }
.ai-btn:hover { background: rgba(45, 212, 191, .24); filter: none; }
.logo { box-shadow: none; }
.quickrender { background: var(--surface-2); border: 1px solid var(--border-strong); }
.qr-progress div, .progress .bar div { background: var(--primary); }
.panel { background: var(--surface); box-shadow: none; }
.panel-head h2 { font-size: 13px; letter-spacing: .01em; }

/* Toolbar editor satu baris */
.toolbar { display: flex; flex-wrap: nowrap; gap: 6px; grid-template-columns: none; }
.toolbar .btn.primary { flex: 1 1 auto; grid-column: auto; }
.toolbar .btn.tool { flex: 0 0 auto; flex-direction: row; width: 44px; min-height: 44px; padding: 0; gap: 0; font-size: 0; }
.toolbar .btn.tool .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.toolbar .btn.tool .i { width: 18px; height: 18px; }
.panel.floating .toolbar .btn.ghost, .panel.floating .toolbar .btn.primary { min-height: 44px; }
.bulk-tools, .cover-tools { display: grid; }

/* Terminal mengambang: ringkas supaya tidak terpotong di ukuran S */
.panel.floating { overflow: auto; gap: 10px; padding: 12px; }
.panel.floating .ed-hint, .panel.floating .assets-box, .panel.floating > .switch { display: none; }
.panel.floating #editorHead h2 { font-size: 0; flex: 0 0 auto; }  /* cukup ikon (pegangan geser) */
.panel.floating #editorHead .kind-badge { display: none; }
.panel.floating .editor-wrap { min-height: 140px; }
.panel.floating .status { padding: 6px 10px; }
.panel.floating .lint-head { min-height: 34px; }
.panel.floating .lint-list { max-height: 120px; }
@media (max-width: 520px) {
  #editorHead .kind-badge { display: none; }      /* mode sudah terlihat di topbar */
  .panel:not(.floating) .editor-wrap { height: 44dvh; }
}
@media (min-width: 1024px) {
  .panel.floating #editorHead { gap: 6px; }
  .panel.floating #editorHead .select-wrap.compact select { width: 96px; }
}

/* ---------- Layar penuh ala bioskop: video memenuhi layar ---------- */
.panel-preview.expanded { padding: 0; gap: 0; background: #000; justify-content: center; }
.panel-preview.expanded .panel-head {
  position: absolute; z-index: 3; min-height: 0;
  top: max(10px, env(safe-area-inset-top, 0px)); right: max(10px, env(safe-area-inset-right, 0px));
}
.panel-preview.expanded .panel-head h2,
.panel-preview.expanded #previewInfo,
.panel-preview.expanded .chips-row,
.panel-preview.expanded .pv-opts,
.panel-preview.expanded .frame-label,
.panel-preview.expanded .quickrender { display: none; }
.panel-preview.expanded #btnExpand { background: rgba(10, 11, 16, .6); backdrop-filter: blur(8px); border-color: rgba(255, 255, 255, .15); }
.panel-preview.expanded .stage-wrap { flex: 1; min-height: 0; align-items: center; justify-content: center; }
.panel-preview.expanded .stage { --stage-max-h: calc(100dvh - 60px); border-radius: 0; box-shadow: none; }
.panel-preview.expanded .transport {
  max-width: none; width: 100%; margin: 0; gap: 12px;
  padding: 10px max(16px, env(safe-area-inset-right, 0px)) max(10px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  background: #000;
}
.panel-preview.expanded .play-btn { width: 36px; height: 36px; }

/* ---------- Mouse / trackpad: kontrol ramping ---------- */
@media (pointer: fine) {
  .btn { min-height: 36px; padding: 0 14px; font-size: 13px; border-radius: 10px; gap: 6px; }
  .btn .i { width: 16px; height: 16px; }
  .btn.small { min-height: 30px; padding: 0 10px; font-size: 12px; }
  .btn.big { min-height: 42px; font-size: 14px; border-radius: 12px; }
  .icon-btn { width: 34px; height: 34px; border-radius: 9px; }
  .icon-btn .i { width: 16px; height: 16px; }
  .toolbar .btn.tool { width: 36px; min-height: 36px; }
  .toolbar .btn.primary { min-height: 36px; }
  .panel.floating .toolbar .btn.ghost, .panel.floating .toolbar .btn.primary { min-height: 36px; }
  .chip { min-height: 32px; padding: 0 12px; font-size: 12px; }
  .chip .i { width: 14px; height: 14px; }
  .seg { padding: 3px; border-radius: 10px; }
  .seg button { min-height: 32px; font-size: 12px; border-radius: 7px; }
  .seg-format button { min-height: 44px; }
  .subtab { min-height: 40px; flex-direction: row; gap: 6px; font-size: 12px; }
  .subtab .i { width: 15px; height: 15px; }
  .engine-cards button { min-height: 64px; padding: 10px; }
  .play-btn { width: 40px; height: 40px; }
  .play-btn .i { width: 15px; height: 15px; }
  .input, .select-wrap select { min-height: 38px; font-size: 14px; }
  .select-wrap.compact select { min-height: 34px; font-size: 12px; }
  .mini-sel { min-height: 36px; }
  .mini-sel select { min-height: 34px; }
  .num-field input { min-height: 36px; font-size: 14px; }
  .color-pick input { width: 36px; height: 36px; }
  .switch { min-height: 30px; font-size: 13px; }
  .switch .track { width: 34px; height: 20px; }
  .switch .track::after { width: 14px; height: 14px; }
  .switch input:checked + .track::after { transform: translateX(14px); }
  .term-toggle, .ai-btn { height: 34px; font-size: 12px; }
  .chip-status { height: 30px; }
  .ws-switch button { height: 30px; font-size: 12px; padding: 0 12px; }
  .lint-head { min-height: 36px; }
  .group { padding: 12px; gap: 12px; }
  .sub { gap: 12px; }
  .panel { gap: 12px; }
  .mode-tabs button { min-height: 40px; font-size: 12px; }
  .bg-card { min-height: 44px; }
  .dropzone { min-height: 92px; }
  .layer-list .icon-btn { width: 30px; height: 30px; }
  .layer-list img { width: 38px; height: 38px; }
  .bulk-tools .btn { min-height: 48px; }
  .cover-tools .btn { min-height: 38px; }
}

/* =========================================================
   LAYOUT STUDIO
   Kiri  : meja kerja — langkah ① Buat · ② Atur · ③ Ekspor
   Kanan : panggung preview (bagian utama)
   HP    : satu layar per langkah lewat navigasi bawah
   ========================================================= */
.display, .brand-text strong, .step-btn b, .panel-head h2, .modal-titles h2, .step-title {
  font-family: "Space Grotesk", var(--font);
}

/* --- Brand: Gerak Studio · by ipuy --- */
.brand-text strong { font-size: 17px; font-weight: 700; letter-spacing: -.02em; }
.brand-accent { margin-left: 4px; font-weight: 500; color: var(--primary); }
.brand-text small { display: block !important; font-size: 11px; letter-spacing: .06em; color: var(--muted); margin-top: 0; }
.brand-by { font-weight: 700; color: var(--text-2); letter-spacing: .02em; }

/* Kredit di bawah halaman (terlihat di HP juga) */
.credit {
  padding: 4px var(--gutter) calc(var(--nav-h) + var(--safe-b) + 14px);
  text-align: center; font-size: 12px; color: var(--muted); letter-spacing: .02em;
}
.credit b { color: var(--text-2); font-weight: 700; }
.credit .dot { margin: 0 6px; opacity: .5; }
.layout { padding-bottom: 12px; }
@media (min-width: 1024px) { .credit { padding-bottom: 18px; } }

/* --- Meja kerja --- */
.workbench { display: none; flex-direction: column; gap: 14px; min-width: 0; }
.layout[data-tab="editor"] .workbench,
.layout[data-tab="settings"] .workbench,
.layout[data-tab="export"] .workbench { display: flex; animation: fadeUp var(--t-med) var(--ease); }
.layout[data-tab="preview"] #panel-preview { display: flex; animation: fadeUp var(--t-med) var(--ease); }

/* panel di dalam meja kerja tidak punya kartu sendiri (meja kerja = kartunya) */
.workbench > .panel:not(.floating) { display: flex; background: none; border: 0; border-radius: 0; padding: 0; box-shadow: none; }
.workbench[data-step="create"] #panel-render,
.workbench:not([data-step="create"]) #panel-editor:not(.floating),
.workbench:not([data-step="create"]) #panel-layers,
.workbench:not([data-step="create"]) .wb-intro { display: none !important; }
.layout.ws-layer .wb-intro { display: none; }
.bottomnav { grid-template-columns: repeat(4, 1fr); }
.bottomnav button .i { padding: 3px 12px; }

/* Langkah */
.stepbar { display: none; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.step-btn {
  position: relative; display: flex; align-items: center; gap: 10px; min-width: 0;
  padding: 10px 12px; border-radius: 12px; text-align: left;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2);
  transition: border-color var(--t-fast), background var(--t-fast), color var(--t-fast);
}
.step-btn:hover { border-color: var(--border-strong); color: var(--text); }
.step-btn .n {
  width: 26px; height: 26px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center;
  font: 700 12px var(--mono); background: var(--surface-3); color: var(--muted);
}
.step-btn b { display: block; font-size: 14px; font-weight: 700; line-height: 1.2; }
.step-btn small { display: block; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.step-btn.on { border-color: rgba(45, 212, 191, .55); background: var(--primary-soft); color: var(--text); }
.step-btn.on .n { background: var(--primary); color: var(--on-primary); }
/* garis penghubung antar langkah */
.step-btn:not(:last-child)::after {
  content: ''; position: absolute; right: -7px; top: 50%; width: 8px; height: 1px; background: var(--border-strong);
}

.step-title { display: none; margin: 0; font-size: 18px; font-weight: 700; }
.step-title small { display: block; font: 500 13px var(--font); color: var(--muted); margin-top: 2px; }

/* Petunjuk mulai cepat */
.wb-intro {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-lg);
  background: linear-gradient(135deg, rgba(45, 212, 191, .10), rgba(56, 189, 248, .06));
  border: 1px solid rgba(45, 212, 191, .28);
}
.wb-intro > .i { width: 20px; height: 20px; color: var(--primary); flex-shrink: 0; }
.wb-intro div { flex: 1; min-width: 0; font-size: 13px; color: var(--text-2); line-height: 1.45; }
.wb-intro b { display: block; color: var(--text); font-size: 13px; }
.wb-intro .btn { flex-shrink: 0; }
.float-note { display: none; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: var(--r-lg); background: var(--surface-2); border: 1px dashed var(--border-strong); font-size: 13px; color: var(--text-2); }
.workbench.has-float[data-step="create"] .float-note { display: flex; }

/* Sub-tab panel Ekspor (Render · Bulk · Cover · Log) */
.subtab[data-sub="config"] { display: none; }
.subtabs { grid-template-columns: repeat(4, 1fr); }
.workbench[data-step="settings"] #panel-render .subtabs { display: none; }

/* HP: editor mengambang (sheet) tetap terlihat saat tab Preview */
.layout.sheet-open .workbench { display: flex !important; animation: none; }
.layout.sheet-open[data-tab="preview"] .workbench > :not(#panel-editor) { display: none !important; }

@media (max-width: 1023px) {
  .workbench[data-step="settings"] .step-title[data-for="settings"],
  .workbench[data-step="export"] .step-title[data-for="export"] { display: block; }
}

/* --- Panel "Siap render" di bawah preview --- */
.quickrender { flex-direction: column; align-items: stretch; gap: 12px; flex-wrap: nowrap; }
.qr-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.qr-title { display: flex; align-items: baseline; gap: 10px; min-width: 0; flex-wrap: wrap; }
.qr-title b { font: 700 15px "Space Grotesk", var(--font); }
.qr-title .qr-engine { font-size: 12px; font-weight: 600; color: var(--muted); }
.link-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 4px; border: 0; background: none; color: var(--primary); font-size: 12px; font-weight: 700; white-space: nowrap; }
.link-btn .i { width: 14px; height: 14px; }
.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }
.qr-settings { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.qs { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.qs span { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.qs select {
  width: 100%; min-height: 40px; padding: 0 28px 0 10px; border-radius: 10px;
  border: 1px solid var(--border-strong); background: var(--surface-3); color: var(--text);
  font: 600 14px var(--font); cursor: pointer; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%; background-size: 5px 5px; background-repeat: no-repeat;
}
.qs select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.qs option { background: var(--surface-2); color: var(--text); }
.quickrender .qr-info { flex: 1 1 auto; }
.quickrender .qr-spec { display: none; }           /* ringkasan teks diganti pilihan di atas */
.quickrender .qr-info:has(.qr-stale[hidden]):has(.qr-progress[hidden]):has(.qr-meta:empty):has(.qr-adobe[hidden]) { display: none; }
.quickrender .qr-actions { width: 100%; }
.quickrender .qr-actions .btn { flex: 1; min-height: 44px; font-size: 15px; }
.quickrender .qr-actions #btnQuickDownload { flex: 0 1 auto; }
@media (max-width: 640px) {
  .qr-settings { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .qs select { font-size: 16px; }   /* iOS tidak auto-zoom */
  .quickrender { padding: 12px; gap: 10px; }
}
/* Desktop: panel jadi satu baris — 5 pilihan + tombol Render */
@media (min-width: 1024px) {
  .quickrender {
    display: grid; grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "head head" "set act" "info info";
    column-gap: 14px; row-gap: 10px; align-items: end;
  }
  .qr-head { grid-area: head; }
  .qr-settings { grid-area: set; }
  .quickrender .qr-actions { grid-area: act; }
  .quickrender .qr-info { grid-area: info; }
  .quickrender .qr-actions { min-width: 180px; }
  .quickrender .qr-actions .btn { min-height: 40px; font-size: 14px; }
  .qs select { min-height: 38px; font-size: 13px; }
}

/* --- Desktop: meja kerja | panggung --- */
@media (min-width: 1024px) {
  :root { --gutter: 20px; }
  .layout {
    display: grid; grid-template-columns: minmax(380px, 460px) minmax(0, 1fr);
    gap: 20px; align-items: start; padding-bottom: 20px;
    max-width: 1760px; margin: 0 auto;
  }
  .workbench {
    display: flex !important; animation: none;
    position: sticky; top: calc(var(--top-h) + 16px);
    max-height: calc(100dvh - var(--top-h) - 32px); overflow: auto;
    padding: 0 16px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl);
    scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent;
  }
  .stepbar {
    display: grid; position: sticky; top: 0; z-index: 3;
    margin: 0 -16px; padding: 16px 16px 12px; background: var(--surface);
    border-bottom: 1px solid var(--border);
  }
  .workbench > .panel:not(.floating) { position: static; max-height: none; overflow: visible; }
  .layout #panel-preview {
    display: flex !important; animation: none;
    position: sticky; top: calc(var(--top-h) + 16px);
  }
  .editor-wrap { height: 46dvh; min-height: 300px; }
  .stage { --stage-max-h: calc(100dvh - 430px); } /* sisakan ruang untuk panel "Siap render" */
  .bottomnav { display: none; }
  .toast { bottom: 24px; }
  .layout.no-editor { grid-template-columns: minmax(0, 1fr); }
  .layout.no-editor .workbench { display: none !important; }
  .layout.no-editor .stage { --stage-max-h: calc(100dvh - 300px); }
  .panel.floating { position: fixed; max-height: calc(100dvh - 16px); }
  /* workbench sticky = stacking context sendiri → angkat di atas preview saat ada jendela floating */
  .workbench.has-float { z-index: var(--z-float); }
  .layout .panel.term-off { display: none !important; }
}
@media (min-width: 1024px) and (max-width: 1240px) {
  .step-btn small { display: none; }
}

/* ===== PERBAIKI DENGAN AI ===== */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.qs-note { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border: 1px dashed rgba(45,212,191,.35); border-radius: var(--r-md); background: rgba(45,212,191,.06); }
.qs-note .i { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; color: var(--primary); }
.ai-fix { border: 1px solid rgba(45,212,191,.28); border-radius: var(--r-md); background: linear-gradient(180deg, rgba(45,212,191,.07), var(--surface-2) 60%); }
.ai-fix summary { display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 12px; cursor: pointer; font-size: 13px; font-weight: 700; color: var(--text); list-style: none; }
.ai-fix summary::-webkit-details-marker { display: none; }
.ai-fix summary .i { width: 16px; height: 16px; color: var(--primary); }
.ai-fix summary .chev { color: var(--muted); transition: transform var(--t-med) var(--ease); transform: rotate(-90deg); }
.ai-fix[open] summary .chev { transform: none; }
.ai-src { margin-left: auto; font: 600 11px var(--mono); padding: 2px 8px; border-radius: 99px; color: var(--muted); background: var(--surface-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 50%; }
.ai-src.ready { color: var(--success); background: var(--success-soft); }
.ai-body { display: flex; flex-direction: column; gap: 10px; padding: 0 12px 12px; }
.ai-fix.docked-left { flex-shrink: 0; }
.ai-keyrow { display: flex; gap: 6px; align-items: stretch; }
.ai-keyrow input { flex: 1; min-width: 0; }
.ai-keyrow .btn, .ai-keyrow .icon-btn { flex-shrink: 0; height: auto; min-height: 40px; }
.ai-keystate { font-size: 12px; color: var(--muted); }
.ai-keystate:empty { display: none; }
.ai-keystate.ok { color: var(--success); }
.ai-keystate.err { color: var(--danger); }
.ai-cfg .row-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ai-cfg #aiDetect[disabled] { opacity: .5; pointer-events: none; }
.ai-cfg #aiModel { margin-top: 6px; }
.ai-cfg .field { display: flex; flex-direction: column; gap: 6px; }
.ai-cfg input[type=text] { font-family: var(--mono); }
.ai-body textarea, .ai-cfg input[type=password], .ai-cfg input[type=text] { width: 100%; min-height: 40px; padding: 9px 11px; border-radius: var(--r-sm, 8px); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: 14px/1.45 inherit; resize: vertical; }
.ai-cfg input[type=password] { font-family: var(--mono); resize: none; }
.ai-body textarea:focus, .ai-cfg input:focus { outline: 2px solid var(--ring); outline-offset: 1px; border-color: transparent; }
.ai-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ai-chips button { min-height: 30px; padding: 0 11px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface-3); color: var(--text-2); font-size: 12px; font-weight: 600; cursor: pointer; }
.ai-chips button:hover { border-color: rgba(45,212,191,.5); color: var(--text); }
.ai-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ai-actions .icon-btn { margin-left: auto; }
.ai-status { margin: 0; font-size: 12px; color: var(--text-2); line-height: 1.5; min-height: 0; }
.ai-status:empty { display: none; }
.ai-status.err { color: var(--danger); }
.ai-status.ok { color: var(--success); }
.ai-status .spin { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: aispin .8s linear infinite; vertical-align: -1px; }
@keyframes aispin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ai-status .spin { animation: none; } }
.ai-cfg { display: flex; flex-direction: column; gap: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.ai-cfg .hint .link-btn { min-height: 0; padding: 0; color: var(--danger); }
#code.ai-busy { opacity: .55; }

/* =========================================================
   STATUS RENDER — warna mengikuti keadaan
   idle (teal) · rendering (biru → teal, bergerak) · done (hijau, Unduh menyala)
   stale (kuning) · error (merah)
   ========================================================= */
:root { --st: var(--primary); --st-rgb: 45, 212, 191; --dl: #22c55e; --dl-rgb: 34, 197, 94; }
.quickrender { --st: var(--primary); --st-rgb: 45, 212, 191; transition: border-color var(--t-med), box-shadow var(--t-med), background var(--t-med); }
.quickrender[data-state="rendering"] { --st: #38bdf8; --st-rgb: 56, 189, 248; }
.quickrender[data-state="done"]      { --st: var(--dl); --st-rgb: var(--dl-rgb); }
.quickrender[data-state="stale"]     { --st: var(--warning); --st-rgb: 251, 191, 36; }
.quickrender[data-state="error"]     { --st: var(--danger); --st-rgb: 248, 113, 113; }
.quickrender {
  background: linear-gradient(180deg, rgba(var(--st-rgb), .07), transparent 70%), var(--surface-2);
  border-color: rgba(var(--st-rgb), .32);
  box-shadow: 0 0 0 1px rgba(var(--st-rgb), .06), 0 10px 30px -18px rgba(var(--st-rgb), .55);
}
/* titik status di judul */
.qr-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--st); align-self: center; flex-shrink: 0; box-shadow: 0 0 0 3px rgba(var(--st-rgb), .18); }
.quickrender[data-state="rendering"] .qr-dot { animation: qrPulse 1.1s ease-in-out infinite; }
@keyframes qrPulse { 50% { box-shadow: 0 0 0 7px rgba(var(--st-rgb), 0); transform: scale(.8); } }
.qr-title b { transition: color var(--t-med); }
.quickrender:not([data-state="idle"]) .qr-title b { color: var(--st); }
.quickrender .qr-engine { color: var(--muted); }

/* garis cahaya berjalan di tepi atas panel saat render */
.quickrender[data-state="rendering"]::before {
  content: ''; position: absolute; left: 12px; right: 12px; top: -1px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--st), #2dd4bf, transparent);
  background-size: 200% 100%; animation: qrSweep 1.6s linear infinite;
}
@keyframes qrSweep { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* progress lebih tebal + kilau */
.quickrender .qr-progress { height: 8px; margin-top: 0; background: rgba(255, 255, 255, .06); }
.quickrender .qr-progress div {
  background: linear-gradient(90deg, #38bdf8, #2dd4bf);
  box-shadow: 0 0 12px rgba(56, 189, 248, .55);
  position: relative; overflow: hidden;
}
.quickrender .qr-progress div::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .45), transparent);
  transform: translateX(-100%); animation: qrShine 1.3s ease-in-out infinite;
}
@keyframes qrShine { to { transform: translateX(100%); } }
.quickrender .qr-info { gap: 6px; }
.quickrender .qr-info:has(.qr-stale[hidden]):has(.qr-progress[hidden]):has(.qr-meta:empty):has(.qr-adobe[hidden]) { display: none; }
.quickrender .qr-info:has(.qr-meta:not(:empty)) { display: flex; }
.qr-meta { font-size: 12px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qr-meta:empty { display: none; }
.quickrender[data-state="done"] .qr-meta { color: #86efac; }
.quickrender[data-state="error"] .qr-meta { color: #fca5a5; white-space: normal; }
.quickrender[data-state="stale"] .qr-meta { color: var(--muted); }

/* tombol Unduh: menyala saat hasil siap */
#btnQuickDownload.primary {
  background: var(--dl); color: #052e16; border-color: transparent; font-weight: 700;
  box-shadow: 0 0 0 1px rgba(var(--dl-rgb), .6), 0 8px 26px -6px rgba(var(--dl-rgb), .75);
  animation: dlGlow 2.2s ease-in-out infinite;
}
#btnQuickDownload.primary:hover { background: #16a34a; color: #fff; }
#btnQuickDownload.pop { animation: dlPop .5s var(--ease), dlGlow 2.2s ease-in-out .5s infinite; }
@keyframes dlGlow { 50% { box-shadow: 0 0 0 1px rgba(var(--dl-rgb), .9), 0 0 28px 2px rgba(var(--dl-rgb), .55); } }
@keyframes dlPop { 0% { transform: scale(.9); } 60% { transform: scale(1.05); } 100% { transform: scale(1); } }
.quickrender[data-state="stale"] #btnQuickDownload { color: var(--text-2); }
/* saat selesai: Unduh jadi aksi utama, Render ulang mengalah */
.quickrender[data-state="done"] .qr-actions #btnQuickDownload { flex: 1 1 auto; order: 0; }
.quickrender[data-state="done"] .qr-actions #btnQuickRender { flex: 0 1 auto; color: var(--text-2); }
#btnQuickCancel { color: #fca5a5; border-color: rgba(248, 113, 113, .4); }
#btnQuickCancel:hover { background: var(--danger-soft); }

/* preview ikut memberi tanda */
.stage { transition: box-shadow var(--t-med); }
body:has(#quickRender[data-state="rendering"]) .stage { box-shadow: 0 0 0 2px rgba(56, 189, 248, .55), 0 0 40px -6px rgba(56, 189, 248, .45), var(--shadow-2); }
body:has(#quickRender[data-state="done"]) .stage { box-shadow: 0 0 0 1px rgba(34, 197, 94, .45), var(--shadow-2); }
.rec-badge { border-color: rgba(56, 189, 248, .45); }
.rec-badge .dot { background: #38bdf8; box-shadow: 0 0 10px #38bdf8; }

/* progress di langkah Ekspor ikut tema yang sama */
.progress .bar div { background: linear-gradient(90deg, #38bdf8, #2dd4bf); }

/* =========================================================
   POLES UMUM
   ========================================================= */
body {
  background:
    radial-gradient(1100px 520px at 90% -12%, rgba(45, 212, 191, .13), transparent 62%),
    radial-gradient(800px 480px at -12% 108%, rgba(56, 189, 248, .09), transparent 60%),
    radial-gradient(600px 300px at 40% 120%, rgba(129, 140, 248, .05), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}
.topbar { background: rgba(10, 11, 16, .7); box-shadow: 0 1px 0 rgba(255, 255, 255, .03), 0 10px 30px -20px rgba(0, 0, 0, .8); }
.logo { box-shadow: 0 6px 18px -4px rgba(45, 212, 191, .55); }
/* kartu: sorot halus di tepi atas */
@media (min-width: 1024px) {
  .workbench, .layout #panel-preview {
    background: linear-gradient(180deg, rgba(255, 255, 255, .025), transparent 140px), var(--surface);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04), 0 20px 50px -30px rgba(0, 0, 0, .9);
  }
}
.step-btn.on { box-shadow: 0 0 0 3px rgba(45, 212, 191, .08), 0 8px 22px -14px rgba(45, 212, 191, .7); }
.step-btn.on .n { box-shadow: 0 0 12px rgba(45, 212, 191, .55); }
.btn.primary { box-shadow: 0 6px 18px -8px rgba(45, 212, 191, .7); }
.btn.primary:hover { box-shadow: 0 8px 22px -8px rgba(45, 212, 191, .85); }
.qs select { transition: border-color var(--t-fast), background-color var(--t-fast); }
.qs select:hover:not(:disabled) { border-color: rgba(45, 212, 191, .45); }
.qs select:disabled { opacity: .55; cursor: not-allowed; }
.play-btn { box-shadow: 0 6px 18px -6px rgba(255, 255, 255, .35); }
.status.ok { box-shadow: inset 0 0 0 1px rgba(52, 211, 153, .18); }
.status.err { box-shadow: inset 0 0 0 1px rgba(248, 113, 113, .25); }

@media (prefers-reduced-motion: reduce) {
  .quickrender[data-state="rendering"] .qr-dot, .quickrender[data-state="rendering"]::before,
  .quickrender .qr-progress div::after, #btnQuickDownload.primary, #btnQuickDownload.pop { animation: none; }
}

/* =========================================================
   MENU 4 · METADATA
   ========================================================= */
/* langkah jadi 4 → label ringkas, keterangan kecil disembunyikan */
.stepbar { grid-template-columns: repeat(4, 1fr); }
.step-btn { padding: 9px 10px; gap: 8px; }
.step-btn small { display: none; }
.step-btn .n { width: 24px; height: 24px; }
.bottomnav { grid-template-columns: repeat(5, 1fr); }
.bottomnav button .i { padding: 3px 10px; }

/* tampil hanya di langkah Meta */
#panel-meta { display: none; }
.workbench[data-step="meta"] #panel-meta { display: flex; }
.workbench[data-step="meta"] #panel-render { display: none !important; }
.layout[data-tab="meta"] .workbench { display: flex; animation: fadeUp var(--t-med) var(--ease); }
@media (max-width: 1023px) {
  .workbench[data-step="meta"] .step-title[data-for="meta"] { display: block; }
}

.meta-card { border: 1px solid rgba(45, 212, 191, .28); border-radius: var(--r-lg); padding: 14px; background: linear-gradient(180deg, rgba(45, 212, 191, .06), transparent 60%), var(--surface-2); display: flex; flex-direction: column; gap: 12px; }
.meta-src { font: 600 11px var(--mono); padding: 3px 9px; border-radius: 99px; background: var(--surface-3); color: var(--text-2); max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meta-actions { display: flex; gap: 8px; }
.meta-actions .btn { flex: 1; }
.meta-actions.wrap { flex-wrap: wrap; }
.meta-actions.wrap .btn.primary { flex: 1 1 100%; }
.meta-status { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--text-2); }
.meta-status:empty { display: none; }
.meta-status.ok { color: var(--success); }
.meta-status.warn { color: var(--warning); }
.meta-status.err { color: var(--danger); }
.meta-status.busy { color: #7dd3fc; }
.meta-status .spin { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: aispin .8s linear infinite; vertical-align: -1px; }
.meta-thumbs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.meta-thumbs:empty { display: none; }
.meta-thumbs img { height: 44px; border-radius: 6px; border: 1px solid var(--border-strong); flex-shrink: 0; }
.meta-fields { display: flex; flex-direction: column; gap: 12px; }
.meta-fields textarea, .meta-fields input[type=text], #panel-meta input[type=text], #panel-meta textarea {
  width: 100%; padding: 9px 11px; border-radius: var(--r-sm); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font: 14px/1.45 var(--font); resize: vertical;
}
#panel-meta textarea:focus, #panel-meta input:focus { outline: 2px solid var(--ring); outline-offset: 1px; border-color: transparent; }
#panel-meta .field { display: flex; flex-direction: column; gap: 6px; }
#panel-meta .row-label { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.val.good { color: var(--success); }
.val.bad { color: var(--warning); }
.kw-chips { display: flex; flex-wrap: wrap; gap: 5px; max-height: 190px; overflow-y: auto; padding: 2px; }
.kw { display: inline-flex; align-items: center; gap: 2px; padding: 3px 4px 3px 9px; border-radius: 99px; font-size: 12px; background: var(--surface-3); border: 1px solid var(--border); color: var(--text-2); }
.kw.top { background: var(--primary-soft); border-color: rgba(45, 212, 191, .35); color: #ccfbf1; }
.kw button { width: 18px; height: 18px; border-radius: 50%; border: 0; background: none; color: var(--muted); font-size: 14px; line-height: 1; display: grid; place-items: center; }
.kw button:hover { background: var(--danger-soft); color: var(--danger); }
.meta-cats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.meta-cats .field:last-child { grid-column: 1 / -1; }
.minmax { display: grid; grid-template-columns: 1fr 92px 92px; gap: 8px; align-items: end; }
.minmax .label { align-self: center; font-size: 13px; }
#panel-meta .num-field { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
#panel-meta .num-field input { width: 100%; min-height: 38px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface-3); color: var(--text); font: 600 14px var(--mono); }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; }
.chip-btn { min-height: 30px; padding: 0 11px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface-3); color: var(--text-2); font-size: 12px; font-weight: 600; }
.chip-btn:hover { border-color: rgba(45, 212, 191, .5); color: var(--text); }
.platform-list { display: flex; flex-direction: column; gap: 6px; }
.pf { display: flex; gap: 10px; align-items: flex-start; padding: 9px 11px; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; transition: border-color var(--t-fast), background var(--t-fast); }
.pf.on { border-color: rgba(45, 212, 191, .5); background: var(--primary-soft); }
.pf input { margin-top: 3px; accent-color: var(--primary); width: 16px; height: 16px; flex-shrink: 0; }
.pf b { display: block; font-size: 13px; }
.pf small { display: block; font-size: 11.5px; color: var(--muted); line-height: 1.4; }
.meta-ok { color: var(--success); font-weight: 600; }

/* tombol metadata di panel Siap render */
#btnQuickMeta { color: #ccfbf1; border-color: rgba(45, 212, 191, .4); }
#btnQuickMeta.has-meta { color: var(--success); border-color: rgba(34, 197, 94, .45); }
#btnQuickMeta:disabled { opacity: .6; cursor: progress; }
.quickrender .qr-actions #btnQuickMeta { flex: 0 1 auto; }
.quickrender .qr-actions #btnQuickPlain { flex: 0 0 auto; width: 44px; height: auto; min-height: 40px; }
@media (min-width: 1024px) {
  /* setelah render ada banyak tombol → baris aksi penuh */
  .quickrender[data-state="done"], .quickrender[data-state="stale"] { grid-template-areas: "head head" "set set" "act act" "info info"; }
  .quickrender[data-state="done"] .qr-actions, .quickrender[data-state="stale"] .qr-actions { min-width: 0; }
}
@media (max-width: 640px) {
  .quickrender .qr-actions { flex-wrap: wrap; }
  .quickrender[data-state="done"] .qr-actions #btnQuickDownload { flex: 1 1 100%; order: -1; }
  .minmax { grid-template-columns: 1fr 76px 76px; }
}

/* ===== Keyword berperingkat (prioritas) ===== */
.kw-field { gap: 8px !important; }
.kw-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kw-head .label { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--text-2); }
.kw-head .label .i { width: 14px; height: 14px; color: var(--primary); }
.kw-head-r { display: inline-flex; align-items: center; gap: 8px; }
.kw-head-r .val { font-size: 11px; padding: 2px 8px; border-radius: 99px; background: var(--surface-3); }
.kw-legend { display: flex; flex-wrap: wrap; gap: 5px; }
.kw-legend span { font-size: 10.5px; font-weight: 700; padding: 3px 9px; border-radius: 99px; border: 1px solid; }
/* 4 tingkat warna */
.t1 { --kc: 52, 211, 153; }  /* hijau  · 1–10  */
.t2 { --kc: 96, 165, 250; }  /* biru   · 11–20 */
.t3 { --kc: 192, 132, 252; } /* ungu   · 21–30 */
.t4 { --kc: 148, 163, 184; } /* abu    · 31+   */
.kw-legend span { color: rgb(var(--kc)); background: rgba(var(--kc), .1); border-color: rgba(var(--kc), .35); }
.kw-chips { max-height: 260px; gap: 6px; }
.kw, .kw.top {
  gap: 5px; padding: 3px 4px 3px 4px; font-size: 12.5px; font-weight: 500; cursor: grab; user-select: none;
  color: var(--text); background: rgba(var(--kc, 148, 163, 184), .1); border: 1px solid rgba(var(--kc, 148, 163, 184), .38);
  transition: transform var(--t-fast), box-shadow var(--t-fast), opacity var(--t-fast);
}
.kw .kn { min-width: 18px; height: 18px; padding: 0 4px; border-radius: 99px; display: inline-grid; place-items: center; font: 700 10px var(--mono); color: #0b1020; background: rgb(var(--kc, 148, 163, 184)); }
.kw:hover { box-shadow: 0 0 0 1px rgba(var(--kc), .6); }
.kw.dragging { opacity: .4; cursor: grabbing; }
.kw.drop { box-shadow: -3px 0 0 0 var(--primary); transform: translateX(2px); }
.kw button { color: rgba(var(--kc, 148, 163, 184), .9); }
#mfKwText { font: 13px/1.5 var(--mono) !important; }
.kw-tip { font-size: 11.5px; }
@media (pointer: coarse) { .kw { cursor: default; } }
.kw-head-r .val, .kw-head-r .link-btn { white-space: nowrap; }
.kw-head .label { min-width: 0; }
@media (max-width: 480px) { .kw-head .label { font-size: 10.5px; letter-spacing: .03em; } .kw-head-r { gap: 4px; } }
.bulk-meta { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: var(--r-md); border: 1px solid rgba(45, 212, 191, .28); background: var(--primary-soft); }
.bulk-meta .hint { font-size: 12px; }

/* ===== Layar progres render (menggantikan preview saat render) ===== */
.render-screen {
  position: absolute; inset: 0; z-index: 5;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(4px, 1.4vh, 12px);
  padding: 16px; text-align: center;
  background:
    radial-gradient(60% 70% at 50% 45%, rgba(56, 189, 248, .16), transparent 70%),
    linear-gradient(180deg, #0b1220, #070a12);
}
.render-screen::after { /* garis halus bergerak di bawah: tanda masih bekerja */
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: linear-gradient(90deg, transparent, #38bdf8, #2dd4bf, transparent); background-size: 200% 100%;
  animation: qrSweep 1.6s linear infinite;
}
.rs-ring { position: relative; width: clamp(72px, 22%, 150px); aspect-ratio: 1; }
.rs-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.rs-ring circle { fill: none; stroke-width: 8; }
.rs-track { stroke: rgba(255, 255, 255, .08); }
.rs-bar { stroke: url(#rsGrad); stroke: #38bdf8; stroke-linecap: round; stroke-dasharray: 326.7; stroke-dashoffset: 326.7; transition: stroke-dashoffset 200ms linear; filter: drop-shadow(0 0 6px rgba(56, 189, 248, .6)); }
.rs-ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: clamp(16px, 3.2vw, 30px); font-weight: 700; color: #e0f2fe; }
.rs-title { font: 700 clamp(13px, 1.6vw, 17px) "Space Grotesk", var(--font); color: var(--text); }
.rs-sub { font-size: clamp(11px, 1.1vw, 13px); color: #7dd3fc; max-width: 90%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rs-note { font-size: 11px; color: var(--muted); }
@media (max-width: 480px) { .rs-note { display: none; } }
@media (prefers-reduced-motion: reduce) { .render-screen::after { animation: none; } }
body:has(#renderScreen:not([hidden])) .frame-label { visibility: hidden; }
body:has(#renderScreen:not([hidden])) .transport { opacity: .45; }
@media (max-width: 640px) {
  .quickrender .qr-actions { display: flex; flex-wrap: wrap; gap: 8px; }
  .quickrender .qr-actions #btnQuickMeta, .quickrender .qr-actions #btnQuickRender { flex: 1 1 0; min-width: 0; }
  .quickrender[data-state="done"] .qr-actions #btnQuickRender, .quickrender[data-state="stale"] .qr-actions #btnQuickRender { flex: 1 1 0; }
  .quickrender .qr-actions #btnQuickPlain { flex: 0 0 44px; }
}

/* peringatan syarat teknis Adobe Stock */
.qr-adobe { display: inline-flex; align-items: flex-start; gap: 6px; font-size: 12px; font-weight: 600; color: #fdba74; line-height: 1.4; }
.qr-adobe .i { width: 14px; height: 14px; margin-top: 1px; flex-shrink: 0; }
/* =========================================================
   PRO / LISENSI
   ========================================================= */
.pro-btn {
  display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 14px; border-radius: 99px;
  border: 1px solid rgba(251, 191, 36, .55); background: linear-gradient(135deg, rgba(251, 191, 36, .18), rgba(249, 115, 22, .12));
  color: #fde68a; font-size: 13px; font-weight: 800; letter-spacing: .01em; white-space: nowrap;
  box-shadow: 0 6px 18px -10px rgba(251, 191, 36, .9); transition: filter var(--t-fast), transform var(--t-fast);
}
.pro-btn:hover { filter: brightness(1.12); }
.pro-btn:active { transform: scale(.97); }
.pro-btn .i { width: 16px; height: 16px; }
.pro-btn.is-pro { color: #fef3c7; background: linear-gradient(135deg, #b45309, #d97706); border-color: transparent; }
@media (max-width: 640px) { .pro-btn { height: 36px; padding: 0 10px; } .pro-btn .lbl { font-size: 12px; } }

.pro-icon { background: linear-gradient(135deg, #f59e0b, #f97316) !important; box-shadow: 0 6px 20px rgba(249, 115, 22, .35) !important; }
.pro-modal .modal-card { max-width: 860px; }
.pro-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 12px 20px 4px; }
.pro-tabs button { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2); font-size: 13px; font-weight: 700; }
.pro-tabs button b { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font: 700 11px var(--mono); background: var(--surface-3); color: var(--muted); }
.pro-tabs button.on { border-color: rgba(251, 191, 36, .6); background: rgba(251, 191, 36, .1); color: var(--text); }
.pro-tabs button.on b { background: #f59e0b; color: #1c1205; }
.pro-reason { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0 0; padding: 10px 12px; border-radius: 12px; background: rgba(251, 191, 36, .08); border: 1px solid rgba(251, 191, 36, .35); color: #fde68a; font-size: 13px; font-weight: 600; }
.pro-reason .i { width: 16px; height: 16px; flex-shrink: 0; }
.pro-reason span { flex: 1; min-width: 160px; }
.pro-status { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--success-soft); border: 1px solid rgba(52, 211, 153, .35); font-size: 12.5px; color: var(--text-2); }
.pro-status b { color: var(--success); font-size: 14px; }
.pro-status.expired { background: var(--danger-soft); border-color: rgba(248, 113, 113, .35); }
.pro-status.expired b { color: var(--danger); }
.pro-status[hidden] { display: none; }

.plan-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 8px; }
.plan {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left;
  padding: 16px 14px 14px; border-radius: 16px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text);
  transition: border-color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
}
.plan:hover { border-color: rgba(251, 191, 36, .5); transform: translateY(-2px); }
.plan.best { border-color: rgba(251, 191, 36, .7); background: linear-gradient(180deg, rgba(251, 191, 36, .1), var(--surface-2) 60%); box-shadow: 0 12px 30px -18px rgba(251, 191, 36, .9); }
.plan.on { outline: 2px solid #f59e0b; outline-offset: 1px; }
.plan-badge { font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 3px 9px; border-radius: 99px; background: var(--surface-3); color: var(--text-2); }
.plan.best .plan-badge { background: #f59e0b; color: #1c1205; }
.plan-name { font: 700 16px "Space Grotesk", var(--font); margin-top: 6px; }
.plan-price { font: 800 24px "Space Grotesk", var(--font); color: #fbbf24; letter-spacing: -.01em; }
.plan-per { font-size: 11.5px; color: var(--muted); font-family: var(--mono); }
.plan small { font-size: 12px; color: var(--text-2); line-height: 1.45; flex: 1; }
.plan-cta { margin-top: 8px; width: 100%; text-align: center; padding: 9px; border-radius: 10px; font-size: 13px; font-weight: 800; background: linear-gradient(135deg, #f59e0b, #f97316); color: #1c1205; }
.compare { margin-top: 14px; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; font-size: 12.5px; }
.compare-head, .compare-row { display: grid; grid-template-columns: 1.6fr 1fr 1.2fr; gap: 8px; padding: 9px 12px; align-items: center; }
.compare-head { background: var(--surface-2); font-size: 12px; color: var(--muted); }
.compare-head .pro, .compare-row .pro { color: #fbbf24; font-weight: 700; }
.compare-row { border-top: 1px solid var(--border); color: var(--text-2); }
.compare-row span:first-child { color: var(--text); }
.compare-row .no { color: var(--muted); }

.pay-wrap { display: grid; grid-template-columns: minmax(200px, 300px) 1fr; gap: 18px; align-items: start; margin-top: 8px; }
.qris-box { background: #fff; border-radius: 16px; padding: 8px; box-shadow: 0 10px 30px -14px rgba(0, 0, 0, .8); }
.qris-box img { width: 100%; height: auto; display: block; border-radius: 10px; }
.pay-info { display: flex; flex-direction: column; gap: 8px; }
.pay-row { display: flex; justify-content: space-between; gap: 10px; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); font-size: 13px; color: var(--text-2); }
.pay-row b { color: var(--text); }
.pay-row.big b { font: 800 22px "Space Grotesk", var(--font); color: #fbbf24; }
.pay-row.big { align-items: center; }
.pay-steps { margin: 4px 0; padding-left: 20px; font-size: 13px; color: var(--text-2); line-height: 1.6; }
.wa-btn { background: #16a34a; color: #fff; border-color: transparent; font-weight: 800; text-decoration: none; }
.wa-btn:hover { background: #15803d; }
.lic-input { width: 100%; min-height: 50px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-size: 20px !important; letter-spacing: .08em; text-align: center; text-transform: uppercase; }
.lic-input:focus { outline: 2px solid #f59e0b; outline-offset: 1px; border-color: transparent; }
.lic-msg { margin: 0; font-size: 13px; font-weight: 600; color: var(--text-2); }
.lic-msg:empty { display: none; }
.lic-msg.ok { color: var(--success); }
.lic-msg.err { color: var(--danger); }
.pro-foot { justify-content: flex-end; }
.quickrender.free::after {
  content: 'Versi gratis: 720p · 30fps · 10 dtk · watermark'; position: absolute; top: 14px; right: 110px;
  font-size: 11px; color: var(--muted); pointer-events: none;
}
@media (max-width: 1100px) { .quickrender.free::after { display: none; } }
@media (max-width: 760px) {
  .plan-grid { grid-template-columns: 1fr; }
  .pay-wrap { grid-template-columns: 1fr; }
  .qris-box { max-width: 300px; margin: 0 auto; }
  .pro-tabs { padding: 10px 16px 4px; }
  .pro-tabs button { font-size: 12px; gap: 5px; }
  .compare-head, .compare-row { grid-template-columns: 1.3fr 1fr 1fr; }
}
.pro-foot a, .pro-modal a.btn { color: var(--text); text-decoration: none; }
.pro-modal a.wa-btn { color: #fff; }
@media (max-width: 760px) { .hide-sm { display: none; } }
.plan-old { display: flex; align-items: center; gap: 8px; margin-top: 2px; font-size: 13px; color: var(--muted); }
.plan-old s { text-decoration-thickness: 2px; text-decoration-color: rgba(248, 113, 113, .8); }
.plan-old em { font-style: normal; font-size: 10.5px; font-weight: 800; letter-spacing: .04em; padding: 2px 8px; border-radius: 99px; background: rgba(248, 113, 113, .16); color: #fca5a5; }
.pay-old { font: 600 13px var(--font); color: var(--muted); margin-right: 6px; text-decoration-color: rgba(248, 113, 113, .8); }
.plan-grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.plan-grid { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.plan-price { font-size: 22px; }
