:root {
  --bg: #eef1f4; --surface: #ffffff; --panel: #f7f8fa; --line: #d5dae0; --line2: #e5e8ec;
  --ink: #1f2937; --ink2: #4b5563; --muted: #6b7280;
  --acc: #c2410c; --acc-h: #9a3412; --dark: #2b3440;
  --ok: #15803d; --warn: #b45309; --warn-bg: #fff7ed; --info: #eef4fb;
  --wa: #16a34a;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* header */
.top { height: 52px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px;
  background: var(--dark); color: #fff; gap: 12px; }
.brand { display: flex; align-items: baseline; gap: 8px; white-space: nowrap; overflow: hidden; }
.brand .logo { background: var(--acc); border-radius: 6px; padding: 2px 6px; font-size: 14px; }
.brand b { font-size: 17px; letter-spacing: .3px; }
.brand .sub { color: #b8c0ca; font-size: 13px; }
.top-actions { display: flex; gap: 8px; align-items: center; }
.top .btn { background: #3a4553; border-color: #4a5563; color: #fff; }
.top .btn.primary { background: var(--acc); border-color: var(--acc); }
.menu { position: relative; }
.menu-list { position: absolute; right: 0; top: 36px; background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  border-radius: 6px; box-shadow: 0 8px 24px rgba(0,0,0,.15); z-index: 50; min-width: 210px; padding: 4px; }
.menu-list button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 4px; cursor: pointer; }
.menu-list button:hover { background: #eef2f7; }
.banner { background: #fef3c7; color: #78350f; padding: 8px 16px; font-size: 13px; border-bottom: 1px solid #fcd34d; }

/* layout */
.layout { display: grid; grid-template-columns: 1fr 420px; height: calc(100vh - 52px); }
.banner:not([hidden]) + .layout { height: calc(100vh - 52px - 37px); }
.adminbar { background: #1e3a5f; color: #fff; padding: 7px 16px; font-size: 13.5px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.adminbar .btn { background: #fff; color: #1e3a5f; border: 0; min-height: 30px; padding: 4px 12px; }
.adminbar:not([hidden]) + .layout, .banner:not([hidden]) + .adminbar:not([hidden]) + .layout { height: calc(100vh - 52px - 44px); }
.viewer { position: relative; min-width: 0; display: flex; flex-direction: column; background: linear-gradient(#f4f6f8, #c9d1da); }
.panel { background: var(--panel); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }

/* buttons */
.btn { border: 1px solid #cfd5dc; background: var(--surface); border-radius: 5px; padding: 7px 12px; cursor: pointer; font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn:hover { border-color: #6aa0d8; }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn.primary { background: var(--acc); border-color: var(--acc); color: #fff; }
.btn.primary:hover { background: var(--acc-h); }
.btn.wa { background: var(--wa); border-color: var(--wa); color: #fff; }
.btn.wide { width: 100%; margin: 4px 0; }
.btn:disabled { opacity: .5; cursor: default; }

/* tabs / views */
.tabs { display: flex; gap: 4px; padding: 8px 10px 0; z-index: 5; }
.tab { border: 1px solid var(--line); border-bottom: none; background: #e3e7ec; padding: 6px 14px; border-radius: 6px 6px 0 0; cursor: pointer; font-weight: 600; color: var(--ink2); }
.tab.active { background: var(--surface); color: var(--ink); }
.view { display: none; position: relative; flex: 1; min-height: 0; border-top: 1px solid var(--line); }
.view.active { display: block; }
#v3d.active, #vedit.active { display: flex; flex-direction: column; }
#three { position: absolute; inset: 0; }
.float { position: absolute; background: rgba(255,255,255,.94); border: 1px solid #cfd5dc; border-radius: 6px; box-shadow: 0 1px 4px rgba(0,0,0,.08); z-index: 3; }
.toggles { top: 10px; left: 10px; display: flex; gap: 12px; padding: 6px 10px; font-weight: 600; }
.tier-ctl { display: inline-flex; gap: 6px; }
.tier-ctl select { min-height: 32px; padding: 3px 6px; border: 1px solid var(--line2); border-radius: 6px; font-weight: 600; background: #fff; }
#wireTiers .tier-blk { margin-bottom: 18px; }
#wireTiers h4 { margin: 4px 0 6px; font-size: 14px; }
#wireTiers .flipnote { display: inline-block; margin-left: 8px; font-size: 12px; color: #7c3aed; background: #ede9fe; border-radius: 6px; padding: 1px 7px; }
#wireTiers .tlink-note { font-size: 12.5px; color: #92400e; background: #fef3c7; border-radius: 6px; padding: 5px 8px; margin: 6px 0 0; }
.adm-only { position: relative; outline: 2px dashed #7c3aed; outline-offset: 2px; }
.adm-only::after { content: 'admin'; position: absolute; top: -9px; right: -6px; background: #7c3aed; color: #fff; font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 6px; }
.toggles label { display: flex; gap: 5px; align-items: center; cursor: pointer; }
.toggles .nmode { display: flex; gap: 10px; padding-left: 12px; border-left: 1px solid var(--line2); }
.cams { right: 10px; bottom: 10px; display: flex; overflow: hidden; }
.cams button { border: 0; border-right: 1px solid var(--line2); background: none; padding: 6px 10px; cursor: pointer; color: var(--ink2); }
.cams button:last-child { border-right: 0; }
.cams button:hover { background: #e6f0fb; }
.dims { right: 10px; top: 10px; padding: 5px 10px; color: #1d4ed8; font-weight: 600; font-size: 13px; }
.lbl3d { font: 700 12px/16px system-ui; height: 18px; display: inline-block; padding: 0 6px; border-radius: 4px; border: 1px solid var(--ink); background: #fef3c7; color: var(--ink); white-space: nowrap; pointer-events: none; }
.lbl3d.main { background: var(--acc); color: #fff; }
.lbl3d.top { border-color: #b91c1c; }
.busy { position: absolute; top: 14px; right: 14px; z-index: 6; }
.busy span { display: block; width: 18px; height: 18px; border: 3px solid #cbd5e1; border-top-color: var(--acc); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* wiring */
#vwire { overflow: auto; background: var(--surface); padding: 10px 14px; }
.wire-head { color: var(--ink2); font-size: 13px; margin-bottom: 8px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: middle; }
.dot.plus { background: #dc2626; } .dot.minus { background: #9ca3af; }
.chip { display: inline-block; padding: 0 5px; border: 1px solid var(--ink); border-radius: 4px; background: #fef3c7; font-weight: 700; font-size: 12px; }
.chip.main { background: var(--acc); color: #fff; }
.wire-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.wire-grid figure { margin: 0; border: 1px solid var(--line2); border-radius: 6px; padding: 8px; }
.wire-grid figcaption { font-weight: 700; margin-bottom: 6px; }
.wire-grid figcaption small { color: var(--muted); font-weight: 400; }
.wire-grid svg { width: 100%; height: auto; max-height: 70vh; display: block; }

/* editor */
#vedit { background: var(--surface); }
.edit-bar { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-bottom: 1px solid var(--line2); flex-wrap: wrap; }
.edit-bar .grow { flex: 1; }
.count { font-weight: 700; padding: 2px 8px; border-radius: 4px; background: #eef2f7; }
.count.ok { background: #dcfce7; color: var(--ok); } .count.bad { background: var(--warn-bg); color: var(--warn); }
#ecanvas { flex: 1; width: 100%; min-height: 0; touch-action: none; cursor: crosshair; }
.edit-hint { padding: 6px 10px; color: var(--muted); font-size: 12px; border-top: 1px solid var(--line2); }

/* panel */
.stepper { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; padding: 10px 10px 6px; }
.stepper button { border: 1px solid #cfd5dc; background: var(--surface); border-radius: 5px; padding: 6px 1px; font-weight: 600; font-size: 12px; white-space: nowrap; color: #374151; cursor: pointer; line-height: 1.2; }
.stepper button .st { display: block; font-size: 11px; font-weight: 700; }
.stepper button.bad .st { color: var(--warn); } .stepper button.ok .st { color: var(--ok); }
.stepper button.cur { background: var(--dark); color: #fff; border-color: var(--dark); }
.stepper button.cur .st { color: #fff; }
.pages { flex: 1; overflow: auto; padding: 0 14px 10px; min-height: 0; }
.page h2 { font-size: 17px; margin: 6px 0 2px; }
.intro { color: var(--muted); margin: 0 0 10px; font-size: 13px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 0; }
.row > label { color: var(--ink2); }
[data-help] { cursor: help; }
[data-help]::after { content: " ⓘ"; color: #9ca3af; font-size: 12px; }
.row select, .num { width: 196px; flex: none; }
select { border: 1px solid #cfd5dc; border-radius: 4px; padding: 5px 6px; background: #fff; }
.num { display: flex; align-items: center; border: 1px solid #cfd5dc; border-radius: 4px; background: #fff; overflow: hidden; }
.num input { border: 0; width: 100%; padding: 5px 6px; min-width: 0; background: transparent; }
.num i { font-style: normal; color: var(--muted); font-size: 13px; white-space: nowrap; flex: none; width: 52px; text-align: center; }
.num select.unit { border: 0; border-left: 1px solid var(--line2); border-radius: 0; flex: none; width: 52px; padding: 0 4px; }
.seg { display: inline-flex; border: 1px solid #cfd5dc; border-radius: 5px; overflow: hidden; background: #fff; }
.seg button { border: 0; border-right: 1px solid #e5e8ec; background: none; padding: 4px 10px; font: 600 13px system-ui; color: var(--ink2); cursor: pointer; }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--dark); color: #fff; }
.count.full { animation: pulse .5s 2; }
@keyframes pulse { 50% { background: #fecaca; color: #b91c1c; } }
.num:focus-within, select:focus { outline: 2px solid #93c5fd; outline-offset: -1px; }
.num.warn, select.warn { background: var(--warn-bg); border-color: #f59e0b; }
input:disabled { color: #9ca3af; }
.check { display: flex; gap: 8px; align-items: center; margin: 8px 0; cursor: pointer; }
.info { background: var(--info); border-radius: 4px; padding: 6px 9px; margin: 6px 0; font-size: 13px; }
.info:empty { display: none; }
.muted { color: var(--muted); } .small { font-size: 12.5px; }
.okc { color: var(--ok); font-weight: 700; } .badc { color: var(--warn); font-weight: 700; }
details.more { margin: 8px 0; border: 1px solid var(--line2); border-radius: 5px; padding: 4px 8px; background: #fff; }
details.more summary { cursor: pointer; font-weight: 600; padding: 3px 0; }
.shop { border: 1px solid #bbf7d0; background: #f0fdf4; border-radius: 6px; padding: 8px 10px; margin: 8px 0; }
.shop p { margin: 0 0 6px; font-size: 13px; }

.card { margin: 0 10px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--acc); border-radius: 4px; padding: 7px 10px; font-size: 13px; }
.card table { width: 100%; border-collapse: collapse; }
.card td { padding: 1px 0; vertical-align: top; }
.card td:first-child { color: var(--muted); width: 78px; }
.nav { display: flex; justify-content: space-between; padding: 8px 10px 10px; }

/* modal & toast */
.modal { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: grid; place-items: center; z-index: 100; padding: 16px; }
.modal-box { background: var(--surface); border-radius: 10px; max-width: 620px; width: 100%; max-height: 85vh; overflow: auto; padding: 18px 20px; box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.modal-box h3 { margin-top: 0; }
.modal-box.wide { max-width: 900px; }
.fo-box { margin-top: 12px; border-top: 1px solid var(--line2); padding-top: 10px; }
.fo-box h4 { margin: 0 0 8px; } .fo-box input:not([type=checkbox]) { padding: 7px 8px; border: 1px solid var(--line2); border-radius: 6px; font: inherit; }
.fo-act { display: flex; justify-content: flex-end; align-items: center; gap: 12px; } .fo-act b { font-size: 17px; color: #c2410c; }
.fs-steps { list-style: none; padding: 0; margin: 8px 0 12px; display: grid; gap: 4px; }
.fs-steps li { color: #9ca3af; font-weight: 600; } .fs-steps li.ok { color: #15803d; } .fs-steps li.now { color: #b45309; }
.fs-qr { text-align: center; } .fs-qr img { width: 240px; max-width: 80%; image-rendering: pixelated; border: 1px solid var(--line2); border-radius: 8px; }
.ok-big { font-size: 15px; font-weight: 700; color: #15803d; }
.pp-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px 14px; font-size: 13px; font-weight: 600; }
.pp-form label { display: flex; flex-direction: column; gap: 3px; }
.pp-form label.ck { flex-direction: row; align-items: center; gap: 6px; font-weight: 500; }
.pp-form select, .pp-form input[type=number] { padding: 5px 6px; border: 1px solid var(--line2); border-radius: 6px; font: inherit; font-weight: 500; min-width: 0; }
.pp-xy { display: flex; align-items: center; gap: 5px; } .pp-xy input { width: 76px; } .pp-xy i { font-style: normal; color: #6b7280; }
.pp-info { margin: 10px 0 6px; font-size: 13px; line-height: 1.5; } .pp-info .bad { color: #b91c1c; font-weight: 600; } .pp-info .muted { color: #6b7280; font-size: 12px; }
.pp-view { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.pp-view figure { margin: 0; border: 1px solid var(--line2); border-radius: 8px; padding: 6px; background: #f8fafc; }
.pp-view figcaption { font-size: 12px; font-weight: 700; margin-bottom: 4px; } .pp-view svg { width: 100%; height: auto; max-height: 300px; display: block; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--dark); color: #fff; padding: 9px 16px; border-radius: 6px; z-index: 120; box-shadow: 0 6px 20px rgba(0,0,0,.25); max-width: 90vw; }
.tip { position: fixed; z-index: 130; background: #111827; color: #fff; font-size: 12.5px; padding: 6px 9px; border-radius: 5px; max-width: 280px; pointer-events: none; }

/* elemen khusus HP (disembunyikan di PC) */
.sm, .sheet-handle, .card-mini, .expand { display: none; }
.stepper .n::after { content: ". "; }
.pm { border: 0; background: #eef2f7; width: 32px; align-self: stretch; font-size: 18px; font-weight: 700; cursor: pointer; color: var(--ink); flex: none; }
.pm:active { background: #dbe4ee; }

/* ================================================= HP */
@media (max-width: 900px) {
  html, body { height: 100%; overflow: hidden; }
  body { display: flex; flex-direction: column; height: 100dvh; }
  .top { height: 48px; flex: none; padding: 0 10px; }
  .brand .sub, .lg { display: none; }
  .sm { display: inline; }
  .top .btn.small { min-width: 40px; min-height: 36px; font-size: 16px; }
  .banner { flex: none; font-size: 12.5px; padding: 6px 12px; }
  .layout, .banner:not([hidden]) + .layout, .adminbar:not([hidden]) + .layout { display: flex; flex-direction: column; flex: 1; min-height: 0; height: auto; }

  /* area 3D */
  .viewer { height: 42%; flex: none; transition: height .25s ease; }
  .tabs { padding: 6px 8px 0; }
  .tab { padding: 6px 12px; font-size: 13px; }
  .toggles { top: 8px; left: 8px; gap: 10px; padding: 4px 8px; font-size: 12.5px; }
  .toggles input { width: 16px; height: 16px; }
  .toggles { flex-wrap: wrap; row-gap: 4px; max-width: calc(100% - 16px); }
  .toggles .nmode { border-left: 0; padding-left: 0; }
  .cams { right: 8px; bottom: 18px; }
  .cams button { padding: 7px 9px; font-size: 12.5px; }
  .dims { display: none; }
  .expand { display: grid; place-items: center; position: absolute; top: 5px; right: 8px; z-index: 6; width: 34px; height: 30px;
    border: 1px solid #cfd5dc; border-radius: 6px; background: #fff; font-size: 17px; cursor: pointer; }
  .busy { top: 12px; right: 52px; }
  .lbl3d { font-size: 11px; line-height: 15px; height: 17px; padding: 0 4px; }

  /* panel bawah (bottom sheet) */
  .panel { flex: 1; min-height: 0; border-left: 0; border-top: 1px solid var(--line); border-radius: 14px 14px 0 0;
    margin-top: -10px; z-index: 10; box-shadow: 0 -4px 18px rgba(15, 23, 42, .14); }
  .sheet-handle { display: flex; flex-direction: column; align-items: center; gap: 2px; border: 0; background: none;
    padding: 6px 0 0; color: var(--muted); font-size: 11px; cursor: pointer; flex: none; }
  .sheet-handle .grip { width: 40px; height: 4px; border-radius: 2px; background: #c3cad3; }
  body.vfull .viewer { height: calc(100% - 70px - env(safe-area-inset-bottom)); }
  body.vfull .panel > :not(.nav) { display: none; }
  body.pfull .viewer { height: 0; overflow: hidden; }
  body.pfull .panel { margin-top: 0; border-radius: 0; }

  /* langkah: lingkaran bernomor */
  .stepper { display: flex; justify-content: space-between; padding: 4px 14px 2px; gap: 0; position: relative; flex: none; }
  .stepper::before { content: ""; position: absolute; left: 34px; right: 34px; top: 20px; height: 2px; background: #d5dae0; }
  .stepper button { background: none; border: 0; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 2px;
    width: 64px; font-size: 11px; color: var(--ink2); position: relative; }
  .stepper button .n { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #fff;
    border: 2px solid #cfd5dc; font-size: 13.5px; font-weight: 700; }
  .stepper .n::after { content: ""; }
  .stepper button .st { display: none; }
  .stepper button.ok .n { border-color: var(--ok); color: var(--ok); }
  .stepper button.bad .n { border-color: #f59e0b; color: var(--warn); background: var(--warn-bg); }
  .stepper button.cur { color: var(--ink); font-weight: 700; }
  .stepper button.cur .n { background: var(--dark); border-color: var(--dark); color: #fff; }
  .stepper button.cur { background: none; }

  .pages { overflow: auto; padding: 0 14px 12px; -webkit-overflow-scrolling: touch; }
  .page h2 { font-size: 17px; margin-top: 8px; }
  .row { margin: 8px 0; }
  .row > label { font-size: 14.5px; }
  input, select, textarea { font-size: 16px; }                  /* cegah zoom otomatis iOS */
  .row select, .num { width: 58%; min-height: 44px; }
  .num input { padding: 8px; }
  .btn { min-height: 44px; }
  .btn.wide { margin: 6px 0; }
  .check { min-height: 40px; font-size: 15px; }
  .check input { width: 20px; height: 20px; }

  /* ringkasan: satu baris, ketuk untuk buka */
  .card-mini { display: flex; align-items: center; gap: 6px; margin: 0 10px; padding: 8px 12px; border: 1px solid var(--line);
    border-left: 4px solid var(--acc); border-radius: 6px; background: var(--surface); font-size: 13.5px; text-align: left;
    cursor: pointer; flex: none; }
  .card-mini .cm-main { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .card { display: none; }
  .panel.card-open .card { display: block; max-height: 38vh; overflow: auto; margin-top: -4px; border-top-left-radius: 0; border-top-right-radius: 0; }
  .panel.card-open .card-mini { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }

  .nav { padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); gap: 10px; flex: none; background: var(--panel); }
  .nav .btn { min-height: 48px; font-size: 15.5px; }
  #prev { flex: none; padding: 0 14px; }
  #next { flex: 1; }

  /* wiring & editor */
  .wire-grid { grid-template-columns: 1fr; }
  #vwire { padding: 8px; }
  .edit-bar { padding: 6px 8px; gap: 6px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .edit-bar::-webkit-scrollbar { display: none; }
  .edit-bar > * { flex: none; }
  .edit-bar .lay-wrap { order: 1; } .edit-bar .tier-ctl { order: 2; } .edit-bar .undo { order: 3; } .edit-bar #eAuto { order: 4; } .edit-bar #eClear { order: 5; }
  .edit-bar .btn.small { min-height: 36px; padding: 4px 10px; font-size: 13px; white-space: nowrap; }
  .edit-bar .count { font-size: 12.5px; padding: 4px 8px; white-space: nowrap; }
  .seg button { min-height: 36px; padding: 4px 9px; }
  .edit-bar #eDone, .edit-bar .grow { display: none; }   /* tombol Lanjut di bawah = Selesai */
  .edit-hint { font-size: 11px; padding: 4px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  .toast { bottom: calc(78px + env(safe-area-inset-bottom)); width: max-content; max-width: 92vw; text-align: center; }
  .modal { padding: 10px; align-items: end; }
  .modal-box { max-height: 88dvh; border-radius: 14px; padding: 16px; }
  .modal-actions .btn { flex: 1; }
  .menu-list { min-width: 220px; }
  .menu-list button { padding: 12px; font-size: 15px; }
}

/* form pesanan */
.oform label { display: block; font-weight: 600; margin: 10px 0 4px; font-size: 14px; }
.oform input[type=text], .oform input[type=tel], .oform input[type=number], .oform textarea {
  width: 100%; padding: 9px 10px; border: 1px solid #cfd5dc; border-radius: 6px; font: 15px system-ui; }
.oform .items { display: grid; gap: 6px; }
.oform .items label { display: flex; gap: 8px; align-items: center; font-weight: 500; margin: 0; padding: 8px 10px; border: 1px solid var(--line2); border-radius: 6px; cursor: pointer; }
.oform .items input { width: 18px; height: 18px; }
.oform .sum { background: var(--info); border-radius: 6px; padding: 8px 10px; font-size: 13.5px; margin-bottom: 4px; }
.oform .err { color: #b91c1c; min-height: 18px; font-size: 13px; margin-top: 8px; }
.oform .hp { position: absolute; left: -9999px; }
.linkbox { display: flex; gap: 6px; margin: 8px 0; }
.linkbox input { flex: 1; padding: 8px; border: 1px solid #cfd5dc; border-radius: 6px; font: 14px system-ui; min-width: 0; }
.okbig { font-size: 40px; text-align: center; margin: 4px 0; }

.stlnote { margin: -2px 0 6px; text-align: center; }

.hest { margin: 4px 0 8px; padding: 8px 10px; border-radius: 8px; background: var(--info); border: 1px solid var(--line2); font-size: 13px; line-height: 1.45; }
.hest small { opacity: .75; }
.oform .hest { margin-top: 8px; }

/* ---------- tombol Shop & popup toko */
.shopnav { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px 0 10px; border-radius: 18px;
  background: linear-gradient(135deg, #fbbf24 0%, #f97316 55%, #ea580c 100%); color: #fff; font-weight: 800; font-size: 14.5px; text-decoration: none;
  letter-spacing: .2px; box-shadow: 0 0 0 0 rgba(251, 146, 60, .7); animation: shopPulse 2s infinite; white-space: nowrap; text-shadow: 0 1px 1px rgba(0,0,0,.25); }
.shopnav:hover { filter: brightness(1.08); transform: translateY(-1px); }
.shopnav .si { font-size: 17px; display: inline-block; animation: shopWiggle 2.4s infinite; transform-origin: 50% 80%; }
.shopnav i { position: absolute; top: -7px; right: -6px; background: #dc2626; color: #fff; font: 800 9px/14px system-ui; padding: 0 5px; border-radius: 7px; border: 2px solid var(--dark); font-style: normal; text-shadow: none; }
@keyframes shopPulse { 0% { box-shadow: 0 0 0 0 rgba(251, 146, 60, .75); } 70% { box-shadow: 0 0 0 10px rgba(251, 146, 60, 0); } 100% { box-shadow: 0 0 0 0 rgba(251, 146, 60, 0); } }
@keyframes shopWiggle { 0%, 80%, 100% { transform: rotate(0); } 85% { transform: rotate(-14deg); } 90% { transform: rotate(12deg); } 95% { transform: rotate(-6deg); } }
@media (prefers-reduced-motion: reduce) { .shopnav, .shopnav .si { animation: none; } }
.spop { position: fixed; inset: 0; z-index: 120; background: rgba(15, 23, 42, .55); display: grid; place-items: center; padding: 16px; animation: spIn .25s ease; }
.spop[hidden] { display: none; }
@keyframes spIn { from { opacity: 0; } to { opacity: 1; } }
.spbox { position: relative; width: 100%; max-width: 460px; background: #fff; border-radius: 18px; overflow: hidden; box-shadow: 0 24px 60px rgba(0,0,0,.35); animation: spUp .3s cubic-bezier(.2,.9,.3,1.2); max-height: calc(100dvh - 32px); overflow-y: auto; }
@keyframes spUp { from { transform: translateY(24px) scale(.96); } to { transform: none; } }
.spx { position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: rgba(255,255,255,.2); color: #fff; font-size: 15px; cursor: pointer; z-index: 2; }
.spx:hover { background: rgba(255,255,255,.35); }
.sphead { background: radial-gradient(circle at 90% 10%, rgba(251,191,36,.6), transparent 50%), linear-gradient(135deg, #1f2937, #9a3412 70%, #ea580c); color: #fff; padding: 22px 22px 18px; }
.spbadge { display: inline-block; background: rgba(255,255,255,.18); border-radius: 12px; padding: 3px 10px; font-size: 11px; font-weight: 800; letter-spacing: 1px; }
.sphead h2 { margin: 10px 0 6px; font-size: 22px; line-height: 1.2; }
.sphead p { margin: 0; color: #fde7d6; font-size: 14px; }
.spgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 16px 16px 4px; }
.spgrid:empty { display: none; }
.spgrid a { border: 1px solid #eceef1; border-radius: 10px; overflow: hidden; text-decoration: none; color: #1f2937; display: block; transition: .15s; }
.spgrid a:hover { border-color: #f97316; transform: translateY(-2px); }
.spgrid img { width: 100%; aspect-ratio: 1.4; object-fit: cover; background: #f5f5f5; display: block; }
.spgrid .n { font-size: 12px; padding: 6px 8px 0; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.spgrid .p { font-weight: 800; font-size: 13.5px; padding: 0 8px 8px; }
.spgrid .p s { color: #9ca3af; font-weight: 400; font-size: 11px; margin-left: 4px; }
.spcta { display: block; margin: 14px 16px 6px; text-align: center; padding: 13px; border-radius: 12px; font-weight: 800; font-size: 16px; color: #fff; text-decoration: none;
  background: linear-gradient(135deg, #f97316, #c2410c); box-shadow: 0 6px 16px rgba(234, 88, 12, .35); }
.spcta:hover { filter: brightness(1.06); }
.splater { display: block; margin: 0 auto 12px; border: 0; background: none; color: #6b7280; font-size: 13px; cursor: pointer; padding: 6px 10px; }
@media (max-width: 900px) {
  .shopnav { height: 36px; padding: 0 12px 0 9px; font-size: 14px; }
  .shopnav i { display: none; }
  .brand b { font-size: 16px; }
}
@media (max-width: 380px) { .brand b { display: none; } }
@media (max-width: 480px) { .top:has(#shopNav:not([hidden])) .brand b { display: none; } }

/* ---------- pola seri-paralel & undo */
.seg.undo button { font-size: 16px; padding: 4px 10px; }
.seg.undo button:disabled { opacity: .35; cursor: default; }
.laypop { position: fixed; z-index: 90; width: 360px; max-width: calc(100vw - 16px); max-height: min(70vh, 560px); display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 14px 40px rgba(0,0,0,.22); }
.laypop[hidden] { display: none; }
.lp-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px 2px; }
.lp-x { border: 0; background: none; font-size: 16px; cursor: pointer; color: var(--muted); }
.lp-sub { margin: 0; padding: 0 12px 8px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line2); }
.lp-list { overflow: auto; padding: 6px; }
.lp-item { display: grid; grid-template-columns: 116px 1fr; gap: 10px; align-items: center; width: 100%; text-align: left; padding: 6px; border: 1px solid transparent; border-radius: 8px; background: none; cursor: pointer; color: var(--ink); font: inherit; }
.lp-item:hover { background: #f3f6f9; border-color: var(--line); }
.lp-item.cur { border-color: var(--acc); background: #fff7ed; }
.lp-item canvas { flex: none; width: 112px; height: 72px; margin: 0 auto; border-radius: 6px; background: #f8fafc; border: 1px solid var(--line2); }
.lp-item b { display: block; font-size: 13px; }
.lp-item small { display: block; color: var(--muted); font-size: 11.5px; line-height: 1.35; }
.lp-item .tag { display: inline-block; font-size: 10.5px; font-weight: 700; padding: 0 6px; border-radius: 8px; margin-top: 2px; }
.lp-item .tag.cur { background: var(--acc); color: #fff; } .lp-item .tag.warn { background: #fee2e2; color: #b91c1c; }
.lp-load { padding: 18px; text-align: center; color: var(--muted); font-size: 13px; }
@media (max-width: 900px) { .laypop { left: 8px !important; right: 8px; width: auto; top: auto !important; bottom: 8px; max-height: 62vh; } }
#preset option.pre-ok, #preset.pre-ok { color: #15803d; font-weight: 700; }
#preset option:not(.pre-ok) { color: var(--ink, #1f2937); font-weight: 400; }
.pre-note { margin: -4px 0 8px; font-size: 12.5px; color: #15803d; font-weight: 600; }
.toggles .exp { color: #7c3aed; }

/* kunci preview (daftar OTP) */
.viewer.gated #three, .viewer.gated #vwire .wire-grid, .viewer.gated #wireTiers { filter: blur(9px); }
.viewer.gated #three { pointer-events: none; }
.viewer.gated #vwire .wire-grid, .viewer.gated #wireTiers { user-select: none; pointer-events: none; }
.gate-ov { position: absolute; left: 0; right: 0; bottom: 0; top: 42px; display: grid; place-items: center; z-index: 6; pointer-events: none; padding: 14px; }
.gate-ov[hidden] { display: none; }
.gate-card { pointer-events: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 14px 40px rgba(15,23,42,.22);
  padding: 18px 20px; max-width: 360px; text-align: center; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.gate-card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.gate-card small { color: var(--muted); font-size: 12px; }
.gate-ic { font-size: 28px; line-height: 1; }
.gate-form #gt_otp label { display: flex; flex-direction: column; gap: 4px; }
@media (max-width: 900px) {
  .gate-ov { place-items: start center; padding: 46px 10px 10px; }
  .gate-card { flex-direction: row; padding: 10px 12px; gap: 10px; max-width: 340px; text-align: left; }
  .gate-card p, .gate-card small { display: none; }
  .gate-card b { font-size: 13px; }
  .gate-ic { font-size: 20px; }
  .gate-card .btn { white-space: nowrap; }
}
