/* ==========================================================================
   SpenlaVerse — Liquid Glass Design System
   Gaya visual terinspirasi Apple "Liquid Glass" (iOS 26 / macOS Tahoe).
   Dipakai berdampingan dengan Tailwind CSS (CDN). Urutan layer disamakan
   dengan Tailwind agar utility class tetap bisa meng-override komponen.
   ========================================================================== */
@layer theme, base, components, utilities;

/* ---------- Font SF Pro (San Francisco) ---------- */
@font-face {
  font-family: "SF Pro";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: local("SF Pro Display Regular"), local("SF Pro Text Regular"), local("SF Pro Display"), local("SF Pro Text"), local(".SFNS-Regular"),
       url("../fonts/sf-pro-regular.woff") format("woff");
}
@font-face {
  font-family: "SF Pro";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: local("SF Pro Display Medium"), local("SF Pro Text Medium"), local(".SFNS-Medium"),
       url("../fonts/sf-pro-medium.woff") format("woff");
}
@font-face {
  font-family: "SF Pro";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: local("SF Pro Display Semibold"), local("SF Pro Text Semibold"), local(".SFNS-Semibold"),
       url("../fonts/sf-pro-medium.woff") format("woff");
}
@font-face {
  font-family: "SF Pro";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: local("SF Pro Display Bold"), local("SF Pro Text Bold"), local(".SFNS-Bold"),
       url("../fonts/sf-pro-bold.woff") format("woff");
}

/* ---------- Font Stack Sans Notch (Logo Branding) ---------- */
@font-face {
  font-family: "Stack Sans Notch";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/stack-sans-notch.woff2") format("woff2");
}

:root {
  --font-sans: "SF Pro", "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --font-brand: "Stack Sans Notch", var(--font-sans);
  --accent: #0a84ff;
  --accent-rgb: 10, 132, 255;
  --blur: 6px;
  color-scheme: light;
}
:root.dark { color-scheme: dark; }

