/* ============================================================
   1. TOKEN: nilai yang dipakai berulang, dikumpulkan di satu tempat.
   Mau ganti warna? Cukup ubah di sini, semuanya ikut berubah.
   ============================================================ */
:root {
  --night: #0e1226;
  --dusk: #3a3f8f;
  --ember: #ff9f5a;

  --glass: rgba(18, 22, 48, 0.42);
  --glass-edge: rgba(255, 255, 255, 0.14);
  --text-on-glass: rgba(255, 255, 255, 0.92);

  --dock-size: 52px;           /* ukuran ikon saat diam. JavaScript membaca nilai ini juga */
  --dock-bg: rgba(255, 255, 255, 0.16);
  --dock-edge: rgba(255, 255, 255, 0.28);

  /* Jendela */
  --paper: #f6f6f8;
  --ink: #1d1d22;
  --ink-soft: #7a7a86;
  --line: rgba(20, 20, 40, 0.14);
  --tl-close: #ff5f57;
  --tl-min: #febc2e;
  --tl-zoom: #28c840;
  --tl-off: #cfcfd5;           /* warna tombol saat jendela tidak aktif */

  --menubar-h: 28px;

  --font-ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", sans-serif;
}

/* ============================================================
   2. RESET KECIL: hilangkan margin bawaan browser
   ============================================================ */
* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;            /* desktop tidak boleh bisa di-scroll */
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   3. DESKTOP + WALLPAPER
   Wallpaper dibuat murni dari CSS (tanpa file gambar) dengan menumpuk
   beberapa gradient. Yang paling atas di daftar = lapisan paling depan.
   ============================================================ */
#desktop {
  position: relative;          /* jadi "patokan" untuk anak-anaknya */
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 85% 108%, rgba(255, 159, 90, 0.55) 0%, rgba(255, 159, 90, 0) 55%),
    radial-gradient(90% 70% at 12% 0%, var(--dusk) 0%, transparent 60%),
    linear-gradient(180deg, #151a3d 0%, var(--night) 100%);
}

/* Cincin sinyal: lapisan hiasan di atas wallpaper.
   ::before = elemen "bayangan" yang dibuat CSS, tidak perlu ditulis di HTML. */
#desktop::before {
  content: "";
  position: absolute;
  inset: 0;                    /* sama dengan top/right/bottom/left: 0 */
  background: repeating-radial-gradient(
    circle at 85% 108%,
    transparent 0 54px,
    rgba(255, 255, 255, 0.07) 54px 55px
  );
  /* mask membuat cincin memudar semakin jauh dari pusat */
  -webkit-mask-image: radial-gradient(circle at 85% 108%, #000 0, transparent 78%);
          mask-image: radial-gradient(circle at 85% 108%, #000 0, transparent 78%);
  pointer-events: none;        /* klik menembus lapisan ini */
}

/* ============================================================
   4. MENU BAR
   ============================================================ */
#menubar {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: var(--menubar-h);
  z-index: 1000;               /* selalu di atas jendela nanti */
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 12px;
  font-size: 13px;
  color: var(--text-on-glass);
  /* Menu bar macOS modern itu transparan: tidak ada latar, hanya teks di atas wallpaper.
     text-shadow tipis menjaga teks tetap terbaca di bagian wallpaper yang terang. */
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  user-select: none;
}

.mb-left, .mb-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.mb-right { gap: 14px; font-variant-numeric: tabular-nums; }

.mb-logo {
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: default;
}

.mb-app { font-weight: 600; }  /* nama aplikasi aktif dicetak tebal */

.mb-item { opacity: 0.88; }

/* Di layar sempit, menu teks disembunyikan supaya tidak sesak */
@media (max-width: 640px) {
  .mb-item { display: none; }
}

/* ============================================================
   5. DOCK
   #dock hanya "rel" tak terlihat selebar layar yang memusatkan isinya.
   Yang kelihatan adalah .dock-bar di dalamnya.
   ============================================================ */
#dock {
  position: absolute;
  left: 0; right: 0;
  bottom: 10px;
  z-index: 900;
  display: flex;
  justify-content: center;
  pointer-events: none;        /* area kosong di kiri-kanan dock tidak menghalangi klik */
}

