/* Пастирський помічник — стилі на основі дизайн-системи «Lavender Beats» (м'який пластиліновий інтерфейс) */

@font-face{font-family:"Nunito";font-weight:400;font-display:swap;src:url(../fonts/nunito-cyrillic-400-normal.woff2) format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:"Nunito";font-weight:500;font-display:swap;src:url(../fonts/nunito-cyrillic-500-normal.woff2) format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:"Nunito";font-weight:600;font-display:swap;src:url(../fonts/nunito-cyrillic-600-normal.woff2) format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:"Nunito";font-weight:700;font-display:swap;src:url(../fonts/nunito-cyrillic-700-normal.woff2) format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:"Nunito";font-weight:800;font-display:swap;src:url(../fonts/nunito-cyrillic-800-normal.woff2) format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:"Nunito";font-weight:400;font-display:swap;src:url(../fonts/nunito-cyrillic-ext-400-normal.woff2) format("woff2");unicode-range:U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}
@font-face{font-family:"Nunito";font-weight:700;font-display:swap;src:url(../fonts/nunito-cyrillic-ext-700-normal.woff2) format("woff2");unicode-range:U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}
@font-face{font-family:"Nunito";font-weight:400;font-display:swap;src:url(../fonts/nunito-latin-400-normal.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"Nunito";font-weight:500;font-display:swap;src:url(../fonts/nunito-latin-500-normal.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"Nunito";font-weight:600;font-display:swap;src:url(../fonts/nunito-latin-600-normal.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"Nunito";font-weight:700;font-display:swap;src:url(../fonts/nunito-latin-700-normal.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"Nunito";font-weight:800;font-display:swap;src:url(../fonts/nunito-latin-800-normal.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}

/* Layout: lavender canvas → rounded shell; sidebar rail on desktop, bottom tab bar on phones */
:root{
  --canvas:#d0bfea;--surface:#f2e0df;--surface-raised:#fbefea;--line:#ecd9d3;
  --ink:#22132d;--ink-muted:#554858;
  --sidebar:#9684d8;--on-sidebar:#fcf6fc;
  --primary:#a284de;--on-primary:#ffffff;--primary-text:#6a4bb8;
  --hero-tint:#d4bbe5;--banner:#b490d8;--banner-button:#c090de;--on-banner:#ffffff;
  --rose:#de7896;--on-rose:#ffffff;--rose-soft:#f0baba;--badge:#f07890;--success:#276b2e;
  --tint-lavender:#ecd8e4;--tint-peach:#fcd8d0;--tint-butter:#fce6cf;--tint-sky:#d8deea;
  --icon-lavender:#9c7ed8;--icon-coral:#f67872;--icon-honey:#fcc66c;--icon-sky:#84a8de;
  --danger:#a3243f;
  --shadow-clay:0 8px 20px rgba(120,90,170,.18),inset 0 2px 0 rgba(255,255,255,.7);
  --shadow-button:0 6px 14px rgba(130,100,210,.35),inset 0 -3px 0 rgba(60,30,110,.12),inset 0 2px 0 rgba(255,255,255,.35);
  --scrim:rgba(34,19,45,.38);

  --sans:"Nunito","Varela Round",system-ui,"Segoe UI",sans-serif;
  --space-1:4px;--space-2:8px;--space-3:12px;--space-4:16px;--space-5:20px;--space-6:24px;--space-8:32px;
  --radius-sm:12px;--radius-md:18px;--radius-lg:24px;--radius-xl:36px;--radius-pill:999px;
  --tabbar-h:68px;
  color-scheme:light;
}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){
  --canvas:#15101d;--surface:#1e1828;--surface-raised:#2a2236;--line:#3b3148;
  --ink:#f4ecf6;--ink-muted:#bfb2c6;--sidebar:#2b2342;--on-sidebar:#f4ecf6;
  --primary:#b79cf0;--on-primary:#1c0d2b;--primary-text:#c7b0f7;
  --hero-tint:#3a2d52;--banner:#5b4285;--banner-button:#7a5aa8;--on-banner:#f4ecf6;
  --rose:#e98aa6;--on-rose:#1c0d2b;--rose-soft:#4a2c36;--badge:#f07890;--success:#8fd18f;
  --tint-lavender:#3a2e4a;--tint-peach:#4a2f30;--tint-butter:#48392a;--tint-sky:#2c3448;
  --icon-lavender:#b79cf0;--icon-coral:#f8908a;--icon-honey:#fcc66c;--icon-sky:#94b6e8;
  --danger:#ff9fb0;
  --shadow-clay:0 8px 20px rgba(0,0,0,.4),inset 0 1px 0 rgba(255,255,255,.06);
  --shadow-button:0 6px 14px rgba(0,0,0,.45),inset 0 -3px 0 rgba(0,0,0,.2),inset 0 2px 0 rgba(255,255,255,.15);
  --scrim:rgba(0,0,0,.55);color-scheme:dark}}
:root[data-theme="dark"]{
  --canvas:#15101d;--surface:#1e1828;--surface-raised:#2a2236;--line:#3b3148;
  --ink:#f4ecf6;--ink-muted:#bfb2c6;--sidebar:#2b2342;--on-sidebar:#f4ecf6;
  --primary:#b79cf0;--on-primary:#1c0d2b;--primary-text:#c7b0f7;
  --hero-tint:#3a2d52;--banner:#5b4285;--banner-button:#7a5aa8;--on-banner:#f4ecf6;
  --rose:#e98aa6;--on-rose:#1c0d2b;--rose-soft:#4a2c36;--badge:#f07890;--success:#8fd18f;
  --tint-lavender:#3a2e4a;--tint-peach:#4a2f30;--tint-butter:#48392a;--tint-sky:#2c3448;
  --icon-lavender:#b79cf0;--icon-coral:#f8908a;--icon-honey:#fcc66c;--icon-sky:#94b6e8;
  --danger:#ff9fb0;
  --shadow-clay:0 8px 20px rgba(0,0,0,.4),inset 0 1px 0 rgba(255,255,255,.06);
  --shadow-button:0 6px 14px rgba(0,0,0,.45),inset 0 -3px 0 rgba(0,0,0,.2),inset 0 2px 0 rgba(255,255,255,.15);
  --scrim:rgba(0,0,0,.55);color-scheme:dark}

*,*::before,*::after{box-sizing:border-box}
html,body{height:100%}
body{margin:0;background:var(--canvas);color:var(--ink);font-family:var(--sans);font-size:16px;line-height:22px;font-weight:500;-webkit-font-smoothing:antialiased}
[hidden]{display:none!important}
img{max-width:100%}
button,input,select,textarea{font:inherit;color:inherit}
:focus-visible{outline:2px solid var(--primary-text);outline-offset:2px}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.ico{width:1.25em;height:1.25em;fill:currentColor;flex:none;vertical-align:-.25em}

/* ---------- Shell ---------- */
.app{display:flex;gap:var(--space-6);min-height:100%;padding:var(--space-8);}
.shell{flex:1;min-width:0;background:var(--surface);border-radius:var(--radius-xl);padding:var(--space-8);box-shadow:var(--shadow-clay);display:flex;flex-direction:column;gap:var(--space-6)}
.sidebar{width:248px;flex:none;background:var(--sidebar);color:var(--on-sidebar);border-radius:var(--radius-xl);padding:var(--space-8) var(--space-4);display:flex;flex-direction:column;gap:var(--space-2);position:sticky;top:var(--space-8);height:calc(100vh - 2*var(--space-8));box-shadow:var(--shadow-clay)}
.brand{font-size:22px;line-height:28px;font-weight:800;padding:0 var(--space-3) var(--space-6);display:flex;gap:var(--space-3);align-items:center}
.brand .mark{width:40px;height:40px;border-radius:var(--radius-sm);background:var(--on-sidebar);color:var(--sidebar);display:grid;place-items:center;box-shadow:var(--shadow-button)}
.brand .mark img{width:100%;height:100%;border-radius:var(--radius-sm);object-fit:cover}
.nav-item{display:flex;align-items:center;gap:var(--space-3);min-height:52px;padding:0 var(--space-4);border-radius:var(--radius-md);color:var(--on-sidebar);text-decoration:none;font-size:18px;line-height:24px;font-weight:700;border:0;background:none;cursor:pointer;width:100%;text-align:left;position:relative}
.nav-item:hover{background:rgba(255,255,255,.12)}
.nav-item[aria-current="page"]{background:var(--surface-raised);color:var(--primary-text);box-shadow:var(--shadow-clay)}
.nav-spacer{flex:1}
.nav-count{margin-left:auto;background:var(--badge);color:#fff;font-size:12px;line-height:16px;font-weight:800;border-radius:var(--radius-pill);padding:2px 8px;min-width:22px;text-align:center}

.topbar{display:flex;align-items:center;gap:var(--space-4);flex-wrap:wrap}
.page-title{font-size:32px;line-height:38px;font-weight:800;margin:0;flex:1;min-width:0;text-wrap:balance}
.topbar-actions{display:flex;gap:var(--space-3);align-items:center;flex-wrap:wrap}
.view{display:flex;flex-direction:column;gap:var(--space-5);min-width:0}

.tabbar{display:none}
.mobile-only{display:none!important}
@media (max-width:820px){.mobile-only{display:inline-grid!important}}

/* ---------- Primitives ---------- */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:var(--space-2);min-height:48px;padding:0 var(--space-5);border-radius:var(--radius-pill);border:0;cursor:pointer;font-size:18px;line-height:24px;font-weight:800;background:var(--primary);color:var(--on-primary);box-shadow:var(--shadow-button);white-space:nowrap;text-decoration:none}
.btn:hover{filter:brightness(1.04)}
.btn:active{transform:translateY(1px)}
.btn:disabled{opacity:.55;cursor:not-allowed}
.btn.soft{background:var(--surface-raised);color:var(--primary-text);box-shadow:var(--shadow-clay);font-size:16px;font-weight:700}
.btn.ghost{background:transparent;color:var(--primary-text);box-shadow:none;font-size:16px;font-weight:700}
.btn.danger{background:var(--surface-raised);color:var(--danger);box-shadow:var(--shadow-clay);font-size:16px;font-weight:700}
.btn.rose{background:var(--rose);color:var(--on-rose)}
.btn.small{min-height:40px;padding:0 var(--space-4);font-size:15px}
.icon-btn{width:48px;height:48px;border-radius:var(--radius-pill);border:0;cursor:pointer;display:inline-grid;place-items:center;background:var(--surface-raised);color:var(--primary-text);box-shadow:var(--shadow-clay);flex:none}
.icon-btn .ico{width:22px;height:22px}
.icon-btn.plain{background:transparent;box-shadow:none;width:44px;height:44px}

.panel{background:var(--surface-raised);border-radius:var(--radius-lg);padding:var(--space-6);box-shadow:var(--shadow-clay);display:flex;flex-direction:column;gap:var(--space-4);min-width:0}
.panel-head{display:flex;align-items:center;gap:var(--space-3);flex-wrap:wrap}
.panel-head h2,.card-title{font-size:17px;line-height:24px;font-weight:700;margin:0}
.panel-head h2{flex:1;min-width:0}
.muted{color:var(--ink-muted)}
.meta{font-size:14px;line-height:20px;font-weight:500;color:var(--ink-muted)}
.caption{font-size:12px;line-height:16px;font-weight:600}

.chip{display:inline-flex;align-items:center;gap:6px;min-height:32px;padding:6px var(--space-3);max-width:100%;border-radius:var(--radius-pill);background:var(--surface);color:var(--ink-muted);font-size:13px;line-height:16px;font-weight:700;border:0;overflow-wrap:anywhere}
.chip.warn{background:var(--tint-peach);color:var(--ink)}
.chip.ok{background:var(--tint-sky);color:var(--ink)}
.chip.lav{background:var(--tint-lavender);color:var(--ink)}
.chip.butter{background:var(--tint-butter);color:var(--ink)}
.chip.prio1{background:var(--tint-peach);color:var(--ink)}
.chip.prio2{background:var(--tint-butter);color:var(--ink)}
.chip.prio3{background:var(--tint-sky);color:var(--ink)}
.chip .ico{width:14px;height:14px}

.seg{display:inline-flex;background:var(--surface);border-radius:var(--radius-pill);padding:4px;gap:4px;box-shadow:inset 0 1px 3px rgba(60,30,110,.08)}
.seg button{border:0;background:transparent;border-radius:var(--radius-pill);min-height:40px;padding:0 var(--space-4);font-weight:700;color:var(--ink-muted);cursor:pointer;font-size:15px}
.seg button[aria-pressed="true"]{background:var(--surface-raised);color:var(--primary-text);box-shadow:var(--shadow-clay)}

.search{display:flex;align-items:center;gap:var(--space-2);background:var(--surface-raised);border-radius:var(--radius-pill);padding:0 var(--space-4);min-height:48px;box-shadow:var(--shadow-clay);flex:1;min-width:200px}
.search input{border:0;background:transparent;outline:none;flex:1;min-width:0;min-height:46px}
.search .ico{color:var(--ink-muted)}

/* ---------- Today ---------- */
.hero{background:var(--hero-tint);border-radius:var(--radius-lg);padding:var(--space-6);display:flex;gap:var(--space-5);align-items:center;box-shadow:var(--shadow-clay);position:relative;overflow:hidden;min-height:150px}
.hero-text{flex:1;min-width:0;display:flex;flex-direction:column;gap:var(--space-2);position:relative;z-index:1}
.greeting{font-size:26px;line-height:32px;font-weight:800;margin:0;text-wrap:balance}
.hero-art{width:170px;height:150px;flex:none;position:relative}
.hero-art img{position:absolute;inset:-10px -10px -24px -10px;width:calc(100% + 20px);height:calc(100% + 34px);object-fit:contain}
.clay-blob{position:absolute;border-radius:50%;box-shadow:var(--shadow-button)}
.hero-verse{font-size:15px;line-height:22px;color:var(--ink-muted);max-width:52ch}
.hero-actions{display:flex;gap:var(--space-3);flex-wrap:wrap;margin-top:var(--space-2)}

.stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:var(--space-5)}
.stat{border-radius:var(--radius-md);padding:var(--space-5);display:flex;flex-direction:column;gap:var(--space-2);box-shadow:var(--shadow-clay);border:0;text-align:left;cursor:pointer;color:var(--ink)}
.stat .tile{width:44px;height:44px;border-radius:var(--radius-sm);display:grid;place-items:center;color:#fff;box-shadow:var(--shadow-button)}
.stat .tile .ico{width:24px;height:24px}
.stat .num{font-size:32px;line-height:36px;font-weight:800;font-variant-numeric:tabular-nums}
.stat .lbl{font-size:14px;line-height:20px;color:var(--ink-muted);font-weight:600}
.stat.lav{background:var(--tint-lavender)}.stat.lav .tile{background:var(--icon-lavender)}
.stat.peach{background:var(--tint-peach)}.stat.peach .tile{background:var(--icon-coral)}
.stat.butter{background:var(--tint-butter)}.stat.butter .tile{background:var(--icon-honey)}
.stat.sky{background:var(--tint-sky)}.stat.sky .tile{background:var(--icon-sky)}

.grid-2{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(0,1fr);gap:var(--space-5);align-items:start}
.stack{display:flex;flex-direction:column;gap:var(--space-5);min-width:0}

/* ---------- Rows / lists ---------- */
.list{display:flex;flex-direction:column}
.row{display:flex;gap:var(--space-3);align-items:center;padding:var(--space-3) 0;border-top:1px solid var(--line);min-width:0}
.row:first-child{border-top:0}
.row-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.row-title{font-weight:700;font-size:16px;line-height:22px;overflow-wrap:anywhere}
.row-sub{font-size:14px;line-height:20px;color:var(--ink-muted);overflow-wrap:anywhere}
.row-actions{display:flex;gap:var(--space-2);align-items:center;flex:none}
.row.clickable{cursor:pointer;border-radius:var(--radius-sm)}
.row.clickable:hover .row-title{color:var(--primary-text)}
.row.is-done .row-title{text-decoration:line-through;color:var(--ink-muted)}
.row.is-cancelled .row-title{text-decoration:line-through;color:var(--ink-muted)}
.row.conflict{background:linear-gradient(var(--tint-peach),var(--tint-peach)) left/4px 100% no-repeat;padding-left:var(--space-3)}
.time-col{width:64px;flex:none;font-weight:800;font-variant-numeric:tabular-nums;font-size:15px}
.time-col small{display:block;font-weight:600;color:var(--ink-muted);font-size:12px}
.avatar{width:44px;height:44px;border-radius:var(--radius-pill);background:var(--tint-lavender);color:var(--primary-text);display:grid;place-items:center;font-weight:800;flex:none;box-shadow:var(--shadow-clay)}
.avatar.lg{width:72px;height:72px;font-size:26px}
.kind-tile{width:40px;height:40px;border-radius:var(--radius-sm);display:grid;place-items:center;color:#fff;flex:none;box-shadow:var(--shadow-button)}
.kind-tile .ico{width:20px;height:20px}
.kt-meeting{background:var(--icon-lavender)}.kt-visit{background:var(--icon-coral)}.kt-call{background:var(--icon-sky)}.kt-service{background:var(--icon-honey)}.kt-other{background:var(--icon-lavender)}.kt-task{background:var(--icon-sky)}

.check{width:32px;height:32px;border-radius:var(--radius-pill);border:2px solid var(--primary);background:transparent;display:grid;place-items:center;cursor:pointer;color:var(--on-primary);flex:none;padding:0}
.check .ico{width:18px;height:18px;opacity:0}
.check[aria-checked="true"]{background:var(--primary)}
.check[aria-checked="true"] .ico{opacity:1}
.check-hit{width:44px;height:44px;display:grid;place-items:center;flex:none;border:0;background:none;padding:0;cursor:pointer}

.empty{display:flex;flex-direction:column;align-items:center;text-align:center;gap:var(--space-3);padding:var(--space-6) var(--space-4)}
.empty img{width:150px;height:150px;object-fit:contain}
.empty .empty-tile{width:72px;height:72px;border-radius:var(--radius-md);display:grid;place-items:center;color:#fff;background:var(--icon-lavender);box-shadow:var(--shadow-button)}
.empty .empty-tile .ico{width:36px;height:36px}
.empty h3{margin:0;font-size:17px;line-height:24px}
.empty p{margin:0;color:var(--ink-muted);max-width:44ch}

.banner{background:var(--banner);color:var(--on-banner);border-radius:var(--radius-lg);padding:var(--space-5) var(--space-6);display:flex;gap:var(--space-4);align-items:center;flex-wrap:wrap;box-shadow:var(--shadow-clay)}
.banner h3{margin:0;font-size:20px;line-height:26px;font-weight:800}
.banner p{margin:0;font-size:16px;font-weight:700}
.banner .btn{background:var(--banner-button);color:var(--on-banner)}
.notice{background:var(--tint-butter);color:var(--ink);border-radius:var(--radius-md);padding:var(--space-4);display:flex;gap:var(--space-3);align-items:flex-start;font-size:15px;line-height:21px}
.notice.info{background:var(--tint-sky)}
.notice.warn{background:var(--tint-peach)}
.notice .ico{margin-top:2px;width:20px;height:20px}
.notice > div{min-width:0}

/* ---------- Calendar ---------- */
.cal-toolbar{display:flex;align-items:center;gap:var(--space-3);flex-wrap:wrap}
.cal-range{font-size:20px;line-height:26px;font-weight:800;margin:0}
.month-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:6px}
.month-grid .dow{font-size:12px;font-weight:700;color:var(--ink-muted);text-align:center;padding-bottom:4px;text-transform:uppercase;letter-spacing:.04em}
.day-cell{min-height:92px;background:var(--surface);border-radius:var(--radius-sm);padding:6px;border:0;text-align:left;cursor:pointer;display:flex;flex-direction:column;gap:3px;min-width:0;color:var(--ink)}
.day-cell.other{opacity:.5}
.day-cell.today{box-shadow:inset 0 0 0 2px var(--primary-text)}
.day-cell .dn{font-weight:800;font-size:14px;font-variant-numeric:tabular-nums}
.day-cell .ev{font-size:12px;line-height:15px;font-weight:700;background:var(--tint-lavender);border-radius:6px;padding:2px 5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.day-cell .ev.task{background:var(--tint-sky)}
.day-cell .ev.conf{background:var(--tint-peach)}
.day-cell .more{font-size:12px;color:var(--ink-muted);font-weight:700}
.week-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:var(--space-3)}
.week-col{background:var(--surface);border-radius:var(--radius-md);padding:var(--space-3);display:flex;flex-direction:column;gap:var(--space-2);min-width:0;min-height:160px}
.week-col.today{box-shadow:inset 0 0 0 2px var(--primary-text)}
.week-col h3{margin:0;font-size:14px;line-height:18px;font-weight:800;border:0;background:none;padding:0;text-align:left;cursor:pointer;color:var(--ink)}
.wk-item{background:var(--surface-raised);border-radius:10px;padding:6px 8px;font-size:13px;line-height:17px;font-weight:700;border:0;text-align:left;cursor:pointer;color:var(--ink);box-shadow:var(--shadow-clay);overflow-wrap:anywhere}
.wk-item small{display:block;color:var(--ink-muted);font-weight:600}
.wk-item.task{background:var(--tint-sky)}
.wk-item.conf{background:var(--tint-peach)}
.wk-item.cancelled{opacity:.6;text-decoration:line-through}

/* ---------- People ---------- */
.profile-head{display:flex;gap:var(--space-4);align-items:center;flex-wrap:wrap}
.profile-head .who{flex:1;min-width:0}
.profile-head h2{margin:0;font-size:26px;line-height:32px;font-weight:800;overflow-wrap:anywhere}
.kv{display:grid;grid-template-columns:auto minmax(0,1fr);gap:6px var(--space-4);font-size:15px}
.kv dt{color:var(--ink-muted);font-weight:600}
.kv dd{margin:0;overflow-wrap:anywhere}
.private-note{white-space:pre-wrap;background:var(--surface);border-radius:var(--radius-sm);padding:var(--space-3);font-size:15px;overflow-wrap:anywhere}
.filters{display:flex;gap:var(--space-2);flex-wrap:wrap;min-width:0}

/* ---------- Stats ---------- */
.stackbar{display:flex;height:28px;border-radius:var(--radius-pill);overflow:hidden;gap:3px;background:var(--surface)}
.stackbar span{min-width:6px}
.legend{display:flex;flex-wrap:wrap;gap:var(--space-2) var(--space-5);font-size:14px;line-height:20px}
.legend span{display:inline-flex;align-items:center;gap:8px}
.legend i{width:12px;height:12px;border-radius:4px;display:block;flex:none}
.histo{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:var(--space-2);height:190px;align-items:end;padding-top:var(--space-2);border-bottom:1px solid var(--line)}
.hcol{display:flex;flex-direction:column;align-items:center;justify-content:flex-end;height:100%;gap:4px;min-width:0}
.hbar{width:100%;max-width:44px;border-radius:8px 8px 3px 3px;min-height:3px;box-shadow:var(--shadow-button)}
.hval{font-size:13px;font-weight:800;font-variant-numeric:tabular-nums}
.hlbl{font-size:12px;line-height:16px;font-weight:600;color:var(--ink-muted);white-space:nowrap;margin-bottom:-22px;transform:translateY(0)}
.histo{margin-bottom:22px}
.bounds{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto;gap:var(--space-3);align-items:end}
details > summary::-webkit-details-marker{display:none}
a.stat{color:var(--ink)}
@media (max-width:820px){.bounds{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}.bounds .btn{grid-column:1/-1}.hlbl{font-size:10px}}

/* ---------- Journal ---------- */
.journal-card{background:var(--surface-raised);border-radius:var(--radius-md);padding:var(--space-5);box-shadow:var(--shadow-clay);display:flex;flex-direction:column;gap:var(--space-2);border:0;text-align:left;cursor:pointer;color:var(--ink);width:100%}
.journal-card h3{margin:0;font-size:17px;line-height:24px}
.journal-card p{margin:0;color:var(--ink-muted);display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere}
.journal-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:var(--space-4)}
mark{background:var(--tint-butter);color:var(--ink);border-radius:3px;padding:0 1px}

/* ---------- Sheet / forms ---------- */
.sheet-wrap{position:fixed;inset:0;background:var(--scrim);display:flex;align-items:center;justify-content:center;padding:var(--space-4);z-index:50}
.sheet{background:var(--surface);border-radius:var(--radius-lg);width:min(640px,100%);max-height:calc(100% - 16px);display:flex;flex-direction:column;box-shadow:0 20px 50px rgba(34,19,45,.35)}
.sheet-head{display:flex;align-items:center;gap:var(--space-3);padding:var(--space-5) var(--space-6) var(--space-3)}
.sheet-head h2{margin:0;font-size:22px;line-height:28px;font-weight:800;flex:1;min-width:0}
.sheet-body{padding:var(--space-2) var(--space-6) var(--space-4);overflow:auto;display:flex;flex-direction:column;gap:var(--space-4)}
.sheet-foot{display:flex;gap:var(--space-3);padding:var(--space-4) var(--space-6) var(--space-5);flex-wrap:wrap;justify-content:flex-end;border-top:1px solid var(--line)}
.sheet-foot .left{margin-right:auto}
.sheet-body form{display:flex;flex-direction:column;gap:var(--space-4)}
.field{display:flex;flex-direction:column;gap:6px;min-width:0}
.x-ico{width:22px;height:22px;stroke:currentColor;stroke-width:2.5;stroke-linecap:round;fill:none}
.field label,.field .label{font-weight:700;font-size:15px}
.field .hint{font-size:13px;color:var(--ink-muted);line-height:18px}
.field .err{font-size:14px;color:var(--danger);font-weight:700}
.input,select.input,textarea.input{width:100%;min-height:48px;border-radius:var(--radius-md);border:2px solid transparent;background:var(--surface-raised);padding:10px 14px;box-shadow:var(--shadow-clay);outline:none}
textarea.input{min-height:120px;resize:vertical;line-height:22px}
.input:focus{border-color:var(--primary-text)}
.input[aria-invalid="true"]{border-color:var(--danger)}
.field-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:var(--space-4)}
.radio-pills{display:flex;flex-wrap:wrap;gap:var(--space-2)}
.radio-pills label{display:inline-flex;align-items:center;min-height:40px;padding:0 var(--space-4);border-radius:var(--radius-pill);background:var(--surface-raised);box-shadow:var(--shadow-clay);cursor:pointer;font-weight:700;font-size:15px}
.radio-pills input{position:absolute;opacity:0;pointer-events:none}
.radio-pills input:checked + span{color:var(--primary-text)}
.radio-pills label:has(input:checked){box-shadow:inset 0 0 0 2px var(--primary-text),var(--shadow-clay)}
.radio-pills label:has(input:focus-visible){outline:2px solid var(--primary-text);outline-offset:2px}

/* Dictation */
.dictation{background:var(--hero-tint);border-radius:var(--radius-md);padding:var(--space-4);display:flex;flex-direction:column;gap:var(--space-3)}
.dict-controls{display:flex;gap:var(--space-3);align-items:center;flex-wrap:wrap}
.rec-dot{width:12px;height:12px;border-radius:50%;background:var(--badge);animation:pulse 1.2s infinite}
@keyframes pulse{50%{opacity:.3}}
@media (prefers-reduced-motion:reduce){.rec-dot{animation:none}}
.interim{color:var(--ink-muted);font-style:italic}

/* Toast */
.toasts{position:fixed;left:50%;bottom:calc(var(--space-6) + env(safe-area-inset-bottom,0px));transform:translateX(-50%);display:flex;flex-direction:column;gap:var(--space-2);z-index:80;width:min(520px,calc(100% - 32px))}
.toast{background:var(--ink);color:var(--surface);border-radius:var(--radius-md);padding:var(--space-3) var(--space-4);display:flex;gap:var(--space-3);align-items:center;box-shadow:0 10px 30px rgba(0,0,0,.25);font-weight:700}
.toast span{flex:1;min-width:0}
.toast button{background:transparent;border:0;color:var(--surface);font-weight:800;text-decoration:underline;cursor:pointer;min-height:36px;padding:0 6px}
.toast.error{background:var(--danger);color:#fff}
.toast.error button{color:#fff}

/* Lock */
.lock{position:fixed;inset:0;background:var(--canvas);display:grid;place-items:center;z-index:100;padding:var(--space-4)}
.lock .panel{width:min(380px,100%);align-items:stretch;text-align:center}

/* ---------- Responsive ---------- */
@media (max-width:1100px){
  .stats{grid-template-columns:repeat(2,minmax(0,1fr))}
  .grid-2{grid-template-columns:minmax(0,1fr)}
  .sidebar{width:220px}
}
@media (max-width:820px){
  .app{padding:0;display:block}
  .sidebar{display:none}
  .shell{border-radius:0;padding:var(--space-5) var(--space-4) calc(var(--tabbar-h) + var(--space-8) + env(safe-area-inset-bottom,0px));min-height:100%;box-shadow:none;gap:var(--space-5)}
  .page-title{font-size:26px;line-height:32px}
  .tabbar{display:flex;position:fixed;left:0;right:0;bottom:0;z-index:40;background:var(--surface-raised);box-shadow:0 -6px 20px rgba(120,90,170,.18);padding:6px 6px calc(6px + env(safe-area-inset-bottom,0px));justify-content:space-around}
  .tab{text-decoration:none;flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-height:56px;border:0;background:none;color:var(--ink-muted);font-size:12px;line-height:16px;font-weight:700;border-radius:var(--radius-md);cursor:pointer;position:relative;padding:0 2px}
  .tab .ico{width:24px;height:24px}
  .tab[aria-current="page"]{color:var(--primary-text);background:var(--tint-lavender)}
  .tab .dot{position:absolute;top:6px;right:calc(50% - 20px);width:9px;height:9px;border-radius:50%;background:var(--badge)}
  .hero{flex-direction:column-reverse;align-items:stretch;text-align:left}
  .hero-art{width:120px;height:110px;align-self:flex-end;margin:-8px -4px -16px 0}
  .panel{padding:var(--space-5)}
  .stats{gap:var(--space-3)}
  .stat{padding:var(--space-4)}
  .stat .num{font-size:28px;line-height:32px}
  .week-grid{grid-template-columns:minmax(0,1fr)}
  .week-col{min-height:0}
  .day-cell{min-height:58px;padding:4px}
  .day-cell .ev,.day-cell .more{display:none}
  .day-cell .dots{display:flex;gap:3px;flex-wrap:wrap}
  .sheet-wrap{align-items:flex-end;padding:0}
  .sheet{border-radius:var(--radius-lg) var(--radius-lg) 0 0;max-height:94%;padding-bottom:env(safe-area-inset-bottom,0px)}
  .sheet-head,.sheet-body,.sheet-foot{padding-left:var(--space-4);padding-right:var(--space-4)}
  .toasts{bottom:calc(var(--tabbar-h) + var(--space-4) + env(safe-area-inset-bottom,0px))}
  .btn{font-size:16px}
  .topbar .btn .lbl-wide,.row-actions .lbl-wide{display:none}
  .row-actions .btn.small{width:44px;padding:0}
}
.dots{display:none}
.dots i{width:7px;height:7px;border-radius:50%;background:var(--icon-lavender);display:block}
.dots i.task{background:var(--icon-sky)}
.dots i.conf{background:var(--icon-coral)}
@media (max-width:420px){
  .time-col{width:52px}
  .row-actions .btn.small{padding:0 10px}
}
