/* NOBAR-MVP-357 · ADR-0218: 🤖 Operator chat — tombol mengambang (sebelah 💬) + panel percakapan. Token warna tema (terang/gelap). */
.op-fab { position: fixed; right: 76px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 31; width: 50px; height: 50px; padding: 0;
  border-radius: 50%; border: 1px solid var(--line); background: var(--surface); box-shadow: 0 4px 16px rgba(0,0,0,.18); font-size: 22px; line-height: 1;
  display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text); }
.op-fab[hidden] { display: none; }
.op-fab:hover { border-color: var(--accent); }
.op-fab:active { transform: scale(.94); }
.op-fab.jalan { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), 0 4px 16px rgba(0,0,0,.18); }
.op-fab .nav-badge { position: absolute; top: -3px; right: -3px; margin: 0; }
body.rv-wide .op-fab { bottom: calc(40px + env(safe-area-inset-bottom, 0px)); }
body.bc-buka .op-fab { display: none; }
body.op-terbuka .op-fab, body.ms-terbuka .op-fab { display: none; }
@media (max-width: 900px) { body.rv-wide .op-fab { bottom: calc(96px + env(safe-area-inset-bottom, 0px)); } }

.op-panel { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 62; width: 420px;
  height: min(680px, calc(100vh - 32px)); display: flex; flex-direction: column; background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,.25); overflow: hidden; }
