/* KTR.Plus+ bergaya layanan streaming: latar #141414, teks putih/abu, merah untuk aksi utama,
   wordmark merah (Bebas Neue), Inter untuk semua teks (angka tabular, tanpa huruf mono).
   Tata letak tetap: form kiri, hero + riwayat kanan.
   --accent = isian (tombol, avatar); --accent-text = teks merah di atas latar gelap. */
:root {
  --bg: #141414; --panel: #1c1c1c; --panel-2: #262626; --line: #2b2b2b; --line-2: #444444;
  --text: #ffffff; --muted: #b3b3b3; --dim: #8c8c8c;
  --sel: #ffffff; --sel-bg: #333333;
  --accent: #e5252a; --accent-ink: #ffffff; --accent-text: #ff5c5c; --accent-tint: rgba(229, 37, 42, .16);
  --ok: #46d369; --warn: #e8a33a; --warn-bg: #221a0d; --err: #ff7b7b;
  --sans: "Inter", "Helvetica Neue", "Segoe UI", Roboto, sans-serif;
  --mono: var(--sans);
  --logo: "Bebas Neue", "Arial Narrow", Impact, sans-serif;
  --r-s: 4px; --r-m: 6px;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 13.5px/1.5 var(--sans); }
button, select, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--sel); outline-offset: 2px; }
[hidden] { display: none !important; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
body, button, input, select, textarea { font-variant-numeric: tabular-nums; }
a { color: var(--text); }

/* ---------------------------------------------------------------- navigasi atas */
.top { display: flex; align-items: center; gap: 36px; height: 64px; padding: 0 28px; background: linear-gradient(180deg, #000 0%, #0b0b0b 100%); border-bottom: 1px solid #1f1f1f; min-width: 0; }
.brand { display: flex; align-items: baseline; gap: 1px; flex: none; text-decoration: none; color: var(--text); }
/* wordmark merah */
.brand .mark, .brand b { font: 400 34px/1 var(--logo); color: var(--accent); letter-spacing: .01em; }
.group { display: flex; align-items: stretch; gap: 22px; height: 100%; }
.nav { position: relative; display: flex; align-items: center; height: 100%; padding: 0; border: none; background: none; color: #e5e5e5; font-size: 14.5px; font-weight: 400; cursor: pointer; white-space: nowrap; text-decoration: none; transition: color .2s; }
.nav:hover { color: var(--muted); }
.nav.on { color: #fff; font-weight: 700; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 12px; flex: none; }
.quota { display: flex; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-s); padding: 7px 12px; font-size: 12.5px; color: var(--muted); }
.quota .big { font: 600 14px var(--mono); color: var(--text); font-variant-numeric: tabular-nums; }
.keybtn { border: 1px solid var(--line-2); background: none; color: var(--text); border-radius: var(--r-s); padding: 7px 14px; font-weight: 600; cursor: pointer; text-decoration: none; font-size: 13.5px; }
.keybtn:hover { background: var(--panel-2); }
.top .simtag { margin-left: -16px; }
.simtag { font: 600 11px var(--mono); color: var(--warn); border: 1px solid #4f3b14; background: var(--warn-bg); padding: 3px 8px; border-radius: 4px; }

/* ---------------------------------------------------------------- tata letak aplikasi */
.app { display: grid; grid-template-columns: 430px 1fr; grid-template-rows: 64px minmax(0, 1fr); height: 100vh; }
.app > .top { grid-column: 1 / -1; }
.form-col { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; background: #0f0f0f; }
.form-scroll { flex: 1; overflow-y: auto; padding: 22px 22px 12px; }
.res-col { overflow-y: auto; padding: 24px 28px 32px; min-width: 0; }
.full { grid-column: 1 / -1; overflow-y: auto; padding: 24px 28px 40px; min-height: 0; }

.notice { display: flex; gap: 10px; padding: 10px 12px; border: 1px solid #4f3b14; background: var(--warn-bg); color: #f0c27a; border-radius: var(--r-s); font-size: 12px; margin-bottom: 18px; }
.notice svg { flex: none; width: 15px; height: 15px; margin-top: 2px; }
.notice.err { border-color: #5a1f22; background: #2a1214; color: #ffb4b4; }
.sec { font-size: 14px; color: var(--text); margin: 24px 0 10px; font-weight: 700; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.sec:first-child { margin-top: 0; }
.sec span { color: var(--dim); font-weight: 400; font-size: 12px; }

.select { position: relative; }
.select select { appearance: none; width: 100%; background: var(--panel); border: 1px solid var(--line); color: var(--text); border-radius: var(--r-s); padding: 9px 34px 24px 12px; font-weight: 500; cursor: pointer; }
.select .sub { position: absolute; left: 13px; bottom: 7px; font-size: 11.5px; color: var(--muted); pointer-events: none; }
.select::after { content: ""; position: absolute; right: 14px; top: 50%; width: 7px; height: 7px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.select.plain select { padding: 9px 34px 9px 12px; }
.tabs { display: flex; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-s); padding: 3px; gap: 3px; }
.tabs button { flex: 1; border: none; background: none; color: var(--muted); padding: 7px 6px; border-radius: 4px; cursor: pointer; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tabs button.on { background: var(--sel); color: #000; font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { border: 1px solid var(--line); background: var(--panel); color: var(--muted); padding: 6px 11px; border-radius: var(--r-s); cursor: pointer; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.chips button:hover { border-color: var(--line-2); color: var(--text); }
.chips button.on { border-color: var(--sel); color: #000; background: var(--sel); font-weight: 600; }
.chips button span { opacity: .6; }

.slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.slot { position: relative; aspect-ratio: 1.08; border: 1px dashed var(--line-2); border-radius: var(--r-s); background: var(--panel); cursor: pointer; overflow: hidden; display: grid; place-items: center; color: var(--dim); font-size: 12px; }
.slot:hover, .slot.over { border-color: var(--sel); color: var(--text); }
.slot .lbl { position: absolute; left: 6px; top: 5px; font: 500 10px var(--mono); color: var(--text); background: #000b; padding: 1px 4px; border-radius: 3px; z-index: 2; }
.slot.filled { border-style: solid; cursor: default; }
.slot img, .slot video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slot .fname { position: absolute; left: 6px; right: 6px; bottom: 24px; font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.slot .st { position: absolute; left: 5px; bottom: 5px; font: 500 10px var(--mono); padding: 1px 5px; border-radius: 3px; background: #000c; z-index: 2; color: var(--text); }
.slot .st.busy { color: var(--warn); }
.slot .x, .slot .mv { position: absolute; right: 4px; width: 22px; height: 22px; border-radius: 4px; border: none; background: #000c; color: #fff; cursor: pointer; font-size: 11px; z-index: 2; opacity: 0; }
.slot .x { top: 4px; } .slot .mv { bottom: 4px; }
.slot.filled:hover .x, .slot.filled:hover .mv, .slot .x:focus-visible, .slot .mv:focus-visible { opacity: 1; }
.refnote { color: var(--dim); font-size: 11.5px; margin-top: 6px; }

textarea { width: 100%; min-height: 160px; resize: vertical; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-s); color: var(--text); padding: 10px 12px; line-height: 1.55; }
textarea:focus, .inp:focus { outline: none; border-color: var(--sel); }
.inp { width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-s); color: var(--text); padding: 9px 12px; }
.toggle { display: flex; align-items: center; justify-content: space-between; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-s); padding: 9px 12px; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle .sw { width: 34px; height: 19px; border-radius: 99px; background: #2f2f34; position: relative; transition: background .15s; flex: none; }
.toggle .sw::after { content: ""; position: absolute; left: 2px; top: 2px; width: 15px; height: 15px; border-radius: 50%; background: #9a9aa3; transition: left .15s; }
.toggle input:checked + .sw { background: var(--sel); }
.toggle input:checked + .sw::after { left: 17px; background: #111; }
.toggle input:focus-visible + .sw { outline: 2px solid var(--sel); outline-offset: 2px; }

.form-foot { padding: 14px 22px 16px; border-top: 1px solid var(--line); background: #0f0f0f; }
.gen { width: 100%; border: none; border-radius: var(--r-s); padding: 14px; background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 15px; cursor: pointer; display: flex; justify-content: center; align-items: center; gap: 10px; }
.gen:hover { filter: brightness(1.06); } .gen:disabled { opacity: .55; cursor: not-allowed; }
.gen .cost { font: 500 12px var(--mono); opacity: .75; }
.form-hint { color: var(--warn); font-size: 12.5px; margin-top: 8px; }
.form-hint.muted { color: var(--dim); }
.form-hint:empty { display: none; }

/* ---------------------------------------------------------------- hero (hasil terpilih) */
.hero { position: relative; border-radius: var(--r-m); overflow: hidden; background: #000; }
.hero-badge { position: absolute; top: 16px; right: 16px; z-index: 4; }
.badge { font: 600 11px var(--mono); padding: 3px 8px; border-radius: 4px; background: rgba(0,0,0,.6); color: var(--muted); }
.badge.busy { color: var(--warn); } .badge.ok { color: var(--ok); } .badge.err { color: var(--err); }
.result-body { min-height: 380px; display: grid; place-items: center; text-align: center; color: var(--muted); padding: 20px; }
.result-body h4 { margin: 0 0 8px; color: var(--text); font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.result-media { position: relative; width: 100%; min-height: 440px; display: grid; grid-template-columns: minmax(280px, 1fr) minmax(0, 1.15fr); text-align: left; isolation: isolate; }
.result-media .bg { position: absolute; inset: -60px; width: calc(100% + 120px); height: calc(100% + 120px); object-fit: cover; filter: blur(40px) brightness(.32) saturate(1.3); z-index: -1; pointer-events: none; }
.result-media .m { display: grid; place-items: center; padding: 24px; min-width: 0; order: 2; }
.result-media .m video, .result-media .m img { max-width: 100%; max-height: 62vh; display: block; border-radius: var(--r-s); box-shadow: 0 24px 60px rgba(0,0,0,.55); background: #000; }
.result-media .info { order: 1; padding: 40px 12px 32px 36px; display: flex; flex-direction: column; justify-content: flex-end; gap: 12px; font-size: 13px; color: #cfcfcf; min-width: 0; }
.result-media.compact { min-height: 0; }
.result-body:has(> .compact) { min-height: 0; padding: 0; }
.result-media.compact .info { padding: 22px 12px 22px 28px; justify-content: center; }
.result-media.compact .m { padding: 22px 28px; }
.result-media.compact .hero-title { font-size: 20px; -webkit-line-clamp: 2; }
.hero-title { overflow-wrap: anywhere; margin: 0; color: #fff; font-size: 30px; line-height: 1.15; font-weight: 800; letter-spacing: -0.025em; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: #d6d6d6; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.hero-actions a, .hero-actions button { display: inline-flex; align-items: center; min-height: 40px; padding: 0 18px; border-radius: var(--r-s); border: none; background: rgba(109,109,110,.7); color: #fff; font-weight: 700; text-decoration: none; font-size: 14px; cursor: pointer; }
.hero-actions a:hover, .hero-actions button:hover { background: rgba(255,255,255,.22); }
.hero-actions .primary { background: #fff; color: #000; }
.hero-actions .primary:hover { background: rgba(255,255,255,.75); }
details { font-size: 12px; color: var(--muted); }
details .p { color: #bdbdbd; white-space: pre-wrap; max-height: 120px; overflow: auto; font-size: 12.5px; margin-top: 6px; }
.err-text { color: var(--err); font-size: 12.5px; white-space: pre-wrap; }
.pbig { width: 100%; max-width: 420px; padding: 40px 20px; margin: 0 auto; }
.pmini { width: 100%; padding: 0 14px; }
.prow { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; font-size: 12.5px; color: var(--muted); }
.prow b { color: var(--text); font: 500 22px var(--mono); }
.pmini .prow b { font-size: 14px; }
.pbig .sub { font-size: 12px; color: var(--dim); margin-top: 8px; }
.pbar { height: 4px; background: #2a2a2e; border-radius: 2px; overflow: hidden; margin-top: 8px; }
.pbar i { display: block; height: 100%; background: var(--accent); transition: width .6s ease; }
.pbar.indet i { width: 35%; animation: slide 1.4s ease-in-out infinite; }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(300%); } }

/* ---------------------------------------------------------------- grid riwayat */
.rail-head { display: flex; align-items: center; gap: 12px; margin: 30px 0 14px; }
.rail-head h3 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.rail-head .num { color: var(--dim); font-size: 13px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 20px 16px; padding: 4px 2px 12px; }
.card { min-width: 0; display: flex; flex-direction: column; cursor: pointer; border-radius: var(--r-m); }
.card .thumb { aspect-ratio: 16 / 9; background: #161616; display: grid; place-items: center; color: var(--muted); position: relative; font-size: 12.5px; border-radius: var(--r-m); overflow: hidden; outline: 2px solid transparent; outline-offset: -2px; transition: transform .2s ease; }
.card:hover .thumb { transform: scale(1.03); }
.card.sel .thumb { outline-color: var(--sel); }
.card .thumb video, .card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .cbody { padding: 10px 2px 2px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card .ttl { overflow-wrap: anywhere; font-size: 14px; font-weight: 700; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tags { display: flex; gap: 2px 10px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.tag { white-space: nowrap; }
.tag.err { color: var(--err); } .tag.busy { color: var(--warn); }
.card .acts { display: flex; gap: 2px; padding: 2px 0 0; }
.card .acts button, .card .acts a { width: 32px; height: 30px; border: none; background: none; border-radius: 4px; color: var(--muted); cursor: pointer; display: grid; place-items: center; text-decoration: none; }
.card .acts button:hover, .card .acts a:hover { background: var(--sel-bg); color: var(--text); }
.card .acts svg { width: 15px; height: 15px; }
.empty-grid { color: var(--muted); padding: 30px 20px; font-size: 13.5px; border: 1px dashed var(--line-2); border-radius: var(--r-m); grid-column: 1 / -1; }

/* ---------------------------------------------------------------- editing */
.edit-view { grid-column: 1 / -1; display: grid; grid-template-columns: 300px minmax(0, 1fr); min-height: 0; }
.ed-lib { border-right: 1px solid var(--line); background: #0f0f0f; padding: 18px 16px; overflow-y: auto; min-height: 0; }
.ed-h { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.ed-h h3 { margin: 0; font-size: 16px; font-weight: 800; letter-spacing: -0.01em; }
.ed-h .btn2 { margin-left: auto; }
.ed-hint { font-size: 12px; color: var(--dim); margin-bottom: 10px; }
.ed-item { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 6px; border-radius: var(--r-s); cursor: pointer; }
.ed-item:hover { background: var(--panel); }
.ed-item.sel { background: var(--sel-bg); }
.ed-item video, .ed-clip video { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 6px; background: #000; display: block; }
.ed-item .t { font-size: 12.5px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ed-item .d { font-size: 11.5px; color: var(--dim); }
.ed-add { border: 1px solid var(--line-2); background: none; color: var(--text); border-radius: 6px; width: 32px; height: 32px; cursor: pointer; font-size: 18px; line-height: 1; }
.ed-add:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.ed-btns { display: flex; flex-direction: column; gap: 4px; }
.ed-del { border: 1px solid transparent; background: none; color: var(--dim); border-radius: 6px; width: 32px; height: 32px; cursor: pointer; display: grid; place-items: center; flex: none; }
.ed-del svg { width: 15px; height: 15px; }
.ed-del:hover, .ed-del:focus-visible { color: var(--err); border-color: #5a1f22; background: #2a1214; }
.ed-main { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.ed-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 14px 24px; border-bottom: 1px solid var(--line); }
.ed-top .inp { width: 220px; padding: 7px 10px; }
.ed-top select { background: var(--panel); color: var(--text); border: 1px solid var(--line-2); border-radius: var(--r-s); padding: 7px 10px; font-weight: 600; }
.ed-look { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.ed-total { margin-left: auto; color: var(--muted); font-size: 12.5px; text-align: right; }
.ed-top .btnl { flex: none; display: inline-flex; align-items: center; gap: 10px; }
.ed-top .btnl .cost { font: 500 12px var(--mono); opacity: .75; }
.ed-top .btnl:disabled { opacity: .55; cursor: not-allowed; filter: none; }
.ed-status { padding: 0 24px; font-size: 12.5px; color: var(--warn); }
.ed-status:not(:empty) { padding: 10px 24px; border-bottom: 1px solid var(--line); }
.ed-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.ed-preview { padding: 18px 24px; overflow-y: auto; min-width: 0; }
.ed-preview video.main { width: 100%; max-height: 46vh; background: #000; border-radius: var(--r-s); display: block; }
.ed-pinfo { font-size: 12px; color: var(--muted); margin-top: 8px; }
.ed-tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; }
.ed-tools label { display: inline-flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--muted); cursor: pointer; margin-left: 4px; }
.ed-tools input { accent-color: var(--accent); }
.ed-frames { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 10px; }
.ed-frames:empty { display: none; }
.ed-frame { border: 1px solid var(--line-2); border-radius: var(--r-s); overflow: hidden; background: #000; }
.ed-frame img { width: 100%; aspect-ratio: 16/9; object-fit: contain; display: block; }
.ed-frame .meta { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; padding: 6px 8px; background: var(--panel); font-size: 11.5px; color: var(--muted); }
.ed-frame .meta a, .ed-frame .meta button { color: var(--text); background: none; border: none; padding: 0; cursor: pointer; font-size: 11.5px; text-decoration: underline; text-underline-offset: 2px; }
.ed-seq { padding: 18px 24px; overflow-y: auto; border-left: 1px solid var(--line); min-width: 0; }
.ed-empty { border: 1px dashed var(--line-2); border-radius: var(--r-m); padding: 26px 18px; color: var(--muted); font-size: 13px; text-align: center; }
.ed-clip { display: grid; grid-template-columns: 22px 112px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 10px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--panel); }
.ed-clip.sel { border-color: var(--sel); }
.ed-clip .idx { font: 700 13px var(--mono); color: var(--accent-text); padding-top: 2px; }
.ed-clip .ttl { font-size: 13px; font-weight: 700; overflow-wrap: anywhere; line-height: 1.3; cursor: pointer; }
.ed-clip .sub { font-size: 11.5px; color: var(--dim); margin-top: 2px; }
.ed-trim { display: flex; flex-wrap: wrap; gap: 6px 10px; margin-top: 8px; font-size: 12px; color: var(--muted); align-items: center; }
.ed-trim input { width: 74px; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; color: var(--text); padding: 4px 6px; font: 12px var(--mono); }
.ed-trim button, .ed-ops button { border: 1px solid var(--line-2); background: none; color: var(--muted); border-radius: 6px; padding: 3px 7px; font-size: 11.5px; cursor: pointer; }
.ed-trim button:hover, .ed-ops button:hover { color: var(--text); border-color: var(--text); }
.ed-ops { display: flex; flex-direction: column; gap: 4px; }
.ed-cuts { display: flex; flex-wrap: wrap; gap: 4px 6px; margin-top: 8px; font-size: 11.5px; color: var(--dim); align-items: center; }
.ed-cuts button { border: 1px solid var(--line-2); background: none; color: var(--muted); border-radius: 6px; padding: 2px 6px; font: 11px var(--mono); cursor: pointer; }
.ed-cuts button.in { border-color: var(--accent); color: var(--accent-text); }
.ed-cuts button:hover { color: var(--text); border-color: var(--text); }
.ed-tr { margin: 6px 0 6px 32px; padding: 8px 10px; border-left: 2px dashed var(--line-2); display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-size: 12px; color: var(--muted); }
.ed-tr .chips button { padding: 4px 9px; font-size: 12px; }
.ed-tr label { display: inline-flex; gap: 5px; align-items: center; cursor: pointer; }
.ed-tr input { accent-color: var(--accent); }
.ed-tr select { background: var(--panel); color: var(--text); border: 1px solid var(--line-2); border-radius: 6px; padding: 2px 4px; font-size: 12px; }
.ed-render { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-s); margin-bottom: 6px; font-size: 12.5px; }
.ed-render .acts { display: flex; gap: 10px; align-items: center; }
.ed-render a { color: var(--text); }
.ed-render .pbar { margin-top: 6px; }
@media (max-width: 1100px) { .ed-body { grid-template-columns: 1fr; } .ed-seq { border-left: none; border-top: 1px solid var(--line); } .edit-view { grid-template-columns: 240px minmax(0, 1fr); } }
@media (max-width: 860px) {
  .edit-view { display: block; }
  .ed-lib { border-right: none; border-bottom: 1px solid var(--line); max-height: 45vh; }
  .ed-top { padding: 12px 16px; } .ed-top .inp { width: 100%; } .ed-preview, .ed-seq { padding: 16px; }
  .ed-clip { grid-template-columns: 22px 84px minmax(0, 1fr) auto; }
}

/* ---------------------------------------------------------------- akun */
.quota-btn { cursor: pointer; font: inherit; }
.quota-btn:hover { border-color: var(--line-2); }
.avatar-btn { width: 36px; height: 36px; border-radius: 4px; border: none; background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 15px; cursor: pointer; display: grid; place-items: center; flex: none; }
.avatar-btn:hover { filter: brightness(1.08); }
.avatar-btn.on, .avatar-btn[aria-expanded="true"] { outline: 2px solid var(--sel); outline-offset: 2px; }
.acct-menu { position: relative; flex: none; }
.dropdown { position: absolute; right: 0; top: calc(100% + 10px); width: 290px; max-width: calc(100vw - 32px); z-index: 40; background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r-m); padding: 8px; }
.dd-head { display: flex; gap: 10px; align-items: center; padding: 6px 8px 10px; }
.avatar-sm { width: 38px; height: 38px; border-radius: 4px; background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 16px; display: grid; place-items: center; flex: none; }
.dd-name { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dd-bal { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; padding: 10px 12px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-s); }
.dd-bal .k { font-size: 11.5px; color: var(--muted); }
.dd-money { font-size: 19px; font-weight: 600; color: var(--text); }
.dd-link { background: none; border: none; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: 12px; padding: 0; white-space: nowrap; }
.dd-link:hover { color: var(--text); }
.dd-sep { height: 1px; background: var(--line); margin: 6px 0; }
.dd-item { display: block; width: 100%; text-align: left; background: none; border: none; color: var(--text); padding: 9px 10px; border-radius: 6px; cursor: pointer; font-size: 13.5px; }
.dd-item:hover, .dd-item:focus-visible { background: var(--sel-bg); outline: none; }
.dd-item.danger { color: var(--err); }
.acc-wrap { max-width: 1120px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.acc-wrap .stats { margin-bottom: 0; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.acc-inline .btn2 { white-space: nowrap; }
@media (max-width: 600px) { .acc-wrap .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.acc-head { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 16px; }
.acc-profile { display: flex; gap: 18px; align-items: center; }
.avatar-lg { width: 72px; height: 72px; border-radius: 4px; background: var(--accent); color: var(--accent-ink); font-size: 30px; font-weight: 800; display: grid; place-items: center; flex: none; }
.acc-id { min-width: 0; flex: 1; }
.acc-name { margin: 0 0 2px; font-size: 24px; font-weight: 800; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.acc-inline { display: flex; gap: 8px; margin-top: 12px; max-width: 420px; }
.acc-inline .inp { padding: 7px 10px; }
.acc-balance .k { font-size: 12px; color: var(--muted); }
.acc-bal { font-size: 34px; font-weight: 600; color: var(--text); letter-spacing: -0.02em; margin-top: 2px; }
.acc-topup { font-size: 13px; color: var(--text); white-space: pre-line; margin-top: 4px; overflow-wrap: anywhere; }
.acc-topup.empty { color: var(--dim); }
.acc-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn2.danger { color: var(--err); border-color: #5a1f22; }
.btn2.danger:hover { background: #2a1214; }
.stack-sm { display: flex; flex-direction: column; gap: 12px; max-width: 420px; }
@media (max-width: 860px) {
  .acc-head { grid-template-columns: 1fr; }
  .acc-profile { align-items: flex-start; }
  .avatar-lg { width: 56px; height: 56px; font-size: 24px; }
}

/* ---------------------------------------------------------------- tombol & panel umum */
.btn2 { border: 1px solid var(--line-2); background: none; color: var(--text); border-radius: var(--r-s); padding: 9px 14px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.btn2:hover { background: var(--panel-2); }
.btn2.sm { padding: 6px 10px; font-size: 12.5px; }
.btnp { border: none; border-radius: var(--r-s); padding: 10px 14px; background: var(--sel); color: #111; font-weight: 700; cursor: pointer; }
.btnp:hover { background: #fff; } .btnp:disabled { opacity: .55; cursor: not-allowed; }
.btnl { border: none; border-radius: var(--r-s); padding: 10px 16px; background: var(--accent); color: var(--accent-ink); font-weight: 800; cursor: pointer; }
.btnl:hover { filter: brightness(1.06); }
.pane { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-m); padding: 20px; }
.pane h2 { margin: 0 0 14px; font-size: 16px; font-weight: 800; letter-spacing: -0.01em; }
.page-title { margin: 0 0 18px; font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; align-items: end; }
.hint { font-size: 12px; color: var(--dim); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-m); padding: 14px 16px; }
.stat .k { font-size: 12px; color: var(--muted); }
.stat .v { font: 600 20px var(--mono); margin-top: 2px; font-variant-numeric: tabular-nums; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.stack > * + * { margin-top: 16px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--dim); font-weight: 600; font-size: 12px; }
td .num, td.num { font-family: var(--mono); }
.pill { font: 600 11px var(--mono); padding: 2px 7px; border-radius: 4px; background: var(--sel-bg); color: var(--muted); white-space: nowrap; }
.pill.ok { color: var(--ok); } .pill.busy { color: var(--warn); } .pill.err { color: var(--err); }
.secret { font: 13px/1.6 var(--mono); background: var(--bg); border: 1px solid var(--line-2); padding: 12px; border-radius: var(--r-s); user-select: all; white-space: pre-line; }
.plus { color: var(--ok); }

/* ---------------------------------------------------------------- login, dialog, toast */
/* halaman masuk: logo di kiri atas, kotak hitam transparan di tengah */
.login-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; gap: 22px; padding: 0 16px 32px;
  background: radial-gradient(80% 55% at 50% 0%, rgba(125, 12, 22, .45), transparent 70%), #000; }
.login-top { align-self: stretch; max-width: 1240px; width: 100%; margin: 0 auto; padding: 18px 16px; }
.login-top .brand .mark, .login-top .brand b { font-size: 40px; }
.login { width: 100%; max-width: 450px; margin-top: 4vh; background: rgba(0, 0, 0, .72); border-radius: 4px; padding: 48px 56px 56px; }
.login h1 { margin: 0 0 26px; font-size: 32px; font-weight: 700; }
.login .field label { font-size: 13px; color: var(--muted); font-weight: 500; }
.login .inp { height: 52px; padding: 0 16px; font-size: 16px; background: rgba(22, 22, 22, .7); border: 1px solid rgba(128, 128, 128, .7); }
.login .inp:focus { border-color: #fff; }
.login .field + .field { margin-top: 16px; }
.login .gen { margin-top: 24px; padding: 12px; font-size: 16px; font-weight: 700; }
.login-new { margin: 28px 0 0; color: var(--muted); font-size: 15px; }
.login-new a { color: #fff; font-weight: 600; text-decoration: none; }
.login-new a:hover { text-decoration: underline; }
.login-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; font-size: 13px; }
.login-links a { color: var(--muted); }
.login-links a:hover { color: var(--text); }
a.dd-item { text-decoration: none; }
.show-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-top: 14px; }
.show-item { margin: 0; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-m); overflow: hidden; }
.show-item img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; background: #000; }
.show-item figcaption { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; font-size: 12.5px; color: var(--muted); }
.show-item figcaption span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 560px) { .login { background: transparent; padding: 8px 4px 24px; margin-top: 0; } .login-top .brand .mark, .login-top .brand b { font-size: 32px; } }
.msg { font-size: 12.5px; padding: 9px 12px; border-radius: var(--r-s); margin-bottom: 14px; }
.msg.err { background: #2a1214; border: 1px solid #5a1f22; color: #ffb4b4; }
.msg.ok { background: #13221a; border: 1px solid #1f4a2c; color: var(--ok); }
.modal { position: fixed; inset: 0; background: #000b; display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal .box { width: 100%; max-width: 420px; background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r-m); padding: 22px; }
.modal h3 { margin: 0 0 14px; font-size: 16px; font-weight: 700; }
.modal .field + .field { margin-top: 12px; }
.modal .btns { display: flex; gap: 8px; margin-top: 18px; justify-content: flex-end; }
.toast { position: fixed; left: 16px; bottom: 16px; max-width: min(560px, calc(100vw - 32px)); z-index: 60; background: var(--panel-2); border: 1px solid var(--line-2); color: var(--text); border-radius: var(--r-s); padding: 10px 14px; font-size: 13px; }
.toast.err { background: #3a1214; border-color: var(--err); color: #ffd6d6; }
::-webkit-scrollbar { width: 9px; height: 9px; } ::-webkit-scrollbar-thumb { background: #2c2c30; border-radius: 9px; } ::-webkit-scrollbar-track { background: transparent; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (pointer: coarse) {
  .chips button, .tabs button, .btn2, .keybtn, .card .acts button, .card .acts a { min-height: 44px; min-width: 44px; }
  .hero-actions a, .hero-actions button { min-height: 44px; }
}
@media (max-width: 1250px) {
  .app { grid-template-columns: 390px 1fr; }
  .top { gap: 22px; padding: 0 18px; } .group { gap: 18px; } .nav { font-size: 14px; }
  .result-media { grid-template-columns: 1fr; } .result-media .info { order: 2; padding: 4px 24px 26px; } .result-media .m { order: 1; }
  .hero-title { font-size: 24px; }
}
@media (max-width: 860px) {
  .app { display: block; height: auto; }
  .top { position: sticky; top: 0; z-index: 10; height: auto; flex-wrap: wrap; gap: 0 12px; padding: 10px 16px 0; }
  .top .simtag { margin-left: 0; }
  .group { order: 3; width: 100%; height: 44px; overflow-x: auto; gap: 20px; }
  .top-right { gap: 8px; } .quota { padding: 6px 10px; } .keybtn { padding: 6px 10px; font-size: 12.5px; }
  .form-col { border-right: none; } .form-scroll { overflow: visible; padding: 16px; } .form-foot { position: sticky; bottom: 0; padding: 12px 16px; }
  .res-col, .full { overflow: visible; padding: 16px; }
  .result-media .info { padding: 4px 16px 20px; } .result-body { min-height: 260px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .two { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .brand .mark, .brand b { font-size: 28px; }
  .top-right { width: 100%; margin: 8px 0 0; flex-wrap: wrap; gap: 6px; }
  .top-right .quota { margin-right: auto; }
  .quota .lbl { display: none; }
}
