/* SaltBlock — palette: Nusantara #0857C3 · Cakrawala #307FE2 · Mentari #71C5E8 · Navy #042A61 · Ice #D6EFFB · Amber #C37408 */
:root {
  --navy: #042A61; --blue: #0857C3; --sky: #307FE2; --mentari: #71C5E8; --ice: #D6EFFB;
  --amber: #C37408; --gold: #E8A271; --red: #C32A08;
  --bg: #F2F7FD; --card: #fff; --text: #0B1B33; --muted: #5B6B82; --line: #E2EBF6;
  --r: 18px; --shadow: 0 1px 2px rgba(4, 42, 97, .06), 0 8px 24px -12px rgba(4, 42, 97, .18);
  --ease: cubic-bezier(.2, .8, .2, 1); --spring: cubic-bezier(.34, 1.56, .64, 1);
  --nav-h: 64px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body {
  margin: 0; font-family: Inter, Aptos, Montserrat, system-ui, sans-serif; color: var(--text);
  background: radial-gradient(1200px 400px at 50% -200px, #DCEBFC 0%, var(--bg) 60%) fixed, var(--bg);
  font-size: 15px; line-height: 1.4; -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 16px);
  overscroll-behavior-y: contain;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }

/* ---------- top bar ---------- */
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px;
  background: linear-gradient(120deg, var(--navy), var(--blue) 70%, var(--sky)); color: #fff;
  box-shadow: 0 6px 20px -10px rgba(4, 42, 97, .6);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; letter-spacing: -.02em; }