.dock-bar {
  position: relative;
  isolation: isolate;          /* lapisan kaca (::before) aman diletakkan di belakang ikon */
  display: flex;
  align-items: flex-end;       /* ikon tumbuh ke atas, dasar tetap di bawah */
  gap: 6px;
  padding: 8px 28px;          /* sisi kiri-kanan lebih lega: ruang cadangan agar ikon tetap di dalam kaca saat deretan melebar */
  pointer-events: auto;        /* tapi dock itu sendiri tetap bisa diklik */

  /* Keadaan awal: tersembunyi di bawah layar */
  transform: translateY(calc(100% + 28px));
  transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Lapisan kaca dipisah dari .dock-bar supaya tepi kirinya bisa maju sendiri tanpa
   memotong atau menggeser ikon. Dua variabel diisi JavaScript mengikuti kursor:
     --glass-l = seberapa jauh tepi kiri kaca maju ke kanan
     --glass-r = seberapa jauh tepi kanan kaca maju ke kiri
   Kalau kosong, kaca penuh selebar dock. */
.dock-bar::before {
  content: "";
  position: absolute;
  z-index: -1;                 /* di belakang ikon */
  top: 0;
  bottom: 0;
  left: var(--glass-l, 0px);
  right: var(--glass-r, 0px);
  border-radius: 22px;
  background: var(--dock-bg);
  border: 1px solid var(--dock-edge);
  -webkit-backdrop-filter: blur(24px) saturate(170%);
          backdrop-filter: blur(24px) saturate(170%);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.dock-bar.is-visible { transform: translateY(0); }

/* Saat kursor sedang menggerakkan efek gelombang, TIDAK ada transisi (biar langsung
   mengikuti kursor). Transisi halus hanya dipakai saat dock kembali ke ukuran diam. */
.dock-bar.is-resting .dock-item {
  transition: transform 0.22s ease-out;
}
.dock-bar.is-resting::before {
  transition: left 0.22s ease-out, right 0.22s ease-out;
}
.dock-bar.is-resting .dock-sep {
  transition: transform 0.22s ease-out;
}

/* Slot: kotak berukuran TETAP untuk tiap ikon. Inilah yang menentukan ukuran kaca dock,
   jadi kacanya tidak ikut membesar saat ikon dibesarkan. */
.dock-slot {
  position: relative;
  flex: none;
  width: var(--dock-size);
  height: var(--dock-size);
}

/* Ikon di dalam slot. Yang berubah hanya transform-nya (tidak memengaruhi tata letak):
     --s  = berapa kali lipat membesar     (diisi JavaScript)
     --tx = geser ke kiri/kanan (px)       (diisi JavaScript, supaya tetangganya tidak tertimpa)
   transform-origin di tengah-bawah: ikon tumbuh ke atas, dasarnya tetap menempel. */
.dock-item {
  position: absolute;
  inset: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: default;
  transform-origin: 50% 100%;
  transform: translateX(var(--tx, 0px)) scale(var(--s, 1));
}

.dock-item svg {
  display: block;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
}

.dock-sep {
  align-self: center;
  width: 1px;
  height: 42px;
  margin: 0 4px;
  background: rgba(255, 255, 255, 0.3);
  transform: translateX(var(--tx, 0px));   /* diisi JavaScript, sama seperti ikon */
}

/* Latar terang di belakang dock: garis pemisah jadi gelap (diatur oleh dock.js) */
.dock-bar.sep-dark .dock-sep { background: rgba(0, 0, 0, 0.32); }

/* Geser ikon: ikon yang dipegang di atas tetangganya, tetangga bergeser mulus, label disembunyikan */
.dock-bar.is-dragging .dock-slot { transition: transform 0.16s ease-out; }
.dock-bar.is-dragging .dock-slot::after { opacity: 0; }
.dock-bar.is-dragging .dock-slot.is-dragged { z-index: 3; transition: none; }
.dock-bar.is-dragging .dock-slot.is-dragged .dock-item { transition: none; cursor: grabbing; }

/* Label nama aplikasi: muncul di atas ikon yang sedang disorot */
.dock-slot::after {
  content: attr(data-label);   /* isi teks diambil dari atribut data-label di HTML */
  position: absolute;
  /* --lift = tinggi tambahan ikon yang sedang membesar, supaya label ikut naik di atasnya */
  bottom: calc(100% + var(--lift, 0px) + 12px);
  left: 50%;
  /* --lx = seberapa jauh ikon bergeser ke samping, supaya label ikut bergeser bersamanya */
  transform: translateX(calc(-50% + var(--lx, 0px)));
  padding: 4px 10px;
  border-radius: 8px;
  font: 500 13px var(--font-ui);
  white-space: nowrap;
  color: var(--text-on-glass);
  background: rgba(30, 34, 64, 0.78);
  -webkit-backdrop-filter: blur(12px);
          backdrop-filter: blur(12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s;
}
.dock-slot.is-hover::after { opacity: 1; }

/* Keyboard: ikon yang sedang fokus diberi cincin supaya jelas */
.dock-item:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 3px;
  border-radius: 14px;
}

/* Lencana angka merah (jumlah belum dibaca), di pojok kanan atas ikon; ikut membesar bersama ikon */
.dock-badge {
  position: absolute;
  top: -3px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  box-sizing: border-box;
  border-radius: 10px;
  background: #ff3b30;
  color: #fff;
  font: 600 12px/20px -apple-system, "SF Pro Text", system-ui, sans-serif;
  text-align: center;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18), 0 2px 4px rgba(0, 0, 0, 0.3);
  pointer-events: none;
}
.dock-badge[hidden] { display: none; }

/* Titik penanda: aplikasi ini sedang terbuka */
.dock-slot.is-running::before {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 50%;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  transform: translateX(var(--lx, 0px));   /* titik ikut bergeser bersama ikonnya */
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
}

/* Layar sentuh tidak punya "kursor mendekat", jadi dock ditampilkan terus */
@media (hover: none) {
  .dock-bar { transform: none; }
}

/* ============================================================
   6. JENDELA
   #workspace menutupi layar di bawah menu bar. Dia sendiri tidak menangkap klik
   (pointer-events: none), hanya jendela di dalamnya yang menangkap.
   ============================================================ */
#workspace {
  position: absolute;
  top: var(--menubar-h);
  left: 0; right: 0;
  bottom: var(--dock-reserve, 0px);   /* diisi desktop.js saat "Dock selalu tampil" aktif */
  z-index: 10;                 /* di bawah dock (900) dan menu bar (1000) */
  pointer-events: none;
}

