/* ==========================================================
   Galeri Dian v2 - Tampilan premium 3D
   Palet: malam biru pekat, kaca berlapis, cahaya ungu-sian
   ========================================================== */
:root {
  --bg: #0a0f24;
  --bg-2: #111838;
  --ink: #eef1ff;
  --muted: #9aa3c7;
  --faint: #6b739a;
  --line: rgba(255, 255, 255, .1);
  --line-2: rgba(255, 255, 255, .16);
  --glass: rgba(255, 255, 255, .055);
  --violet: #9d8cff;
  --cyan: #46d3ff;
  --rose: #ff7ab6;
  --ok: #3ddc97;
  --warn: #ffc56b;
  --danger: #ff6b7d;
  --grad: linear-gradient(135deg, #a592ff 0%, #6f8dff 45%, #46d3ff 100%);
  --r-sm: 10px;
  --r: 16px;
  --r-lg: 22px;
  --depth: 0 1px 0 rgba(255, 255, 255, .14) inset, 0 -1px 0 rgba(0, 0, 0, .35) inset,
           0 2px 4px rgba(0, 0, 0, .25), 0 18px 40px -18px rgba(0, 0, 0, .75);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --side: 268px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh;
  font-family: var(--font); font-size: 15px; line-height: 1.55;
  color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
a { color: inherit; }
img { max-width: 100%; }
.ic { flex: none; display: block; }
.muted { color: var(--faint); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------- Latar 3D: cahaya aurora + lantai perspektif ---------- */
.scene { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
  background: radial-gradient(120% 80% at 50% -10%, #1a2352 0%, var(--bg) 55%); }
.aurora { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .5; }
.a1 { width: 46vw; height: 46vw; left: -12vw; top: -14vw; background: #6b4dff; animation: drift 26s ease-in-out infinite alternate; }
.a2 { width: 38vw; height: 38vw; right: -10vw; top: 10vh; background: #1aa9e6; opacity: .35; animation: drift 32s ease-in-out infinite alternate-reverse; }
.a3 { width: 30vw; height: 30vw; left: 35vw; bottom: -18vw; background: #d84aa0; opacity: .22; animation: drift 38s ease-in-out infinite alternate; }
@keyframes drift { to { transform: translate3d(6vw, 4vh, 0) scale(1.12); } }
.floor {
  position: absolute; left: -50%; right: -50%; bottom: -10vh; height: 60vh;
  background-image:
    linear-gradient(rgba(157, 140, 255, .18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(70, 211, 255, .14) 1px, transparent 1px);
  background-size: 64px 64px;
  transform: perspective(700px) rotateX(64deg);
  transform-origin: bottom center;
  -webkit-mask-image: linear-gradient(to top, rgba(0, 0, 0, .7), transparent 75%);
  mask-image: linear-gradient(to top, rgba(0, 0, 0, .7), transparent 75%);
}

/* ---------- Permukaan kaca berlapis ---------- */
.slab {
  position: relative;
  background: linear-gradient(155deg, rgba(255, 255, 255, .09) 0%, rgba(255, 255, 255, .03) 55%, rgba(255, 255, 255, .02) 100%);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--depth);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  backdrop-filter: blur(18px) saturate(1.3);
}

/* Efek miring 3D mengikuti kursor (diatur oleh core.js) */
[data-tilt] { transform-style: preserve-3d; transition: transform .5s cubic-bezier(.2, .8, .2, 1); will-change: transform; }
[data-tilt].tilting { transition: transform .08s linear; }
.glare {
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 5;
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 0%), rgba(255, 255, 255, .22), transparent 55%);
  opacity: 0; transition: opacity .3s;
}
.tilting > .glare { opacity: 1; }

/* ---------- Logo: tiga lembar foto bertumpuk dalam 3D ---------- */
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-name { font-weight: 800; font-size: 18px; letter-spacing: -.02em; }
.logo3d { position: relative; width: 30px; height: 30px; transform-style: preserve-3d; transform: rotateX(55deg) rotateZ(-45deg); flex: none; }
.logo3d i { position: absolute; inset: 0; border-radius: 7px; }
.logo3d i:nth-child(1) { background: #3b2f8f; transform: translateZ(0); box-shadow: 0 6px 10px rgba(0, 0, 0, .5); }
.logo3d i:nth-child(2) { background: #7a6bff; transform: translateZ(7px); opacity: .9; }
.logo3d i:nth-child(3) { background: var(--grad); transform: translateZ(14px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5); }
.brand:hover .logo3d i:nth-child(2) { transform: translateZ(10px); }
.brand:hover .logo3d i:nth-child(3) { transform: translateZ(20px); }
.logo3d i { transition: transform .35s ease; }
.logo3d.lg { width: 40px; height: 40px; }
.brand-lg .brand-name { font-size: 24px; }

/* ---------- Tombol ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 13px; border: 0; cursor: pointer;
  font-weight: 700; font-size: 14px; text-decoration: none; white-space: nowrap;
  transition: transform .15s ease, box-shadow .15s ease, filter .15s;
}
.btn:active { transform: translateY(2px); }
.btn.sm { min-height: 38px; padding: 0 13px; font-size: 13px; border-radius: 11px; }
.btn.btn-lg { min-height: 52px; font-size: 15px; border-radius: 15px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

/* tombol utama: timbul dengan sisi bawah tebal */
.btn-3d {
  color: #fff; background: var(--grad);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .45) inset, 0 -2px 0 rgba(0, 0, 0, .18) inset,
              0 4px 0 #3f3aa6, 0 10px 24px -6px rgba(100, 110, 255, .65);
  text-shadow: 0 1px 1px rgba(0, 0, 0, .25);
}
.btn-3d:hover { filter: brightness(1.08); }
.btn-3d:active { box-shadow: 0 1px 0 rgba(255, 255, 255, .45) inset, 0 2px 0 #3f3aa6, 0 6px 14px -6px rgba(100, 110, 255, .6); }

.btn-glass {
  background: linear-gradient(180deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .05));
  border: 1px solid var(--line-2);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .15) inset, 0 3px 0 rgba(0, 0, 0, .35), 0 8px 18px -8px rgba(0, 0, 0, .6);
}
.btn-glass:hover { background: linear-gradient(180deg, rgba(255, 255, 255, .17), rgba(255, 255, 255, .07)); }
.btn-glass:active { box-shadow: 0 1px 0 rgba(255, 255, 255, .15) inset, 0 1px 0 rgba(0, 0, 0, .35); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: rgba(255, 255, 255, .07); color: var(--ink); }
.btn-danger {
  color: #fff; background: linear-gradient(135deg, #ff8a8a, #ff4f79);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .4) inset, 0 4px 0 #a3264a, 0 10px 22px -8px rgba(255, 80, 120, .6);
}
.btn-danger:active { box-shadow: 0 1px 0 rgba(255, 255, 255, .4) inset, 0 2px 0 #a3264a; }

.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none;
  border: 0; border-radius: 12px; background: transparent; color: var(--muted); cursor: pointer; text-decoration: none;
}
.icon-btn:hover { background: rgba(255, 255, 255, .08); color: var(--ink); }
.icon-btn.sm { width: 32px; height: 32px; border-radius: 9px; }

/* ---------- Avatar bola 3D ---------- */
.avatar {
  display: inline-grid; place-items: center; flex: none;
  width: 40px; height: 40px; border-radius: 50%;
  font-weight: 800; font-size: 14px; color: #fff; letter-spacing: .02em;
  background: radial-gradient(circle at 32% 28%, hsl(var(--h) 90% 78%), hsl(var(--h) 70% 52%) 45%, hsl(var(--h) 65% 28%) 100%);
  box-shadow: inset 0 -3px 6px rgba(0, 0, 0, .3), 0 6px 14px -4px hsla(var(--h), 80%, 50%, .6);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
}
.avatar.sm { width: 34px; height: 34px; font-size: 12px; }
.avatar.lg { width: 50px; height: 50px; font-size: 17px; }
.avatar.xl { width: 96px; height: 96px; font-size: 32px; }

/* ==========================================================
   Kerangka aplikasi
   ========================================================== */
.sidebar {
  position: fixed; left: 16px; top: 16px; bottom: 16px; width: calc(var(--side) - 32px); z-index: 30;
  display: flex; flex-direction: column; gap: 22px; padding: 22px 16px 16px;
  background: linear-gradient(170deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .025));
  border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--depth);
  -webkit-backdrop-filter: blur(22px); backdrop-filter: blur(22px);
}
.sidebar > .brand { padding: 0 8px; }
.side-nav { display: grid; gap: 4px; }
.side-nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 13px;
  text-decoration: none; font-weight: 600; color: var(--muted); transition: background .2s, color .2s, transform .2s;
}
.side-nav a:hover { background: rgba(255, 255, 255, .06); color: var(--ink); }
.nav-ic { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: rgba(255, 255, 255, .05); }
.side-nav a.active {
  color: var(--ink);
  background: linear-gradient(135deg, rgba(157, 140, 255, .24), rgba(70, 211, 255, .1));
  box-shadow: 0 1px 0 rgba(255, 255, 255, .14) inset, 0 8px 18px -10px rgba(120, 110, 255, .8);
  transform: translateX(3px);
}
.side-nav a.active .nav-ic { background: var(--grad); color: #fff; box-shadow: 0 3px 0 #3f3aa6, 0 6px 12px -4px rgba(100, 110, 255, .7); }

.storage { padding: 14px; margin-top: auto; }
.storage-top { display: flex; align-items: center; gap: 10px; }
.storage-top strong { display: block; font-size: 17px; letter-spacing: -.01em; }
.storage-top small { display: block; font-size: 11.5px; color: var(--muted); line-height: 1.3; }
.storage-ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: rgba(70, 211, 255, .14); color: var(--cyan); }
.storage-bar { display: flex; height: 9px; margin: 14px 0 10px; border-radius: 99px; overflow: hidden; background: rgba(0, 0, 0, .35); box-shadow: inset 0 1px 3px rgba(0, 0, 0, .5); }
.storage-bar span { height: 100%; }
.sb-foto { background: linear-gradient(90deg, #8f7dff, #a592ff); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45); }
.sb-video { background: linear-gradient(90deg, #36b8f0, #46d3ff); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45); }
.storage-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; font-size: 12.5px; color: var(--muted); }
.storage-legend li { display: flex; align-items: center; gap: 8px; }
.storage-legend i { width: 8px; height: 8px; border-radius: 3px; }
.lg-foto { background: var(--violet); } .lg-video { background: var(--cyan); } .lg-folder { background: var(--faint); }

.me { display: flex; align-items: center; gap: 10px; padding: 10px 6px 0; border-top: 1px solid var(--line); }
.me-text { flex: 1; min-width: 0; line-height: 1.3; }
.me-text strong { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-text small { color: var(--muted); font-size: 12px; }

.main { margin-left: var(--side); padding: 30px 32px 60px; max-width: calc(1320px + var(--side)); }

.mtop, .mnav { display: none; }

@media (max-width: 1023px) {
  .sidebar { display: none; }
  .main { margin-left: 0; padding: 18px 16px calc(96px + env(safe-area-inset-bottom, 0px)); }
  .mtop {
    position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between;
    padding: 10px 14px; padding-top: calc(10px + env(safe-area-inset-top, 0px));
    background: rgba(10, 15, 36, .72); border-bottom: 1px solid var(--line);
    -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  }
  .mtop-right { display: flex; align-items: center; gap: 4px; }
  .mtop-right a { display: grid; }
  .mnav {
    position: fixed; z-index: 40; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    display: flex; justify-content: space-around; padding: 6px;
    background: linear-gradient(180deg, rgba(40, 48, 90, .82), rgba(20, 26, 56, .9));
    border: 1px solid var(--line-2); border-radius: 22px; box-shadow: var(--depth);
    -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  }
  .mnav a { flex: 1; display: grid; justify-items: center; gap: 2px; padding: 7px 4px; border-radius: 16px; text-decoration: none; font-size: 11px; font-weight: 700; color: var(--muted); }
  .mnav a.active { color: #fff; background: linear-gradient(135deg, rgba(157, 140, 255, .35), rgba(70, 211, 255, .18)); box-shadow: 0 1px 0 rgba(255, 255, 255, .18) inset; }
}

/* ---------- Kepala halaman ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.ph-text { min-width: 0; }
h1 {
  margin: 0; font-size: clamp(28px, 4.2vw, 44px); line-height: 1.08; font-weight: 800; letter-spacing: -.035em; word-break: break-word;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .35), 0 12px 30px rgba(90, 80, 255, .35);
}
.sub { margin: 6px 0 0; color: var(--muted); font-size: 14.5px; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.crumbs a { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; padding: 3px 8px; border-radius: 8px; }
.crumbs a:hover { background: rgba(255, 255, 255, .07); color: var(--ink); }
.crumbs .sep { opacity: .5; }
.crumbs [aria-current] { color: var(--ink); font-weight: 700; padding: 3px 8px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.actions.center { justify-content: center; }

/* ---------- Bilah alat ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px; margin-bottom: 26px; border-radius: 18px; }
.search {
  position: relative; flex: 1 1 260px; display: flex; align-items: center; gap: 8px;
  min-height: 42px; padding: 0 12px; border-radius: 12px; color: var(--muted);
  background: rgba(0, 0, 0, .28); box-shadow: inset 0 2px 4px rgba(0, 0, 0, .45), 0 1px 0 rgba(255, 255, 255, .06);
}
.search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; color: var(--ink); font-size: 14px; }
.search input::placeholder { color: var(--faint); }
.search.sm { min-height: 40px; margin-bottom: 12px; }
.search-clear { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; color: var(--muted); }
.search-clear:hover { background: rgba(255, 255, 255, .1); color: var(--ink); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 13px; border-radius: 10px;
  border: 0; background: transparent; color: var(--muted); font-size: 13px; font-weight: 700; text-decoration: none; cursor: pointer;
}
.chip:hover { color: var(--ink); background: rgba(255, 255, 255, .06); }
.chip.active {
  color: #fff; background: linear-gradient(180deg, rgba(157, 140, 255, .42), rgba(111, 141, 255, .28));
  box-shadow: 0 1px 0 rgba(255, 255, 255, .22) inset, 0 3px 0 rgba(40, 36, 120, .8);
}
.tb-right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-left: auto; }
.sort select {
  min-height: 38px; padding: 0 32px 0 12px; border: 1px solid var(--line); border-radius: 11px; cursor: pointer;
  font-size: 13px; font-weight: 700; -webkit-appearance: none; appearance: none;
  background: rgba(255, 255, 255, .06) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239aa3c7' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center;
}
.sort select option { background: var(--bg-2); }
@media (max-width: 640px) {
  .tb-right { margin-left: 0; width: 100%; }
  .tb-right .btn span { display: none; }
  .tb-right .sort { flex: 1; }
  .tb-right .sort select { width: 100%; }
}

/* ---------- Menu melayang ---------- */
.menu-wrap { position: relative; }
.menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 50; display: none;
  min-width: 220px; padding: 6px; border-radius: 14px;
  background: linear-gradient(170deg, #252d5c, #171e42); border: 1px solid var(--line-2);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .12) inset, 0 24px 48px -12px rgba(0, 0, 0, .8);
  transform-origin: top right;
}
.menu.up { top: auto; bottom: calc(100% + 6px); transform-origin: bottom right; }
.menu.open { display: block; animation: pop .16s ease-out; }
@keyframes pop { from { opacity: 0; transform: scale(.94) translateY(-4px); } }
.menu button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px;
  border: 0; border-radius: 9px; background: none; text-align: left; cursor: pointer; font-size: 14px; font-weight: 600;
}
.menu button:hover { background: rgba(255, 255, 255, .08); }
.menu .danger { color: var(--danger); }

/* ---------- Bagian ---------- */
.block { margin-bottom: 34px; }
.block-title { margin: 0 0 16px; font-size: 16px; font-weight: 800; letter-spacing: -.01em; color: var(--muted); }

/* ---------- Album 3D (folder) ---------- */
.folders { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 28px 20px; padding-right: 12px; }
.album-link { display: block; perspective: 900px; text-decoration: none; padding: 12px 14px 4px 4px; }
.album-stack { position: relative; display: block; aspect-ratio: 1 / 1; }
.sheet {
  position: absolute; inset: 0; border-radius: 16px; overflow: hidden;
  background: linear-gradient(145deg, #2a3268, #1a2048);
  border: 1px solid rgba(255, 255, 255, .14);
  transition: transform .45s cubic-bezier(.2, .8, .2, 1), box-shadow .45s;
}
.sheet img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sheet.s0 { z-index: 3; transform: translateZ(30px); box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 22px 36px -14px rgba(0, 0, 0, .85); }
.sheet.s1 { z-index: 2; transform: translate(8px, -8px) rotate(4deg) translateZ(15px); filter: brightness(.7); box-shadow: 0 12px 24px -10px rgba(0, 0, 0, .7); }
.sheet.s2 { z-index: 1; transform: translate(14px, -14px) rotate(8deg); filter: brightness(.5); }
.album-link:hover .sheet.s1 { transform: translate(18px, -14px) rotate(9deg) translateZ(15px); }
.album-link:hover .sheet.s2 { transform: translate(28px, -22px) rotate(16deg); }
.album-link:hover .sheet.s0 { box-shadow: 0 1px 0 rgba(255, 255, 255, .3) inset, 0 30px 48px -14px rgba(60, 50, 200, .8); }
.sheet-empty { display: grid; place-items: center; width: 100%; height: 100%; color: var(--violet); background: radial-gradient(circle at 30% 20%, rgba(157, 140, 255, .25), transparent 60%); }
.album-count {
  position: absolute; z-index: 4; left: 10px; bottom: 10px; transform: translateZ(50px);
  min-width: 30px; height: 26px; padding: 0 9px; border-radius: 9px; display: grid; place-items: center;
  font-size: 12px; font-weight: 800; color: #fff;
  background: rgba(10, 15, 36, .65); border: 1px solid rgba(255, 255, 255, .2);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.album-foot { display: flex; align-items: flex-start; gap: 4px; margin-top: 8px; padding-left: 4px; }
.album-text { flex: 1; min-width: 0; }
.album-name { display: block; font-weight: 800; font-size: 14.5px; line-height: 1.3; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.album-name:hover { color: var(--cyan); }
.album-meta { display: block; font-size: 12.5px; color: var(--muted); }

/* ---------- Grid foto ---------- */
.grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
@media (max-width: 640px) { .grid { grid-template-columns: repeat(3, 1fr); gap: 4px; } }
.tile {
  position: relative; display: block; aspect-ratio: 1 / 1; padding: 0; border: 0; cursor: zoom-in;
  border-radius: 14px; overflow: hidden; background: #1a2048;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .12) inset, 0 10px 22px -12px rgba(0, 0, 0, .8);
  transition: transform .25s cubic-bezier(.2, .8, .2, 1), box-shadow .25s;
}
@media (max-width: 640px) { .tile { border-radius: 6px; } }
.tile img, .tile video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
@media (hover: hover) {
  .tile:hover { transform: translateY(-4px) scale(1.03); z-index: 2; box-shadow: 0 1px 0 rgba(255, 255, 255, .2) inset, 0 22px 34px -14px rgba(70, 60, 220, .85); }
}
.tile-badge {
  position: absolute; right: 7px; bottom: 7px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  color: #fff; background: rgba(10, 15, 36, .6); border: 1px solid rgba(255, 255, 255, .25);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.tile-ph { display: grid; place-items: center; align-content: center; gap: 4px; width: 100%; height: 100%; color: var(--muted); font-weight: 800; font-size: 11px; }
.tile-check {
  position: absolute; left: 8px; top: 8px; display: none; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .85); background: rgba(0, 0, 0, .25); color: transparent;
}
.selecting .tile { cursor: pointer; }
.selecting .tile-check { display: grid; }
.selecting .tile.selected { transform: scale(.9); box-shadow: 0 0 0 3px var(--cyan), 0 14px 26px -12px rgba(70, 211, 255, .8); }
.selecting .tile.selected .tile-check { background: var(--grad); border-color: #fff; color: #fff; }
.selecting .tile.selected img, .selecting .tile.selected video { filter: brightness(.85); }

/* ---------- Kosong ---------- */
.empty { text-align: center; padding: 56px 20px; max-width: 560px; margin: 20px auto; border-radius: var(--r-lg); }
.empty h2 { margin: 26px 0 8px; font-size: 22px; letter-spacing: -.02em; }
.empty p { margin: 0 auto 24px; max-width: 420px; color: var(--muted); }
.empty-3d { position: relative; width: 110px; height: 90px; margin: 0 auto; perspective: 500px; }
.empty-3d i {
  position: absolute; left: 20px; top: 10px; width: 70px; height: 70px; border-radius: 14px;
  transform-style: preserve-3d; animation: float 5s ease-in-out infinite;
}
.empty-3d i:nth-child(1) { background: #2c3470; transform: rotateX(55deg) rotateZ(-40deg) translateZ(0); }
.empty-3d i:nth-child(2) { background: #6254d8; transform: rotateX(55deg) rotateZ(-40deg) translateZ(16px); animation-delay: -.6s; }
.empty-3d i:nth-child(3) { background: var(--grad); transform: rotateX(55deg) rotateZ(-40deg) translateZ(32px); animation-delay: -1.2s; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5); }
@keyframes float { 50% { margin-top: -8px; } }

/* ---------- Bilah pilih ---------- */
.selbar {
  position: fixed; z-index: 45; left: 50%; transform: translateX(-50%);
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; width: min(640px, calc(100vw - 24px));
  background: linear-gradient(170deg, rgba(44, 52, 100, .92), rgba(22, 28, 60, .95)); border-radius: 18px;
}
.selbar strong { font-size: 14px; white-space: nowrap; }
.selbar-gap { flex: 1; }
@media (max-width: 1023px) { .selbar { bottom: calc(92px + env(safe-area-inset-bottom, 0px)); } }
@media (max-width: 520px) { .selbar .btn span { display: none; } #selAll { padding: 0 8px; } }
@media (min-width: 1024px) { .selbar { left: calc(50% + var(--side) / 2); } }

/* ---------- Seret-lepas & panel unggah ---------- */
.drop { position: fixed; inset: 0; z-index: 80; display: none; place-items: center; padding: 20px; background: rgba(10, 15, 36, .7); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.drop.show { display: grid; }
.drop-box { display: grid; justify-items: center; gap: 10px; padding: 44px 56px; text-align: center; border: 2px dashed rgba(70, 211, 255, .6); color: var(--cyan); }
.drop-box p { margin: 0; color: var(--ink); font-size: 16px; }
.drop-box small { color: var(--muted); }
.uploader {
  position: fixed; z-index: 60; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  width: min(370px, calc(100vw - 24px)); padding: 16px 16px 18px;
  background: linear-gradient(170deg, rgba(44, 52, 100, .94), rgba(22, 28, 60, .97));
}
@media (max-width: 1023px) { .uploader { right: 12px; bottom: calc(92px + env(safe-area-inset-bottom, 0px)); } }
.up-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.up-bar { height: 10px; border-radius: 99px; background: rgba(0, 0, 0, .4); box-shadow: inset 0 1px 3px rgba(0, 0, 0, .6); overflow: hidden; }
.up-bar span { display: block; height: 100%; width: 0; background: var(--grad); border-radius: 99px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 0 12px rgba(70, 211, 255, .6); transition: width .2s; }
.up-file { margin: 10px 0 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-count { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.up-errors { margin: 8px 0 0; padding: 0; list-style: none; max-height: 110px; overflow: auto; font-size: 12px; color: var(--danger); }
#upReload { margin-top: 12px; }

/* ---------- Dialog ---------- */
.modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 16px; background: rgba(5, 8, 22, .65); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); perspective: 1200px; }
.modal-card.form { gap: 14px; }
.modal-card.form .modal-head, .modal-card.form .modal-actions { margin: 0; }
.modal-card.form .form-err:empty { display: none; }
.modal-card {
  width: min(430px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 22px;
  background: linear-gradient(165deg, #262e5e, #161c40); border-radius: var(--r-lg);
  animation: modalIn .32s cubic-bezier(.2, .9, .25, 1.1);
}
.modal-card.wide { width: min(560px, 100%); }
@keyframes modalIn { from { opacity: 0; transform: rotateX(14deg) translateY(24px) scale(.96); } }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.modal-head h3 { margin: 0; font-size: 19px; letter-spacing: -.02em; }
.modal-card > h3 { margin: 6px 0 4px; font-size: 19px; text-align: center; }
.modal-card > .sub { text-align: center; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.confirm-ic {
  display: grid; place-items: center; width: 60px; height: 60px; margin: 4px auto 10px; border-radius: 18px; color: #fff;
  background: linear-gradient(135deg, #ff8a8a, #ff4f79); box-shadow: 0 1px 0 rgba(255, 255, 255, .45) inset, 0 5px 0 #a3264a, 0 14px 26px -8px rgba(255, 80, 120, .6);
  transform: rotate(-6deg);
}
.confirm-ic.calm { background: var(--grad); box-shadow: 0 1px 0 rgba(255, 255, 255, .45) inset, 0 5px 0 #3f3aa6, 0 14px 26px -8px rgba(100, 110, 255, .6); transform: rotate(6deg); }
.form-err { min-height: 18px; margin: 8px 0 0; font-size: 13px; color: var(--danger); }

/* Pohon folder tujuan */
.tree { list-style: none; margin: 0; padding: 6px; max-height: 46vh; overflow: auto; border-radius: 14px; background: rgba(0, 0, 0, .25); box-shadow: inset 0 2px 6px rgba(0, 0, 0, .4); }
.tree li button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 10px;
  background: none; cursor: pointer; text-align: left; font-size: 14px; font-weight: 600;
}
.tree li button:hover { background: rgba(255, 255, 255, .07); }
.tree li button[aria-selected="true"] { background: linear-gradient(135deg, rgba(157, 140, 255, .35), rgba(70, 211, 255, .15)); box-shadow: 0 1px 0 rgba(255, 255, 255, .15) inset; }
.tree li button:disabled { opacity: .35; cursor: not-allowed; }
.tree .t-ic { color: var(--violet); }
.tree .t-here { margin-left: auto; font-size: 11px; font-weight: 700; color: var(--muted); }

/* ---------- Formulir ---------- */
.form { display: grid; gap: 14px; }
.field { display: grid; gap: 7px; font-size: 13px; font-weight: 700; color: var(--muted); }
.field em { font-style: normal; font-weight: 500; color: var(--faint); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }
.input-3d {
  display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 14px; border-radius: 13px; color: var(--faint);
  background: rgba(0, 0, 0, .3); border: 1px solid rgba(255, 255, 255, .06);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, .5), 0 1px 0 rgba(255, 255, 255, .07);
  transition: border-color .2s, box-shadow .2s;
}
.input-3d:focus-within { border-color: rgba(70, 211, 255, .6); box-shadow: inset 0 2px 5px rgba(0, 0, 0, .5), 0 0 0 4px rgba(70, 211, 255, .15); color: var(--cyan); }
.input-3d input { flex: 1; min-width: 0; height: 46px; border: 0; background: none; outline: none; color: var(--ink); font-size: 15px; font-weight: 500; }
.pw-toggle { display: grid; place-items: center; width: 32px; height: 32px; margin-right: -6px; border: 0; border-radius: 9px; background: none; color: var(--faint); cursor: pointer; }
.pw-toggle:hover, .pw-toggle.on { color: var(--ink); background: rgba(255, 255, 255, .08); }
.form-actions { display: flex; justify-content: flex-end; }

.check { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; cursor: pointer; color: var(--ink); }
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check-box {
  display: grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; flex: none; color: transparent;
  background: rgba(0, 0, 0, .3); box-shadow: inset 0 2px 4px rgba(0, 0, 0, .5); border: 1px solid var(--line-2);
}
.check input:checked + .check-box { color: #fff; background: var(--grad); border-color: transparent; box-shadow: 0 2px 0 #3f3aa6; }
.check input:focus-visible + .check-box { outline: 2px solid var(--cyan); outline-offset: 2px; }

.meter { display: grid; gap: 6px; }
.meter span { display: block; height: 6px; border-radius: 99px; background: rgba(0, 0, 0, .35); position: relative; overflow: hidden; }
.meter span::after { content: ""; position: absolute; inset: 0; width: var(--w, 0%); background: var(--mc, var(--danger)); border-radius: inherit; transition: width .25s, background .25s; }
.meter small { font-size: 12px; color: var(--faint); }

.role-pick { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.role-pick legend { font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 7px; }
@media (max-width: 560px) { .role-pick { grid-template-columns: 1fr; } }
.role-opt input { position: absolute; opacity: 0; }
.role-card {
  display: grid; gap: 4px; height: 100%; padding: 12px; border-radius: 14px; cursor: pointer;
  background: rgba(255, 255, 255, .04); border: 1px solid var(--line); transition: transform .2s, box-shadow .2s, border-color .2s;
}
.role-card b { font-size: 14px; }
.role-card small { font-size: 12px; color: var(--muted); line-height: 1.35; }
.role-opt input:checked + .role-card {
  border-color: rgba(157, 140, 255, .7); transform: translateY(-3px);
  background: linear-gradient(160deg, rgba(157, 140, 255, .22), rgba(70, 211, 255, .06));
  box-shadow: 0 1px 0 rgba(255, 255, 255, .15) inset, 0 5px 0 rgba(40, 36, 120, .9), 0 14px 24px -12px rgba(100, 90, 255, .8);
}
.role-opt input:focus-visible + .role-card { outline: 2px solid var(--cyan); outline-offset: 2px; }
.role-opt input:disabled + .role-card { opacity: .45; cursor: not-allowed; }
.role-ic { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; margin-bottom: 4px; }
.role-ic.role-admin, .role-pill.role-admin { background: rgba(255, 197, 107, .16); color: var(--warn); }
.role-ic.role-editor, .role-pill.role-editor { background: rgba(157, 140, 255, .18); color: #c3b8ff; }
.role-ic.role-viewer, .role-pill.role-viewer { background: rgba(70, 211, 255, .15); color: var(--cyan); }

/* ---------- Peringatan & notifikasi ---------- */
.alert { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 13px; font-size: 14px; line-height: 1.45; margin-bottom: 14px; }
.alert .ic { margin-top: 1px; }
.alert-error { background: rgba(255, 107, 125, .12); color: #ffb3bd; border: 1px solid rgba(255, 107, 125, .3); }
.alert-info { background: rgba(70, 211, 255, .1); color: #bdeeff; border: 1px solid rgba(70, 211, 255, .28); }
.alert.big { padding: 16px 18px; font-size: 15px; margin-bottom: 22px; }
.toast {
  position: fixed; left: 50%; bottom: calc(28px + env(safe-area-inset-bottom, 0px)); z-index: 250;
  display: flex; align-items: center; gap: 8px; max-width: calc(100vw - 32px);
  transform: translate(-50%, 24px); opacity: 0; pointer-events: none;
  padding: 12px 18px; border-radius: 14px; font-size: 14px; font-weight: 700;
  background: linear-gradient(170deg, #2f3872, #1d2450); border: 1px solid var(--line-2); box-shadow: var(--depth);
  transition: opacity .25s, transform .25s cubic-bezier(.2, .9, .25, 1.2);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { border-color: rgba(255, 107, 125, .5); color: #ffc2ca; }
.toast.success::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 10px var(--ok); }
@media (max-width: 1023px) { .toast { bottom: calc(96px + env(safe-area-inset-bottom, 0px)); } }

/* ==========================================================
   Halaman masuk
   ========================================================== */
.login-page { display: grid; min-height: 100vh; }
.login-wrap { display: grid; grid-template-columns: 1.15fr 1fr; align-items: center; gap: 40px; width: min(1180px, 100%); margin: auto; padding: 32px; }
.stage { position: relative; display: grid; gap: 40px; justify-items: center; }
.stack3d { position: relative; width: 360px; height: 340px; perspective: 1100px; transform-style: preserve-3d; }
.pcard {
  position: absolute; left: 50%; top: 50%; width: 210px; margin: 0; padding: 10px 10px 14px;
  border-radius: 14px; background: linear-gradient(170deg, #f7f7fb, #dcdff0);
  box-shadow: 0 1px 0 #fff inset, 0 30px 50px -20px rgba(0, 0, 0, .8), 0 8px 16px rgba(0, 0, 0, .3);
  transform-style: preserve-3d; animation: hover3d 9s ease-in-out infinite;
}
.pcard figcaption { display: grid; gap: 5px; margin-top: 10px; }
.pcard figcaption b { display: block; height: 7px; width: 70%; border-radius: 4px; background: #c8cce0; }
.pcard figcaption b + b { width: 42%; background: #dde0ee; }
.p1 { --r: -16deg; --z: 0px;   --x: -215px; --y: -150px; animation-delay: 0s; }
.p2 { --r: 10deg;  --z: 40px;  --x: -20px;  --y: -190px; animation-delay: -2s; }
.p3 { --r: -6deg;  --z: 90px;  --x: -190px; --y: -10px;  animation-delay: -4s; }
.p4 { --r: 13deg;  --z: 140px; --x: -40px;  --y: -60px;  animation-delay: -6s; }
.pcard { transform: translate(var(--x), var(--y)) rotateX(18deg) rotateY(-22deg) rotateZ(var(--r)) translateZ(var(--z)); }
@keyframes hover3d {
  50% { transform: translate(var(--x), calc(var(--y) - 14px)) rotateX(22deg) rotateY(-14deg) rotateZ(var(--r)) translateZ(calc(var(--z) + 20px)); }
}
.ph { position: relative; aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; }
.ph i, .ph span { position: absolute; display: block; }
.ph .sun { width: 34%; aspect-ratio: 1; border-radius: 50%; left: 56%; top: 16%; }
.ph .moon { width: 22%; aspect-ratio: 1; border-radius: 50%; left: 64%; top: 14%; background: #f5f1ff; box-shadow: 0 0 22px rgba(255, 255, 255, .7); }
.ph .hill { bottom: -30%; border-radius: 50%; }
.ph .h1 { left: -20%; width: 90%; height: 75%; }
.ph .h2 { right: -25%; width: 100%; height: 62%; }
.ph .wave { left: -10%; right: -10%; bottom: -20%; height: 50%; border-radius: 45% 55% 0 0; background: linear-gradient(#1d8fd6, #0b4f8c); }
.ph-sunset { background: linear-gradient(#ff9a6a, #ff5e87 55%, #7d3fb0); }
.ph-sunset .sun { background: #ffe29a; box-shadow: 0 0 30px #ffd36e; }
.ph-sunset .h1 { background: #4a2270; } .ph-sunset .h2 { background: #2c1450; }
.ph-sea { background: linear-gradient(#8fe3ff, #4fb7f0); }
.ph-sea .sun { background: #fff6c9; top: 12%; left: 20%; }
.ph-night { background: linear-gradient(#1c1f5a, #3b2a86); }
.ph-night .h1 { background: #151640; } .ph-night .h2 { background: #0d0e2e; }
.ph-dawn { background: linear-gradient(#ffd3a5, #fd9fd0 60%, #a18cd1); }
.ph-dawn .sun { background: #fff; opacity: .8; top: 40%; left: 30%; }
.ph-dawn .h2 { background: #6d5bd0; }
.pplay { left: 50%; top: 50%; width: 42px; height: 42px; margin: -21px 0 0 -21px; border-radius: 50%; background: rgba(0, 0, 0, .45); }
.pplay::after { content: ""; position: absolute; left: 16px; top: 12px; border-left: 14px solid #fff; border-top: 9px solid transparent; border-bottom: 9px solid transparent; }
.stage-copy { max-width: 440px; text-align: center; }
.stage-copy h2 { margin: 0 0 10px; font-size: clamp(26px, 3.2vw, 38px); line-height: 1.12; letter-spacing: -.03em; font-weight: 800; text-shadow: 0 10px 30px rgba(90, 80, 255, .5); }
.stage-copy p { margin: 0; color: var(--muted); font-size: 15.5px; }

.login-card { width: min(440px, 100%); justify-self: center; padding: 34px 30px 26px; border-radius: 26px;
  background: linear-gradient(160deg, rgba(255, 255, 255, .11), rgba(255, 255, 255, .03)); }
.login-card h1 { font-size: 30px; margin: 30px 0 6px; }
.login-card .lead { margin: 0 0 22px; color: var(--muted); }
.login-card .btn { margin-top: 8px; }
.login-foot { margin: 22px 0 0; text-align: center; font-size: 12px; color: var(--faint); }

@media (max-width: 900px) {
  .login-wrap { grid-template-columns: 1fr; gap: 8px; padding: 20px 16px 32px; }
  .stage { gap: 0; }
  .stack3d { transform: scale(.62); height: 230px; margin-top: -30px; }
  .stage-copy { display: none; }
}

/* ==========================================================
   Akun saya
   ========================================================== */
.account-grid { display: grid; grid-template-columns: 340px 1fr; gap: 22px; align-items: start; }
@media (max-width: 1100px) { .account-grid { grid-template-columns: 1fr; } }
.stack-col { display: grid; gap: 22px; }
.profile-card { padding: 26px 22px; border-radius: var(--r-lg); overflow: hidden; }
.profile-card::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 110px; border-radius: var(--r-lg) var(--r-lg) 0 0;
  background: linear-gradient(135deg, rgba(157, 140, 255, .45), rgba(70, 211, 255, .25)); opacity: .6;
}
.profile-hero { position: relative; display: grid; justify-items: center; text-align: center; padding-top: 30px; }
.profile-hero .avatar { transform: translateZ(40px); border: 4px solid rgba(255, 255, 255, .15); }
.profile-hero h2 { margin: 14px 0 0; font-size: 21px; letter-spacing: -.02em; }
.profile-hero p { margin: 0 0 12px; color: var(--muted); }
.role-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 99px; font-size: 12px; font-weight: 800; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; margin: 24px 0 0; padding-top: 18px; border-top: 1px solid var(--line); font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; word-break: break-word; font-weight: 600; }
.kv.sm { font-size: 13px; gap: 6px 12px; margin-top: 16px; padding-top: 14px; }
.panel { padding: 22px; border-radius: var(--r-lg); }
.panel-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.panel-head h2 { margin: 0; font-size: 18px; letter-spacing: -.02em; }
.panel-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 13px; color: #fff; background: var(--grad); box-shadow: 0 1px 0 rgba(255, 255, 255, .45) inset, 0 4px 0 #3f3aa6, 0 10px 18px -8px rgba(100, 110, 255, .7); }

/* ==========================================================
   Manajemen user
   ========================================================== */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
@media (max-width: 760px) { .stat-row { grid-template-columns: repeat(2, 1fr); gap: 10px; } }
.stat { padding: 18px; display: grid; gap: 2px; border-radius: 18px; }
.stat strong { font-size: 30px; line-height: 1.1; letter-spacing: -.03em; transform: translateZ(24px); }
.stat small { color: var(--muted); font-weight: 600; }
.stat-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; margin-bottom: 10px; transform: translateZ(30px); }
.stat-ic.c1 { background: rgba(157, 140, 255, .2); color: #c3b8ff; }
.stat-ic.c2 { background: rgba(255, 197, 107, .16); color: var(--warn); }
.stat-ic.c3 { background: rgba(255, 122, 182, .16); color: var(--rose); }
.stat-ic.c4 { background: rgba(70, 211, 255, .15); color: var(--cyan); }
.user-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.user-card { padding: 18px; border-radius: 20px; }
.user-card.is-off { opacity: .6; }
.uc-top { display: flex; align-items: center; gap: 12px; }
.uc-top .avatar { transform: translateZ(30px); }
.uc-name { flex: 1; min-width: 0; line-height: 1.3; }
.uc-name strong { display: block; font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uc-name small { color: var(--muted); }
.me-tag { font-size: 11px; font-weight: 800; padding: 2px 7px; margin-left: 4px; border-radius: 6px; background: rgba(70, 211, 255, .18); color: var(--cyan); vertical-align: 2px; }
.uc-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.status { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; background: rgba(255, 255, 255, .06); }
.status i { width: 7px; height: 7px; border-radius: 50%; }
.status.on i { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.status.off i { background: var(--faint); }
.status.warn { color: var(--warn); } .status.warn i { background: var(--warn); }
.empty-note { text-align: center; color: var(--muted); padding: 40px 0; }

/* ==========================================================
   Penampil layar penuh
   ========================================================== */
.lb { position: fixed; inset: 0; z-index: 150; color: #fff; --bg-alpha: 1; user-select: none; -webkit-user-select: none; }
.lb-bg { position: absolute; inset: 0; background: #000; opacity: var(--bg-alpha); }
.lb-viewport { position: absolute; inset: 0; overflow: hidden; touch-action: none; }
.lb-track { display: flex; width: 100%; height: 100%; transform: translate3d(-100%, 0, 0); will-change: transform; }
.lb-slide { flex: 0 0 100%; height: 100%; display: flex; align-items: center; justify-content: center; overflow: hidden; }
/* Foto selalu muat utuh di layar (ukuran file tetap asli, hanya tampilannya diskalakan) */
.lb-slide img {
  flex: none; min-width: 0; min-height: 0;
  max-width: 100vw; max-height: 100vh; max-height: 100dvh; width: auto; height: auto; display: block; object-fit: contain;
  background-size: contain; background-position: center; background-repeat: no-repeat;
  transform-origin: center center; will-change: transform; -webkit-user-drag: none;
}
.lb-slide video { width: 100%; height: 100%; max-height: 100vh; max-height: 100dvh; object-fit: contain; background: #000; outline: none; }
.lb-fallback { display: grid; justify-items: center; gap: 12px; padding: 24px; text-align: center; color: #cfd4ee; }
.lb-fallback p { margin: 0; max-width: 320px; }

.lb-top, .lb-bottom { position: absolute; left: 0; right: 0; z-index: 3; transition: opacity .2s, transform .2s; }
.lb-top {
  top: 0; display: flex; align-items: center; gap: 4px;
  padding: 8px 8px 28px; padding-top: calc(8px + env(safe-area-inset-top, 0px));
  background: linear-gradient(rgba(0, 0, 0, .7), transparent);
}
.lb-title { flex: 1; min-width: 0; display: grid; line-height: 1.25; padding: 0 6px; }
.lb-title span { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-title small { font-size: 12px; opacity: .7; }
.lb-quality { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 99px; font-size: 11.5px; font-weight: 800; color: #0a0f24; background: var(--grad); }
.lb-btn { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border: 0; border-radius: 50%; background: none; color: #fff; cursor: pointer; }
.lb-btn:hover { background: rgba(255, 255, 255, .14); }
.lb-btn .i-pause, .lb.playing .lb-btn .i-play { display: none; }
.lb.playing .lb-btn .i-pause { display: block; }

.lb-bottom {
  bottom: 0; display: flex; justify-content: center; gap: 4px;
  padding: 28px 8px 10px; padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(transparent, rgba(0, 0, 0, .75));
}
.lb-bottom button, .lb-bottom a {
  display: grid; justify-items: center; gap: 3px; min-width: 70px; padding: 8px 10px; border: 0; border-radius: 14px;
  background: none; color: #fff; cursor: pointer; font-size: 11.5px; font-weight: 700; text-decoration: none;
}
.lb-bottom button:hover, .lb-bottom a:hover { background: rgba(255, 255, 255, .12); }
.lb-bottom .danger { color: #ff9aa8; }

.lb-nav {
  position: absolute; top: 50%; z-index: 3; transform: translateY(-50%); display: none; place-items: center;
  width: 54px; height: 54px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .2); cursor: pointer; color: #fff;
  background: rgba(255, 255, 255, .1); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); transition: opacity .2s;
}
.lb-nav:hover { background: rgba(255, 255, 255, .22); }
.lb-nav.prev { left: 18px; } .lb-nav.next { right: 18px; }
.lb-nav:disabled { opacity: 0 !important; pointer-events: none; }
@media (hover: hover) and (pointer: fine) { .lb-nav { display: grid; } }

.lb-info {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; max-height: 70vh; overflow: auto;
  padding: 10px 22px calc(24px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(170deg, #262e5e, #141a38); border-radius: 24px 24px 0 0;
  border-top: 1px solid var(--line-2); transform: translateY(105%); transition: transform .3s cubic-bezier(.2, .8, .2, 1);
}
.lb-info.open { transform: none; }
.lb-info-grip { width: 42px; height: 5px; border-radius: 99px; background: rgba(255, 255, 255, .25); margin: 0 auto 16px; }
.lb-info dl { display: grid; grid-template-columns: auto 1fr; gap: 9px 20px; margin: 0 auto; max-width: 560px; font-size: 14px; }
.lb-info dt { color: var(--muted); }
.lb-info dd { margin: 0; word-break: break-word; font-weight: 600; }
.q-badge { display: inline-flex; align-items: center; gap: 5px; color: var(--cyan); }
.lb.ui-hidden .lb-top { opacity: 0; transform: translateY(-12px); pointer-events: none; }
.lb.ui-hidden .lb-bottom { opacity: 0; transform: translateY(12px); pointer-events: none; }
.lb.ui-hidden .lb-nav { opacity: 0; pointer-events: none; }

/* ---------- Gerak dikurangi ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  [data-tilt] { transform: none !important; }
}

/* ---------- Label folder pada hasil saringan / pencarian ---------- */
.tile-folder {
  position: absolute; left: 6px; bottom: 6px; max-width: calc(100% - 44px);
  padding: 3px 8px; border-radius: 7px; font-size: 11px; font-weight: 700; color: #fff; text-align: left;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  background: rgba(10, 15, 36, .62); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
@media (max-width: 640px) { .tile-folder { font-size: 9.5px; padding: 2px 5px; left: 3px; bottom: 3px; } }

/* ==========================================================
   Pengaturan
   ========================================================== */
.settings-grid { grid-template-columns: 1.2fr 1fr; }
@media (max-width: 1100px) { .settings-grid { grid-template-columns: 1fr; } }
.limit-now {
  display: grid; gap: 2px; padding: 18px 20px; margin-bottom: 18px; border-radius: 16px;
  background: linear-gradient(135deg, rgba(157, 140, 255, .22), rgba(70, 211, 255, .1));
  box-shadow: 0 1px 0 rgba(255, 255, 255, .14) inset, 0 5px 0 rgba(40, 36, 120, .7), 0 16px 30px -14px rgba(100, 90, 255, .7);
}
.limit-now small { color: var(--muted); font-weight: 600; }
.limit-now strong { font-size: 34px; line-height: 1.1; letter-spacing: -.03em; }
.preset-chips { gap: 8px; }
.preset-chips .chip { background: rgba(255, 255, 255, .05); border: 1px solid var(--line); }
.limit-row { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; }
.input-3d select { flex: 1; height: 46px; border: 0; background: transparent; outline: none; color: var(--ink); font-size: 15px; font-weight: 600; cursor: pointer; }
.input-3d select option { background: var(--bg-2); }
.input-3d input:disabled, .input-3d select:disabled { opacity: .4; }
.note { display: flex; gap: 10px; margin: 20px 0 0; padding-top: 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); line-height: 1.5; }
.note .ic { margin-top: 2px; color: var(--cyan); }
.note code { padding: 1px 5px; border-radius: 5px; background: rgba(255, 255, 255, .08); font-size: 12px; }
.disk { margin-bottom: 8px; }
.disk-bar { height: 14px; border-radius: 99px; overflow: hidden; background: rgba(0, 0, 0, .35); box-shadow: inset 0 2px 4px rgba(0, 0, 0, .5); }
.disk-bar span { display: block; height: 100%; border-radius: 99px; background: var(--grad); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 0 14px rgba(70, 211, 255, .5); }
.disk-legend { display: flex; justify-content: space-between; margin-top: 8px; font-size: 13px; color: var(--muted); }
.disk-legend b { color: var(--ink); font-size: 15px; }

/* Unggahan terjeda: menunggu layar aktif / koneksi kembali */
.uploader.waiting .up-bar span { background: linear-gradient(90deg, #ffc56b, #ff9f6b); box-shadow: none; animation: wait 1.2s ease-in-out infinite alternate; }
@keyframes wait { to { opacity: .45; } }
.up-hint { margin: 10px 0 0; font-size: 11.5px; color: var(--faint); line-height: 1.45; }