.logo { width: 26px; height: 26px; border-radius: 8px; background: rgba(255,255,255,.14); display: grid; gap: 2px; padding: 5px; }
.logo i { display: block; height: 3px; border-radius: 2px; background: var(--mentari); animation: logo 3.6s var(--ease) infinite; }
.logo i:nth-child(2) { width: 60%; background: #fff; animation-delay: .2s; }
.logo i:nth-child(3) { width: 80%; background: var(--ice); animation-delay: .4s; }
@keyframes logo { 0%, 70%, 100% { transform: scaleX(1); } 80% { transform: scaleX(.4); } 90% { transform: scaleX(1.1); } }
.logo i { transform-origin: left; }
.top-r { display: flex; align-items: center; gap: 8px; }
.pill { background: rgba(255,255,255,.18); color: #fff; padding: 6px 12px; border-radius: 99px; font-weight: 600; font-size: 13px; transition: background .2s; }
.pill:active { background: rgba(255,255,255,.3); }
.streak { background: rgba(255,255,255,.14); padding: 6px 10px; border-radius: 99px; font-weight: 700; font-size: 13px; }

/* ---------- layout ---------- */
.view { max-width: 640px; margin: 0 auto; padding: 0 12px; }
.view.in-fade { animation: fadeUp .35s var(--ease); }
.view.in-right { animation: inRight .35s var(--ease); }
.view.in-left { animation: inLeft .35s var(--ease); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } }
@keyframes inRight { from { opacity: 0; transform: translateX(40px); } }
@keyframes inLeft { from { opacity: 0; transform: translateX(-40px); } }

.datebar { display: flex; align-items: center; gap: 8px; padding: 16px 0 12px; }
.datebar.plain { padding-left: 4px; }
.dtitle { flex: 1; text-align: center; min-width: 0; }
.datebar.plain .dtitle { text-align: left; }
.dtitle small { color: var(--sky); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.dtitle h1 { font-size: 21px; font-weight: 800; margin: 2px 0 8px; color: var(--navy); }
.arrow { width: 42px; height: 42px; border-radius: 14px; background: var(--card); box-shadow: var(--shadow); font-size: 24px; color: var(--blue); flex: none; transition: transform .15s var(--spring); }
.arrow:active { transform: scale(.88); }

.chip { display: inline-flex; align-items: center; gap: 4px; padding: 5px 11px; border-radius: 99px; font-size: 12.5px; font-weight: 600; max-width: 100%; }
.chip.work { background: var(--ice); color: var(--blue); }
.chip.off { background: #EEF2F7; color: var(--muted); }
.chip.hol { background: linear-gradient(90deg, #FFF1E2, #FDE6D6); color: var(--amber); animation: glow 2.6s ease-in-out infinite; }
.chip.cuti { background: #FFF6E8; color: var(--amber); }
@keyframes glow { 50% { box-shadow: 0 0 0 4px rgba(195, 116, 8, .08); } }

.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px; }
.card h2 { font-size: 16px; font-weight: 750; color: var(--navy); }
.card h3 { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 14px 0 6px; }
.card-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.muted { color: var(--muted); font-size: 13px; margin: 2px 0 0; }
.count { background: var(--ice); color: var(--blue); font-weight: 700; font-size: 12px; padding: 4px 9px; border-radius: 99px; flex: none; }
.empty { color: var(--muted); text-align: center; font-size: 13px; padding: 10px 0 2px; margin: 0; }
.hint { color: var(--muted); font-size: 12.5px; }
.center { text-align: center; }

/* ---------- priorities ---------- */
.prio-card { position: relative; overflow: hidden; }
.prio-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: linear-gradient(90deg, var(--blue), var(--mentari)); }
.prio-card.win::before { background: linear-gradient(90deg, var(--amber), var(--gold), var(--amber)); background-size: 200% 100%; animation: shine 2s linear infinite; }
@keyframes shine { to { background-position: -200% 0; } }
.ring { position: relative; width: 48px; height: 48px; flex: none; }
.ring svg { width: 48px; height: 48px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 5; }
.ring .rb { stroke: var(--ice); }
.ring .rf { stroke: var(--blue); stroke-linecap: round; transition: stroke-dashoffset .7s var(--spring); }
.ring.full .rf { stroke: var(--amber); }
.ring.full { animation: pulse 1.6s ease-in-out infinite; }
.ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: var(--navy); }
@keyframes pulse { 50% { transform: scale(1.06); } }

.prio { list-style: none; margin: 0; padding: 0; counter-reset: p; }
.prio li { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.prio li:last-child { border-bottom: 0; }
.prio input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; padding: 8px 0; font-size: 15.5px; font-weight: 550; }
.prio input::placeholder { color: #A9B6C8; font-weight: 450; }
.prio li.done input { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--amber); }

.check {
  width: 30px; height: 30px; border-radius: 50%; border: 2.5px solid #C3D3E6; flex: none; display: grid; place-items: center;
  transition: background .25s, border-color .25s, transform .3s var(--spring);
}
.check svg { width: 16px; height: 16px; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 24; stroke-dashoffset: 24; transition: stroke-dashoffset .35s .05s var(--ease); }
.check:active { transform: scale(.85); }
.done > .check { background: var(--blue); border-color: var(--blue); animation: boing .45s var(--spring); }
.prio .done > .check { background: var(--amber); border-color: var(--amber); }
.done > .check svg { stroke-dashoffset: 0; }
.check.sm { width: 24px; height: 24px; border-width: 2px; }
.check.sm svg { width: 13px; height: 13px; }
@keyframes boing { 0% { transform: scale(.6); } 60% { transform: scale(1.2); } 100% { transform: scale(1); } }

.mini { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); font-size: 15px; flex: none; transition: background .2s, transform .15s; }
.mini:active { background: var(--ice); transform: scale(.9); }
.mini.x { font-size: 20px; }
.mini.x:active { background: #FDE8E2; color: var(--red); }

/* ---------- task dump ---------- */
.add { margin-bottom: 4px; }
.seg { display: inline-flex; background: #EEF3FA; border-radius: 12px; padding: 3px; margin-bottom: 8px; position: relative; }
.seg button { padding: 6px 14px; border-radius: 9px; font-weight: 600; font-size: 13px; color: var(--muted); transition: background .25s, color .25s, box-shadow .25s; }
.seg button.on { background: #fff; color: var(--blue); box-shadow: 0 2px 8px -2px rgba(4, 42, 97, .2); }
.add-row { display: flex; gap: 8px; }
.add-row input { flex: 1; min-width: 0; border: 1.5px solid var(--line); border-radius: 14px; padding: 11px 14px; outline: 0; background: #FAFCFF; transition: border-color .2s, box-shadow .2s; }
.add-row input:focus { border-color: var(--sky); box-shadow: 0 0 0 4px rgba(48, 127, 226, .12); }
.add-btn { width: 46px; border-radius: 14px; background: linear-gradient(135deg, var(--blue), var(--sky)); color: #fff; font-size: 24px; font-weight: 600; box-shadow: 0 6px 14px -6px var(--blue); transition: transform .2s var(--spring); }
.add-btn:active { transform: scale(.88) rotate(90deg); }

.tasks { list-style: none; margin: 0; padding: 0; }
.task { display: flex; align-items: center; gap: 8px; padding: 6px 4px 6px 0; border-radius: 12px; transition: background .2s, opacity .2s, transform .2s; }
.task .tt { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.task.done .tt { color: var(--muted); text-decoration: line-through; }
.task.just .tt { animation: strike .4s var(--ease); }
@keyframes strike { from { opacity: .3; transform: translateX(6px); } }
.task.pop { animation: pop .45s var(--spring); }
.task.lifting { opacity: .35; transform: scale(.97); }
.tgrip { width: 26px; height: 34px; display: grid; place-items: center; color: #A9B6C8; font-size: 18px; cursor: grab; touch-action: none; user-select: none; flex: none; border-radius: 8px; }
.tgrip:active { background: var(--ice); color: var(--blue); }
.pin { font-size: 11.5px; font-weight: 700; color: var(--blue); background: var(--ice); padding: 3px 7px; border-radius: 99px; flex: none; }

.drag-ghost {
  position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none; margin: -22px 0 0 -30px;
  max-width: 220px; padding: 10px 14px; border-radius: 14px; background: #fff; color: var(--navy); font-weight: 650; font-size: 14px;
  box-shadow: 0 18px 40px -12px rgba(4, 42, 97, .45); border: 2px solid var(--mentari); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: border-color .15s, background .15s; animation: lift .2s var(--spring);
}
.drag-ghost.over { border-color: var(--blue); background: var(--ice); }
@keyframes lift { from { scale: .8; opacity: .4; } }

/* ---------- timeline ---------- */
.tl-card { padding-bottom: 12px; }
.tl-wrap { max-height: 62vh; overflow-y: auto; margin: 0 -8px; padding: 0 8px; border-radius: 12px; overscroll-behavior: contain; }
.tl { position: relative; margin-left: 48px; }
.slot { position: absolute; left: 0; right: 0; height: 44px; border-top: 1px solid var(--line); cursor: pointer; transition: background .15s; }
.slot.half { border-top-style: dashed; border-top-color: #EDF2F9; }
.slot:active { background: rgba(214, 239, 251, .6); }
.slot span { position: absolute; left: -48px; top: -8px; width: 40px; text-align: right; font-size: 11.5px; font-weight: 600; color: #8A9BB3; font-variant-numeric: tabular-nums; }
.tl-work { position: absolute; left: -6px; right: 0; background: linear-gradient(180deg, rgba(214, 239, 251, .55), rgba(214, 239, 251, .35)); border-left: 3px solid var(--mentari); border-radius: 0 10px 10px 0; pointer-events: none; }
.tl-work span { position: absolute; right: 8px; top: 4px; font-size: 10.5px; font-weight: 700; color: var(--sky); text-transform: uppercase; letter-spacing: .06em; opacity: .7; }
.tl-blocks { position: absolute; inset: 0; pointer-events: none; }
.blk {
  position: absolute; pointer-events: auto; display: flex; align-items: flex-start; gap: 4px; padding: 6px 6px 6px 2px;
  border-radius: 12px; background: color-mix(in srgb, var(--c) 13%, #fff); border-left: 4px solid var(--c);
  box-shadow: 0 2px 6px -3px color-mix(in srgb, var(--c) 60%, transparent); overflow: hidden; cursor: pointer;
  transition: top .25s var(--ease), height .25s var(--ease), box-shadow .2s, transform .2s, opacity .2s;
}
.blk:active { transform: scale(.985); }
.blk.pop { animation: pop .5s var(--spring); }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.04); opacity: 1; } 100% { transform: scale(1); } }
.blk.dragging { transition: none; z-index: 5; box-shadow: 0 14px 30px -10px color-mix(in srgb, var(--c) 70%, transparent); transform: scale(1.02); }
.blk-body { flex: 1; min-width: 0; }
.blk b { display: block; font-size: 13.5px; font-weight: 700; color: color-mix(in srgb, var(--c) 70%, #000); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.blk small { display: block; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.blk.compact { align-items: center; padding-top: 2px; padding-bottom: 2px; }
.blk.compact .blk-body { display: flex; align-items: baseline; gap: 6px; }
.blk.compact small { flex: none; }
.blk.done { opacity: .62; }
.blk.done b { text-decoration: line-through; }
.grip { width: 22px; align-self: stretch; display: grid; place-items: center; color: color-mix(in srgb, var(--c) 55%, #fff); font-size: 15px; touch-action: none; cursor: grab; user-select: none; flex: none; border-radius: 8px; }
.grip:active { background: color-mix(in srgb, var(--c) 18%, #fff); }
.chk { width: 26px; height: 26px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--c) 45%, #fff); display: grid; place-items: center; flex: none; background: #fff; transition: background .2s, transform .3s var(--spring); }
.blk.compact .chk { width: 22px; height: 22px; }
.chk svg { width: 13px; height: 13px; fill: none; stroke: #fff; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 24; stroke-dashoffset: 24; transition: stroke-dashoffset .3s var(--ease); }
.blk.done .chk { background: var(--c); border-color: var(--c); animation: boing .45s var(--spring); }
.blk.done .chk svg { stroke-dashoffset: 0; }
.rsz { position: absolute; left: 30%; right: 30%; bottom: 0; height: 14px; touch-action: none; cursor: ns-resize; }
.rsz::after { content: ""; position: absolute; left: 50%; bottom: 4px; width: 28px; height: 4px; margin-left: -14px; border-radius: 4px; background: color-mix(in srgb, var(--c) 40%, #fff); }

.now { position: absolute; left: -8px; right: 0; height: 0; border-top: 2px solid var(--amber); z-index: 4; pointer-events: none; transition: top 1s linear; }
.now i { position: absolute; left: -5px; top: -7px; width: 12px; height: 12px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 0 rgba(195, 116, 8, .5); animation: ping 1.8s infinite; }
.now::after { content: attr(data-t); position: absolute; right: 0; top: -20px; font-size: 10.5px; font-weight: 800; color: #fff; background: var(--amber); padding: 1px 6px; border-radius: 6px; }
@keyframes ping { 70% { box-shadow: 0 0 0 10px rgba(195, 116, 8, 0); } 100% { box-shadow: 0 0 0 0 rgba(195, 116, 8, 0); } }
.drop-ind { position: absolute; left: 2px; right: 2px; border-radius: 12px; border: 2px dashed var(--blue); background: rgba(48, 127, 226, .1); opacity: 0; transform: scale(.96); transition: top .12s, opacity .15s, transform .15s; pointer-events: none; z-index: 6; }
.drop-ind.show { opacity: 1; transform: scale(1); }
.drop-ind::after { content: attr(data-t); position: absolute; left: 8px; top: 6px; font-size: 12px; font-weight: 800; color: var(--blue); }

.btn { padding: 11px 16px; border-radius: 14px; font-weight: 650; font-size: 14px; transition: transform .15s var(--spring), background .2s; }
.btn:active { transform: scale(.95); }
.btn.primary { background: linear-gradient(135deg, var(--blue), var(--sky)); color: #fff; box-shadow: 0 8px 18px -8px var(--blue); }
.btn.ghost { background: #EEF3FA; color: var(--blue); }
.btn.danger { color: var(--red); }
.btn.wide { width: 100%; margin-top: 12px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

/* ---------- weekly ---------- */
.week { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(176px, 46%); gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 2px 12px 12px; margin: 0 -12px; scroll-padding: 12px; overscroll-behavior-x: contain; }
.wcol { scroll-snap-align: start; background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 10px; display: flex; flex-direction: column; gap: 8px; border: 2px solid transparent; transition: transform .2s var(--spring); animation: fadeUp .4s var(--ease) both; }
.wcol:nth-child(2) { animation-delay: .03s; } .wcol:nth-child(3) { animation-delay: .06s; } .wcol:nth-child(4) { animation-delay: .09s; }
.wcol:nth-child(5) { animation-delay: .12s; } .wcol:nth-child(6) { animation-delay: .15s; } .wcol:nth-child(7) { animation-delay: .18s; }
.wcol.today { border-color: var(--sky); }
.wcol.off { background: #F7F9FC; }
.wcol.hol { background: linear-gradient(180deg, #FFF4E8, #fff 40%); }
.wh { text-align: left; padding: 4px 6px 6px; border-radius: 12px; transition: background .2s; }
.wh:active { background: var(--ice); }
.wh b { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-right: 6px; }
.wh span { font-size: 24px; font-weight: 800; color: var(--navy); }
.wcol.today .wh span { color: var(--blue); }
.wh em { display: block; font-style: normal; font-size: 11.5px; font-weight: 650; color: var(--amber); margin-top: 2px; }
.wcol.today .wh em { color: var(--sky); }
.wcell { display: block; background: #F5F8FC; border-radius: 12px; padding: 6px 8px; transition: background .2s, box-shadow .2s; }
.wcell:focus-within { background: #fff; box-shadow: 0 0 0 2px var(--mentari); }
.wcell span { font-size: 10.5px; font-weight: 750; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.wcell textarea { width: 100%; border: 0; outline: 0; background: none; resize: none; font-size: 13.5px; padding: 2px 0 0; min-height: 52px; field-sizing: content; }
.wcell.catatan { background: repeating-linear-gradient(180deg, #FBFCFE 0 21px, #EEF3FA 21px 22px); }
.wsum { display: flex; justify-content: space-between; font-size: 12px; font-weight: 650; color: var(--muted); padding: 0 4px; }
.wsum .gold { color: var(--amber); }

/* ---------- settings ---------- */
.fld { display: block; margin-top: 10px; }
.fld > span { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .05em; }
.fld input, .fld select, .rt input, .rt select { width: 100%; border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #FAFCFF; outline: 0; transition: border-color .2s; }
.fld input:focus, .fld select:focus, .rt input:focus, .rt select:focus { border-color: var(--sky); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dchips { display: flex; flex-wrap: wrap; gap: 6px; }
.dchip { padding: 8px 12px; border-radius: 12px; background: #EEF3FA; color: var(--muted); font-weight: 650; font-size: 13px; transition: background .2s, color .2s, transform .2s var(--spring); }
.dchip.on { background: var(--blue); color: #fff; }
.dchip:active { transform: scale(.9); }
.rts { display: grid; gap: 10px; margin-top: 10px; }
.rt { border-left: 4px solid var(--c); background: #F8FAFD; border-radius: 12px; padding: 8px; display: grid; gap: 6px; }
.rt input { font-weight: 650; }
.rt-row { display: flex; align-items: center; gap: 6px; }
.rt-row select { padding: 8px 6px; min-width: 0; }
.rt-row span { color: var(--muted); }
.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; margin: 10px 0 4px; }
.switch input { position: absolute; opacity: 0; }
.switch i { width: 46px; height: 28px; border-radius: 99px; background: #CBD6E4; position: relative; flex: none; transition: background .25s; }
.switch i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.2); transition: transform .3s var(--spring); }
.switch input:checked + i { background: var(--blue); }
.switch input:checked + i::after { transform: translateX(18px); }
.switch input:focus-visible + i { box-shadow: 0 0 0 3px rgba(48, 127, 226, .3); }

/* ---------- nav ---------- */
.nav {
  position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 10px); transform: translateX(-50%); z-index: 30;
  width: min(420px, calc(100% - 24px)); height: var(--nav-h); display: grid; grid-template-columns: repeat(3, 1fr);
  background: rgba(4, 42, 97, .92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-radius: 22px; padding: 6px; box-shadow: 0 16px 34px -12px rgba(4, 42, 97, .6);
}
.nav-ind { position: absolute; left: 6px; top: 6px; bottom: 6px; width: calc((100% - 12px) / 3); border-radius: 16px; background: linear-gradient(135deg, var(--blue), var(--sky)); transition: transform .4s var(--spring); }
.nav button { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: rgba(214, 239, 251, .7); font-size: 11px; font-weight: 650; transition: color .25s; }
.nav button.on { color: #fff; }
.nav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; transition: transform .3s var(--spring); }
.nav button.on svg { transform: translateY(-1px) scale(1.08); }
.nav button:active svg { transform: scale(.85); }

/* ---------- sheet ---------- */
.sheet-root { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
.sheet-root .backdrop { position: absolute; inset: 0; background: rgba(4, 22, 52, .45); opacity: 0; transition: opacity .3s; }
.sheet-root .panel {
  position: absolute; left: 50%; bottom: 0; width: min(560px, 100%); max-height: 88vh; overflow-y: auto;
  transform: translate(-50%, 105%); visibility: hidden; transition: transform .38s var(--spring), visibility 0s .38s;
  background: #fff; border-radius: 24px 24px 0 0; padding: 8px 16px calc(env(safe-area-inset-bottom) + 18px);
  box-shadow: 0 -20px 50px -20px rgba(4, 42, 97, .5);
}
.sheet-root.open { pointer-events: auto; }
.sheet-root.open .backdrop { opacity: 1; }
.sheet-root.open .panel { transform: translate(-50%, 0); visibility: visible; transition: transform .38s var(--spring), visibility 0s; }
.grab { width: 44px; height: 5px; border-radius: 4px; background: #D5DEEA; margin: 4px auto 10px; }
.sheet-h { display: flex; align-items: center; gap: 10px; }
.sheet-h h3 { font-size: 18px; color: var(--navy); }
.sheet-h .muted { flex: 1; margin: 0; }
.cats { display: flex; flex-wrap: wrap; gap: 8px; }
.cat { padding: 8px 12px; border-radius: 12px; font-weight: 650; font-size: 13px; color: var(--c); background: color-mix(in srgb, var(--c) 10%, #fff); border: 2px solid transparent; transition: transform .2s var(--spring), background .2s, color .2s; }
.cat.on { background: var(--c); color: #fff; transform: scale(1.05); }
.cat:active { transform: scale(.92); }
.sheet-actions { display: flex; gap: 8px; margin-top: 18px; }
.sheet-actions .primary { flex: 1; }

/* ---------- toast / party / fx ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 22px); z-index: 70;
  transform: translate(-50%, 20px) scale(.95); opacity: 0; pointer-events: none;
  display: flex; align-items: center; gap: 14px; max-width: calc(100% - 32px);
  background: var(--navy); color: #fff; padding: 11px 16px; border-radius: 14px; font-size: 14px; font-weight: 550;
  box-shadow: 0 14px 30px -10px rgba(4, 42, 97, .6); transition: transform .35s var(--spring), opacity .25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); pointer-events: auto; }
.toast button { color: var(--mentari); font-weight: 750; white-space: nowrap; }
#fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 80; }
.party { position: fixed; inset: 0; z-index: 75; display: grid; place-items: center; background: rgba(4, 22, 52, .5); opacity: 0; pointer-events: none; transition: opacity .3s; padding: 24px; }
.party.show { opacity: 1; pointer-events: auto; }
.party-card { background: #fff; border-radius: 26px; padding: 26px 24px 20px; text-align: center; max-width: 320px; transform: scale(.7); transition: transform .5s var(--spring); box-shadow: 0 30px 60px -20px rgba(4, 42, 97, .6); }
.party.show .party-card { transform: scale(1); }
.party .big { font-size: 64px; animation: boing .8s var(--spring), wobble 2s 1s ease-in-out infinite; }
.party h2 { font-size: 22px; font-weight: 800; color: var(--navy); margin: 6px 0; }
.party p { color: var(--muted); margin: 0 0 16px; }
@keyframes wobble { 25% { transform: rotate(-8deg); } 75% { transform: rotate(8deg); } }

.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

::view-transition-old(root), ::view-transition-new(root) { animation-duration: .25s; }

/* ---------- larger screens ---------- */
@media (min-width: 900px) {
  .view { max-width: 1180px; }
  .view:has(.week) .week { grid-auto-flow: row; grid-template-columns: repeat(7, 1fr); overflow: visible; margin: 0; padding: 2px 0 12px; }
  .view:has(.tl-card) { display: grid; grid-template-columns: 380px 1fr; grid-template-rows: auto auto 1fr; column-gap: 16px; }
  .view:has(.tl-card) .datebar { grid-column: 1 / -1; }
  .view:has(.tl-card) .tl-card { grid-column: 2; grid-row: 2 / span 2; }
  .view:has(.tl-card) .tl-wrap { max-height: calc(100vh - 260px); }
  .view:has(.prio-card) .card:not(.tl-card) { grid-column: 1; }
  .view:has(.prio-card) > .card:nth-of-type(2) { align-self: start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- v2: Dropbox sync ---------- */
.top-r { gap: 6px; }
.brand { font-size: 17px; }
.sync { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.16); color: #fff; padding: 6px 11px; border-radius: 99px; font-weight: 600; font-size: 12.5px; white-space: nowrap; transition: background .2s, transform .2s var(--spring); }
.sync:active { transform: scale(.94); background: rgba(255,255,255,.28); }
.sync svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sync.st-synced svg { stroke: var(--mentari); }
.sync.st-conflict svg, .sync.st-waiting svg { stroke: var(--gold); }
.sync.st-error svg, .sync.st-relogin svg { stroke: #F28B6E; }
.sync.st-local, .sync.st-offline { color: rgba(255,255,255,.85); }
.sync.st-conflict, .sync.st-relogin, .sync.st-waiting { animation: glowW 2.4s ease-in-out infinite; }
@keyframes glowW { 50% { box-shadow: 0 0 0 4px rgba(232, 162, 113, .25); } }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 400px) { .top-r .pill:not([hidden]) + .sync span { display: none; } .sync { padding: 7px 9px; } }

.dbx { display: flex; flex-direction: column; gap: 12px; }
.dbx .card-h { margin: 0; align-items: center; }
.dbx-head { display: flex; gap: 14px; align-items: center; }
.dbx-ic { width: 56px; height: 56px; border-radius: 16px; background: var(--ice); display: grid; place-items: center; flex: none; animation: floaty 3.2s ease-in-out infinite; }
.dbx-ic svg { width: 30px; height: 30px; fill: none; stroke: var(--blue); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@keyframes floaty { 50% { transform: translateY(-3px); } }
.dbx-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; font-size: 14px; }
.dbx-list li { display: flex; gap: 10px; align-items: flex-start; }
.dbx-list svg { width: 18px; height: 18px; fill: none; stroke: var(--blue); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; flex: none; margin-top: 1px; }
.btn.primary.wide, .btn.grow { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.dbx-go { padding: 14px; font-size: 15px; margin-top: 2px; }
.dbx .btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }
.dbx .hint { margin: 0; }
.acct { display: flex; align-items: center; gap: 12px; background: #F5F8FC; border-radius: 14px; padding: 12px; }
.av { width: 42px; height: 42px; border-radius: 50%; background: linear-gradient(135deg, var(--blue), var(--mentari)); color: #fff; font-weight: 800; font-size: 17px; display: grid; place-items: center; flex: none; }
.acct b { display: block; font-size: 15px; }
.acct small { display: block; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.stats > div { border: 1.5px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.stats small { display: block; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.stats b { display: block; font-size: 16px; color: var(--navy); margin-top: 2px; }
.folder { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin: 0; }
.folder svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.dbx .switch { margin: 0; font-size: 14px; }
.dbx-err { margin: 0; font-size: 12.5px; color: #A8260A; background: #FDEEEA; border-radius: 10px; padding: 8px 10px; overflow-wrap: anywhere; }
.btn-row.nowrap { flex-wrap: nowrap; margin-top: 0; }
.btn.grow { flex: 1; }
.btn[disabled] { opacity: .7; }
.btn.ghost.danger { background: #FDEEEA; color: #A8260A; }
.count.st-conflict, .count.st-waiting, .count.st-pending { background: #FFF1E2; color: var(--amber); }
.count.st-error, .count.st-relogin { background: #FDEEEA; color: #A8260A; }
.count.st-offline { background: #EEF2F7; color: var(--muted); }

.conflict { border-top: 4px solid var(--amber); display: flex; flex-direction: column; gap: 10px; animation: fadeUp .4s var(--ease); }
.conflict .muted { margin: -6px 0 0; }
.vers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ver { border: 2px solid var(--line); border-radius: 14px; padding: 10px; }
.ver.on { border-color: var(--blue); background: #F0F7FE; }
.ver small { display: block; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.ver.on small { color: var(--blue); }
.ver b { display: block; font-size: 14px; margin-top: 2px; }
.ver span { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }

.opts { display: grid; gap: 10px; margin-top: 14px; }
.opt { display: flex; gap: 12px; align-items: flex-start; text-align: left; border: 2px solid var(--line); border-radius: 16px; padding: 12px 14px; transition: border-color .2s, background .2s, transform .2s var(--spring); }
.opt:active { transform: scale(.98); }
.opt.on { border-color: var(--blue); background: #F0F7FE; }
.opt i { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #C3D3E6; flex: none; margin-top: 1px; position: relative; transition: border-color .2s; }
.opt.on i { border-color: var(--blue); }
.opt.on i::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--blue); animation: boing .35s var(--spring); }
.opt b { font-size: 15px; display: flex; align-items: center; gap: 8px; }
.opt em { font-style: normal; font-size: 11px; font-weight: 700; color: #fff; background: var(--blue); padding: 2px 8px; border-radius: 99px; }
.opt small { display: block; font-size: 13px; color: var(--muted); margin-top: 3px; }
.note { display: flex; gap: 10px; align-items: center; background: #FFF6E8; border-radius: 12px; padding: 10px 12px; font-size: 12.5px; color: #7A4905; margin: 14px 0 0; }
.note svg { width: 18px; height: 18px; fill: none; stroke: var(--amber); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- v3: Google Calendar ---------- */
.gi { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.gi.lk { width: 12px; height: 12px; color: #8A9BB3; }
.gblk {
  position: absolute; pointer-events: auto; display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; text-align: left;
  padding: 6px 8px; border-radius: 12px; border: 1.5px solid #C9D6E6; border-left: 4px solid var(--c);
  background: repeating-linear-gradient(135deg, #fff 0 7px, #F2F6FB 7px 14px); overflow: hidden; cursor: pointer;
  transition: transform .2s var(--spring), box-shadow .2s; animation: fadeUp .35s var(--ease);
}
.gblk:active { transform: scale(.98); }
.gblk.compact { align-items: center; padding-top: 1px; padding-bottom: 1px; }
.gb-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.gblk.compact .gb-body { flex-direction: row; align-items: baseline; gap: 6px; }
.gb-body b { font-size: 13px; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gb-body small { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; }
.gb-lock { flex: none; display: flex; }
.gall { display: flex; align-items: center; gap: 8px; width: calc(100% - 48px); margin: 0 0 8px 48px; text-align: left; border-radius: 10px; border: 1.5px solid #C9D6E6; border-left: 4px solid var(--c); background: repeating-linear-gradient(135deg, #fff 0 7px, #F2F6FB 7px 14px); padding: 6px 10px; font-size: 12.5px; }
.gall b { color: var(--navy); flex: none; }
.gall span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gall.sm { width: 100%; margin: 0; padding: 4px 8px; font-size: 11.5px; border-width: 1px; border-left-width: 3px; }
.gstat { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 650; color: var(--muted); background: #F2F6FB; border: 1px solid #DDE6F1; padding: 4px 8px; border-radius: 99px; flex: none; white-space: nowrap; }
.gstat.err { color: #A8260A; background: #FDEEEA; border-color: #F6CFC4; }
.chip.gc { background: #fff; border: 1px solid #DDE6F1; color: var(--muted); margin-left: 4px; }
.gchip { display: flex; align-items: center; gap: 6px; width: 100%; text-align: left; font-size: 12px; background: repeating-linear-gradient(135deg, #fff 0 6px, #F2F6FB 6px 12px); border: 1px solid #D5E0EC; border-left: 3px solid var(--c); border-radius: 8px; padding: 4px 6px; margin-top: 4px; }
.gchip b { color: var(--navy); flex: none; font-variant-numeric: tabular-nums; }
.gchip span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wcell > span:first-child { display: block; }

.gcal { display: flex; flex-direction: column; gap: 10px; }
.dbx-ic.gc { animation: none; }
.gcrow { display: flex; align-items: center; gap: 10px; background: #F5F8FC; border-radius: 14px; padding: 10px 8px 10px 12px; animation: fadeUp .3s var(--ease); }
.gcrow .sw { width: 14px; height: 14px; border-radius: 4px; background: var(--c); flex: none; }
.gcm { flex: 1; min-width: 0; }
.gcm b { display: block; font-size: 14px; }
.gcm small { display: block; font-size: 12px; color: var(--muted); }
.gerr { color: #A8260A; }
.switch.sm { margin: 0; }
.switch.sm i { width: 42px; height: 26px; }
.switch.sm i::after { width: 20px; height: 20px; }
.switch.sm input:checked + i::after { transform: translateX(16px); }
.gadd { display: flex; flex-direction: column; gap: 8px; border-top: 1px dashed var(--line); padding-top: 12px; }
.gadd .lbl { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.gadd input { width: 100%; border: 1.5px solid var(--line); border-radius: 12px; padding: 11px 12px; background: #FAFCFF; outline: 0; transition: border-color .2s, box-shadow .2s; }
.gadd input:focus { border-color: var(--sky); box-shadow: 0 0 0 4px rgba(48, 127, 226, .12); }
.gadd .btn.wide { margin-top: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.gsw { display: flex; justify-content: space-between; gap: 6px; padding: 2px 2px; }
.gsw button { width: 32px; height: 32px; border-radius: 50%; background: var(--c); border: 3px solid #fff; box-shadow: 0 0 0 1px #DDE6F1; transition: transform .2s var(--spring), box-shadow .2s; }
.gsw button.on { box-shadow: 0 0 0 2px var(--navy); transform: scale(1.1); }
.linkbtn { color: var(--blue); font-weight: 650; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; align-self: center; padding: 4px; }
.ghelp { margin: 0; padding: 10px 12px 10px 30px; background: #F5F8FC; border-radius: 12px; font-size: 13px; display: grid; gap: 6px; animation: fadeUp .3s var(--ease); }
.gcal .folder .gi { width: 14px; height: 14px; color: #8A9BB3; }

.ev-h { display: flex; align-items: flex-start; gap: 12px; }
.ev-h .bar { width: 6px; align-self: stretch; border-radius: 4px; background: var(--c); flex: none; }
.ev-h > div { flex: 1; min-width: 0; }
.ev-h h3 { font-size: 20px; font-weight: 800; color: var(--navy); margin-top: 8px; overflow-wrap: anywhere; }
.gtag { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; color: color-mix(in srgb, var(--c) 70%, #000); background: color-mix(in srgb, var(--c) 12%, #fff); padding: 3px 9px; border-radius: 99px; }
.ev-rows { display: grid; gap: 10px; margin: 14px 0 0; font-size: 14px; }
.ev-rows > div { display: flex; gap: 10px; align-items: flex-start; }
.ev-rows .gi { width: 16px; height: 16px; color: var(--muted); margin-top: 2px; }
.ev-desc { color: var(--muted); white-space: pre-line; overflow-wrap: anywhere; }
.note.gray { background: #F2F6FB; color: var(--muted); }
.note.gray .gi { width: 16px; height: 16px; color: #8A9BB3; }
a.btn { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.wcell .gchip span, .wcell .gchip b { text-transform: none; letter-spacing: 0; font-size: 12px; }
.wcell .gchip span { font-weight: 500; color: var(--text); }
.wcell .gchip b { font-weight: 750; color: var(--navy); }
