/* ============================================================
   style.css — پوسته‌ی کامل برنامه‌ریز من
   Cinematic astronomical identity: eight true sky periods cross-
   fade behind glassy, quiet surfaces. Persian turquoise + gold
   accents. A drawn SVG moon replaces the emoji. Mature, cool,
   atmospheric — never childish.
   ============================================================ */

/* ---------- local Vazirmatn (bundled, OFL) ---------- */
@font-face {
  font-family: 'Vazirmatn';
  font-weight: 400; font-style: normal; font-display: swap;
  src: url('/fonts/vazirmatn-arabic-400.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+200C-200E, U+2010-2011, U+204F, U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
  font-family: 'Vazirmatn';
  font-weight: 400; font-style: normal; font-display: swap;
  src: url('/fonts/vazirmatn-latin-400.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+2000-206F, U+2074, U+20AC, U+2212, U+2215;
}
@font-face {
  font-family: 'Vazirmatn';
  font-weight: 500; font-style: normal; font-display: swap;
  src: url('/fonts/vazirmatn-arabic-500.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+200C-200E, U+2010-2011, U+204F, U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
  font-family: 'Vazirmatn';
  font-weight: 500; font-style: normal; font-display: swap;
  src: url('/fonts/vazirmatn-latin-500.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+2000-206F, U+2074, U+20AC, U+2212, U+2215;
}
@font-face {
  font-family: 'Vazirmatn';
  font-weight: 700; font-style: normal; font-display: swap;
  src: url('/fonts/vazirmatn-arabic-700.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+200C-200E, U+2010-2011, U+204F, U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
  font-family: 'Vazirmatn';
  font-weight: 700; font-style: normal; font-display: swap;
  src: url('/fonts/vazirmatn-latin-700.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+2000-206F, U+2074, U+20AC, U+2212, U+2215;
}

/* ---------- design tokens ---------- */
:root {
  --bg-grad-transition: 3500ms ease-in-out;
  --radius: 18px;
  --nav-h: calc(64px + env(safe-area-inset-bottom));
  --accent: #2fb9a8;          /* Persian turquoise */
  --accent-2: #d9a441;        /* saffron gold */
  --accent-3: #3d8fb0;        /* lapis blue */
  --danger: #e0655e;
  --gold-soft: rgba(217, 164, 65, .16);
}

html[data-scheme='dark'] {
  color-scheme: dark;
  --text: #e8ecfa;
  --muted: #93a0c2;
  --surface: rgba(13, 18, 42, 0.58);
  --surface-glass: rgba(24, 32, 66, 0.42);
  --border: rgba(148, 162, 214, 0.16);
  --shadow: 0 14px 34px rgba(2, 5, 20, .5);
  --input-bg: rgba(8, 12, 32, .55);
  --title-glow: 0 0 22px rgba(120, 160, 255, .18);
}
html[data-scheme='light'] {
  color-scheme: light;
  --text: #17263f;
  --muted: #536a8c;
  --surface: rgba(255, 255, 255, 0.66);
  --surface-glass: rgba(255, 255, 255, 0.52);
  --border: rgba(28, 64, 105, 0.13);
  --shadow: 0 10px 26px rgba(40, 80, 120, .12);
  --input-bg: rgba(255, 255, 255, 0.75);
  --title-glow: none;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'Vazirmatn', Tahoma, system-ui, sans-serif;
  color: var(--text);
  background: #060a1c;                       /* base under layers */
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: color .9s ease;
  padding-top: env(safe-area-inset-top);
}

button { font-family: inherit; color: inherit; cursor: pointer; }

/* ---------- animated background stack ---------- */
#bgfx { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg-layer {
  position: absolute; inset: 0;
  opacity: 0;
  transition: opacity var(--bg-grad-transition);
  will-change: opacity;
}
#stars { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 1.6s ease; }

/* the drawn moon */
#moon-disc {
  position: absolute; z-index: 2;
  opacity: 0;
  transition: opacity 2.4s ease, inset-inline-end 4s linear, top 4s linear;
  user-select: none;
  filter: drop-shadow(0 0 18px rgba(210, 228, 255, .28));
}
#moon-disc svg { width: 100%; height: 100%; display: block; }
#moon-glow {
  position: absolute; z-index: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%,
    rgba(198, 222, 250, .5) 0%,
    rgba(160, 178, 220, .24) 45%,
    transparent 70%);
  filter: blur(8px);
  opacity: 0;
  transition: opacity 3s ease, width 2s ease, height 2s ease, inset-inline-end 4s linear, top 4s linear;
  pointer-events: none;
}

/* atmospheric layers */
#sun-glow {
  position: absolute; z-index: 1; width: 70vmax; height: 46vmax; border-radius: 50%;
  opacity: 0; filter: blur(30px);
  transition: opacity 3.2s ease, background 3.2s ease;
  background: radial-gradient(circle at 50% 60%, rgba(255, 196, 110, .5), transparent 62%);
  bottom: -18vmax; left: -14vmax;
}
#haze {
  position: absolute; z-index: 1; inset-inline: 0; bottom: 0; height: 34%;
  opacity: .5; transition: opacity 3s ease, background 3s ease;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, .16));
}
.wisp {
  position: absolute; z-index: 1; height: 9vmax; border-radius: 50%;
  filter: blur(26px); opacity: 0; transition: opacity 3.5s ease;
  background: rgba(214, 226, 248, .13);
}
.wisp.w1 { top: 16%; left: -30%; width: 46vw; animation: wisp-drift 95s linear infinite; }
.wisp.w2 { top: 38%; left: 55%; width: 38vw; height: 7vmax; animation: wisp-drift 130s linear infinite reverse; }
@keyframes wisp-drift {
  from { transform: translateX(-8vw); }
  to   { transform: translateX(130vw); }
}
#vignette {
  position: absolute; inset: 0; z-index: 3; opacity: .55;
  transition: opacity 3s ease;
  background: radial-gradient(120% 90% at 50% 42%, transparent 58%, rgba(2, 4, 14, .5) 100%);
}
/* light scheme: barely-there vignette tuned per daylight bucket */
html[data-scheme='light'] #vignette { opacity: .12; }
html[data-scheme='light'][data-bucket='goldenAm'] #vignette,
html[data-scheme='light'][data-bucket='goldenPm'] #vignette { opacity: .18; }
#grain {
  position: absolute; inset: -50%; z-index: 3; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)' opacity='.6'/%3E%3C/svg%3E");
  animation: grain-shift 9s steps(6) infinite;
}
@keyframes grain-shift {
  0%,100% { transform: translate(0,0); }
  20% { transform: translate(-4%,3%); }
  40% { transform: translate(3%,-5%); }
  60% { transform: translate(-5%,-2%); }
  80% { transform: translate(4%,4%); }
}