.op-panel[hidden] { display: none; }
.op-kepala { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.op-logo { font-size: 20px; }
.op-judul { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.op-judul .small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.op-judul-baris { display: flex; align-items: center; gap: 2px; min-width: 0; }
.op-judul-baris b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.op-judul-baris .op-x { flex: none; font-size: 13px; min-width: 26px; min-height: 26px; padding: 2px 5px; }
.op-kepala > .op-x { flex: none; }
.op-kepala .grow { flex: 1; }
.op-x { border: 0; background: none; font-size: 17px; line-height: 1; padding: 6px 8px; border-radius: 8px; cursor: pointer; color: var(--text-2);
  min-width: 36px; min-height: 36px; }
.op-x:hover { background: var(--line); }
.op-badan { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.op-utas { flex: 1; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; padding: 10px; background: var(--bg); display: flex; flex-direction: column; gap: 5px; }
/* laporan Arbani 23 Okt (HP): satu pesan yang lebih lebar dari panel membuat seluruh utas bisa digeser ke samping */
.op-utas > * { min-width: 0; max-width: 100%; }
.op-kosong { padding: 6px 4px; color: var(--text); }
.op-kosong ul { margin: 4px 0 8px 18px; padding: 0; }
.op-g { display: flex; }
.op-g.saya { justify-content: flex-end; }
.op-g-isi { max-width: 86%; padding: 7px 10px 4px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); overflow-wrap: anywhere; }
.op-g.saya .op-g-isi { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); border-bottom-right-radius: 4px; }
.op-g.dia .op-g-isi { border-bottom-left-radius: 4px; }
/* markdown ringan balasan AI (opMd) */
.op-md-h { font-weight: 700; margin: 6px 0 2px; }
.op-md-li { display: flex; gap: 6px; margin: 1px 0; }
.op-md-n { flex: none; min-width: 1.1em; color: var(--text-2); }
.op-md-t1 { padding-left: 16px; } .op-md-t2 { padding-left: 32px; } .op-md-t3 { padding-left: 48px; }
.op-md-q { border-left: 3px solid var(--line); padding-left: 8px; color: var(--text-2); }
.op-md-jeda { height: 6px; }
.op-md-hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.op-md-pre { white-space: pre-wrap; font-size: 12px; background: var(--surface-2, var(--bg)); padding: 6px 8px; border-radius: 6px; margin: 4px 0; }
.op-md-tabel { overflow-x: auto; margin: 4px 0; }
.op-md-tabel table { border-collapse: collapse; font-size: 12.5px; }
.op-md-tabel th, .op-md-tabel td { border: 1px solid var(--line); padding: 3px 6px; text-align: left; vertical-align: top; overflow-wrap: normal; }
.op-md code, .op-kemajuan code { font-size: 12px; padding: 0 3px; border-radius: 4px; background: var(--surface-2, var(--bg)); }
.op-w { display: block; text-align: right; color: var(--text-3, var(--text-2)); font-size: 11px; margin-top: 2px; }
.op-kemajuan .op-w, .op-aksi .op-w, .op-galat .op-w, .op-sistem .op-w { display: inline; margin-left: 4px; }
.op-kemajuan { color: var(--text-2); padding: 1px 6px; border-left: 2px solid var(--line); overflow-wrap: anywhere; }
.op-aksi { padding: 4px 8px; border-radius: 8px; background: var(--surface-2); border: 1px dashed var(--line); overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.op-galat { padding: 5px 8px; border-radius: 8px; color: var(--critical-text, #b4232a);
  background: color-mix(in srgb, var(--critical, #d63340) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--critical, #d63340) 35%, var(--line)); overflow-wrap: anywhere; }
.op-sistem { align-self: center; color: var(--text-2); text-align: center; padding: 2px 8px; overflow-wrap: anywhere; }
/* NOBAR-MVP-359 (ADR-0219): navigasi halaman oleh operator — tautan (HP / panel lain) atau catatan "sudah dibuka" */
.op-nav { align-self: flex-start; padding: 3px 8px; border-radius: 8px; border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
  background: var(--accent-soft); overflow-wrap: anywhere; max-width: 100%; }
.op-nav .op-w { display: inline; margin-left: 4px; }
.op-nav-a { color: var(--accent); font: inherit; font-weight: 600; text-decoration: none; background: none; border: 0; padding: 0; cursor: pointer;
  text-align: left; overflow-wrap: anywhere; white-space: normal; }
.op-nav-a:hover, .op-nav-a:focus-visible { text-decoration: underline; }
.op-izin { padding: 8px 10px; border-radius: 10px; background: color-mix(in srgb, var(--warning, #f0a020) 12%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--warning, #f0a020) 50%, var(--line)); display: flex; flex-direction: column; gap: 5px; overflow-wrap: anywhere; }
.op-izin-k { font-weight: 700; color: var(--warning-text, #7a4d00); }
.op-izin-rinci code { display: block; padding: 4px 6px; border-radius: 6px; background: var(--surface-2); overflow-wrap: anywhere; white-space: normal; }
.op-izin-r pre { margin: 4px 0 0; padding: 6px; border-radius: 6px; background: var(--surface-2); white-space: pre-wrap; overflow-wrap: anywhere;
  max-height: 160px; overflow-y: auto; font-size: 11px; }
.op-izin-r summary { cursor: pointer; color: var(--text-2); }
.op-izin-t { display: flex; gap: 8px; flex-wrap: wrap; }
.op-izin-t button { min-height: 36px; }
.op-kaki { border-top: 1px solid var(--line); background: var(--surface); }
/* bilah persetujuan ✅/✋ di kaki chat (di atas kotak ketik) + garis "pesan baru" (arahan Arbani 16 Okt) */
.op-bilah-izin { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px 0; max-height: 40vh; overflow-y: auto; }
.op-bilah-izin .op-izin-t { align-items: center; padding: 6px 8px; border-radius: 10px; background: color-mix(in srgb, var(--warning, #f0a020) 12%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--warning, #f0a020) 50%, var(--line)); }
.op-bilah-k { flex: 1 1 100%; min-width: 0; text-align: left; background: none; border: 0; padding: 0; font: inherit; font-weight: 700;
  color: var(--warning-text, #7a4d00); cursor: pointer; overflow-wrap: anywhere; white-space: normal; }   /* button global = nowrap → judul bablas di HP */
.op-garis-baru { display: flex; align-items: center; gap: 8px; color: var(--critical-text, #b4232a); font-weight: 600; }
.op-garis-baru::before, .op-garis-baru::after { content: ''; flex: 1; border-top: 1px solid currentColor; opacity: .4; }
.op-status { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 6px 10px 0; }
.op-henti { margin-left: auto; min-height: 30px; padding: 2px 10px; color: var(--critical-text, #b4232a);
  border-color: color-mix(in srgb, var(--critical, #d63340) 45%, var(--line)); }
.op-prod { display: flex; align-items: center; gap: 6px; padding: 4px 10px 0; }
.op-tulis { display: flex; align-items: flex-end; gap: 6px; padding: 8px 10px; }
.op-tulis textarea { flex: 1; resize: none; min-height: 40px; max-height: 140px; border-radius: 18px; padding: 9px 12px; line-height: 1.4; font: inherit; }
.op-kirim { min-width: 42px; min-height: 40px; border-radius: 50%; padding: 0; font-size: 16px; }
/* NOBAR-MVP-0500: 📎 lampiran — tombol, pratinjau sebelum kirim, gambar kecil di pesan, sorotan saat berkas diseret ke panel */
.op-lampir { min-width: 36px; min-height: 40px; border-radius: 50%; padding: 0; font-size: 17px; background: transparent; border: 0; flex: none; }
.op-lamp { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 10px 0; }
.op-lamp-chip { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 3px 6px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--surface); font-size: 12px; text-decoration: none; color: inherit; }
.op-lamp-chip img { width: 34px; height: 34px; object-fit: cover; border-radius: 4px; }
.op-lamp-chip button { min-width: 22px; min-height: 22px; padding: 0; border: 0; background: transparent; font-size: 12px; }
.op-lamp-n { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.op-lamp-pesan { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 2px; }
.op-lamp-g img { display: block; max-width: 180px; max-height: 140px; border-radius: 8px; border: 1px solid var(--line); object-fit: cover; }
.op-panel.op-seret { outline: 2px dashed var(--accent); outline-offset: -6px; }
.op-daftar { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.op-baris { display: flex; flex-direction: column; gap: 2px; width: 100%; padding: 10px 14px; border: 0; border-bottom: 1px solid var(--line);
  background: none; text-align: left; cursor: pointer; color: var(--text); font: inherit; min-height: 52px; }
.op-baris:hover { background: var(--surface-2); }
.op-baris b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.op-atur { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 10px 14px; display: flex; flex-direction: column; gap: 10px; }
.op-atur fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.op-atur label { display: flex; flex-direction: column; gap: 3px; }
.op-atur fieldset label, .op-atur > label:has(> input[type=checkbox]) { flex-direction: row; align-items: center; gap: 6px; }
.op-atur-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.op-atur-t { display: flex; gap: 8px; }
@media (max-width: 600px) {
  /* Arbani 23 Okt: di HP halaman tidak digeser ke samping & tidak di-zoom (iOS mengabaikan user-scalable=no) — clip, bukan hidden: sticky tetap jalan */
  html, body { overflow-x: clip; touch-action: pan-x pan-y; }
  .op-panel { right: 0; left: 0; bottom: 0; top: 0; width: auto; height: auto; height: 100dvh; border-radius: 0; border: 0; }
  .op-fab { right: 74px; }
  /* laporan Arbani 18 Okt (HP): panel full screen, halaman belakang dikunci supaya guliran tidak bocor (setara body.ms-terbuka) */
  body.op-terbuka { overflow: hidden; overscroll-behavior: none; }
  .op-kepala { padding-top: max(8px, env(safe-area-inset-top)); }
  .op-tulis { padding-bottom: max(8px, env(safe-area-inset-bottom)); }
}
/* NOBAR-MVP-376: diff usulan PR 🛠 Kirana di kartu izin */
.op-izin-r pre.op-diff { max-height: 320px; overflow: auto; white-space: pre; font-size: 11px; line-height: 1.35; margin: 4px 0 0; }
