:root {
  color-scheme: light dark;
  --bg: #F5F6F8; --surface: #FFFFFF; --line: #E4E6EB; --line-2: #EEF0F3;
  --text: #15121A; --text-2: #4A4553; --text-3: #6F6A78;
  --accent: #6A4BEB; --accent-2: #7B5CFF; --accent-soft: #EEEAFF; --rose: #E8417A;
  --ok: #157347; --ok-soft: #E7F5EE; --warn: #A85A00; --warn-soft: #FFF3E0; --danger: #B42335; --danger-soft: #FDECEE;
  --radius: 12px; --shadow: 0 1px 2px rgba(16,12,24,.05), 0 1px 3px rgba(16,12,24,.06);
  --th-bg: #FAFAFB; --row-hover: #F8F6FF; --topbar-bg: rgba(245,246,248,.9); --bar2: #DCD3FF;
  --on-accent: #fff; --toast-bg: #15121A; --toast-fg: #fff;
}
/* Mode gelap: hanya ikut prefers-color-scheme, token di atas ditimpa. */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111015; --surface: #1A1821; --line: #2F2B38; --line-2: #26222E;
    --text: #F2EFF5; --text-2: #CFC9D8; --text-3: #A39DAD;
    --accent: #A996FF; --accent-2: #8F78FF; --accent-soft: #2A2550; --rose: #F06A97;
    --ok: #6FD39C; --ok-soft: #163426; --warn: #F2B65E; --warn-soft: #3A2B12; --danger: #FF8A9A; --danger-soft: #3D1A21;
    --shadow: 0 1px 2px rgba(0,0,0,.4);
    --th-bg: #201D28; --row-hover: #221E2B; --topbar-bg: rgba(17,16,21,.9); --bar2: #4A3F86;
    --on-accent: #1A1421; --toast-bg: #F2EFF5; --toast-fg: #15121A;
  }
}
[hidden] { display: none !important; }
* { box-sizing: border-box; }
body { margin: 0; font-family: "Plus Jakarta Sans", system-ui, sans-serif; font-size: 14px; color: var(--text); background: var(--bg); }
a { color: inherit; text-decoration: none; }
button { font: inherit; }

/* Ikon: CSS mask dari /icons/<nama>.svg */
.icon { width: 18px; height: 18px; display: inline-block; flex: none; background: currentColor;
  -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; }

.app { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; padding: 16px 12px; background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; font-weight: 800; font-size: 15px; }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; color: #fff; background: linear-gradient(140deg, #FFB59A, #E86A9A 55%, #5B2A6E); }
.brand-mark .icon { width: 17px; height: 17px; }
.group { margin: 14px 8px 4px; font-size: 11.5px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; }
a.nav, button.nav { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 8px; background: none; text-align: left; color: var(--text-2); font-weight: 600; cursor: pointer; }
a.nav:hover, button.nav:hover { background: var(--bg); }
a.nav.on { background: var(--accent-soft); color: var(--accent); }
.nav .count { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--text-3); }
.nav .count:empty { display: none; }
.nav .count.alert { color: var(--on-accent); background: var(--danger); padding: 1px 7px; border-radius: 99px; font-size: 11.5px; }
.side-foot { margin-top: auto; display: grid; gap: 4px; border-top: 1px solid var(--line); padding-top: 12px; }
.who { display: flex; align-items: center; gap: 10px; padding: 8px 10px; min-width: 0; }
.who-text { min-width: 0; display: grid; }
.who-text b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-text .updated { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 30px; height: 30px; border-radius: 99px; display: grid; place-items: center; font-weight: 800; font-size: 13px; color: var(--on-accent); background: var(--accent); flex: none; }

