/* שקיפות — עיצוב
   Layout: a colored hero band, a sticky row of color-coded tabs, one panel per tab.
   Each tab owns a hue (field green, clay, sky, sun, plum) that carries into its panel. */
:root{
  --bg:#F2F6F3; --surface:#FFFFFF; --ink:#14261B; --muted:#55695C; --line:#D6E1D8;
  --field:#1E7A49; --field-soft:#DDF0E3;
  --sky:#2275B0;   --sky-soft:#DCEBF6;
  --sun:#C98A0C;   --sun-soft:#FBEFCF;
  --clay:#C9532F;  --clay-soft:#F9E1D8;
  --plum:#7A4FAE;  --plum-soft:#ECE3F6;
  --teal:#0F7E78;  --teal-soft:#D6EFEC;
  --neg:#B8322A;   --neg-soft:#F8DEDA;
  --hero1:#1E7A49; --hero2:#0F7E78; --on-hero:#FFFFFF; --on-hero-dim:rgba(255,255,255,.82);
  --accent:var(--field); --accent-soft:var(--field-soft);
  --wheat:var(--sun); --wheat-soft:var(--sun-soft);
  --c1:var(--field); --c2:var(--sky); --c3:var(--sun); --c4:var(--teal); --c5:var(--plum);
  --f-display:"Secular One","Assistant",system-ui,sans-serif;
  --f-body:"Assistant",system-ui,-apple-system,"Segoe UI",Arial,sans-serif;
  --r:14px;
  color-scheme:light;
}
@media (prefers-color-scheme: dark){:root:not([data-theme="light"]){
  --bg:#0E1511; --surface:#162019; --ink:#E4ECE6; --muted:#9DAEA3; --line:#26332B;
  --field:#5CC58D; --field-soft:#183224; --sky:#6CB2E6; --sky-soft:#152A3A;
  --sun:#EDBB4B; --sun-soft:#352A12; --clay:#F08A66; --clay-soft:#3A2119;
  --plum:#B994E6; --plum-soft:#2B2140; --teal:#4FC9C0; --teal-soft:#123230;
  --neg:#F07A6C; --neg-soft:#3B1D19;
  --hero1:#14583A; --hero2:#0C5A56; color-scheme:dark}}
:root[data-theme="dark"]{
  --bg:#0E1511; --surface:#162019; --ink:#E4ECE6; --muted:#9DAEA3; --line:#26332B;
  --field:#5CC58D; --field-soft:#183224; --sky:#6CB2E6; --sky-soft:#152A3A;
  --sun:#EDBB4B; --sun-soft:#352A12; --clay:#F08A66; --clay-soft:#3A2119;
  --plum:#B994E6; --plum-soft:#2B2140; --teal:#4FC9C0; --teal-soft:#123230;
  --neg:#F07A6C; --neg-soft:#3B1D19;
  --hero1:#14583A; --hero2:#0C5A56; color-scheme:dark}

*{box-sizing:border-box}
html{padding-top:env(safe-area-inset-top,0px);padding-bottom:env(safe-area-inset-bottom,0px)}
body{margin:0;background:var(--bg);color:var(--ink);font-family:var(--f-body);font-size:16px;line-height:1.55}
body::before{content:"";position:fixed;inset:0 0 auto;height:env(safe-area-inset-top,0px);z-index:10;background:var(--bg)}
img{max-width:100%}
[hidden]{display:none!important}
.wrap{direction:rtl;max-width:1000px;margin:0 auto;padding-left:max(16px,env(safe-area-inset-left,0px));padding-right:max(16px,env(safe-area-inset-right,0px));padding-block:18px 48px}
.num{direction:ltr;unicode-bidi:isolate;font-variant-numeric:tabular-nums}
h1,h2,h3{text-wrap:balance;margin:0}
h1{font-family:var(--f-display);font-weight:400;font-size:clamp(2.8rem,8vw,4.2rem);line-height:1;letter-spacing:-.01em}
h2{font-family:var(--f-display);font-weight:400;font-size:1.45rem}
h3{font-size:1.05rem;font-weight:700}
p{margin:0}
.muted{color:var(--muted)}
.small{font-size:.88rem}

/* ---------- hero band ---------- */
header.top{position:relative;overflow:hidden;display:flex;flex-wrap:wrap;gap:16px 28px;align-items:flex-end;justify-content:space-between;
  padding:28px 24px 24px;border-radius:20px;color:var(--on-hero);
  background:linear-gradient(135deg,var(--hero1),var(--hero2))}
/* a drop and the rings spreading from it: transparency as clear water. Rings fade out with distance; one ring keeps travelling outward */
header.top::before,header.top::after{content:"";position:absolute;pointer-events:none;inset:0}
/* ellipses (water seen at an angle) that thin out and fade with distance, around a soft glint where the drop landed */
header.top::before{
  background:
    /* the drop, two small ones falling behind it, and the splash where it lands */
    radial-gradient(circle at 12% 12%, #fff 0 3.5px, rgba(220,244,255,.5) 4px 7px, transparent 8px),
    radial-gradient(circle at 12% 27%, rgba(255,255,255,.9) 0 2.5px, transparent 3.5px),
    radial-gradient(circle at 12% 42%, rgba(255,255,255,.75) 0 1.8px, transparent 2.8px),
    linear-gradient(to bottom, transparent 10%, rgba(255,255,255,.28) 22%, rgba(255,255,255,.12) 56%, transparent 62%) 12% 0 / 1px 100% no-repeat,
    radial-gradient(ellipse 12px 6px at 12% 62%, #fff, rgba(210,240,255,.6) 55%, transparent),
    /* dense rings in pale water-blue, spaced wider and thinner with distance */
    radial-gradient(ellipse 30px 12px at 12% 62%, transparent 82%, rgba(220,244,255,.55) 91%, transparent),
    radial-gradient(ellipse 52px 21px at 12% 62%, transparent 84%, rgba(220,244,255,.46) 92%, transparent),
    radial-gradient(ellipse 78px 31px at 12% 62%, transparent 86%, rgba(220,244,255,.38) 93%, transparent),
    radial-gradient(ellipse 108px 43px at 12% 62%, transparent 88%, rgba(220,244,255,.3) 94%, transparent),
    radial-gradient(ellipse 144px 57px at 12% 62%, transparent 90%, rgba(220,244,255,.23) 95%, transparent),
    radial-gradient(ellipse 188px 74px at 12% 62%, transparent 91%, rgba(220,244,255,.16) 96%, transparent),
    radial-gradient(ellipse 240px 94px at 12% 62%, transparent 93%, rgba(220,244,255,.1) 97%, transparent),
    /* a pool of light under the splash */
    radial-gradient(ellipse 260px 100px at 12% 62%, rgba(120,214,255,.28), transparent 70%)}
header.top::after{
  inset:auto;width:70px;height:28px;left:calc(12% - 35px);top:calc(62% - 14px);border-radius:50%;
  border:1.5px solid rgba(255,255,255,.5);box-shadow:0 0 0 9px rgba(255,255,255,.06),0 0 0 10px rgba(255,255,255,.18);
  animation:ripple 7s cubic-bezier(.2,.5,.3,1) infinite}
@keyframes ripple{from{transform:scale(.15);opacity:.9}70%{opacity:.25}to{transform:scale(6);opacity:0}}
@media (prefers-reduced-motion:reduce){header.top::after{animation:none;opacity:0}}
.brand{display:flex;flex-direction:column;gap:8px;position:relative}
.brand .place{font-weight:700;font-size:1.1rem;color:var(--on-hero)}
.brand .sitelink{color:var(--on-hero);font-weight:700;text-decoration:underline;width:fit-content}
.stamp{position:relative;display:flex;flex-direction:column;gap:2px;font-size:.9rem;color:var(--on-hero-dim)}
.stamp b{color:var(--on-hero)}
.sample{display:inline-flex;align-items:center;gap:6px;background:#FFD666;color:#4A3300;border-radius:999px;padding:2px 12px;font-weight:800;font-size:.8rem;width:fit-content}

/* ---------- tabs: each tab owns a hue ---------- */
nav.tabs{position:sticky;top:env(safe-area-inset-top,0px);z-index:5;background:var(--bg);display:flex;gap:6px;overflow-x:auto;scrollbar-width:none;padding-block:14px 12px;margin-bottom:6px}
nav.tabs::-webkit-scrollbar{display:none}
nav.tabs button{flex:none;display:inline-flex;align-items:center;gap:8px;font:inherit;font-weight:700;font-size:.95rem;color:var(--ink);background:var(--surface);border:1px solid var(--line);border-radius:999px;padding:7px 14px;cursor:pointer}
nav.tabs button::before{content:"";width:9px;height:9px;border-radius:50%;background:var(--t)}
nav.tabs button:hover{background:var(--ts);border-color:transparent}
nav.tabs button[aria-selected="true"]{background:var(--t);border-color:var(--t);color:var(--on-t)}
nav.tabs button[aria-selected="true"]::before{background:var(--on-t)}
[data-tab="overview"]{--t:var(--teal);--ts:var(--teal-soft)}
[data-tab="income"]{--t:var(--field);--ts:var(--field-soft)}
[data-tab="expenses"]{--t:var(--clay);--ts:var(--clay-soft)}
[data-tab="plans"]{--t:var(--sky);--ts:var(--sky-soft)}
[data-tab="calendar"]{--t:var(--sun);--ts:var(--sun-soft)}
[data-tab="how"]{--t:var(--plum);--ts:var(--plum-soft)}
[data-tab="sources"]{--t:var(--teal);--ts:var(--teal-soft)}
:root{--on-t:#FFFFFF}
@media (prefers-color-scheme: dark){:root:not([data-theme="light"]){--on-t:#0E1511}}
:root[data-theme="dark"]{--on-t:#0E1511}
button:focus-visible,a:focus-visible{outline:2px solid var(--sky);outline-offset:2px}

/* ---------- panels ---------- */
section.panel{--p:var(--teal);--ps:var(--teal-soft);display:flex;flex-direction:column;gap:20px;padding-top:6px}
#p-income{--p:var(--field);--ps:var(--field-soft)}
#p-expenses{--p:var(--clay);--ps:var(--clay-soft)}
#p-plans{--p:var(--sky);--ps:var(--sky-soft)}
#p-calendar{--p:var(--sun);--ps:var(--sun-soft)}
#p-how{--p:var(--plum);--ps:var(--plum-soft)}
#sources{display:flex;flex-direction:column;gap:16px}
.docs{list-style:none;margin:0;padding:0;display:flex;flex-direction:column}
.docs li{border-top:1px solid var(--line)}
.docs li:first-child{border-top:0}
.docs a,.docs li.soon{display:flex;justify-content:space-between;align-items:baseline;gap:12px;padding:10px 2px;color:var(--ink);text-decoration:none}
.docs a:hover span:first-child{color:var(--p);text-decoration:underline}
.docs li.soon span:first-child{color:var(--muted)}
.lede{max-width:66ch;padding:12px 16px;border-radius:var(--r);background:var(--ps);color:var(--ink)}
.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:18px;min-width:0;box-shadow:0 1px 2px rgba(20,38,27,.04)}
.card-head{display:flex;flex-wrap:wrap;gap:4px 12px;justify-content:space-between;align-items:baseline;margin-bottom:12px}
.card-head h2,.panel>div>h2{color:var(--p)}

/* ---------- KPI tiles ---------- */
.kpis{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.kpi{border-radius:var(--r);padding:16px 18px;display:flex;flex-direction:column;gap:4px;min-width:0;background:var(--surface);border:1px solid var(--line)}
.kpi .label{font-size:.85rem;color:var(--muted);font-weight:700}
.kpi .val{font-size:clamp(1.35rem,4vw,1.9rem);font-weight:800;line-height:1.15}
.kpi .sub{font-size:.82rem;color:var(--muted)}
.kpi.inc{background:var(--field-soft);border-color:transparent}.kpi.inc .val{color:var(--field)}
.kpi.exp{background:var(--clay-soft);border-color:transparent}.kpi.exp .val{color:var(--clay)}
.kpi.neg{background:var(--neg-soft);border-color:transparent}.kpi.neg .val{color:var(--neg)}
.kpi.pos{background:var(--teal-soft);border-color:transparent}.kpi.pos .val{color:var(--teal)}
@media (max-width:620px){.kpis{grid-template-columns:1fr}}

sup.star,a.star{color:var(--sun);font-weight:800;text-decoration:none;margin-inline-start:2px}

/* ---------- charts ---------- */
.chartbox{overflow-x:auto}
svg{direction:ltr}
svg text{font-family:var(--f-body)}
.ax{fill:var(--muted);font-size:11px}
.grid{stroke:var(--line);stroke-width:1}
.zero{stroke:var(--ink);stroke-width:1.2}
.lineA{fill:none;stroke:var(--teal);stroke-width:3;stroke-linejoin:round;stroke-linecap:round}
.lineP{fill:none;stroke:var(--teal);stroke-width:2.2;stroke-dasharray:6 5}
.negband{fill:var(--neg-soft)}
.dot{fill:var(--surface);stroke:var(--teal);stroke-width:2.2}
.dot.neg{stroke:var(--neg)}
.ann{fill:var(--sun);font-size:11.5px;font-weight:800}
.annline{stroke:var(--sun);stroke-width:1.2;stroke-dasharray:2 3}
.endlbl{fill:var(--ink);font-size:12px;font-weight:800}

.split{display:grid;grid-template-columns:minmax(0,260px) minmax(0,1fr);gap:20px;align-items:center}
@media (max-width:680px){.split{grid-template-columns:1fr}}
.legend{display:flex;flex-direction:column;gap:2px;margin:0;padding:0;list-style:none}
.legend li{display:grid;grid-template-columns:12px minmax(0,1fr) auto auto;gap:10px;align-items:baseline;padding:8px 0;border-bottom:1px solid var(--line)}
.legend li:last-child{border-bottom:0}
.sw{width:12px;height:12px;border-radius:3px;align-self:center;display:inline-block}
.legend .pct{color:var(--muted);font-size:.85rem;min-width:3.2em;text-align:end}

/* ---------- tables ---------- */
table{border-collapse:collapse;width:100%;font-size:.95rem}
.tablebox{overflow-x:auto}
th{font-size:.78rem;letter-spacing:.04em;color:var(--p);font-weight:800;text-align:start;padding:8px 10px;border-bottom:2px solid var(--p)}
td{padding:10px;border-bottom:1px solid var(--line);vertical-align:top}
td.n,th.n{text-align:end;white-space:nowrap}
tbody tr:hover td{background:var(--ps)}
tr.total td{font-weight:800;border-bottom:0;border-top:2px solid var(--ink)}
tr.pending td{background:var(--sun-soft)}

/* ---------- expense bars ---------- */
.bars{display:flex;flex-direction:column;gap:14px}
.bar{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 12px;align-items:baseline}
.bar .name{font-weight:700}
.bar .amt{font-size:.88rem;color:var(--muted);white-space:nowrap}
.track{grid-column:1/-1;position:relative;height:14px;background:var(--clay-soft);border-radius:7px}
.fill{position:absolute;inset-block:0;inset-inline-start:0;background:var(--clay);border-radius:7px}
.fill.over{background:var(--sun)}
.mark{position:absolute;inset-block:-4px;width:2px;background:var(--ink);opacity:.7}
#bars .track{background:var(--line)}
#bars .fill{background:var(--sky)}
#bars .fill.over{background:var(--neg);border-radius:0 7px 7px 0}
.chip{display:inline-block;font-size:.75rem;font-weight:800;border-radius:999px;padding:1px 9px;margin-inline-start:6px;vertical-align:1px}
.chip.warn{background:var(--sun-soft);color:var(--sun)}
.chip.ok{background:var(--field-soft);color:var(--field)}
.chip.neg{background:var(--neg-soft);color:var(--neg)}
.chip.info{background:var(--sky-soft);color:var(--sky)}
.chip.plan{background:var(--plum-soft);color:var(--plum)}
.keyline{display:flex;flex-wrap:wrap;gap:14px;font-size:.82rem;color:var(--muted);margin-top:10px}
.keyline span{display:inline-flex;gap:6px;align-items:center}
.k-mark{width:2px;height:12px;background:var(--ink);opacity:.6;display:inline-block}

/* ---------- ledger ---------- */
.ledger{display:flex;flex-direction:column}
.ledger .row{display:grid;grid-template-columns:5.2em minmax(0,1fr) auto;gap:10px;padding:10px 0;border-bottom:1px solid var(--line);align-items:baseline}
.ledger .row:last-child{border-bottom:0}
.ledger .d{color:var(--muted);font-size:.85rem}
.ledger .cat{display:block;font-size:.8rem;color:var(--muted)}
.amt-in{color:var(--field);font-weight:800}
.amt-out{color:var(--clay);font-weight:800}

/* ---------- projects ---------- */
.projects{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
@media (max-width:680px){.projects{grid-template-columns:1fr}}
.proj{--s:var(--sky);--ss:var(--sky-soft);display:flex;flex-direction:column;gap:10px;background:linear-gradient(180deg,var(--ss) 0,var(--surface) 90px)}
.proj.s-ok{--s:var(--field);--ss:var(--field-soft)}
.proj.s-warn{--s:var(--sun);--ss:var(--sun-soft)}
.proj.s-plan{--s:var(--plum);--ss:var(--plum-soft)}
.proj .meta{display:flex;flex-wrap:wrap;gap:6px 16px;font-size:.88rem;color:var(--muted)}
.proj .meta b{color:var(--ink)}
.stack{display:flex;height:10px;border-radius:5px;overflow:hidden;background:var(--line)}
.stack span{display:block;height:100%}
.fund{display:flex;flex-wrap:wrap;gap:4px 14px;font-size:.82rem;color:var(--muted)}
.fund i{display:inline-block;width:9px;height:9px;border-radius:2px;margin-inline-end:5px}
.prog{height:8px;background:var(--line);border-radius:4px;position:relative}
.prog span{position:absolute;inset-block:0;inset-inline-start:0;background:var(--s);border-radius:4px}

/* ---------- calendar ---------- */
.week{display:flex;flex-direction:column}
.day{display:grid;grid-template-columns:5.5em minmax(0,1fr);gap:12px;padding:12px 0;border-bottom:1px solid var(--line)}
.day:last-child{border-bottom:0}
.day .dl{font-weight:800;line-height:1.25}
.day .dl small{display:block;font-weight:400;color:var(--muted);font-size:.8rem}
.day.today{background:var(--sun-soft);border-radius:10px;padding-inline:10px;border-bottom-color:transparent}
.day.today .dl{color:var(--sun)}
.evs{display:flex;flex-direction:column;gap:6px}
.ev{--k:var(--muted);display:flex;flex-wrap:wrap;gap:4px 10px;align-items:baseline;padding-inline-start:14px;position:relative}
.ev::before{content:"";position:absolute;inset-inline-start:0;top:.55em;width:8px;height:8px;border-radius:50%;background:var(--k)}
.ev.k-garden{--k:var(--field)} .ev.k-waste{--k:var(--clay)} .ev.k-clean{--k:var(--sky)} .ev.k-medical{--k:var(--plum)}
.ev .t{font-weight:800;min-width:3.4em;color:var(--k)}
.ev .bell{font-size:.76rem;color:var(--sun);font-weight:800;background:var(--surface);border:1px solid var(--sun);border-radius:999px;padding:0 8px}
.empty{color:var(--muted);font-size:.9rem}
.hours{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:12px}
.hours .card h3{margin-bottom:6px;color:var(--sun)}
.hours ul{margin:0;padding:0;list-style:none;font-size:.93rem}
.hours li{display:flex;justify-content:space-between;gap:10px;padding:3px 0}

/* ---------- bot demo ---------- */
.chat{display:flex;flex-direction:column;gap:10px;border-radius:var(--r);padding:14px;min-height:150px;
  background:repeating-linear-gradient(45deg,var(--sun-soft) 0 10px,var(--bg) 10px 20px)}
.bubble{max-width:85%;padding:9px 12px;border-radius:14px;font-size:.95rem;box-shadow:0 1px 2px rgba(20,38,27,.08)}
.bubble.q{align-self:flex-start;background:var(--surface);border-start-start-radius:4px}
.bubble.a{align-self:flex-end;background:var(--field-soft);border-start-end-radius:4px}
.bubble .src{display:block;font-size:.76rem;color:var(--muted);margin-top:4px}
.qs{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}
.qs button{font:inherit;font-size:.88rem;font-weight:700;background:var(--sun-soft);color:var(--ink);border:1px solid transparent;border-radius:999px;padding:6px 12px;cursor:pointer}
.qs button:hover{border-color:var(--sun)}
/* ---------- bot floating chat ---------- */
#bot-av,.av-head{fill:var(--teal)}
.av-face{fill:var(--surface)}
.av-eye{fill:var(--ink)}.av-glint{fill:var(--surface)}
.av-smile{fill:none;stroke:var(--ink);stroke-width:2.6;stroke-linecap:round}
.av-cheek{fill:var(--sun);opacity:.55}
.av-grain{fill:var(--sun)}
.bot-btn{position:fixed;inset-block-end:max(16px,env(safe-area-inset-bottom,0px));right:16px;z-index:20;display:inline-flex;align-items:center;gap:8px;font:inherit;font-weight:800;background:var(--surface);border:2px solid var(--teal);border-radius:999px;padding:4px 16px 4px 6px;box-shadow:0 6px 20px rgba(20,38,27,.18);cursor:pointer;color:var(--teal)}
.bot-btn[hidden]{display:none}
.bot-btn svg{width:46px;height:46px;color:var(--teal);flex:none}
.bot-btn:hover{background:var(--teal-soft)}
.bot-panel{position:fixed;inset-block-end:max(16px,env(safe-area-inset-bottom,0px));right:16px;z-index:21;width:min(380px,calc(100vw - 32px));max-height:min(560px,calc(100dvh - 32px));display:flex;flex-direction:column;gap:10px;background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:14px;box-shadow:0 12px 36px rgba(20,38,27,.28);overflow:auto}
.bot-panel[hidden]{display:none}
.bot-panel header{display:flex;align-items:center;gap:10px}
.bot-panel header svg{width:44px;height:44px;flex:none;color:var(--teal)}
.bot-panel header div{flex:1;display:flex;flex-direction:column;line-height:1.25}
.bot-panel header small{color:var(--muted);font-size:.78rem}
.bot-panel header button{font:inherit;font-size:1.5rem;line-height:1;background:none;border:0;color:var(--muted);cursor:pointer;padding:4px 8px}
.bot-panel{inset-block-end:calc(max(16px,env(safe-area-inset-bottom,0px)) + 66px)}
.bot-panel .qs{margin-top:0}
.bot-form{display:flex;gap:8px}
.bot-form input{flex:1;min-width:0;font:inherit;font-size:.95rem;color:var(--ink);background:var(--bg);border:1px solid var(--line);border-radius:999px;padding:8px 14px}
.bot-form input:focus{outline:2px solid var(--teal);border-color:transparent}
.bot-form button{font:inherit;font-weight:800;color:var(--on-t);background:var(--teal);border:0;border-radius:999px;padding:8px 16px;cursor:pointer}
[data-tab="community"]{--t:var(--field);--ts:var(--field-soft)}
#p-community{--p:var(--field);--ps:var(--field-soft)}
.chg,.upd{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px}
.chg li{display:grid;grid-template-columns:auto minmax(0,1fr);gap:10px;align-items:baseline}
.upd{margin-top:8px;padding-top:8px;border-top:1px solid var(--line);font-size:.9rem}
.upd li{display:flex;gap:10px}
.mm-in{display:flex;align-items:center;gap:8px;margin-bottom:12px;font-weight:700}
.mm-in input{width:8em;font:inherit;color:var(--ink);background:var(--bg);border:1px solid var(--line);border-radius:10px;padding:6px 10px}
.req-sum{display:flex;flex-wrap:wrap;gap:14px;margin-bottom:8px;color:var(--muted)}
.req{display:flex;justify-content:space-between;align-items:baseline;gap:12px;padding:9px 0;border-bottom:1px solid var(--line)}
.req .cat{display:block;font-size:.8rem;color:var(--muted)}
#qaList details{border-top:1px solid var(--line);padding:8px 0}
#qaList details:first-child{border-top:0}
#qaList summary{cursor:pointer;font-weight:700}
#qaList p{margin:6px 0 0;color:var(--muted)}
a.btn{display:inline-block;font-weight:800;color:var(--on-t);background:var(--p,var(--teal));text-decoration:none;border-radius:999px;padding:8px 18px}
#feedback p{margin:0 0 10px}
.plan-h{grid-column:1/-1;margin-top:8px}
.plan-h h2{color:var(--p);margin:0 0 4px}
.votes{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;font-size:.95rem}
.vbtn{font:inherit;color:var(--ink);background:var(--surface);border:1.5px solid var(--line);border-radius:999px;padding:5px 14px;cursor:pointer}
.vbtn:hover{border-color:var(--teal);background:var(--teal-soft)}
.vbtn.up[aria-pressed="true"]{background:var(--field-soft);border-color:var(--field)}
.vbtn.down[aria-pressed="true"]{background:var(--clay-soft);border-color:var(--clay)}
.bubble p{margin:0}.bubble p+p{margin-top:8px}
.bubble a.go{font-weight:700;font-size:.85rem;color:var(--teal);white-space:nowrap}
.bot-note{margin:0}
.bot-contact{margin:0}.bot-contact a{color:var(--teal);font-weight:700}

/* ---------- notes ---------- */
.notes{display:flex;flex-direction:column;gap:12px;margin:0;padding:0;list-style:none}
.notes li{display:grid;grid-template-columns:2.2em minmax(0,1fr);gap:8px;padding:12px 14px;background:var(--sun-soft);border-radius:var(--r)}
.notes .mk{color:var(--sun);font-weight:800;font-size:1.1rem;line-height:1.3}
.notes li:target,.notes li:focus{outline:2px solid var(--sun)}

/* ---------- flow diagram ---------- */
.flow svg{width:100%;max-width:420px;height:auto;display:block;margin:0 auto}
.fbox{fill:var(--surface);stroke:var(--line);stroke-width:1.5}
.fbox.key{fill:var(--teal-soft);stroke:var(--teal);stroke-width:2}
.fbox.gate{fill:var(--sun-soft);stroke:var(--sun)}
.fbox.out1{fill:var(--sky-soft);stroke:var(--sky)}
.fbox.out2{fill:var(--field-soft);stroke:var(--field)}
.ft{fill:var(--ink);font-size:14px;font-weight:700}
.fs{fill:var(--muted);font-size:11.5px}
.farrow{stroke:var(--muted);stroke-width:1.6;fill:none}
.fhead{fill:var(--muted)}
.principles{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:12px}
.principles .card h3{color:var(--plum)}
.principles .card p{font-size:.93rem;color:var(--muted);margin-top:4px}
footer{margin-top:36px;padding-top:14px;border-top:1px solid var(--line);font-size:.85rem;color:var(--muted)}
@media (prefers-reduced-motion:no-preference){.fill,.prog span{transition:width .5s ease}}

/* ---------- bot: fix overlapping bubbles ---------- */
.bot-panel{overflow:hidden}
.bot-panel>*{flex:none}
.bot-panel .chat{flex:1 1 auto;min-height:140px;overflow-y:auto;background:var(--bg);border:1px solid var(--line)}
.bot-panel .qs{max-height:92px;overflow-y:auto}
.bubble{flex:none;overflow-wrap:anywhere}
.bubble.a{background:var(--teal-soft)}

.wrap{padding-bottom:96px}

/* ---------- compare chart, details rows, notes ---------- */
.b0{fill:var(--muted);opacity:.55}.b1{fill:var(--teal)}.b2{fill:var(--sun)}
.why{display:block;font-size:.8rem;font-weight:400;color:var(--muted);margin-top:2px;line-height:1.4}
.why.alt{color:var(--sun)}
tr.sub td{padding:0 10px 10px;border-bottom:1px solid var(--line)}
tr.sub details{background:var(--bg);border-radius:10px;padding:6px 10px}
tr.sub summary{cursor:pointer;font-weight:700;color:var(--p,var(--teal));font-size:.9rem}
table.subt{font-size:.88rem;margin-top:6px}
table.subt td,table.subt th{padding:6px 8px}
#audited a,.card-head a{color:var(--teal);font-weight:700;text-decoration:none}
#audited table td{padding:8px 4px}
#foot a{color:var(--teal);font-weight:700}

/* ---------- interactive cash-flow chart ---------- */
.cf-legend{display:flex;flex-direction:column;gap:4px;list-style:none;margin:0 0 8px;padding:0;font-size:.9rem}
.cf-legend li{display:flex;align-items:center;gap:8px}
.cf-legend .sw.b0{background:var(--muted);opacity:.55}.cf-legend .sw.b1{background:var(--teal)}.cf-legend .sw.b2{background:var(--sun)}
rect.cfbar{cursor:pointer;transition:transform .15s}
rect.cfbar:focus{outline:none}
rect.cfbar{transform-box:fill-box;transform-origin:50% 100%}
rect.cfbar.on{transform:scale(1.14)}
.cf-info{margin-top:8px;min-height:1.6em;color:var(--muted)}
.cf-info b{color:var(--ink)}
.cf-info a{color:var(--teal);font-weight:700}

/* ---------- explanation videos ---------- */
.vids{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:16px}
.vid{display:flex;flex-direction:column;gap:10px}
.vid-frame{aspect-ratio:16/9;border-radius:var(--r);overflow:hidden;background:var(--plum-soft)}
.vid-frame video,.vid-frame iframe{width:100%;height:100%;border:0;display:block;background:#000}
.vid-ph{height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;color:var(--plum);font-weight:700}
.vid-ph svg{width:84px;height:84px}
.pa-head{fill:var(--plum)}.pa-body{fill:var(--plum);opacity:.75}.pa-eye{fill:var(--plum-soft)}.pa-smile{fill:none;stroke:var(--plum-soft);stroke-width:2;stroke-linecap:round}

/* ---------- community: calmer colors for volunteers, secondary button ---------- */
#vol .track{background:var(--teal-soft)}
#vol .fill{background:var(--teal)}
a.btn.alt{background:var(--surface);color:var(--teal);border:1.5px solid var(--teal);padding:6.5px 16px}
#ideas p+p{margin-top:10px}

/* The bot button sits at the bottom-left so hosting overlays (e.g. Netlify's, bottom-right) can't cover it */
.bot-btn,.bot-panel{right:auto;left:16px}

/* ---------- audited report: one line per row, breakdown on hover or focus ---------- */
/* rows that open on hover or focus show a down arrow (up while open) */
tr.has{cursor:help}
tr.has td:first-child::before{content:"▾";margin-inline-end:8px;color:var(--teal);font-size:.95rem;font-weight:800}
tr.has:hover td:first-child::before,tr.has:focus td:first-child::before,tr.has:focus-within td:first-child::before{content:"▴"}
tr.has:focus{outline:none}
.parts{display:none;margin-top:6px;font-size:.84rem;font-weight:400;color:var(--muted)}
#audited tr.has:hover .parts,#audited tr.has:focus .parts,#audited tr.has:focus-within .parts{display:block}
.parts ul{list-style:none;margin:0 0 4px;padding:0 12px 0 0}
.parts li{display:flex;justify-content:space-between;gap:12px;max-width:300px}
.parts li::before{content:"•";margin-inline-end:6px}
.parts li span:first-of-type{flex:1}
.parts a{font-weight:700;color:var(--teal);text-decoration:none}

/* ---------- hover emphasis: the item under the pointer grows a little, in every chart ---------- */
.track,.stack,.prog{transition:transform .15s;transform-origin:center}
.bar:hover .track{transform:scaleY(1.5)}
.bar:hover .name{color:var(--ink)}
.proj:hover .stack{transform:scaleY(1.5)}
.donut-seg,circle.seg{transition:stroke-width .15s;cursor:pointer}
circle.seg:hover,circle.seg.on{stroke-width:34}
.legend li{transition:background .15s}
.legend li:hover{background:var(--ps)}

/* ---------- clickable items: grow slightly, like the chart bars ---------- */
.kpi.go,.bar.go{cursor:pointer}
.kpi.go{transition:transform .15s}
.kpi.go:hover,.kpi.go:focus-visible{transform:scale(1.03)}
.bar.go:focus-visible{outline:2px solid var(--sky);outline-offset:3px;border-radius:6px}
tr.flash td{animation:flash 1.6s ease-out}
@keyframes flash{0%,40%{background:var(--sun-soft)}100%{background:transparent}}
#incTable tr.has:hover .parts,#incTable tr.has:focus .parts{display:block}

/* ---------- bot feedback ---------- */
.fb{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin-top:6px;font-size:.8rem;color:var(--muted)}
.fb button{font:inherit;color:var(--ink);background:var(--surface);border:1px solid var(--line);border-radius:999px;padding:2px 10px;cursor:pointer}
.fb button:hover{border-color:var(--teal);background:var(--teal-soft)}

/* ---------- admin screen ---------- */
.range{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:4px}
.range button{font:inherit;font-weight:700;color:var(--ink);background:var(--surface);border:1px solid var(--line);border-radius:999px;padding:5px 14px;cursor:pointer}
.range button[aria-pressed="true"]{background:var(--teal);border-color:var(--teal);color:var(--on-t)}
.range button.alt{margin-inline-start:auto;color:var(--muted)}
#content{display:flex;flex-direction:column;gap:20px}
#views .track{background:var(--sky-soft)}#views .fill{background:var(--sky)}
#votes .track{background:var(--teal-soft)}#votes .fill{background:var(--teal)}
rect.cfbar:hover{transform:scale(1.08)}
.chg li{align-items:baseline}
/* update proposals: before/after lines wrap (never overflow), the sign marks removed/added */
.prop{border:1px solid var(--line);border-radius:12px;padding:12px;display:flex;flex-direction:column;gap:8px}
.prop.pending{border-color:var(--teal);border-width:2px}
.prop.hit{outline:3px solid var(--sun)}
.prop blockquote{margin:0;padding-inline-start:10px;border-inline-start:3px solid var(--line)}
.prop .diff{display:flex;flex-direction:column;gap:2px;font-size:.9rem}
.prop .diff div{white-space:pre-wrap;overflow-wrap:anywhere;padding:4px 8px;border-radius:6px}
.prop .diff .del{background:var(--neg-soft);text-decoration:line-through}
.prop .diff .add{background:var(--teal-soft)}
.prop .acts{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.prop .acts button{font:inherit;font-weight:700;color:var(--ink);background:var(--surface);border:1px solid var(--line);border-radius:999px;padding:5px 14px;cursor:pointer}
.prop .acts button:disabled{opacity:.5;cursor:default}

/* admin intake box: one column, full width, readable on a phone */
.intake{display:flex;flex-direction:column;gap:6px}
.intake label{font-weight:700;margin-top:6px}
.intake textarea,.intake input[type=text],.intake input[type=file]{width:100%;box-sizing:border-box;font:inherit;color:var(--ink);background:var(--bg);border:1px solid var(--line);border-radius:10px;padding:8px 10px}
.intake textarea{resize:vertical;min-height:7em}
#intakeCard .card-head button{font:inherit;font-weight:700;color:var(--ink);background:var(--surface);border:1px solid var(--line);border-radius:999px;padding:4px 14px;cursor:pointer}
.intake-item{border-top:1px solid var(--line);padding:10px 0;display:flex;flex-direction:column;gap:4px}
.intake-item .preview{white-space:pre-wrap;overflow-wrap:anywhere}
.intake-item .links{display:flex;flex-wrap:wrap;gap:8px}

/* ---------- phones (390px): stack, shrink, and hint instead of clipping ---------- */
@media (max-width:520px){
  .card{padding:14px}
  /* expense rows: name on its own line, figures below and allowed to wrap, so nothing is cut off */
  .bar{grid-template-columns:minmax(0,1fr)}
  .bar .amt{white-space:normal;line-height:1.5}
  .bar .chip{display:inline-block;white-space:nowrap}
  /* tables: smaller type and padding; the first column takes the remaining width, numbers never wrap */
  table{font-size:.82rem}
  th,td{padding:8px 3px}
  th.n,td.n{width:1%;font-size:.74rem}
  td:first-child:not(.n){min-width:100px}
  table.subt td,table.subt th{padding:5px 4px}
  /* header: keep the glow behind the text faint */
  header.top::before{opacity:.35}
  header.top::after{display:none}
  /* tabs row: fade the edges to show that it scrolls */
  nav.tabs{-webkit-mask-image:linear-gradient(to right,transparent,#000 28px,#000 calc(100% - 28px),transparent);mask-image:linear-gradient(to right,transparent,#000 28px,#000 calc(100% - 28px),transparent)}
}