/* per-period atmosphere: sun-glow position/color + haze tone */
html[data-bucket='sunrise'] #sun-glow {
  opacity: .85; left: -20vmax; bottom: -16vmax;
  background: radial-gradient(circle at 50% 60%, rgba(255, 187, 92, .62), transparent 60%);
}
html[data-bucket='goldenAm'] #sun-glow {
  opacity: .4; left: -18vmax; bottom: -22vmax;
  background: radial-gradient(circle at 50% 60%, rgba(255, 214, 138, .45), transparent 62%);
}
html[data-bucket='goldenPm'] #sun-glow {
  opacity: .45; left: auto; right: -20vmax; bottom: -22vmax;
  background: radial-gradient(circle at 50% 60%, rgba(255, 202, 110, .5), transparent 62%);
}
html[data-bucket='sunset'] #sun-glow {
  opacity: .95; left: auto; right: -18vmax; bottom: -14vmax;
  background: radial-gradient(circle at 50% 60%, rgba(255, 138, 66, .66), transparent 60%);
}
html[data-bucket='dusk'] #sun-glow {
  opacity: .3; left: auto; right: -16vmax; bottom: -20vmax;
  background: radial-gradient(circle at 50% 60%, rgba(224, 106, 84, .4), transparent 58%);
}
html[data-bucket='dawn'] #sun-glow {
  opacity: .35; left: -16vmax; bottom: -20vmax;
  background: radial-gradient(circle at 50% 60%, rgba(96, 190, 170, .4), transparent 60%);
}
html[data-bucket='daylight'] #sun-glow {
  opacity: .22; left: -16vmax; bottom: -26vmax;
  background: radial-gradient(circle at 50% 60%, rgba(255, 240, 200, .38), transparent 64%);
}
html[data-bucket='night'] #sun-glow { opacity: 0; }

