/* SuperByte — komponen HP mobile-first bersama (PRD#mobile-web-view D16 Run D · D1, I1), pasangan js/sb-mobile-ui.js.
   Dirujuk HTML halaman pemakai (index, agents, models, settings, workspace, tasks) TEPAT SETELAH css/sb-sheet.css.
   Semua kelas ber-prefix sb-m-; komponen ini hanya dirender di tampilan HP (≤768) — di desktop ≥769 wadah hidupnya
   (bilah aksi, layar detail) disembunyikan dan markup HP-only memakai .sb-m-hp, sehingga desktop 1280 tidak berubah.
   Warna = palet sistem A consumer (docs/guide/ui-design-system.md §2.1–2.5): brand prod #4f46e5/#4338ca/#6366f1/#eef2ff
   (staging biru lewat env-theme), semantik warn #fef3c7/#92400e, danger #dc2626/#fee2e2/#991b1b, sukses #22c55e,
   netral #111827/#374151/#6b7280/#9ca3af/#e5e7eb/#f3f4f6. Ukuran/hierarki mengikuti mockup usulan-01..13 (disetujui). */

@media (min-width: 769px) {
  .sb-m-hp, .sb-m-bar, .sb-m-screens { display: none !important; }
}

/* ── Avatar default: warna tetap dari id (sbMUI.tone) + inisial ── */
.sb-m-av { display: inline-grid; place-items: center; flex: none; border-radius: 50%; color: #fff; font-weight: 700;
  letter-spacing: .01em; line-height: 1; -webkit-user-select: none; user-select: none; }
.sb-m-av .nav-icon { width: 55%; height: 55%; }
.sb-m-av-sm { width: 36px; height: 36px; font-size: 13px; }
.sb-m-av-md { width: 44px; height: 44px; font-size: 15px; }
.sb-m-av-lg { width: 56px; height: 56px; font-size: 19px; }
.sb-m-av-xl { width: 104px; height: 104px; font-size: 36px; }
.sb-m-av-sq { border-radius: 14px; }
/* Palet nada .sb-m-t0..5 DIPINDAH ke css/sb-ui.css (satu aturan bersama .sb-av-t*, region sb-env-theme:keep D20 —
   PRD#mobile-web-view D21 Run E · E0). Halaman pemakai sbMUI WAJIB merujuk sb-ui.css (dijaga tests/mobile-web-e0-foundation.test.js). */
