/* =========================================================
   ui-tokens.css — PUSAT TAMPILAN SikBase (satu sumber untuk semua platform)

   Isi file ini hanya VARIABEL CSS (design token) + pengaturan preferensi tampilan.
   Tidak ada komponen / selector tampilan di sini, jadi aman dimuat di HP maupun desktop.

   CARA PAKAI (di CSS yang ada di file .js manapun):
       background: var(--sh-color-surface);
       color:      var(--sh-color-text);
       padding:    var(--sh-space-3) var(--sh-space-4);
       border-radius: var(--sh-radius-lg);
   Jangan menulis warna / ukuran mentah (#e5604d, 16px) di file lain — tambahkan token di sini.

   PENAMAAN:   --sh-<kelompok>-<peran>[-<varian>]
       kelompok : color | font | text | space | radius | shadow | motion | z | layout | safe
       peran    : sesuai FUNGSI (surface, text-muted, accent), bukan nama warna (bukan "teal-2").
   Tambah tema/ukuran baru → cukup tambah/ubah token di sini; semua file ikut berubah.

   PREFERENSI (dipasang sebagai atribut di <html>; disimpan & diterapkan oleh ui-prefs.js):
       data-theme="light|dark"
       data-density="comfortable|compact"      → jarak antar elemen (--sh-space-*)
       data-font-size="normal|large"           → ukuran teks (--sh-text-*)
       data-motion="normal|reduce"             → animasi (--sh-motion-*)
       data-platform="mobile|desktop"          → diisi otomatis (>= 1024px = desktop)

   BREAKPOINT (variabel CSS tidak bisa dipakai di @media, jadi angkanya dicatat di sini):
       HP / tablet  : < 1024px      Desktop : >= 1024px   (@media (min-width: 1024px))

   URUTAN MUAT: di <head> index.html, SEBELUM script yang menyuntik CSS.
   Dibungkus @layer sh-tokens: CSS lama di mobile.js / desktop.js (tanpa layer) otomatis menang,
   jadi nilai lama tetap dipakai sampai Anda menghapusnya dari sana dan beralih ke token ini.
   ========================================================= */
