/* WANA — base styles (Fiori DNA)
 * Flat, elevation 0. TIDAK ADA box-shadow di file ini.
 * Shadow HANYA boleh di: dialog, menu, bottom sheet, FAB (tidak ada di file ini).
 * Radius: var(--radius-sm)=8px atau var(--radius-pill)=999px. TIDAK ADA nilai lain. */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

html { background: var(--surface-alt, #F5F5F7); }
body {
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.5;
  color: var(--ink);
  background: var(--canvas);
  max-width: var(--shell);
  margin: 0 auto;
  min-height: 100dvh;
  padding-bottom: 76px; /* ruang untuk tabbar */
}

/* ---------- Topbar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-md) var(--sp-lg);
  border-bottom: 1px solid var(--border);
  background: var(--canvas);
  position: sticky;
  top: 0;
  z-index: 10;
  /* flat: tanpa shadow */
}
.topbar .brand { font-size: 17px; font-weight: 700; letter-spacing: 0.2px; }
.topbar-right { display: flex; align-items: center; gap: var(--sp-sm); }

.client-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--brand);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  min-height: var(--touch-min);
  padding: 0 var(--sp-sm);
  cursor: pointer;
  position: relative;
}

/* Dropdown pemilih klien di header (dipakai wireClientSwitch di router.js) */
.client-menu {
  z-index: 60;
  background: var(--surface, #fff);
  border: 1px solid var(--border, #E5E7EB);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  padding: 6px;
  color: var(--ink); /* jangan mewarisi biru dari tombol header */
  /* HP: selebar area konten, tepat di bawah header (induk = #topbar) */
  position: absolute;
  top: calc(100% + 8px);
  left: var(--sp-lg);
  right: var(--sp-lg);
  max-height: 70vh;
  overflow-y: auto;
}
@media (min-width: 900px) {
  /* Desktop: dropdown wajar di bawah tombol, rata kanan (induk = tombol) */
  .client-menu {
    left: auto;
    right: 0;
    min-width: 240px;
    max-width: 320px;
  }
}
.client-menu .cm-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  background: none;
  font: inherit;
  font-size: 14px;
  color: inherit;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  min-height: var(--touch-min);
}
.client-menu .cm-item:hover { background: var(--surface-alt, #F3F4F6); }
.client-menu .cm-item.active { background: rgba(59,130,246,.08); }
.client-menu .cm-ava {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #6B7280;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}
.client-menu .cm-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.client-menu .cm-item.active .cm-name { font-weight: 600; }
.client-menu .cm-check { width: 18px; color: var(--brand); flex-shrink: 0; display: flex; visibility: hidden; }
.client-menu .cm-item.active .cm-check { visibility: visible; }
.client-menu .cm-add { color: var(--brand); font-weight: 600; border-top: 1px solid var(--border, #E5E7EB); border-radius: 0; margin-top: 4px; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--touch-min);
  height: var(--touch-min);
  background: none;
  border: none;
  color: var(--ink);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.icon-btn:active { background: var(--surface-alt); }

/* ---------- App container ---------- */
#app { padding: 0 var(--sp-lg) 40px; }

/* ---------- Tipografi ---------- */
.page-title { font-size: var(--fs-title); font-weight: 600; padding: var(--sp-lg) 0 var(--sp-md); }
.sec-label {
  font-size: var(--fs-label);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin: var(--sp-xl) 0 var(--sp-sm);
  font-weight: 500;
}
.hero-num {
  font-size: var(--fs-display);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  margin: var(--sp-xs) 0;
}
.hero-sub { font-size: 13px; color: var(--muted); }
.tabular { font-variant-numeric: tabular-nums; }

/* ---------- Tombol ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-sm);
  min-height: var(--touch-min);
  padding: var(--sp-md) var(--sp-xl);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--canvas);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  /* flat: tanpa shadow */
}
.btn:active { background: var(--surface-alt); }

.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.btn-primary:active { background: var(--brand-pressed); }

.btn-sm { min-height: 36px; padding: var(--sp-sm) var(--sp-lg); font-size: 13px; }

.btn-block { width: 100%; }

/* Link sebagai aksi sekunder */
.link-action {
  display: block;
  text-align: center;
  color: var(--brand);
  font-weight: 600;
  font-size: 14px;
  padding: var(--sp-lg);
  text-decoration: none;
  min-height: var(--touch-min);
}

/* ---------- Field ---------- */
.field { margin-bottom: var(--sp-lg); }
.field > label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: var(--sp-md);
  font-family: inherit;
  font-size: 16px; /* cegah zoom iOS */
  color: var(--ink);
  background: var(--canvas);
  /* flat: tanpa shadow */
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--brand);
}
.field .hint { font-size: var(--fs-label); color: var(--muted); margin-top: 4px; }

/* ---------- Segmented control ---------- */
.segmented {
  display: flex;
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
  padding: 3px;
  margin-bottom: var(--sp-xl);
}
.segmented button {
  flex: 1;
  border: none;
  background: none;
  padding: 10px var(--sp-sm);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  color: var(--muted);
  cursor: pointer;
  min-height: var(--touch-min);
}
.segmented button.active {
  background: var(--brand);
  color: #fff;
  /* aktif = biru solid, teks putih — bahasa desain switcher yang disetujui */
}

/* ---------- Chip (pill filter) ---------- */
.chips { display: flex; gap: var(--sp-sm); flex-wrap: wrap; margin-bottom: var(--sp-xl); }
.chip {
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--canvas);
  padding: var(--sp-sm) var(--sp-lg);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  min-height: 36px;
  /* flat: tanpa shadow */
}
.chip.active { border-color: var(--brand); color: var(--brand); font-weight: 600; }

/* ---------- List row (flat) ---------- */
.row {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  /* tanpa radius, tanpa margin antar baris, tanpa shadow */
}
.row .row-icon { width: 20px; height: 20px; flex-shrink: 0; }
.row .row-txt { flex: 1; min-width: 0; }
.row .row-txt b { display: block; font-size: 14px; font-weight: 600; }
.row .row-txt span { font-size: var(--fs-label); color: var(--muted); }
.row .row-chev { color: var(--muted); flex-shrink: 0; }

/* ---------- Status: ikon + teks (BUKAN badge pill) ---------- */
.st { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.st .dot { width: 8px; height: 8px; border-radius: var(--radius-pill); flex-shrink: 0; }
.st.ok { color: var(--success); }
.st.ok .dot { background: var(--success); }
.st.warn { color: var(--warning); }
.st.warn .dot { background: var(--warning); }
.st.bad { color: var(--danger); }
.st.bad .dot { background: var(--danger); }
.st.info { color: var(--info); }
.st.info .dot { background: var(--info); }
.st.muted { color: var(--muted); }
.st.muted .dot { background: var(--muted); }

/* ---------- Tabel flat ---------- */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--muted);
  font-weight: 600;
  padding: var(--sp-sm) 0;
  border-bottom: 1px solid var(--border);
}
td {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
tr:last-child td { border-bottom: none; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* tanpa border vertikal, tanpa shadow, tanpa radius per baris */

/* ---------- Section accordion ---------- */
.sec { border-bottom: 1px solid var(--border); }
.sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: none;
  padding: var(--sp-lg) 0;
  font-family: inherit;
  font-size: var(--fs-section);
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  min-height: var(--touch-min);
  text-align: left;
}
.sec-head .sec-tt { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.sec-head .sec-t { font-size: var(--fs-section); font-weight: 600; color: var(--ink); }
.sec-head .sec-sub { font-size: 12px; font-weight: 400; color: var(--muted); line-height: 1.4; }
.sec-head .sec-count { font-size: var(--fs-label); font-weight: 400; color: var(--muted); margin-left: var(--sp-sm); }
.sec-head .chev { color: var(--muted); transition: transform 0.2s; flex-shrink: 0; }
.sec.open .sec-head .chev { transform: rotate(180deg); }
.sec-body { display: none; padding-bottom: var(--sp-lg); }
.sec.open .sec-body { display: block; }

/* ---------- Bottom tabbar ---------- */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--shell);
  background: var(--canvas);
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 10;
  padding-bottom: env(safe-area-inset-bottom);
  /* flat: tanpa shadow */
}
.tabbar .tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 0 8px;
  text-decoration: none;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  min-height: 60px;
}
.tabbar .tab svg { width: 22px; height: 22px; }
.tabbar .tab.active { color: var(--brand); }
.tabbar .tab.hidden { display: none; } /* untuk mode personal: tab Klien disembunyikan */

/* ---------- Utilitas ---------- */
.divider { border: none; border-top: 1px solid var(--border); margin: var(--sp-xl) 0; }
.muted { color: var(--muted); }
.empty { text-align: center; padding: 60px var(--sp-xl); }
.empty p { color: var(--muted); margin: var(--sp-lg) 0; }

/* Upload zone: dashed, bukan kartu berwarna */
.upload-zone {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  padding: var(--sp-3xl) var(--sp-xl);
  text-align: center;
  margin-bottom: var(--sp-lg);
}