@layer components {
  html {
    -webkit-tap-highlight-color: transparent;
    font-family: var(--font-sans);
  }
  body, button, input, select, textarea {
    font-family: var(--font-sans);
  }
  body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: -0.011em;
    color: #0f172a;
    background: #f2f2f7;
  }
  .dark body { color: #f8fafc; background: #000000; }
  .brand-wordmark, h1, h2, h3, h4, #pageTitle { font-family: var(--font-brand); }
  .brand-wordmark { letter-spacing: -0.02em; }
  ::selection { background: rgba(var(--accent-rgb), .25); }

  /* ---------- Wallpaper (latar minimalis iOS) ---------- */
  .wallpaper {
    position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
    background: #f2f2f7;
  }
  .dark .wallpaper {
    background: #000000;
  }
  .blob { display: none; }
  .reduce-motion .blob { animation: none; }

  /* Anak grid otomatis min-w-0 agar tabel/teks panjang di dalam kartu tidak melebarkan kolom di layar sempit */
  .grid > * { min-width: 0; }

  /* ---------- Material: card solid iOS (non-glass) ---------- */
  .glass {
    position: relative;
    background: #ffffff;
    border: 1px solid rgba(0,0,0,.04);
    border-radius: 26px;
    box-shadow: 0 1px 2px rgba(0,0,0,.03);
  }
  .glass::before { display: none; }
  .dark .glass {
    background: #1c1c1e;
    border-color: rgba(255,255,255,.045);
    box-shadow: none;
  }

  /* Liquid glass navigasi — sidebar, top bar, tab bar */
  .liquid {
    position: relative;
    background: linear-gradient(180deg, rgba(255,255,255,.78), rgba(255,255,255,.62));
    -webkit-backdrop-filter: blur(var(--blur)) saturate(190%);
    backdrop-filter: blur(var(--blur)) saturate(190%);
    border: 1px solid rgba(0,0,0,.05);
    box-shadow:
      inset 0 1px 1px rgba(255,255,255,.95),
      inset 0 -1px 1px rgba(255,255,255,.35),
      0 8px 32px -10px rgba(15,23,42,.18);
  }
  .liquid::before {
    content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
    background: linear-gradient(135deg, rgba(255,255,255,.95), rgba(255,255,255,.15) 30%, rgba(255,255,255,0) 50%, rgba(255,255,255,.2) 70%, rgba(255,255,255,.75));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
  }
  /* Mode gelap: Liquid Glass gelap khas iOS */
  .dark .liquid {
    background: linear-gradient(180deg, rgba(44,44,46,.74), rgba(28,28,30,.68));
    border-color: transparent;
    box-shadow: 0 12px 36px -8px rgba(0,0,0,.85);
  }
  .dark .liquid::before {
    background: linear-gradient(135deg, rgba(255,255,255,.14), rgba(255,255,255,.04) 30%, rgba(255,255,255,.01) 50%, rgba(255,255,255,.04) 70%, rgba(255,255,255,.08));
  }

  /* Header mengambang dengan Liquid Glass Progressive Blur:
     dari bawah ke atas semakin buram (3 tingkat blur bertingkat)
     lalu bergradasi mulus ke warna solid latar belakang (#f5f5f7 / #0a0a0f) */
  .topbar-fade { isolation: isolate; }
  .topbar-fade::before,
  .topbar-fade::after,
  .topbar-fade > .progressive-blur,
  .topbar-fade > .progressive-blur::before,
  .topbar-fade > .progressive-blur::after {
    content: "";
    position: absolute;
    inset: 0 0 -6px 0;
    z-index: -1;
    pointer-events: none;
  }
  @media (min-width: 1024px) {
    .topbar-fade::before,
    .topbar-fade::after,
    .topbar-fade > .progressive-blur {
      left: 0;
    }
  }
  /* Tingkat 1 (paling bawah → tepi atas): blur halus 3px */
  .topbar-fade::before {
    -webkit-backdrop-filter: blur(3px) saturate(135%);
    backdrop-filter: blur(3px) saturate(135%);
    -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0,0,0,.92) 38%, rgba(0,0,0,.55) 68%, rgba(0,0,0,.15) 88%, transparent 100%);
    mask-image: linear-gradient(180deg, #000 0%, rgba(0,0,0,.92) 38%, rgba(0,0,0,.55) 68%, rgba(0,0,0,.15) 88%, transparent 100%);
  }
  /* Tingkat 2: blur menengah 10px */
  .topbar-fade > .progressive-blur::before {
    inset: 0;
    -webkit-backdrop-filter: blur(10px) saturate(160%);
    backdrop-filter: blur(10px) saturate(160%);
    -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0,0,0,.9) 28%, rgba(0,0,0,.48) 56%, rgba(0,0,0,.12) 78%, transparent 92%);
    mask-image: linear-gradient(180deg, #000 0%, rgba(0,0,0,.9) 28%, rgba(0,0,0,.48) 56%, rgba(0,0,0,.12) 78%, transparent 92%);
  }
  /* Tingkat 3: blur kuat 22px */
  .topbar-fade > .progressive-blur::after {
    inset: 0;
    -webkit-backdrop-filter: blur(22px) saturate(185%);
    backdrop-filter: blur(22px) saturate(185%);
    -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0,0,0,.85) 20%, rgba(0,0,0,.4) 44%, rgba(0,0,0,.08) 65%, transparent 80%);
    mask-image: linear-gradient(180deg, #000 0%, rgba(0,0,0,.85) 20%, rgba(0,0,0,.4) 44%, rgba(0,0,0,.08) 65%, transparent 80%);
  }
  /* Lapisan paling atas di belakang konten header: ujung atas solid 100%, lalu gradasi scrim halus ke transparan */
  .topbar-fade::after {
    background: linear-gradient(180deg,
      #f2f2f7 0%,
      #f2f2f7 6%,
      rgba(242,242,247,.96) 16%,
      rgba(242,242,247,.88) 28%,
      rgba(242,242,247,.75) 40%,
      rgba(242,242,247,.58) 52%,
      rgba(242,242,247,.38) 64%,
      rgba(242,242,247,.20) 76%,
      rgba(242,242,247,.07) 88%,
      rgba(242,242,247,.015) 95%,
      rgba(242,242,247,0) 100%);
  }
  .dark .topbar-fade::after {
    background: linear-gradient(180deg,
      #000000 0%,
      #000000 6%,
      rgba(0,0,0,.96) 16%,
      rgba(0,0,0,.88) 28%,
      rgba(0,0,0,.75) 40%,
      rgba(0,0,0,.58) 52%,
      rgba(0,0,0,.38) 64%,
      rgba(0,0,0,.20) 76%,
      rgba(0,0,0,.07) 88%,
      rgba(0,0,0,.015) 95%,
      rgba(0,0,0,0) 100%);
  }

  /* Material kaca — hanya untuk elemen interaktif: modal, toast */
  .glass-strong {
    position: relative;
    background: linear-gradient(145deg, rgba(255,255,255,.78), rgba(255,255,255,.55));
    -webkit-backdrop-filter: blur(calc(var(--blur) + 16px)) saturate(200%);
    backdrop-filter: blur(calc(var(--blur) + 16px)) saturate(200%);
    box-shadow: inset 0 1px 1px rgba(255,255,255,.9), 0 30px 80px -20px rgba(15,23,42,.45);
  }
  /* Rim spekular hanya untuk glass-strong (interactive) */
  .glass-strong::before {
    content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
    background: linear-gradient(135deg, rgba(255,255,255,.95), rgba(255,255,255,.15) 30%, rgba(255,255,255,0) 50%, rgba(255,255,255,.2) 70%, rgba(255,255,255,.75));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
  }
  .dark .glass-strong {
    background: linear-gradient(145deg, rgba(44,44,46,.84), rgba(26,26,28,.78));
    box-shadow: 0 30px 80px -20px rgba(0,0,0,.85);
  }
  .dark .glass-strong::before {
    background: linear-gradient(135deg, rgba(255,255,255,.13), rgba(255,255,255,.03) 30%, rgba(255,255,255,.01) 50%, rgba(255,255,255,.03) 70%, rgba(255,255,255,.08));
  }

  /* Elemen bersarang — solid subtle iOS */
  .glass-thin {
    background: #f2f2f7;
    box-shadow: none;
    border: 1px solid rgba(0,0,0,.03);
  }
  .dark .glass-thin {
    background: #2c2c2e;
    box-shadow: none;
    border-color: rgba(255,255,255,.04);
  }
  .pressable { transition: transform .35s cubic-bezier(.34,1.56,.64,1), background-color .2s; cursor: pointer; }
  .pressable:active { transform: scale(.97); }
  a.glass-thin.pressable:hover, button.glass-thin.pressable:hover, .glass-thin.pressable:hover { background: #e5e5ea; }
  .dark .glass-thin.pressable:hover { background: #3a3a3c; }

  .text-muted { color: rgba(51, 65, 85, .78); }
  .dark .text-muted { color: rgba(226, 232, 240, .62); }
  .divider { border-color: rgba(0,0,0,.08); }
  .dark .divider { border-color: rgba(255,255,255,.08); }

  /* ---------- Tombol (gaya native iOS 26 — seragam dengan .seg) ---------- */
  .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .46rem;
    height: 2.65rem; padding: 0 1.2rem; border-radius: 9999px; font-weight: 600; font-size: .85rem;
    letter-spacing: -0.01em; white-space: nowrap; user-select: none; cursor: pointer; position: relative;
    transition: transform .28s cubic-bezier(.22,1,.36,1), background .2s ease, border-color .2s ease, box-shadow .2s ease, filter .2s ease, opacity .2s ease;
  }
  .btn:active { transform: scale(.95); }
  .btn:disabled { opacity: .45; pointer-events: none; }
  .btn-sm { height: 2.2rem; padding: 0 .95rem; font-size: .8rem; }
  .btn-icon { width: 2.65rem; height: 2.65rem; padding: 0; flex-shrink: 0; }

  @media (max-width: 639px) {
    .pen-generate-btn { width: 2.65rem; height: 2.65rem; padding: 0; flex-shrink: 0; }
  }

  /* Varian kapsul netral iOS 26 (seragam dengan .seg & .search-box) */
  .btn-glass, .icon-btn, .btn-group-glass {
    position: relative;
    color: #121214;
    background: rgba(252, 252, 254, .95);
    border: 1px solid rgba(0, 0, 0, .085);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .03);
    -webkit-backdrop-filter: blur(var(--blur)) saturate(180%);
    backdrop-filter: blur(var(--blur)) saturate(180%);
  }
  /* Di atas permukaan kartu .glass yang solid (#ffffff / #1c1c1e), matikan backdrop-filter pada kontrol kecil
     agar Chrome tidak membuat ratusan offscreen render-pass yang memicu blank space (checkerboarding) saat scroll */
  .glass :is(.btn-glass, .icon-btn, .btn-group-glass, .switch, .seg, .sem-toggle),
  .glass .search-box .glass-input,
  .glass select.glass-input.glass-select-pill {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .btn-glass:hover, .icon-btn:hover {
    background: #ffffff;
    border-color: rgba(0, 0, 0, .13);
    box-shadow: 0 2px 6px rgba(0, 0, 0, .05);
  }
  .dark .btn-glass, .dark .icon-btn, .dark .btn-group-glass {
    color: #f5f5f7;
    background: rgba(37, 37, 40, .94);
    border-color: rgba(255, 255, 255, .12);
    box-shadow: 0 2px 10px rgba(0, 0, 0, .42);
  }
  .dark .btn-glass:hover, .dark .icon-btn:hover {
    background: rgba(46, 46, 50, .96);
    border-color: rgba(255, 255, 255, .18);
    box-shadow: 0 3px 12px rgba(0, 0, 0, .48);
  }

  /* Varian "Filled" aksen iOS 26 */
  .btn-primary {
    color: #fff;
    border: 1px solid rgba(0, 0, 0, .05);
    background: var(--accent);
    box-shadow: 0 1px 4px rgba(var(--accent-rgb), .28);
  }
  .dark .btn-primary {
    border-color: rgba(255, 255, 255, .12);
    box-shadow: 0 2px 10px rgba(0, 0, 0, .42);
  }
  .btn-primary:hover { filter: brightness(1.06); }

  /* Varian "Destructive filled" */
  .btn-danger {
    color: #fff;
    border: 1px solid rgba(0, 0, 0, .05);
    background: #ff3b30;
    box-shadow: 0 1px 4px rgba(255, 59, 48, .28);
  }
  .dark .btn-danger {
    background: #ff453a;
    border-color: rgba(255, 255, 255, .12);
    box-shadow: 0 2px 10px rgba(0, 0, 0, .42);
  }
  .btn-danger:hover { filter: brightness(1.06); }

  /* Varian "Destructive" lembut */
  .btn-ghost-danger {
    color: #ff3b30;
    background: rgba(255, 59, 48, .07);
    border-color: rgba(255, 59, 48, .16);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .03);
  }
  .btn-ghost-danger:hover {
    background: rgba(255, 59, 48, .13);
    border-color: rgba(255, 59, 48, .24);
    box-shadow: 0 2px 6px rgba(0, 0, 0, .05);
  }
  .dark .btn-ghost-danger {
    color: #ff453a;
    background: rgba(255, 69, 58, .14);
    border-color: rgba(255, 69, 58, .22);
    box-shadow: 0 2px 10px rgba(0, 0, 0, .42);
  }
  .dark .btn-ghost-danger:hover {
    background: rgba(255, 69, 58, .22);
    border-color: rgba(255, 69, 58, .30);
    box-shadow: 0 3px 12px rgba(0, 0, 0, .48);
  }
  .icon-btn {
    width: 2.5rem; height: 2.5rem; border-radius: 9999px; display: inline-grid; place-items: center; flex-shrink: 0;
    cursor: pointer; transition: transform .28s cubic-bezier(.22,1,.36,1), background .2s ease, border-color .2s ease, box-shadow .2s ease;
  }
  .icon-btn:active { transform: scale(.9); }
  .icon-btn.sm { width: 2.15rem; height: 2.15rem; }

  /* Kapsul grup tombol ikon gaya native iOS 26 */
  .btn-group-glass {
    display: inline-flex; align-items: center; border-radius: 9999px;
    height: 2.65rem; padding: 4px; gap: 9px; flex-shrink: 0;
  }
  .btn-group-glass.sm {
    height: 2.15rem; padding: 3px; gap: 7px;
  }
  @media (max-width: 767px) {
    .btn-group-glass.sm.btn-group-md {
      width: 2.15rem;
      padding: 0;
      gap: 0;
      justify-content: center;
    }
  }
  .btn-group-glass > .btn,
  .btn-group-glass > .icon-btn {
    position: relative;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }
  .btn-group-glass > .btn::before,
  .btn-group-glass > .icon-btn::before {
    display: none !important;
  }
  .btn-group-glass > :is(.btn, .icon-btn) + :is(.btn, .icon-btn)::after {
    content: "";
    position: absolute;
    left: -5px;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 52%;
    border-radius: 9999px;
    background: rgba(0, 0, 0, .14);
    pointer-events: none;
    transition: opacity .2s ease;
  }
  .dark .btn-group-glass > :is(.btn, .icon-btn) + :is(.btn, .icon-btn)::after {
    background: rgba(255, 255, 255, .18);
  }
  .btn-group-glass.sm > :is(.btn, .icon-btn) + :is(.btn, .icon-btn)::after {
    left: -4px;
    height: 50%;
  }
  @media (max-width: 767px) {
    .btn-group-glass > .hidden + :is(.btn, .icon-btn)::after { display: none; }
  }
  .btn-group-glass > :is(.btn, .icon-btn):hover::after,
  .btn-group-glass > :is(.btn, .icon-btn):hover + :is(.btn, .icon-btn)::after,
  .btn-group-glass > :is(.btn, .icon-btn).active::after,
  .btn-group-glass > :is(.btn, .icon-btn).active + :is(.btn, .icon-btn)::after {
    opacity: 0;
  }
  .btn-group-glass > .btn { height: 100%; width: 2.35rem; }
  .btn-group-glass.sm > .icon-btn.sm { width: 1.95rem; height: 100%; }
  .btn-group-glass > .btn:hover,
  .btn-group-glass > .icon-btn:hover {
    background: #eaeaea !important;
  }
  .dark .btn-group-glass > .btn:hover,
  .dark .btn-group-glass > .icon-btn:hover {
    background: rgba(255,255,255,.11) !important;
  }

  /* ---------- Input, Date, Select & Textarea (proporsional di mobile & desktop) ---------- */
  .glass-input {
    display: block; width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box;
    min-height: 2.65rem; border-radius: 9999px; padding: .55rem 1rem; font-size: .85rem; line-height: 1.35; color: inherit; outline: none;
    background-color: #ffffff;
    background-image: none;
    border: 1px solid rgba(0, 0, 0, .085);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .02);
    transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
  }
  .glass-input.text-xs {
    font-size: .75rem;
    min-height: 2.25rem;
    padding: .4rem .85rem;
  }
  input[type="date"].glass-input,
  input[type="time"].glass-input {
    -webkit-appearance: none;
    appearance: none;
    height: 2.65rem;
    min-height: 2.65rem;
    padding-top: 0;
    padding-bottom: 0;
    font-size: .85rem;
    line-height: 1.25;
    text-align: left;
    display: flex;
    align-items: center;
    color: #121214;
    -webkit-text-fill-color: #121214;
    background-color: #ffffff;
  }
  .dark input[type="date"].glass-input,
  .dark input[type="time"].glass-input {
    color: #f5f5f7;
    -webkit-text-fill-color: #f5f5f7;
    background-color: #262629;
  }
  input[type="date"].glass-input::-webkit-date-and-time-value,
  input[type="time"].glass-input::-webkit-date-and-time-value {
    text-align: left;
    font-size: inherit;
    line-height: 1.25;
    margin: 0;
    padding: 0;
    color: inherit;
    -webkit-text-fill-color: currentColor;
  }
  input[type="date"].glass-input::-webkit-datetime-edit,
  input[type="time"].glass-input::-webkit-datetime-edit,
  input[type="date"].glass-input::-webkit-datetime-edit-text,
  input[type="time"].glass-input::-webkit-datetime-edit-text,
  input[type="date"].glass-input::-webkit-datetime-edit-month-field,
  input[type="date"].glass-input::-webkit-datetime-edit-day-field,
  input[type="date"].glass-input::-webkit-datetime-edit-year-field,
  input[type="time"].glass-input::-webkit-datetime-edit-hour-field,
  input[type="time"].glass-input::-webkit-datetime-edit-minute-field {
    color: inherit;
    -webkit-text-fill-color: currentColor;
    background-color: transparent;
  }
  .glass-input::placeholder { color: rgba(60, 60, 67, .45); font-size: .85rem; }
  .glass-input:focus {
    background-color: #ffffff;
    border-color: rgba(0, 0, 0, .085);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .02);
    outline: none;
  }
  .glass-input:disabled,
  .glass-input[readonly] {
    opacity: .62;
    background-color: rgba(242, 242, 247, .75);
    cursor: not-allowed;
  }
  .dark .glass-input {
    background-color: #262629;
    background-image: none;
    border-color: rgba(255, 255, 255, .10);
    box-shadow: none;
  }
  .dark .glass-input::placeholder { color: rgba(235, 235, 245, .42); }
  .dark .glass-input:focus {
    background-color: #262629;
    border-color: rgba(255, 255, 255, .10);
    box-shadow: none;
    outline: none;
  }
  .dark .glass-input:disabled,
  .dark .glass-input[readonly] {
    opacity: .56;
    background-color: rgba(44, 44, 46, .55);
  }
  select.glass-input,
  select.glass-input:focus,
  .dark select.glass-input,
  .dark select.glass-input:focus {
    appearance: none; -webkit-appearance: none;
    height: 2.65rem; min-height: 2.65rem;
    padding-top: 0; padding-bottom: 0; padding-right: 2.35rem;
    font-size: .85rem; line-height: 2.5rem;
    text-overflow: ellipsis; white-space: nowrap; overflow: hidden;
    cursor: pointer;
    background-repeat: no-repeat;
    background-position: right .9rem center;
    background-size: 15px 15px;
  }
  select.glass-input.text-xs,
  select.glass-input.text-xs:focus,
  .dark select.glass-input.text-xs,
  .dark select.glass-input.text-xs:focus {
    height: 2.25rem; min-height: 2.25rem;
    font-size: .75rem; line-height: 2.15rem;
    padding-right: 2.1rem;
  }
  select.glass-input,
  select.glass-input:focus {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236e6e73' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  }
  .dark select.glass-input,
  .dark select.glass-input:focus {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2398989d' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  }
  textarea.glass-input { resize: vertical; min-height: 5.5rem; line-height: 1.5; border-radius: 22px; padding: .72rem 1rem; font-size: .85rem; }

  /* ---------- Highlight kata tidak sesuai ketentuan pada input TP ---------- */
  .tp-editor-wrap {
    position: relative;
    width: 100%;
    border-radius: 21px;
    background-color: #ffffff;
    transition: background-color .2s;
  }
  .tp-editor-wrap:focus-within { background-color: #ffffff; }
  .dark .tp-editor-wrap { background-color: #2c2c2e; }
  .dark .tp-editor-wrap:focus-within { background-color: #323236; }

  .tp-editor-backdrop,
  textarea.glass-input.tp-editor-input {
    font-family: inherit;
    font-size: .875rem;
    font-weight: 400;
    line-height: 1.45;
    letter-spacing: normal;
    word-spacing: normal;
    padding: .58rem 4.25rem .58rem 4.15rem;
    border-radius: 21px;
    border-width: 1px;
    border-style: solid;
    box-sizing: border-box;
    white-space: pre-wrap;
    overflow-wrap: break-word;
    word-break: normal;
    tab-size: 4;
  }
  .tp-editor-backdrop {
    border-color: transparent;
  }
  .tp-editor-backdrop {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
    color: #0f172a;
    background: transparent;
  }
  .dark .tp-editor-backdrop { color: #f8fafc; }
  textarea.glass-input.tp-editor-input {
    position: relative;
    z-index: 2;
    min-height: 2.65rem;
    resize: none;
    overflow: hidden;
    color: transparent !important;
    -webkit-text-fill-color: transparent;
    caret-color: #0f172a;
    background-color: transparent !important;
    background-image: none !important;
  }
  .dark textarea.glass-input.tp-editor-input { caret-color: #ffffff; }
  textarea.glass-input.tp-editor-input:focus { background-color: transparent !important; }
  textarea.glass-input.tp-editor-input::selection {
    background: rgba(37, 99, 235, 0.25);
    color: transparent;
    -webkit-text-fill-color: transparent;
  }
  textarea.glass-input.tp-editor-input::placeholder {
    -webkit-text-fill-color: rgba(60, 60, 67, .42);
  }
  .dark textarea.glass-input.tp-editor-input::placeholder {
    -webkit-text-fill-color: rgba(235, 235, 245, .40);
  }
  .tp-editor-count {
    position: absolute;
    right: .85rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    pointer-events: none;
    font-size: 11px;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    color: rgba(60, 60, 67, .55);
  }
  .dark .tp-editor-count {
    color: rgba(235, 235, 245, .55);
  }
  .tp-editor-badge {
    position: absolute;
    left: .5rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    pointer-events: none;
  }
  .tp-hl-bad {
    color: #dc2626;
    background: none;
    background-color: transparent;
    box-shadow: none;
    padding: 0;
    margin: 0;
    text-decoration: none;
  }
  .dark .tp-hl-bad {
    color: #ff6961;
    background: none;
    background-color: transparent;
    box-shadow: none;
    padding: 0;
    margin: 0;
    text-decoration: none;
  }
  .field-label { display: block; font-size: .78rem; font-weight: 600; margin-bottom: .4rem; color: rgba(51,65,85,.85); }
  .dark .field-label { color: rgba(226,232,240,.75); }
  input[type="range"] { accent-color: var(--accent); width: 100%; }
  /* Checkbox sederhana bergaya iOS Liquid Glass */
  input[type="checkbox"]:not(.switch):not(.check-mark) {
    appearance: none; -webkit-appearance: none;
    width: 1.2rem; height: 1.2rem; border-radius: 9999px; flex-shrink: 0; cursor: pointer;
    background: rgba(255,255,255,.55);
    border: 1.25px solid rgba(15,23,42,.18);
    box-shadow: inset 0 1px 1px rgba(255,255,255,.9);
    display: inline-grid; place-items: center;
    transition: background .18s ease, border-color .18s ease, transform .2s cubic-bezier(.34,1.56,.64,1);
  }
  .dark input[type="checkbox"]:not(.switch):not(.check-mark) {
    background: rgba(255,255,255,.10);
    border-color: rgba(255,255,255,.26);
    box-shadow: none;
  }
  input[type="checkbox"]:not(.switch):not(.check-mark):checked {
    background: var(--accent);
    border-color: var(--accent);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 72% 72%;
  }
  input[type="checkbox"]:not(.switch):not(.check-mark):active { transform: scale(.9); }

  /* Daftar pilihan Liquid Glass sederhana ala iOS (centang biru polos di kanan tanpa kotak) */
  .glass-check-list {
    border-radius: 22px; overflow: hidden;
    background: linear-gradient(180deg, rgba(255,255,255,.78) 0%, rgba(255,255,255,.58) 100%);
    border: 1px solid rgba(255,255,255,.85);
    box-shadow:
      inset 0 1.5px 1.5px rgba(255,255,255,.95),
      0 0 0 .5px rgba(15,23,42,.05),
      0 6px 16px -4px rgba(15,23,42,.06);
    -webkit-backdrop-filter: blur(var(--blur)) saturate(190%);
    backdrop-filter: blur(var(--blur)) saturate(190%);
  }
  .dark .glass-check-list {
    background: linear-gradient(180deg, rgba(255,255,255,.12) 0%, rgba(255,255,255,.07) 100%);
    border-color: rgba(255,255,255,.09);
    box-shadow: inset 0 1px .5px rgba(255,255,255,.10), 0 2px 8px rgba(0,0,0,.30);
  }
  .glass-check-item {
    display: flex; align-items: center; gap: .65rem;
    padding: .68rem 1rem; cursor: pointer; font-size: .86rem;
    border-top: 1px solid rgba(15,23,42,.06);
    transition: background-color .15s ease;
  }
  .dark .glass-check-item { border-top-color: rgba(255,255,255,.08); }
  .glass-check-item:first-child { border-top: 0; }
  @media (min-width: 640px) {
    .glass-check-list.cols-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .glass-check-list.cols-2 .glass-check-item:nth-child(2) { border-top: 0; }
    .glass-check-list.cols-2 .glass-check-item:nth-child(even) { border-left: 1px solid rgba(15,23,42,.06); }
    .dark .glass-check-list.cols-2 .glass-check-item:nth-child(even) { border-left-color: rgba(255,255,255,.08); }
  }
  .glass-check-list.cols-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .glass-check-list.cols-3 .glass-check-item:nth-child(-n+3) { border-top: 0; }
  .glass-check-list.cols-3 .glass-check-item:not(:nth-child(3n+1)) { border-left: 1px solid rgba(15,23,42,.06); }
  .dark .glass-check-list.cols-3 .glass-check-item:not(:nth-child(3n+1)) { border-left-color: rgba(255,255,255,.08); }
  .glass-check-item:hover { background: rgba(255,255,255,.45); }
  .dark .glass-check-item:hover { background: rgba(255,255,255,.07); }
  input[type="checkbox"].check-mark,
  input[type="radio"].check-mark {
    appearance: none; -webkit-appearance: none;
    width: 1.15rem; height: 1.15rem; flex-shrink: 0; border: 0; background: transparent; cursor: pointer;
    opacity: 0; transform: scale(.75);
    transition: opacity .18s ease, transform .22s cubic-bezier(.34,1.56,.64,1);
    color: var(--accent);
  }
  input[type="checkbox"].check-mark:checked,
  input[type="radio"].check-mark:checked {
    opacity: 1; transform: scale(1);
    background-color: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / contain no-repeat;
  }

  .search-box { position: relative; }
  .search-box.search-box-wide { width: 100%; }
  @media (min-width: 640px) { .search-box.search-box-wide { width: 14.5rem !important; } }
  @media (min-width: 768px) { .search-box.search-box-wide { width: 16.5rem !important; } }
  @media (min-width: 1024px) { .search-box.search-box-wide { width: 17.5rem !important; } }
  .search-box svg { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); z-index: 2; color: #1c1c1e; opacity: .72; pointer-events: none; }
  .dark .search-box svg { color: #f5f5f7; opacity: .72; }
  .search-box .glass-input { height: 2.65rem; min-height: 2.65rem; padding-top: 0; padding-bottom: 0; padding-left: 2.55rem; border-radius: 9999px; font-size: .85rem; }
  .search-box .glass-input,
  input[type="search"].glass-input {
    color: #121214;
    background-color: rgba(252, 252, 254, .95);
    background-image: none;
    border: 1px solid rgba(0, 0, 0, .085);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .03);
    -webkit-backdrop-filter: blur(var(--blur)) saturate(180%);
    backdrop-filter: blur(var(--blur)) saturate(180%);
  }
  .search-box .glass-input::placeholder,
  input[type="search"].glass-input::placeholder { color: rgba(60, 60, 67, .52); font-size: .85rem !important; }
  .search-box .glass-input:focus,
  input[type="search"].glass-input:focus {
    background-color: rgba(252, 252, 254, .95);
    background-image: none;
    border-color: rgba(0, 0, 0, .085);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .03);
    outline: none;
  }
  .dark .search-box .glass-input,
  .dark input[type="search"].glass-input {
    color: #f5f5f7;
    background-color: rgba(37, 37, 40, .94);
    background-image: none;
    border-color: rgba(255, 255, 255, .12);
    box-shadow: 0 2px 10px rgba(0, 0, 0, .42);
  }
  .dark .search-box .glass-input::placeholder,
  .dark input[type="search"].glass-input::placeholder { color: rgba(235, 235, 245, .45); }
  .dark .search-box .glass-input:focus,
  .dark input[type="search"].glass-input:focus {
    background-color: rgba(37, 37, 40, .94);
    background-image: none;
    border-color: rgba(255, 255, 255, .12);
    box-shadow: 0 2px 10px rgba(0, 0, 0, .42);
    outline: none;
  }
  select.glass-input.glass-select-pill,
  select.glass-input.glass-select-pill:focus {
    height: 2.65rem;
    min-height: 2.65rem;
    padding: 0 2.25rem 0 1.05rem;
    line-height: 2.5rem;
    border-radius: 9999px;
    font-size: .85rem !important;
    font-weight: 600;
    color: #121214;
    background-color: rgba(252, 252, 254, .95);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%231c1c1e' stroke-opacity='.72' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .85rem center;
    background-size: 15px 15px;
    border: 1px solid rgba(0, 0, 0, .085);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .03);
    -webkit-backdrop-filter: blur(var(--blur)) saturate(180%);
    backdrop-filter: blur(var(--blur)) saturate(180%);
  }
  select.glass-input.glass-select-pill:hover,
  select.glass-input.glass-select-pill:focus {
    background-color: #ffffff;
    border-color: rgba(0, 0, 0, .13);
    box-shadow: 0 2px 6px rgba(0, 0, 0, .05);
  }
  .dark select.glass-input.glass-select-pill,
  .dark select.glass-input.glass-select-pill:focus {
    color: #f5f5f7;
    background-color: rgba(37, 37, 40, .94);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23f5f5f7' stroke-opacity='.75' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .85rem center;
    background-size: 15px 15px;
    border: 1px solid rgba(255, 255, 255, .12);
    box-shadow: 0 2px 10px rgba(0, 0, 0, .42);
  }
  .dark select.glass-input.glass-select-pill:hover,
  .dark select.glass-input.glass-select-pill:focus {
    background-color: rgba(46, 46, 50, .96);
    border-color: rgba(255, 255, 255, .18);
    box-shadow: 0 3px 12px rgba(0, 0, 0, .48);
  }

  /* ---------- Switch gaya iOS 26 Liquid Glass (kapsul lonjong) ---------- */
  .switch {
    appearance: none; -webkit-appearance: none;
    display: inline-block; vertical-align: middle;
    width: 62px; height: 28px; border-radius: 9999px; flex-shrink: 0;
    background: rgba(120, 120, 128, .22);
    border: 1px solid rgba(255, 255, 255, .45);
    box-shadow:
      inset 0 1.5px 3px rgba(15, 23, 42, .12),
      inset 0 -1px 1px rgba(255, 255, 255, .65),
      0 0 0 .5px rgba(15, 23, 42, .05);
    -webkit-backdrop-filter: blur(var(--blur)) saturate(180%);
    backdrop-filter: blur(var(--blur)) saturate(180%);
    position: relative; cursor: pointer;
    transition: background .3s ease, border-color .3s ease, box-shadow .3s ease;
  }
  .dark .switch {
    background: rgba(120, 120, 128, .34);
    border-color: rgba(255, 255, 255, .14);
    box-shadow:
      inset 0 1.5px 3px rgba(0, 0, 0, .4),
      inset 0 -1px 1px rgba(255, 255, 255, .12);
  }
  .switch::after {
    content: "";
    position: absolute; top: 1.5px; left: 1.5px;
    width: 37px; height: 23px; border-radius: 9999px;
    background: linear-gradient(180deg, #ffffff 0%, rgba(255, 255, 255, .96) 100%);
    box-shadow:
      inset 0 1px 1px rgba(255, 255, 255, 1),
      0 2px 6px rgba(15, 23, 42, .18),
      0 1px 2px rgba(15, 23, 42, .10);
    transition: transform .4s cubic-bezier(.34, 1.56, .64, 1), width .25s ease;
  }
  .switch:active:not(:disabled)::after { width: 42px; }
  .switch:checked {
    background: linear-gradient(180deg, rgba(48, 209, 88, .92) 0%, rgba(52, 199, 89, .98) 100%);
    border-color: rgba(255, 255, 255, .36);
    box-shadow:
      inset 0 1px 2px rgba(0, 0, 0, .08),
      inset 0 -1px 1px rgba(255, 255, 255, .35),
      0 0 0 .5px rgba(52, 199, 89, .38);
  }
  .switch:checked::after { transform: translateX(20px); }
  .switch:checked:active:not(:disabled)::after { transform: translateX(15px); }
  .switch:disabled { opacity: .55; cursor: not-allowed; }

  /* ---------- Segmented control gaya native iOS 26 ---------- */
  .seg {
    position: relative; display: inline-flex; align-items: center; gap: 2px; padding: 4px; height: 2.65rem; border-radius: 9999px; max-width: 100%; overflow-x: auto;
    background: rgba(252, 252, 254, .95);
    border: 1px solid rgba(0, 0, 0, .085);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .03);
    -webkit-backdrop-filter: blur(var(--blur)) saturate(180%);
    backdrop-filter: blur(var(--blur)) saturate(180%);
    scrollbar-width: none;
  }
  .seg::-webkit-scrollbar { display: none; }
  .dark .seg {
    background: rgba(37, 37, 40, .94);
    border-color: rgba(255, 255, 255, .12);
    box-shadow: 0 2px 10px rgba(0, 0, 0, .42);
  }
  .seg-thumb {
    position: absolute; top: 4px; bottom: 4px; left: 0; width: 0; border-radius: 9999px; z-index: 0;
    background: #eaeaea;
    box-shadow: none;
    transition: transform .38s cubic-bezier(.22,1,.36,1), width .38s cubic-bezier(.22,1,.36,1);
  }
  .dark .seg-thumb {
    background: #0b0b0d;
    box-shadow: none;
  }
  .seg-item {
    position: relative; z-index: 1; display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap; flex-shrink: 0;
    height: 100%; padding: 0 1.05rem; border-radius: 9999px; font-size: .85rem; font-weight: 500; line-height: 1; color: #121214;
    transition: color .22s ease; cursor: pointer;
  }
  .dark .seg-item { color: #f5f5f7; }
  .seg-item.active { color: var(--accent); font-weight: 600; }
  .dark .seg-item.active { color: var(--accent); font-weight: 600; }
  .seg.seg-compact { display: flex; width: 100%; height: auto; padding: 3px; }
  .seg.seg-compact .seg-thumb { top: 3px; bottom: 3px; }
  .seg.seg-compact .seg-item { flex: 1; height: auto; justify-content: center; padding: .38rem .4rem; font-size: .72rem; gap: .28rem; }
  .seg.seg-shrink { min-width: 0; max-width: 100%; }
  .seg.seg-shrink .seg-item { justify-content: center; }
  .seg.seg-icons { height: 2.65rem; align-items: center; }
  .seg.seg-icons .seg-item { height: 100%; padding: 0 .68rem; justify-content: center; }
  .sem-toggle {
    height: 2.65rem;
    display: inline-flex; align-items: center; justify-content: center; gap: .38rem;
    padding: 0 .85rem; border-radius: 9999px; flex-shrink: 0; white-space: nowrap;
    font-size: .85rem; font-weight: 600; line-height: 1; color: #121214;
    background: rgba(252, 252, 254, .95);
    border: 1px solid rgba(0, 0, 0, .085);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .03);
    -webkit-backdrop-filter: blur(var(--blur)) saturate(180%);
    backdrop-filter: blur(var(--blur)) saturate(180%);
    cursor: pointer; user-select: none;
    transition: transform .18s cubic-bezier(.22,1,.36,1), background .2s ease, border-color .2s ease, box-shadow .2s ease;
  }
  .sem-toggle .sem-toggle-word { display: none; }
  @media (min-width: 640px) {
    .sem-toggle .sem-toggle-word { display: inline; }
  }
  .sem-toggle:hover {
    background: #ffffff;
    border-color: rgba(0, 0, 0, .13);
    box-shadow: 0 2px 6px rgba(0, 0, 0, .05);
  }
  .sem-toggle:active { transform: scale(.95); }
  .sem-toggle svg { opacity: .72; transition: opacity .2s ease; }
  .sem-toggle:hover svg { opacity: 1; }
  .dark .sem-toggle {
    color: #f5f5f7;
    background: rgba(37, 37, 40, .94);
    border-color: rgba(255, 255, 255, .12);
    box-shadow: 0 2px 10px rgba(0, 0, 0, .42);
  }
  .dark .sem-toggle:hover {
    background: rgba(46, 46, 50, .96);
    border-color: rgba(255, 255, 255, .18);
    box-shadow: 0 3px 12px rgba(0, 0, 0, .48);
  }

  /* ---------- Navigasi gaya Liquid Glass iOS / iPadOS 26 ---------- */
  #sidebar {
    background: linear-gradient(180deg, rgba(255, 255, 255, .62) 0%, rgba(255, 255, 255, .48) 100%);
    -webkit-backdrop-filter: blur(14px) saturate(195%);
    backdrop-filter: blur(14px) saturate(195%);
    border: none;
    border-radius: 0;
    box-shadow:
      inset -1px 0 0 rgba(0, 0, 0, .06),
      inset -2px 0 1px rgba(255, 255, 255, .55),
      4px 0 24px -6px rgba(15, 23, 42, .13);
    padding: 1.25rem .9rem;
  }
  #sidebar::before { display: none; }
  .dark #sidebar {
    background: linear-gradient(180deg, rgba(64, 64, 70, .56) 0%, rgba(44, 44, 48, .50) 52%, rgba(50, 50, 56, .56) 100%);
    -webkit-backdrop-filter: blur(14px) saturate(195%);
    backdrop-filter: blur(14px) saturate(195%);
    border: none;
    box-shadow:
      inset -1px 0 0 rgba(255, 255, 255, .14),
      8px 0 28px -6px rgba(0, 0, 0, .72);
  }
  @media (min-width: 1024px) {
    #sidebar ~ main {
      padding-left: 264px;
    }
  }
  .nav-item {
    position: relative; z-index: 1; display: flex; align-items: center; gap: .78rem; padding: .66rem .95rem;
    border-radius: 9999px; font-weight: 500; font-size: .92rem; color: #121214; transition: color .22s ease; cursor: pointer;
  }
  .nav-item svg {
    flex-shrink: 0;
  }
  .dark .nav-item { color: #f5f5f7; }
  .nav-item:hover { color: #000000; }
  .dark .nav-item:hover { color: #ffffff; }
  .nav-item.active,
  .nav-item.active:hover { color: var(--accent); font-weight: 600; }
  .dark .nav-item.active,
  .dark .nav-item.active:hover { color: var(--accent); font-weight: 600; }
  .nav-thumb {
    position: absolute; left: 0; top: 0; z-index: 0; border-radius: 9999px; opacity: 0;
    background: rgba(0, 0, 0, .07);
    box-shadow: none;
    transition: transform .5s cubic-bezier(.22,1,.36,1), width .5s cubic-bezier(.22,1,.36,1), height .5s cubic-bezier(.22,1,.36,1), opacity .25s;
  }
  .dark .nav-thumb {
    background: rgba(0, 0, 0, .64);
    box-shadow: none;
  }
  #tabbar {
    background: linear-gradient(180deg, rgba(255, 255, 255, .62) 0%, rgba(255, 255, 255, .48) 100%);
    -webkit-backdrop-filter: blur(14px) saturate(195%);
    backdrop-filter: blur(14px) saturate(195%);
    border: 1px solid rgba(0, 0, 0, .06);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, .92),
      inset 0 -1px 0 rgba(255, 255, 255, .50),
      0 8px 26px -6px rgba(15, 23, 42, .13);
  }
  #tabbar::before {
    display: block;
    background: linear-gradient(
      180deg,
      rgba(255, 255, 255, .88) 0%,
      rgba(255, 255, 255, .12) 28%,
      rgba(255, 255, 255, .06) 50%,
      rgba(255, 255, 255, .12) 72%,
      rgba(255, 255, 255, .68) 100%
    );
  }
  .dark #tabbar {
    background: linear-gradient(180deg, rgba(64, 64, 70, .56) 0%, rgba(44, 44, 48, .50) 52%, rgba(50, 50, 56, .56) 100%);
    -webkit-backdrop-filter: blur(14px) saturate(195%);
    backdrop-filter: blur(14px) saturate(195%);
    border: 1px solid transparent;
    box-shadow: 0 12px 32px -6px rgba(0, 0, 0, .72);
  }
  .dark #tabbar::before {
    display: block;
    background: linear-gradient(
      180deg,
      rgba(255, 255, 255, .28) 0%,
      rgba(255, 255, 255, .05) 26%,
      rgba(255, 255, 255, .02) 50%,
      rgba(255, 255, 255, .05) 74%,
      rgba(255, 255, 255, .22) 100%
    );
  }
  #tabNav .nav-thumb {
    background: rgba(0, 0, 0, .07);
    box-shadow: none;
  }
  .dark #tabNav .nav-thumb {
    background: rgba(0, 0, 0, .64);
    box-shadow: none;
  }
  .tab-item {
    position: relative; z-index: 1; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    height: 52px; padding: 5px 4px; border-radius: 9999px; font-size: .64rem; line-height: 1.15; font-weight: 500; white-space: nowrap;
    color: #121214; transition: color .22s ease;
  }
  .dark .tab-item { color: #f5f5f7; }
  .tab-item.active { color: var(--accent); font-weight: 600; }
  .dark .tab-item.active { color: var(--accent); font-weight: 600; }
  .tab-item svg { width: 24px; height: 24px; flex-shrink: 0; transition: transform .45s cubic-bezier(.34,1.56,.64,1); }
  .tab-item.active svg { transform: scale(1.05); }
  #tabbar.tabbar-fit {
    width: max-content !important;
  }
  #tabbar.tabbar-fit #tabNav {
    display: grid !important;
    grid-auto-flow: column;
    grid-auto-columns: minmax(86px, 1fr);
    align-items: stretch;
  }
  #tabbar.tabbar-fit .tab-item {
    flex: none;
    padding: 5px .9rem;
  }

  /* ---------- Elemen kecil ---------- */
  .avatar {
    display: grid; place-items: center; border-radius: 9999px; color: #334155; font-weight: 700; flex-shrink: 0; letter-spacing: 0;
    overflow: hidden; position: relative;
    background: linear-gradient(145deg, #ffffff 0%, #e9eef5 100%);
    border: 1px solid rgba(15, 23, 42, .08);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.95), inset 0 -2px 5px rgba(15,23,42,.06), 0 3px 8px -2px rgba(15,23,42,.15);
  }
  .dark .avatar {
    background: linear-gradient(145deg, #ffffff 0%, #dfe6f0 100%);
    border-color: rgba(255, 255, 255, .18);
  }
  .avatar img {
    width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
  }
  .guru-hero-cover img,
  .live-cls-avatar {
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
  }
  #btnProfile .profile-btn-icon,
  #btnProfile .profile-btn-avatar {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
  }
  #btnProfile.is-avatar .profile-btn-icon {
    display: none;
  }
  #btnProfile:not(.is-avatar) .profile-btn-avatar {
    display: none;
  }
  #btnProfile,
  #btnProfile:focus,
  #btnProfile:focus-visible,
  #btnProfile:active {
    outline: none !important;
    -webkit-tap-highlight-color: transparent;
  }
  #btnProfile,
  .dark #btnProfile,
  #btnProfile:hover,
  .dark #btnProfile:hover {
    background: transparent !important;
    border: 0 !important;
    border-color: transparent !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    overflow: visible !important;
    box-shadow: none !important;
    border-radius: 20px;
    transition: transform .35s cubic-bezier(.34, 1.56, .64, 1);
  }
  #btnProfile::before {
    content: "";
    display: block;
    position: absolute;
    inset: 0;
    border-radius: 20px;
    pointer-events: none;
    z-index: -1;
    background: linear-gradient(180deg, rgba(255,255,255,.72) 0%, rgba(255,255,255,.56) 100%);
    border: 1px solid rgba(255,255,255,.82);
    box-shadow:
      inset 0 1px .5px rgba(255,255,255,.95),
      inset 0 -1px .5px rgba(255,255,255,.50),
      0 0 0 .5px rgba(15,23,42,.05),
      0 2px 6px rgba(15,23,42,.06),
      0 1px 2px rgba(15,23,42,.03);
    -webkit-backdrop-filter: blur(var(--blur)) saturate(190%);
    backdrop-filter: blur(var(--blur)) saturate(190%);
    opacity: 1;
    transform: scale(1);
    will-change: opacity, transform;
    transition:
      opacity .24s cubic-bezier(.32, .72, 0, 1) .06s,
      transform .28s cubic-bezier(.32, .72, 0, 1) .06s,
      background .2s ease,
      box-shadow .2s ease;
  }
  #btnProfile:hover::before {
    background: linear-gradient(180deg, rgba(255,255,255,.84) 0%, rgba(255,255,255,.68) 100%);
    box-shadow:
      inset 0 1px 1px rgba(255,255,255,1),
      inset 0 -1px .5px rgba(255,255,255,.60),
      0 0 0 .5px rgba(15,23,42,.06),
      0 4px 10px rgba(15,23,42,.08),
      0 1px 3px rgba(15,23,42,.04);
  }
  .dark #btnProfile::before {
    background: linear-gradient(180deg, rgba(255,255,255,.14) 0%, rgba(255,255,255,.08) 100%);
    border-color: rgba(255,255,255,.10);
    box-shadow:
      inset 0 1px .5px rgba(255,255,255,.12),
      inset 0 -1px .5px rgba(255,255,255,.03),
      0 2px 8px rgba(0,0,0,.30);
  }
  .dark #btnProfile:hover::before {
    background: linear-gradient(180deg, rgba(255,255,255,.22) 0%, rgba(255,255,255,.14) 100%);
  }
  #btnProfile[aria-expanded="true"]::before,
  .dark #btnProfile[aria-expanded="true"]::before,
  #btnProfile[aria-expanded="true"]:hover::before,
  .dark #btnProfile[aria-expanded="true"]:hover::before {
    opacity: 0;
    transform: scale(.84);
    transition:
      opacity .16s cubic-bezier(.32, .72, 0, 1),
      transform .2s cubic-bezier(.32, .72, 0, 1);
  }
  #btnProfile .avatar,
  .dark #btnProfile .avatar {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    border-radius: 20px;
    overflow: hidden;
    will-change: border-radius;
    transition: border-radius .28s cubic-bezier(.32, .72, 0, 1);
  }
  #btnProfile .avatar img {
    border-radius: inherit !important;
  }
  #btnProfile[aria-expanded="true"],
  .dark #btnProfile[aria-expanded="true"],
  #btnProfile[aria-expanded="true"]:hover,
  .dark #btnProfile[aria-expanded="true"]:hover,
  #btnProfile[aria-expanded="true"]:focus,
  #btnProfile[aria-expanded="true"]:focus-visible,
  #btnProfile[aria-expanded="true"]:active {
    outline: none !important;
    transform: none !important;
  }
  #btnProfile.is-avatar[aria-expanded="true"] .avatar,
  .dark #btnProfile.is-avatar[aria-expanded="true"] .avatar {
    border-radius: 0px;
    transition: border-radius .26s cubic-bezier(.32, .72, 0, 1);
  }
  #btnProfile.no-transition,
  #btnProfile.no-transition::before,
  #btnProfile.no-transition .avatar,
  #btnProfile.no-transition .avatar img {
    transition: none !important;
  }
  .tp-has-pill:not(:focus) {
    color: transparent !important;
    caret-color: transparent;
  }
  .tp-has-pill:focus ~ .tp-extreme-pill {
    opacity: 0;
  }
  .tone-blue { --tone: 0, 122, 255; }
  .tone-green { --tone: 22, 163, 74; }
  .tone-orange { --tone: 234, 120, 0; }
  .tone-red { --tone: 229, 46, 60; }
  .tone-purple { --tone: 147, 51, 234; }
  .tone-pink { --tone: 219, 39, 119; }
  .tone-teal { --tone: 13, 148, 136; }
  .tone-indigo { --tone: 79, 70, 229; }
  .tone-yellow { --tone: 202, 138, 4; }
  .tone-gray { --tone: 100, 116, 139; }
  .tone-accent { --tone: var(--accent-rgb); }
  .dark .tone-blue { --tone: 100, 170, 255; }
  .dark .tone-green { --tone: 74, 222, 128; }
  .dark .tone-orange { --tone: 255, 170, 70; }
  .dark .tone-red { --tone: 255, 110, 110; }
  .dark .tone-purple { --tone: 196, 140, 255; }
  .dark .tone-pink { --tone: 255, 120, 180; }
  .dark .tone-teal { --tone: 60, 220, 200; }
  .dark .tone-indigo { --tone: 150, 145, 255; }
  .dark .tone-yellow { --tone: 250, 204, 21; }
  .dark .tone-gray { --tone: 170, 180, 200; }
  .icon-bubble {
    width: 2.6rem; height: 2.6rem; border-radius: 15px; display: grid; place-items: center; flex-shrink: 0;
    color: rgb(var(--tone)); background: rgba(var(--tone), .14); box-shadow: inset 0 1px 0 rgba(255,255,255,.55);
  }
  .dark .icon-bubble { box-shadow: inset 0 1px 0 rgba(255,255,255,.1); background: rgba(var(--tone), .18); }
  .class-card-head.is-compact .class-card-icon { display: none; }
  .class-card-head.is-compact .class-card-name { color: rgb(var(--tone)); }
  .badge {
    display: inline-flex; align-items: center; gap: .3rem; padding: .22rem .62rem; border-radius: 9999px;
    font-size: .72rem; font-weight: 600; white-space: nowrap; color: rgb(var(--tone)); background: rgba(var(--tone), .13);
  }
  .chip {
    display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .9rem; border-radius: 9999px; font-size: .82rem; font-weight: 500;
    background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(242,242,247,.7)); border: 1px solid rgba(0,0,0,.08); cursor: pointer; white-space: nowrap;
    box-shadow: inset 0 1px 0 #fff, 0 1px 2px rgba(0,0,0,.04);
    transition: all .3s cubic-bezier(.34,1.56,.64,1);
  }
  .chip:hover { background: #fff; }
  .dark .chip { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.05); box-shadow: inset 0 1px 0 rgba(255,255,255,.05); }
  .dark .chip:hover { background: rgba(255,255,255,.12); }
  .chip:active { transform: scale(.95); }
  .chip.active { color: #fff; border-color: transparent; background: rgba(var(--accent-rgb), .92); box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 6px 14px -4px rgba(var(--accent-rgb), .6); }
  .progress { height: .5rem; border-radius: 9999px; background: rgba(120,120,128,.18); overflow: hidden; }
  .progress > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, rgba(var(--tone, var(--accent-rgb)), .7), rgb(var(--tone, var(--accent-rgb)))); transition: width .8s cubic-bezier(.22,1,.36,1); }

  /* Tombol presensi H / S / I / D / A (gaya Pill Liquid Glass) */
  .att-group {
    display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 9999px; flex-shrink: 0;
    background: linear-gradient(180deg, rgba(255,255,255,.78) 0%, rgba(255,255,255,.58) 100%);
    border: 1px solid rgba(255,255,255,.85);
    box-shadow: inset 0 1px .5px rgba(255,255,255,.95), inset 0 -1px .5px rgba(255,255,255,.5), 0 0 0 .5px rgba(15,23,42,.05), 0 2px 6px rgba(15,23,42,.06);
    -webkit-backdrop-filter: blur(var(--blur)) saturate(190%);
    backdrop-filter: blur(var(--blur)) saturate(190%);
  }
  .dark .att-group {
    background: linear-gradient(180deg, rgba(255,255,255,.14) 0%, rgba(255,255,255,.08) 100%);
    border-color: rgba(255,255,255,.10);
    box-shadow: inset 0 1px .5px rgba(255,255,255,.12), inset 0 -1px .5px rgba(255,255,255,.03), 0 2px 8px rgba(0,0,0,.30);
  }
  .att-btn {
    width: 2rem; height: 2rem; border-radius: 9999px; font-weight: 700; font-size: .76rem; color: rgba(51,65,85,.82); cursor: pointer;
    transition: transform .35s cubic-bezier(.34,1.56,.64,1), background .2s, color .2s, box-shadow .2s;
  }
  .dark .att-btn { color: rgba(226,232,240,.70); }
  .att-btn:hover:not(.on) { background: rgba(15,23,42,.06); }
  .dark .att-btn:hover:not(.on) { background: rgba(255,255,255,.10); }
  .att-btn:active { transform: scale(.88); }
  .att-btn.on { color: #fff; transform: scale(1.03); box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 4px 10px -3px var(--c); background: var(--c); }
  .att-btn[data-val="H"] { --c: #34c759; }
  .att-btn[data-val="S"] { --c: #ff9f0a; }
  .att-btn[data-val="I"] { --c: #0a84ff; }
  .att-btn[data-val="D"] { --c: #af52de; }
  .att-btn[data-val="A"] { --c: #ff3b30; }
  .att-group.cond-sess .att-btn { --c: #0a84ff; }
  .att-group.cond-floor .att-btn { --c: #34c759; }

  /* ---------- Tabel ---------- */
  .table { width: 100%; font-size: .875rem; border-collapse: collapse; }
  .table th { text-align: left; font-weight: 600; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; padding: .95rem 1rem .75rem; color: rgba(71,85,105,.8); white-space: nowrap; }
  .dark .table th { color: rgba(226,232,240,.55); }
  .table td { padding: .85rem 1rem; border-top: 1px solid rgba(0,0,0,.06); vertical-align: middle; }
  .dark .table td { border-top-color: rgba(255,255,255,.07); }
  .table th:first-child, .table td:first-child { padding-left: 1.5rem; }
  .table th:last-child, .table td:last-child { padding-right: 1.5rem; }
  .table tbody tr { transition: background .2s; }
  .table tbody tr:hover { background: rgba(0,0,0,.035); }
  .dark .table tbody tr:hover { background: rgba(255,255,255,.05); }

  /* Modal gradasi halus di bawah judul & tombol yang fix (ringan saat scroll) */
  .modal-panel {
    border-radius: 36px 36px 0 0;
  }
  @media (min-width: 640px) {
    .modal-panel {
      border-radius: 36px;
    }
  }
  .modal-panel.glass-strong {
    background: linear-gradient(180deg, rgba(244, 244, 248, .92) 0%, rgba(240, 240, 246, .88) 100%);
    -webkit-backdrop-filter: blur(calc(var(--blur) + 20px)) saturate(190%);
    backdrop-filter: blur(calc(var(--blur) + 20px)) saturate(190%);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, .95), 0 32px 84px -20px rgba(15, 23, 42, .42);
  }
  .dark .modal-panel.glass-strong {
    background: linear-gradient(180deg, rgba(36, 36, 38, .92) 0%, rgba(28, 28, 30, .88) 100%);
    box-shadow: inset 0 1px .5px rgba(255, 255, 255, .12), 0 32px 84px -20px rgba(0, 0, 0, .85);
  }
  .modal-panel .glass-thin {
    background: #ffffff;
    border-color: rgba(0, 0, 0, .04);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .03);
  }
  .dark .modal-panel .glass-thin {
    background: #2c2c2e;
    border-color: rgba(255, 255, 255, .05);
    box-shadow: none;
  }
  .modal-panel a.glass-thin.pressable:hover,
  .modal-panel button.glass-thin.pressable:hover,
  .modal-panel .glass-thin.pressable:hover {
    background: #f5f5f7;
  }
  .dark .modal-panel .glass-thin.pressable:hover {
    background: #3a3a3c;
  }

  /* Tombol Close Modal — Liquid Glass iOS 26 */
  .icon-btn.modal-close-btn {
    width: 2.5rem;
    height: 2.5rem;
    color: #1c1c1e;
    border: none;
    background: linear-gradient(155deg, rgba(255, 255, 255, .80) 0%, rgba(255, 255, 255, .48) 100%);
    -webkit-backdrop-filter: blur(22px) saturate(190%);
    backdrop-filter: blur(22px) saturate(190%);
    box-shadow:
      inset 0 1px 1.5px rgba(255, 255, 255, .96),
      inset 0 -1px 1px rgba(255, 255, 255, .42),
      0 4px 16px -2px rgba(15, 23, 42, .12),
      0 1px 3px rgba(15, 23, 42, .06);
  }
  .icon-btn.modal-close-btn::before {
    display: block;
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(255, 255, 255, .98) 0%, rgba(255, 255, 255, .35) 32%, rgba(255, 255, 255, .10) 55%, rgba(255, 255, 255, .42) 80%, rgba(255, 255, 255, .92) 100%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
  }
  .icon-btn.modal-close-btn:hover {
    background: linear-gradient(155deg, rgba(255, 255, 255, .94) 0%, rgba(255, 255, 255, .66) 100%);
    border-color: transparent;
    box-shadow:
      inset 0 1px 1.5px rgba(255, 255, 255, 1),
      inset 0 -1px 1px rgba(255, 255, 255, .52),
      0 6px 20px -2px rgba(15, 23, 42, .16),
      0 2px 4px rgba(15, 23, 42, .08);
    transform: scale(1.04);
  }
  .icon-btn.modal-close-btn:active {
    transform: scale(.90);
  }
  .dark .icon-btn.modal-close-btn {
    color: #f5f5f7;
    background: linear-gradient(155deg, rgba(76, 76, 82, .72) 0%, rgba(44, 44, 48, .58) 100%);
    box-shadow:
      inset 0 1px 1px rgba(255, 255, 255, .24),
      inset 0 -1px 1px rgba(255, 255, 255, .06),
      0 6px 18px -4px rgba(0, 0, 0, .55);
  }
  .dark .icon-btn.modal-close-btn::before {
    background: linear-gradient(135deg, rgba(255, 255, 255, .34) 0%, rgba(255, 255, 255, .08) 35%, rgba(255, 255, 255, .03) 55%, rgba(255, 255, 255, .18) 100%);
  }
  .dark .icon-btn.modal-close-btn:hover {
    background: linear-gradient(155deg, rgba(94, 94, 100, .82) 0%, rgba(56, 56, 60, .70) 100%);
    box-shadow:
      inset 0 1px 1px rgba(255, 255, 255, .30),
      inset 0 -1px 1px rgba(255, 255, 255, .08),
      0 8px 22px -4px rgba(0, 0, 0, .62);
  }

  .modal-header { padding: 0.875rem 0.875rem 0.75rem 1.5rem; }
  .modal-header,
  .modal-footer,
  .modal-edge-bot {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
  }
  .modal-body { flex: 1 1 auto; min-height: 0; }
  .modal-content { flex: 1 0 auto; position: relative; z-index: 1; min-width: 0; }
  .modal-panel.glass-strong::before { z-index: 30; }

  .modal-fade-top::after,
  .modal-fade-bot::after,
  .modal-edge-bot::after {
    content: "";
    position: absolute;
    z-index: -1;
    pointer-events: none;
    opacity: 0;
    transition: opacity .2s ease;
  }
  .modal-fade-top::after { inset: 0 0 -16px 0; }
  .modal-fade-bot::after { inset: -16px 0 0 0; }
  .modal-edge-bot { height: 48px; margin-top: -48px; }
  .modal-edge-bot::after { inset: 0; }

  .modal-fade-top.fade-on::after,
  .modal-fade-bot.fade-on::after,
  .modal-edge-bot.fade-on::after {
    opacity: 1;
  }

  .modal-fade-top::after {
    background: linear-gradient(180deg, rgba(244,244,248,.96) 0%, rgba(244,244,248,.9) 55%, rgba(244,244,248,.5) 80%, rgba(244,244,248,0) 100%);
  }
  .dark .modal-fade-top::after {
    background: linear-gradient(180deg, rgba(34,34,36,.96) 0%, rgba(32,32,34,.9) 55%, rgba(28,28,30,.5) 80%, rgba(28,28,30,0) 100%);
  }
  .modal-fade-bot::after,
  .modal-edge-bot::after {
    background: linear-gradient(0deg, rgba(240,240,246,.96) 0%, rgba(240,240,246,.9) 55%, rgba(240,240,246,.5) 80%, rgba(240,240,246,0) 100%);
  }
  .dark .modal-fade-bot::after,
  .dark .modal-edge-bot::after {
    background: linear-gradient(0deg, rgba(28,28,30,.96) 0%, rgba(28,28,30,.9) 55%, rgba(28,28,30,.5) 80%, rgba(28,28,30,0) 100%);
  }

  /* ---------- Scrollable list dalam card (tanpa scrollbar + fade atas/bawah ala modal) ---------- */
  .fade-scroll-wrap {
    position: relative;
  }
  .fade-scroll-wrap::before,
  .fade-scroll-wrap::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 24px;
    pointer-events: none;
    z-index: 2;
    opacity: 0;
    transition: opacity .2s ease;
  }
  .fade-scroll-wrap::before {
    top: 0;
    background: linear-gradient(180deg, #ffffff 0%, rgba(255,255,255,.88) 45%, rgba(255,255,255,0) 100%);
  }
  .fade-scroll-wrap::after {
    bottom: 0;
    background: linear-gradient(0deg, #ffffff 0%, rgba(255,255,255,.88) 45%, rgba(255,255,255,0) 100%);
  }
  .dark .fade-scroll-wrap::before {
    background: linear-gradient(180deg, #1c1c1e 0%, rgba(28,28,30,.88) 45%, rgba(28,28,30,0) 100%);
  }
  .dark .fade-scroll-wrap::after {
    background: linear-gradient(0deg, #1c1c1e 0%, rgba(28,28,30,.88) 45%, rgba(28,28,30,0) 100%);
  }
  .fade-scroll-wrap.fade-top-on::before,
  .fade-scroll-wrap.fade-bot-on::after {
    opacity: 1;
  }
  .fade-scroll-list {
    position: relative;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .fade-scroll-list::-webkit-scrollbar {
    display: none;
  }

  /* ---------- Modal & toast ---------- */
  .modal-backdrop { background: rgba(15,23,42,.22); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); opacity: 0; transition: opacity .3s; }
  .dark .modal-backdrop { background: rgba(0,0,0,.45); }
  .modal-panel { opacity: 0; transform: translate3d(0, 24px, 0); will-change: transform, opacity; transition: transform .36s cubic-bezier(.22,1,.36,1), opacity .24s ease; }
  .modal-root.open .modal-backdrop { opacity: 1; }
  .modal-root.open .modal-panel { opacity: 1; transform: translate3d(0, 0, 0); }
  .toast {
    display: flex; align-items: center; gap: .6rem; padding: .7rem 1.1rem .7rem .8rem; border-radius: 9999px; font-size: .875rem; font-weight: 500;
    opacity: 0; transform: translateY(-16px) scale(.9); transition: transform .5s cubic-bezier(.34,1.56,.64,1), opacity .3s;
  }
  .toast.show { opacity: 1; transform: none; }

  /* ---------- Animasi tampilan ---------- */
  @keyframes viewIn {
    from { opacity: 0; transform: translate3d(0, 10px, 0); }
    to { opacity: 1; transform: translate3d(0, 0, 0); }
  }
  .anim-in {
    animation: viewIn .42s cubic-bezier(.22,1,.36,1) both;
    will-change: opacity, transform;
  }
  @keyframes lazyItemIn {
    from { opacity: .18; transform: translate3d(0, 6px, 0); }
    to { opacity: 1; transform: translate3d(0, 0, 0); }
  }
  @keyframes lazyRowIn {
    from { opacity: .18; }
    to { opacity: 1; }
  }
  .lazy-item-in {
    animation: lazyItemIn .22s cubic-bezier(.22,1,.36,1) both;
  }
  tr.lazy-item-in {
    animation-name: lazyRowIn;
    transform: none !important;
  }
  .reduce-motion .anim-in,
  .reduce-motion .lazy-item-in { animation: none; will-change: auto; }
  @keyframes pulseDot { 0%, 100% { box-shadow: 0 0 0 0 rgba(52,199,89,.55); } 50% { box-shadow: 0 0 0 6px rgba(52,199,89,0); } }
  .live-dot { width: .5rem; height: .5rem; border-radius: 9999px; background: #34c759; animation: pulseDot 1.8s infinite; }
  .badge.tone-red .live-dot { background: #ff3b30; }

  .bar-col { border-radius: 10px 10px 6px 6px; background: linear-gradient(180deg, rgba(var(--accent-rgb), .95), rgba(var(--accent-rgb), .45)); box-shadow: inset 0 1px 0 rgba(255,255,255,.55); transition: height .9s cubic-bezier(.22,1,.36,1); }

  /* ---------- Mode Layar Penuh Pantauan Realtime ---------- */
  body.monitor-fs-active #sidebar,
  body.monitor-fs-active #topbar,
  body.monitor-fs-active #tabbar {
    display: none !important;
  }
  .realtime-monitor {
    display: none;
  }
  .realtime-monitor .fs-only {
    display: none;
  }

  /* Animasi background ambient soft & modern untuk mode layar penuh (otomatis dark mode) */
  @keyframes fsBlobMove1 {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    33% { transform: translate3d(12vw, 8vh, 0) scale(1.08); }
    66% { transform: translate3d(-6vw, 14vh, 0) scale(0.95); }
  }
  @keyframes fsBlobMove2 {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    33% { transform: translate3d(-14vw, -9vh, 0) scale(1.07); }
    66% { transform: translate3d(8vw, -12vh, 0) scale(0.96); }
  }
  @keyframes fsBlobMove3 {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(10vw, -10vh, 0) scale(1.1); }
  }
  @keyframes fsBlobMove4 {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(-10vw, 10vh, 0) scale(1.09); }
  }
  @keyframes fsBgGradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
  }

  .realtime-monitor.is-fullscreen,
  .dark .realtime-monitor.is-fullscreen {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 90 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    overflow: hidden !important;
    padding: 0.9rem 1.2rem !important;
    color: #f8fafc !important;
    color-scheme: dark !important;
    background: #000000 !important;
    animation: none !important;
    border: none !important;
    transform: none !important;
    display: flex !important;
    flex-direction: column !important;
  }
  .realtime-monitor.is-fullscreen .fs-bg-anim {
    position: absolute !important;
    inset: 0 !important;
    z-index: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
    background: transparent !important;
  }
  .realtime-monitor.is-fullscreen .lb-blob {
    opacity: .34;
  }
  .realtime-monitor.is-fullscreen .fs-blob,
  .dark .realtime-monitor.is-fullscreen .fs-blob {
    position: absolute;
    border-radius: 9999px;
    filter: blur(110px);
    opacity: 0.12;
    will-change: transform;
  }
  .realtime-monitor.is-fullscreen .fs-blob-1 {
    width: 48vw; height: 48vw; max-width: 760px; max-height: 760px;
    top: -16%; left: -8%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.55) 0%, rgba(37, 99, 235, 0.18) 55%, transparent 78%);
    animation: fsBlobMove1 28s ease-in-out infinite;
  }
  .realtime-monitor.is-fullscreen .fs-blob-2 {
    width: 50vw; height: 50vw; max-width: 780px; max-height: 780px;
    bottom: -18%; right: -8%;
    background: radial-gradient(circle, rgba(124, 92, 252, 0.48) 0%, rgba(79, 70, 229, 0.16) 55%, transparent 78%);
    animation: fsBlobMove2 34s ease-in-out infinite;
  }
  .realtime-monitor.is-fullscreen .fs-blob-3 {
    width: 42vw; height: 42vw; max-width: 640px; max-height: 640px;
    bottom: 4%; left: 16%;
    background: radial-gradient(circle, rgba(45, 212, 191, 0.40) 0%, rgba(14, 165, 233, 0.14) 55%, transparent 78%);
    animation: fsBlobMove3 26s ease-in-out infinite;
  }
  .realtime-monitor.is-fullscreen .fs-blob-4 {
    width: 40vw; height: 40vw; max-width: 600px; max-height: 600px;
    top: 6%; right: 18%;
    background: radial-gradient(circle, rgba(96, 165, 250, 0.44) 0%, rgba(139, 92, 246, 0.14) 55%, transparent 78%);
    animation: fsBlobMove4 30s ease-in-out infinite;
  }

  .realtime-monitor.is-fullscreen .fs-hide {
    display: none !important;
  }
  .realtime-monitor.is-fullscreen .fs-only {
    display: flex !important;
  }
  span.fs-only {
    display: none;
  }
  .realtime-monitor.is-fullscreen span.fs-only {
    display: inline !important;
  }

  /* Header Polos di Layar Penuh (tanpa tampilan card khusus & tanpa liquid glass) */
  .realtime-monitor.is-fullscreen .fs-header,
  .dark .realtime-monitor.is-fullscreen .fs-header {
    padding: 0.25rem 0.1rem 0.55rem !important;
    margin-bottom: 0.55rem !important;
    border-radius: 0 !important;
    border: none !important;
    background: transparent !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    box-shadow: none !important;
    flex-shrink: 0 !important;
    flex-wrap: nowrap !important;
  }
  .realtime-monitor.is-fullscreen .fs-title,
  .realtime-monitor.is-fullscreen #liveSlotBadge,
  .realtime-monitor.is-fullscreen #liveClock,
  .realtime-monitor.is-fullscreen .fs-date,
  .realtime-monitor.is-fullscreen #liveInlineSummary .badge,
  .dark .realtime-monitor.is-fullscreen #liveSlotBadge,
  .dark .realtime-monitor.is-fullscreen #liveClock,
  .dark .realtime-monitor.is-fullscreen .fs-date,
  .dark .realtime-monitor.is-fullscreen #liveInlineSummary .badge {
    font-size: clamp(1rem, min(2.1vh, 1.4vw), 1.55rem) !important;
    line-height: 1.2 !important;
  }
  .realtime-monitor.is-fullscreen .fs-title {
    margin-top: 0 !important;
    white-space: nowrap !important;
  }
  .realtime-monitor.is-fullscreen .fs-header .badge:not(.tone-red),
  .dark .realtime-monitor.is-fullscreen .fs-header .badge:not(.tone-red) {
    background: rgba(255, 255, 255, 0.07) !important;
    color: rgba(226, 232, 240, 0.82) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
  }
  .realtime-monitor.is-fullscreen #liveSlotBadge,
  .realtime-monitor.is-fullscreen #liveClock,
  .realtime-monitor.is-fullscreen .fs-date,
  .dark .realtime-monitor.is-fullscreen #liveSlotBadge,
  .dark .realtime-monitor.is-fullscreen #liveClock,
  .dark .realtime-monitor.is-fullscreen .fs-date {
    font-weight: 600 !important;
  }
  .realtime-monitor.is-fullscreen #liveClock,
  .dark .realtime-monitor.is-fullscreen #liveClock {
    padding: 0.35rem 0.9rem !important;
    color: #f8fafc !important;
    background: rgba(255, 255, 255, 0.09) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
  }
  .realtime-monitor.is-fullscreen #liveSlotBadge,
  .dark .realtime-monitor.is-fullscreen #liveSlotBadge {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    color: rgba(226, 232, 240, 0.85) !important;
  }
  .realtime-monitor.is-fullscreen #liveClassGrid {
    flex: 1 1 0% !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: hidden !important;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    grid-template-rows: repeat(9, minmax(0, 1fr)) !important;
    gap: 0.65rem !important;
    padding-right: 0 !important;
  }

  /* Card Solid Non-Glass di Layar Penuh (tanpa efek liquid glass, dark mode) */
  .realtime-monitor.is-fullscreen .live-cls-card,
  .dark .realtime-monitor.is-fullscreen .live-cls-card {
    position: relative !important;
    padding: 0.45rem 0.55rem 0 !important;
    border-radius: 1rem !important;
    gap: 0.25rem !important;
    height: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
    background: #1c1c1e !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    border: 1px solid rgba(255, 255, 255, 0.045) !important;
    box-shadow: none !important;
  }
  .realtime-monitor.is-fullscreen .live-cls-card::before,
  .dark .realtime-monitor.is-fullscreen .live-cls-card::before {
    display: none !important;
  }
  .realtime-monitor.is-fullscreen .live-cls-body {
    background: transparent !important;
  }

  /* Sederhanakan info presensi dan jurnal di layar penuh (1 baris ringkas per kapsul) */
  .realtime-monitor.is-fullscreen .live-cls-sub {
    display: none !important;
  }
  .realtime-monitor.is-fullscreen .live-cls-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.3rem !important;
  }
  .realtime-monitor.is-fullscreen .live-meta-item,
  .dark .realtime-monitor.is-fullscreen .live-meta-item {
    border-radius: 9999px !important;
    padding: 0.22rem 0.5rem !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.07) !important;
    box-shadow: none !important;
  }

  .realtime-monitor.is-fullscreen .live-cls-name {
    font-size: 1.05rem !important;
    font-weight: 900 !important;
    letter-spacing: -0.03em !important;
    line-height: 1 !important;
    color: #f8fafc !important;
  }
  .realtime-monitor.is-fullscreen .live-cls-status,
  .dark .realtime-monitor.is-fullscreen .live-cls-status {
    background: rgba(255, 255, 255, 0.07) !important;
    color: rgba(226, 232, 240, 0.72) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
  }
  .realtime-monitor.is-fullscreen .live-cls-subject > span:first-child {
    display: none !important;
  }
  .realtime-monitor.is-fullscreen .live-cls-subject span {
    color: rgba(203, 213, 225, 0.65) !important;
  }
  .realtime-monitor.is-fullscreen .live-meta-label {
    color: rgba(148, 163, 184, 0.65) !important;
  }
  .realtime-monitor.is-fullscreen .live-meta-val {
    color: rgba(226, 232, 240, 0.78) !important;
  }
  @media (min-width: 960px), (min-aspect-ratio: 4/3) {
    .realtime-monitor.is-fullscreen #liveClassGrid {
      grid-template-columns: repeat(9, minmax(0, 1fr)) !important;
      grid-template-rows: repeat(3, minmax(0, 1fr)) !important;
      gap: 0.85rem !important;
    }
    .realtime-monitor.is-fullscreen .live-cls-card {
      padding: 0.5rem 0.55rem 0 !important;
      border-radius: 1.05rem !important;
      gap: 0.25rem !important;
    }
    .realtime-monitor.is-fullscreen .live-cls-name {
      font-size: clamp(1.5rem, min(4.5vh, 2.5vw), 3.4rem) !important;
      font-weight: 900 !important;
      letter-spacing: -0.04em !important;
      line-height: 1 !important;
    }
    .realtime-monitor.is-fullscreen .live-cls-status {
      font-size: clamp(0.5rem, min(1vh, 0.58vw), 0.72rem) !important;
      padding: 0.12rem 0.36rem !important;
    }
    .realtime-monitor.is-fullscreen .live-cls-name-wrap {
      margin-top: clamp(0.45rem, 1.2vh, 0.85rem) !important;
    }
    .realtime-monitor.is-fullscreen .live-cls-body {
      flex: 1 1 0% !important;
      flex-direction: column !important;
      align-items: center !important;
      justify-content: space-between !important;
      text-align: center !important;
      gap: clamp(0.2rem, 0.5vh, 0.45rem) !important;
      padding: 0 !important;
    }
    .realtime-monitor.is-fullscreen .live-cls-avatar {
      width: calc(100% - 1rem) !important;
      max-width: 100% !important;
      height: auto !important;
      max-height: 100% !important;
      flex: 1 1 0% !important;
      min-height: 0 !important;
      object-fit: contain !important;
      object-position: bottom center !important;
      border: none !important;
      border-radius: 0 !important;
    }
    .realtime-monitor.is-fullscreen .live-cls-info {
      display: flex !important;
      flex-direction: column !important;
      align-items: center !important;
      justify-content: center !important;
      width: 100% !important;
      flex: 0 1 auto !important;
    }
    .realtime-monitor.is-fullscreen .live-cls-teacher {
      font-size: clamp(0.7rem, min(1.5vh, 0.92vw), 1.1rem) !important;
      line-height: 1.16 !important;
      font-weight: 800 !important;
      width: 100% !important;
    }
    .realtime-monitor.is-fullscreen .live-cls-subject {
      justify-content: center !important;
      width: 100% !important;
      margin-top: 0.2vh !important;
    }
    .realtime-monitor.is-fullscreen .live-cls-meta {
      grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
      gap: 0.22rem !important;
    }
    .realtime-monitor.is-fullscreen .live-meta-item {
      padding: 0.24vh 0.32rem !important;
      overflow: hidden !important;
    }
    .realtime-monitor.is-fullscreen .live-meta-label {
      font-size: clamp(0.38rem, min(0.72vh, 0.44vw), 0.54rem) !important;
      letter-spacing: 0 !important;
      min-width: 0 !important;
      overflow: hidden !important;
      text-overflow: ellipsis !important;
    }
    .realtime-monitor.is-fullscreen .live-meta-val {
      font-size: clamp(0.46rem, min(0.88vh, 0.54vw), 0.66rem) !important;
      flex-shrink: 0 !important;
    }
  }
  @media (max-width: 959px) and (max-aspect-ratio: 4/3), (max-height: 660px) {
    .realtime-monitor.is-fullscreen .live-cls-body {
      padding: 0.15rem 0.35rem !important;
      gap: 0.35rem !important;
    }
    .realtime-monitor.is-fullscreen .live-cls-avatar {
      width: 1.75rem !important;
      height: 1.75rem !important;
    }
    .realtime-monitor.is-fullscreen .live-cls-meta {
      padding-top: 0.15rem !important;
    }
  }

  /* ---------- Liquid Glass Dropdown Menu (Topbar Avatar) ---------- */
  .glass-menu {
    background: linear-gradient(145deg, rgba(255,255,255,.78), rgba(255,255,255,.55));
    -webkit-backdrop-filter: blur(36px) saturate(200%);
    backdrop-filter: blur(36px) saturate(200%);
    border: 1px solid rgba(255,255,255,.72);
    box-shadow:
      inset 0 1px 1px rgba(255,255,255,.92),
      inset 0 -1px 1px rgba(255,255,255,.32),
      0 18px 44px -10px rgba(15,23,42,.22),
      0 4px 12px -2px rgba(15,23,42,.06);
    transform-origin: calc(100% - 27px) 27px;
    opacity: 0;
    transform: scale(.55) translate3d(4px, -4px, 0);
    pointer-events: none;
    will-change: transform, opacity;
    transition: opacity .22s cubic-bezier(.32,.72,0,1), transform .26s cubic-bezier(.32,.72,0,1);
  }
  .glass-menu.is-open {
    opacity: 1;
    transform: scale(1) translate3d(0, 0, 0);
    pointer-events: auto;
    transition: opacity .24s cubic-bezier(.22,1,.36,1), transform .34s cubic-bezier(.22,1.12,.36,1);
  }
  .glass-menu::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(255,255,255,.95), rgba(255,255,255,.22) 32%, rgba(255,255,255,.04) 52%, rgba(255,255,255,.24) 72%, rgba(255,255,255,.82));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
  }
  .dark .glass-menu {
    background: linear-gradient(145deg, rgba(44,44,46,.84), rgba(26,26,28,.78));
    border-color: rgba(255,255,255,.08);
    box-shadow:
      inset 0 1px .5px rgba(255,255,255,.12),
      inset 0 -1px .5px rgba(255,255,255,.03),
      0 22px 52px -12px rgba(0,0,0,.78);
  }
  .dark .glass-menu::before {
    background: linear-gradient(135deg, rgba(255,255,255,.16), rgba(255,255,255,.04) 32%, rgba(255,255,255,.01) 52%, rgba(255,255,255,.04) 72%, rgba(255,255,255,.10));
  }
  .glass-menu-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    width: 100%;
    padding: .6rem .9rem;
    border-radius: 9999px;
    font-size: .875rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: background-color .18s ease, box-shadow .18s ease, transform .25s cubic-bezier(.34,1.56,.64,1);
  }
  .glass-menu-item:hover {
    background: rgba(15,23,42,.075);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 0 0 .5px rgba(15,23,42,.04);
  }
  .dark .glass-menu-item:hover {
    background: rgba(255,255,255,.14);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.16);
  }
  .glass-menu-item:active { transform: scale(.97); }
  .reduce-motion .glass-menu { animation: none; }

  /* Scrollbar halus */
  .nice-scroll::-webkit-scrollbar { width: 8px; height: 8px; }
  .nice-scroll::-webkit-scrollbar-thumb { background: rgba(120,120,128,.35); border-radius: 9999px; }
  .nice-scroll::-webkit-scrollbar-track { background: transparent; }
  /* Autohide scrollbar pada menu popup (modal) di laptop/desktop agar seperti layar sentuh */
  .modal-body.nice-scroll {
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
  }
  .modal-body.nice-scroll.is-scrolling {
    scrollbar-color: rgba(120, 120, 128, .42) transparent;
  }
  .dark .modal-body.nice-scroll.is-scrolling {
    scrollbar-color: rgba(200, 200, 210, .38) transparent;
  }
  .modal-body.nice-scroll::-webkit-scrollbar { width: 6px; height: 6px; }
  .modal-body.nice-scroll::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 9999px;
  }
  .modal-body.nice-scroll.is-scrolling::-webkit-scrollbar-thumb,
  .modal-body.nice-scroll::-webkit-scrollbar-thumb:hover,
  .modal-body.nice-scroll::-webkit-scrollbar-thumb:active {
    background: rgba(120, 120, 128, .42);
  }
  .dark .modal-body.nice-scroll.is-scrolling::-webkit-scrollbar-thumb,
  .dark .modal-body.nice-scroll::-webkit-scrollbar-thumb:hover,
  .dark .modal-body.nice-scroll::-webkit-scrollbar-thumb:active {
    background: rgba(200, 200, 210, .38);
  }
  .no-scrollbar { scrollbar-width: none; }
  .no-scrollbar::-webkit-scrollbar { display: none; }
  /* Cegah scrollbar vertikal sementara pada kontainer tabel/kartu di Chrome/Windows:
     sesuai spek CSS, overflow-x: hidden/auto tanpa overflow-y otomatis menghitung overflow-y menjadi auto */
  .overflow-x-auto:not(.overflow-y-auto),
  .overflow-x-hidden:not(.overflow-y-auto),
  [class*="overflow-x-auto"]:not([class*="overflow-y-auto"]),
  [class*="overflow-x-hidden"]:not([class*="overflow-y-auto"]) {
    overflow-y: hidden;
  }

  /* Efek bling-bling poin Aura */
  .aura-bling-wrap { position: relative; display: inline-flex; align-items: center; padding-right: 18px; }
  .aura-bling {
    background: linear-gradient(110deg, #ff3b30 0%, #ff9500 28%, #fff3b0 48%, #ff3b30 68%, #ff6b6b 100%);
    background-size: 220% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 0 8px rgba(255, 59, 48, 0.35));
    animation: auraShimmer 2.4s linear infinite;
  }
  .aura-spark {
    position: absolute;
    pointer-events: none;
    color: #ff9500;
    text-shadow: 0 0 6px rgba(255, 149, 0, 0.8), 0 0 10px rgba(255, 59, 48, 0.6);
    line-height: 1;
    animation: auraSparkle 1.8s ease-in-out infinite;
  }
  .aura-spark-1 { top: -4px; right: 2px; font-size: 12px; animation-delay: 0s; }
  .aura-spark-2 { bottom: 0px; right: -2px; font-size: 9px; color: #ff3b30; animation-delay: .6s; }
  .aura-spark-3 { top: 4px; right: -8px; font-size: 10px; color: #ffcc00; animation-delay: 1.15s; }
  @keyframes auraShimmer {
    0% { background-position: 200% center; }
    100% { background-position: -20% center; }
  }
  @keyframes auraSparkle {
    0%, 100% { opacity: .25; transform: scale(.65) rotate(0deg); }
    50% { opacity: 1; transform: scale(1.25) rotate(20deg); }
  }
  /* Efek blink-blink medali Juara 1 */
  .medal-wrap { position: relative; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
  .medal-disc { position: relative; overflow: hidden; }
  .medal-gold-bling::after {
    content: "";
    position: absolute;
    inset: -20%;
    background: linear-gradient(115deg, transparent 32%, rgba(255,255,255,.78) 49%, transparent 66%);
    transform: translateX(-120%);
    animation: medalSweep 2.6s ease-in-out infinite;
    pointer-events: none;
  }
  .medal-spark {
    position: absolute;
    pointer-events: none;
    color: #facc15;
    text-shadow: 0 0 6px rgba(250, 204, 21, .9), 0 0 10px rgba(234, 179, 8, .7);
    line-height: 1;
    z-index: 20;
    animation: auraSparkle 1.7s ease-in-out infinite;
  }
  .medal-spark-1 { top: -3px; right: -4px; font-size: 11px; animation-delay: 0s; }
  .medal-spark-2 { bottom: -2px; left: -3px; font-size: 9px; color: #fef08a; animation-delay: .55s; }
  .medal-spark-3 { top: 8px; left: -6px; font-size: 10px; color: #f59e0b; animation-delay: 1.1s; }
  @keyframes medalSweep {
    0%, 35% { transform: translateX(-120%); }
    75%, 100% { transform: translateX(120%); }
  }

  /* Background animasi khusus halaman Leaderboard Aura */
  .lb-bg-anim {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
  }
  .lb-blob {
    position: absolute;
    border-radius: 9999px;
    filter: blur(85px);
    opacity: .48;
    will-change: transform;
  }
  .dark .lb-blob { opacity: .34; }
  .lb-blob-1 {
    width: 44vw; height: 44vw; min-width: 320px; min-height: 320px;
    top: -10%; left: -6%;
    background: radial-gradient(circle, rgba(255, 204, 0, .6), rgba(255, 149, 0, .18) 70%, transparent);
    animation: lbFloat1 16s ease-in-out infinite alternate;
  }
  .lb-blob-2 {
    width: 42vw; height: 42vw; min-width: 300px; min-height: 300px;
    bottom: -12%; right: -6%;
    background: radial-gradient(circle, rgba(255, 59, 48, .5), rgba(255, 149, 0, .16) 70%, transparent);
    animation: lbFloat2 19s ease-in-out infinite alternate;
  }
  .lb-blob-3 {
    width: 34vw; height: 34vw; min-width: 260px; min-height: 260px;
    top: 32%; right: 20%;
    background: radial-gradient(circle, rgba(250, 204, 21, .45), rgba(175, 82, 222, .2) 70%, transparent);
    animation: lbFloat3 22s ease-in-out infinite alternate;
  }
  .lb-particle {
    position: absolute;
    color: #ffb300;
    text-shadow: 0 0 10px rgba(255, 179, 0, .75), 0 0 18px rgba(255, 59, 48, .45);
    opacity: .15;
    will-change: transform, opacity;
    animation: lbTwinkle ease-in-out infinite;
  }
  .lb-particle-rise {
    position: absolute;
    bottom: -28px;
    color: #ffb300;
    text-shadow: 0 0 12px rgba(255, 179, 0, .85), 0 0 22px rgba(255, 59, 48, .55);
    opacity: 0;
    will-change: transform, opacity;
    animation: lbRise linear infinite;
  }
  @keyframes lbFloat1 {
    0% { transform: translate3d(0, 0, 0) scale(1); }
    100% { transform: translate3d(12vw, 10vh, 0) scale(1.16); }
  }
  @keyframes lbFloat2 {
    0% { transform: translate3d(0, 0, 0) scale(1); }
    100% { transform: translate3d(-14vw, -10vh, 0) scale(1.18); }
  }
  @keyframes lbFloat3 {
    0% { transform: translate3d(0, 0, 0) scale(.95); }
    100% { transform: translate3d(-10vw, 12vh, 0) scale(1.12); }
  }
  @keyframes lbTwinkle {
    0%, 100% { opacity: .12; transform: scale(.65) rotate(0deg); }
    50% { opacity: .92; transform: scale(1.22) rotate(18deg); }
  }
  @keyframes lbRise {
    0% { transform: translate3d(0, 0, 0) scale(.75) rotate(0deg); opacity: 0; }
    12% { opacity: .88; }
    85% { opacity: .78; }
    100% { transform: translate3d(0, -110vh, 0) scale(1.18) rotate(28deg); opacity: 0; }
  }

  /* Tema kosmik biru-cyan khusus halaman login agar menyatu dengan logo SpenlaVerse */
  .login-cosmic-bg .lb-blob-1 {
    background: radial-gradient(circle, rgba(37, 99, 235, .44), rgba(56, 189, 248, .22) 65%, transparent);
  }
  .login-cosmic-bg .lb-blob-2 {
    background: radial-gradient(circle, rgba(34, 211, 238, .44), rgba(14, 165, 233, .2) 65%, transparent);
  }
  .login-cosmic-bg .lb-blob-3 {
    background: radial-gradient(circle, rgba(99, 102, 241, .36), rgba(37, 99, 235, .18) 65%, transparent);
  }
  .dark .login-cosmic-bg .lb-blob { opacity: .4; }
  .login-cosmic-bg .lb-particle {
    color: #0ea5e9;
    text-shadow: 0 0 10px rgba(34, 211, 238, .85), 0 0 20px rgba(37, 99, 235, .45);
  }
  .dark .login-cosmic-bg .lb-particle {
    color: #67e8f9;
    text-shadow: 0 0 12px rgba(103, 232, 249, .95), 0 0 24px rgba(37, 99, 235, .65);
  }

  /* Cover hero full-width di Beranda Guru dengan background kosmik beranimasi */
  body.has-hero-cover main { overflow-x: clip; }
  .guru-hero-cover {
    position: relative;
    margin-top: -88px;
    padding-top: 84px;
    padding-bottom: 1.75rem;
  }
  @media (min-width: 640px) {
    .guru-hero-cover {
      margin-top: -92px;
      padding-top: 88px;
      padding-bottom: 2rem;
    }
  }
  @media (min-width: 1024px) {
    .guru-hero-cover {
      padding-top: 5.5rem;
      padding-bottom: 2.25rem;
    }
  }
  .guru-hero-cover-bg {
    position: absolute;
    top: 0;
    bottom: 0;
    left: calc(50% - 50vw);
    width: 100vw;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
  }
  .guru-hero-cover::after {
    content: "";
    position: absolute;
    left: calc(50% - 50vw);
    width: 100vw;
    bottom: 0;
    height: 1px;
    z-index: 1;
    pointer-events: none;
    background: rgba(0,0,0,.06);
    box-shadow:
      0 -1px 1px rgba(255,255,255,.75),
      0 8px 32px -10px rgba(15,23,42,.18);
  }
  .dark .guru-hero-cover::after {
    background: linear-gradient(90deg, rgba(255,255,255,.04), rgba(255,255,255,.10) 30%, rgba(255,255,255,.06) 60%, rgba(255,255,255,.09));
    box-shadow: 0 12px 36px -8px rgba(0,0,0,.85);
  }
  @media (min-width: 1024px) {
    .guru-hero-cover-bg,
    .guru-hero-cover::after { left: calc(50% - 50vw - 144px); }
  }
  .guru-hero-cover-bg .lb-blob-1 { width: 38vw; height: 38vw; min-width: 260px; min-height: 260px; top: -35%; left: -4%; }
  .guru-hero-cover-bg .lb-blob-2 { width: 36vw; height: 36vw; min-width: 240px; min-height: 240px; bottom: -30%; right: 4%; }
  .guru-hero-cover-bg .lb-blob-3 { width: 30vw; height: 30vw; min-width: 220px; min-height: 220px; top: -15%; right: 26%; }

  /* Warna card podium Leaderboard (Emas, Perak, Perunggu) dengan efek Liquid Glass */
  .liquid.lb-card-gold {
    background: linear-gradient(135deg, rgba(254, 240, 138, .74), rgba(250, 204, 21, .44) 55%, rgba(234, 179, 8, .36));
    border-color: rgba(234, 179, 8, .55);
    box-shadow: 0 12px 30px -10px rgba(234, 179, 8, .35), inset 0 1px 1px rgba(255, 255, 255, .85), inset 0 -1px 1px rgba(255, 255, 255, .35);
  }
  .dark .liquid.lb-card-gold {
    background: linear-gradient(135deg, rgba(234, 179, 8, .32), rgba(202, 138, 4, .18) 60%, rgba(161, 98, 7, .22));
    border-color: rgba(250, 204, 21, .45);
  }
  .liquid.lb-card-silver {
    background: linear-gradient(135deg, rgba(241, 245, 249, .84), rgba(203, 213, 225, .60) 55%, rgba(148, 163, 184, .44));
    border-color: rgba(148, 163, 184, .6);
    box-shadow: 0 10px 26px -10px rgba(100, 116, 139, .3), inset 0 1px 1px rgba(255, 255, 255, .9), inset 0 -1px 1px rgba(255, 255, 255, .35);
  }
  .dark .liquid.lb-card-silver {
    background: linear-gradient(135deg, rgba(148, 163, 184, .28), rgba(100, 116, 139, .18) 60%, rgba(71, 85, 105, .22));
    border-color: rgba(203, 213, 225, .4);
  }
  .liquid.lb-card-bronze {
    background: linear-gradient(135deg, rgba(254, 215, 170, .74), rgba(251, 146, 60, .42) 55%, rgba(180, 83, 9, .34));
    border-color: rgba(217, 119, 6, .52);
    box-shadow: 0 10px 26px -10px rgba(180, 83, 9, .32), inset 0 1px 1px rgba(255, 247, 237, .8), inset 0 -1px 1px rgba(255, 247, 237, .3);
  }
  .dark .liquid.lb-card-bronze {
    background: linear-gradient(135deg, rgba(217, 119, 6, .30), rgba(180, 83, 9, .18) 60%, rgba(146, 64, 14, .22));
    border-color: rgba(251, 146, 60, .42);
  }

  /* ---------- Paginasi responsif ---------- */
  .pager-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .65rem 1rem;
  }
  .pager-bar .pager-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .375rem;
  }
  .pager-bar.is-wrapped {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
  }
  .pager-bar.is-wrapped .pager-nav {
    justify-content: center;
  }

  /* ---------- Tombol tipis Load More (Lazy Scroll) ---------- */
  .lazy-more-btn {
    width: 100%;
    height: 2.15rem;
    padding: 0 1rem;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    font-size: .78rem;
    font-weight: 600;
    line-height: 1;
    color: #121214;
    background: rgba(252, 252, 254, .95);
    border: 1px solid rgba(0, 0, 0, .085);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .03);
    cursor: pointer;
    user-select: none;
    transition: transform .18s cubic-bezier(.22,1,.36,1), background .2s ease, border-color .2s ease, color .2s ease;
  }
  .lazy-more-btn:hover {
    color: #000000;
    background: #ffffff;
    border-color: rgba(0, 0, 0, .13);
  }
  .lazy-more-btn:active { transform: scale(.985); }
  .dark .lazy-more-btn {
    color: #f5f5f7;
    background: rgba(37, 37, 40, .94);
    border-color: rgba(255, 255, 255, .12);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .38);
  }
  .dark .lazy-more-btn:hover {
    color: #fff;
    background: rgba(46, 46, 50, .96);
    border-color: rgba(255, 255, 255, .18);
  }

  /* ---------- List multi-kolom urut vertikal (atas ke bawah) ---------- */
  .col-flow-3, .col-flow-4 {
    column-count: 1;
    column-gap: 0.625rem;
  }
  @media (min-width: 640px) {
    .col-flow-3, .col-flow-4 { column-count: 2; }
  }
  @media (min-width: 1280px) {
    .col-flow-3 { column-count: 3; }
    .col-flow-4 { column-count: 4; }
  }
  .col-flow-3 > *, .col-flow-4 > * {
    break-inside: avoid;
    margin-bottom: 0.625rem;
    width: 100%;
  }

  /* ---------- Time range single-pill ---------- */
  .time-range-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.65rem;
    border-radius: 9999px;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.10);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: border-color .18s, box-shadow .18s, background-color .18s;
  }
  .time-range-pill:focus-within {
    border-color: rgba(var(--accent-rgb, 37, 99, 235), 0.55);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb, 37, 99, 235), 0.14);
  }
  .dark .time-range-pill {
    background: #2c2c2e;
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  }
  .time-range-pill input[type="time"] {
    appearance: none;
    -webkit-appearance: none;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    outline: none !important;
    padding: 0.2rem 0.15rem !important;
    min-height: 1.75rem !important;
    height: auto !important;
    width: auto !important;
    font-size: 0.75rem !important;
    line-height: 1.2 !important;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    color: inherit;
    min-width: 0;
  }
  .time-range-pill input[type="time"]::-webkit-date-and-time-value {
    text-align: center;
  }

  /* ---------- Cetak ---------- */
  @media print {
    .wallpaper, #sidebar, #tabbar, #topbar, .no-print { display: none !important; }
    main { padding: 0 !important; }
    .glass, .glass-strong { background: #fff !important; box-shadow: none !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; border: 1px solid #ddd; }
    .glass::before { display: none; }
    body { color: #000 !important; }
  }
  .pie-slice { stroke: rgba(255, 255, 255, .85); }
  .dark .pie-slice { stroke: #1c1c1e; }

  @media (prefers-reduced-motion: reduce) {
    .blob, .anim-in, .lazy-item-in { animation: none; will-change: auto; }
  }
}

@layer utilities {
  /* Safe-area iPhone notch / Dynamic Island untuk mode standalone (Add to Home Screen) */
  #topbar,
  #viewWrap {
    padding-left: calc(1.25rem + env(safe-area-inset-left, 0px)) !important;
    padding-right: calc(1.25rem + env(safe-area-inset-right, 0px)) !important;
  }
  #topbar {
    padding-top: calc(0.75rem + env(safe-area-inset-top, 0px)) !important;
  }
  #loginMain {
    padding-left: calc(1rem + env(safe-area-inset-left, 0px)) !important;
    padding-right: calc(1rem + env(safe-area-inset-right, 0px)) !important;
    padding-top: calc(1rem + env(safe-area-inset-top, 0px)) !important;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px)) !important;
  }
  @media (min-width: 640px) {
    #topbar,
    #viewWrap {
      padding-left: calc(1.5rem + env(safe-area-inset-left, 0px)) !important;
      padding-right: calc(1.5rem + env(safe-area-inset-right, 0px)) !important;
    }
    #topbar {
      padding-top: calc(1rem + env(safe-area-inset-top, 0px)) !important;
    }
    #loginMain {
      padding-left: calc(2rem + env(safe-area-inset-left, 0px)) !important;
      padding-right: calc(2rem + env(safe-area-inset-right, 0px)) !important;
      padding-top: calc(2rem + env(safe-area-inset-top, 0px)) !important;
      padding-bottom: calc(2rem + env(safe-area-inset-bottom, 0px)) !important;
    }
    .modal-root {
      padding-left: calc(1.5rem + env(safe-area-inset-left, 0px)) !important;
      padding-right: calc(1.5rem + env(safe-area-inset-right, 0px)) !important;
    }
  }
  @media (min-width: 1024px) {
    #topbar,
    #viewWrap {
      padding-left: calc(2rem + env(safe-area-inset-left, 0px)) !important;
      padding-right: calc(2rem + env(safe-area-inset-right, 0px)) !important;
    }
  }
  #tabbar:not(.tabbar-fit) {
    width: calc(100% - 40px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)) !important;
    max-width: 28rem !important;
  }
  #tabbar.tabbar-fit {
    max-width: calc(100% - 40px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)) !important;
  }
}