.window {
  position: absolute;
  display: flex;
  flex-direction: column;
  max-width: 100%;
  max-height: 100%;
  pointer-events: auto;        /* overflow TIDAK disembunyikan: titik tarik ubah ukuran sedikit keluar dari tepi */
  color: var(--ink);
  background: var(--paper);
  border-radius: 12px;
  box-shadow:
    0 0 0 0.5px rgba(0, 0, 0, 0.3),
    0 10px 28px -8px rgba(0, 0, 0, 0.4);
  animation: win-in 0.18s ease-out;       /* muncul saat dibuka (menjawab aksi pengguna) */
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.2s;
}

/* Jendela aktif punya bayangan lebih dalam, jadi jelas mana yang di depan */
.window.is-focused {
  box-shadow:
    0 0 0 0.5px rgba(0, 0, 0, 0.4),
    0 22px 55px -10px rgba(0, 0, 0, 0.55),
    0 8px 18px rgba(0, 0, 0, 0.22);
}

@keyframes win-in {
  from { opacity: 0; transform: scale(0.94); }
  to   { opacity: 1; transform: scale(1); }
}

.window.is-closing {
  opacity: 0;
  transform: scale(0.94);
  pointer-events: none;
  transition: opacity 0.12s, transform 0.12s;
}

/* Diminimalkan: mengecil dan terbang ke ikon di dock.
   --mx dan --my (jarak ke ikon) diisi oleh windows.js. visibility menunggu animasi selesai. */
.window.is-minimized {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(var(--mx, 0px), var(--my, 0px)) scale(0.12);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s, visibility 0s 0.3s;
}

.window.is-maximized,
.window.is-maximized .titlebar,
.window.is-maximized .win-body { border-radius: 0; }

/* Titik tarik untuk mengubah ukuran: kotak transparan di tepi dan sudut jendela.
   Setengahnya (4px) di luar jendela, jadi tidak perlu tepat di garis tepi.
   Sudut (16px) lebih besar dari tepi (8px) dan berada di atasnya. */