html[data-bucket='sunset'] #haze,
html[data-bucket='goldenPm'] #haze {
  background: linear-gradient(180deg, transparent, rgba(255, 190, 120, .22));
}
html[data-bucket='sunrise'] #haze {
  background: linear-gradient(180deg, transparent, rgba(255, 220, 160, .26));
}
html[data-bucket='dawn'] #haze {
  background: linear-gradient(180deg, transparent, rgba(110, 200, 180, .16));
}
html[data-bucket='night'] #haze,
html[data-bucket='dusk'] #haze { opacity: .3; }
.wisp { opacity: .55; }
html[data-bucket='night'] .wisp { opacity: .3; }
html[data-bucket='dawn'] .wisp { opacity: .4; }

/* ---------- topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: transparent;
}
.brand { font-weight: 700; letter-spacing: .2px; opacity: .92; }
.spacer { flex: 1; }
.badge {
  font-size: 12px; padding: 3px 10px; border-radius: 999px;
  background: var(--surface-glass); border: 1px solid var(--border);
  backdrop-filter: blur(10px);
}
.badge[data-mode='ok']   { color: #6fd8c8; }
.badge[data-mode='warn'] { color: #f0a49b; }

/* ---------- main container & cards ---------- */
main {
  max-width: 560px; margin: 0 auto;
  padding: 6px 14px calc(var(--nav-h) + 18px);
  min-height: 70vh;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  padding: 14px;
  margin-bottom: 12px;
  transition: background .9s ease, border-color .9s ease;
}
.sec { font-size: 15px; margin: 18px 6px 8px; font-weight: 700; }
.sec.inline { display: inline-block; margin: 0 0 10px; }
.page-title { font-size: 21px; margin: 6px 4px 14px; text-shadow: var(--title-glow); }
.muted { color: var(--muted); }
.small-p, .hint { color: var(--muted); font-size: 12.5px; margin: 8px 4px; }
.hidden { display: none !important; }
.mono { font-family: ui-monospace, monospace; }

