/* Our Schedule — liquid glass UI, warm couple aesthetic, mobile-first */
:root {
  --ink: #4A3F35;
  --ink-soft: #6E6054;
  --muted: #A89C8E;
  --kev: #7BA7D9;
  --kev-deep: #3E6FA3;
  --kev-soft: rgba(123, 167, 217, .20);
  --bby: #E89AAE;
  --bby-deep: #B0526B;
  --bby-soft: rgba(232, 154, 174, .20);
  --accent: #F4A988;
  --accent-soft: rgba(244, 169, 136, .24);
  --cream: #FFF6EE;
  --radius: 22px;
  --radius-sm: 14px;
  --pill: 999px;
  --grad-warm: linear-gradient(135deg, #F6AD8A 0%, #F0A19F 52%, #E89AAE 100%);
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-spring: cubic-bezier(.34, 1.45, .64, 1);
  --ease-sheet: cubic-bezier(.32, .72, 0, 1);
  /* Material liquid glass */
  --glass-fill: linear-gradient(155deg, rgba(255, 255, 255, .66) 0%, rgba(255, 255, 255, .30) 48%, rgba(255, 255, 255, .44) 100%);
  --glass-blur: blur(22px) saturate(190%) brightness(1.03);
  --glass-edge: inset 0 1px 0 rgba(255, 255, 255, .95), inset 0 -1px 0 rgba(255, 255, 255, .22);
  --glass-depth: 0 1px 2px rgba(120, 80, 50, .05), 0 10px 30px -10px rgba(178, 120, 90, .32), 0 30px 60px -30px rgba(178, 120, 90, .25);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: ui-rounded, "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  min-height: 100vh;
  padding-bottom: env(safe-area-inset-bottom);
  background-color: var(--cream);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; }
.hidden { display: none !important; }
/* Ikon Solar (sprite di index.html), ikut warna teks */
.ic { width: 1.2em; height: 1.2em; flex-shrink: 0; vertical-align: -.22em; }
.view { max-width: 520px; margin: 0 auto; padding: 16px 14px 28px; min-height: 100vh; }
:focus-visible { outline: 2px solid rgba(244, 169, 136, .9); outline-offset: 2px; }

/* ---------- Latar aurora (yang dibiaskan kaca) ---------- */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.blob {
  position: absolute; border-radius: 50%;
  will-change: transform;
  animation: drift 28s ease-in-out infinite alternate;
}
.b1 { width: 72vmax; height: 72vmax; left: -26vmax; top: -32vmax; background: radial-gradient(closest-side, rgba(244, 169, 136, .58), rgba(244, 169, 136, 0)); }
.b2 { width: 62vmax; height: 62vmax; right: -26vmax; top: -8vmax; background: radial-gradient(closest-side, rgba(232, 154, 174, .52), rgba(232, 154, 174, 0)); animation-duration: 34s; animation-delay: -8s; }
.b3 { width: 84vmax; height: 70vmax; left: -12vmax; bottom: -44vmax; background: radial-gradient(closest-side, rgba(255, 206, 160, .62), rgba(255, 206, 160, 0)); animation-duration: 40s; animation-delay: -16s; }
.b4 { width: 48vmax; height: 48vmax; right: -16vmax; bottom: -14vmax; background: radial-gradient(closest-side, rgba(123, 167, 217, .30), rgba(123, 167, 217, 0)); animation-duration: 30s; animation-delay: -4s; }
.b5 { width: 36vmax; height: 36vmax; left: -10vmax; top: 40vh; background: radial-gradient(closest-side, rgba(232, 154, 174, .30), rgba(232, 154, 174, 0)); animation-duration: 36s; animation-delay: -20s; }
@keyframes drift {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(4vmax, 3vmax, 0) scale(1.08); }
  100% { transform: translate3d(-3vmax, 5vmax, 0) scale(.95); }
}
/* Grain halus: latar terasa bertekstur, kaca terlihat lebih bening */
.bg::after {
  content: ""; position: absolute; inset: 0; opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .29 0 0 0 0 .25 0 0 0 0 .21 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Glass surface ---------- */
.glass {
  position: relative;
  background: var(--glass-fill);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 0;
  box-shadow: var(--glass-edge), var(--glass-depth);
}
/* Rim cahaya: tepi kaca yang menangkap cahaya di sudut kiri-atas & kanan-bawah */
.glass::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: linear-gradient(140deg, rgba(255, 255, 255, .95) 0%, rgba(255, 255, 255, .25) 28%, rgba(255, 255, 255, 0) 50%, rgba(255, 255, 255, .18) 72%, rgba(255, 255, 255, .8) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* ---------- Login ---------- */
#login-view {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding-top: 40px; padding-bottom: 40px;
  overflow: hidden; /* gelembung dekorasi boleh keluar kartu, tapi jangan bikin scroll samping */
}
.login-stage { position: relative; width: 100%; max-width: 380px; }
.login-card {
  z-index: 1;
  border-radius: 34px;
  padding: 34px 28px 28px;
  text-align: center;
  animation: pop-in .7s var(--ease-spring) backwards;
}
.login-card.shake { animation: shake .45s var(--ease-out); }
@keyframes shake {
  20% { transform: translateX(-8px); }
  40% { transform: translateX(7px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(2px); }
}
.login-heart {
  width: 64px; height: 64px; margin: 0 auto 18px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: #E8708F;
  background: radial-gradient(120% 120% at 30% 18%, rgba(255, 255, 255, .95), rgba(255, 255, 255, .38) 55%, rgba(244, 169, 136, .28));
  box-shadow: inset 0 1px 1px #fff, inset 0 -5px 12px rgba(232, 154, 174, .32), 0 12px 26px -10px rgba(232, 154, 174, .65);
  animation: float 5s ease-in-out infinite;
}
.login-heart .ic { width: 32px; height: 32px; }
.login-card h1 {
  margin: 6px 0 4px; padding: 0 4px 4px; /* ruang untuk ekor huruf italic */
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-style: italic; font-weight: 600;
  font-size: 46px; line-height: 1.05; letter-spacing: -.8px;
  background: linear-gradient(100deg, var(--ink) 25%, #9A5E60 75%, #B0526B);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
/* Garis pemisah tipis yang memudar di kedua ujung */
#login-form::before {
  content: ""; display: block; height: 1px; margin: 24px 6px 20px;
  background: linear-gradient(90deg, transparent, rgba(74, 63, 53, .16), transparent);
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Pilih user: dua avatar dihubungkan hati ---------- */
.user-select { display: flex; align-items: flex-start; justify-content: center; gap: 4px; }
.user-opt.kev { --tint: 123, 167, 217; --tint-deep: 62, 111, 163; }
.user-opt.bby { --tint: 232, 154, 174; --tint-deep: 176, 82, 107; }
.user-opt {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 6px 10px; border: 0; border-radius: 20px;
  background: none; cursor: pointer;
  font-size: 14px; font-weight: 800; color: var(--muted);
  transition: color .25s ease;
}
.user-avatar {
  position: relative; width: 72px; height: 72px; border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(120% 120% at 30% 15%, #fff, rgba(var(--tint), .3));
  box-shadow: inset 0 1px 1px #fff, inset 0 -3px 8px rgba(var(--tint-deep), .14), 0 0 0 2px rgba(255, 255, 255, .7), 0 8px 18px -10px rgba(120, 80, 50, .4);
  opacity: .55; filter: grayscale(.45);
  transition: opacity .3s ease, filter .3s ease, transform .45s var(--ease-spring), box-shadow .3s ease;
}
.user-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.user-initial { font-size: 26px; font-weight: 800; color: rgb(var(--tint-deep)); }
.user-check {
  position: absolute; right: -2px; bottom: -2px;
  width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center;
  color: #fff;
  background: linear-gradient(135deg, rgb(var(--tint)), rgb(var(--tint-deep)));
  box-shadow: 0 0 0 2.5px #fff, 0 3px 8px -2px rgba(var(--tint-deep), .6);
  opacity: 0; scale: .4;
  transition: opacity .2s ease, scale .4s var(--ease-spring);
}
.user-check .ic { width: 15px; height: 15px; }
.user-opt.selected { color: var(--ink); }
.user-opt.selected .user-avatar { opacity: 1; filter: none; }
/* Tetesan liquid glass di belakang avatar terpilih (posisi & animasi tarik dari JS) */
.user-select { position: relative; }
.user-opt, .user-link { position: relative; z-index: 1; }
.user-blob {
  position: absolute; left: 0; top: 0; z-index: 0;
  width: 88px; height: 88px; border-radius: 50%;
  pointer-events: none; opacity: 0;
  background: radial-gradient(120% 120% at 30% 20%, rgba(255, 255, 255, .8), rgba(255, 255, 255, .25) 55%, rgba(var(--tint), .3));
  -webkit-backdrop-filter: blur(6px) saturate(170%);
  backdrop-filter: blur(6px) saturate(170%);
  box-shadow:
    inset 0 1px 1px #fff,
    inset 0 -4px 10px rgba(var(--tint-deep), .2),
    inset 0 0 0 1.5px rgba(255, 255, 255, .75),
    0 0 0 2.5px rgba(var(--tint), .75),
    0 14px 28px -10px rgba(var(--tint-deep), .6);
  transition: box-shadow .45s ease, background .45s ease, opacity .3s ease;
  will-change: transform;
}
.user-blob.is-ready { opacity: 1; }
.user-blob.kev { --tint: 123, 167, 217; --tint-deep: 62, 111, 163; }
.user-blob.bby { --tint: 232, 154, 174; --tint-deep: 176, 82, 107; }
/* Kilau specular di kiri-atas tetesan */
.user-blob::before {
  content: ""; position: absolute; left: 16%; top: 7%; width: 46%; height: 26%;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, .95), rgba(255, 255, 255, 0));
}
.user-opt.selected .user-check { opacity: 1; scale: 1; }
.user-link {
  display: flex; align-items: center; gap: 6px;
  margin-top: 33px; /* sejajar dengan tengah avatar */
  color: rgba(232, 154, 174, .85);
}
.user-link .ic { width: 16px; height: 16px; }
.user-link::before, .user-link::after { content: ""; width: 14px; height: 1.5px; border-radius: 2px; background: rgba(232, 154, 174, .4); }
.user-link { animation: heartbeat 2.4s ease-in-out infinite; }
@keyframes heartbeat { 0%, 60%, 100% { transform: scale(1); } 10% { transform: scale(1.18); } 20% { transform: scale(1); } 30% { transform: scale(1.1); } }
@media (hover: hover) {
  .user-opt:hover:not(.selected) .user-avatar { opacity: .85; filter: grayscale(.1); }
  .user-opt:hover:not(.selected) { color: var(--ink-soft); }
}

/* ---------- Password: ikon gembok + tombol lihat ---------- */
.pass-field { position: relative; margin-top: 24px; }
.pass-field input { padding: 14px 50px 14px 46px; }
.pass-icon {
  position: absolute; left: 16px; top: 50%; width: 18px; height: 18px;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none; transition: color .2s ease;
}
.pass-field:focus-within .pass-icon { color: #E07F5C; }
.pass-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px; padding: 0; border: 0; border-radius: 50%;
  display: grid; place-items: center;
  background: transparent; color: var(--muted); cursor: pointer;
  transition: background .2s ease, color .2s ease;
}
.pass-toggle .ic { width: 20px; height: 20px; }
@media (hover: hover) { .pass-toggle:hover { background: rgba(255, 255, 255, .7); color: var(--ink); } }

.login-foot { margin: 20px 0 0; text-align: center; font-size: 12.5px; font-weight: 700; letter-spacing: .3px; color: var(--muted); }
.foot-heart { width: 14px; height: 14px; margin: 0 1px; vertical-align: -2px; color: var(--bby); animation: heartbeat 2.4s ease-in-out infinite; }

/* Gelembung kaca dekoratif di belakang kartu (terlihat buram lewat kaca) */
.login-orb {
  position: absolute; z-index: 0; border-radius: 50%; pointer-events: none;
  background: radial-gradient(120% 120% at 30% 20%, rgba(255, 255, 255, .95), rgba(255, 255, 255, .3) 45%, rgba(var(--c), .5) 100%);
  box-shadow: inset 0 -6px 14px rgba(var(--c), .35), inset 0 2px 2px #fff, 0 16px 34px -12px rgba(var(--c), .65);
  animation: float 7s ease-in-out infinite;
}
.login-orb.o1 { --c: 244, 169, 136; width: 120px; height: 120px; top: -46px; right: -40px; }
.login-orb.o2 { --c: 123, 167, 217; width: 76px; height: 76px; bottom: 96px; left: -42px; animation-duration: 8s; animation-delay: -2.5s; }
.login-orb.o3 { --c: 232, 154, 174; width: 46px; height: 46px; bottom: 18px; right: -18px; animation-duration: 6s; animation-delay: -4s; }

/* Thumb "cair": memipih sesaat ketika pindah */
.squish { animation: squish .55s var(--ease-out); }
@keyframes squish {
  0% { scale: 1 1; }
  30% { scale: 1.1 .84; }
  65% { scale: .97 1.04; }
  100% { scale: 1 1; }
}

/* ---------- Form ---------- */
label { display: block; text-align: left; font-size: 13px; font-weight: 700; margin: 14px 2px 6px; color: var(--ink-soft); }
label .opt { font-weight: 600; color: var(--muted); }
/* Field: default lebih kontras, hover, focus (ring + label ikut berwarna),
   terisi, invalid (setelah user berinteraksi), disabled */
:root {
  --field-bg: rgba(255, 255, 255, .66);
  --field-border: rgba(150, 120, 95, .24);
  --field-border-hover: rgba(224, 127, 92, .5);
  --field-focus: #EE9A78;
  --field-ring: 0 0 0 4px rgba(244, 169, 136, .28), 0 6px 16px -8px rgba(224, 127, 92, .45);
  --field-inset: inset 0 1px 2px rgba(140, 95, 60, .08), 0 1px 0 rgba(255, 255, 255, .7);
  --field-invalid: #D9576A;
}
label { transition: color .2s ease; }
label:focus-within { color: #D9714F; }
input, select, textarea {
  width: 100%;
  font-size: 16px;
  font-weight: 600;
  padding: 13px 16px;
  border: 1.5px solid var(--field-border);
  border-radius: var(--radius-sm);
  background: var(--field-bg);
  color: var(--ink);
  box-shadow: var(--field-inset);
  transition: background .2s ease, border-color .2s ease, box-shadow .25s ease;
}
input::placeholder, textarea::placeholder { color: rgba(140, 125, 110, .7); font-weight: 500; }
input:not(:placeholder-shown):not(.switch), textarea:not(:placeholder-shown) { background: rgba(255, 255, 255, .82); }
input:focus, select:focus, textarea:focus {
  outline: none;
  background: #fff;
  border-color: var(--field-focus);
  box-shadow: var(--field-ring);
}
input:user-invalid, textarea:user-invalid {
  border-color: var(--field-invalid);
  box-shadow: 0 0 0 4px rgba(217, 87, 106, .16);
}
label:has(:user-invalid) { color: var(--field-invalid); }
input:disabled, textarea:disabled, .picker-field:disabled { opacity: .5; cursor: not-allowed; }
textarea { resize: vertical; }

/* ---------- Toggle "Seharian" (switch liquid glass) ---------- */
.switch-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 10px 10px 14px;
  border: 1.5px solid var(--field-border);
  border-radius: var(--radius-sm);
  background: var(--field-bg);
  box-shadow: var(--field-inset);
  color: var(--ink);
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease, box-shadow .25s ease;
}
.switch-text { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 800; }
.switch-text > span { display: flex; flex-direction: column; line-height: 1.2; }
.switch-text small { font-size: 12px; font-weight: 600; color: var(--muted); }
.switch-text .ic {
  width: 36px; height: 36px; padding: 8px; flex-shrink: 0;
  border-radius: 11px;
  color: #D9714F; background: rgba(244, 169, 136, .16);
  box-shadow: inset 0 0 0 1px rgba(244, 169, 136, .24);
  transition: color .25s ease, background .25s ease, transform .5s var(--ease-spring);
}
.switch-row:has(.switch:checked) { border-color: rgba(238, 154, 120, .7); background: rgba(255, 255, 255, .88); }
.switch-row:has(.switch:checked) .switch-text .ic { color: #fff; background: var(--grad-warm); transform: scale(1.06); box-shadow: 0 4px 10px -3px rgba(232, 140, 150, .7); }
.switch-row:has(.switch:focus-visible) { border-color: var(--field-focus); box-shadow: var(--field-ring); }
@media (hover: hover) { .switch-row:hover { border-color: var(--field-border-hover); } }

.switch-row input.switch {
  -webkit-appearance: none; appearance: none;
  position: relative; flex-shrink: 0;
  width: 52px; height: 32px; margin: 0; padding: 0;
  border: 0; border-radius: var(--pill);
  cursor: pointer;
  background: rgba(150, 120, 95, .2);
  box-shadow: inset 0 1px 3px rgba(120, 80, 50, .2), inset 0 0 0 1px rgba(255, 255, 255, .45);
  transition: background .3s ease, box-shadow .3s ease;
}
.switch-row input.switch:focus { outline: none; }
/* Thumb: tetesan kaca yang memanjang saat ditekan, lalu meluncur dengan pegas */
.switch-row input.switch::before {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 26px; height: 26px; border-radius: var(--pill);
  background: radial-gradient(120% 120% at 30% 20%, #fff, rgba(255, 255, 255, .88) 60%, rgba(240, 228, 222, .95));
  box-shadow: 0 3px 8px -2px rgba(120, 80, 50, .4), inset 0 -1px 2px rgba(120, 80, 50, .1), inset 0 1px 0 #fff;
  transition: transform .5s var(--ease-spring), width .25s var(--ease-out);
}
.switch-row input.switch:active::before { width: 32px; }
.switch-row input.switch:checked {
  background: var(--grad-warm);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .55), inset 0 -2px 5px rgba(176, 82, 107, .2), 0 4px 12px -4px rgba(232, 140, 150, .75);
}
.switch-row input.switch:checked::before { transform: translateX(20px); }
.switch-row input.switch:checked:active::before { transform: translateX(14px); }

/* Baris jam menyusut halus saat "Seharian" aktif */
.time-collapse {
  display: grid; grid-template-rows: 1fr;
  transition: grid-template-rows .4s var(--ease-out), opacity .3s ease;
}
.time-collapse-inner { min-height: 0; overflow: hidden; margin: 0 -6px; padding: 0 6px 6px; } /* ruang untuk focus ring */
.time-collapse.is-collapsed { grid-template-rows: 0fr; opacity: 0; }

/* Label waktu event seharian */
.allday-tag { display: inline-flex; align-items: center; gap: 4px; color: #D9714F; }
.allday-tag .ic { width: 14px; height: 14px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.error {
  color: #C24D5C; font-size: 13px; font-weight: 700; margin: 10px 0 0;
  padding: 8px 12px; border-radius: 12px;
  background: rgba(232, 106, 106, .1);
  box-shadow: inset 0 0 0 1px rgba(232, 106, 106, .18);
}

/* ---------- Buttons ---------- */
.btn-primary {
  position: relative; isolation: isolate; overflow: hidden;
  background: var(--grad-warm);
  color: #fff;
  border: 0;
  border-radius: var(--pill);
  padding: 14px 22px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: .2px;
  width: 100%;
  margin-top: 20px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  cursor: pointer;
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, .75),
    inset 0 -3px 8px rgba(176, 82, 107, .26),
    inset 0 0 0 1px rgba(255, 255, 255, .22),
    0 10px 24px -8px rgba(232, 140, 150, .75),
    0 2px 6px rgba(224, 127, 92, .18);
  text-shadow: 0 1px 2px rgba(160, 70, 80, .28);
}
/* Kilau specular di separuh atas tombol gel */
.btn-primary::before {
  content: ""; position: absolute; z-index: -1;
  inset: 0 0 35% 0;
  background: radial-gradient(75% 100% at 50% 0%, rgba(255, 255, 255, .5), rgba(255, 255, 255, 0) 100%);
  pointer-events: none;
}
/* Sapuan cahaya saat hover */
.btn-primary::after {
  content: ""; position: absolute; z-index: -1;
  top: -20%; bottom: -20%; left: -40%; width: 30%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .45), transparent);
  transform: translateX(-120%) skewX(-18deg);
  pointer-events: none;
}
@keyframes sheen { to { transform: translateX(620%) skewX(-18deg); } }
.btn-primary:active { transform: scale(.97); }
.btn-soft {
  display: inline-flex; align-items: center; gap: 7px;
  border: 0;
  border-radius: var(--pill);
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
  cursor: pointer;
  background: rgba(255, 255, 255, .5);
  box-shadow: inset 0 1px 0 #fff, inset 0 0 0 1px rgba(255, 255, 255, .5), 0 2px 8px -2px rgba(140, 95, 60, .14);
}
.btn-soft .ic { color: #E07F5C; }
.btn-soft:active { transform: scale(.95); }
.btn-ghost {
  background: transparent;
  border: none;
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  padding: 11px 16px;
  cursor: pointer;
  border-radius: var(--pill);
}
.btn-ghost:active { transform: scale(.96); }
.icon-btn {
  width: 42px; height: 42px;
  flex-shrink: 0;
  display: inline-grid; place-items: center;
  border: 0; border-radius: 50%; padding: 0;
  font-size: 22px;
  line-height: 1;
  color: var(--ink);
  cursor: pointer;
  background: radial-gradient(120% 120% at 30% 15%, rgba(255, 255, 255, .92), rgba(255, 255, 255, .45) 60%, rgba(255, 255, 255, .55));
  -webkit-backdrop-filter: blur(14px) saturate(180%);
  backdrop-filter: blur(14px) saturate(180%);
  box-shadow: inset 0 1px 1px #fff, inset 0 -1px 2px rgba(178, 120, 90, .12), inset 0 0 0 1px rgba(255, 255, 255, .5), 0 6px 16px -6px rgba(178, 120, 90, .38);
}
.icon-btn:active { transform: scale(.9); }
.icon-btn .ic { width: 20px; height: 20px; }
.cal-header .icon-btn .ic { width: 22px; height: 22px; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: max(10px, env(safe-area-inset-top)); z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border-radius: 26px;
  padding: 10px 10px 10px 20px;
  margin-bottom: 12px;
}
.app-title { margin: 0; font-size: 19px; font-weight: 800; letter-spacing: -.2px; }
.title-ic { color: var(--bby); }
.cal-sub { margin: 1px 0 0; font-size: 12.5px; font-weight: 600; color: var(--muted); }

/* ---------- Segmented control ---------- */
.seg {
  position: relative;
  display: flex;
  border-radius: var(--pill);
  padding: 5px;
  margin-bottom: 16px;
}
.seg-thumb {
  position: absolute;
  top: 5px; bottom: 5px; left: 0;
  border-radius: var(--pill);
  background: linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(255, 255, 255, .7));
  box-shadow: inset 0 1px 0 #fff, inset 0 -2px 5px rgba(244, 169, 136, .18), 0 6px 16px -4px rgba(232, 154, 174, .5), 0 1px 3px rgba(120, 80, 50, .12);
  transition: transform .5s var(--ease-spring), width .4s var(--ease-out);
  z-index: 0;
}
.seg button {
  flex: 1;
  position: relative; z-index: 1;
  border: none; background: none;
  padding: 10px 0;
  font-size: 14px; font-weight: 800;
  color: var(--muted);
  cursor: pointer;
  border-radius: var(--pill);
  transition: color .25s ease;
}
.seg button.active { color: var(--ink); }

/* ---------- Month view ---------- */
#month-wrap { border-radius: 28px; padding: 14px 12px 12px; }
.cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-header h2 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -.2px; }
.dow-row {
  display: grid; grid-template-columns: repeat(7, 1fr);
  text-align: center; font-size: 11px; font-weight: 800; color: var(--muted);
  letter-spacing: .5px; text-transform: uppercase;
  padding: 6px 0 8px;
}
.dow-row span:nth-child(n+6) { color: rgba(176, 82, 107, .6); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.day-cell {
  /* tanpa backdrop-filter: 42 sel blur bikin patah-patah di HP */
  position: relative;
  background: linear-gradient(160deg, rgba(255, 255, 255, .64), rgba(255, 255, 255, .26));
  border: 0;
  border-radius: 16px;
  min-height: 62px;
  padding: 6px 3px;
  font-size: 13px;
  color: inherit;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), inset 0 0 0 1px rgba(255, 255, 255, .42), 0 2px 6px -2px rgba(178, 120, 90, .2);
  overflow: hidden;
  transition: transform .3s var(--ease-spring), box-shadow .2s ease, background .2s ease;
}
.day-cell.other { opacity: .4; pointer-events: none; background: rgba(255, 255, 255, .18); box-shadow: none; }
.day-cell.today {
  background: linear-gradient(160deg, rgba(255, 255, 255, .88), rgba(255, 233, 220, .6));
  box-shadow: inset 0 1px 0 #fff, inset 0 0 0 1.5px rgba(244, 169, 136, .7), 0 8px 18px -8px rgba(244, 169, 136, .75);
}
.day-cell.selected { box-shadow: inset 0 1px 0 #fff, inset 0 0 0 1.5px var(--bby); }
.day-num {
  width: 24px; height: 24px; line-height: 24px;
  margin: 0 auto 4px;
  border-radius: 50%;
  font-weight: 800; font-size: 13px; text-align: center;
}
.day-cell.today .day-num {
  background: var(--grad-warm); color: #fff;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .6), 0 3px 8px -2px rgba(232, 140, 150, .75);
}
.ev-chip {
  font-size: 10px;
  border-radius: var(--pill);
  padding: 2px 6px;
  margin: 2px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 700;
}
.ev-chip.kev { background: var(--kev-soft); color: var(--kev-deep); }
.ev-chip.bby { background: var(--bby-soft); color: var(--bby-deep); }
.ev-more { font-size: 10px; color: var(--muted); text-align: center; }
.ev-count { display: flex; flex-wrap: wrap; gap: 3px; justify-content: center; }
/* Badge jumlah jadwal: tetesan gel */
.cnt {
  min-width: 19px; height: 19px; padding: 0 5px;
  border-radius: var(--pill); font-size: 10.5px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff;
  text-shadow: 0 1px 1px rgba(0, 0, 0, .12);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .6), inset 0 -1px 2px rgba(0, 0, 0, .08), 0 3px 6px -2px var(--glow);
}
.cnt.kev { --glow: rgba(62, 111, 163, .6); background: radial-gradient(120% 120% at 30% 15%, #B2CDEC, var(--kev) 55%, #6893C8); }
.cnt.bby { --glow: rgba(176, 82, 107, .5); background: radial-gradient(120% 120% at 30% 15%, #F6C6D2, var(--bby) 55%, #DA87A0); }
/* Layar HP: dua badge harus muat sejajar di sel selebar ~43px */
@media (max-width: 420px) {
  .cal-grid { gap: 5px; }
  .day-cell { padding: 6px 2px; }
  .ev-count { gap: 2px; }
  .cnt { min-width: 16px; height: 16px; padding: 0 4px; font-size: 9.5px; }
}

.legend { display: flex; justify-content: center; gap: 8px; margin: 14px 0 2px; }
.legend-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px 6px 9px; border-radius: var(--pill);
  font-size: 12px; font-weight: 800; color: var(--ink-soft);
  background: rgba(255, 255, 255, .4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), inset 0 0 0 1px rgba(255, 255, 255, .45);
}
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; box-shadow: inset 0 1px 1px rgba(255, 255, 255, .6), 0 0 6px var(--glow); }
.dot.kev { --glow: rgba(123, 167, 217, .8); background: var(--kev); }
.dot.bby { --glow: rgba(232, 154, 174, .8); background: var(--bby); }

/* ---------- Agenda view ---------- */
#agenda-list { padding-bottom: 4px; }
.agenda-day { margin: 20px 0 4px; }
.agenda-day:first-child { margin-top: 4px; }
.agenda-date {
  display: flex; align-items: center; gap: 11px;
  margin: 0 4px 10px;
  animation: rise .55s var(--ease-out) backwards;
  animation-delay: calc(min(var(--i, 0), 14) * 40ms);
}
.ad-num {
  width: 42px; height: 42px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 14px;
  font-size: 17px; font-weight: 800;
  background: linear-gradient(160deg, rgba(255, 255, 255, .8), rgba(255, 255, 255, .4));
  box-shadow: inset 0 1px 0 #fff, inset 0 0 0 1px rgba(255, 255, 255, .5), 0 6px 14px -6px rgba(178, 120, 90, .4);
}
.agenda-day.is-today .ad-num {
  background: var(--grad-warm); color: #fff;
  text-shadow: 0 1px 2px rgba(160, 70, 80, .25);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .7), inset 0 -2px 5px rgba(176, 82, 107, .22), 0 8px 18px -6px rgba(232, 140, 150, .75);
}
.ad-meta { display: flex; flex-direction: column; line-height: 1.2; }
.ad-day { font-size: 15px; font-weight: 800; }
.ad-month { font-size: 12px; font-weight: 600; color: var(--muted); }
.rel-pill {
  font-size: 11px; font-weight: 800;
  background: var(--grad-warm);
  color: #fff;
  padding: 4px 11px; border-radius: var(--pill);
  text-shadow: 0 1px 1px rgba(160, 70, 80, .25);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .65), 0 4px 10px -3px rgba(232, 140, 150, .7);
}
.ag-item {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  border-radius: var(--radius);
  padding: 14px 14px 14px 10px;
  margin-bottom: 10px;
  cursor: pointer;
  font-size: inherit; color: inherit; text-align: left;
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  backdrop-filter: blur(16px) saturate(180%);
  animation: rise .55s var(--ease-out) backwards;
  animation-delay: calc(min(var(--i, 0), 14) * 40ms);
}
.ag-item.kev { background: radial-gradient(90% 160% at 0% 50%, rgba(123, 167, 217, .2), transparent 60%), var(--glass-fill); }
.ag-item.bby { background: radial-gradient(90% 160% at 0% 50%, rgba(232, 154, 174, .22), transparent 60%), var(--glass-fill); }
.ag-item:active { transform: scale(.985); }
.ag-bar { width: 5px; align-self: stretch; border-radius: var(--pill); flex-shrink: 0; }
.ag-item.kev .ag-bar { background: linear-gradient(180deg, #B2CDEC, var(--kev)); box-shadow: 0 0 10px rgba(123, 167, 217, .7); }
.ag-item.bby .ag-bar { background: linear-gradient(180deg, #F6C6D2, var(--bby)); box-shadow: 0 0 10px rgba(232, 154, 174, .7); }
.ag-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.ag-time { font-size: 12px; color: var(--muted); font-weight: 800; letter-spacing: .2px; }
.ag-title { font-size: 16px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-who { flex-shrink: 0; display: inline-flex; }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.98); } }

/* ---------- Action bar (dock kaca melayang) ---------- */
.actionbar {
  position: sticky; bottom: max(14px, env(safe-area-inset-bottom)); z-index: 15;
  display: flex; gap: 8px; align-items: center;
  margin-top: 18px;
  padding: 6px;
  border-radius: var(--pill);
}
.actionbar .btn-soft { flex: 0 0 auto; margin: 0; }
.actionbar .btn-primary { flex: 1; margin-top: 0; width: auto; }

/* ---------- Modal ---------- */
.modal {
  position: fixed; inset: 0;
  background: rgba(74, 63, 53, .26);
  -webkit-backdrop-filter: blur(8px) saturate(140%);
  backdrop-filter: blur(8px) saturate(140%);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 50;
  animation: fade-in .25s ease backwards;
}
.modal-card {
  width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto; overscroll-behavior: contain;
  padding: 10px 20px calc(22px + env(safe-area-inset-bottom));
  border-radius: 30px 30px 0 0;
  background: linear-gradient(180deg, rgba(255, 251, 247, .86), rgba(255, 245, 237, .76));
  -webkit-backdrop-filter: blur(32px) saturate(190%);
  backdrop-filter: blur(32px) saturate(190%);
  box-shadow: inset 0 1px 0 #fff, inset 0 0 0 1px rgba(255, 255, 255, .55), 0 -12px 40px -12px rgba(120, 80, 50, .3);
  animation: sheet-in .5s var(--ease-sheet) backwards;
}
/* Rim ::after ikut ter-scroll di kartu yang bisa scroll, jadi diganti inset shadow */
.modal-card::after { display: none; }
/* Grabber bottom sheet */
.modal-card::before {
  content: ""; display: block;
  width: 40px; height: 5px; margin: 0 auto 12px;
  border-radius: var(--pill);
  background: rgba(74, 63, 53, .16);
}
@media (min-width: 560px) {
  .modal { align-items: center; padding: 16px; }
  .modal-card {
    border-radius: 30px;
    padding: 20px 22px 22px;
    box-shadow: inset 0 1px 0 #fff, inset 0 0 0 1px rgba(255, 255, 255, .55), 0 30px 80px -24px rgba(120, 80, 50, .45);
    animation: pop-in .45s var(--ease-spring) backwards;
  }
  .modal-card::before { display: none; }
}
@keyframes fade-in { from { opacity: 0; } }
@keyframes sheet-in { from { transform: translateY(100%); } }
@keyframes pop-in { from { opacity: 0; transform: translateY(10px) scale(.92); } }
@keyframes float { 50% { transform: translateY(-6px); } }
.modal-card label { margin: 16px 2px 0; }
.modal-card label input,
.modal-card label select,
.modal-card label textarea { margin-top: 8px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.modal-head h3 { display: flex; align-items: center; gap: 9px; margin: 0; font-size: 19px; font-weight: 800; letter-spacing: -.2px; }
.modal-head h3 .ic { color: #E07F5C; width: 22px; height: 22px; }
.modal-head .icon-btn { width: 36px; height: 36px; font-size: 20px; }
.modal-actions { display: flex; gap: 10px; margin-top: 22px; align-items: stretch; }
.modal-actions .btn-ghost { flex: 0 0 auto; display: flex; align-items: center; padding: 13px 20px; }
.modal-actions .btn-primary { flex: 1; margin-top: 0; }

/* ---------- Profile drawer (menu kaca dari tombol avatar) ---------- */
.drawer {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(74, 63, 53, .14);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  display: flex; align-items: flex-start; justify-content: flex-end;
  padding: calc(max(10px, env(safe-area-inset-top)) + 70px) max(14px, calc((100vw - 520px) / 2 + 14px)) 0 14px;
  animation: fade-in .2s ease backwards;
}
.drawer-card {
  border-radius: 26px;
  padding: 14px 8px 8px;
  width: 260px;
  background: linear-gradient(160deg, rgba(255, 253, 250, .9), rgba(255, 247, 240, .74));
  transform-origin: top right;
  animation: menu-in .42s var(--ease-spring) backwards;
}
@keyframes menu-in { from { opacity: 0; transform: scale(.82) translateY(-8px); } }
.drawer-handle { display: none; }
.drawer-card .btn-ghost .ic { width: 20px; height: 20px; color: var(--ink-soft); }
.drawer-card .btn-ghost {
  display: flex; align-items: center; gap: 10px;
  text-align: left; padding: 12px 14px; border-radius: 16px;
}
.profile-head {
  display: flex; gap: 12px; align-items: center;
  padding: 0 8px 14px; margin-bottom: 6px;
  border-bottom: 1px solid rgba(74, 63, 53, .08);
}
.profile-avatar {
  width: 48px; height: 48px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; background: rgba(255, 255, 255, .6);
}
.profile-avatar-btn {
  position: relative; width: 56px; height: 56px; border-radius: 50%;
  border: 0; padding: 0; cursor: pointer;
  background: radial-gradient(120% 120% at 30% 15%, #fff, rgba(255, 236, 224, .8));
  overflow: visible; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 26px;
  box-shadow: 0 0 0 2.5px rgba(255, 255, 255, .95), 0 0 0 4.5px rgba(244, 169, 136, .55), 0 8px 18px -6px rgba(232, 140, 150, .6);
}
.profile-avatar-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.avatar-edit {
  position: absolute; bottom: -4px; right: -4px;
  color: var(--ink-soft);
  border-radius: 50%; width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .95);
  box-shadow: inset 0 1px 0 #fff, 0 3px 8px -2px rgba(120, 80, 50, .35);
}
.avatar-edit .ic { width: 14px; height: 14px; }
.who-wrap { position: relative; display: inline-flex; width: 22px; height: 22px; flex-shrink: 0; border-radius: 50%; }
.who-wrap img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; opacity: 0; }
.who-wrap img.loaded { opacity: 1; }
.who-initial {
  display: inline-flex; align-items: center; justify-content: center;
  width: 100%; height: 100%; border-radius: 50%;
  background: rgba(244, 169, 136, .25); color: var(--accent);
  font-size: 12px; font-weight: 800;
}
.kev .who-initial { background: var(--kev-soft); color: var(--kev-deep); }
.bby .who-initial { background: var(--bby-soft); color: var(--bby-deep); }
.ag-who .who-wrap {
  width: 32px; height: 32px;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .9), 0 0 0 3.5px var(--ring, rgba(244, 169, 136, .6)), 0 4px 10px -2px rgba(120, 80, 50, .25);
}
.ag-item.kev { --ring: rgba(123, 167, 217, .7); }
.ag-item.bby { --ring: rgba(232, 154, 174, .75); }
.ag-who .who-initial { font-size: 13px; }
.ev-who img, .ag-who img { object-fit: cover; }
.profile-head h3 { margin: 0; font-size: 17px; font-weight: 800; }
.profile-sub { margin: 2px 0 0; font-size: 13px; font-weight: 600; color: var(--muted); }
.btn-block { width: 100%; text-align: center; }
.profile-btn { font-size: 18px; overflow: hidden; padding: 0; }
.avatar-initial {
  font-weight: 800; font-size: 20px; color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center;
  width: 100%; height: 100%;
}
#topbar-avatar-emoji.avatar-initial { font-size: 18px; }
.profile-btn #topbar-avatar-emoji { display: inline-flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.topbar-avatar-img { width: 42px; height: 42px; object-fit: cover; border-radius: 50%; display: block; }

/* ---------- Custom cursor: lensa liquid glass (desktop only) ---------- */
#custom-cursor { display: none; }
@media (hover: hover) and (pointer: fine) {
  html.has-cursor, html.has-cursor * { cursor: none !important; }
  #custom-cursor {
    --tint: 244, 169, 136;            /* peach */
    --tint-deep: 224, 127, 92;
    display: block; position: fixed; left: 0; top: 0; z-index: 9999;
    pointer-events: none;
    transition: opacity .25s ease;
  }
  #custom-cursor[data-tint="kev"] { --tint: 123, 167, 217; --tint-deep: 62, 111, 163; }
  #custom-cursor[data-tint="bby"] { --tint: 232, 154, 174; --tint-deep: 176, 82, 107; }
  #custom-cursor.is-hidden { opacity: 0; }
  .cur-lens, .cur-dot { position: fixed; left: 0; top: 0; will-change: transform; }
  .cur-lens {
    display: grid; place-items: center;
    width: 34px; height: 34px; border-radius: 17px;
    background: radial-gradient(120% 120% at 30% 20%, rgba(255, 255, 255, .32), rgba(255, 255, 255, .04) 58%, rgba(var(--tint), .14));
    box-shadow:
      inset 0 1px 1px rgba(255, 255, 255, .95),
      inset 0 -2px 4px rgba(var(--tint-deep), .16),
      inset 0 0 0 1px rgba(255, 255, 255, .5),
      0 0 0 .5px rgba(var(--tint), .5),
      0 6px 16px -4px rgba(178, 120, 90, .35);
    -webkit-backdrop-filter: saturate(1.6) brightness(1.06);
    backdrop-filter: saturate(1.6) brightness(1.06);
    transition: opacity .2s ease, background .25s ease, box-shadow .25s ease;
  }
  /* Kilau specular kecil di kiri-atas lensa */
  .cur-lens::before {
    content: ""; position: absolute;
    left: 16%; top: 8%; width: 48%; height: 30%;
    border-radius: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, .9), rgba(255, 255, 255, 0));
    transition: opacity .2s ease;
  }
  /* Ikon kecil di dalam lensa (× / ↕), hanya untuk mode close & scroll */
  .cur-lens::after {
    content: ""; position: relative;
    width: 16px; height: 16px;
    background: rgba(var(--tint-deep), .9);
    -webkit-mask: var(--cur-icon) center / contain no-repeat;
    mask: var(--cur-icon) center / contain no-repeat;
    opacity: 0; scale: .5;
    transition: opacity .15s ease, scale .3s var(--ease-spring);
  }
  /* .cur-dot dipindah lewat transform JS; tampilan + skala di ::before
     (scale di elemen yang sama akan ikut mengalikan posisi translate) */
  .cur-dot { width: 6px; height: 6px; }
  .cur-dot::before {
    content: ""; position: absolute; inset: 0; border-radius: 50%;
    background: linear-gradient(135deg, rgb(var(--tint)), rgb(var(--tint-deep)));
    box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .95), 0 1px 4px rgba(var(--tint-deep), .5);
    transition: opacity .15s ease, scale .25s var(--ease-spring);
  }
  #custom-cursor.is-text .cur-dot::before,
  #custom-cursor.is-scroll .cur-dot::before,
  #custom-cursor.is-close .cur-dot::before { opacity: 0; scale: .2; }

  /* Hover: lensa membesar, lebih terang, berpendar warna pemilik */
  #custom-cursor.is-hover .cur-lens {
    -webkit-backdrop-filter: saturate(1.5);
    backdrop-filter: saturate(1.5);
    background: radial-gradient(120% 120% at 30% 20%, rgba(255, 255, 255, .22), rgba(var(--tint), .06) 58%, rgba(var(--tint), .2));
    box-shadow:
      inset 0 1px 1px #fff,
      inset 0 -3px 6px rgba(var(--tint-deep), .18),
      inset 0 0 0 1.5px rgba(255, 255, 255, .6),
      0 0 0 1px rgba(var(--tint), .55),
      0 0 18px -2px rgba(var(--tint), .55),
      0 8px 18px -6px rgba(178, 120, 90, .35);
  }
  #custom-cursor.is-hover .cur-dot::before { scale: 1.3; }

  /* Text: caret kaca — inti warna dengan tepi putih supaya terlihat di atas fokus ring */
  #custom-cursor.is-text .cur-lens {
    -webkit-backdrop-filter: none; backdrop-filter: none;
    background: linear-gradient(180deg, rgb(var(--tint)), rgb(232, 154, 174));
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .9), 0 0 10px rgba(232, 154, 174, .55);
  }
  #custom-cursor.is-text .cur-lens::before { opacity: 0; }

  /* Scroll (roda jam): kapsul vertikal dengan panah ↕ */
  /* Panah kecil di ujung atas & bawah kapsul, angka di tengah tetap terbaca */
  #custom-cursor.is-scroll .cur-lens::after {
    width: 12px; height: 42px; opacity: .85; scale: 1;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22%3E%3Cpath fill=%22none%22 stroke=%22%23000%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22 stroke-width=%221.5%22 d=%22M19 15L12 9L5 15%22/%3E%3C/svg%3E") top / 12px no-repeat, url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22%3E%3Cpath fill=%22none%22 stroke=%22%23000%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22 stroke-width=%221.5%22 d=%22M19 9L12 15L5 9%22/%3E%3C/svg%3E") bottom / 12px no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22%3E%3Cpath fill=%22none%22 stroke=%22%23000%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22 stroke-width=%221.5%22 d=%22M19 15L12 9L5 15%22/%3E%3C/svg%3E") top / 12px no-repeat, url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22%3E%3Cpath fill=%22none%22 stroke=%22%23000%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22 stroke-width=%221.5%22 d=%22M19 9L12 15L5 9%22/%3E%3C/svg%3E") bottom / 12px no-repeat;
  }
  #custom-cursor.is-scroll .cur-lens::before { opacity: .6; }

  /* Close (area gelap modal): lensa dengan × */
  #custom-cursor.is-close .cur-lens {
    background: radial-gradient(120% 120% at 30% 20%, rgba(255, 255, 255, .7), rgba(255, 255, 255, .4) 60%, rgba(var(--tint), .25));
  }
  #custom-cursor.is-close .cur-lens::after { --cur-icon: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22%3E%3Cg fill=%22none%22 stroke=%22%23000%22 stroke-linecap=%22round%22 stroke-width=%221.5%22%3E%3Cpath d=%22M19.0068 5L5.00684 19%22/%3E%3Cpath d=%22M19 19L5 5%22/%3E%3C/g%3E%3C/svg%3E"); width: 18px; height: 18px; opacity: 1; scale: 1; }

  /* Riak klik: dua cincin kaca berwarna yang menyebar */
  .cur-ripple {
    position: fixed; width: 44px; height: 44px; margin: -22px 0 0 -22px;
    border-radius: 50%;
    border: 1.5px solid rgba(var(--tint), .8);
    box-shadow: inset 0 0 8px rgba(255, 255, 255, .7), 0 0 12px rgba(var(--tint), .45);
    animation: ripple .6s var(--ease-out) forwards;
  }
  .cur-ripple::after {
    content: ""; position: absolute; inset: 8px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .9);
    animation: ripple .6s .06s var(--ease-out) backwards;
  }
}
@keyframes ripple {
  from { transform: scale(.25); opacity: .9; }
  to { transform: scale(1.5); opacity: 0; }
}