.rs {
  position: absolute;
  z-index: 5;
}
.rs-n  { top: -4px;    left: 12px;  right: 12px;  height: 8px; cursor: ns-resize; }
.rs-s  { bottom: -4px; left: 12px;  right: 12px;  height: 8px; cursor: ns-resize; }
.rs-e  { right: -4px;  top: 12px;   bottom: 12px; width: 8px;  cursor: ew-resize; }
.rs-w  { left: -4px;   top: 12px;   bottom: 12px; width: 8px;  cursor: ew-resize; }
.rs-nw, .rs-ne, .rs-sw, .rs-se { width: 16px; height: 16px; z-index: 6; }
.rs-nw { top: -4px;    left: -4px;  cursor: nwse-resize; }
.rs-se { bottom: -4px; right: -4px; cursor: nwse-resize; }
.rs-ne { top: -4px;    right: -4px; cursor: nesw-resize; }
.rs-sw { bottom: -4px; left: -4px;  cursor: nesw-resize; }

/* Jendela maksimal tidak bisa ditarik; saat sedang ditarik, teks di dalamnya tidak boleh terseleksi */
.window.is-maximized .rs { display: none; }
.window.is-resizing { user-select: none; }

/* Animasi ukuran hanya dinyalakan sebentar saat memperbesar/mengecilkan.
   Kalau selalu menyala, menggeser jendela akan terasa lambat dan "licin". */
.window.is-geometry-anim {
  transition:
    left 0.24s ease, top 0.24s ease, width 0.24s ease, height 0.24s ease,
    border-radius 0.24s ease, transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.2s;
}

/* Title bar */
.titlebar {
  position: relative;
  flex: none;
  display: flex;
  align-items: center;
  height: 38px;
  padding: 0 14px;
  border-radius: 12px 12px 0 0;   /* sudut membulat dipotong di sini, bukan di .window */
  background: linear-gradient(#ededf1, #e3e3e8);
  border-bottom: 1px solid var(--line);
  user-select: none;
  touch-action: none;          /* supaya geser dengan jari tidak malah men-scroll halaman */
}

.win-title {
  position: absolute;
  left: 0; right: 0;
  margin: 0;
  font: 600 13px/38px var(--font-ui);
  text-align: center;
  color: var(--ink-soft);
  pointer-events: none;        /* klik tembus ke title bar, jadi tetap bisa digeser */
}
.window.is-focused .win-title { color: var(--ink); }

/* Tombol merah-kuning-hijau */
.traffic {
  position: relative;          /* supaya berada di atas judul */
  z-index: 1;
  display: flex;
  gap: 8px;
}

.light {
  position: relative;
  width: 12px;
  height: 12px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--tl-off);   /* jendela tidak aktif: abu-abu */
  box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.18);
  cursor: default;
}

/* Aktif, atau saat kursor di atas kelompok tombol: berwarna */
.window.is-focused .light-close, .traffic:hover .light-close { background: var(--tl-close); }
.window.is-focused .light-min,   .traffic:hover .light-min   { background: var(--tl-min); }
.window.is-focused .light-zoom,  .traffic:hover .light-zoom  { background: var(--tl-zoom); }

/* Simbol kecil muncul saat kursor di atas kelompok tombol */
.light::after {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font: 700 9px/1 var(--font-ui);
  color: rgba(0, 0, 0, 0.55);
  opacity: 0;
}
.traffic:hover .light::after { opacity: 1; }
.light-close::after { content: "\00d7"; font-size: 11px; }
.light-min::after   { content: "\2013"; }
.light-zoom::after  { content: "+"; }

.light:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; }

/* Isi jendela */
.win-body {
  flex: 1;
  border-radius: 0 0 12px 12px;
  min-height: 0;              /* wajib agar anak flex bisa mengecil dan scroll di dalamnya */
  overflow: auto;
}

.placeholder {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  height: 100%;
  color: var(--ink-soft);
  font-size: 14px;
}
.placeholder p { margin: 0; }
.ph-icon { width: 64px; height: 64px; opacity: 0.9; }

@media (prefers-reduced-motion: reduce) {
  .window { animation: none; transition: none !important; }
}

/* ============================================================
   7. WALLPAPER PRIBADI (aktif hanya kalau assets/wallpaper.jpg ada)
   Kelas .has-wallpaper dipasang oleh js/wallpaper.js.
   ============================================================ */
