/* css/workspace-shell.css — kerangka halaman workspace bersama Terminal + Browser (PRD#agent-browser §2.3, B1).
 *
 * DIEKSTRAK dari blok <style> pages/terminal.html (PRD#terminal-workspace D-TW2 T2, D-TW9 T4, D-TW14) — BUKAN salinan:
 * pages/terminal.html dan pages/browser.html memuat berkas ini; yang khusus satu halaman tetap di halamannya (Terminal: tombol
 * Panel baru/Kelola server, worker, tampilan Server). Aturan grid generik = css/split-workspace.css (satu sumber dgn Chat). */
.tw-page.hidden { display: none; }
/* Banner langganan app.js (sticky, menyisip di atas body) mendorong halaman setinggi dirinya → grid
   terpotong dan halaman menggulir (sisa T1). Tingginya diukur ke --tw-offset (mountWorkspace). */
.tw-page { height: calc(100dvh - var(--tw-offset, 0px)); }
@media (max-width: 768px) {
  html:not(.sb-embed) .tw-page { height: calc(100dvh - 56px - var(--sb-sat) - var(--sb-sab) - var(--tw-offset, 0px)); }
}
.tw-bar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid #e5e7eb; background: #fff; }
.tw-count { font-size: 12px; color: #6b7280; font-variant-numeric: tabular-nums; }
.tw-area { position: relative; flex: 1 1 auto; min-height: 0; display: flex; background: #f9fafb; }
.tw-area > .sbc-split { flex: 1 1 auto; height: 100%; }
/* Satu panel pun butuh header (pilih server, bagi, tutup) — Terminal tidak punya pill seperti Chat. */
@media (min-width: 769px) { .tw-area .sbc-pane-hd { display: flex; } }
.tw-state { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: #d1d5db; }
.tw-state[data-state="ok"] { background: #16a34a; }
.tw-state[data-state="warn"] { background: #d97706; }
.tw-state[data-state="err"] { background: #dc2626; }
.tw-empty { position: absolute; inset: 0; overflow-y: auto; display: flex; align-items: flex-start; justify-content: center; padding: 48px 16px; }
.tw-empty-card { width: 100%; max-width: 520px; text-align: center; }
.tw-empty-card .empty-icon { margin: 0 auto; }
.tw-empty-list { margin-top: 16px; text-align: left; border-top: 1px solid #f3f4f6; padding-top: 8px; }
/* PRD#terminal-workspace D-TW9 T4 — HP: SATU panel layar penuh (.tw-m-on = panel difokus, dipasang
   js/terminal-workspace.js); pill (pola .sbc-pill Chat) membuka lembar daftar panel ber-back-stack.
   Panel lain tetap terpasang (display:none) → kembali ke desktop tak memuat ulang iframe. */
.tw-pill { display: none; }
@media (max-width: 768px) {
  .tw-bar { padding: 8px 12px; }
  .tw-h1 { display: none; }
  /* Warna/border/bayangan/hover/terbuka pill + avatar = komponen pill css/custom.css (.tw-pill alias, PRD#notes v0.10 G4). */
  .tw-pill { display: inline-flex; gap: 6px; max-width: 100%; min-height: 36px; padding: 4px 10px 4px 4px; font: inherit; font-size: 13px; font-weight: 600; }
  .tw-pill:focus-visible { outline: 2px solid #4f46e5; outline-offset: 2px; }
  .tw-pill-ava { flex: 0 0 26px; display: inline-flex; }
  .tw-pill-ava:empty { display: none; }
  .tw-pill-name { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tw-pill > svg { flex: 0 0 auto; color: #9ca3af; }
  .tw-count { margin-top: 2px; padding-left: 4px; }
  .tw-area > .sbc-split { display: flex; flex-direction: column; }
  .tw-area .sbc-col { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
  .tw-area .sbc-col:not(.tw-m-on), .tw-area .sbc-pane:not(.tw-m-on), .tw-area .sbc-fold-strip { display: none !important; }
  .tw-empty { padding: 24px 12px; }
}
/* Lembar daftar panel (D-TW9 H3): HP = lembar bawah; desktop = popover di bawah bilah atas (dibuka dari
   "Tutup panel lain", H7). z 45 = lapis overlay dalam-halaman (peta z-index design system): di atas
   bottom nav (40), di bawah modal (50); FAB chat disembunyikan selama terbuka. */
.tw-sheet-bd { position: fixed; inset: 0; z-index: 45; background: rgba(17,24,39,.45); }
.tw-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; max-height: 80dvh; display: flex; flex-direction: column; background: #fff;
  border-radius: 16px 16px 0 0; box-shadow: 0 -10px 30px rgba(15,23,42,.18); padding-bottom: var(--sb-sab); }
.tw-sheet-hd { display: flex; align-items: center; gap: 8px; padding: 12px 8px 8px 16px; border-bottom: 1px solid #f3f4f6; }
.tw-sheet-hd > .tw-sheet-x { margin-left: auto; }
.tw-sheet-title { font-size: 15px; font-weight: 600; color: #111827; }
.tw-sheet-sub { font-size: 12px; color: #6b7280; font-variant-numeric: tabular-nums; }
.tw-sheet-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 6px; }
/* D-TW14 (owner 2026-11-11) — satu baris = satu kartu: sorotan (tampil/hover/fokus) membungkus nama SAMPAI tombol ×,
   jadi × terbaca milik barisnya walau tetap di ujung kanan (zona jempol; jauh dari nama = tak salah ketuk "tutup").
   × abu-abu tenang, merah hanya saat hover/ditekan. */
.tw-sheet-row { border-radius: 10px; transition: background-color .12s; }
.tw-sheet-row > .sbc-menu-item, .tw-sheet-row > .sbc-menu-item:hover, .tw-sheet-row > .sbc-menu-item:focus-visible { background: none; }
.tw-sheet-row:hover, .tw-sheet-row:has(> .sbc-menu-item:focus-visible) { background: #f3f4f6; }
.tw-sheet-row.is-on { background: #eef2ff; }
.tw-sheet-x { width: 36px; height: 36px; flex: 0 0 36px; border: none; background: none; border-radius: 8px; color: #6b7280; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.tw-sheet-x:hover { background: #f3f4f6; color: #111827; }
.tw-sheet-row > .tw-sheet-x { color: #9ca3af; margin-right: 2px; }
.tw-sheet-row > .tw-sheet-x:hover, .tw-sheet-row > .tw-sheet-x:active { background: #fee2e2; color: #b91c1c; }
.tw-sheet-x:focus-visible { outline: 2px solid #4f46e5; outline-offset: 1px; }
.tw-sheet-ft { padding: 10px 16px 12px; border-top: 1px solid #f3f4f6; }
.tw-sheet-ft .btn { width: 100%; justify-content: center; }
body.tw-sheet-open #sbChatFab { display: none !important; }
@media (max-width: 768px) {
  .tw-sheet .sbc-menu-item { min-height: 44px; }
  .tw-sheet-x { width: 44px; height: 44px; flex-basis: 44px; }
}
@media (min-width: 769px) {
  .tw-sheet-bd { background: transparent; }
  .tw-sheet { position: absolute; left: auto; bottom: auto; top: 52px; right: 16px; width: 320px; max-height: 70vh; border: 1px solid #e5e7eb;
    border-radius: 14px; box-shadow: 0 12px 32px rgba(0,0,0,.14); padding-bottom: 0; }
}

/* PRD#agent-browser §2.3/§2.5 (B2) — DIEKSTRAK dari pages/terminal.html (bukan salinan): bilah kuning .term-prev (Terminal D-TW15 S2 +
   banner ambil alih Browser) dan dasar baris tombol .term-keys (Terminal D-TW20 + keyboard HP Browser). */
/* D-TW15 S2 — bilah "shell lama": kuning (peringatan), satu baris di panel lebar, membungkus di panel sempit. */
.term-prev { flex: none; display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; padding: 8px 12px; background: #fffbeb;
  border-bottom: 1px solid #fde68a; color: #92400e; font-size: 13px; line-height: 18px; }
.term-prev[hidden] { display: none; }
.term-prev-t { flex: 1 1 220px; min-width: 0; }
.term-prev-act { display: flex; gap: 8px; flex: none; }
.term-prev button { height: 32px; padding: 0 12px; border-radius: 8px; border: 1px solid #fcd34d; background: #fff; color: #92400e; font: inherit;
  font-size: 13px; font-weight: 600; cursor: pointer; }
.term-prev button.is-danger { border-color: #fca5a5; color: #b91c1c; }
.term-prev button:focus-visible { outline: 2px solid #4f46e5; outline-offset: 2px; }
@media (max-width: 768px) { .term-prev button { height: 40px; } }
.term-keys { display: flex; align-items: center; background: #111827; }
.term-keys-scroll { flex: 1 1 auto; min-width: 0; display: flex; gap: 6px; padding: 6px 8px; overflow-x: auto; scrollbar-width: none; }
.term-keys-scroll::-webkit-scrollbar { display: none; }
.term-keys button { flex: 0 0 auto; min-width: 44px; height: 36px; border-radius: 6px; background: #1f2937; color: #e5e7eb; font-size: 13px; border: 1px solid #374151; display: inline-flex; align-items: center; justify-content: center; }
.term-keys button[aria-pressed="true"] { background: #4f46e5; border-color: #4f46e5; }
