/* =========================================================================
   RAPROJ LAYOUT · "Soft Bubble Glass"
   Semua tampilan dikendalikan token. Preset & checklist Casual hanya
   menimpa token lewat atribut di <html>:
   data-preset · data-accent · data-header · data-glass · data-radius
   data-shadow · data-indicator · data-labels · data-density
   data-textsize · data-motion · data-gold
   ========================================================================= */

/* ---------- 1. TOKEN DASAR (preset Default = Bubble) ---------- */
:root {
  --font: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --main-font-family: var(--font);

  --primary-color: #3b82f6;
  --primary-dark: #1d4ed8;
  --primary-soft: color-mix(in srgb, var(--primary-color) 10%, transparent);
  --primary-glow: color-mix(in srgb, var(--primary-color) 35%, transparent);
  --gold: #f59e0b;
  --gold-dark: #d97706;
  --danger-color: #ef4444;
  --success-color: #10b981;
  --warning-color: #f59e0b;

  --bg-body: #f6f8fc;
  --card-bg: #ffffff;
  --surface: #ffffff;
  --border-color: #e2e8f0;
  --text-title: #0f172a;
  --text-main: #334155;
  --text-desc: #64748b;
  --bg-header: #ffffff;
  --dropdown-bg: #ffffff;
  --hdr-bg-glass: rgba(255, 255, 255, 0.72);
  --hdr-border: rgba(226, 232, 240, 0.8);
  --nav-track: rgba(15, 23, 42, 0.045);

  /* radius */
  --r-sm: 8px; --r-md: 14px; --r-lg: 20px; --r-pill: 999px;

  /* bayangan */
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 10px 30px rgba(15, 23, 42, 0.10);
  --shadow-lg: 0 20px 48px rgba(15, 23, 42, 0.22);

  /* gerak */
  --m: 1;
  --dur-1: calc(150ms * var(--m));
  --dur-2: calc(250ms * var(--m));
  --dur-3: calc(400ms * var(--m));
  --ease: cubic-bezier(0.34, 1.35, 0.5, 1);       /* pegas halus */
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-smooth: var(--ease-out);

  /* header */
  --hdr-h: 56px;
  --hdr-w: min(1200px, calc(100% - 24px));
  --hdr-mt: 10px;
  --hdr-top: 10px;
  --hdr-radius: 18px;
  --hdr-bg: var(--hdr-bg-glass);
  --blur: 16px;
  --hdr-pad-x: 14px;

  /* kepadatan */
  --pad: 20px;
  --item-h: 36px;
}

html.dark-mode {
  --bg-body: #0b1121;
  --card-bg: rgba(30, 41, 59, 0.45);
  --surface: #0f172a;
  --border-color: rgba(255, 255, 255, 0.09);
  --text-title: #ffffff;
  --text-main: #f1f5f9;
  --text-desc: #94a3b8;
  --bg-header: #0f172a;
  --dropdown-bg: #131c31;
  --hdr-bg-glass: rgba(15, 23, 42, 0.72);
  --hdr-border: rgba(255, 255, 255, 0.1);
  --nav-track: rgba(255, 255, 255, 0.06);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.55);
}