/* Catatan: file ini TIDAK mengandung box-shadow sama sekali.
 * Shadow HANYA boleh di elemen floating (dialog, menu, bottom sheet, FAB)
 * yang akan didefinisikan di modul masing-masing saat dibutuhkan.
 * Jangan tambahkan shadow ke .row, .btn, table, input, .tabbar, atau .segmented. */

/* ---------- Share screen (link + PIN) ---------- */
.share-linkrow { display: flex; gap: var(--sp-sm); align-items: stretch; margin-bottom: var(--sp-sm); }
.share-url {
  flex: 1; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: var(--sp-md); font-size: var(--fs-body);
  background: var(--surface-alt);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pin-display { display: flex; gap: var(--sp-md); justify-content: center; margin: var(--sp-lg) 0 var(--sp-sm); }
.pin-digit {
  width: 56px; height: 64px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.pin-actions { display: flex; justify-content: center; margin-bottom: var(--sp-sm); }
.linklike {
  background: none; border: none; color: var(--brand);
  font-size: 13px; font-weight: 600; cursor: pointer; padding: var(--sp-sm);
  min-height: var(--touch-min);
}
.toggle-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 0; border-bottom: 1px solid var(--border);
}
.toggle {
  width: 48px; height: 28px; border-radius: var(--radius-pill);
  background: var(--border); border: none; position: relative; cursor: pointer;
  flex-shrink: 0;
}
.toggle.on { background: var(--brand); }
.toggle::after {
  content: ''; position: absolute;
  width: 24px; height: 24px; border-radius: var(--radius-pill);
  background: #fff; top: 2px; left: 2px; transition: left .2s;
}
.toggle.on::after { left: 22px; }
.share-actions { display: flex; gap: var(--sp-sm); margin-top: var(--sp-sm); }
.share-actions .btn { flex: 1; }
.wa-preview {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: var(--sp-md); margin-top: var(--sp-lg);
  background: var(--surface-alt); font-size: 13px;
}
.wa-preview .wa-label { font-size: var(--fs-label); color: var(--muted); margin-bottom: 6px; }
.wa-preview .wa-text { line-height: 1.6; }

/* Riwayat snapshots */
.snap{border:1px solid var(--border);border-radius:8px;padding:14px 16px;margin-bottom:12px;cursor:pointer;background:#fff}
.snap:active{background:var(--surface-alt)}
.snap-top{display:flex;justify-content:space-between;align-items:center;margin-bottom:4px}
.snap-date{font-weight:600;font-size:14px}
.snap-check input{width:20px;height:20px;accent-color:var(--brand)}
.snap-client{font-size:12px;color:var(--muted);margin-bottom:8px}
.snap-metrics{display:flex;gap:12px;font-size:14px;margin-bottom:8px}
.snap-metrics b{font-weight:700}
.snap-status{display:flex;align-items:center;gap:6px;font-size:13px}
.snap-status .dot{width:8px;height:8px;border-radius:999px;display:inline-block}
.snap-status .dot.ok{background:var(--success)}
.snap-status .dot.warn{background:var(--warning)}
.snap-status .dot.bad{background:var(--danger)}
.compare-bar{position:sticky;bottom:80px;background:var(--ink);color:#fff;border-radius:8px;padding:12px 16px;display:flex;justify-content:space-between;align-items:center;margin-top:16px}
.compare-bar[hidden]{display:none}

/* Bar seleksi Riwayat: di layar ponsel dock menempel di atas bottom nav.
 * Breakpoint mengikuti tokens.css (kolom sempit di bawah 768px). */
@media (max-width: 767px) {
  .compare-bar {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(72px + env(safe-area-inset-bottom));
    width: calc(100% - 32px);
    max-width: calc(var(--shell) - 32px);
    z-index: 9; /* di bawah tabbar (z-index 10) */
    margin-top: 0;
  }
  /* Daftar tidak tertutup bar saat dock aktif */
  .has-compare-bar #snapList { padding-bottom: 140px; }
}

/* ==========================================================================
   HOST LEGACY (drawer / scrim / modal / report)
   --------------------------------------------------------------------------
   Modul engine 00-22 berasal dari shell ads-analyzer. Layar baru merender ke
   #app, tapi engine masih memakai #drawer (pengaturan lanjutan), #scrim, dan
   #modal (report klien PDF/PPT). Aturan ini disalin dari app.css asli, dengan
   token WANA (nama berbeda: --surface-alt/--border, bukan --surface/--line)
   supaya drawer tetap rata & tidak ada kotak berbingkai warna.
   ========================================================================== */

#legacy-host #main[hidden],
#legacy-host #acct[hidden] { display: none !important; }

.scrim {
  position: fixed; inset: 0; background: rgba(17, 17, 17, .4);
  z-index: 40; display: none;
}
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(460px, 100%);
  background: var(--canvas); z-index: 41; transform: translateX(100%);
  transition: transform .22s ease; display: flex; flex-direction: column;
  border-left: 1px solid var(--border);
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.drawer.open { transform: none; }
.drawer.open + .scrim, .scrim.show { display: block; }
.dr-h {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.dr-h h2 { font-size: var(--fs-section); margin: 0; }
.dr-b { overflow-y: auto; padding: 4px 20px 30px; }
.dr-sec { padding: 18px 0; border-bottom: 1px solid var(--border); }
.dr-sec:last-child { border-bottom: 0; }

.modal {
  position: fixed; inset: 0; z-index: 50; background: rgba(17, 17, 17, .5);
  display: none; overflow-y: auto;
  padding: max(20px, env(safe-area-inset-top, 0px)) 16px max(20px, env(safe-area-inset-bottom, 0px));
}
.modal.show { display: block; }
.modal-in {
  max-width: 820px; margin: 0 auto; background: var(--canvas);
  border-radius: var(--radius-sm); overflow: hidden;
}
.modal-bar {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  justify-content: space-between; padding: 14px 18px;
  border-bottom: 1px solid var(--border); background: var(--surface-alt);
}
.modal-bar .mclose { order: 2; }
.modal-bar .row { order: 3; flex: 1 1 100%; gap: 6px; }
.modal-bar .row .btn { padding: 7px 11px; font-size: 13px; }

#reportDoc { background: #fff; color: var(--ink); font-size: 14px; line-height: 1.55; }
#reportDoc .rdoc { display: grid; gap: 14px; padding: 20px; }
#reportDoc .rsec { padding: 2px 0; }
#reportDoc .r-tbl { display: block; overflow-x: auto; }

@media print {
  .drawer, .scrim, .modal { display: none !important; }
}
/* ==========================================================================
   TABEL — ACUAN TETAP
   --------------------------------------------------------------------------
   Aturan: SEMUA tabel dibungkus .tbl-wrap yang BISA DIGESER SAMPING.
   Di 390px, tabel 5-6 kolom tidak mungkin muat; tanpa geser, kolom saling
   menimpa dan angka jadi tidak terbaca.

   Aturan penting (permintaan pemilik):
   - Tabel = default tampilan.
   - Ada penukar "Tabel | Kartu".
   - Di mode KARTU, teks TIDAK BOLEH menimpa/menutupi kartu.
     Karena itu setiap kartu memakai susunan vertikal (label di atas, nilai di
     bawah) dan `min-width:0` + `overflow-wrap:anywhere`, bukan posisi absolut.

   Mengikuti acuan app.css asli: .tbl-wrap { overflow-x:auto }, .r-tbl pakai
   header --surface-alt, angka `tabular-nums` rata kanan.
   ========================================================================== */

/* ---------- Bingkai geser: SEMUA tabel memakai ini ---------- */
.tbl-wrap {
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  /* geser halus di iOS; tanpa shadow, tanpa kotak berbingkai warna */
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--canvas);
}
.tbl-wrap > table { min-width: 100%; }
/* petunjuk ada isi di kanan (digambar dgn gradient netral, bukan warna) */
.tbl-wrap.geser-kanan {
  background-image: linear-gradient(to left, rgba(17,17,17,.06), rgba(17,17,17,0) 24px);
  background-repeat: no-repeat;
  background-position: right center;
  background-size: 24px 100%;
}

/* ---------- Kelas tabel yang dipakai kode (sebelumnya TANPA aturan) ---------- */
.dec-tbl, .rtbl, .cc-mini, .sample-tbl, .r-tbl { width: 100%; border-collapse: collapse; }
.dec-tbl th, .rtbl th, .cc-mini th, .sample-tbl th, .r-tbl th {
  background: var(--surface-alt);
  white-space: nowrap;
}
.dec-tbl td, .rtbl td, .cc-mini td, .sample-tbl td, .r-tbl td { vertical-align: top; }
.dec-tbl td:first-child, .rtbl td:first-child { min-width: 150px; }
.dec-tbl tr.kid td:first-child { position: relative; padding-left: 30px; }
.dec-tbl tr.kid td:first-child::before {
  content: ""; position: absolute; left: 14px; top: 0; bottom: 0;
  border-left: 2px solid var(--border);
}
.rtbl th.num, .rtbl td.num,
.r-tbl .n, .r-tbl th.n, .r-tbl td.n {
  text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.sample-tbl { font-size: 12px; }
.sample-tbl th, .sample-tbl td { white-space: nowrap; padding: 6px 10px; }
.cc-mini td, .cc-mini th { vertical-align: top; }
/* di dalam modal/laporan, tabel juga harus bisa digeser */
#reportDoc .r-tbl { display: block; overflow-x: auto; }

/* ---------- Penukar Tabel | Kartu ---------- */
.tb-switch {
  display: inline-flex; gap: 2px; padding: 3px;
  background: var(--surface-alt); border-radius: var(--radius-sm);
  margin: 0 0 var(--sp-md);
}
.tb-switch button {
  border: none; background: none; font-family: inherit; font-size: 12px;
  font-weight: 600; color: var(--muted); cursor: pointer;
  padding: 6px 14px; border-radius: var(--radius-sm); min-height: 32px;
}
.tb-switch button.active { background: var(--canvas); color: var(--ink); }
.tb-switch button:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }

/* ---------- Mode KARTU ----------
   Tiap baris tabel jadi satu blok vertikal. Teks dibiarkan mengalir di dalam
   kartu (tanpa posisi absolut / tanpa float), jadi tidak mungkin menimpa. */
.tb-cards { display: grid; gap: var(--sp-md); }
.tb-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--sp-md);
  background: var(--canvas);
  /* kunci: anak-anak tidak boleh melebar keluar dan menutupi kartu lain */
  min-width: 0;
  overflow: hidden;
}
.tb-card > .tb-card-title {
  font-size: 14px; font-weight: 600; color: var(--ink);
  margin-bottom: var(--sp-sm);
  overflow-wrap: anywhere; word-break: break-word;
}
.tb-card dl { margin: 0; display: grid; gap: 6px; }
.tb-card .tb-f {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--sp-md); min-width: 0;
}
.tb-card .tb-f dt {
  font-size: var(--fs-label); color: var(--muted);
  flex: 0 1 auto; min-width: 0; overflow-wrap: anywhere;
}
.tb-card .tb-f dd {
  margin: 0; font-size: 13px; font-weight: 600; color: var(--ink);
  text-align: right; font-variant-numeric: tabular-nums;
  flex: 0 0 auto; max-width: 55%; overflow-wrap: anywhere;
}
/* teks penjelas panjang di kartu: turun ke baris sendiri, tidak menimpa */
.tb-card .tb-note {
  display: block; margin-top: var(--sp-sm); font-size: var(--fs-label);
  color: var(--muted); overflow-wrap: anywhere;
}
.tb-card .tb-note b { color: var(--ink); }

