/* Gentle Planner — Wrenessa
   Brand: cream, charcoal, sage, bronze-gold + companion palettes per theme */
@font-face{font-family:"Lora";src:url(/fonts/lora.woff) format("woff");font-weight:400 700;font-display:swap}
@font-face{font-family:"Lora";src:url(/fonts/lora-i.woff) format("woff");font-weight:400 700;font-style:italic;font-display:swap}
@font-face{font-family:"DM Sans";src:url(/fonts/dmsans.woff) format("woff");font-weight:300 800;font-display:swap}
@font-face{font-family:"Easy Read";src:url(/fonts/easy.woff) format("woff");font-weight:400;font-display:swap}
@font-face{font-family:"Easy Read";src:url(/fonts/easy-b.woff) format("woff");font-weight:700;font-display:swap}

:root{
  --bg:#F6F1E7;--surface:#FFFDF8;--surface2:#EFE8DA;--ink:#2F2B28;--muted:#6E665E;--line:#E3DACA;
  --accent:#7E9170;--accent-ink:#fff;--accent2:#B08D57;--soft1:#E4EBDD;--soft2:#F3E6CF;--soft3:#E9E1F1;--soft4:#F6DED3;--soft5:#DCE9EE;
  --good:#6E9461;--warn:#C0773F;--danger:#B4554B;
  --r:18px;--r2:12px;--shadow:0 1px 2px rgba(47,43,40,.06),0 8px 24px rgba(47,43,40,.06);
  --fs:16px;--display:"Lora",Georgia,serif;--body:"DM Sans",system-ui,-apple-system,"Segoe UI",sans-serif;
  color-scheme:light;
}
/* Themes (light) */
[data-theme=lavender]{--bg:#F4F1F7;--surface:#FFFEFF;--surface2:#E9E3F0;--ink:#2E2A33;--muted:#6B6475;--line:#DED6E8;--accent:#8C78B4;--accent2:#C7956B;--soft1:#E8E1F3;--soft2:#F5E7D9;--soft3:#E0EAF2;--soft4:#F4DFE6;--soft5:#E3EEDF}
[data-theme=seaglass]{--bg:#EFF5F3;--surface:#FCFFFE;--surface2:#DFEBE7;--ink:#24302E;--muted:#5E6F6B;--line:#D2E2DD;--accent:#4F8F86;--accent2:#C49A5C;--soft1:#D9ECE7;--soft2:#F1E8D6;--soft3:#E1E6F3;--soft4:#F3E0DA;--soft5:#DCEBF2}
[data-theme=clay]{--bg:#F7EFEA;--surface:#FFFCFA;--surface2:#EEDFD6;--ink:#33281F;--muted:#76655A;--line:#E8D6CB;--accent:#B86F58;--accent2:#8A9A6E;--soft1:#F3DDD3;--soft2:#EEE6D2;--soft3:#E6E2EE;--soft4:#F2D9D9;--soft5:#DDE8E3}
[data-theme=honey]{--bg:#F8F3E6;--surface:#FFFDF6;--surface2:#F0E6CC;--ink:#30291B;--muted:#72664D;--line:#E9DDBD;--accent:#B48A2E;--accent2:#6F8A82;--soft1:#F4E7C2;--soft2:#E3EADB;--soft3:#ECE3EF;--soft4:#F5DED0;--soft5:#DCE8EC}
[data-theme=slate]{--bg:#EFF2F5;--surface:#FDFEFF;--surface2:#E0E6EC;--ink:#252B33;--muted:#5D6672;--line:#D4DCE5;--accent:#5A7393;--accent2:#B08D57;--soft1:#DFE7F0;--soft2:#F1E9DA;--soft3:#E7E2F0;--soft4:#F1E0DC;--soft5:#DDEBE4}
/* Dark */
[data-mode=dark]{color-scheme:dark;--bg:#1B1A18;--surface:#252321;--surface2:#2F2C29;--ink:#F1EBE1;--muted:#ADA397;--line:#3A3632;--accent:#A3B793;--accent-ink:#1B1A18;--accent2:#CDAA72;--soft1:#2F362B;--soft2:#3A3226;--soft3:#322E3B;--soft4:#3B2D29;--soft5:#283439;--shadow:0 1px 2px rgba(0,0,0,.3),0 8px 24px rgba(0,0,0,.25)}
[data-mode=dark][data-theme=lavender]{--bg:#1C1A21;--surface:#25222C;--surface2:#2F2B37;--line:#3A3544;--accent:#B7A5DB;--soft1:#2F2A3B}
[data-mode=dark][data-theme=seaglass]{--bg:#161D1C;--surface:#1F2827;--surface2:#283331;--line:#33403E;--accent:#7FC0B5;--soft1:#22332F}
[data-mode=dark][data-theme=clay]{--bg:#1E1917;--surface:#28211E;--surface2:#332A26;--line:#41352F;--accent:#E0A08A;--soft1:#3A2A24}
[data-mode=dark][data-theme=honey]{--bg:#1D1B15;--surface:#27241C;--surface2:#322E23;--line:#40392A;--accent:#DDB65E;--soft1:#3A3220}
[data-mode=dark][data-theme=slate]{--bg:#171B20;--surface:#20262D;--surface2:#29313A;--line:#343E49;--accent:#94AECD;--soft1:#26303B}
[data-font=easy]{--body:"Easy Read","Comic Sans MS",system-ui,sans-serif;--display:"Easy Read","Comic Sans MS",sans-serif;letter-spacing:.02em;word-spacing:.08em}
[data-calm=on]{--soft1:var(--surface2);--soft2:var(--surface2);--soft3:var(--surface2);--soft4:var(--surface2);--soft5:var(--surface2)}
[data-calm=on] *{animation:none!important;transition:none!important}

*{box-sizing:border-box;min-width:0}
html{font-size:var(--fs);-webkit-text-size-adjust:100%}
body{margin:0;background:var(--bg);color:var(--ink);font:400 1rem/1.5 var(--body);overflow-x:hidden;-webkit-font-smoothing:antialiased}
button,input,select,textarea{font:inherit;color:inherit}
h1,h2,h3{font-family:var(--display);font-weight:600;margin:0;line-height:1.15;letter-spacing:-.01em}
h1{font-size:clamp(1.6rem,3.2vw,2.2rem)}h2{font-size:1.3rem}h3{font-size:1.05rem}
em.ital{font-style:italic;color:var(--accent)}
a{color:var(--accent)}
.muted{color:var(--muted)}.small{font-size:.86rem}.tiny{font-size:.76rem}
.hidden{display:none!important}

/* Shell */
.shell{display:grid;grid-template-columns:1fr;min-height:100dvh}
.side{display:none}
.main{padding:16px 16px calc(96px + env(safe-area-inset-bottom));max-width:1180px;width:100%;margin:0 auto}
.topbar{display:flex;align-items:center;gap:10px;padding:calc(10px + env(safe-area-inset-top)) 16px 10px;position:sticky;top:0;z-index:20;background:color-mix(in srgb,var(--bg) 88%,transparent);backdrop-filter:blur(10px)}
.topbar .brand{flex:1}
.brand{display:flex;align-items:center;gap:10px;text-decoration:none;color:var(--ink)}
.brand b{font-family:var(--display);font-size:1.15rem;font-weight:600}
.brand small{display:block;font-size:.7rem;color:var(--muted);letter-spacing:.02em}
.logo{width:34px;height:34px;flex:none;color:var(--accent2)}
.bottomnav{position:fixed;left:0;right:0;bottom:0;z-index:30;display:grid;grid-template-columns:repeat(5,1fr);background:var(--surface);border-top:1px solid var(--line);padding:6px 6px calc(6px + env(safe-area-inset-bottom))}
.bottomnav button{border:0;background:none;display:flex;flex-direction:column;align-items:center;gap:2px;padding:6px 2px;border-radius:12px;font-size:.72rem;color:var(--muted);cursor:pointer}
.bottomnav button svg{width:24px;height:24px}
.bottomnav button.on{color:var(--ink);background:var(--soft1)}
.bottomnav .plus{background:var(--accent);color:var(--accent-ink);border-radius:16px;margin:0 6px}
@media(min-width:900px){
  .shell{grid-template-columns:256px 1fr}
  .side{display:flex;flex-direction:column;gap:4px;position:sticky;top:0;height:100dvh;overflow:auto;padding:20px 14px;border-right:1px solid var(--line);background:var(--surface)}
  .topbar,.bottomnav{display:none}
  .main{padding:28px 32px 48px}
}
.side .brand{padding:4px 8px 16px}
.navbtn{display:flex;align-items:center;gap:12px;width:100%;border:0;background:none;padding:10px 12px;border-radius:12px;cursor:pointer;color:var(--ink);text-align:left;font-weight:500}
.navbtn svg{width:20px;height:20px;color:var(--muted);flex:none}
.navbtn:hover{background:var(--surface2)}
.navbtn.on{background:var(--soft1);font-weight:700}.navbtn.on svg{color:var(--accent)}
.side .grow{flex:1}
.side .dump{margin:6px 0 12px;justify-content:center;background:var(--accent);color:var(--accent-ink);font-weight:700}
.side .dump svg{color:inherit}

/* Page header + tabs */
.phead{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between;gap:12px;margin:4px 0 14px}
.phead p{margin:4px 0 0;color:var(--muted)}
.tabs{display:flex;gap:6px;overflow-x:auto;padding:2px 0 10px;margin-bottom:8px;scrollbar-width:none}
.tabs::-webkit-scrollbar{display:none}
.tab{flex:none;border:1px solid var(--line);background:var(--surface);border-radius:999px;padding:8px 14px;cursor:pointer;font-weight:500;font-size:.92rem;white-space:nowrap}
.tab.on{background:var(--ink);color:var(--bg);border-color:var(--ink)}

/* Cards & grid */
.grid{display:grid;gap:14px;align-items:start;grid-template-columns:repeat(12,minmax(0,1fr))}
.c12{grid-column:span 12}.c8{grid-column:span 12}.c6{grid-column:span 12}.c4{grid-column:span 12}.c3{grid-column:span 6}
@media(min-width:720px){.c6{grid-column:span 6}.c4{grid-column:span 6}.c3{grid-column:span 3}}
@media(min-width:1100px){.c8{grid-column:span 8}.c4{grid-column:span 4}}
.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:16px;box-shadow:var(--shadow)}
.card.soft1{background:var(--soft1);border-color:transparent}.card.soft2{background:var(--soft2);border-color:transparent}.card.soft3{background:var(--soft3);border-color:transparent}.card.soft4{background:var(--soft4);border-color:transparent}.card.soft5{background:var(--soft5);border-color:transparent}
.card h3{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:10px}
.card h3 .act{font-family:var(--body);font-size:.82rem;font-weight:600}
.kicker{font-size:.74rem;font-weight:700;color:var(--muted);text-transform:none;letter-spacing:.02em;margin-bottom:4px}
.big{font-family:var(--display);font-size:2rem;font-weight:600;line-height:1}
.row{display:flex;align-items:center;gap:10px}.row.wrap{flex-wrap:wrap}.between{justify-content:space-between}.gap4{gap:4px}
.stack>*+*{margin-top:10px}
.empty{padding:22px;text-align:center;color:var(--muted);border:1.5px dashed var(--line);border-radius:var(--r2)}

/* Buttons & inputs */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:10px 16px;border-radius:12px;border:1px solid var(--line);background:var(--surface);cursor:pointer;font-weight:600;text-decoration:none;color:var(--ink)}
.btn:hover{background:var(--surface2)}
.btn.pri{background:var(--accent);color:var(--accent-ink);border-color:transparent}
.btn.pri:hover{filter:brightness(.96)}
.btn.ghost{background:none;border-color:transparent}
.btn.sm{min-height:34px;padding:6px 12px;font-size:.86rem;border-radius:10px}
.btn.danger{color:var(--danger)}
.btn svg{width:18px;height:18px}
.iconbtn{width:40px;height:40px;display:inline-grid;place-items:center;border-radius:12px;border:1px solid var(--line);background:var(--surface);cursor:pointer}
.iconbtn svg{width:20px;height:20px}
input[type=text],input[type=number],input[type=date],input[type=time],input[type=password],input[type=email],input:not([type]),select,textarea{width:100%;min-height:44px;padding:10px 12px;border-radius:12px;border:1px solid var(--line);background:var(--surface);font-size:16px}
textarea{min-height:110px;resize:vertical;line-height:1.5}
input:focus,select:focus,textarea:focus,button:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
label.f{display:block;font-weight:600;font-size:.88rem;margin-bottom:12px}
label.f>span{display:block;margin-bottom:6px}
label.f.row{display:flex}label.f.row>span{margin:0}
.seg{display:flex;flex-wrap:wrap;gap:6px}
.seg button{border:1px solid var(--line);background:var(--surface);border-radius:999px;padding:8px 12px;cursor:pointer;font-size:.9rem;min-height:40px}
.seg button.on{background:var(--accent);border-color:var(--accent);color:var(--accent-ink);font-weight:700}

/* List items */
.list{display:flex;flex-direction:column;gap:8px}
.item{display:flex;align-items:center;gap:12px;padding:12px;border-radius:14px;background:var(--surface);border:1px solid var(--line);cursor:pointer}
.card .item{background:color-mix(in srgb,var(--surface) 70%,transparent)}
.item .grow{flex:1}
.item .t{font-weight:600;overflow-wrap:anywhere}
.item .m{font-size:.8rem;color:var(--muted);display:flex;flex-wrap:wrap;gap:4px 10px;margin-top:2px}
.item.done .t{text-decoration:line-through;color:var(--muted)}
.chk{appearance:none;-webkit-appearance:none;width:26px;height:26px;flex:none;border:2px solid var(--accent);border-radius:9px;display:grid;place-items:center;cursor:pointer;background:var(--surface)}
.chk:checked{background:var(--accent)}
.chk:checked::after{content:"";width:7px;height:12px;border:solid var(--accent-ink);border-width:0 3px 3px 0;transform:translateY(-1px) rotate(45deg)}
.pill{display:inline-flex;align-items:center;gap:4px;font-size:.74rem;font-weight:700;padding:3px 9px;border-radius:999px;background:var(--surface2);color:var(--ink)}
.pill.e-low{background:var(--soft5)}.pill.e-med{background:var(--soft2)}.pill.e-high{background:var(--soft4)}
.pill.ok{background:var(--soft1)}.pill.warn{background:var(--soft4)}
.bar{height:10px;border-radius:99px;background:var(--surface2);overflow:hidden}
.bar>i{display:block;height:100%;background:var(--accent);border-radius:99px}

/* Sheet / modal */
.scrim{position:fixed;inset:0;background:rgba(20,18,16,.38);z-index:80;display:flex;align-items:flex-end;justify-content:center;animation:fade .15s}
.sheet{background:var(--bg);width:100%;max-width:560px;max-height:92dvh;overflow:auto;border-radius:22px 22px 0 0;padding:18px 18px calc(18px + env(safe-area-inset-bottom));animation:up .2s ease-out}
@media(min-width:700px){.scrim{align-items:center}.sheet{border-radius:22px}}
.sheet h2{margin-bottom:14px}
.sheet .foot{display:flex;gap:8px;justify-content:space-between;margin-top:8px;flex-wrap:wrap}
@keyframes up{from{transform:translateY(30px);opacity:0}}@keyframes fade{from{opacity:0}}
@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}
.toast{position:fixed;left:50%;bottom:calc(92px + env(safe-area-inset-bottom));transform:translateX(-50%);background:var(--ink);color:var(--bg);padding:10px 16px;border-radius:12px;z-index:90;font-weight:600;max-width:90vw;box-shadow:var(--shadow)}

/* Today specifics */
.hello{display:flex;flex-wrap:wrap;justify-content:space-between;gap:16px;align-items:flex-end;margin-bottom:16px}
.daybar{position:relative;height:16px;border-radius:99px;background:var(--surface2);overflow:hidden;margin:10px 0 6px}
.daybar>i{position:absolute;inset:0 auto 0 0;background:linear-gradient(90deg,var(--accent),var(--accent2));border-radius:99px}
.battery{display:flex;gap:8px}
.battery button{flex:1;border:1.5px solid var(--line);background:var(--surface);border-radius:14px;padding:10px 6px;cursor:pointer;font-weight:600;font-size:.85rem;display:flex;flex-direction:column;align-items:center;gap:4px}
.battery button.on{border-color:var(--accent);background:var(--soft1)}
.batt{width:34px;height:16px;border:2px solid currentColor;border-radius:4px;position:relative;padding:1px}
.batt::after{content:"";position:absolute;right:-5px;top:4px;width:3px;height:5px;background:currentColor;border-radius:1px}
.batt i{display:block;height:100%;background:currentColor;border-radius:2px}
.moods{display:flex;gap:6px}
.moods button{flex:1;aspect-ratio:1;max-width:56px;border-radius:50%;border:2px solid transparent;cursor:pointer;display:grid;place-items:center}
.moods button.on{border-color:var(--ink)}
.moods svg{width:70%;height:70%}
.pick{background:var(--ink);color:var(--bg);border-radius:var(--r);padding:18px}
.pick .btn{background:var(--bg);color:var(--ink);border:0}
.sos{position:fixed;inset:0;z-index:70;background:var(--bg);overflow:auto;padding:calc(24px + env(safe-area-inset-top)) 20px 40px}
.sos .in{max-width:520px;margin:0 auto}
.breath{width:180px;height:180px;margin:24px auto;border-radius:50%;background:var(--soft1);display:grid;place-items:center;animation:breathe 8s ease-in-out infinite;font-weight:700}
@keyframes breathe{0%,100%{transform:scale(.78)}50%{transform:scale(1)}}

/* Calendar */
.cal{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:4px}
.cal .dow{font-size:.72rem;font-weight:700;color:var(--muted);text-align:center;padding:4px 0}
.cal .d{min-height:74px;background:var(--surface);border:1px solid var(--line);border-radius:10px;padding:5px;font-size:.78rem;cursor:pointer;overflow:hidden}
.cal .d.out{opacity:.4}.cal .d.today{border-color:var(--accent);box-shadow:inset 0 0 0 1px var(--accent)}
.cal .d b{display:block;font-size:.82rem}
.cal .ev{display:block;background:var(--soft1);border-radius:5px;padding:1px 4px;margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:.7rem}
.cal .ev.task{background:var(--soft2)}.cal .ev.bill{background:var(--soft4)}.cal .ev.bday{background:var(--soft3)}
@media(max-width:560px){.cal .d{min-height:54px}.cal .ev{font-size:0;height:6px;padding:0}}
.week{display:grid;gap:10px;grid-template-columns:repeat(auto-fit,minmax(150px,1fr))}
@media(min-width:1180px){.week{grid-template-columns:repeat(7,minmax(0,1fr))}}
.timeline{position:relative;border-left:2px solid var(--line);margin-left:52px}
.slot{position:relative;min-height:44px;border-bottom:1px dashed var(--line);cursor:pointer}
.slot .h{position:absolute;left:-56px;top:-9px;font-size:.74rem;color:var(--muted);width:46px;text-align:right}
.blk{position:absolute;left:8px;right:4px;border-radius:10px;padding:6px 10px;font-size:.85rem;font-weight:600;overflow:hidden;cursor:pointer;box-shadow:var(--shadow)}
.nowline{position:absolute;left:-6px;right:0;height:2px;background:var(--danger);z-index:2}
.nowline::before{content:"";position:absolute;left:-4px;top:-4px;width:10px;height:10px;border-radius:50%;background:var(--danger)}

/* Focus timer */
.timer{display:grid;place-items:center;gap:12px;text-align:center}
.dial{width:min(300px,72vw);aspect-ratio:1;position:relative}
.dial svg{width:100%;height:100%;transform:rotate(-90deg)}
.dial .read{position:absolute;inset:0;display:grid;place-items:center;align-content:center}
.dial .read b{font-family:var(--display);font-size:3rem;line-height:1}
.chips{display:flex;flex-wrap:wrap;gap:6px}

/* Habit grid */
.hgrid{display:grid;grid-template-columns:minmax(110px,1.4fr) repeat(7,minmax(30px,1fr)) 54px;gap:6px;align-items:center}
.hgrid .dot{aspect-ratio:1;border-radius:10px;border:1.5px solid var(--line);background:var(--surface);cursor:pointer;max-width:44px}
.hgrid .dot.on{background:var(--accent);border-color:var(--accent)}
.hgrid .hd{font-size:.72rem;color:var(--muted);text-align:center;font-weight:700}

.chart{width:100%;height:180px}
.jar{display:flex;flex-wrap:wrap;gap:8px}
.jar .note{background:var(--soft2);border-radius:12px;padding:10px 12px;font-size:.9rem;max-width:260px}
.jar .note:nth-child(3n+1){background:var(--soft1)}.jar .note:nth-child(3n+2){background:var(--soft3)}
.steps .item{padding:8px 10px}

/* Gate / onboarding */
.gate{min-height:100dvh;display:grid;place-items:center;padding:24px}
.gate .box{width:100%;max-width:460px}
.gate .logo{width:64px;height:64px}
.demo-banner{background:var(--ink);color:var(--bg);text-align:center;padding:8px 12px;font-size:.86rem;font-weight:600}
.demo-banner a{color:var(--bg)}
@media print{.side,.topbar,.bottomnav,.tabs,.btn,.iconbtn{display:none!important}.card{box-shadow:none;break-inside:avoid}body{background:#fff}}

#syncdot:empty{display:none}
.sched{display:flex;flex-direction:column;gap:6px;margin-top:12px}.sched div{display:flex;gap:10px;align-items:center;font-size:.9rem}.sched time{width:46px;color:var(--muted);font-size:.8rem;font-variant-numeric:tabular-nums}.sched i{width:8px;height:8px;border-radius:50%;background:var(--accent);flex:none}.sched .past{opacity:.45}.sched .cur{font-weight:700}
@media(max-width:600px){.hgrid{grid-template-columns:minmax(76px,1.3fr) repeat(7,minmax(0,1fr)) 40px;gap:4px}.hgrid .dot{border-radius:7px}.hgrid .t{font-size:.85rem}}