/* ---------- 2. WARNA AKSEN (pilihan pengguna) ---------- */
html[data-accent="green"]  { --primary-color: #10b981; --primary-dark: #047857; }
html[data-accent="purple"] { --primary-color: #8b5cf6; --primary-dark: #6d28d9; }
html[data-accent="pink"]   { --primary-color: #ec4899; --primary-dark: #be185d; }

/* ---------- 3. PRESET CASUAL (Clean) ---------- */
html[data-preset="casual"] {
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --r-sm: 6px; --r-md: 10px; --r-lg: 12px;
  --shadow-sm: none; --shadow-md: none; --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.18);
  --ease: var(--ease-out);
  --m: 0.6;
  --hdr-w: 100%; --hdr-mt: 0px; --hdr-top: 0px; --hdr-radius: 0px;
  --hdr-bg: var(--surface); --blur: 0px;
}
/* checklist Casual */
html[data-preset="casual"][data-header="float"] { --hdr-w: min(1200px, calc(100% - 24px)); --hdr-mt: 10px; --hdr-top: 10px; --hdr-radius: var(--r-lg); }
html[data-preset="casual"][data-glass="on"]     { --hdr-bg: var(--hdr-bg-glass); --blur: 16px; }
html[data-preset="casual"][data-shadow="on"]    { --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.06); --shadow-md: 0 10px 30px rgba(15, 23, 42, 0.10); }
html.dark-mode[data-preset="casual"][data-shadow="on"] { --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3); --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.35); }
html[data-preset="casual"][data-radius="sharp"] { --r-sm: 3px;  --r-md: 5px;  --r-lg: 8px; }
html[data-preset="casual"][data-radius="round"] { --r-sm: 10px; --r-md: 16px; --r-lg: 24px; }
html[data-preset="casual"][data-density="compact"] { --hdr-h: 48px; --pad: 14px; --item-h: 32px; }
html[data-preset="casual"][data-textsize="s"] { font-size: 14.5px; }
html[data-preset="casual"][data-textsize="l"] { font-size: 17.5px; }
html[data-preset="casual"][data-motion="full"] { --m: 1; --ease: cubic-bezier(0.34, 1.35, 0.5, 1); }
html[data-preset="casual"][data-motion="off"]  { --m: 0; }
html[data-preset="casual"][data-gold="hide"] .avatar-plus-crown { display: none; }
html[data-preset="casual"][data-gold="hide"] .avatar-initial-box.is-vip { background: none; box-shadow: none; }
html[data-preset="casual"][data-gold="hide"] .avatar-initial-box.is-vip .avatar-initial { background: var(--primary-color); color: #fff; }
html[data-preset="casual"][data-gold="hide"] .dd-row.is-gold,
html[data-preset="casual"][data-gold="hide"] .badge-member-tag.is-plus { color: var(--primary-color); background: var(--primary-soft); border-color: transparent; }

/* ---------- 4. DASAR ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
* { font-family: var(--font) !important; }   /* paksa seluruh page mengikuti preset aktif */
body {
  background: var(--bg-body); color: var(--text-main);
  min-height: 100vh; display: flex; flex-direction: column;
  position: relative; overflow-x: hidden;
  transition: background var(--dur-2) ease;
}
body.rp-lock { overflow: hidden; }
.rp-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--primary-color); outline-offset: 2px; }

.raproj-app-wrapper { display: flex; flex: 1; flex-direction: column; width: 100%; min-height: 100vh; }
.raproj-main-layout-body {
  display: flex; flex-direction: row; flex: 1; width: 100%;
  position: relative; align-items: flex-start;
  min-height: calc(100vh - var(--hdr-h));
}
.raproj-content-viewport { flex: 1; min-width: 0; width: 100%; padding: var(--pad); padding-top: 15px; }
html.mode-web-compact .raproj-content-viewport { max-width: 920px; margin: 0 auto; padding: 14px; }

/* transisi antar halaman (header tetap, konten memudar) */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: var(--dur-2); animation-timing-function: var(--ease-out); }
::view-transition-group(rp-header) { animation-duration: 0s; }

/* ---------- 5. HEADER ---------- */
.raproj-custom-header {
  view-transition-name: rp-header;
  width: var(--hdr-w); height: var(--hdr-h);
  margin: var(--hdr-mt) auto 0;
  padding: 0 max(var(--hdr-pad-x), calc((100% - 1200px) / 2 + var(--hdr-pad-x)));
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  position: sticky; top: var(--hdr-top); z-index: 9999;
  background: var(--hdr-bg);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(170%);
  backdrop-filter: blur(var(--blur)) saturate(170%);
  border: 1px solid var(--hdr-border); border-radius: var(--hdr-radius);
  box-shadow: var(--shadow-md);
  transition: transform var(--dur-3) var(--ease-out), box-shadow var(--dur-2) ease, background var(--dur-2) ease;
}
html[data-preset="casual"][data-header="flat"] .raproj-custom-header { border-width: 0 0 1px; }
.raproj-custom-header.is-scrolled { border-color: color-mix(in srgb, var(--primary-color) 28%, var(--hdr-border)); }
.raproj-custom-header.is-hidden-scroll { transform: translateY(calc(-100% - 16px)); }