#desktop.has-wallpaper {
  /* gambarnya (background-image) dipasang oleh JavaScript, menggantikan gradient bawaan */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Cincin sinyal hanya hiasan untuk wallpaper bawaan */
#desktop.has-wallpaper::before { display: none; }

/* Wallpaper foto biasanya terang di bagian atas, jadi teks menu bar dibuat gelap
   (macOS asli juga menyesuaikan warna teks dengan wallpaper) */
#desktop.has-wallpaper #menubar {
  color: rgba(0, 0, 0, 0.86);
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.25);
}

/* ============================================================
   8. TERMINAL
   Kelas .app-terminal dipasang otomatis oleh windows.js pada jendela Terminal,
   jadi aturan di bawah hanya berlaku untuknya.
   ============================================================ */
.app-terminal { background: #fff; }

/* Title bar Terminal: lebih tipis, putih polos, judul rata kiri setelah tombol (bukan di tengah) */
.app-terminal .titlebar {
  height: 28px;
  background: #fff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.09);
}
.app-terminal .win-title {
  position: static;
  flex: 1;
  min-width: 0;
  margin-left: 16px;
  font: 500 13px/28px var(--font-ui);
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Ikon folder kecil di depan judul (gambar SVG bawaan CSS, buatan sendiri) */
.app-terminal .win-title::before {
  content: "";
  display: inline-block;
  width: 15px;
  height: 12px;
  margin-right: 6px;
  vertical-align: -1px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 13'%3E%3Cpath d='M1 2.5A1.5 1.5 0 0 1 2.5 1h3.2l1.6 1.8h6.2A1.5 1.5 0 0 1 15 4.3v6.2a1.5 1.5 0 0 1-1.5 1.5h-11A1.5 1.5 0 0 1 1 10.5z' fill='%235bb0f2'/%3E%3C/svg%3E") no-repeat center / contain;
}

.app-terminal .win-body {
  overflow: hidden;            /* yang bisa di-scroll adalah .term di dalamnya */
  background: #fff;
}

.term {
  position: relative;          /* patokan untuk .term-measure */
  height: 100%;
  padding: 4px 6px;
  overflow-x: hidden;
  overflow-y: auto;
  outline: none;               /* fokus ditandai oleh kursor, bukan garis tepi */
  color: #000;
  background: #fff;
  font: 12px/15px Menlo, "SF Mono", ui-monospace, "DejaVu Sans Mono", Consolas, monospace;
  cursor: text;
}

/* pre-wrap: spasi dipertahankan, baris panjang membungkus seperti di terminal sungguhan */
.term-row,
.term-line {
  min-height: 15px;
  white-space: pre-wrap;
  word-break: break-all;
}

/* Kursor blok: terisi saat jendela aktif, hanya garis tepi saat jendela tidak aktif
   (sama seperti Terminal macOS) */
.term-cursor {
  color: #fff;
  background: #8e8e93;
}
.window:not(.is-focused) .term-cursor {
  color: inherit;
  background: transparent;
  box-shadow: inset 0 0 0 1px #8e8e93;
}

/* 10 huruf "M" tersembunyi, hanya untuk mengukur lebar satu huruf */
.term-measure {
  position: absolute;
  visibility: hidden;
  white-space: pre;
}

/* ============================================================
   9. BERKAS (Finder)
   Gaya macOS Tahoe: sidebar melayang berujung bulat, toolbar berbentuk pil,
   sudut jendela lebih besar. Toolbar hidup di dalam title bar (dibuat berkas.js).
   ============================================================ */
.app-berkas {
  --fb-accent: #2a6df0;
  --fb-gray: #8c8c92;
  --fb-side-w: 196px;
  background: #fff;
  border-radius: 26px;
}

/* Title bar melayang di atas isi; bagian kirinya menutupi sidebar jadi lampu lalu lintas
   terlihat di atas panel sidebar. */
.app-berkas .titlebar {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 3;
  height: 52px;
  padding-left: 20px;
  background: none;
  border: 0;
  border-radius: 26px 26px 0 0;
}
.app-berkas .win-title { display: none; }     /* judulnya digambar sendiri di toolbar (.fb-name) */
.app-berkas .win-body {
  position: relative;
  overflow: hidden;
  background: #fff;
  border-radius: 26px;
}

/* ----- Toolbar ----- */
.fb-tools {
  position: absolute;
  top: 0; bottom: 0;
  left: calc(var(--fb-side-w) + 18px);
  right: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.fb-pill {
  display: flex;
  align-items: center;
  flex: none;
  height: 34px;
  padding: 0 3px;
  background: #fff;
  border-radius: 17px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.14), 0 0 0 0.5px rgba(0, 0, 0, 0.06);
}
.fb-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: none;
  color: #3b3b41;
  cursor: default;
}
.fb-btn svg { width: 16px; height: 16px; }
.fb-btn:hover:not(:disabled) { background: rgba(0, 0, 0, 0.05); }
.fb-btn:disabled { color: #b9b9bf; }
.fb-btn.is-on { background: rgba(0, 0, 0, 0.09); }
.fb-div { width: 1px; height: 16px; background: rgba(0, 0, 0, 0.12); }
.fb-btn:focus-visible { outline: 2px solid var(--fb-accent); outline-offset: -2px; }

.fb-name {
  flex: 1;
  min-width: 0;
  margin: 0 0 0 4px;
  font: 600 13px/1 var(--font-ui);
  color: #4a4a50;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.fb-search {
  flex: 0 1 190px;
  min-width: 112px;
  gap: 7px;
  padding: 0 12px;
  color: #85858b;
}
.fb-search svg { width: 15px; height: 15px; flex: none; }
.fb-search input {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: none;
  font: 13px var(--font-ui);
  color: var(--ink);
}
.fb-search input::placeholder { color: #85858b; }
.fb-search input::-webkit-search-cancel-button { display: none; }
.fb-search:focus-within { box-shadow: 0 0 0 2px rgba(42, 109, 240, 0.55), 0 1px 6px rgba(0, 0, 0, 0.14); }

/* ----- Sidebar ----- */
.fb-side {
  position: absolute;
  left: 8px; top: 8px; bottom: 8px;
  width: var(--fb-side-w);
  padding: 58px 8px 12px;
  overflow-y: auto;
  border-radius: 18px;
  background: linear-gradient(180deg, #fbf2fa 0%, #f5f2f8 38%, #f2f2f6 100%);
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.1), 0 1px 8px rgba(0, 0, 0, 0.07);
}
.fb-side-head {
  padding: 12px 12px 3px;
  font: 700 11.5px/1.2 var(--font-ui);
  color: var(--fb-gray);
}
.fb-side-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  height: 30px;
  padding: 0 11px;
  border: 0;
  border-radius: 15px;
  background: none;
  font: 14px var(--font-ui);
  color: #1d1d22;
  text-align: left;
  cursor: default;
}
.fb-side-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fb-side-item:hover { background: rgba(0, 0, 0, 0.04); }
.fb-side-item.is-active { background: rgba(0, 0, 0, 0.075); color: var(--fb-accent); }
.fb-side-item:focus-visible { outline: 2px solid var(--fb-accent); outline-offset: -2px; }
.fb-sm { width: 16px; height: 16px; flex: none; }

/* ----- Area isi ----- */
.fb-main {
  display: flex;
  flex-direction: column;
  height: 100%;
  margin-left: calc(var(--fb-side-w) + 8px);
  padding-top: 52px;
  container-type: inline-size;       /* supaya kolom daftar bisa menyesuaikan lebar area ini */
}
.fb-scroll { flex: 1; min-height: 0; overflow: auto; outline: none; }

.fb-defs { position: absolute; width: 0; height: 0; }

/* Judul grup tanggal ("Hari Ini", "Kemarin", ...) */
.fb-group {
  margin: 0;
  font: 700 15px/1.2 var(--font-ui);
  color: var(--fb-gray);
}
.fb-icons .fb-group { margin: 0 14px; padding: 10px 2px 6px; border-bottom: 1px solid rgba(0, 0, 0, 0.1); }

/* Tampilan ikon */
.fb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 6px 2px;
  padding: 10px 14px 16px;
}
.fb-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 2px;
  text-align: center;
  user-select: none;
}
.fb-ico { display: grid; place-items: center; width: 66px; height: 60px; border-radius: 9px; }
.fb-ico svg { width: 100%; height: 100%; filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, 0.22)); }
.fb-label {
  max-width: 100%;
  margin-top: 4px;
  padding: 1px 6px;
  border-radius: 5px;
  font: 13px/1.25 var(--font-ui);
  color: #1d1d22;
  overflow-wrap: anywhere;
}
.fb-cell.is-sel .fb-ico { background: rgba(0, 0, 0, 0.08); }
.fb-cell.is-sel .fb-label { background: var(--fb-accent); color: #fff; }
.window:not(.is-focused) .fb-cell.is-sel .fb-label { background: #c9c9d0; color: #1d1d22; }

/* Tampilan daftar */
.fb-list { padding: 0 8px 12px; }
.fb-head,
.fb-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 170px 100px 140px;
  align-items: center;
  column-gap: 10px;
  padding: 0 10px;
}
.fb-head {
  position: sticky;
  top: 0;
  z-index: 2;
  height: 26px;
  margin: 0 -8px;
  padding: 0 18px;
  background: #fff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  font: 600 11px var(--font-ui);
  color: var(--fb-gray);
}
.fb-head span:first-child { font-size: 12px; font-weight: 700; }
.fb-group-list { padding: 14px 10px 4px; font-size: 12px; }
.fb-row {
  height: 24px;
  margin-top: 0;
  border-radius: 7px;
  font: 13px var(--font-ui);
  color: #6b6b72;
  user-select: none;
  white-space: nowrap;
}
.fb-row > span { overflow: hidden; text-overflow: ellipsis; }
.fb-row.is-alt { background: #f4f4f6; }
.fb-cellname { display: flex; align-items: center; gap: 7px; min-width: 0; color: #1d1d22; }
.fb-cellname span { overflow: hidden; text-overflow: ellipsis; }
.fb-row.is-sel { background: var(--fb-accent); color: rgba(255, 255, 255, 0.85); }
.fb-row.is-sel .fb-cellname { color: #fff; }
.window:not(.is-focused) .fb-row.is-sel { background: #d4d4da; color: #55555b; }
.window:not(.is-focused) .fb-row.is-sel .fb-cellname { color: #1d1d22; }

@container (max-width: 560px) {
  .fb-head, .fb-row { grid-template-columns: minmax(0, 1fr) 150px 80px; }
  .fb-head span:nth-child(4), .fb-row > span:nth-child(4) { display: none; }
}

/* ----- Path bar dan status ----- */
.fb-pathbar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 2px;
  height: 26px;
  padding: 0 10px;
  border-top: 1px solid rgba(0, 0, 0, 0.09);
  font: 12px var(--font-ui);
  color: #6b6b72;
  white-space: nowrap;
  overflow: hidden;
}
.fb-crumb {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 4px;
  border: 0;
  border-radius: 5px;
  background: none;
  font: inherit;
  color: inherit;
  cursor: default;
}
.fb-crumb:hover:not(:disabled) { background: rgba(0, 0, 0, 0.06); }
.fb-crumb .fb-sm { width: 14px; height: 14px; }
.fb-sep { color: #a2a2a8; }
.fb-status {
  flex: none;
  height: 24px;
  font: 11px/24px var(--font-ui);
  color: #7a7a80;
  text-align: center;
  border-radius: 0 0 26px 0;
}
.window.is-maximized .fb-status { border-radius: 0; }

/* Menu klik kanan ikon dock (Buka / Tutup / Hapus dari Dock) */
.dock-ctx { position: fixed; z-index: 1200; min-width: 190px; padding: 5px; border-radius: 10px; background: rgba(44,44,48,.88); -webkit-backdrop-filter: blur(30px) saturate(160%); backdrop-filter: blur(30px) saturate(160%); border: 1px solid #ffffff22; box-shadow: 0 12px 34px #0009; color: #f2f2f4; font-size: 13px; user-select: none; }
.dock-ctx-head { padding: 3px 10px 5px; font-weight: 600; color: #ffffffa8; }
.dock-ctx-row { display: block; width: 100%; height: 24px; padding: 0 10px; border: 0; border-radius: 5px; background: none; color: inherit; font: inherit; text-align: left; cursor: default; }
.dock-ctx-row:hover:not(:disabled), .dock-ctx-row:focus-visible { background: #0a84ff; color: #fff; outline: none; }
.dock-ctx-row:disabled { color: #ffffff55; }
.dock-ctx-sep { height: 1px; margin: 5px 8px; background: #ffffff26; }
