/* SuperByte — split workspace generik (PRD#terminal-workspace D-TW1 T0).
   Dipakai halaman Chat (index.html + js/chat-split.js) dan halaman Terminal (T2) lewat
   js/split-layout.js. Diekstrak dari <style> inline index.html TANPA perubahan aturan; nama kelas
   .sbc-* dipertahankan supaya harness E2E split Chat tetap valid. Aturan khusus Chat (panel utama
   .sbc-host / .is-main, pill .sbc-top) tetap inline di index.html. */
/* ── PRD#chat-split-workspace S3 — split workspace ala iTerm (js/split-layout.js) ──
   Kolom = flex row; tiap kolom 1–2 panel. Header panel hanya saat > 1 panel; pill kanan-atas
   disembunyikan di mode split (pemilih pindah ke header tiap panel). Mobile = panel utama saja. */
@media (min-width: 769px) {
  .sbc-split { display: flex; height: 100vh; width: 100%; min-width: 0; }
  .sbc-col { display: flex; flex-direction: column; flex: 1 1 0; min-width: 0; min-height: 0; }
  .sbc-col + .sbc-col { border-left: 1px solid #e5e7eb; }
}
.sbc-pane { position: relative; display: flex; flex-direction: column; flex: 1 1 0; min-height: 0; min-width: 0; background: #fff; }
.sbc-pane + .sbc-pane { border-top: 1px solid #e5e7eb; }
.sbc-pane-frame { flex: 1 1 auto; width: 100%; border: 0; background: #fff; }
.sbc-pane-hd { display: none; align-items: center; gap: 2px; height: 40px; flex: 0 0 40px; padding: 0 6px 0 8px; border-bottom: 1px solid #f3f4f6; background: #fff; }
.sbc-split.is-split .sbc-pane-hd { display: flex; }
.sbc-split.is-split .sbc-pane.focused::after { content: ''; position: absolute; inset: 0; border: 2px solid #4f46e5; pointer-events: none; z-index: 6; }
.sbc-pane.flash::after { content: ''; position: absolute; inset: 0; border: 2px solid #a5b4fc; pointer-events: none; z-index: 6; animation: sbcFlash .9s ease; }
@keyframes sbcFlash { 0%, 100% { opacity: 0; } 30%, 70% { opacity: 1; } }
.sbc-pane-pick { display: inline-flex; align-items: center; gap: 6px; border: none; background: none; border-radius: 8px; padding: 4px 6px;
  cursor: pointer; min-width: 0; font: inherit; font-size: 13px; font-weight: 600; color: #111827; }
.sbc-pane-pick:hover, .sbc-pane-pick[aria-expanded="true"] { background: #f3f4f6; }
.sbc-pane-pick:focus-visible, .sbc-pane-btn:focus-visible { outline: 2px solid #4f46e5; outline-offset: 1px; }
.sbc-pane-pick > svg { color: #9ca3af; flex: 0 0 auto; }
.sbc-pane-ava { width: 24px; height: 24px; flex: 0 0 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: #fff; background: linear-gradient(135deg, #6366f1, #4f46e5); }
.sbc-pane-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.sbc-pane-sp { flex: 1 1 auto; }
.sbc-pane-btn { width: 28px; height: 28px; flex: 0 0 28px; border: none; background: none; border-radius: 7px; color: #6b7280; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.sbc-pane-btn:hover:not(:disabled) { background: #eef2ff; color: #4f46e5; }
.sbc-pane-btn:disabled { opacity: .35; cursor: default; }
.sbc-pane-btn.danger:hover:not(:disabled) { background: #fee2e2; color: #b91c1c; }
/* S4 — lebar adaptif (kolom dilipat ke rel kanan), pembatas seret, perbesar panel. */
.sbc-split, .sbc-col { position: relative; }
.sbc-col.sbc-folded { display: none !important; }
.sbc-fold-strip { flex: 0 0 52px; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 10px 0;
  border-left: 1px solid #e5e7eb; background: #f9fafb; overflow-y: auto; }
.sbc-fold-strip[hidden] { display: none; }
.sbc-fold-chip { position: relative; width: 36px; height: 36px; flex: 0 0 36px; border: 1px solid #e5e7eb; border-radius: 10px; background: #fff;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.sbc-fold-chip:hover { background: #eef2ff; border-color: #c7d2fe; }
.sbc-fold-chip:focus-visible { outline: 2px solid #4f46e5; outline-offset: 2px; }
.sbc-fold-dot { position: absolute; top: -3px; right: -3px; width: 10px; height: 10px; border-radius: 50%; background: #dc2626; box-shadow: 0 0 0 2px #f9fafb; display: none; }
.sbc-fold-chip.unread .sbc-fold-dot { display: block; }
/* PRD#chat-session-rail — item rel = chip + label (pola pratinjau Terminal); chip parkir punya × saat hover/fokus. */
.sbc-fold-item { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; flex: 0 0 auto; width: 48px; }
.sbc-fold-lbl { max-width: 48px; font-size: 10px; line-height: 12px; color: #6b7280; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.sbc-fold-x { position: absolute; top: -5px; left: -1px; width: 16px; height: 16px; padding: 0; border: 1px solid #e5e7eb; border-radius: 50%; background: #fff; color: #6b7280;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; opacity: 0; transition: opacity .12s; }
.sbc-fold-x svg { width: 10px; height: 10px; }
.sbc-fold-item:hover .sbc-fold-x, .sbc-fold-item:focus-within .sbc-fold-x { opacity: 1; }
.sbc-fold-x:hover { background: #fee2e2; border-color: #fecaca; color: #b91c1c; }
.sbc-fold-x:focus-visible { outline: 2px solid #4f46e5; outline-offset: 1px; opacity: 1; }
@media (prefers-reduced-motion: reduce) { .sbc-fold-x { transition: none; } }
/* PRD#chat-session-rail D-SR6 — kolom boleh menyempit sampai 240 px: header panel < 300 px dipadatkan
   (tombol 24 px, tanpa chevron) supaya judul tetap terbaca dan tak ada tombol terdorong keluar.
   Kontainer = HEADER, bukan .sbc-pane: container-type memberi layout containment (stacking context)
   dan .sbc-pane-menu (anak panel) harus tetap bisa meluber di atas panel bawahnya. */
.sbc-pane-hd { container: sbcpanehd / inline-size; }
@container sbcpanehd (max-width: 300px) {
  .sbc-pane-pick { gap: 4px; padding: 4px; }
  .sbc-pane-pick > svg { display: none; }
  .sbc-pane-btn { width: 24px; height: 24px; flex: 0 0 24px; }
  .sbc-pane-btn svg { width: 14px; height: 14px; }
  .sbc-tgt { margin-left: 2px !important; }
}
.sbc-gutter-v { position: absolute; top: 0; bottom: 0; left: -4px; width: 8px; cursor: col-resize; z-index: 9; }
.sbc-gutter-h { position: absolute; left: 0; right: 0; top: -4px; height: 8px; cursor: row-resize; z-index: 9; }
.sbc-gutter-v:hover, .sbc-gutter-v:focus-visible, .sbc-split.drag-v .sbc-gutter-v:active { outline: none; background: linear-gradient(to right, transparent 3px, #818cf8 3px, #818cf8 5px, transparent 5px); }
.sbc-gutter-h:hover, .sbc-gutter-h:focus-visible, .sbc-split.drag-h .sbc-gutter-h:active { outline: none; background: linear-gradient(to bottom, transparent 3px, #818cf8 3px, #818cf8 5px, transparent 5px); }
.sbc-split.is-dragging { user-select: none; }
.sbc-split.is-dragging iframe { pointer-events: none; }
.sbc-split.drag-v, .sbc-split.drag-v * { cursor: col-resize !important; }
.sbc-split.drag-h, .sbc-split.drag-h * { cursor: row-resize !important; }
.sbc-split.is-zoomed .sbc-col:not(.has-zoom), .sbc-split.is-zoomed .sbc-pane:not(.zoomed),
.sbc-split.is-zoomed .sbc-gutter-v, .sbc-split.is-zoomed .sbc-gutter-h { display: none !important; }
.sbc-pane-btn[aria-pressed="true"] { background: #eef2ff; color: #4f46e5; }
.sbc-pane-menu { position: absolute; top: 40px; left: 8px; z-index: 60; width: 288px; max-width: calc(100% - 16px); max-height: 70vh; overflow-y: auto;
  background: #fff; border: 1px solid #e5e7eb; border-radius: 14px; box-shadow: 0 12px 32px rgba(0,0,0,.14); padding: 6px; }
@media (max-width: 768px) {
  .sbc-pane-hd { display: none !important; }
}
@media (prefers-reduced-motion: reduce) { .sbc-pane.flash::after { animation: none; } }