/* ---------- Month slide animation ---------- */
@keyframes slide-in-right {
  from { transform: translateX(40px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes slide-in-left {
  from { transform: translateX(-40px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
.cal-grid.slide-right { animation: slide-in-right .35s var(--ease-out); }
.cal-grid.slide-left { animation: slide-in-left .35s var(--ease-out); }

/* ---------- Transitions (smooth hover) ---------- */
.btn-primary, .btn-soft, .btn-ghost, .btn-danger, .icon-btn,
.ag-item, .ev-card, .ev-del, .ev-edit, .profile-avatar-btn, .picker-field {
  transition: transform .3s var(--ease-spring), box-shadow .25s ease, background .25s ease, filter .25s ease;
}

/* ---------- Hover (desktop) ---------- */
@media (hover: hover) {
  .btn-primary:hover {
    filter: brightness(1.04) saturate(1.06);
    box-shadow:
      inset 0 1px 1px rgba(255, 255, 255, .8),
      inset 0 -3px 8px rgba(176, 82, 107, .26),
      inset 0 0 0 1px rgba(255, 255, 255, .28),
      0 14px 30px -8px rgba(232, 140, 150, .85),
      0 2px 6px rgba(224, 127, 92, .2);
  }
  .btn-primary:hover::after { animation: sheen .9s var(--ease-out); }
  .btn-soft:hover { background: rgba(255, 255, 255, .78); }
  .btn-ghost:hover { background: rgba(255, 255, 255, .55); box-shadow: inset 0 1px 0 #fff, inset 0 0 0 1px rgba(255, 255, 255, .6); }
  .btn-danger:hover { filter: brightness(1.06); }
  .icon-btn:hover {
    transform: translateY(-1px);
    box-shadow: inset 0 1px 1px #fff, inset 0 -1px 2px rgba(178, 120, 90, .12), inset 0 0 0 1px rgba(255, 255, 255, .6), 0 10px 22px -8px rgba(178, 120, 90, .45);
  }
  .day-cell:hover {
    background: linear-gradient(160deg, rgba(255, 255, 255, .92), rgba(255, 255, 255, .5));
    transform: translateY(-2px);
    box-shadow: inset 0 1px 0 #fff, inset 0 0 0 1px rgba(244, 169, 136, .45), 0 10px 20px -8px rgba(178, 120, 90, .4);
  }
  .day-cell:active { transform: translateY(0) scale(.96); }
  .ag-item:hover { transform: translateY(-2px); box-shadow: var(--glass-edge), 0 2px 4px rgba(120, 80, 50, .05), 0 18px 34px -14px rgba(178, 120, 90, .45); }
  .ev-card:hover { box-shadow: var(--glass-edge), 0 14px 30px -12px rgba(178, 120, 90, .4); }
  .ev-del:hover, .ev-edit:hover { transform: scale(1.12); opacity: 1; }
  .seg button:hover:not(.active) { color: var(--ink-soft); }
  .profile-avatar-btn:hover { transform: scale(1.05); }
  .confirm-actions .btn-ghost:hover, .confirm-actions .btn-danger:hover { transform: translateY(-1px); }
}

/* ---------- Confirm dialog ---------- */
.confirm-card { text-align: center; }
@media (min-width: 560px) { .confirm-card { max-width: 360px; padding-top: 28px; } }
.confirm-icon {
  width: 72px; height: 72px; margin: 6px auto 12px;
  display: grid; place-items: center; color: #D14D6E;
  border-radius: 50%;
  background: radial-gradient(120% 120% at 30% 18%, #fff, rgba(255, 220, 220, .7) 60%, rgba(232, 106, 106, .22));
  box-shadow: inset 0 1px 1px #fff, inset 0 -4px 10px rgba(209, 77, 110, .18), 0 12px 24px -10px rgba(209, 77, 110, .5);
}
.confirm-icon .ic { width: 34px; height: 34px; }
.confirm-card h3 { margin: 0 0 6px; font-size: 20px; font-weight: 800; }
.confirm-text { color: var(--muted); font-size: 14px; font-weight: 600; margin: 0 0 20px; }
.confirm-actions { display: flex; gap: 10px; }
.confirm-actions .btn-ghost, .confirm-actions .btn-danger { flex: 1; margin: 0; }
.confirm-actions .btn-ghost { background: rgba(255, 255, 255, .5); box-shadow: inset 0 1px 0 #fff, inset 0 0 0 1px rgba(255, 255, 255, .5); }
.btn-danger {
  position: relative; isolation: isolate; overflow: hidden;
  border: none; border-radius: var(--pill); padding: 13px 20px;
  font-size: 15px; font-weight: 800; color: #fff; cursor: pointer;
  background: linear-gradient(135deg, #EE7A72, #D14D6E);
  text-shadow: 0 1px 2px rgba(120, 30, 50, .3);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .6), inset 0 -3px 8px rgba(120, 30, 50, .25), 0 10px 22px -8px rgba(209, 77, 110, .7);
}
.btn-danger::before {
  content: ""; position: absolute; z-index: -1;
  inset: 0 0 35% 0;
  background: radial-gradient(75% 100% at 50% 0%, rgba(255, 255, 255, .42), rgba(255, 255, 255, 0) 100%);
}
.btn-danger:active { transform: scale(.96); }

/* ---------- Day events ---------- */
.day-events { display: flex; flex-direction: column; gap: 10px; margin: 12px 0 4px; }
.ev-card {
  border-radius: 20px;
  padding: 14px 14px 14px 26px;
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  backdrop-filter: blur(16px) saturate(180%);
  animation: rise .5s var(--ease-out) backwards;
}
.ev-card::before {
  content: ""; position: absolute;
  left: 11px; top: 14px; bottom: 14px; width: 5px;
  border-radius: var(--pill);
  background: var(--muted);
}
.ev-card.kev::before { background: linear-gradient(180deg, #B2CDEC, var(--kev)); box-shadow: 0 0 10px rgba(123, 167, 217, .7); }
.ev-card.bby::before { background: linear-gradient(180deg, #F6C6D2, var(--bby)); box-shadow: 0 0 10px rgba(232, 154, 174, .7); }
.ev-card .ev-time { font-size: 12px; color: var(--muted); font-weight: 800; }
.ev-card .ev-title { font-size: 16px; font-weight: 800; margin: 2px 0; padding-right: 76px; }
.ev-card.is-locked .ev-title { padding-right: 40px; }
/* Gembok di jadwal milik pasangan: tidak bisa diubah/dihapus */
.ev-lock {
  display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 50%;
  color: var(--muted);
  background: rgba(255, 255, 255, .45);
  box-shadow: inset 0 0 0 1px rgba(150, 120, 95, .16);
}
.ev-lock .ic { width: 15px; height: 15px; }
.ev-card .ev-desc { font-size: 13px; color: var(--ink-soft); white-space: pre-wrap; margin-top: 2px; }
.ev-card .ev-who { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; margin-top: 8px; }
.ev-card.kev .ev-who { color: var(--kev-deep); }
.ev-card.bby .ev-who { color: var(--bby-deep); }
.ev-actions { position: absolute; top: 10px; right: 10px; display: flex; gap: 6px; z-index: 1; }
.ev-del, .ev-edit {
  display: grid; place-items: center;
  width: 32px; height: 32px; padding: 0;
  border: 0; border-radius: 50%;
  color: var(--ink-soft); cursor: pointer; opacity: .85;
  background: radial-gradient(120% 120% at 30% 15%, #fff, rgba(255, 255, 255, .5));
  box-shadow: inset 0 1px 0 #fff, inset 0 0 0 1px rgba(255, 255, 255, .6), 0 4px 10px -4px rgba(178, 120, 90, .4);
}
.ev-del .ic, .ev-edit .ic { width: 16px; height: 16px; }
@media (hover: hover) { .ev-del:hover { color: #D14D6E; } .ev-edit:hover { color: #E07F5C; } }
.empty-day {
  text-align: center; color: var(--muted); padding: 30px 16px; font-size: 14px; font-weight: 700;
  border-radius: var(--radius);
}
.empty-emoji .ic { width: 44px; height: 44px; color: var(--accent); }
.empty-emoji { margin-bottom: 8px; animation: float 5s ease-in-out infinite; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: linear-gradient(160deg, rgba(92, 74, 62, .8), rgba(60, 48, 40, .74));
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  color: #fff;
  padding: 12px 22px; border-radius: var(--pill);
  font-size: 14px; font-weight: 700; z-index: 100;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), inset 0 0 0 1px rgba(255, 255, 255, .12), 0 14px 32px -10px rgba(60, 40, 30, .5);
  animation: toast-in .5s var(--ease-spring) backwards;
  max-width: 90vw; text-align: center;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 16px) scale(.9); } }

/* ---------- Custom pickers ---------- */
/* Picker tanggal/jam: tampil seperti field + tombol ikon berwarna di kanan,
   supaya jelas bisa diklik; state .is-open selama picker-nya terbuka */
.picker-field {
  width: 100%; min-height: 52px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 16px; font-weight: 700; text-align: left;
  padding: 7px 7px 7px 16px;
  border: 1.5px solid var(--field-border);
  border-radius: var(--radius-sm);
  background: var(--field-bg);
  color: var(--ink);
  cursor: pointer;
  box-shadow: var(--field-inset);
  margin-top: 8px;
}
.picker-field:active { transform: scale(.98); background: rgba(255, 240, 232, .95); }
.picker-field:focus-visible, .picker-field.is-open {
  outline: none;
  background: #fff;
  border-color: var(--field-focus);
  box-shadow: var(--field-ring);
}
.picker-chev {
  width: 36px; height: 36px; flex-shrink: 0;
  display: inline-grid; place-items: center;
  border-radius: 11px;
  color: #D9714F;
  background: rgba(244, 169, 136, .16);
  box-shadow: inset 0 0 0 1px rgba(244, 169, 136, .24);
  transition: background .2s ease, color .2s ease, box-shadow .2s ease, transform .35s var(--ease-spring);
}
.picker-chev .ic { width: 20px; height: 20px; }
.picker-field.is-open .picker-chev {
  color: #fff;
  background: var(--grad-warm);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .6), 0 4px 10px -3px rgba(232, 140, 150, .7);
  transform: scale(1.06);
}

/* Date picker mini grid */
.dp-grid { margin-top: 4px; }
.dp-grid .day-cell { min-height: 44px; padding: 10px 2px; }
.dp-grid .day-cell .day-num { margin-bottom: 0; }
.dp-grid .day-cell.picked {
  background: var(--grad-warm);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .7), inset 0 -2px 6px rgba(176, 82, 107, .22), 0 8px 18px -6px rgba(232, 140, 150, .75);
}
.dp-grid .day-cell.picked .day-num { color: #fff; background: none; box-shadow: none; }

/* Time picker wheels */
@media (min-width: 560px) { .time-card { max-width: 340px; } }
.time-wheels {
  display: flex; align-items: stretch; justify-content: center;
  gap: 6px; margin: 14px 0 4px;
  position: relative;
}
/* Pita pilihan: tetesan kaca di tengah roda */
.time-wheels::before {
  content: "";
  position: absolute; left: 8px; right: 8px; top: 50%;
  height: 44px; transform: translateY(-50%);
  background: linear-gradient(180deg, rgba(255, 255, 255, .9), rgba(255, 255, 255, .55));
  border-radius: 16px;
  box-shadow: inset 0 1px 0 #fff, inset 0 0 0 1px rgba(255, 255, 255, .6), 0 8px 18px -8px rgba(232, 154, 174, .55);
  pointer-events: none;
}
.wheel {
  flex: 1;
  height: 180px;
  overflow-y: scroll;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  position: relative;
  z-index: 1;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent);
  /* padder via JS: padding-top/bottom = (180-44)/2 */
}
.wheel::-webkit-scrollbar { display: none; }
.wheel-sep {
  font-size: 28px; font-weight: 800; color: var(--muted);
  display: flex; align-items: center;
  z-index: 1;
}
.wheel-item {
  height: 44px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; color: var(--muted);
  scroll-snap-align: center;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: color .2s ease, font-size .2s ease;
}
.wheel-item.sel { color: var(--ink); font-weight: 800; font-size: 23px; }

@media (hover: hover) {
  input:hover:not(:focus):not(:disabled):not(.switch), textarea:hover:not(:focus):not(:disabled),
  .picker-field:hover:not(.is-open):not(:disabled) { border-color: var(--field-border-hover); background: rgba(255, 255, 255, .86); }
  .picker-field:hover:not(.is-open) .picker-chev { background: rgba(244, 169, 136, .28); }
  .wheel-item:hover { color: var(--ink); }
  .dp-grid .day-cell:hover {
    background: linear-gradient(160deg, rgba(255, 255, 255, .92), rgba(255, 255, 255, .5));
    transform: translateY(-2px);
  }
  .dp-grid .day-cell.picked:hover { background: var(--grad-warm); }
}

/* ---------- Micro-animation & transisi perubahan layout ---------- */
:root { --ease-in: cubic-bezier(.4, 0, 1, 1); }

/* Keluar: modal, drawer, toast, login (JS: hide() memasang .is-leaving lalu .hidden) */
.modal.is-leaving, .drawer.is-leaving { animation: fade-out .22s ease forwards; pointer-events: none; }
.modal.is-leaving .modal-card { animation: sheet-out .24s var(--ease-in) forwards; }
@media (min-width: 560px) {
  .modal.is-leaving .modal-card { animation: pop-out .2s var(--ease-in) forwards; }
}
.drawer.is-leaving .drawer-card { animation: menu-out .18s var(--ease-in) forwards; }
.toast.bump { animation: toast-in .45s var(--ease-spring) backwards; }
.toast.is-leaving { animation: toast-out .22s var(--ease-in) forwards; }
#login-view.is-leaving {
  position: fixed; inset: 0; z-index: 40; pointer-events: none;
  animation: login-out .38s var(--ease-out) forwards;
}
@keyframes fade-out { to { opacity: 0; } }
@keyframes sheet-out { to { transform: translateY(100%); } }
@keyframes pop-out { to { opacity: 0; transform: translateY(8px) scale(.94); } }
@keyframes menu-out { to { opacity: 0; transform: scale(.88) translateY(-6px); } }
@keyframes toast-out { to { opacity: 0; transform: translate(-50%, 12px) scale(.94); } }
@keyframes login-out { to { opacity: 0; transform: scale(1.04); filter: blur(6px); } }

/* Masuk ke kalender setelah login: bagian-bagian muncul bertahap */
.cal-enter .topbar, .cal-enter .seg, .cal-enter #month-wrap, .cal-enter #agenda-list, .cal-enter .actionbar {
  animation: rise .6s var(--ease-out) backwards;
}
.cal-enter .seg { animation-delay: .06s; }
.cal-enter #month-wrap, .cal-enter #agenda-list { animation-delay: .12s; }
.cal-enter .actionbar { animation-delay: .2s; }

/* Ganti Agenda <-> Bulan: panel masuk dari arah segmen yang dipilih */
.view-in-left { animation: view-in-left .42s var(--ease-out); }
.view-in-right { animation: view-in-right .42s var(--ease-out); }
@keyframes view-in-left { from { opacity: 0; transform: translateX(-20px); } }
@keyframes view-in-right { from { opacity: 0; transform: translateX(20px); } }

/* Hapus jadwal: kartu menyusut & memudar sebelum list dirender ulang */
.ev-card.is-removing { animation: card-out .28s var(--ease-in) forwards; pointer-events: none; }
@keyframes card-out { to { opacity: 0; transform: translateX(24px) scale(.94); } }

/* Pesan error muncul dengan pegas kecil */
.error:not(.hidden) { animation: err-in .35s var(--ease-spring); }
@keyframes err-in { from { opacity: 0; transform: translateY(-4px) scale(.97); } }

/* Nilai picker (tanggal/jam) berganti */
.value-in { display: inline-block; animation: value-in .35s var(--ease-spring); }
@keyframes value-in { from { opacity: 0; transform: translateY(6px); } }

/* Ikon mata password berganti */
.pass-toggle .ic:not(.hidden) { animation: icon-pop .35s var(--ease-spring); }
@keyframes icon-pop { from { opacity: 0; transform: scale(.6) rotate(-25deg); } }

/* Foto profil memudar masuk saat selesai dimuat */
.user-avatar img:not(.hidden), .topbar-avatar-img:not(.hidden), .profile-avatar-img:not(.hidden) { animation: fade-in .4s ease; }
.who-wrap img { transition: opacity .3s ease; }

/* Badge jumlah jadwal meletup kecil saat kalender dirender */
.cnt { animation: pop .45s var(--ease-spring) backwards; animation-delay: .12s; }
@keyframes pop { from { opacity: 0; transform: scale(.3); } }

/* Hari ini di date picker & tanggal terpilih */
.dp-grid .day-cell.picked { animation: pop .35s var(--ease-spring); }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .blob, .login-heart, .login-orb, .user-link, .empty-emoji { animation: none !important; }
}