.sb-m-av-off { background: #e5e7eb; color: #6b7280; }
.sb-m-av-grp { background: #e0e7ff; color: #4f46e5; }

/* ── Ubin ikon 40 px ── */
.sb-m-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.sb-m-ico .nav-icon { width: 22px; height: 22px; }
.sb-m-ico-accent { background: #eef2ff; color: #4f46e5; }
.sb-m-ico-neutral { background: #f3f4f6; color: #4b5563; }
.sb-m-ico-warn { background: #fef3c7; color: #92400e; }
.sb-m-ico-ok { background: #dcfce7; color: #166534; }
.sb-m-ico-danger { background: #fee2e2; color: #dc2626; }

/* ── Seksi, kotak grup ── */
.sb-m-sect { font-size: 12px; font-weight: 600; color: #6b7280; letter-spacing: .04em; text-transform: uppercase; padding: 20px 16px 8px; }
.sb-m-box { margin: 0 16px; border: 1px solid #e5e7eb; border-radius: 16px; overflow: hidden; background: #fff; }
.sb-m-box + .sb-m-box { margin-top: 16px; }

/* ── Baris daftar ── */
.sb-m-row { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 10px 16px;
  background: none; border: 0; text-align: left; font: inherit; color: #111827; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.sb-m-row + .sb-m-row::before { content: ''; position: absolute; top: 0; left: 72px; right: 0; height: 1px; background: #f3f4f6; }
/* Di dalam kotak: garis pemisah penuh antar-baris apa pun (row/kv bercampur). */
.sb-m-box .sb-m-row + .sb-m-row::before { display: none; }
.sb-m-box.sb-m-box > * + * { border-top: 1px solid #f3f4f6; }
.sb-m-row:active { background: #f9fafb; }
.sb-m-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sb-m-row-title { font-size: 15px; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-m-row-bold .sb-m-row-title { font-size: 16px; font-weight: 600; }
.sb-m-row-sub { font-size: 13px; color: #6b7280; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Teks baris berjarak baris normal seperti semua sketsa HP (utang D-FE #15/#16 A1: line-height 1,5 warisan dokumen membuat
   baris ±2 px lebih tinggi dan judul/keterangan merenggang dari sketsa). */
.sb-m-row-title, .sb-m-row-sub { line-height: normal; }
.sb-m-row-val { font-size: 14px; color: #6b7280; max-width: 170px; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: none; }
.sb-m-row-danger .sb-m-row-title { color: #dc2626; font-weight: 600; }
.sb-m-chev { color: #d1d5db; display: inline-flex; flex: none; }
.sb-m-chev .nav-icon { width: 20px; height: 20px; }
/* Target sentuh ≥44 (micro-audit A9 2026-10-11; dulu 40×40). */
.sb-m-row-menu { width: 44px; height: 44px; margin-right: -10px; border: 0; background: none; border-radius: 12px; color: #6b7280;
  display: grid; place-items: center; flex: none; cursor: pointer; }
.sb-m-row-menu .nav-icon { width: 22px; height: 22px; }

/* ── Kunci–nilai + sakelar (di dalam .sb-m-box) ── */
.sb-m-kv { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 14px 16px; background: none; border: 0;
  text-align: left; font: inherit; color: #111827; cursor: pointer; -webkit-tap-highlight-color: transparent; }
div.sb-m-kv { cursor: default; }
.sb-m-kv-label { flex: 1; min-width: 0; font-size: 15px; }
.sb-m-kv-val { font-size: 14px; color: #6b7280; max-width: 170px; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-m-tog { width: 48px; height: 28px; border-radius: 14px; background: #d1d5db; position: relative; flex: none; transition: background-color .15s; }
.sb-m-tog::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: left .15s cubic-bezier(.2,0,0,1); }
.sb-m-tog.sb-on { background: #4f46e5; }
.sb-m-tog.sb-on::after { left: 23px; }

/* ── Kartu grid 2 kolom ── */
.sb-m-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 4px 16px 16px; }
.sb-m-card { display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 0; padding: 18px 10px 14px;
  border: 1px solid #e5e7eb; border-radius: 20px; background: #fff; font: inherit; color: #111827; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.sb-m-card:active { background: #f9fafb; }
.sb-m-card .sb-m-av { width: 92px; height: 92px; font-size: 32px; }
.sb-m-card-name { font-size: 15px; font-weight: 700; margin-top: 12px; line-height: 1.25; min-height: 38px; padding: 0 4px; max-width: 100%;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.sb-m-card-meta { height: 24px; margin-top: 8px; display: flex; gap: 8px; align-items: center; justify-content: center; white-space: nowrap; }
.sb-m-card-off { background: #f9fafb; }
.sb-m-card-off .sb-m-card-name { color: #6b7280; }

/* ── Chip, status, badge ── */
.sb-m-chip { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 9999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; flex: none; }
.sb-m-row .sb-m-chip { height: 26px; padding: 0 10px; font-size: 12.5px; }
.sb-m-chip-warn { background: #fef3c7; color: #92400e; }
.sb-m-chip-danger { background: #fee2e2; color: #991b1b; }
.sb-m-chip-accent { background: #eef2ff; color: #3730a3; }
.sb-m-chip-neutral { background: #f3f4f6; color: #4b5563; }
.sb-m-status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #6b7280; }
.sb-m-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: #22c55e; }
.sb-m-dot-off { background: #d1d5db; }
.sb-m-badge { min-width: 20px; height: 20px; border-radius: 10px; background: #4f46e5; color: #fff; font-size: 11px; font-weight: 700;
  display: inline-grid; place-items: center; padding: 0 6px; flex: none; }
.sb-m-badge-dot { min-width: 10px; width: 10px; height: 10px; padding: 0; border-radius: 50%; }

/* ── Kartu satu baris (catatan) ── */
.sb-m-note { display: flex; gap: 12px; align-items: center; width: calc(100% - 32px); margin: 8px 16px 0; padding: 14px 16px; border-radius: 16px;
  border: 0; text-align: left; font: inherit; cursor: pointer; }
div.sb-m-note { cursor: default; }
.sb-m-note-info { background: #eef2ff; color: #3730a3; }
.sb-m-note-warn { background: #fef3c7; color: #92400e; }
.sb-m-note-ico { display: inline-flex; flex: none; }
.sb-m-note-ico .nav-icon { width: 24px; height: 24px; }
.sb-m-note-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sb-m-note-title { font-size: 15px; font-weight: 600; }
.sb-m-note-sub { font-size: 13.5px; opacity: .85; margin-top: 2px; }
.sb-m-note .sb-m-chev { color: currentColor; opacity: .7; }

/* ── Kepala sheet + pilihan radio ── */
.sb-m-sheet-head { padding: 4px 12px 12px; }
.sb-m-sheet-title { font-size: 18px; font-weight: 700; color: #111827; margin: 0; }
.sb-m-sheet-sub { font-size: 13px; color: #6b7280; margin: 4px 0 0; }
.sb-m-pick { display: flex; flex-direction: column; gap: 8px; padding: 0 8px; }
.sb-m-rad { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 1.5px solid #e5e7eb; border-radius: 14px;
  background: #fff; font: inherit; color: #111827; text-align: left; cursor: pointer; }
.sb-m-rad.sb-on { border-color: #4f46e5; background: #eef2ff; }
.sb-m-rd { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid #d1d5db; flex: none; display: grid; place-items: center; }
.sb-m-rad.sb-on .sb-m-rd { border-color: #4f46e5; }
.sb-m-rad.sb-on .sb-m-rd::after { content: ''; width: 10px; height: 10px; border-radius: 50%; background: #4f46e5; }
.sb-m-rad-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sb-m-rad-label { font-size: 15px; font-weight: 600; }
.sb-m-rad-sub { font-size: 13px; color: #6b7280; margin-top: 2px; }

/* ── Menu titik tiga (isi sheet) ── */
.sb-m-menu { display: flex; flex-direction: column; }
.sb-m-menu-item { display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 0 12px; border: 0; background: none; border-radius: 12px;
  font: inherit; font-size: 16px; color: #111827; text-align: left; cursor: pointer; }
.sb-m-menu-item:active { background: #f3f4f6; }
.sb-m-menu-ico { display: inline-flex; color: #6b7280; }
.sb-m-menu-ico .nav-icon { width: 22px; height: 22px; }
.sb-m-menu-danger, .sb-m-menu-danger .sb-m-menu-ico { color: #dc2626; }

/* ── Bilah aksi zona jempol ── */
.sb-m-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 48px; border: 0; border-radius: 12px;
  background: #4f46e5; color: #fff; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.sb-m-btn:active { background: #4338ca; }
.sb-m-btn .nav-icon { width: 20px; height: 20px; }
.sb-m-bar { position: fixed; z-index: 33; }
/* Ukuran §5.6 design system HP (utang D-FE #15/#16 A1: dulu bawah 12 px — tombol 12 px lebih rendah dari semua sketsa). */
.sb-m-bar-block { left: 0; right: 0; bottom: 0; padding: 12px 16px calc(24px + var(--sb-sab)); background: linear-gradient(to top, #fff 70%, rgba(255,255,255,0)); }
.sb-m-bar-pill { right: 16px; bottom: calc(24px + var(--sb-sab)); }
.sb-m-bar-pill .sb-m-btn { width: auto; height: 52px; padding: 0 20px 0 16px; border-radius: 26px; box-shadow: 0 8px 20px rgba(79,70,229,.32); }
/* Keyboard terbuka (--kb, app.js) = bilah disembunyikan supaya isian tidak tertutup. */
html[style*="--kb"] .sb-m-bar { display: none; }
/* Ruang gulir di bawah konten supaya item terakhir tidak tertutup bilah. */
/* Bilah [hidden] tidak dihitung; bilah di body (sbMUI.bar(null)) memberi ruang di .main-content. */
.sb-route:has(> .sb-m-bar-block:not([hidden])), .main-content:has(> .sb-m-bar-block:not([hidden])), body.sb-mf:has(> .sb-m-bar-block:not([hidden])) > .main-content,
.sb-m-screen-has-bar .sb-m-screen-body { padding-bottom: calc(100px + var(--sb-sab)); }

/* ── Layar detail push varian B ── */
.sb-m-screens { position: fixed; inset: 0; z-index: 34; pointer-events: none; display: none; }
.sb-m-screens.sb-on { display: block; }
.sb-m-screen { position: absolute; inset: 0; display: flex; flex-direction: column; background: #fff; pointer-events: auto; overflow: hidden; }
.sb-m-hdr { flex: none; height: calc(56px + var(--sb-sat)); padding: var(--sb-sat) 8px 0; display: flex; align-items: center; gap: 4px; background: #fff; }
.sb-m-hdr-btn { width: 44px; height: 44px; border: 0; background: none; border-radius: 12px; display: grid; place-items: center; color: #374151; cursor: pointer; flex: none; }
.sb-m-hdr-btn .nav-icon { width: 22px; height: 22px; }
.sb-m-hdr-title { flex: 1; min-width: 0; margin: 0; padding-left: 4px; font-size: 18px; font-weight: 700; letter-spacing: -.01em; color: #111827;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-m-screen-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding-bottom: calc(16px + var(--sb-sab)); }
.sb-m-screen .sb-m-bar { position: absolute; }

/* ── Tab status + pill (aditif D4: PRD#mobile-web-view D16 Run D · D4) — usulan-10: pill 36 px bergulir horizontal,
   tab sama lebar 14/600 + hitungan 12 px, aktif = teks brand + garis bawah 2 px. ── */
/* Pill tampak 36 px, area sentuh 44 px: bingkai transparan 4 px di luar latar (background-clip) — jarak & tepi tampak
   tetap (gap 6 → 0 + 2×4, padding wadah −4) (micro-audit A10 2026-10-11). */
.sb-m-pills { display: flex; gap: 0; padding: 0 12px 6px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.sb-m-pills::-webkit-scrollbar { display: none; }
.sb-m-pill { flex: none; height: 44px; padding: 0 14px; border: 4px solid transparent; background-clip: padding-box; border-radius: 22px; background-color: #f3f4f6; color: #4b5563; font: inherit;
  font-size: 14px; font-weight: 600; white-space: nowrap; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.sb-m-pill.sb-on { background-color: #4f46e5; color: #fff; }
.sb-m-tabs { display: flex; padding: 0 8px; border-bottom: 1px solid #e5e7eb; }
.sb-m-tab { flex: 1 1 0; min-width: 0; display: flex; align-items: baseline; justify-content: center; gap: 3px; padding: 12px 4px 11px; margin-bottom: -1px;
  border: 0; border-bottom: 2px solid transparent; background: none; font: inherit; font-size: 14px; font-weight: 600; color: #6b7280;
  white-space: nowrap; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.sb-m-tab small { font-size: 12px; font-weight: 600; opacity: .8; }
.sb-m-tab.sb-on { color: #4f46e5; border-bottom-color: #4f46e5; }
/* Tombol sekunder bergaris (aditif D4: aksi kedua di sheet detail, mockup usulan-11 'Arsipkan'). */
.sb-m-btn.sb-m-btn-out { background: #fff; color: #374151; border: 1px solid #d1d5db; }
.sb-m-btn.sb-m-btn-out:active { background: #f9fafb; }

/* Bersama (review Run D) */
.sb-m-hint{margin:0;padding:8px 16px 12px;font-size:13px;color:#6b7280}
.sb-m-sheet-acts{display:flex;flex-direction:column;gap:8px;padding:12px 8px 4px}
.sb-m-sheet-acts .sb-m-row{min-height:48px;padding:8px 6px;border-radius:12px}
.sb-m-btn:disabled{opacity:.5}
.sb-m-empty{margin:0;padding:40px 16px;text-align:center;font-size:14px;color:#9ca3af}
/* Bilah dua aksi (aditif, viewer File Kerja 2026-10-11): sbMUI.bar({…, more}) — utama + ⋮ persegi 48 px / tombol garis berlabel. */
.sb-m-bar-2 { display: flex; gap: 10px; }
.sb-m-bar-2 > .sb-m-btn { flex: 1 1 0; min-width: 0; }
.sb-m-bar-2 > .sb-m-btn.sb-m-btn-ico { flex: 0 0 48px; width: 48px; padding: 0; }
.sb-m-bar-2 > .sb-m-btn-out .nav-icon { color: #374151; }
.sb-m-bar-2[hidden] { display: none; }

/* ── Panel cari HP bersama (smoke owner 2026-10-12): body.sb-m-searching + kelas halaman (nt-/skm-/mt-/ing-searching = apa
   yang disembunyikan). Ukuran = panel cari Chat HP (chat-search.js): padding 4/16/12, kotak pill 44 px. ── */
body.sb-mf.sb-m-searching .page-header.sb-page-head { display: flex; padding: 4px 16px 12px; margin: 0; border: 0; background: #fff; }
body.sb-mf.sb-m-searching .page-header.sb-page-head .sb-page-tools { flex: 1; min-width: 0; }
body.sb-mf.sb-m-searching .page-header.sb-page-head .sb-page-tools > label { width: auto; max-width: none; flex: 1; height: 44px; margin: 0; }
body.sb-mf.sb-m-searching .page-header.sb-page-head .sb-page-tools > label input[type="search"] { height: 44px; min-height: 44px; border-radius: 9999px; font-size: 15px; }