.header-left-container { display: flex; align-items: center; min-width: 0; }
.header-left-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.header-logo-img { height: 32px; width: 32px; object-fit: contain; border-radius: 50%; flex-shrink: 0; }
html.dark-mode .header-logo-img { background: #fff; padding: 3px; }
.header-brand-text { font-size: 1rem; font-weight: 800; color: var(--text-title); letter-spacing: -0.01em; white-space: nowrap; }
.header-page-title { display: none; font-size: 0.92rem; font-weight: 700; color: var(--text-title); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.header-right-actions { display: flex; align-items: center; gap: 8px; }

/* navigasi ikon desktop dengan pill yang meluncur */
.header-nav-icons {
  position: relative; display: flex; align-items: center; gap: 2px;
  padding: 3px; margin-right: 4px;
  background: var(--nav-track); border-radius: var(--r-pill);
}
.rp-nav-pill {
  position: absolute; left: 0; top: 3px; bottom: 3px; z-index: 0;
  width: var(--pill-w, 0px); transform: translateX(var(--pill-x, 0px));
  background: var(--primary-color); border-radius: var(--r-pill);
  box-shadow: 0 4px 14px var(--primary-glow);
  opacity: 0; pointer-events: none;
  transition: transform var(--dur-3) var(--ease), width var(--dur-3) var(--ease), opacity var(--dur-2) ease;
}
.header-nav-icons.has-pill .rp-nav-pill { opacity: 1; }
.header-nav-icons.no-anim .rp-nav-pill { transition: none; }

.header-icon-item {
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  height: calc(var(--item-h) - 2px); padding: 0 10px;
  border-radius: var(--r-pill); color: var(--text-desc);
  text-decoration: none; white-space: nowrap; overflow: hidden;
  transition: color var(--dur-2) ease, background var(--dur-2) ease;
}
.header-icon-item:hover { color: var(--primary-color); background: var(--primary-soft); }
.header-icon-item.active { color: #fff; background: transparent; padding: 0 14px; }
.header-icon-item svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2.2; }
.menu-icon-svg { display: flex; flex-shrink: 0; }
.menu-label-text {
  max-width: 0; opacity: 0; margin-left: 0; overflow: hidden;
  font-size: 0.76rem; font-weight: 700;
  transition: max-width var(--dur-3) var(--ease-out), opacity var(--dur-2) ease, margin var(--dur-3) var(--ease-out);
}
.header-icon-item.active .menu-label-text,
html[data-preset="casual"][data-labels="always"] .menu-label-text,
html.nav-text-always-show .menu-label-text { max-width: 120px; opacity: 1; margin-left: 7px; }

/* Casual: penanda berupa garis bawah */
html[data-preset="casual"][data-indicator="underline"] .header-nav-icons { background: transparent; padding: 0; border-radius: 0; }
html[data-preset="casual"][data-indicator="underline"] .rp-nav-pill { top: auto; bottom: 0; height: 3px; border-radius: 3px; box-shadow: none; }
html[data-preset="casual"][data-indicator="underline"] .header-icon-item { border-radius: var(--r-sm); height: var(--item-h); }
html[data-preset="casual"][data-indicator="underline"] .header-icon-item.active { color: var(--primary-color); }

/* tombol ikon */
.btn-quick-theme-toggle, .btn-mobile-hamburger {
  width: var(--item-h); height: var(--item-h); border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--border-color); color: var(--text-title); cursor: pointer;
  transition: border-color var(--dur-2) ease, background var(--dur-2) ease, transform var(--dur-1) var(--ease);
}
.btn-quick-theme-toggle:hover, .btn-mobile-hamburger:hover { border-color: var(--primary-color); color: var(--primary-color); background: var(--primary-soft); }
.btn-quick-theme-toggle:active, .btn-mobile-hamburger:active { transform: scale(0.92); }
.btn-mobile-hamburger { display: none; }

.btn-login-header {
  background: var(--primary-color); color: #fff; border-radius: var(--r-md);
  padding: 7px 14px; text-decoration: none; font-size: 0.78rem; font-weight: 700;
}

/* ---------- 6. AVATAR & DROPDOWN ---------- */
.user-profile-wrapper { position: relative; display: flex; align-items: center; }
.avatar-initial-box {
  position: relative; border: 0; background: none; cursor: pointer;
  border-radius: 50%; padding: 2px; display: block;
  transition: transform var(--dur-1) var(--ease);
}
.avatar-initial-box:hover { transform: scale(1.06); }
.avatar-initial-box.is-vip { background: linear-gradient(135deg, var(--gold), var(--gold-dark)); box-shadow: 0 0 10px rgba(245, 158, 11, 0.4); }
.avatar-initial {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--primary-color); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.78rem; letter-spacing: 0.03em;
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.avatar-initial-box.is-vip .avatar-initial { background: linear-gradient(135deg, #1e293b, #0f172a); color: var(--gold); }
.avatar-plus-crown {
  position: absolute; top: -4px; left: -4px; width: 16px; height: 16px; z-index: 4;
  display: flex; align-items: center; justify-content: center; color: #fff;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  border: 2px solid var(--bg-header); border-radius: 50%;
}
.profile-unread-badge {
  position: absolute; top: -3px; right: -3px; z-index: 3; display: none;
  background: var(--danger-color); color: #fff; font-size: 0.58rem; font-weight: 800;
  min-width: 15px; padding: 2px 4px; line-height: 1; text-align: center;
  border: 2px solid var(--bg-header); border-radius: 10px;
}

.profile-dropdown-box {
  position: absolute; top: calc(100% + 12px); right: 0; z-index: 100000;
  width: min(320px, calc(100vw - 24px)); padding: 12px;
  max-height: calc(100vh - var(--hdr-h) - 40px); overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 10px;
  background: var(--dropdown-bg); border: 1px solid var(--border-color);
  border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transform: translateY(-8px) scale(0.98); transform-origin: top right;
  transition: opacity var(--dur-2) ease, transform var(--dur-2) var(--ease), visibility var(--dur-2);
}
.profile-dropdown-box.show { opacity: 1; visibility: visible; transform: none; }

.dd-profile { display: flex; align-items: center; gap: 12px; padding: 10px; background: var(--bg-body); border: 1px solid var(--border-color); border-radius: var(--r-md); }
.dd-avatar { width: 42px; height: 42px; flex-shrink: 0; border-radius: 50%; background: var(--primary-color); color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.dd-profile.is-vip .dd-avatar { background: linear-gradient(135deg, #1e293b, #0f172a); color: var(--gold); box-shadow: 0 0 0 2px var(--gold); }
.dd-info { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dd-name { font-size: 0.86rem; font-weight: 800; color: var(--text-title); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-email { font-size: 0.7rem; color: var(--text-desc); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge-member-tag {
  align-self: flex-start; margin-top: 3px; padding: 2px 9px; border-radius: var(--r-pill);
  font-size: 0.64rem; font-weight: 800; border: 1px solid var(--border-color); color: var(--text-desc);
}
.badge-member-tag.is-plus { color: var(--gold-dark); background: rgba(245, 158, 11, 0.14); border-color: rgba(245, 158, 11, 0.3); }

.dd-actions { display: flex; flex-direction: column; gap: 2px; }
.dd-row {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 9px 10px; border: 0; background: none; border-radius: var(--r-md);
  color: var(--text-main); font-size: 0.8rem; font-weight: 600; text-align: left;
  text-decoration: none; cursor: pointer;
  transition: background var(--dur-1) ease, color var(--dur-1) ease;
}
.dd-row svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 2.1; flex-shrink: 0; }
.dd-row:hover { background: var(--primary-soft); color: var(--primary-color); }
.dd-row small { display: block; font-size: 0.64rem; font-weight: 500; color: var(--text-desc); }
.dd-row.is-gold { color: var(--gold-dark); }
.dd-row.is-gold:hover { background: rgba(245, 158, 11, 0.12); color: var(--gold-dark); }
.dd-row.is-danger:hover { background: rgba(239, 68, 68, 0.1); color: var(--danger-color); }
.dd-divider { height: 1px; background: var(--border-color); }

.dropdown-notif-header { display: flex; justify-content: space-between; align-items: center; padding: 0 4px; font-size: 0.74rem; font-weight: 800; color: var(--text-desc); }
#hdrUnreadText { font-size: 0.64rem; color: var(--primary-color); font-weight: 800; }
.dropdown-notif-list { display: flex; flex-direction: column; gap: 6px; }
.dropdown-notif-item { display: flex; flex-direction: column; padding: 8px 10px; border-radius: var(--r-md); text-decoration: none; background: var(--bg-body); border: 1px solid var(--border-color); transition: border-color var(--dur-1) ease; }
.dropdown-notif-item:hover { border-color: var(--primary-color); }
.dropdown-notif-item.is-unread { border-left: 3px solid var(--primary-color); background: var(--primary-soft); }
.notif-item-title { font-size: 0.76rem; font-weight: 800; color: var(--text-title); margin-bottom: 2px; }
.notif-item-msg { font-size: 0.7rem; color: var(--text-desc); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.notif-item-time { font-size: 0.62rem; color: var(--text-desc); margin-top: 4px; font-weight: 600; }
.notif-empty { font-size: 0.72rem; color: var(--text-desc); padding: 10px 0; text-align: center; }
.dropdown-notif-footer { text-align: right; padding-top: 2px; }
.link-notif-more { font-size: 0.74rem; font-weight: 800; color: var(--primary-color); text-decoration: none; }
.link-notif-more:hover { text-decoration: underline; }

/* ---------- 7. PENGATURAN (modal desktop / bottom sheet HP) ---------- */
.rp-sheet-overlay {
  position: fixed; inset: 0; z-index: 100020;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(15, 23, 42, 0.55);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity var(--dur-2) ease, visibility var(--dur-2);
}
.rp-sheet-overlay.active { opacity: 1; visibility: visible; pointer-events: auto; }
.rp-sheet {
  width: 100%; max-width: 440px; max-height: min(86vh, 760px); overflow-y: auto; overscroll-behavior: contain;
  padding: 20px; display: flex; flex-direction: column; gap: 18px;
  background: var(--surface); border: 1px solid var(--border-color);
  border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  transform: translateY(14px) scale(0.97);
  transition: transform var(--dur-3) var(--ease);
}
.rp-sheet-overlay.active .rp-sheet { transform: none; }
.rp-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rp-sheet-head h3 { font-size: 1rem; font-weight: 800; color: var(--text-title); }
.rp-sheet-close {
  width: 30px; height: 30px; border-radius: 50%; cursor: pointer; flex-shrink: 0;
  background: var(--bg-body); border: 1px solid var(--border-color); color: var(--text-desc);
  display: flex; align-items: center; justify-content: center;
}
.rp-sheet-close:hover { color: var(--text-title); border-color: var(--primary-color); }

.setting-group-box { display: flex; flex-direction: column; gap: 8px; }
.setting-label { font-size: 0.78rem; font-weight: 800; color: var(--text-title); }
.setting-hint { font-size: 0.68rem; color: var(--text-desc); line-height: 1.35; }

.segmented-control { display: flex; gap: 2px; padding: 3px; background: var(--bg-body); border: 1px solid var(--border-color); border-radius: var(--r-md); }
.segmented-btn {
  flex: 1; padding: 8px 10px; border: 0; background: transparent; cursor: pointer;
  border-radius: calc(var(--r-md) - 3px); color: var(--text-desc);
  font-size: 0.76rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: background var(--dur-2) ease, color var(--dur-2) ease, box-shadow var(--dur-2) ease;
}
.segmented-btn[aria-pressed="true"] { background: var(--surface); color: var(--primary-color); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); }
html.dark-mode .segmented-btn[aria-pressed="true"] { background: rgba(255, 255, 255, 0.1); }

.swatch-row { display: flex; gap: 10px; }
.swatch-btn {
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer; padding: 0;
  border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--border-color);
  transition: transform var(--dur-1) var(--ease), box-shadow var(--dur-2) ease;
}
.swatch-btn:hover { transform: scale(1.1); }
.swatch-btn[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--primary-color); }

.setting-switch-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px; background: var(--bg-body); border: 1px solid var(--border-color); border-radius: var(--r-md);
}
.setting-switch-text { display: flex; flex-direction: column; min-width: 0; }
.setting-switch-text b { font-size: 0.78rem; color: var(--text-title); font-weight: 700; }
.setting-switch-text span { font-size: 0.66rem; color: var(--text-desc); line-height: 1.3; }
.toggle-switch-wrapper { position: relative; flex-shrink: 0; }
.toggle-switch-input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.toggle-switch-label {
  display: block; width: 44px; height: 24px; border-radius: 20px; background: #cbd5e1; position: relative;
  transition: background var(--dur-2) ease; pointer-events: none;
}
.toggle-switch-label::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  transition: transform var(--dur-2) var(--ease);
}
.toggle-switch-input:checked + .toggle-switch-label { background: var(--primary-color); }
.toggle-switch-input:checked + .toggle-switch-label::after { transform: translateX(20px); }
.toggle-switch-input:focus-visible + .toggle-switch-label { outline: 2px solid var(--primary-color); outline-offset: 2px; }

.rp-casual-only { display: none; }
html[data-preset="casual"] .rp-casual-only { display: flex; }
.casual-opts { padding: 12px; border: 1px dashed var(--border-color); border-radius: var(--r-md); flex-direction: column; gap: 12px; }
.casual-opts-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.btn-text { background: none; border: 0; cursor: pointer; color: var(--primary-color); font-size: 0.72rem; font-weight: 800; }
.btn-text:hover { text-decoration: underline; }

.mode-buttons { display: flex; gap: 10px; }
.mode-btn {
  flex: 1; padding: 12px 10px; cursor: pointer; border-radius: var(--r-md);
  background: var(--bg-body); border: 1px solid var(--border-color); color: var(--text-title);
  font-size: 0.78rem; font-weight: 700;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  transition: border-color var(--dur-2) ease, transform var(--dur-1) var(--ease);
}
.mode-btn:hover { border-color: var(--primary-color); color: var(--primary-color); }
.mode-btn:active { transform: scale(0.97); }
.mode-btn svg { stroke: currentColor; fill: none; stroke-width: 2.2; }

/* ---------- 8. DRAWER NAVIGASI HP ---------- */
.raproj-sidebar-overlay, .raproj-mobile-drawer { display: none; }

/* ---------- 9. MODE FOCUS & MODE WEB ---------- */
.mini-focus-top-bar {
  position: fixed; top: 10px; left: 10px; z-index: 100010; display: none; align-items: center; gap: 8px;
  padding: 4px 10px 4px 6px; border-radius: var(--r-pill);
  background: var(--hdr-bg-glass); border: 1px solid var(--hdr-border);
  -webkit-backdrop-filter: blur(16px) saturate(170%); backdrop-filter: blur(16px) saturate(170%);
  box-shadow: var(--shadow-md);
  transition: opacity var(--dur-3) ease;
}
.mini-focus-top-bar.is-dim { opacity: 0.3; }
.mini-focus-top-bar:hover, .mini-focus-top-bar:focus-within { opacity: 1; }
.mini-brand { display: flex; align-items: center; gap: 6px; font-size: 0.72rem; font-weight: 800; color: var(--text-title); }
.mini-brand img { width: 22px; height: 22px; object-fit: contain; border-radius: 50%; }
html.dark-mode .mini-brand img { background: #fff; padding: 2px; }
.mini-exit {
  display: flex; align-items: center; gap: 3px; cursor: pointer; padding: 3px 9px;
  background: rgba(239, 68, 68, 0.12); border: 1px solid rgba(239, 68, 68, 0.25); color: var(--danger-color);
  border-radius: var(--r-pill); font-size: 0.64rem; font-weight: 800;
}
body.is-focus-mode .raproj-custom-header, body.is-fullscreen-mode .raproj-custom-header,
body.is-focus-mode .raproj-sidebar-overlay, body.is-fullscreen-mode .raproj-sidebar-overlay { display: none !important; }
body.is-focus-mode .mini-focus-top-bar, body.is-fullscreen-mode .mini-focus-top-bar { display: flex; }
body.is-focus-mode .raproj-content-viewport, body.is-fullscreen-mode .raproj-content-viewport { padding-top: 50px; }

/* ---------- 10. TOAST ---------- */
#rpToastHost {
  position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); z-index: 100050;
  transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px;
  width: min(92vw, 380px); pointer-events: none;
}
.rp-toast {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px; max-width: 100%;
  background: var(--text-title); color: var(--bg-body); border-radius: var(--r-pill);
  font-size: 0.8rem; font-weight: 600; box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(12px) scale(0.96);
  transition: opacity var(--dur-2) ease, transform var(--dur-3) var(--ease);
}
.rp-toast.show { opacity: 1; transform: none; }
.rp-toast::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--primary-color); flex-shrink: 0; }
.rp-toast.success::before { background: var(--success-color); }
.rp-toast.error::before { background: var(--danger-color); }
.rp-toast.warning::before { background: var(--warning-color); }

/* ---------- 11. RESPONSIF (HP) ---------- */
@media (max-width: 768px) {
  :root { --hdr-h: 52px; --hdr-pad-x: 12px; }
  html:not([data-preset="casual"]) { --hdr-w: calc(100% - 16px); --hdr-mt: 8px; --hdr-top: 8px; }
  html[data-preset="casual"][data-header="float"] { --hdr-w: calc(100% - 16px); --hdr-mt: 8px; --hdr-top: 8px; }
  html[data-preset="casual"][data-density="compact"] { --hdr-h: 46px; }
  .raproj-custom-header { padding: 0 var(--hdr-pad-x); }
  .header-nav-icons { display: none; }
  .btn-mobile-hamburger { display: flex; }
  .header-right-actions { gap: 6px; }
  .raproj-content-viewport { padding: 12px; padding-top: 10px; }
  .header-left-brand.has-page-title .header-brand-text { display: none; }
  .header-left-brand.has-page-title .header-page-title { display: block; max-width: 44vw; }

  /* settings jadi bottom sheet */
  .rp-sheet-overlay { align-items: flex-end; padding: 0; }
  .rp-sheet { max-width: 100%; max-height: 88vh; border-radius: var(--r-lg) var(--r-lg) 0 0; padding-bottom: max(20px, env(safe-area-inset-bottom)); transform: translateY(100%); }
  .rp-sheet::before { content: ''; align-self: center; width: 38px; height: 4px; border-radius: 4px; background: var(--border-color); margin: -8px 0 -6px; }

  /* drawer */
  .raproj-sidebar-overlay {
    display: block; position: fixed; inset: 0; z-index: 100000;
    background: rgba(15, 23, 42, 0.55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
    opacity: 0; visibility: hidden; transition: opacity var(--dur-3) ease, visibility var(--dur-3);
  }
  .raproj-sidebar-overlay.active { opacity: 1; visibility: visible; }
  .raproj-mobile-drawer {
    position: absolute; top: 0; left: 0; bottom: 0; width: min(290px, 84vw);
    display: flex; flex-direction: column; gap: 14px; padding: 18px 14px max(18px, env(safe-area-inset-bottom));
    background: var(--surface); border-radius: 0 var(--r-lg) var(--r-lg) 0; box-shadow: var(--shadow-lg);
    transform: translateX(-100%); transition: transform var(--dur-3) var(--ease-out);
  }
  .raproj-sidebar-overlay.active .raproj-mobile-drawer { transform: none; }
  .drawer-header { display: flex; align-items: center; justify-content: space-between; }
  .drawer-title { font-size: 0.9rem; font-weight: 800; color: var(--text-title); }
  .drawer-user { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--r-md); background: var(--bg-body); border: 1px solid var(--border-color); }
  .drawer-user .dd-avatar { width: 38px; height: 38px; font-size: 0.82rem; }
  .drawer-user.is-vip .dd-avatar { background: linear-gradient(135deg, #1e293b, #0f172a); color: var(--gold); box-shadow: 0 0 0 2px var(--gold); }
  .drawer-menu-list { display: flex; flex-direction: column; gap: 4px; overflow-y: auto; flex: 1; }
  .drawer-menu-item {
    display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: var(--r-pill);
    color: var(--text-main); font-size: 0.86rem; font-weight: 600; text-decoration: none;
    transition: background var(--dur-2) ease, color var(--dur-2) ease;
  }
  .drawer-menu-item:hover { background: var(--primary-soft); color: var(--primary-color); }
  .drawer-menu-item.active { background: var(--primary-color); color: #fff; box-shadow: 0 4px 14px var(--primary-glow); }
  .drawer-menu-item svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2.2; }
  .drawer-menu-item .menu-emoji { font-size: 1.1rem; }
  .drawer-menu-icon { display: flex; align-items: center; justify-content: center; width: 22px; }
  .raproj-sidebar-overlay.active .drawer-menu-item { animation: rp-drawer-in var(--dur-3) var(--ease) both; animation-delay: calc(var(--i, 0) * 40ms * var(--m)); }
  .drawer-foot { display: flex; gap: 8px; padding-top: 12px; border-top: 1px solid var(--border-color); }
  .drawer-foot .dd-row { flex: 1; justify-content: center; border: 1px solid var(--border-color); padding: 9px; }
}
@keyframes rp-drawer-in { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  :root { --m: 0 !important; }
  *, *::before, *::after { scroll-behavior: auto !important; }
}

/* ---------- NOTIFIKASI (popup) ---------- */
[hidden] { display: none !important; }
.dd-count { margin-left: auto; min-width: 20px; padding: 2px 7px; border-radius: var(--r-pill); background: var(--danger-color); color: #fff; font-size: 0.64rem; font-weight: 800; text-align: center; line-height: 1.3; }
.notif-sheet { max-width: 460px; gap: 12px; }
.notif-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.notif-toolbar .btn-text:disabled { opacity: 0.4; cursor: default; text-decoration: none; }
.notif-scroll { overflow-y: auto; max-height: 56vh; padding-right: 2px; overscroll-behavior: contain; }
.notif-row { position: relative; display: flex; align-items: stretch; gap: 6px; }
.notif-row .dropdown-notif-item { flex: 1; min-width: 0; }
.notif-check {
  flex-shrink: 0; width: 34px; border-radius: var(--r-md); cursor: pointer;
  background: var(--bg-body); border: 1px solid var(--border-color); color: var(--text-desc);
  display: flex; align-items: center; justify-content: center;
  transition: color var(--dur-1) ease, border-color var(--dur-1) ease, background var(--dur-1) ease;
}
.notif-check:hover { color: var(--success-color); border-color: var(--success-color); background: rgba(16, 185, 129, 0.08); }
.notif-check svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2.6; }
@media (max-width: 768px) { .notif-scroll { max-height: 62vh; } }