@layer sh-tokens {

  /* ---------- 1. DEFAULT (tema terang, kepadatan normal) ---------- */
  :is(:root, [data-sh-scope]) {
    color-scheme: light;

    /* Warna — permukaan & teks */
    --sh-color-bg: #f4f1ea;              /* latar halaman */
    --sh-color-surface: #ffffff;         /* kartu, tabel, dialog */
    --sh-color-surface-sunken: #ece8de;  /* hover baris, area cekung */
    --sh-color-text: #14262b;
    --sh-color-text-muted: #667b80;
    --sh-color-border: #dcd7ca;
    --sh-color-overlay: rgb(10 25 30 / .55);

    /* Warna — aksen & status */
    --sh-color-accent: #14808a;          /* aksen utama (tombol, bar, fokus) */
    --sh-color-accent-strong: #0e5f67;   /* aksen lebih pekat (teks/gradasi di atas tint aksen) */
    --sh-color-accent-contrast: #ffffff; /* teks di atas aksen */
    --sh-color-danger: #e5604d;          /* coral: aksi penting / hapus / badge */
    --sh-color-success: #2e9d6a;
    --sh-color-warning: #d98a1f;
    --sh-color-info: #2f6fe0;            /* biru: VC, kategori kurus, peran korpel */
    --sh-color-focus-ring: var(--sh-color-accent);

    /* Warna — sidebar / navigasi */
    --sh-color-nav-bg: #0e3b43;
    --sh-color-nav-text: #cfe3e6;
    --sh-color-nav-active-bg: rgb(255 255 255 / .12);
    --sh-color-nav-active-text: #ffffff;

    /* Tipografi — keluarga huruf */
    --sh-font-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
    --sh-font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --sh-font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

    /* Tipografi — skala ukuran (dikali preferensi data-font-size) */
    --sh-font-scale: 1;
    --sh-text-xs: calc(11.5px * var(--sh-font-scale));
    --sh-text-sm: calc(12.5px * var(--sh-font-scale));
    --sh-text-md: calc(14px * var(--sh-font-scale));   /* teks isi */
    --sh-text-lg: calc(16px * var(--sh-font-scale));
    --sh-text-xl: calc(19px * var(--sh-font-scale));
    --sh-text-2xl: calc(24px * var(--sh-font-scale));
    --sh-weight-regular: 400;
    --sh-weight-medium: 500;
    --sh-weight-semibold: 600;
    --sh-weight-bold: 700;
    --sh-leading-tight: 1.2;
    --sh-leading-normal: 1.5;

    /* Jarak — skala 4px (dikali preferensi data-density) */
    --sh-density-scale: 1;
    --sh-space-1: calc(4px * var(--sh-density-scale));
    --sh-space-2: calc(8px * var(--sh-density-scale));
    --sh-space-3: calc(12px * var(--sh-density-scale));
    --sh-space-4: calc(16px * var(--sh-density-scale));
    --sh-space-5: calc(24px * var(--sh-density-scale));
    --sh-space-6: calc(32px * var(--sh-density-scale));
    --sh-space-7: calc(48px * var(--sh-density-scale));

    /* Sudut & bayangan */
    --sh-radius-sm: 10px;   /* tombol, input, tag */
    --sh-radius-md: 12px;
    --sh-radius-lg: 16px;   /* kartu, tabel, dialog */
    --sh-radius-pill: 99px;
    --sh-shadow-sm: 0 1px 2px rgb(14 38 43 / .08);
    --sh-shadow-md: 0 6px 20px rgb(14 38 43 / .12);
    --sh-shadow-lg: 0 18px 48px rgb(14 38 43 / .22);

    /* Gerak */
    --sh-motion-fast: 120ms;
    --sh-motion-base: 200ms;
    --sh-motion-slow: 320ms;
    --sh-motion-ease: cubic-bezier(.2, .7, .2, 1);

    /* Tumpukan lapisan (z-index) */
    --sh-z-topbar: 20;
    --sh-z-nav: 30;
    --sh-z-overlay: 100;
    --sh-z-dialog: 110;
    --sh-z-toast: 200;

    /* Tata letak */
    --sh-layout-nav-width: 208px;
    --sh-layout-nav-width-collapsed: 60px;
    --sh-layout-content-max: 1720px;
    --sh-layout-tap-target: 44px;   /* tinggi minimum area sentuh (HP) */

    /* Area aman layar berponi (HP) */
    --sh-safe-top: env(safe-area-inset-top, 0px);
    --sh-safe-right: env(safe-area-inset-right, 0px);
    --sh-safe-bottom: env(safe-area-inset-bottom, 0px);
    --sh-safe-left: env(safe-area-inset-left, 0px);
  }

  /* ---------- 2. PREFERENSI: TEMA ---------- */
  :is(:root, [data-sh-scope])[data-theme="dark"] {
    color-scheme: dark;
    --sh-color-bg: #0b1a1e;
    --sh-color-surface: #12262b;
    --sh-color-surface-sunken: #1a3238;
    --sh-color-text: #e8f1f2;
    --sh-color-text-muted: #8fa8ad;
    --sh-color-border: #24424a;
    --sh-color-overlay: rgb(0 0 0 / .65);
    --sh-color-accent: #3bb4bf;
    --sh-color-accent-strong: #3bb4bf;
    --sh-color-accent-contrast: #05181c;
    --sh-color-danger: #f0735f;
    --sh-color-success: #4cc38a;
    --sh-color-warning: #eaa13d;
    --sh-color-nav-bg: #08262c;
    --sh-shadow-sm: 0 1px 2px rgb(0 0 0 / .4);
    --sh-shadow-md: 0 6px 20px rgb(0 0 0 / .45);
    --sh-shadow-lg: 0 18px 48px rgb(0 0 0 / .6);
  }

  /* ---------- 3. PREFERENSI: KEPADATAN, UKURAN TEKS, GERAK ---------- */
  :root[data-density="compact"] { --sh-density-scale: .8; --sh-layout-tap-target: 38px; }
  :root[data-font-size="large"] { --sh-font-scale: 1.15; }
  :root[data-motion="reduce"] {
    --sh-motion-fast: 0ms; --sh-motion-base: 0ms; --sh-motion-slow: 0ms;
  }
  @media (prefers-reduced-motion: reduce) {
    :root:not([data-motion="normal"]) { --sh-motion-fast: 0ms; --sh-motion-base: 0ms; --sh-motion-slow: 0ms; }
  }

  /* ---------- 4. PENYESUAIAN PER PLATFORM ---------- */
  :root[data-platform="mobile"] { --sh-layout-tap-target: 44px; }
  @media (min-width: 1024px) {
    :root { --sh-text-md: calc(14px * var(--sh-font-scale)); }   /* desktop = 14px (sama dengan body lama) */
  }

  /* ---------- 5. ALIAS NAMA LAMA → TOKEN BARU ----------
     Nama di kiri dipakai CSS lama (mobile.js / desktop.js). Setelah nilai lamanya dihapus dari
     mobile.js, alias ini membuat seluruh kode lama otomatis memakai token di atas.
     Cek dulu nilai :root di mobile.js agar warnanya sama sebelum menghapus. */
  :root {
    --bg: var(--sh-color-bg);
    --card: var(--sh-color-surface);
    --sand: var(--sh-color-surface-sunken);
    --text: var(--sh-color-text);
    --muted: var(--sh-color-text-muted);
    --line: var(--sh-color-border);
    --teal: var(--sh-color-accent);
    --coral: var(--sh-color-danger);
    --good: var(--sh-color-success);
    --warn: var(--sh-color-warning);
    --rail-active: var(--sh-color-nav-active-bg);
  }

  /* ---------- 6. PREFERENSI: WARNA TEMA (data-palette) ----------
     Bawaan = 'teal' (tanpa override). Tiap palet mengubah: latar, permukaan, aksen, border & sidebar.
     Tiap palet punya varian terang (1 atribut) dan gelap (2 atribut, lebih spesifik, jadi menang atas bagian 2).
     Tambah palet baru: salin satu blok terang + satu blok gelap, lalu daftarkan namanya di DEFS (ui-prefs.js)
     dan di PALETTE_META (ui-prefs.js) supaya muncul di pemilih tema (ui-theme-picker.js).
     Selector memakai :is(:root, [data-sh-scope]) → elemen apa pun bertanda data-sh-scope + data-palette + data-theme
     bisa menampilkan pratinjau palet asli (dipakai kartu pemilih tema), tanpa menyalin kode warna. */
  :is(:root, [data-sh-scope])[data-palette="forest"] {
    --sh-color-bg: #f0f4ee; --sh-color-surface-sunken: #e4eadf; --sh-color-border: #d3dccb;
    --sh-color-accent: #2f8f5b; --sh-color-accent-strong: #1f6b42; --sh-color-nav-bg: #12392a;
  }
  :is(:root, [data-sh-scope])[data-palette="forest"][data-theme="dark"] {
    --sh-color-bg: #0b1812; --sh-color-surface: #11241a; --sh-color-surface-sunken: #1a3326; --sh-color-border: #24473a;
    --sh-color-accent: #5bbf86; --sh-color-accent-strong: #5bbf86; --sh-color-nav-bg: #08261b;
  }
  :is(:root, [data-sh-scope])[data-palette="ocean"] {
    --sh-color-bg: #eef2fa; --sh-color-surface-sunken: #e0e7f4; --sh-color-border: #ccd6ea;
    --sh-color-accent: #2f6fe0; --sh-color-accent-strong: #1f4fb0; --sh-color-nav-bg: #11284f;
  }
  :is(:root, [data-sh-scope])[data-palette="ocean"][data-theme="dark"] {
    --sh-color-bg: #0a1220; --sh-color-surface: #101c33; --sh-color-surface-sunken: #182a4a; --sh-color-border: #243a63;
    --sh-color-accent: #6b9bf0; --sh-color-accent-strong: #6b9bf0; --sh-color-nav-bg: #0a1a36;
  }
  :is(:root, [data-sh-scope])[data-palette="violet"] {
    --sh-color-bg: #f3f1fa; --sh-color-surface-sunken: #e7e3f4; --sh-color-border: #d8d2ec;
    --sh-color-accent: #7c5cd6; --sh-color-accent-strong: #5a3fb0; --sh-color-nav-bg: #2a1f4f;
  }
  :is(:root, [data-sh-scope])[data-palette="violet"][data-theme="dark"] {
    --sh-color-bg: #120e20; --sh-color-surface: #1a1530; --sh-color-surface-sunken: #261f45; --sh-color-border: #382f63;
    --sh-color-accent: #a58cf0; --sh-color-accent-strong: #a58cf0; --sh-color-nav-bg: #1c1438;
  }
  :is(:root, [data-sh-scope])[data-palette="rose"] {
    --sh-color-bg: #faf1f4; --sh-color-surface-sunken: #f2e2e8; --sh-color-border: #e8cfd8;
    --sh-color-accent: #d6457a; --sh-color-accent-strong: #a82d5c; --sh-color-nav-bg: #4a1a2e;
  }
  :is(:root, [data-sh-scope])[data-palette="rose"][data-theme="dark"] {
    --sh-color-bg: #1b0e14; --sh-color-surface: #29151e; --sh-color-surface-sunken: #3a1f2b; --sh-color-border: #54303f;
    --sh-color-accent: #f07aa4; --sh-color-accent-strong: #f07aa4; --sh-color-nav-bg: #2e1220;
  }
  :is(:root, [data-sh-scope])[data-palette="amber"] {
    --sh-color-bg: #f8f3ea; --sh-color-surface-sunken: #efe6d4; --sh-color-border: #e2d6bd;
    --sh-color-accent: #c77a14; --sh-color-accent-strong: #96570a; --sh-color-nav-bg: #3d2a10;
  }
  :is(:root, [data-sh-scope])[data-palette="amber"][data-theme="dark"] {
    --sh-color-bg: #19130a; --sh-color-surface: #261d0f; --sh-color-surface-sunken: #352919; --sh-color-border: #4d3b22;
    --sh-color-accent: #eaa13d; --sh-color-accent-strong: #eaa13d; --sh-color-nav-bg: #2a1c08;
  }

  /* Sepia: kertas krem hangat + cokelat tua. Selain latar & aksen, permukaan dan teks ikut dihangatkan
     (palet lain membiarkannya) supaya tampilan benar-benar bernuansa sepia, bukan sekadar aksen cokelat. */
  :is(:root, [data-sh-scope])[data-palette="sepia"] {
    --sh-color-bg: #f4ecd8; --sh-color-surface: #fbf5e6; --sh-color-surface-sunken: #eadfc4; --sh-color-border: #dccfb0;
    --sh-color-text: #3d3226; --sh-color-text-muted: #6f5f4a;
    --sh-color-accent: #8b5e34; --sh-color-accent-strong: #6a4423; --sh-color-nav-bg: #3b2a1a;
    --sh-shadow-sm: 0 1px 2px rgb(61 44 24 / .10);
    --sh-shadow-md: 0 6px 20px rgb(61 44 24 / .14);
    --sh-shadow-lg: 0 18px 48px rgb(61 44 24 / .24);
  }
  :is(:root, [data-sh-scope])[data-palette="sepia"][data-theme="dark"] {
    --sh-color-bg: #1a140d; --sh-color-surface: #261e14; --sh-color-surface-sunken: #342a1c; --sh-color-border: #4d3f2b;
    --sh-color-text: #efe4d0; --sh-color-text-muted: #b3a28a;
    --sh-color-accent: #d4a373; --sh-color-accent-strong: #d4a373; --sh-color-nav-bg: #2a1d0e;
    --sh-shadow-sm: 0 1px 2px rgb(0 0 0 / .4);
    --sh-shadow-md: 0 6px 20px rgb(0 0 0 / .45);
    --sh-shadow-lg: 0 18px 48px rgb(0 0 0 / .6);
  }

  /* ===== Palet tambahan (v2) ===== */
  /* Merah delima */
  :is(:root, [data-sh-scope])[data-palette="crimson"] {
    --sh-color-bg: #faf0f0; --sh-color-surface-sunken: #f3e1e1; --sh-color-border: #e8cccc;
    --sh-color-accent: #c62f3d; --sh-color-accent-strong: #9a1f2b; --sh-color-nav-bg: #4a1218;
  }
  :is(:root, [data-sh-scope])[data-palette="crimson"][data-theme="dark"] {
    --sh-color-bg: #1a0d0f; --sh-color-surface: #281417; --sh-color-surface-sunken: #381e22; --sh-color-border: #532f34;
    --sh-color-accent: #ef6b78; --sh-color-accent-strong: #ef6b78; --sh-color-nav-bg: #2b1013;
  }
  /* Jeruk */
  :is(:root, [data-sh-scope])[data-palette="tangerine"] {
    --sh-color-bg: #fbf2ea; --sh-color-surface-sunken: #f4e3d3; --sh-color-border: #e9d3bd;
    --sh-color-accent: #e0661a; --sh-color-accent-strong: #a84a0e; --sh-color-nav-bg: #432010;
  }
  :is(:root, [data-sh-scope])[data-palette="tangerine"][data-theme="dark"] {
    --sh-color-bg: #1a110a; --sh-color-surface: #271a0f; --sh-color-surface-sunken: #372516; --sh-color-border: #523823;
    --sh-color-accent: #f58a4b; --sh-color-accent-strong: #f58a4b; --sh-color-nav-bg: #2c1507;
  }
  /* Persik */
  :is(:root, [data-sh-scope])[data-palette="peach"] {
    --sh-color-bg: #fdf3ee; --sh-color-surface-sunken: #f8e4da; --sh-color-border: #efd3c6;
    --sh-color-accent: #e8795a; --sh-color-accent-strong: #b9553a; --sh-color-nav-bg: #4a2418;
  }
  :is(:root, [data-sh-scope])[data-palette="peach"][data-theme="dark"] {
    --sh-color-bg: #1c110d; --sh-color-surface: #2a1913; --sh-color-surface-sunken: #3b2419; --sh-color-border: #55372b;
    --sh-color-accent: #f5a088; --sh-color-accent-strong: #f5a088; --sh-color-nav-bg: #301810;
  }
  /* Limau */
  :is(:root, [data-sh-scope])[data-palette="lime"] {
    --sh-color-bg: #f3f6e8; --sh-color-surface-sunken: #e7edd3; --sh-color-border: #d6dfbb;
    --sh-color-accent: #5f9410; --sh-color-accent-strong: #44700a; --sh-color-nav-bg: #25380d;
  }
  :is(:root, [data-sh-scope])[data-palette="lime"][data-theme="dark"] {
    --sh-color-bg: #11160a; --sh-color-surface: #1a2210; --sh-color-surface-sunken: #26311a; --sh-color-border: #3a4a26;
    --sh-color-accent: #a3d24a; --sh-color-accent-strong: #a3d24a; --sh-color-nav-bg: #172108;
  }
  /* Mint */
  :is(:root, [data-sh-scope])[data-palette="mint"] {
    --sh-color-bg: #edf7f3; --sh-color-surface-sunken: #dcefe8; --sh-color-border: #c5e2d7;
    --sh-color-accent: #1fa384; --sh-color-accent-strong: #167a63; --sh-color-nav-bg: #0f3a31;
  }
  :is(:root, [data-sh-scope])[data-palette="mint"][data-theme="dark"] {
    --sh-color-bg: #0a1815; --sh-color-surface: #10261f; --sh-color-surface-sunken: #17332b; --sh-color-border: #234a3e;
    --sh-color-accent: #55d4b3; --sh-color-accent-strong: #55d4b3; --sh-color-nav-bg: #08291f;
  }
  /* Zaitun */
  :is(:root, [data-sh-scope])[data-palette="olive"] {
    --sh-color-bg: #f4f4e9; --sh-color-surface-sunken: #e8e8d4; --sh-color-border: #d8d8bb;
    --sh-color-accent: #7d8138; --sh-color-accent-strong: #5a5d22; --sh-color-nav-bg: #2f3010;
  }
  :is(:root, [data-sh-scope])[data-palette="olive"][data-theme="dark"] {
    --sh-color-bg: #14150b; --sh-color-surface: #1e2013; --sh-color-surface-sunken: #2b2d1b; --sh-color-border: #404329;
    --sh-color-accent: #bfc46a; --sh-color-accent-strong: #bfc46a; --sh-color-nav-bg: #1e200c;
  }
  /* Langit */
  :is(:root, [data-sh-scope])[data-palette="sky"] {
    --sh-color-bg: #eef6fb; --sh-color-surface-sunken: #dfecf6; --sh-color-border: #c9deee;
    --sh-color-accent: #1d9bd6; --sh-color-accent-strong: #146f9e; --sh-color-nav-bg: #0f3550;
  }
  :is(:root, [data-sh-scope])[data-palette="sky"][data-theme="dark"] {
    --sh-color-bg: #09151d; --sh-color-surface: #0f2230; --sh-color-surface-sunken: #173247; --sh-color-border: #234861;
    --sh-color-accent: #5cc3f2; --sh-color-accent-strong: #5cc3f2; --sh-color-nav-bg: #0a2638;
  }
  /* Nila */
  :is(:root, [data-sh-scope])[data-palette="indigo"] {
    --sh-color-bg: #f0f1fb; --sh-color-surface-sunken: #e2e4f6; --sh-color-border: #cdd1ec;
    --sh-color-accent: #4b53d6; --sh-color-accent-strong: #353cab; --sh-color-nav-bg: #1c1f55;
  }
  :is(:root, [data-sh-scope])[data-palette="indigo"][data-theme="dark"] {
    --sh-color-bg: #0d0f20; --sh-color-surface: #151833; --sh-color-surface-sunken: #20244a; --sh-color-border: #323869;
    --sh-color-accent: #8e95f5; --sh-color-accent-strong: #8e95f5; --sh-color-nav-bg: #14173d;
  }
  /* Fuchsia */
  :is(:root, [data-sh-scope])[data-palette="fuchsia"] {
    --sh-color-bg: #fbf0fa; --sh-color-surface-sunken: #f4e0f2; --sh-color-border: #e8cbe5;
    --sh-color-accent: #c026b3; --sh-color-accent-strong: #8f1a85; --sh-color-nav-bg: #4a1445;
  }
  :is(:root, [data-sh-scope])[data-palette="fuchsia"][data-theme="dark"] {
    --sh-color-bg: #1a0c19; --sh-color-surface: #281427; --sh-color-surface-sunken: #381d37; --sh-color-border: #542f52;
    --sh-color-accent: #ea6fde; --sh-color-accent-strong: #ea6fde; --sh-color-nav-bg: #2e102c;
  }
  /* Lavender */
  :is(:root, [data-sh-scope])[data-palette="lavender"] {
    --sh-color-bg: #f6f3fc; --sh-color-surface-sunken: #ebe5f7; --sh-color-border: #ddd3f0;
    --sh-color-accent: #8b6bd6; --sh-color-accent-strong: #6a4bb8; --sh-color-nav-bg: #3a2e63;
  }
  :is(:root, [data-sh-scope])[data-palette="lavender"][data-theme="dark"] {
    --sh-color-bg: #15111f; --sh-color-surface: #1e1930; --sh-color-surface-sunken: #2a2342; --sh-color-border: #3d3460;
    --sh-color-accent: #bda8f5; --sh-color-accent-strong: #bda8f5; --sh-color-nav-bg: #231c3d;
  }
  /* Slate */
  :is(:root, [data-sh-scope])[data-palette="slate"] {
    --sh-color-bg: #f0f3f6; --sh-color-surface-sunken: #e2e7ec; --sh-color-border: #cfd6de;
    --sh-color-accent: #4f6b8a; --sh-color-accent-strong: #384f69; --sh-color-nav-bg: #1f2d3d;
  }
  :is(:root, [data-sh-scope])[data-palette="slate"][data-theme="dark"] {
    --sh-color-bg: #0e1319; --sh-color-surface: #151c25; --sh-color-surface-sunken: #1e2833; --sh-color-border: #2f3d4d;
    --sh-color-accent: #8fb0d4; --sh-color-accent-strong: #8fb0d4; --sh-color-nav-bg: #131b25;
  }
  /* Grafit: monokrom netral (tanpa rona). Teks & permukaan ikut dinetralkan seperti sepia. */
  :is(:root, [data-sh-scope])[data-palette="graphite"] {
    --sh-color-bg: #f3f3f3; --sh-color-surface: #ffffff; --sh-color-surface-sunken: #e8e8e8; --sh-color-border: #d6d6d6;
    --sh-color-text: #1b1b1b; --sh-color-text-muted: #6b6b6b;
    --sh-color-accent: #3d3d3d; --sh-color-accent-strong: #1f1f1f; --sh-color-nav-bg: #1a1a1a;
    --sh-shadow-sm: 0 1px 2px rgb(0 0 0 / .08);
    --sh-shadow-md: 0 6px 20px rgb(0 0 0 / .12);
    --sh-shadow-lg: 0 18px 48px rgb(0 0 0 / .22);
  }
  :is(:root, [data-sh-scope])[data-palette="graphite"][data-theme="dark"] {
    --sh-color-bg: #101010; --sh-color-surface: #1a1a1a; --sh-color-surface-sunken: #262626; --sh-color-border: #383838;
    --sh-color-text: #ececec; --sh-color-text-muted: #a0a0a0;
    --sh-color-accent: #d4d4d4; --sh-color-accent-strong: #d4d4d4; --sh-color-nav-bg: #0b0b0b;
    --sh-shadow-sm: 0 1px 2px rgb(0 0 0 / .4);
    --sh-shadow-md: 0 6px 20px rgb(0 0 0 / .45);
    --sh-shadow-lg: 0 18px 48px rgb(0 0 0 / .6);
  }

  /* ---------- 7. POPOVER / TOOLTIP (popup hover, dialog kecil, menu dropdown) ----------
     Diturunkan dari token permukaan, jadi otomatis ikut SEMUA tema (terang/gelap) dan SEMUA palet
     (semua palet) tanpa perlu blok per palet. Ubah di sini untuk mengatur
     tampilan semua popup sekaligus. */
  :root {
    --sh-color-popover-bg: var(--sh-color-surface);
    --sh-color-popover-text: var(--sh-color-text);
    --sh-color-popover-border: color-mix(in srgb, var(--sh-color-text) 14%, var(--sh-color-border));
    --sh-color-popover-divider: var(--sh-color-border);
  }
  /* Gelap: popup sedikit lebih terang dari kartu supaya terangkat dari latar */
  :root[data-theme="dark"] {
    --sh-color-popover-bg: color-mix(in srgb, var(--sh-color-text) 8%, var(--sh-color-surface));
    --sh-color-popover-border: color-mix(in srgb, var(--sh-color-text) 20%, var(--sh-color-border));
  }

}