/* satu-satunya mode yg tampil: tabel ATAU kartu */
[data-tampilan="tabel"] .tb-cards { display: none; }
[data-tampilan="kartu"] .tbl-wrap { display: none; }

/* status = titik + kata, tanpa lencana berwarna (aturan Fiori) */
.tb-dot { display: inline-block; width: 8px; height: 8px; border-radius: 999px; margin-right: 6px; vertical-align: middle; }
.tb-dot.green { background: var(--success); }
.tb-dot.red { background: var(--danger); }
.tb-dot.beige, .tb-dot.yellow { background: var(--warning); }
.tb-dot.blue { background: var(--info); }
.tb-dot.grey { background: var(--muted); }
/* ---------- Jarak antar kolom (WAJIB) ----------
   `* { padding: 0 }` di baris awal menghapus padding bawaan sel, dan aturan
   `th`/`td` hanya mengatur padding VERTIKAL. Akibatnya kolom saling menempel:
   header "Spend" + "Klik WA" terbaca "SPENDKLIK WA" dan kolom kanan terpotong.
   Di sini jarak horizontal dipasang eksplisit, dan header tidak boleh membungkus
   (nowrap) supaya tabel memang menggeser, bukan menghimpit. */
.tbl-wrap th,
.tbl-wrap td,
.dec-tbl th, .dec-tbl td,
.rtbl th, .rtbl td,
.r-tbl th, .r-tbl td,
.cc-mini th, .cc-mini td,
.sample-tbl th, .sample-tbl td {
  padding-left: 10px;
  padding-right: 10px;
}
.tbl-wrap th:first-child,
.dec-tbl th:first-child, .dec-tbl td:first-child,
.rtbl th:first-child, .rtbl td:first-child,
.r-tbl th:first-child, .r-tbl td:first-child { padding-left: 12px; }
.tbl-wrap th:last-child,
.dec-tbl th:last-child, .dec-tbl td:last-child,
.rtbl th:last-child, .rtbl td:last-child,
.r-tbl th:last-child, .r-tbl td:last-child { padding-right: 12px; }
/* ---------- Sel pertama & kontrol di dalam tabel ----------
   Sel "Campaign / ad set" memuat nama + sub-teks + tombol CBO/ABO. Tanpa
   aturan, kontrol ini berdesakan dengan teks ("BudgetCBOABOpilih supaya...").
   Dibuat mengalir ke bawah dalam kolom sempit, bukan berdampingan. */