/* ---------- buttons / inputs ---------- */
.btn {
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 10px 16px;
  font-size: 14px; font-weight: 500;
  background: var(--surface-glass);
  transition: transform .12s ease, filter .2s;
}
.btn:active { transform: scale(.97); }
.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-3));
  color: #04222a; border: none; font-weight: 700;
  box-shadow: 0 6px 18px rgba(47, 185, 168, .26);
}
.btn.danger { background: rgba(224, 101, 94, .15); color: #f2b8b2; border-color: rgba(224, 101, 94, .35); }
html[data-scheme='light'] .btn.danger { color: #9c2f28; }
.btn.ghost { background: transparent; }
.btn.tiny { padding: 7px 12px; font-size: 13px; }
.btn.wide { width: 100%; }
.icon-btn {
  background: var(--surface-glass); border: 1px solid var(--border);
  width: 38px; height: 38px; border-radius: 12px; font-size: 17px;
  display: grid; place-items: center;
}
.fld, select.sel, textarea.fld {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 13px;
  padding: 11px 13px;
  font-size: 15px; font-family: inherit;
  outline: none;
  transition: border-color .2s;
}
.fld:focus, .sel:focus { border-color: var(--accent); }
textarea.fld { resize: vertical; }
label.lbl { display: block; font-size: 12.5px; color: var(--muted); margin: 0 4px 4px; }
.row { display: flex; align-items: center; }
.row.gap { gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.row.spread { justify-content: space-between; }
.col { display: block; }
.col.gap > *+* { margin-top: 8px; }
.grow { flex: 1; }

.seg { display: inline-flex; background: var(--surface-glass); border: 1px solid var(--border); border-radius: 13px; padding: 3px; gap: 3px; }
.seg button {
  border: none; background: transparent; padding: 8px 13px;
  border-radius: 10px; font-size: 13.5px; font-weight: 500; color: var(--muted);
  transition: all .18s;
}
.seg button.on {
  background: linear-gradient(135deg, rgba(47, 185, 168, .9), rgba(61, 143, 176, .9));
  color: #04222a; font-weight: 700;
}
.seg.small button { padding: 6px 9px; font-size: 12.5px; }
.seg.wide { display: flex; } .seg.wide button { flex: 1; }

.checkline { display: flex; gap: 8px; align-items: center; font-size: 14px; margin: 10px 2px; }
.cal-flip-line { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); margin: 10px 2px; }

/* ---------- bottom nav + fab ---------- */
.bottom-nav {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: var(--nav-h);
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  border-top: 1px solid var(--border);
}
.bottom-nav button {
  background: none; border: none;
  display: grid; place-items: center; gap: 2px;
  font-size: 11px; color: var(--muted); padding-top: 7px;
}
.bottom-nav button i { font-style: normal; font-size: 19px; line-height: 1; }
.bottom-nav button.on { color: var(--accent); font-weight: 700; }
.fab {
  position: fixed; z-index: 40;
  bottom: calc(var(--nav-h) + 14px);
  inset-inline-end: 18px;
  width: 58px; height: 58px; border-radius: 20px;
  border: none;
  font-size: 27px; font-weight: 300;
  background: linear-gradient(135deg, #2fb9a8, #3d8fb0);
  color: #04222a;
  box-shadow: 0 10px 26px rgba(30, 120, 130, .4);
  transition: transform .15s ease;
}
.fab:active { transform: scale(.94) rotate(-90deg); }

/* ---------- toast ---------- */
.toast {
  position: fixed; bottom: calc(var(--nav-h) + 16px); left: 50%; transform: translateX(-50%) translateY(20px);
  z-index: 60; opacity: 0; pointer-events: none;
  background: rgba(14, 20, 46, .92);
  color: var(--text);
  padding: 11px 18px; border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: all .25s ease; max-width: 86vw; text-align: center;
  backdrop-filter: blur(14px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast[data-kind='err'] { border-color: rgba(224, 101, 94, .45); }

/* ---------- today view ---------- */
.today-head .hero-line { display: flex; justify-content: space-between; align-items: center; margin: 10px 6px 2px; }
.greet { font-size: 14px; color: var(--muted); font-weight: 500; }
.moon-chip {
  font-size: 12.5px; padding: 4px 11px; border-radius: 999px;
  background: var(--surface-glass); border: 1px solid var(--border);
}
.date-header .dh-jalali { font-size: 23px; font-weight: 700; letter-spacing: .2px; }
.date-header .dh-gregorian { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.date-header .dh-gregorian .th-clock { color: var(--accent-2); font-weight: 500; }

.progress-card { display: flex; gap: 16px; align-items: center; }
.ring { width: 84px; height: 84px; transform: rotate(-90deg); flex-shrink: 0; }
.ring circle { fill: none; stroke-width: 9; stroke-linecap: round; }
.ring-bg { stroke: var(--border); }
.ring-fg { stroke: var(--accent); filter: drop-shadow(0 0 6px rgba(47, 185, 168, .5)); transition: stroke-dashoffset .7s ease; }
.progress-copy b { display: block; font-size: 15.5px; }
.progress-copy small { color: var(--muted); }

.quick-add { display: flex; gap: 9px; padding: 10px; }
.quick-add input { flex: 1; border: none; background: transparent; outline: none; color: inherit; font-size: 15px; }

.overdue-toggle {
  width: 100%; text-align: start; color: #f0a49b;
  background: rgba(224, 101, 94, .08);
  border: 1px dashed rgba(224, 101, 94, .4);
}

/* ---------- item rows ---------- */
.card.list { padding: 5px; }
.item-row {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 8px;
  border-bottom: 1px solid var(--border);
}
.item-row:last-child { border-bottom: none; }
.check {
  width: 26px; height: 26px; flex-shrink: 0;
  border-radius: 9px; border: 2px solid var(--accent);
  background: transparent; font-size: 14px; color: #04222a;
  display: grid; place-items: center; font-weight: 700;
  transition: all .18s;
}
.check.static { border-style: solid; border-width: 0; font-size: 17px; opacity: .85; }
.item-row.event .check.static { color: #d9a441; }
.item-title { font-size: 15px; font-weight: 500; word-break: break-word; }
.item-row.done .item-title { text-decoration: line-through; opacity: .55; }
.item-note { font-size: 12.5px; color: var(--muted); margin-top: 2px; white-space: pre-wrap; }
.item-chips { display: flex; gap: 5px; margin-top: 5px; flex-wrap: wrap; }
.chip { font-size: 10.5px; padding: 2px 8px; border-radius: 999px; background: var(--surface-glass); border: 1px solid var(--border); color: var(--muted); }
.chip.prio-1 { color: #6fd8c8; border-color: rgba(111, 216, 200, .35); }
.chip.prio-2 { color: #f0a49b; border-color: rgba(240, 164, 155, .45); }
.item-main { flex: 1; min-width: 0; }

/* ---------- calendar ---------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 10px; }
.cal-title { text-align: center; line-height: 1.25; }
.cal-title .main { font-size: 18px; font-weight: 700; }
.cal-title small { display: block; color: var(--muted); font-size: 12px; }
.row.tools { justify-content: center; gap: 8px; margin-bottom: 12px; }
.grid.weekdays { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; color: var(--muted); font-size: 11.5px; margin-bottom: 4px; }
.grid.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cell {
  position: relative; aspect-ratio: 1/1.06;
  border: 1px solid transparent; border-radius: 13px;
  background: var(--surface-glass);
  display: grid; place-content: center; gap: 0;
  padding-top: 2px;
}
.cell.blank { visibility: hidden; }
.cell b { font-size: 14.5px; font-weight: 600; }
.cell small { font-size: 9px; color: var(--muted); }
.cell.today { border-color: var(--accent-2); box-shadow: inset 0 0 0 1px var(--accent-2), 0 4px 14px rgba(217, 164, 65, .22); }
.cell.friday small { color: #f0a49b; }
.dots { position: absolute; bottom: 5px; left: 50%; transform: translateX(-50%); display: flex; gap: 2.5px; }
.dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent-3); }
.dot.task { background: #2fb9a8; }
.dot.event { background: #d9a441; }
.dot.hot { box-shadow: 0 0 6px currentColor; }
.daysheet-head { margin-bottom: 10px; }

/* ---------- plans / goals ---------- */
.goal-chip {
  display: inline-block; margin: 3px;
  padding: 7px 13px; border-radius: 999px;
  background: linear-gradient(135deg, rgba(217, 164, 65, .16), rgba(47, 185, 168, .13));
  border: 1px solid var(--border);
  font-size: 13px;
}
.agenda-group h3 { margin-top: 16px; }
.archive summary { cursor: pointer; font-weight: 700; font-size: 14px; }
.empty { text-align: center; color: var(--muted); padding: 22px 10px !important; }
.empty span { display: block; font-size: 30px; margin-bottom: 6px; }
.empty.small { padding: 16px 8px !important; font-size: 13px; }
.empty.small span { font-size: 20px; display: inline; margin-inline-end: 4px; }

/* ---------- sheet ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 80; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(2, 5, 16, .55); backdrop-filter: blur(3px); opacity: 0; transition: opacity .28s; }
.sheet {
  position: relative; width: min(560px, 100%);
  max-height: 88vh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface);
  backdrop-filter: blur(26px) saturate(160%);
  -webkit-backdrop-filter: blur(26px) saturate(160%);
  border: 1px solid var(--border); border-bottom: none;
  border-radius: 22px 22px 0 0;
  padding: 10px 16px calc(18px + env(safe-area-inset-bottom));
  box-shadow: 0 -12px 40px rgba(0, 6, 24, .4);
  transform: translateY(100%); transition: transform .32s cubic-bezier(.32,.72,.36,1);
}
.sheet-wrap.open .sheet { transform: translateY(0); }
.sheet-wrap.open .sheet-backdrop { opacity: 1; }
.sheet-handle { width: 44px; height: 4px; border-radius: 4px; background: var(--border); margin: 4px auto 8px; }
.sheet-title { font-size: 16px; font-weight: 700; margin: 2px 2px 10px; }
.confirm-msg { font-size: 14.5px; line-height: 1.8; }
.editor-actions { margin-top: 14px; }

/* ---------- auth ---------- */
.auth-root { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 18px; }
.auth-card { width: min(420px, 94vw); text-align: center; padding: 26px 22px; }
.logo { font-size: 26px; margin: 2px 0 4px; font-weight: 700;
  background: linear-gradient(135deg, #4fd0bd, #e8c169);
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-card form { display: grid; gap: 9px; margin-top: 12px; }

/* ---------- settings ---------- */
.set-sec h3.inline { margin-bottom: 8px; }
.notif-status { font-size: 13.5px; margin-bottom: 9px; }
.okok { color: #6fd8c8; }
.warn { color: #f0a49b; }
.city-list { max-height: 46vh; overflow-y: auto; margin: 8px 0; display: grid; gap: 4px; }
.city-row { text-align: start; padding: 10px 12px; border-radius: 11px; border: 1px solid var(--border); background: var(--surface-glass); font-size: 14px; }
.city-row small { color: var(--muted); margin-inline-start: 6px; }
.adv { margin-top: 10px; font-size: 13.5px; color: var(--muted); }
details.adv summary { cursor: pointer; }

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ============================================================
   Cinematic polish pass — micro-interactions & theme wiring.
   Every rule above is duration-capped by the reduced-motion
   guard (its !important wins over anything below).
   ============================================================ */

/* --- full-moon brightness lift (JS set --moon-lift; now it paints) --- */
#bgfx { transition: opacity .4s ease, filter 3s ease; }
html[data-scheme='dark'] #bgfx {
  filter: brightness(calc(1 + var(--moon-lift, 0) * 0.6))
          saturate(calc(1 + var(--moon-lift, 0) * 0.35));
}

/* --- slow aurora drift during dark periods (GPU-composited) --- */
html[data-scheme='dark'] .bg-layer::after {
  content: '';
  position: absolute; inset: -18%;
  background: radial-gradient(58% 42% at 72% 4%, rgba(47, 185, 168, .1), transparent 70%);
  animation: aurora-drift 52s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes aurora-drift {
  from { transform: translate3d(-2.5%, -1.5%, 0) scale(1); }
  to   { transform: translate3d(2.5%, 1.5%, 0) scale(1.07); }
}

/* --- toast: light-scheme surface --- */
html[data-scheme='light'] .toast { background: rgba(255, 255, 255, .95); }

/* --- done checkbox: filled turquoise + pop micro-interaction --- */
.item-row.done .check {
  background: var(--accent);
  border-color: transparent;
  color: #04222a;
}
.item-row { transition: background-color .2s ease; }
.item-row.pop .check { animation: check-pop .32s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes check-pop {
  0%   { transform: scale(.55); }
  60%  { transform: scale(1.22); }
  100% { transform: scale(1); }
}

/* --- page entrance: staggered rise on TAB SWITCH only --- */
.page-in > * { animation: rise-in .34s cubic-bezier(.22, .9, .3, 1) both; }
.page-in > *:nth-child(2) { animation-delay: .045s; }
.page-in > *:nth-child(3) { animation-delay: .09s; }
.page-in > *:nth-child(4) { animation-delay: .135s; }
.page-in > *:nth-child(5) { animation-delay: .18s; }
.page-in > *:nth-child(6) { animation-delay: .225s; }
@keyframes rise-in {
  from { opacity: 0; transform: translateY(10px); }
}

/* --- progress ring draws itself on page entry --- */
.page-in .ring-fg { animation: ring-draw .9s ease both; }
@keyframes ring-draw {
  from { stroke-dashoffset: 326.8; }   /* full circumference 2π·52 */
}

/* --- calendar: direction-aware month slide (RTL) --- */
.cal-title[data-anim] { animation: cal-fade .3s ease both; }
.grid.days[data-anim='next'] { animation: cal-next .32s ease both; }
.grid.days[data-anim='prev'] { animation: cal-prev .32s ease both; }
@keyframes cal-fade { from { opacity: 0; } }
@keyframes cal-next { from { opacity: 0; transform: translateX(-16px); } }
@keyframes cal-prev { from { opacity: 0; transform: translateX(16px); } }

/* --- sync badge flash --- */
.badge.flash { animation: badge-in .32s ease; }
@keyframes badge-in {
  from { opacity: 0; transform: translateY(-8px) scale(.92); }
}

/* --- bottom-nav active lift --- */
.bottom-nav button i { transition: transform .22s ease, filter .22s ease; }
.bottom-nav button.on i {
  transform: translateY(-2px) scale(1.12);
  filter: drop-shadow(0 0 8px rgba(47, 185, 168, .5));
}

/* --- hover polish (pointer devices only, never on touch) --- */
@media (hover: hover) {
  .btn:hover { filter: brightness(1.07); }
  .item-row:hover { background: rgba(140, 160, 220, .06); }
  .goal-chip { transition: transform .18s ease, border-color .18s ease; }
  .goal-chip:hover { transform: translateY(-2px); border-color: var(--accent-2); }
  .city-row:hover { border-color: var(--accent); }
  .fab { transition: transform .18s ease, box-shadow .2s ease; }
  .fab:hover { transform: translateY(-2px) scale(1.04); box-shadow: 0 14px 32px rgba(30, 130, 140, .48); }
  .cell:hover { border-color: var(--border); filter: brightness(1.12); }
}

/* --- keyboard focus --- */
:where(button, input, select, textarea, summary):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* --- date-picker weekday hint line --- */
.dp-week { font-size: 12.5px; color: var(--muted); margin: 6px 2px 2px; }

/* --- boot splash --- */
#boot-splash {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center;
  background: #060a1c;
}
#boot-splash .splash-inner { text-align: center; }
#boot-splash .moon-pulse { width: 54px; height: 54px; margin: 0 auto; animation: splash-pulse 1.7s ease-in-out infinite; }
#boot-splash .moon-pulse svg { width: 100%; height: 100%; }
#boot-splash .splash-fa { color: #93a0c2; margin-top: 10px; font-size: 14px; }
@keyframes splash-pulse {
  0%, 100% { transform: scale(1); opacity: .8; }
  50% { transform: scale(1.12); opacity: 1; }
}

/* --- desktop breathing room --- */
@media (min-width: 720px) {
  main { max-width: 640px; }
}