.main { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 4; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding-block: 14px; padding-left: max(28px, env(safe-area-inset-left, 0px)); padding-right: max(28px, env(safe-area-inset-right, 0px)); background: var(--topbar-bg); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar h1 { margin: 0; font-size: 20px; font-weight: 800; flex: 1; }
.content { padding-block: 24px 60px; padding-left: max(28px, env(safe-area-inset-left, 0px)); padding-right: max(28px, env(safe-area-inset-right, 0px)); display: grid; gap: 20px; max-width: 1320px; }
.page { display: none; }
.page.on { display: grid; gap: 20px; }
.updated { color: var(--text-3); font-size: 12.5px; }

.btn, .select { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none; }
button.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.danger { color: var(--danger); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn:focus-visible, a.nav:focus-visible, button.nav:focus-visible, .pill:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
.panel-head h2 { margin: 0; font-size: 15px; font-weight: 800; flex: 1; min-width: 0; }
.panel-body { padding: 16px; }
.stack { display: grid; gap: 14px; }
.grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
.grid-2e { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-2 > *, .grid-2e > * { min-width: 0; }
@media (max-width: 1100px) { .grid-2, .grid-2e { grid-template-columns: 1fr; } }

.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.kpi { padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); display: grid; gap: 6px; min-width: 0; }
.kpi .label { display: flex; align-items: center; gap: 6px; color: var(--text-2); font-weight: 600; font-size: 13px; }
.kpi .label .icon { width: 15px; height: 15px; color: var(--text-3); }
.kpi .val { font-size: 26px; font-weight: 800; letter-spacing: -.02em; overflow-wrap: anywhere; }
.kpi .foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; color: var(--text-3); font-size: 12.5px; }
.delta { display: inline-flex; align-items: center; padding: 1px 6px; border-radius: 6px; font-weight: 700; font-size: 12px; }
.delta.up { background: var(--ok-soft); color: var(--ok); }
.delta.down { background: var(--danger-soft); color: var(--danger); }
.live-dot { width: 8px; height: 8px; border-radius: 99px; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); flex: none; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 16px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
th { font-size: 12px; font-weight: 700; color: var(--text-3); background: var(--th-bg); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: 0; }
tbody tr[data-id] { cursor: pointer; }
tbody tr:hover { background: var(--row-hover); }
tr.sel { background: var(--accent-soft) !important; }
.muted { display: block; color: var(--text-3); font-size: 12.5px; font-weight: 500; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 700; background: var(--line-2); color: var(--text-2); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }
.thumb { --h: 300; width: 32px; height: 32px; border-radius: 8px; display: inline-grid; place-items: center; overflow: hidden; color: #fff; vertical-align: middle; margin-right: 10px; background: linear-gradient(140deg, hsl(calc(var(--h) + 20) 75% 70%), hsl(var(--h) 55% 42%)); flex: none; }
.thumb .icon { width: 16px; height: 16px; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
.pill { padding: 5px 12px; border-radius: 99px; border: 1px solid var(--line); font-weight: 600; font-size: 13px; color: var(--text-2); background: var(--surface); cursor: pointer; }
.pill.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.table-wrap { overflow-x: auto; }
.pager { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: center; padding: 10px 16px; color: var(--text-3); font-size: 13px; border-top: 1px solid var(--line-2); }
.empty-cell { text-align: center; padding: 24px; color: var(--text-3); }

.chart { width: 100%; height: 220px; display: block; }
.chart .bar { fill: var(--accent); }
.chart .bar2 { fill: var(--bar2); }
.chart .grid { stroke: var(--line-2); }
.chart text { fill: var(--text-3); font-size: 11px; font-family: inherit; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; color: var(--text-2); font-size: 12.5px; font-weight: 600; }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; background: var(--accent); vertical-align: -1px; }
.legend span.b2::before { background: var(--bar2); }
.meter { height: 8px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.kv { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 16px; align-items: center; margin: 0; }
.kv dt { color: var(--text-2); font-weight: 600; }
.kv dd { margin: 0; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.ret { display: grid; gap: 14px; }
.ret-row { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; }
.ret-row b { font-size: 15px; }
.ret-row .meter { position: relative; height: 10px; overflow: visible; }
.ret-row .target { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text); border-radius: 2px; }

.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.split > * { min-width: 0; }
/* Tabel di sebelah drawer: sel lebih rapat supaya kolom angka tidak terpotong di 1440px. */
.split .table-wrap th, .split .table-wrap td { padding-inline: 12px; }
.split .table-wrap th { white-space: normal; line-height: 1.35; }
.split .table-wrap th.num, .split .table-wrap td.num { padding-left: 8px; }
.drawer { position: sticky; top: 84px; }
.drawer .panel-body { display: grid; gap: 14px; }
.drawer-x { margin-left: auto; font-size: 20px; line-height: 1; padding: 4px 10px; }
@media (max-width: 1200px) {
  .split { grid-template-columns: 1fr; }
  .drawer { position: static; }
  .drawer:not(.open) { display: none; }
  .drawer.open { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100%); z-index: 50; overflow-y: auto; border-radius: 0; box-shadow: -12px 0 32px rgb(0 0 0 / .18); }
}
.field { display: grid; gap: 6px; min-width: 0; }
.field > span { font-weight: 700; font-size: 13px; color: var(--text-2); }
.input { width: 100%; height: 38px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; }
textarea.input { height: auto; min-height: 80px; max-height: 70vh; overflow-y: auto; padding: 10px 12px; line-height: 1.5; resize: none; }
select.input { padding-right: 8px; }
.input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.help { color: var(--text-3); font-size: 12.5px; line-height: 1.45; margin: 0; }
input[type="range"] { width: 100%; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.note { display: flex; gap: 10px; padding: 12px 14px; border-radius: 10px; background: var(--accent-soft); color: var(--text-2); line-height: 1.5; font-size: 13px; }
.note .icon { color: var(--accent); margin-top: 1px; }
.note.danger { background: var(--danger-soft); }
.note.danger .icon { color: var(--danger); }
.stack-list { display: grid; gap: 4px; font-size: 13px; }
.slots { display: grid; grid-template-columns: repeat(16, minmax(0, 1fr)); gap: 4px; }
.slots i { height: 16px; border-radius: 3px; background: var(--line-2); }
.slots i.on { background: var(--accent); }
.search { display: flex; align-items: center; gap: 8px; width: 240px; max-width: 100%; height: 36px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text-3); }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; font: inherit; color: var(--text); }
.search:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.top-search { width: 260px; }
.range-wrap { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text-3); }
.range-wrap:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.range-select { border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.menu-btn, .side-x { display: none; }
.menu-btn { width: 36px; padding: 0; }
.scrim { position: fixed; inset: 0; z-index: 55; background: rgb(15 13 19 / .4); }
body.side-lock { overflow: hidden; }

.prompt-top { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.prompt-char { min-width: 240px; max-width: 100%; }
.prompt-top .help { max-width: 52ch; margin: 0 0 6px; }
.flow { margin: 0; padding-left: 22px; display: grid; gap: 8px; font-size: 13.5px; line-height: 1.5; color: var(--text-2); }
.code-block { margin: 0; padding: 12px 14px; max-height: 360px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font: 12.5px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--text-2); background: var(--line-2); border-radius: 8px; }
.msg { display: grid; gap: 6px; min-width: 0; }
.bg-block { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; min-width: 0; }
.bg-block summary { cursor: pointer; font-weight: 700; font-size: 13.5px; list-style: none; display: flex; align-items: center; gap: 8px; }
.bg-block summary::-webkit-details-marker { display: none; }
.bg-block summary::after { content: ""; margin-left: auto; flex: none; width: 7px; height: 7px; border-right: 2px solid var(--text-3); border-bottom: 2px solid var(--text-3); transform: translateY(-2px) rotate(45deg); transition: transform .15s ease; }
.bg-block[open] summary::after { transform: translateY(1px) rotate(225deg); }
.bg-block[open] summary { margin-bottom: 12px; }
.badge.flag { min-width: 24px; justify-content: center; font-variant-numeric: tabular-nums; }
.flag-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13px; }
.flag-list li { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.chips { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.chip { display: inline-block; padding: 1px 8px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 700; }

.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; text-align: center; }
.gate-box { display: grid; gap: 14px; justify-items: center; }
.gate-box p { margin: 0; font-weight: 700; font-size: 16px; }
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; z-index: 50; width: max-content; max-width: calc(100vw - 32px); }
.toast { background: var(--toast-bg); color: var(--toast-fg); padding: 10px 14px; border-radius: 10px; box-shadow: 0 4px 16px rgba(16,12,24,.2); font-weight: 600; font-size: 13px; }
.toast.err { background: var(--danger); }

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  /* Sidebar jadi panel off-canvas, dibuka dari tombol menu di topbar. */
  .side { position: fixed; top: 0; left: 0; bottom: 0; width: min(280px, 84vw); height: 100vh; z-index: 60; transform: translateX(-105%); visibility: hidden; transition: transform .2s ease, visibility .2s; border-right: 1px solid var(--line); }
  .side.open { transform: none; visibility: visible; box-shadow: 12px 0 32px rgb(0 0 0 / .18); }
  .side-x { display: inline-flex; position: absolute; top: 12px; right: 12px; }
  .menu-btn { display: inline-flex; }
  .top-search { display: none; }
  .topbar, .content { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .updated { display: none; }
  .search { width: 100%; }
  .panel-head h2 { flex: 1 1 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi .val { font-size: 22px; }
  .prompt-char { min-width: 0; width: 100%; }
  .slots { grid-template-columns: repeat(8, minmax(0, 1fr)); }
  .topbar h1 { font-size: 18px; }
}

/* Engine (#prompt): parameter, aturan global, riwayat, pratinjau per karakter */
.topbar .badge { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.help a { color: var(--accent); font-weight: 700; }
.eng-body { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 20px; }
.eng-field small.help { display: block; margin-top: 2px; }
.eng-def { color: var(--text-3); font-weight: 500; font-size: 12.5px; margin-left: 4px; }
.eng-ctl { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.eng-ctl .uk-range { flex: 1 1 140px; min-width: 0; }
.eng-ctl .uk-num { width: 160px; flex: none; }
.eng-ctl .input[aria-invalid="true"] { border-color: var(--danger); }
.eng-unit { color: var(--text-3); font-weight: 600; }
.eng-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.field-label { font-weight: 700; font-size: 13px; color: var(--text-2); }
textarea.input.eng-rules { width: 100%; min-height: 280px; font: 13px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre; overflow: auto; }
.eng-diff { max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 6px 0; font: 12.5px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; }
.eng-diff div { padding: 0 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.eng-diff .diff-add { background: var(--ok-soft); color: var(--ok); }
.eng-diff .diff-del { background: var(--danger-soft); color: var(--danger); }
.eng-hist { list-style: none; margin: 0; padding: 0; display: grid; min-width: 0; }
.eng-hist > li { display: grid; gap: 6px; min-width: 0; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.eng-hist > li:first-child { padding-top: 0; }
.eng-hist > li:last-child { border-bottom: 0; padding-bottom: 0; }
.eng-hist > li > .help { margin: 0; }
.eng-hist-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.eng-hist-top .help { flex: 1 1 auto; overflow-wrap: anywhere; }
.eng-confirm { flex-wrap: wrap; }
.eng-confirm > span { flex: 1 1 220px; }
.eng-preview { min-width: 0; }
.eng-sum { display: flex; align-items: center; gap: 10px; padding: 14px 16px; font-weight: 800; font-size: 15px; cursor: pointer; list-style: none; }
.eng-sum::-webkit-details-marker { display: none; }
.eng-sum::before { content: ""; flex: none; width: 7px; height: 7px; border-right: 2px solid var(--text-3); border-bottom: 2px solid var(--text-3); transform: translateY(-2px) rotate(45deg); transition: transform .15s ease; }
.eng-preview[open] > .eng-sum::before { transform: translateY(1px) rotate(225deg); }
.eng-sum::after { content: "Tampilkan"; margin-left: auto; color: var(--text-3); font-size: 13px; font-weight: 600; }
.eng-preview[open] > .eng-sum { border-radius: var(--radius) var(--radius) 0 0; border-bottom-color: transparent; }
.eng-preview[open] > .eng-sum::after { content: "Sembunyikan"; }
.eng-preview-body { margin-top: 0; padding: 20px 0 0; }
@media (max-width: 860px) {
  .eng-ctl .uk-num { width: 128px; }
  .eng-hist-top .help { flex-basis: 100%; }
}

/* Komponen native -> kustom (lihat ui-kit.css untuk Select, NumberField, Slider, DatePicker, SearchField, Tooltip) */
/* Checkbox dan radio: sama dengan style.css, tanpa tampilan native. */
input[type="checkbox"], input[type="radio"] {
  -webkit-appearance: none; appearance: none; flex: none; display: inline-grid; place-content: center;
  width: 18px; height: 18px; margin: 0; border: 1.5px solid var(--line); background: var(--surface);
  cursor: pointer; transition: background-color .12s ease, border-color .12s ease;
}
input[type="checkbox"] { border-radius: 5px; }
input[type="radio"] { border-radius: 50%; }
input[type="checkbox"]::before {
  content: ""; width: 5px; height: 9px; margin-top: -2px; border-right: 2px solid var(--on-accent); border-bottom: 2px solid var(--on-accent);
  transform: rotate(45deg) scale(0); transition: transform .12s ease;
}
input[type="checkbox"]:checked::before { transform: rotate(45deg) scale(1); }
input[type="radio"]::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--on-accent); transform: scale(0); transition: transform .12s ease; }
input[type="radio"]:checked::before { transform: scale(1); }
input[type="checkbox"]:checked, input[type="radio"]:checked { background: var(--accent); border-color: var(--accent); }
input[type="checkbox"]:hover:not(:disabled), input[type="radio"]:hover:not(:disabled) { border-color: var(--accent-2); }
input[type="checkbox"]:disabled, input[type="radio"]:disabled { opacity: .45; cursor: default; }

/* Fokus keyboard: satu token untuk semua elemen interaktif. */
:where(button, a, summary, [role="option"], [tabindex]):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
:where(input[type="checkbox"], input[type="radio"]):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Search: sembunyikan × native (WebKit); clear sendiri di ui-kit.css */
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; appearance: none; display: none; }

/* Autofill: ikut token surface dan teks, bukan biru atau kuning browser */
input:-webkit-autofill, textarea:-webkit-autofill, select:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px var(--surface) inset !important; box-shadow: 0 0 0 1000px var(--surface) inset !important;
  -webkit-text-fill-color: var(--text); caret-color: var(--text); transition: background-color 9999s ease-out 0s;
}

/* Scrollbar tipis dengan token (Firefox dan Chromium baru pakai scrollbar-width; WebKit lama pakai ::-webkit-scrollbar) */
* { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 99px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); background-clip: padding-box; }

/* Playground: iframe chat kiri, panel biaya kanan */
.pg-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.pg-layout > * { min-width: 0; }
.pg-stage { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.pg-frame { display: block; width: 100%; height: calc(100vh - 150px); min-height: 620px; border: 0; background: var(--bg); }
.pg-empty { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; padding: 24px; text-align: center; color: var(--text-3); }
.pg-item { display: grid; gap: 2px; width: 100%; text-align: left; padding: 8px 10px; border-radius: 8px; border: 1px solid transparent; background: none; color: var(--text); font: inherit; cursor: pointer; }
.pg-item:hover { background: var(--line-2); }
.pg-item.on { border-color: var(--accent); }
.pg-bar { display: flex; height: 12px; border-radius: 99px; overflow: hidden; background: var(--line-2); }
.pg-bar i { display: block; height: 100%; min-width: 0; }
.pg-sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 8px; vertical-align: middle; }
.pg-proj { margin: 0; font-weight: 700; font-size: 15px; }
@media (max-width: 1100px) { .pg-layout { grid-template-columns: 1fr; } .pg-frame { height: 70vh; min-height: 520px; } }