.dec-tbl td:first-child, .rtbl td:first-child {
  min-width: 180px;
  max-width: 240px;
}
.dec-tbl td:first-child > * ,
.rtbl td:first-child > * { display: block; }
.dec-tbl td:first-child button,
.dec-tbl td:first-child .btn,
.dec-tbl td:first-child [data-act] {
  display: inline-block;
  margin: 6px 6px 0 0;
  min-height: 30px;
  padding: 4px 10px;
  font-size: 12px;
  white-space: nowrap;
}
/* sub-teks di sel: turun baris, tidak menempel ke kontrol */
.dec-tbl td .small, .dec-tbl td .muted,
.rtbl td .small, .rtbl td .muted {
  display: block;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.dec-tbl .bt-wrap, .rtbl .bt-wrap {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px;
}

/* Matriks diagnosa (SVG dari engine lama, dipakai layar Analisa):
   variabel warna kuadran + titik yang dirujuk matrixSVG (16-blocks.js).
   Sebelumnya variabel ini tidak terdefinisi di CSS aplikasi, jadi
   grafik matriks tidak bisa dirender di layar baru. Nilai mengikuti
   palet tone yang sudah dipakai kartu kuadran di layar Analisa. */
:root {
  --qr-bg: #FEE2E2; --qr-strong: #991B1B; --qr-line: #FCA5A5;
  --qg-bg: #DCFCE7; --qg-strong: #166534; --qg-line: #86EFAC;
  --qb-bg: #DBEAFE; --qb-strong: #1E40AF; --qb-line: #93C5FD;
  --qe-bg: #FEF3C7; --qe-strong: #92400E; --qe-line: #FCD34D;
  --dot: #FFFFFF; --dot-stroke: #111111;
}
.msvg { width: 100%; max-width: 340px; height: auto; display: block; }

/* ---------- Blok keputusan lama (decisionBlock) di layar baru ----------
   decisionBlock merender kelas chrome lama (.block-h, .pill, .why,
   .linkbtn, .btsel/.bt, .tgnote, .inp, .ctedit) yang tidak punya aturan
   sama sekali di CSS aplikasi baru — akibatnya lencana keputusan tampil
   teks polos, tombol CBO/ABO & toggle ad set tampil sebagai tombol
   native browser, dan kotak target tidak ter-style. Aturan di bawah
   mendefinisikan kelas-kelas itu mengikuti token aplikasi. */
.sec-body .block { margin: 0; }
.sec-body .block-h h2 { display: none; } /* judul sudah dari akordeon */
.sec-body .block-h .h-sub {
  font-size: 12.5px; color: var(--muted); line-height: 1.55; margin: 0 0 10px;
}
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: var(--radius-pill);
  font-size: 11.5px; font-weight: 700; line-height: 1.5; white-space: nowrap;
  background: #F3F4F6; color: #374151;
}
.pill.t-green { background: #DCFCE7; color: #166534; }
.pill.t-red { background: #FEE2E2; color: #991B1B; }
.pill.t-beige, .pill.t-yellow, .pill.t-amber { background: #FEF3C7; color: #92400E; }
.pill.t-blue { background: #DBEAFE; color: #1E40AF; }
.pill.t-grey { background: #F3F4F6; color: #4B5563; }
.dec-tbl .why {
  display: block; margin-top: 6px;
  font-size: 12.5px; line-height: 1.55; overflow-wrap: anywhere;
}
.dec-tbl .cc-link { margin-top: 6px; font-size: 12.5px; }
.dec-tbl .cc-link a { color: var(--brand); font-weight: 600; }
.linkbtn {
  background: none; border: none; padding: 0; cursor: pointer;
  font-family: inherit; font-size: 12.5px; font-weight: 600; color: var(--brand);
  text-align: left;
}
.linkbtn.dec-tg {
  display: inline-flex; margin-top: 8px; padding: 6px 12px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--canvas); color: var(--ink); font-size: 12px;
  min-height: 32px; align-items: center;
}
.btsel {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px;
}
.btsel .bt {
  padding: 5px 12px; min-height: 30px; cursor: pointer;
  border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--canvas); color: var(--ink);
  font-family: inherit; font-size: 12px; font-weight: 600;
}
.btsel .bt[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.tgnote {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-alt); padding: 12px; margin: 0 0 12px;
  font-size: 12.5px; line-height: 1.55;
}
.tgnote p { margin: 0; }
.tgrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.inp {
  height: 40px; padding: 0 12px; width: 170px; max-width: 100%;
  border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--canvas); color: var(--ink);
  font-family: inherit; font-size: 13px;
}
.ctedit { margin-top: 10px; }
.ctedit summary { cursor: pointer; font-weight: 600; font-size: 13px; }
.ctlist { display: grid; gap: 8px; margin-top: 8px; }
.ctrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ctrow .inp { width: 150px; }

/* Tabel keputusan: pas selebar kartu, tanpa geser samping.
   Layout fixed + lebar kolom eksplisit — sebelumnya kolom Keputusan
   terhimpit ±90px karena kolom lain nowrap, jadi teksnya menumpuk
   satu-dua kata per baris dan kolom terpenting tersembunyi di kanan. */
.sec-body .dec-tbl { table-layout: fixed; width: 100%; }
.sec-body .dec-tbl th { white-space: normal; }
.sec-body .dec-tbl th:nth-child(1), .sec-body .dec-tbl td:nth-child(1) { width: 23%; }
.sec-body .dec-tbl th:nth-child(2), .sec-body .dec-tbl td:nth-child(2) { width: 18%; }
.sec-body .dec-tbl th:nth-child(3), .sec-body .dec-tbl td:nth-child(3) { width: 9%; }
.sec-body .dec-tbl th:nth-child(4), .sec-body .dec-tbl td:nth-child(4) { width: 18%; }
.sec-body .dec-tbl th:nth-child(5), .sec-body .dec-tbl td:nth-child(5) { width: 32%; }
.sec-body .dec-tbl td:first-child { min-width: 0; max-width: none; }
.sec-body .dec-tbl td.n { font-size: 12px; letter-spacing: -0.2px; }
.sec-body .dec-tbl tr.camp-row td { background: var(--surface-alt); }
/* CATATAN: jangan longgarkan layout ini berdasarkan lebar viewport —
   kolom aplikasi selalu sempit (±480px) walau viewport desktop lebar,
   jadi media query min-width justru mengembalikan tabel lebar yang
   meluber. Layout fixed berlaku di semua lebar; persen kolom diskalakan. */
@media (min-width: 720px) {
  .sec-body .dec-tbl td.n { font-size: 12.5px; }
}

/* ---------- Keputusan per campaign & ad set: desain baru (dec2) ----------
   Penukar Tabel | Kartu tetap ada; bawaan Kartu. Kartu = daftar
   keputusan (garis status, metrik sebaris, lencana vonis pendek,
   1 baris alasan, detail di expand). Tabel = 3 kolom + chevron,
   layout fixed selebar kartu. Detail (.d2detail) memakai kelas
   panel lama (.pill/.why/.btsel/.tgnote/.inp) yang sudah didefinisikan. */
.dec2 .d2head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.dec2 .d2switch { margin: 0; background: var(--canvas); border: 1.5px solid var(--border-strong); border-radius: 10px; padding: 3px; }
.dec2 .d2switch button { display: inline-flex; align-items: center; gap: 6px; border-radius: 7px; }
.dec2 .d2switch button.active { background: var(--brand); color: #fff; }
.chev-ico { display: block; transition: transform .15s ease; }
[aria-expanded="true"] > .chev-ico, [aria-expanded="true"] .chev-ico { transform: rotate(180deg); }
.d2btnrow { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; min-height: 32px; }
.d2btnrow-r { display: inline-flex; align-items: center; gap: 8px; }
/* Toggle ad set: teks "N ad set" SELALU tampil (terbuka maupun tertutup).
   Pembeda state = warna pill: terbuka = biru solid brand (#3B82F6),
   teks & chevron putih (bahasa "aktif = biru" seperti segmented);
   tertutup = pill netral. Chevron tetap berputar via aturan chev-ico. */
.d2btnrow .d2kidpill { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: var(--radius-pill); border: 1px solid var(--border-strong); background: var(--canvas); color: var(--ink); font-family: inherit; font-size: 12.5px; font-weight: 700; white-space: nowrap; cursor: pointer; }
.d2btnrow .d2kidpill[aria-expanded="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.d2kidbtn { display: inline-flex; align-items: center; gap: 5px; background: none; border: none; padding: 4px 2px; cursor: pointer; font-family: inherit; font-size: 12.5px; font-weight: 600; color: var(--brand); }
.d2kidbtn.ico { color: var(--muted); padding: 2px; margin-right: 4px; vertical-align: middle; }
.d2expbtn { width: 32px; height: 32px; flex: none; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--canvas); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.d2kids { margin-left: 14px; }
.dec2 .d2tgt { font-size: 12px; font-weight: 700; background: var(--surface-alt); border: 1px solid var(--border); padding: 4px 10px; border-radius: var(--radius-pill); white-space: nowrap; }
.dec2 .d2note { font-size: 12.5px; color: var(--muted); line-height: 1.55; margin: 0 0 10px; }
.dec2[data-tampilan="kartu"] .d2tblwrap { display: none; }
.dec2[data-tampilan="tabel"] .d2cards { display: none; }
/* kartu */
.d2row { display: flex; gap: 10px; padding: 11px 2px; border-bottom: 1px solid var(--border); }
.d2row:last-child { border-bottom: none; }
.d2bar { width: 4px; border-radius: 2px; flex: none; background: var(--muted); }
.d2bar.t-green { background: #22C55E; } .d2bar.t-red { background: #EF4444; }
.d2bar.t-beige, .d2bar.t-yellow, .d2bar.t-amber { background: #F59E0B; } .d2bar.t-blue { background: #3B82F6; }
.d2main { flex: 1; min-width: 0; }
.d2top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.d2nm { font-weight: 700; font-size: 13.5px; overflow-wrap: anywhere; }
.d2row.kid .d2nm { font-size: 13px; }
.d2tag { font-size: 10.5px; font-weight: 700; color: var(--muted); background: var(--surface-alt); border-radius: 6px; padding: 1px 6px; vertical-align: 2px; }
.d2mt { color: var(--muted); font-size: 12px; margin-top: 2px; }
.d2mt b { color: var(--ink); }
.d2delta { font-weight: 700; } .d2delta.dn { color: var(--success); } .d2delta.up { color: var(--danger); }
.d2why { font-size: 12.5px; margin-top: 5px; line-height: 1.5; overflow-wrap: anywhere; }
.d2exp { background: none; border: none; padding: 0; margin-top: 7px; cursor: pointer; font-family: inherit; font-size: 12.5px; font-weight: 600; color: var(--brand); }
.d2detail { margin-top: 8px; padding: 10px 12px; background: #FAFAFA; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 12.5px; line-height: 1.55; overflow-wrap: anywhere; }
.d2detail .cc-link { margin-top: 6px; }
.d2detail .cc-link a { color: var(--brand); font-weight: 600; }
/* tabel: bisa digeser samping, semua kolom 1 baris (nowrap) */
.dec2-tbl { width: max-content; min-width: 100%; border-collapse: collapse; font-size: 12.5px; }
.dec2-tbl th, .dec2-tbl td { white-space: nowrap; }
.dec2-tbl tr.d2drow td { white-space: normal; }
.dec2-tbl th { background: var(--surface-alt); text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); font-weight: 600; padding: 8px; border-bottom: 1px solid var(--border); }
.dec2-tbl th.num, .dec2-tbl td.num { text-align: right; font-variant-numeric: tabular-nums; }
.dec2-tbl td { padding: 9px 8px; border-bottom: 1px solid var(--border); vertical-align: top; overflow-wrap: anywhere; }
.dec2-tbl td .sub { display: block; color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.dec2-tbl td.num .sub { text-align: right; }
.dec2-tbl tr.camp td { background: var(--surface-alt); }
.dec2-tbl tr.kid td:first-child { padding-left: 20px; border-left: 3px solid var(--border); }
.dec2-tbl .pill { white-space: nowrap; }
.dec2-tbl .d2namecell b { vertical-align: middle; }
.dec2-tbl .d2chevc { text-align: center; color: var(--muted); }
.dec2-tbl tr.camp td { font-weight: 500; }
.dec2-tbl tr.d2tr { cursor: pointer; }
.dec2-tbl tr.d2drow td { background: #FAFAFA; padding: 4px 8px 10px; }
.dec2-tbl tr.d2drow .d2detail { margin-top: 4px; border: none; background: transparent; padding: 4px 2px; }

/* ===== Funnel v2: penukar Bar | Corong ===== */
.f2verdict { border-radius: 10px; padding: 11px 12px; font-size: 13px; line-height: 1.55; margin-bottom: 12px; }
.f2verdict.bad { border: 1px solid #FECACA; background: #FEF2F2; }
.f2verdict.bad b { color: #991B1B; }
.f2verdict.ok { border: 1px solid #BBF7D0; background: #F0FDF4; }
.f2verdict.ok b { color: #166534; }
.f2head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.f2total { font-size: 12px; color: var(--muted); text-align: right; }
.f2switch { margin: 0; background: var(--canvas); border: 1.5px solid var(--border-strong); border-radius: 10px; padding: 3px; }
.f2switch button { display: inline-flex; align-items: center; gap: 6px; border-radius: 7px; }
.f2switch button.active { background: var(--brand); color: #fff; }
.fview[data-tampilan="bar"] .fcorongview { display: none; }
.fview[data-tampilan="corong"] .fbarview { display: none; }
/* Tajuk per-bagian — hanya tampil di layar lebar (penukar disembunyikan) */
.fview-ph { display: none; }
.frow2 { margin-bottom: 13px; }
.frow2:last-child { margin-bottom: 2px; }
.ftop2 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.flab2 { font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.fval2 { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ftrack2 { position: relative; height: 22px; background: #F1F1F4; border-radius: 999px; margin-top: 5px; overflow: hidden; }
.fbar2 { position: absolute; left: 0; top: 0; bottom: 0; background: var(--brand); border-radius: 999px; min-width: 3px; }
.fbar2.weak { background: #EF4444; }
.fconv2 { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); margin-top: 4px; }
.fsegwrap { margin: 0 auto; }
.fseg { height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; line-height: 1.3; padding: 0 6px; }
.fsegnm { font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.fsegv { font-size: 11.5px; font-weight: 600; opacity: .92; white-space: nowrap; font-variant-numeric: tabular-nums; }
.fsegconv { text-align: center; font-size: 12px; color: var(--muted); padding: 5px 0 4px; }
.fsegconv.weak { color: #991B1B; font-weight: 600; }

/* ===== Corong v2: corong menerus (kiri) + label (kanan) =====
   Baris rapat tanpa jarak vertikal → segmen corong menyambung jadi satu
   kerucut; label & konversi di kolom kanan supaya tidak pernah terpotong. */
.cor2 { margin: 4px 0 2px; display: flex; flex-direction: column; gap: 0; }
.cor2-row { display: flex; align-items: stretch; gap: 12px; }
/* garis tipis pemisah tiap lorong */
.cor2-row + .cor2-row { border-top: 1px solid var(--border); }
.cor2-row + .cor2-row .cor2-fcell { border-top: 0; }
.cor2-fcell { flex: 0 0 44%; display: flex; align-items: stretch; min-height: 52px; }
.cor2-shape { width: 100%; align-self: stretch; }
.cor2-lcell { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 7px 0; }
.cor2-lab { font-size: 13.5px; font-weight: 700; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; line-height: 1.25; }
.cor2-row.weak .cor2-lab { color: #991B1B; }
.cor2-val { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; display: flex; align-items: baseline; gap: 7px; }
.cor2-share { font-size: 11.5px; font-weight: 600; color: var(--muted); }
.cor2-chip { display: inline-block; font-size: 10.5px; font-weight: 700; color: #fff; background: #EF4444; border-radius: 999px; padding: 2px 8px; line-height: 1.5; }
.cor2-conv { font-size: 11.5px; color: var(--muted); line-height: 1.35; }
.cor2-conv.weak { color: #991B1B; font-weight: 600; }
.cor2-conv.ph { content: ''; display: block; min-height: 1em; }

/* ---------- Layar lebar (tablet/desktop) ---------- */
@media (min-width: 768px) {
  /* corong jangan melebar penuh: kolom jadi renggang & corong melar */
  .cor2 { max-width: 560px; }
  body { border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
  /* funnel: bar (40) + corong (60) berdampingan, penukar disembunyikan */
  .fview .f2switch { display: none; }
  .fview[data-tampilan] { display: grid; grid-template-columns: 40fr 60fr; gap: 24px; align-items: start; }
  .fview[data-tampilan] .f2verdict { grid-column: 1 / -1; margin-bottom: 0; }
  .fview[data-tampilan] .f2head { grid-column: 1 / -1; justify-content: flex-end; margin-bottom: 4px; }
  .fview[data-tampilan] .fbarview, .fview[data-tampilan] .fcorongview { display: block; }
  .fview .fview-ph { display: block; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
}
/* Matriks: layout dasar = MENUMPUK untuk semua lebar (aman di HP).
   Kartu kuadran 1 kolom full width. JANGAN taruh layout di inline style
   .mx-quads — inline mengunci kolom dan tak bisa dioverride media query
   (pernah bikin kartu kuadran sempit tak terbaca di HP). */
.mx-flex { display: block; }
.mx-flex > .mx-quads { display: grid; grid-template-columns: 1fr; gap: 8px; margin-top: 8px; min-width: 0; }
@media (min-width: 900px) {
  /* kartu tampilan kartu (tabel generik) jadi 2 kolom */
  .tb-cards { grid-template-columns: 1fr 1fr; align-items: start; }
  /* ubin Angka kunci di Overview jadi 4 sebaris */
  .kpi-grid { grid-template-columns: repeat(4, 1fr) !important; }
  /* matriks: grafik di kiri, kartu kuadran 2x2 di kanan */
  .mx-flex { display: flex; gap: 20px; align-items: flex-start; }
  .mx-flex > .mx-chart { flex: 0 0 340px; }
  .mx-flex > .mx-quads { grid-template-columns: 1fr 1fr; flex: 1; min-width: 0; }
}
.fseg.stub { height: 26px; }
.fsegout { text-align: center; padding: 5px 0 1px; line-height: 1.35; }
.fsegout .fsegnm { display: block; font-size: 12.5px; font-weight: 700; white-space: normal; }
.fsegout .fsegv { display: block; font-size: 11.5px; font-weight: 600; opacity: .75; white-space: normal; }
.fseg .fsegnm, .fseg .fsegv { white-space: normal; text-align: center; }

/* ===== Matriks: penukar Ringkas | Detail ===== */
.mxhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.mxscope { font-size: 12px; color: var(--muted); text-align: right; }
.mxswitch { margin: 0; background: var(--canvas); border: 1.5px solid var(--border-strong); border-radius: 10px; padding: 3px; }
.mxswitch button { display: inline-flex; align-items: center; gap: 6px; border-radius: 7px; }
.mxswitch button.active { background: var(--brand); color: #fff; }
.mxr2 { border: 1px solid var(--border); border-radius: 8px; padding: 12px; margin-bottom: 10px; }
.mxr2-head { font-size: 15px; font-weight: 800; line-height: 1.4; }
.mxr2-meta { font-size: 11.5px; color: var(--muted); margin-top: 6px; line-height: 1.5; }
.mxr2-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.mxchip { display: inline-flex; align-items: center; font-size: 11.5px; font-weight: 700; padding: 4px 9px; border-radius: 999px; line-height: 1.4; }
.mxbug { font-size: 11.5px; color: #92400E; background: #FFFBEB; border: 1px solid #FDE68A; border-radius: 7px; padding: 6px 9px; margin-top: 9px; line-height: 1.5; }
.mxr2-more { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.mxr2-tap { font-size: 12px; color: var(--muted); }
.mxd2 { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 12px; }
.mxview[data-mxmode="detail"] .mxd2 { display: block !important; }
.mxview[data-mxmode="detail"] .mxr2-meta,
.mxview[data-mxmode="detail"] .mxr2-chips,
.mxview[data-mxmode="detail"] .mxr2-more { display: none; }

/* ===== Tab Todo + badge ===== */
.tabbadge { display: inline-flex; align-items: center; justify-content: center; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; background: #EF4444; color: #fff; font-size: 10.5px; font-weight: 800; margin-left: 5px; vertical-align: 2px; }
.tabbadge[hidden] { display: none; }
.todoview .taicard { border: 1.5px solid #DDD6FE; background: #F5F1FF; border-radius: 8px; padding: 12px; margin-bottom: 14px; }
.todoview .taich { display: flex; align-items: center; gap: 7px; font-weight: 800; font-size: 13.5px; color: #7C3AED; }
/* Chevron lipat Ringkasan AI: tombol bulat d2expbtn existing, kanan header */
.todoview .taich .d2expbtn { margin-left: auto; }
.todoview .taicard p { font-size: 12.5px; line-height: 1.55; margin: 6px 0 0; }
.todoview 
/* Halaman Todo mandiri: tautan ke snapshot sumber */
.tsnaplink { margin: 18px 4px 8px; }
.tmeth { text-align: right; margin: 2px 0 12px; }
.todoview .tmeth a { font-size: 12px; color: #6B7280; text-decoration: none; font-weight: 600; }
.todoview .tmeth a:hover { color: #3B82F6; }
.todoview .taigen { margin-top: 9px; }
.tprog { margin-bottom: 6px; }
.tpt { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); margin-bottom: 5px; }
.tpt b { color: var(--ink); }
.tpbar { height: 8px; background: #F1F1F4; border-radius: 4px; overflow: hidden; }
.tpbar i { display: block; height: 100%; background: var(--brand); border-radius: 4px; }
.tgrp { font-size: 11.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; margin: 16px 0 8px; display: flex; align-items: center; gap: 7px; }
.tgrp .tdot { width: 8px; height: 8px; border-radius: 99px; }
.ttask { border: 1px solid var(--border); border-radius: 8px; padding: 11px 12px; margin-bottom: 8px; }
.ttask.done { opacity: .6; }
.ttrow { display: flex; gap: 10px; align-items: flex-start; }
.ttcheck { width: 19px; height: 19px; margin-top: 1px; accent-color: var(--brand); flex: none; cursor: pointer; }
.ttmain { flex: 1; min-width: 0; }
.tttitle { font-size: 13.5px; font-weight: 700; line-height: 1.45; }
.ttask.done .tttitle { text-decoration: line-through; }
.ttev { font-size: 12px; color: var(--muted); line-height: 1.5; margin-top: 2px; }
.ttmeta { display: flex; gap: 6px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.tsrc { font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--surface-alt); color: var(--muted); }
.taibtn { display: inline-flex; align-items: center; gap: 5px; border: 1px solid #DDD6FE; background: var(--canvas); color: #7C3AED; font-family: inherit; font-size: 11.5px; font-weight: 700; padding: 4px 10px; border-radius: 999px; cursor: pointer; }
.ttexp { margin-left: auto; width: 28px; height: 28px; }
.taiout { margin-top: 9px; background: #F5F1FF; border: 1px solid #DDD6FE; border-radius: 8px; padding: 9px 11px; font-size: 12.5px; line-height: 1.6; }
.taiout.err { background: #FEF2F2; border-color: #FECACA; }
.taih { font-weight: 800; color: #7C3AED; font-size: 11px; margin-bottom: 4px; text-transform: uppercase; letter-spacing: .03em; }
.taiout.err .taih { color: #991B1B; }
.taitext { white-space: pre-wrap; }
/* Render teks AI terstruktur (Ringkasan AI & Bantu AI) */
.aifokus { background: #EFF6FF; border: 1px solid #BFDBFE; border-radius: 8px; padding: 9px 11px; margin: 2px 0 10px; }
.aifokus-l { font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--brand); }
.aifokus p { font-size: 13px; line-height: 1.55; margin: 3px 0 0; color: #1E293B; white-space: normal; }
.aisec { font-size: 13px; font-weight: 800; margin: 10px 0 4px; color: #111827; }
.ailist { margin: 4px 0 8px; padding-left: 18px; font-size: 12.5px; line-height: 1.55; }
.ailist li { margin: 3px 0; }
.aipara { font-size: 12.5px; line-height: 1.55; margin: 6px 0 0; }
.ttdetail { margin-top: 10px; border-top: 1px dashed var(--border); padding-top: 9px; font-size: 12.5px; line-height: 1.55; }
.ttlinks { margin-top: 8px; }
.ttlinks a { font-size: 12px; font-weight: 700; color: var(--brand); text-decoration: none; }

/* Segmen input Analisa: ringkas jadi satu bar saat hasil sudah tampil */
.upsec { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--canvas); margin-bottom: var(--sp-lg); overflow: hidden; }
.upsec-head { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 12px; background: none; border: 0; cursor: pointer; text-align: left; color: var(--ink); font: inherit; }
.upsec-title { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.upsec-body { padding: 2px 12px 14px; }
.upsec-pill { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: var(--radius-pill); border: 1px solid var(--border-strong); background: var(--canvas); color: var(--ink); font-size: 13px; font-weight: 700; white-space: nowrap; }
/* Saat form terbuka: pill menyusut jadi ikon chevron saja (tanpa teks) */
.upsec-head[aria-expanded="true"] .upsec-pill-t { display: none; }
.upsec-head[aria-expanded="true"] .upsec-pill { width: 34px; height: 34px; padding: 0; border-radius: 999px; justify-content: center; }

/* ---- Diagnosa per iklan: penukar Daftar | Kartu + carousel creative ----
   Switcher mengikuti pola .d2switch: active = brand solid, teks putih. */
.diagswitch { margin: 0 0 var(--sp-md); background: var(--canvas); border: 1.5px solid var(--border-strong); border-radius: 10px; padding: 3px; }
.diagswitch button { display: inline-flex; align-items: center; gap: 6px; border-radius: 7px; }
.diagswitch button.active { background: var(--brand); color: #fff; }

/* ---------- Baris filter Riwayat & Todo: pill cakupan + switcher Tabel|Kartu ----------
   Keduanya harus sejajar konstruksi: satu garis tengah vertikal + tinggi visual sama.
   - Switcher: tombol 32px + padding 3x2 + border 1.5x2 = 41px (box-sizing global border-box).
     Margin bawah bawaannya (.diagswitch margin 0 0 var(--sp-md)) menggeser pusat
     konten switcher ke atas dalam flex row -> dimatikan khusus di baris ini
     (.frow .diagswitch { margin: 0 }), dan barisnya sendiri yang memegang jarak
     bawah yang sama (.frow { margin-bottom: var(--sp-md); }) agar jarak ke konten
     di bawahnya sama persis seperti di tempat asal switcher.
   - Pill: tingginya disamakan dengan switcher (41px) sebagai acuan.
   - State biru solid saat scope='semua' disalin persis dari pola d2kidpill terbuka:
     background var(--brand), border var(--brand), teks putih.
     Pill di header upload Analisa tidak tersentuh (scope .frow). */
.frow { margin-bottom: var(--sp-md); }
.frow .diagswitch { margin: 0; }
.frow .upsec-pill { height: 41px; }
.frow .upsec-pill[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.ccar { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; padding: 4px 2px 12px; }
.ccard { flex: 0 0 82%; max-width: 340px; scroll-snap-align: center; background: var(--canvas); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; }
.ccmedia { position: relative; aspect-ratio: 1 / 1; background: var(--surface-alt); }
.ccmedia img[data-ccimg] { width: 100%; height: 100%; object-fit: cover; display: block; }
.ccph { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--muted); padding: 16px; text-align: center; }
.ccph[hidden] { display: none; }
.ccph-t { font-size: 12.5px; font-weight: 700; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cc-add { display: inline-flex; align-items: center; gap: 6px; }
.cc-tools { position: absolute; right: 8px; bottom: 8px; display: flex; gap: 6px; }
.cc-tool { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; font-family: inherit; background: rgba(255,255,255,.94); border: 1px solid var(--border); border-radius: 999px; padding: 5px 10px; cursor: pointer; color: var(--ink); }
.ccbody { padding: 12px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.cc-name { font-weight: 800; font-size: 14px; color: var(--ink); }
.cc-verdict { font-size: 11.5px; font-weight: 800; padding: 3px 10px; border-radius: 999px; }
.cc-verdict.t-red { background: #FEE2E2; color: #991B1B; }
.cc-verdict.t-yellow { background: #FEF3C7; color: #92400E; }
.cc-verdict.t-blue { background: #DBEAFE; color: #1E40AF; }
.cc-verdict.t-green { background: #DCFCE7; color: #166534; }
.cc-stats { display: flex; gap: 14px; flex-wrap: wrap; }
.ccstat { font-size: 11px; color: var(--muted); }
.ccstat b { display: block; font-size: 13px; color: var(--ink); margin-top: 1px; }
.cc-desc { font-size: 13px; color: var(--muted); }
.cc-act { font-size: 13px; color: var(--ink); }
.cc-hint { font-size: 11px; margin: 2px 0 0; }
/* Paste-upload: area creative bisa diklik untuk "mempersenjatai" kartu */
.ccmedia { cursor: pointer; }
.ccmedia.armed { outline: 2.5px solid var(--brand); outline-offset: -2.5px; }
.cc-armhint { position: absolute; left: 8px; top: 8px; display: none; background: var(--brand); color: #fff; font-size: 11px; font-weight: 700; padding: 5px 10px; border-radius: 999px; box-shadow: 0 1px 4px rgba(0,0,0,.25); pointer-events: none; }
.ccmedia.armed .cc-armhint { display: block; }
.cc-armhint .h-mob { display: none; }
@media (pointer: coarse) {
  .cc-armhint .h-desk { display: none; }
  .cc-armhint .h-mob { display: inline; }
}
.ccph-btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

/* ---------- Ad Set & Tren Harian (tab Detail) ----------
   Kartu seksi Ad Set memakai pola carousel mode Kartu Diagnosa (.ccar/.ccard),
   tanpa area thumb/gambar. Hierarki kartu (mockup 16 Okt, disetujui owner):
   nama+pil -> 1 kalimat vonis -> 1 baris pendukung -> 2 bar bergaris penanda
   target -> chip Meta/jendela -> footer tanggal menempel di bawah (tanpa rongga). */
.lccard .ccbody { padding: 16px; height: 100%; gap: 0; align-items: stretch; }
/* Bar grafik kartu seksi Ad Set. Akar masalah bar tak terlihat: .ccbody adalah
   flex kolom dgn align-items:flex-start, sehingga .prog (anak flex) runtuh
   jadi lebar 0. Aturan ini memaksa bar meregang penuh. Warna fill mengikuti
   bahasa status pil (t-green/t-yellow/t-red), konsisten dgn d2bar. */
.lccard .lcard-h { align-self: stretch; width: 100%; margin-bottom: 12px; }
.lccard .lverdict { font-size: 15.5px; font-weight: 800; line-height: 1.35; color: var(--ink); }
/* Blok vonis cadangan tinggi tetap agar bar & elemen di bawahnya sejajar antar
   kartu: muat vonis 2 baris + pendukung 2 baris (15.5×1.35×2 + 4 + 13×1.45×2). */
.lccard .lverdict-w { min-height: 5.25em; }
.lccard .lsub { font-size: 13px; color: var(--muted); line-height: 1.45; margin-top: 4px; }
/* Tint status SANGAT tipis (keputusan owner): Pantau = semburat amber,
   Bermasalah = semburat merah, Aman = tetap putih. Teks tidak berubah. */
.lccard.ltint-yellow { background: rgba(245,158,11,0.055); }
.lccard.ltint-red { background: rgba(239,68,68,0.055); }
.lccard .lbar { margin-top: 16px; align-self: stretch; width: 100%; }
.lccard .lbar-lbl { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 5px; }
.lccard .lbar-k { font-size: 10.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.lccard .lbar-val { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; font-size: 13px; color: var(--ink); }
.lccard .prog { position: relative; overflow: visible; height: 8px; margin: 0; }
.lccard .prog .tick { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink); opacity: .5; border-radius: 2px; }
.lccard .lbar-cap { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.lccard .lmeta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; }
.lccard .lmeta span { font-size: 11.5px; font-weight: 600; padding: 4px 9px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-alt); color: var(--muted); }
.lccard .lfoot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.lccard .lfoot .inp { width: auto; height: 30px; padding: 0 8px; font-size: 12.5px; border-width: 1px; border-radius: 8px; }
.lccard .lfoot label { font-size: 11.5px; }
.lccard .lbar.t-green .prog i { background: #22C55E; }
.lccard .lbar.t-red .prog i { background: #EF4444; }
.lccard .lbar.t-yellow .prog i, .lccard .lbar.t-beige .prog i, .lccard .lbar.t-amber .prog i { background: #F59E0B; }
/* Tren Harian Overview — gaya Oviond (pilihan owner 17 Okt): kartu widget,
   garis halus + area gradasi, grid putus-putus tipis, label sumbu kiri,
   target = garis putus-putus. Pas lebar, tanpa geser, tanpa bar/titik. */
.trn-card { background: var(--canvas); border: 1px solid var(--border); border-radius: 14px; padding: 16px; }
.trn-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.trn-title { font-size: 15px; font-weight: 700; color: var(--ink); }
.trn-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.trn-total { text-align: right; }
.trn-total-v { font-size: 20px; font-weight: 800; color: var(--ink); }
.trnsvg { width: 100%; height: auto; display: block; }
/* Tautan kembali standar (acuan: page Klien) — satu definisi global. */
.back-link { display: inline-block; color: var(--muted); font-size: 14px; padding: 12px 0 0; text-decoration: none; }
.tov-sum { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.tov-sum b { color: var(--ink); font-variant-numeric: tabular-nums; }
/* Kontrol Buka semua / Tutup semua di atas daftar seksi Detail */
.sec-tools { display: flex; justify-content: flex-end; gap: 8px; margin-bottom: 8px; }
.sec-toolbtn { font-size: 12px; font-weight: 700; font-family: inherit; background: var(--canvas); border: 1px solid var(--border); border-radius: 999px; padding: 6px 12px; cursor: pointer; color: var(--ink); }
.sec-toolbtn:active { background: var(--surface-alt); }
   Aturan layout mengikuti riset: SAP Fiori letterboxing 1280px,
   "think in columns" (2 kolom >=900px, 3 kolom >=1440px), chart full-width. */
.lcards { display: grid; gap: var(--sp-md); }
.lcard { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: var(--sp-lg); background: #fff; }
.lcard-h { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--sp-sm); margin-bottom: var(--sp-sm); }
.lcard-h h3 { font-size: var(--fs-body); margin: 0; }
.lcard .big { font-size: var(--fs-title); font-weight: 700; font-variant-numeric: tabular-nums; }
.prog { height: 6px; background: #F3F4F6; border-radius: var(--radius-pill); margin: var(--sp-sm) 0; overflow: hidden; }
.prog i { display: block; height: 100%; background: var(--navy); border-radius: var(--radius-pill); }
.chartbox { width: 100%; }
.chartbox svg { width: 100%; height: auto; display: block; max-height: 360px; }
.chartbox .legend { display: flex; flex-wrap: wrap; gap: var(--sp-lg); font-size: var(--fs-label); color: var(--muted); margin-bottom: var(--sp-sm); }
.chartbox .legend i { display: inline-block; width: 10px; height: 12px; border-radius: 2px; background: var(--navy-soft); margin-right: 6px; vertical-align: -1px; }
.chartbox .legend span:last-child i { height: 3px; width: 14px; background: var(--navy); vertical-align: 2px; margin-right: 6px; }
@media (min-width: 900px) {
  .lcards { grid-template-columns: 1fr 1fr; align-items: start; }
}
@media (min-width: 1100px) {
  /* Daftar diagnosa: dua kolom di desktop (pola kartu Fiori overview page) */
  .diag-list { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-md); align-items: start; }
  .diag-list > div { margin-bottom: 0 !important; }
}
@media (min-width: 1440px) {
  .lcards { grid-template-columns: 1fr 1fr 1fr; }
}

/* === Cek creative (seksi Detail) — bahasa kartu app === */
.cc-group { margin: 18px 0 0; }
.cc-gh { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.cc-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 1100px) { .cc-grid { grid-template-columns: 1fr 1fr; } }
.cc-card { background: var(--canvas); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.cc-name { font-size: 15px; font-weight: 800; color: var(--ink); line-height: 1.35; }
.cc-meta { font-size: 12.5px; }
.cc-why { margin: 0; line-height: 1.55; }
.cc-ev { margin: 2px 0 0; padding-left: 18px; font-size: 13px; line-height: 1.6; color: var(--ink); display: grid; gap: 4px; }
.cc-ev li::marker { color: var(--muted); }
.cc-card .cc-act { margin-top: 4px; background: var(--surface-alt, #F3F4F6); border-radius: 8px; padding: 8px 10px; font-size: 13px; line-height: 1.55; color: var(--ink); }
.cc-card .cc-act-l { font-weight: 800; }

/* ==========================================================================
   SNAPSHOT = PROJECT (dokumen terstempel) — 16 Okt 2026
   Header dokumen read-only, dialog simpan, badge, dan tampilan daftar
   project (Todo & Riwayat). Tabel memakai .tbl-wrap bawaan app (slidable),
   sel satu baris mengikuti pola .dec2-tbl.
   ========================================================================== */

/* ---------- Header dokumen (menggantikan segmen upload saat read-only) ---------- */
.dochead {
  background: var(--canvas);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 14px;
}
.dochead-name {
  font-size: 17px;
  font-weight: 800;
  margin: 10px 0 4px;
  line-height: 1.35;
}
.lockbadge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 800;
  color: #B45309;
  background: rgba(245, 158, 11, 0.14);
  border-radius: var(--radius-pill);
  padding: 3px 10px;
}

/* ---------- Dialog simpan snapshot ---------- */
.snapdlg-wrap {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.snapdlg {
  background: var(--canvas);
  border-radius: var(--radius-sm);
  padding: 20px;
  max-width: 420px;
  width: 100%;
}

/* ---------- Input mati di mode dokumen read-only ---------- */
.inp:disabled,
input:disabled {
  opacity: 0.55;
}

/* ---------- Badge & baris daftar project ---------- */
.openbadge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  background: #EF4444;
  border-radius: var(--radius-pill);
  padding: 2px 9px;
}
.rn-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.rn-row input {
  flex: 1;
  font: inherit;
  padding: 8px 10px;
  border: 1px solid var(--brand);
  border-radius: var(--radius-sm);
  background: var(--canvas);
  color: var(--ink);
}

/* Tabel daftar snapshot/project: semua sel 1 baris (nowrap) mengikuti pola
   tabel Keputusan (.dec2-tbl) — tabel tetap bisa digeser samping, bukan turun. */
#snapList table th, #snapList table td,
#projList table th, #projList table td { white-space: nowrap; }

/* Nav pill (dari eksperimen UI1, disetujui owner 17 Okt): rel abu radius
   penuh, tab aktif pill putih teks gelap — khusus tab mode input Analisa
   (.u1-atabs) dan tab hasil Overview|Details|Todo (.u1-rtabs). */
.u1-atabs, .u1-rtabs { background: #ECEEF1; border-radius: 999px; padding: 4px; }
.u1-atabs button, .u1-rtabs button { border-radius: 999px; color: #667085; font-weight: 600; }
.u1-atabs button.active, .u1-rtabs button.active {
  background: #fff;
  color: #111;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(16, 24, 40, .12);
}

/* Mode dokumen: atribut hidden harus menang atas display .btn/.segmented */
#uploadBtn[hidden] { display: none; }
#modeTabs[hidden] { display: none; }

/* ==== Hero Beranda: carousel 3 kartu + preset tema user (putih/gradasi/gelap) ==== */
.hero { margin: 12px 0; }
.hero-controls { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.hero-range { flex: 1; display: flex; margin-bottom: 0; }
.hero-range button { flex: 1; }
.hero-vs { font-size: 12px; color: var(--muted); line-height: 1.3; }
.hero-track { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 2px; margin: 0 -2px; scrollbar-width: none; }
.hero-track::-webkit-scrollbar { display: none; }
.hero-card { flex: 0 0 86%; max-width: 340px; scroll-snap-align: start; border-radius: 20px; padding: 18px; box-sizing: border-box; display: flex; flex-direction: column; color: var(--h-ink); }
.hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.hero-eye { font-size: 11px; font-weight: 600; letter-spacing: .08em; color: var(--h-mut); }
.hero-ttl { font-size: 24px; font-weight: 800; line-height: 1.15; margin-top: 4px; }
.hero-share-btn { flex: none; width: 34px; height: 34px; border-radius: 999px; border: 1px solid var(--h-btnb); background: transparent; color: var(--h-mut); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.hero-lbl { font-size: 12px; color: var(--h-mut); }
.hero-big { font-size: 42px; font-weight: 800; line-height: 1; }
.hero-rowbig { display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; }
.hero-spend { text-align: right; }
.hero-spend-v { font-size: 20px; font-weight: 800; white-space: nowrap; }
.hero-delta { font-size: 13px; font-weight: 600; color: var(--h-delta); margin-top: 6px; }
.hero-delta.is-buruk { color: var(--h-buruk); }
.hero-tile .hero-delta { font-size: 12.5px; }
.hero-chart { width: 100%; height: 92px; margin-top: 12px; color: var(--h-chart); display: block; }
.hero-tiles { display: flex; gap: 10px; margin-top: 12px; }
.hero-tile { flex: 1; min-width: 0; background: var(--h-tile); border-radius: 14px; padding: 12px 14px; }
.hero-tile-v { font-size: clamp(17px, 5.3vw, 21px); font-weight: 800; margin-top: 3px; white-space: nowrap; letter-spacing: -.01em; }
/* Tile nilai rupiah DILEBARKAN (60/40 lawan tile pendampingnya yang isinya
   pendek) supaya angka muat TANPA mengecilkan font — ukuran font nilai
   tetap sama antar tile. Hanya CPR belasan juta (11+ karakter) yang
   menyusut bertingkat via kelasTileV() di home.js. */
.hero-tile.lebar { flex: 1.5; }
.hero-tile-v.v11 { font-size: clamp(14px, 4.4vw, 17.5px); }
.hero-tile-v.v12 { font-size: clamp(12.5px, 3.9vw, 15px); }
.hero-tile-v.v-big { font-size: clamp(19px, 5.8vw, 23px); }
.hero-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 12px; font-size: 11.5px; color: var(--h-mut); }
.hero-c1 .hero-chart { flex: 1 1 auto; min-height: 92px; }
.hero-c1 .hero-foot { margin-top: 12px; }
.hero-c3 .hero-att { margin-top: auto; }
.hero-c3 .hero-foot { margin-top: 0; }
.hero-bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.hero-bar-n { width: 92px; flex: none; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-bar-track { flex: 1; height: 8px; border-radius: 999px; background: var(--h-track); }
.hero-bar-track i { display: block; height: 8px; border-radius: 999px; background: var(--h-bar); }
.hero-bar-v { font-size: 12.5px; white-space: nowrap; }
.hero-note { font-size: 12.5px; color: var(--h-mut); margin-top: 10px; line-height: 1.5; }
.hero-note b { color: var(--h-ink); }
.hero-prog { margin-top: 16px; }
.hero-prog-l { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--h-mut); }
.hero-prog-l b { color: var(--h-ink); }
.hero-prog-track { height: 10px; border-radius: 999px; background: var(--h-track); margin-top: 7px; }
.hero-prog-track i { display: block; height: 10px; border-radius: 999px; background: var(--h-prog); }
.hero-att { margin-top: 16px; border-top: 1px solid var(--h-track); padding-top: 12px; }
.hero-att-t { font-size: 14.5px; font-weight: 700; }
.hero-att-line { font-size: 12.5px; color: var(--h-mut); margin-top: 5px; line-height: 1.5; }
.hero-att-line b { color: var(--h-ink); }
.hero-bawah { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }
.hero-dots { display: flex; gap: 5px; }
.hero-dots i { width: 6px; height: 6px; border-radius: 99px; background: #D0D5DD; }
.hero-dots i.on { width: 20px; background: var(--ink); }
.hero-tema { display: flex; gap: 8px; }
.hero-sw { width: 22px; height: 22px; border-radius: 999px; border: 1px solid var(--border); cursor: pointer; padding: 0; }
.hero-sw.sw-putih { background: #FFFFFF; }
.hero-sw.sw-gradasi { background: linear-gradient(135deg, #2F6BEE, #C026D3); }
.hero-sw.sw-gelap { background: #101828; }
.hero-sw.on { outline: 2px solid var(--brand); outline-offset: 2px; }
.hero-sheet { position: fixed; inset: 0; background: rgba(16,24,40,.5); display: flex; align-items: flex-end; justify-content: center; z-index: 60; }
.hero-sheet[hidden] { display: none; }
.hero-sheet-card { background: var(--canvas); width: 100%; max-width: 480px; border-radius: 18px 18px 0 0; padding: 18px 18px calc(18px + env(safe-area-inset-bottom)); box-sizing: border-box; }
.hero-sheet-t { font-size: 16px; font-weight: 800; color: var(--ink); }
/* Tema putih simpel */
.hero[data-tema="putih"] { --h-ink: var(--ink); --h-mut: var(--muted); --h-tile: #F7F8FA; --h-delta: #12805C; --h-buruk: #B42318; --h-chart: #3B82F6; --h-track: #EEF2F6; --h-bar: #3B82F6; --h-prog: #12B76A; --h-btnb: #E4E7EC; }
.hero[data-tema="putih"] .hero-card { background: #FFFFFF; border: 1px solid var(--border); }
/* Tema gradasi brand */
.hero[data-tema="gradasi"] { --h-ink: #FFFFFF; --h-mut: rgba(255,255,255,.74); --h-tile: rgba(255,255,255,.15); --h-delta: #BBF7D0; --h-buruk: #FECDC2; --h-chart: #FFFFFF; --h-track: rgba(255,255,255,.28); --h-bar: #FFFFFF; --h-prog: #FFFFFF; --h-btnb: rgba(255,255,255,.4); }
.hero[data-tema="gradasi"] .hero-c1 { background: linear-gradient(150deg, #2F6BEE, #6366F1 58%, #8B5CF6); }
.hero[data-tema="gradasi"] .hero-c2 { background: linear-gradient(150deg, #7C3AED, #C026D3); }
.hero[data-tema="gradasi"] .hero-c3 { background: linear-gradient(150deg, #0F766E, #16A34A); }
/* Tema gelap premium */
.hero[data-tema="gelap"] { --h-ink: #FFFFFF; --h-mut: #98A2B3; --h-tile: rgba(255,255,255,.06); --h-delta: #6CE9A6; --h-buruk: #F97066; --h-chart: #60A5FA; --h-track: rgba(255,255,255,.14); --h-bar: #60A5FA; --h-prog: #6CE9A6; --h-btnb: rgba(255,255,255,.25); }
.hero[data-tema="gelap"] .hero-c1 { background: linear-gradient(160deg, #16233F, #101828); }
.hero[data-tema="gelap"] .hero-c2 { background: linear-gradient(160deg, #221840, #101828); }
.hero[data-tema="gelap"] .hero-c3 { background: linear-gradient(160deg, #0E2A22, #101828); }

/* ==========================================================================
   Motion basic (oil-ui references/motion.md — keputusan owner 17 Okt 2026:
   "basic aja"). Tiga saja: 1) feedback saat ditekan, 2) transisi perubahan
   state, 3) entrance singkat. Tanpa scroll-narrative / parallax / GSAP.
   Hanya transform, opacity, warna; durasi 150-260ms.
   ========================================================================== */
.btn, .segmented button, .chip, .spill, .upsec-pill, .d2kidpill, .hero-sw, .cm-item {
  transition: transform .15s ease, background-color .18s ease, color .18s ease, border-color .18s ease;
}
.btn:active, .chip:active, .spill:active, .upsec-pill:active, .d2kidpill:active { transform: scale(.97); }
.segmented button:active { transform: scale(.98); }
.tabbar .tab { transition: color .18s ease, transform .15s ease; }
.tabbar .tab:active { transform: scale(.94); }
.toggle { transition: background-color .2s ease; }
.hero-dots i { transition: width .2s ease, background-color .2s ease; }
.hero-sw { transition: transform .15s ease, outline-color .18s ease; }
.hero-sw:active { transform: scale(.9); }

@keyframes wana-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes wana-pop { from { opacity: 0; transform: scale(.96) translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes wana-rise { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
@keyframes wana-page { from { opacity: .35; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Entrance halaman: kelas dipasang router sekali per navigasi; render ulang
   di dalam layar tidak melewati router, jadi tidak ikut replay. */
#app.pg-in { animation: wana-page .09s ease-out; }
.snapdlg-wrap { animation: wana-fade .18s ease-out; }
.snapdlg { animation: wana-pop .2s ease-out; }
.hero-sheet { animation: wana-fade .2s ease-out; }
.hero-sheet-card { animation: wana-rise .26s ease-out; }
.modal.show { animation: wana-fade .18s ease-out; }
.modal-in { animation: wana-page .22s ease-out; }
.client-menu { animation: wana-pop .16s ease-out; }

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