/* ธีมสนุกสดใส: ครีม + ส้มคอรัล + เหลืองแดด, เส้นขอบหนาแบบสติกเกอร์, อนิเมชันเด้ง ๆ */
:root {
  --bg: #fff7ec; --card: #ffffff; --soft: #fdeedd; --text: #3b2440; --muted: #86748a; --ink: #3b2440;
  --coral: #ff7a45; --coral-soft: #ffe2d4; --sun: #ffc94a; --sun-soft: #fff1c9; --mint: #5fc493; --mint-soft: #dff3e6;
  --sky: #8b9cf0; --sky-soft: #e3e6fb; --pink: #ff6f91; --pink-soft: #ffe1e8; --deco: #fde4c8; --on-coral: #fff;
  --pop: 4px 4px 0 var(--ink); --pop-sm: 3px 3px 0 var(--ink);
  --radius: 24px; --nav-h: 74px; --font: 'Sarabun', system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #221527; --card: #2f1f36; --soft: #3a2743; --text: #fff3e6; --muted: #c4b0c4; --ink: #120a15;
  --coral-soft: #4a2a2a; --sun-soft: #43361d; --mint-soft: #1f3a2d; --sky-soft: #2a2d4d; --pink-soft: #452436; --deco: #33223b; color-scheme: dark } }
:root[data-theme="dark"] {
  --bg: #221527; --card: #2f1f36; --soft: #3a2743; --text: #fff3e6; --muted: #c4b0c4; --ink: #120a15;
  --coral-soft: #4a2a2a; --sun-soft: #43361d; --mint-soft: #1f3a2d; --sky-soft: #2a2d4d; --pink-soft: #452436; --deco: #33223b; color-scheme: dark }

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 16px; line-height: 1.5; -webkit-tap-highlight-color: transparent; overflow-x: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.25; font-weight: 800; text-wrap: balance; }
h1 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; font-weight: 700; }
.muted { color: var(--muted); }
a { color: inherit; }

/* พื้นหลังลอย */
.bg-deco { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.deco { position: absolute; }
.deco.cloud { animation: drift 40s linear infinite; opacity: .9; }
.deco.leaf { animation: leaf 14s ease-in-out infinite; }
.deco.star { animation: twinkle 3s ease-in-out infinite; }
@keyframes drift { from { transform: translateX(-30px) } 50% { transform: translateX(60px) } to { transform: translateX(-30px) } }
@keyframes leaf { 0%, 100% { transform: translate(0, 0) rotate(0) } 50% { transform: translate(20px, 30px) rotate(40deg) } }
@keyframes twinkle { 0%, 100% { transform: scale(.6); opacity: .4 } 50% { transform: scale(1.1); opacity: 1 } }

.app { position: relative; z-index: 1; display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 20px 16px; display: flex; flex-direction: column; gap: 14px; }
.brand { display: flex; align-items: center; gap: 8px; padding: 0 6px 6px; font-weight: 800; font-size: 1.15rem; }
#sideNav { display: flex; flex-direction: column; gap: 6px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 99px; text-decoration: none; font-weight: 700; color: var(--muted); border: 2.5px solid transparent; transition: .2s; }
.nav-item .ni { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--soft); flex: none; transition: .2s; }
.nav-item svg { width: 20px; height: 20px; }
.nav-item:hover { color: var(--text); }
.nav-item:hover .ni { transform: rotate(-10deg) scale(1.08); }
.nav-item.active { background: var(--card); color: var(--text); border-color: var(--ink); box-shadow: var(--pop-sm); }
.nav-item.active .ni { background: var(--coral); color: #fff; }
.side-card { margin-top: auto; background: var(--sun); color: #3b2440; border: 2.5px solid var(--ink); box-shadow: var(--pop); border-radius: var(--radius); padding: 14px; text-align: center; }
.side-card .big { font-size: 1.8rem; font-weight: 800; line-height: 1.1; }

main { padding: 26px 32px 48px; min-width: 0; max-width: 1240px; width: 100%; }
.loading { padding: 80px; text-align: center; color: var(--muted); }
.view > * { animation: popIn .5s cubic-bezier(.2, 1.4, .4, 1) both; }
.view > *:nth-child(2) { animation-delay: .06s } .view > *:nth-child(3) { animation-delay: .12s } .view > *:nth-child(4) { animation-delay: .18s } .view > *:nth-child(5) { animation-delay: .24s } .view > *:nth-child(n+6) { animation-delay: .3s }
@keyframes popIn { from { opacity: 0; transform: translateY(18px) scale(.97) } to { opacity: 1; transform: none } }

.bottom-nav { display: none; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.topbar .t { display: flex; align-items: center; gap: 12px; }
.grid { display: grid; gap: 18px; }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
.card { background: var(--card); border: 2.5px solid var(--ink); border-radius: var(--radius); padding: 18px; box-shadow: var(--pop); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.card-head h2 { display: flex; align-items: center; gap: 8px; }
.link { font-weight: 700; color: var(--coral); text-decoration: none; cursor: pointer; background: none; border: 0; padding: 0; }

/* Hero */
.hero { position: relative; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 10px 22px; background: var(--sun-soft); border: 2.5px solid var(--ink); border-radius: 32px; padding: 18px 26px; margin-bottom: 22px; box-shadow: var(--pop); overflow: hidden; }
.hero::after { content: ''; position: absolute; right: -60px; bottom: -80px; width: 260px; height: 260px; border-radius: 50%; background: var(--coral-soft); z-index: 0; }
.hero > * { position: relative; z-index: 1; }
.bubble { display: inline-block; background: var(--card); border: 2.5px solid var(--ink); border-radius: 22px; padding: 10px 18px; font-weight: 800; font-size: 1.25rem; position: relative; animation: wobble 4s ease-in-out infinite; }
.bubble::before { content: ''; position: absolute; left: -11px; top: 50%; width: 16px; height: 16px; background: var(--card); border-left: 2.5px solid var(--ink); border-bottom: 2.5px solid var(--ink); transform: translateY(-50%) rotate(45deg); }
@keyframes wobble { 0%, 100% { transform: rotate(0) } 50% { transform: rotate(-1.5deg) } }
.hero h1 { margin: 10px 0 14px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 2.5px solid var(--ink); border-radius: 99px; padding: 10px 20px; font-weight: 800; cursor: pointer; background: var(--coral); color: var(--on-coral); box-shadow: var(--pop-sm); transition: transform .15s, box-shadow .15s; text-decoration: none; white-space: nowrap; }
.btn:hover { transform: translate(-1px, -2px); box-shadow: 4px 5px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--ink); }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.ghost { background: var(--card); color: var(--text); }
.btn.sun { background: var(--sun); color: #3b2440; }
.btn.mint { background: var(--mint); color: #12301f; }
.btn.danger { background: var(--pink); }
.btn.lg { padding: 14px 30px; font-size: 1.15rem; }
.btn.sm { padding: 6px 14px; font-size: .9rem; }
.btn.round { width: 52px; height: 52px; padding: 0; border-radius: 50%; }
.btn.play { width: 92px; height: 92px; padding: 0; border-radius: 50%; font-size: 2rem; animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: var(--pop), 0 0 0 0 rgba(255,122,69,.45) } 50% { box-shadow: var(--pop), 0 0 0 16px rgba(255,122,69,0) } }
.info { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--ink); background: var(--card); font-weight: 800; cursor: pointer; display: inline-grid; place-items: center; flex: none; font-size: .9rem; }

/* Picture tiles */
.tile { cursor: pointer; border: 2.5px solid var(--ink); border-radius: var(--radius); padding: 14px 12px; background: var(--card); box-shadow: var(--pop-sm); transition: transform .2s cubic-bezier(.2,1.6,.4,1), background .2s; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; text-decoration: none; color: inherit; position: relative; }
.tile:hover { transform: translateY(-4px) rotate(-1deg); }
.tile.sel { background: var(--coral-soft); box-shadow: var(--pop); transform: translateY(-3px); }
.tile.sel::after { content: '✓'; position: absolute; top: -12px; right: -10px; width: 30px; height: 30px; border-radius: 50%; background: var(--mint); color: #12301f; border: 2.5px solid var(--ink); display: grid; place-items: center; font-weight: 800; animation: popIn .4s cubic-bezier(.2,1.6,.4,1); }
.tile b { font-size: 1.05rem; font-weight: 800; }
.tile .info { position: absolute; top: 8px; right: 8px; }
.tag { display: inline-block; font-size: .78rem; padding: 2px 10px; border-radius: 99px; border: 2px solid var(--ink); background: var(--card); font-weight: 700; }
.tag.hot { background: var(--sun); color: #3b2440; }

/* KPI */
.kpi { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; position: relative; overflow: hidden; }
.kpi .ico { font-size: 1.7rem; width: 50px; height: 50px; border-radius: 16px; display: grid; place-items: center; border: 2.5px solid var(--ink); animation: bob 3s ease-in-out infinite; }
.kpi .val { font-size: 1.9rem; font-weight: 800; line-height: 1.1; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi .lbl { font-weight: 700; color: var(--muted); }
@keyframes bob { 0%, 100% { transform: translateY(0) } 50% { transform: translateY(-5px) } }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 2.5px solid var(--ink); background: var(--card); padding: 6px 13px; border-radius: 99px; cursor: pointer; font-weight: 700; font-size: .95rem; transition: transform .15s; display: inline-flex; align-items: center; gap: 6px; }
.chip:hover { transform: scale(1.05); }
.chip.on { background: var(--sun); color: #3b2440; box-shadow: var(--pop-sm); }
.chip.pos.on { background: var(--mint); color: #12301f; }
.chip.neg.on { background: var(--coral); color: #fff; }
.chip .em { font-size: 1.15rem; }

/* Session progress: koala walks along the track */
.track { position: relative; height: 14px; background: var(--soft); border: 2.5px solid var(--ink); border-radius: 99px; margin: 34px 22px 26px; }
.track .fill { position: absolute; inset: 0 auto 0 0; background: var(--mint); border-radius: 99px; transition: width .6s cubic-bezier(.2,1.4,.4,1); }
.track .walker { position: absolute; top: -42px; transform: translateX(-50%); transition: left .6s cubic-bezier(.2,1.4,.4,1); }
.step-title { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 22px; text-align: center; }
.step-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 26px; position: sticky; bottom: 0; padding: 14px 0; background: linear-gradient(transparent, var(--bg) 35%); z-index: 2; }

.faces { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.face-btn { background: none; border: 0; padding: 4px; cursor: pointer; border-radius: 50%; transition: transform .2s cubic-bezier(.2,1.6,.4,1); }
.face-btn:hover { transform: scale(1.12) rotate(-6deg); }
.face-btn.on { transform: scale(1.25); filter: drop-shadow(3px 3px 0 var(--ink)); }
.face-btn.on svg { animation: bob 1.4s ease-in-out infinite; }
.range { width: 100%; accent-color: var(--coral); height: 28px; }

.prayer-text { white-space: pre-line; font-size: 1.1rem; line-height: 1.95; text-align: center; font-weight: 500; }

/* Timer */
.timer-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.timer-stage { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; background: var(--sky-soft); }
.ring { position: relative; width: min(320px, 76vw); aspect-ratio: 1; display: grid; place-items: center; }
.ring svg.prog { position: absolute; inset: 0; transform: rotate(-90deg); }
.ring .breath { position: absolute; inset: 12%; border-radius: 50%; background: var(--card); border: 2.5px dashed var(--ink); animation: breathe 10s ease-in-out infinite; }
.ring .center { position: relative; display: flex; flex-direction: column; align-items: center; }
.bubbles i { position: absolute; bottom: 10%; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--ink); background: var(--card); animation: rise 6s ease-in infinite; opacity: 0; }
@keyframes rise { 0% { transform: translateY(0) scale(.5); opacity: 0 } 20% { opacity: 1 } 100% { transform: translateY(-260px) scale(1.1); opacity: 0 } }
.time-big { font-size: 2.6rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.cue { font-size: 1.3rem; font-weight: 800; min-height: 1.6em; }
.phase-dots { display: flex; gap: 8px; }
.phase-dots span { width: 34px; height: 34px; border-radius: 50%; border: 2.5px solid var(--ink); display: grid; place-items: center; background: var(--card); font-size: 1rem; transition: .3s; }
.phase-dots span.on { background: var(--sun); transform: scale(1.15); }
.phase-dots span.done { background: var(--mint); }
.paused .breath, .paused .mascot .m-float, .paused .bubbles i { animation-play-state: paused; }
@keyframes breathe { 0%, 100% { transform: scale(.82) } 40%, 50% { transform: scale(1.08) } }

/* Mascot animations */
.mascot { overflow: visible; }
.mascot .m-float { animation: mfloat 3.6s ease-in-out infinite; transform-origin: 100px 190px; }
.mascot .m-shadow { animation: mshadow 3.6s ease-in-out infinite; transform-origin: 100px 193px; }
.mascot .m-eyes { animation: blink 4.5s infinite; transform-box: fill-box; transform-origin: center; }
.mascot .m-ear-l { animation: earL 5s ease-in-out infinite; transform-origin: 70px 76px; }
.mascot .m-ear-r { animation: earR 5s ease-in-out infinite; transform-origin: 130px 76px; }
.mascot .m-head { animation: tilt 7s ease-in-out infinite; transform-origin: 100px 130px; }
.mascot .m-zzz text { fill: var(--sky); font-weight: 800; font-family: var(--font); animation: zzz 2.6s ease-in-out infinite; }
.mascot .m-zzz text:nth-child(2) { animation-delay: .6s; }
.mascot .m-spark path { animation: twinkle 1.8s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.mascot .m-spark path:nth-child(2) { animation-delay: .7s; }
.mascot .m-arms-up { animation: cheer .6s ease-in-out infinite alternate; transform-origin: 100px 140px; }
.mascot.breathe .m-float { animation: mbreath 10s ease-in-out infinite; }
.mascot.breathe .m-shadow { animation: none; }
@keyframes mfloat { 0%, 100% { transform: translateY(0) } 50% { transform: translateY(-7px) } }
@keyframes mshadow { 0%, 100% { transform: scaleX(1) } 50% { transform: scaleX(.85) } }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1) } 95% { transform: scaleY(.1) } }
@keyframes earL { 0%, 80%, 100% { transform: rotate(0) } 85% { transform: rotate(-12deg) } 90% { transform: rotate(4deg) } }
@keyframes earR { 0%, 60%, 100% { transform: rotate(0) } 65% { transform: rotate(12deg) } 70% { transform: rotate(-4deg) } }
@keyframes tilt { 0%, 100% { transform: rotate(0) } 30% { transform: rotate(-4deg) } 60% { transform: rotate(3deg) } }
@keyframes zzz { 0% { transform: translate(0, 6px); opacity: 0 } 50% { opacity: 1 } 100% { transform: translate(6px, -10px); opacity: 0 } }
@keyframes cheer { from { transform: translateY(0) } to { transform: translateY(-6px) } }
@keyframes mbreath { 0%, 100% { transform: scale(1) } 40%, 50% { transform: scale(1.06, 1.08) } }

/* Art animations */
.art { overflow: visible; flex: none; }
.art.wave-art { overflow: hidden; border-radius: 16px; }
.a-spin { animation: spin 14s linear infinite; }
.a-rise { animation: bob 3s ease-in-out infinite; }
.a-bob { animation: bob 2.6s ease-in-out infinite; }
.a-steam { animation: steam 2.4s ease-in-out infinite; opacity: 0; }
.a-twinkle { animation: twinkle 2s ease-in-out infinite; }
.a-sway { animation: sway 3s ease-in-out infinite; }
.a-drop { animation: drop 1.4s linear infinite; }
.a-wave { animation: wavemove 4s linear infinite; }
.a-ripple { animation: ripple 2.4s ease-out infinite; transform-box: fill-box; transform-origin: center; }
.a-zzz text { animation: zzz 2.6s ease-in-out infinite; } .a-zzz text:nth-child(2) { animation-delay: .7s; }
.a-note { animation: zzz 2s ease-in-out infinite; }
.a-bird { animation: bob 2s ease-in-out infinite; }
.a-ring { animation: ring 2.5s ease-in-out infinite; }
@keyframes spin { to { transform: rotate(360deg) } }
@keyframes steam { 0% { transform: translateY(6px); opacity: 0 } 40% { opacity: 1 } 100% { transform: translateY(-8px); opacity: 0 } }
@keyframes sway { 0%, 100% { transform: rotate(-6deg) } 50% { transform: rotate(6deg) } }
@keyframes drop { 0% { transform: translateY(-6px); opacity: 0 } 30% { opacity: 1 } 100% { transform: translateY(14px); opacity: 0 } }
@keyframes wavemove { from { transform: translateX(0) } to { transform: translateX(var(--dist, -160px)) } }
@keyframes ripple { from { transform: scale(.6); opacity: 1 } to { transform: scale(1.4); opacity: 0 } }
@keyframes ring { 0%, 70%, 100% { transform: rotate(0) } 75% { transform: rotate(-12deg) } 80% { transform: rotate(12deg) } 85% { transform: rotate(-8deg) } 90% { transform: rotate(6deg) } }

/* Charts */
.chart svg { width: 100%; height: auto; display: block; }
.chart text { fill: var(--muted); font-size: 12px; font-weight: 700; font-family: var(--font); }
.legend { display: flex; gap: 12px; font-size: .85rem; font-weight: 700; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--ink); margin-right: 5px; vertical-align: -1px; }

.list { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border: 2px solid var(--ink); border-radius: 18px; background: var(--card); transition: transform .15s; }
.row.click { cursor: pointer; }
.row.click:hover { transform: translateX(4px); }
.row .grow { flex: 1; min-width: 0; }
.row .grow b { display: block; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .grow small { color: var(--muted); font-weight: 600; }
.mini-faces { display: flex; align-items: center; gap: 2px; font-weight: 800; color: var(--muted); }

.badge { text-align: center; padding: 10px 4px; border-radius: 18px; border: 2px solid var(--ink); background: var(--sun-soft); }
.badge .i { font-size: 1.8rem; display: block; animation: bob 3s ease-in-out infinite; }
.badge b { display: block; font-size: .78rem; }
.badge.locked { filter: grayscale(1); opacity: .35; border-style: dashed; }
.badge.locked .i { animation: none; }

.switch { position: relative; width: 56px; height: 32px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--soft); border: 2.5px solid var(--ink); border-radius: 99px; cursor: pointer; transition: .2s; }
.switch span::after { content: ''; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; border-radius: 50%; background: var(--card); border: 2px solid var(--ink); transition: .25s cubic-bezier(.2,1.6,.4,1); }
.switch input:checked + span { background: var(--mint); }
.switch input:checked + span::after { transform: translateX(24px); }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 800; }
.input { border: 2.5px solid var(--ink); background: var(--card); border-radius: 16px; padding: 10px 14px; width: 100%; outline: none; font-weight: 600; }
.input:focus { box-shadow: var(--pop-sm); }
textarea.input { min-height: 90px; resize: vertical; }

.tabs { display: flex; gap: 8px; margin-bottom: 18px; overflow-x: auto; padding: 4px 4px 8px; }
.tabs button { border: 2.5px solid var(--ink); background: var(--card); padding: 8px 18px; border-radius: 99px; cursor: pointer; font-weight: 800; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.tabs button.on { background: var(--coral); color: #fff; box-shadow: var(--pop-sm); }

.notice { background: var(--sun-soft); border: 2.5px solid var(--ink); border-radius: 20px; padding: 12px 16px; font-weight: 600; }
.empty { text-align: center; padding: 20px 10px; color: var(--muted); font-weight: 700; display: flex; flex-direction: column; align-items: center; gap: 8px; }

.modal { position: fixed; inset: 0; background: rgba(40,20,45,.45); display: grid; place-items: center; z-index: 50; padding: 16px; backdrop-filter: blur(4px); }
.modal[hidden] { display: none; }
.modal .box { background: var(--card); border: 3px solid var(--ink); box-shadow: 6px 6px 0 var(--ink); border-radius: 30px; padding: 24px; width: min(540px, 100%); max-height: 90vh; overflow: auto; animation: popIn .4s cubic-bezier(.2,1.5,.4,1); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--card); color: var(--text); border: 2.5px solid var(--ink); box-shadow: var(--pop); padding: 8px 16px 8px 8px; border-radius: 99px; z-index: 60; display: flex; align-items: center; gap: 10px; font-weight: 700; max-width: calc(100vw - 32px); animation: popIn .4s cubic-bezier(.2,1.5,.4,1); }
.toast[hidden] { display: none; }

.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 70; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 14px; border-radius: 3px; border: 1.5px solid #3b2440; animation: fall linear forwards; }
@keyframes fall { to { top: 105%; transform: rotate(720deg) translateX(40px); } }

.big-delta { display: flex; justify-content: center; align-items: center; gap: 14px; margin: 8px 0; }
.big-delta .arrow { font-size: 2rem; font-weight: 800; color: var(--coral); animation: nudge 1s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { transform: translateX(0) } 50% { transform: translateX(6px) } }
.days { display: flex; gap: 4px; }
.days span { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--ink); font-size: .7rem; font-weight: 800; display: grid; place-items: center; }
.days span.on { background: var(--sun); color: #3b2440; }
.days span.off { opacity: .3; border-style: dashed; }
.time-xl { font-size: 1.7rem; font-weight: 800; font-variant-numeric: tabular-nums; }

@media (max-width: 1100px) { .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-main { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  main { padding: 16px 16px calc(var(--nav-h) + 30px + env(safe-area-inset-bottom)); }
  .bottom-nav { display: flex; position: fixed; left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 40; background: var(--card); border: 2.5px solid var(--ink); box-shadow: var(--pop); border-radius: 99px; height: var(--nav-h); padding: 0 6px; }
  .bottom-nav a { flex: 1; display: grid; place-items: center; text-decoration: none; color: var(--muted); }
  .bottom-nav a .ni { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; transition: .2s; }
  .bottom-nav a svg { width: 24px; height: 24px; }
  .bottom-nav a.active { color: var(--text); }
  .bottom-nav a.active .ni { background: var(--sun); border: 2.5px solid var(--ink); }
  .bottom-nav a.fab .ni { width: 64px; height: 64px; margin-top: -30px; background: var(--coral); color: #fff; border: 2.5px solid var(--ink); box-shadow: var(--pop-sm); }
  .g-3, .g-2, .timer-wrap { grid-template-columns: 1fr; }
  .g-2.keep { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { grid-template-columns: 1fr; justify-items: center; text-align: center; padding: 16px; }
  .bubble::before { left: 50%; top: -11px; transform: translateX(-50%) rotate(135deg); }
  .toast { bottom: calc(var(--nav-h) + 24px); }
}
@media (max-width: 420px) { .g-4 { gap: 12px; } .card { padding: 14px; } .kpi .val { font-size: 1.5rem; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
