/* ===========================================================================
   The compiled dashboard -- TREEI's eight programme dashboards in one page.
   ---------------------------------------------------------------------------
   The layout is the Fort Edition's, which is the newest of the Dashboard_TREE
   pages: six hero tiles beside a scene, an icon strip, numbered section cards,
   and area charts with the end value called out. Six of the seven built pages
   already used it; Village and Organization Overview were on the older one.
   Rolling it across all eight is what makes them read as one dashboard.

   Every rule is scoped under .dvzc, because the host theme on treei.org sets
   h1,h2,h3{color:crimson!important} and similar globals, and a dashboard that
   turns red inside somebody's theme is not a dashboard.

   Colour reaches a tab through --acc / --acc2 / --accsoft, set per project by
   the script, so a tab is recoloured in one place and its charts follow.
   Single-theme light by intent: it has to match treei.org.
   ======================================================================== */
/* ---- TREEI's dashboard system -----------------------------------------
   Every selector below is scoped under .dvzc. Not for tidiness: the host
   theme on treei.org sets globals like h1,h2,h3{color:crimson!important} and
   a{color:crimson}, so an unscoped .card or .nav here would both leak out
   into the theme and be overridden by it. One stray bare selector is enough
   to turn a heading red inside somebody else's page.
   --------------------------------------------------------------------- */
.dvzc{
  --bg:#f4f5f7; --panel:#fff; --ink:#0e3a3d; --ink2:#13494c;
  --teal:#0b5658; --green:#1f7a3d; --orange:#f2a93c;
  --border:#e8eaec; --soft:#eef0f1; --muted:#6b7a7c; --muted2:#8b9799;
  --shadow:0 1px 2px rgba(20,30,32,.04), 0 6px 18px rgba(20,30,32,.05);
  --acc:#0b5658; --acc2:#0f4244; --accsoft:#eaf3f2;
  color-scheme:light; background:var(--bg); color:var(--ink);
  font-size:14px; line-height:1.4; display:flex; align-items:flex-start; min-height:700px;
}
.dvzc *{box-sizing:border-box}
/* The host theme sets h1,h2,h3{color:crimson!important} and a{color:crimson}.
   Specificity alone does not beat !important, so the dashboard has to say it
   too — this is the whole reason the scope exists, and without it every
   heading in here turns red inside their page. */
.dvzc h1,.dvzc h2,.dvzc h3{margin:0;font-family:var(--f-disp);color:var(--ink)!important}
.dvzc .hero-sub{color:var(--acc)!important}
.dvzc .stage-head{color:inherit}
.dvzc a{color:inherit!important;text-decoration:none}
.dvzc .sdg b,.dvzc .sdg span,.dvzc .nav button[aria-pressed=true]{color:#fff!important}
.dvzc p{margin:0}.dvzc ol,.dvzc ul{margin:0;padding:0;list-style:none}.dvzc svg{display:block}
.dvzc .tn{font-variant-numeric:tabular-nums}

.dvzc .sidebar{width:216px;flex:0 0 216px;background:var(--panel);border-right:1px solid var(--border);
  align-self:stretch;padding:22px 15px 18px;display:flex;flex-direction:column}
.dvzc .brand-name{font-family:var(--f-disp);font-weight:800;font-size:18px;letter-spacing:.5px;line-height:1.05}
.dvzc .brand-sub{font-weight:600;font-size:9.5px;letter-spacing:1.5px;color:var(--teal);margin-top:1px}
.dvzc .brand-tag{font-size:10px;color:var(--muted2);margin:8px 0 20px}
.dvzc .nav-label{font-size:10.5px;font-weight:700;letter-spacing:1.5px;color:var(--muted2);margin:4px 0 10px}
.dvzc .nav{display:flex;flex-direction:column;gap:4px}
.dvzc .nav button{display:flex;align-items:center;gap:11px;padding:9px 11px;border-radius:11px;color:var(--ink2);
  background:none;border:0;cursor:pointer;text-align:left;width:100%;font:inherit;transition:background .15s}
.dvzc .nav button:hover{background:#f2f5f5}
.dvzc .nav button .ic{width:20px;height:20px;flex:0 0 20px;color:var(--teal)}
.dvzc .nav button .lb{font-size:12.5px;font-weight:600;line-height:1.25}
.dvzc .nav button[aria-pressed=true]{color:#fff;box-shadow:var(--shadow)}
.dvzc .nav button[aria-pressed=true] .ic{color:#fff}
.dvzc .nav button.soon{opacity:.5;cursor:default}
.dvzc .nav button:focus-visible{outline:2px solid var(--teal);outline-offset:2px}
.dvzc .dl-card{border:1px solid var(--border);border-radius:14px;padding:13px;display:flex;gap:9px;
  align-items:flex-start;margin-top:auto;font-size:11.5px;line-height:1.45;color:var(--ink2)}
.dvzc .dl-card b{display:block;font-size:12px;color:var(--ink)}
.dvzc .dl-card .arrow{margin-left:auto;color:var(--muted2)}

.dvzc .main{flex:1;min-width:0;padding:20px 22px 30px;display:flex;flex-direction:column;gap:14px}

/* hero */.dvzc .hero-row{display:flex;gap:14px;align-items:stretch;flex-wrap:wrap}
.dvzc .hero-text{flex:1 1 300px;min-width:250px}
.dvzc .hero-title{font-size:25px;font-weight:800;line-height:1.15}
.dvzc .hero-sub-row{display:flex;align-items:center;gap:8px;margin-top:5px;flex-wrap:wrap}
.dvzc .hero-sub{font-size:15px;font-weight:700;letter-spacing:.3px;color:var(--acc)}
.dvzc .badge{border:1px solid var(--border);border-radius:8px;padding:3px 9px;font-size:11px;
  font-weight:700;color:var(--ink2);background:#fafbfb}
.dvzc .hero-desc{margin-top:9px;font-size:12.5px;color:#3c4a4b;max-width:52ch;line-height:1.55}
.dvzc .hero-stats{display:flex;gap:8px;flex:2 1 460px;flex-wrap:wrap;align-content:flex-start}
.dvzc .hstat{flex:1 1 calc(33.333% - 6px);min-width:104px;max-width:100%;background:var(--panel);border:1px solid var(--border);
  border-radius:14px;box-shadow:var(--shadow);padding:10px 12px}
.dvzc .hstat .lbl{display:flex;align-items:center;gap:5px;font-size:9px;font-weight:700;letter-spacing:.9px;
  color:var(--muted);text-transform:uppercase;line-height:1.25}
.dvzc .hstat .lbl svg{width:11px;height:11px;flex:0 0 11px;color:var(--acc)}
.dvzc .hstat .num{font-size:20px;font-weight:800;margin-top:5px}
.dvzc .hstat .num small{font-size:11.5px;color:var(--muted);font-weight:700}
.dvzc .hstat .sub{font-size:10px;color:var(--muted);margin-top:1px;line-height:1.3}
.dvzc .hero-image{flex:0 0 190px;width:190px;border-radius:14px;overflow:hidden;box-shadow:var(--shadow);
  border:1px solid var(--border)}
.dvzc .hero-image svg{width:100%;height:100%;display:block}

/* quick strip */.dvzc .quickstats{background:var(--panel);border:1px solid var(--border);border-radius:18px;
  box-shadow:var(--shadow);overflow-x:auto}
.dvzc .qrow{display:flex;min-width:min-content}
.dvzc .qstat{flex:1 0 148px;padding:13px 15px;border-right:1px solid var(--soft);display:flex;gap:10px;align-items:flex-start}
.dvzc .qstat:last-child{border-right:0}
.dvzc .qstat .ic-wrap{width:22px;height:22px;flex:0 0 22px;color:var(--acc);margin-top:2px}
.dvzc .qstat .ic-wrap svg{width:22px;height:22px}
.dvzc .val-row{display:flex;align-items:baseline;gap:4px}
.dvzc .val{font-size:17px;font-weight:800;line-height:1.1}
.dvzc .unit{font-size:11px;color:var(--muted);font-weight:700}
.dvzc .cap{font-size:10.5px;color:var(--muted);margin-top:2px;line-height:1.35}

/* source pill */.dvzc .srcrow{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:0 2px}
.dvzc .pill{display:inline-flex;align-items:center;gap:6px;border-radius:999px;padding:4px 11px;
  font-size:10.5px;font-weight:800;letter-spacing:.8px;white-space:nowrap}
.dvzc .pill.live{background:#e7f4ec;color:#1f7a3d}
.dvzc .pill.live::before{content:"";width:6px;height:6px;border-radius:50%;background:#1f7a3d;
  animation:blip 2s ease-in-out infinite}
@keyframes blip{0%,100%{opacity:1}50%{opacity:.25}}
@media (prefers-reduced-motion: reduce){.dvzc .pill.live::before{animation:none}}
.dvzc .pill.stat{background:#fdf2e3;color:#8a5a12}
.dvzc .pill.none{background:var(--soft);color:var(--muted)}
.dvzc .srcrow p{font-size:11.5px;color:var(--muted);line-height:1.5}

/* cards + numbered sections */.dvzc .card{background:var(--panel);border:1px solid var(--border);border-radius:18px;box-shadow:var(--shadow)}
.dvzc .grid{display:grid;gap:13px;grid-template-columns:repeat(auto-fit,minmax(320px,1fr))}
/* A chart and its change callout belong together: in the auto-fit grid above
   they were four independent children and wrapped into a ragged third row. */.dvzc .pair{display:grid;gap:13px;grid-template-columns:minmax(0,2.1fr) minmax(150px,1fr)}
@media (max-width:820px){.dvzc .pair{grid-template-columns:1fr}}
.dvzc .chart-card{padding:15px 17px 13px;min-width:0}
.dvzc .ctitle-row{display:flex;align-items:center;gap:9px;margin-bottom:11px;flex-wrap:wrap}
.dvzc .ic-badge{width:21px;height:21px;flex:0 0 21px;border-radius:6px;background:var(--accsoft);color:var(--acc2);
  display:grid;place-items:center}
.dvzc .ic-badge svg{width:13px;height:13px}
.dvzc .ctitle{font-family:var(--f-disp);font-size:14px;font-weight:700;min-width:0}
.dvzc .ctitle span{color:var(--muted);font-weight:600;font-size:12px}
.dvzc .kind{margin-left:auto;font-size:9px;font-weight:800;letter-spacing:.85px;border-radius:7px;padding:3px 8px;white-space:nowrap}
.dvzc .kind.stock{background:var(--accsoft);color:var(--acc2)}
.dvzc .kind.flow{background:var(--soft);color:var(--muted)}
.dvzc .kind.proj{background:#fdf2e3;color:#8a5a12;border:1px dashed #d8b36a}
.dvzc .cnote{font-size:11.5px;color:var(--muted);margin-top:10px;line-height:1.5}

/* the projected-increase side card, as the fort page has it */.dvzc .side-card{display:flex;flex-direction:column;align-items:center;justify-content:center;
  text-align:center;gap:5px;padding:20px 16px}
.dvzc .side-card .t{font-size:11.5px;color:var(--muted)}
.dvzc .side-card .arw{display:block;width:26px;height:26px;color:var(--green)}
.dvzc .side-card .big{font-family:var(--f-disp);font-size:28px;font-weight:800;color:var(--green);line-height:1}
.dvzc .side-card .b{font-size:11px;color:var(--muted)}

/* donut + pipeline */.dvzc .donut-row{display:flex;gap:18px;align-items:center;flex-wrap:wrap}
.dvzc .donut-wrap{position:relative;width:132px;height:132px;flex:0 0 132px}
.dvzc .donut-center{position:absolute;inset:0;display:grid;place-items:center;text-align:center;line-height:1.15}
.dvzc .donut-center b{font-family:var(--f-disp);font-size:24px;font-weight:800;display:block}
.dvzc .donut-center span{font-size:9.5px;color:var(--muted)}
.dvzc .donut-legend{flex:1 1 200px;min-width:190px;display:flex;flex-direction:column;gap:7px}
.dvzc .donut-legend div{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--ink2)}
.dvzc .dot{width:9px;height:9px;border-radius:50%;flex:0 0 9px}
.dvzc .donut-legend em{margin-left:auto;font-style:normal;color:var(--muted);font-size:11.5px}
.dvzc .pipeline-overview{border:1px solid var(--border);border-radius:14px;padding:13px 15px;margin-top:13px}
.dvzc .po-title{font-size:12.5px;font-weight:700}
.dvzc .po-text{font-size:11.5px;color:var(--muted);margin-top:5px;line-height:1.5}
.dvzc .po-bar-row{display:flex;align-items:center;gap:11px;margin-top:11px}
.dvzc .po-bar-track{flex:1;height:7px;border-radius:5px;background:var(--soft);overflow:hidden}
.dvzc .po-bar-fill{height:100%;border-radius:5px;background:var(--green)}
.dvzc .po-pct{font-size:15px;font-weight:800}
.dvzc .po-sub{font-size:10.5px;color:var(--muted2);margin-top:6px}

/* stage columns */.dvzc .stage-cols{display:grid;gap:11px;grid-template-columns:repeat(auto-fit,minmax(200px,1fr))}
.dvzc .stage-col{border:1px solid var(--border);border-radius:13px;padding:12px 13px;min-width:0;background:#fff}
.dvzc .stage-head{font-size:10.5px;font-weight:800;letter-spacing:.8px;display:flex;align-items:center;gap:7px}
.dvzc .stage-sub{font-size:10.5px;color:var(--muted);margin:5px 0 9px;display:flex;align-items:center;gap:5px}
.dvzc .stage-list li{font-size:12px;color:var(--ink2);padding:3.5px 0;display:flex;gap:7px;line-height:1.35}
.dvzc .stage-list li i{font-style:normal;color:var(--muted2);font-size:10.5px;min-width:15px}
.dvzc .dotb{width:6px;height:6px;border-radius:50%;flex:0 0 6px;margin-top:5px}
.dvzc .stage-progress{display:flex;align-items:center;gap:8px;margin-top:13px;padding-top:12px;
  border-top:1px dashed var(--border);flex-wrap:wrap}
.dvzc .stage-progress > div{display:flex;align-items:center;gap:6px;font-size:10px;font-weight:700;
  letter-spacing:.6px;color:var(--ink2)}
.dvzc .stage-progress > div small{display:block;font-weight:400;color:var(--muted);letter-spacing:0;font-size:10px}
.dvzc .stage-progress .ln{flex:1;border-top:1px dotted var(--muted2);min-width:20px}

/* tile rows */.dvzc .tiles{display:grid;gap:10px;grid-template-columns:repeat(auto-fit,minmax(132px,1fr))}
.dvzc .tile{border:1px solid var(--border);border-radius:12px;padding:13px;background:#fff}
.dvzc .tile .ti{display:block;width:19px;height:19px;color:var(--acc);margin-bottom:7px}
/* An icon fills the box it is given and never its own natural size. Left
   unconstrained an inline SVG renders at 300px and a 19px tile becomes a
   poster of a lightbulb. */.dvzc .tile .ti svg,.dvzc .sdg .gl svg,.dvzc .side-card .arw svg{width:100%;height:100%}
.dvzc .tile .v{font-size:19px;font-weight:800}
.dvzc .tile .v small{font-size:11px;color:var(--muted);font-weight:700}
.dvzc .tile .l{font-size:10.5px;color:var(--muted);margin-top:2px;line-height:1.35}
.dvzc .secblock{padding:15px 17px 16px}

/* model chain */.dvzc .chain{display:flex;flex-wrap:wrap;align-items:flex-start;gap:3px}
.dvzc .chain .step{flex:1 1 84px;min-width:78px;text-align:center}
.dvzc .chain .step .ring{width:40px;height:40px;margin:0 auto 6px;border:1.6px solid var(--acc);border-radius:50%;
  display:grid;place-items:center;color:var(--acc)}
.dvzc .chain .step .ring svg{width:19px;height:19px}
.dvzc .chain .step div{font-size:10px;font-weight:700;color:var(--ink2);line-height:1.3}
.dvzc .chain .ar{align-self:flex-start;color:var(--muted2);font-size:12px;margin-top:14px}

/* sdg */.dvzc .sdgs{display:grid;gap:8px;grid-template-columns:repeat(auto-fit,minmax(116px,1fr))}
.dvzc .sdg{border-radius:11px;padding:10px 11px;color:#fff;height:88px;display:flex;flex-direction:column;
  justify-content:space-between;position:relative;overflow:hidden}
.dvzc .sdg b{font-size:18px;font-weight:800;line-height:1}
.dvzc .sdg span{font-size:8px;font-weight:800;letter-spacing:.4px;line-height:1.25}
.dvzc .sdg .gl{position:absolute;right:8px;bottom:6px;width:22px;height:22px;opacity:.85}

.dvzc .flag{display:flex;gap:10px;border:1px solid #e3cfa4;background:#fdf8ef;border-radius:13px;
  padding:11px 13px;font-size:11.5px;line-height:1.55;color:#5c4415}
.dvzc .flag b{color:#4a3510}
.dvzc .flag svg{flex:0 0 16px;width:16px;height:16px;color:#a97c22;margin-top:1px}

.dvzc .empty{padding:34px 18px;text-align:center;color:var(--muted);font-size:12.5px;line-height:1.6}

@media (max-width:820px){
  /* align-items:flex-start is right when the rail is a column beside the
     content; stacked, it lets each row size to its own content, and the rail
     full of buttons then sets the page width. */
  .dvzc{flex-direction:column;align-items:stretch}
  .dvzc .sidebar{width:100%;max-width:100%;min-width:0;flex:none;border-right:0;
    border-bottom:1px solid var(--border);padding:14px}
  .dvzc .main{min-width:0;max-width:100%}
  /* The rail becomes a scrolling strip. min-width:0 is what makes
     overflow-x actually clip: without it the flex row grows to fit its
     buttons and pushes the whole page sideways instead. */
  .dvzc .nav{flex-direction:row;overflow-x:auto;gap:6px;min-width:0;max-width:100%;
    -webkit-overflow-scrolling:touch}
  .dvzc .nav button{white-space:nowrap;padding:8px 10px;flex:0 0 auto}
  .dvzc .nav button .lb{font-size:11.5px}
  .dvzc .dl-card{display:none}
  .dvzc .main{padding:15px 13px 22px}
  .dvzc .hero-image{flex:1 1 100%;width:100%;height:110px}
}

/* A tab with no dashboard yet, and a page held in a cache since an earlier
   day. The second is meant to be noticed: every figure on such a page is
   standing still for a reason the reader cannot otherwise see. */.dvzc .dvzc-empty{padding:34px 18px;text-align:center;color:var(--muted);font-size:12.5px;line-height:1.6}
.dvzc .srcrow p.dvzc-stale{color:#8a5a12;background:#fdf2e3;border:1px solid #e8d0a4;
  border-radius:9px;padding:7px 11px;font-weight:600}

/* ── the daylight indicator ───────────────────────────────────────────────
   Between the figures and the sentence that explains them. It answers the
   one question a still number raises — is this resting, or is it broken —
   where the reader is already looking. The track behind it shows how much
   of the day is left; on a phone it drops away and the chip carries it. */
.dvzc .dayrow{display:flex;align-items:center;gap:18px;flex-wrap:wrap;padding:0 2px}
.dvzc .daychip{display:inline-flex;align-items:center;gap:8px;border-radius:999px;
  padding:7px 14px 7px 11px;border:1px solid;max-width:100%}
.dvzc .daychip svg{width:15px;height:15px;flex:0 0 15px;display:block}
.dvzc .daychip .w{font-size:12px;font-weight:800;letter-spacing:.4px;white-space:nowrap}
.dvzc .daychip .sep{width:1px;align-self:stretch;background:currentColor;opacity:.42}
.dvzc .daychip .nt{font-size:11.5px}
.dvzc .dayrow.is-day .daychip{background:#e7f4ec;border-color:#bfe0cb;color:#1a6b35}
.dvzc .dayrow.is-rest .daychip,.dvzc .dayrow.is-dawn .daychip{background:#edeff7;
  border-color:#ccd3e6;color:#3b4a74}

.dvzc .daytrack{flex:1 1 260px;min-width:0;max-width:380px;display:flex;flex-direction:column;gap:5px}
.dvzc .daybar{position:relative;height:8px;border-radius:99px;background:#e9ecee;overflow:hidden}
.dvzc .daybar i{position:absolute;top:0;bottom:0;display:block;
  background:linear-gradient(90deg,#fbe8bc,#f3c661,#fbe8bc)}
.dvzc .daymark{position:relative;height:0}
.dvzc .daymark i{position:absolute;top:-12px;width:2px;height:14px;border-radius:2px;
  background:var(--ink);transform:translateX(-1px);display:block}
.dvzc .dayscale{position:relative;height:13px;font-size:10px;color:var(--muted2);white-space:nowrap}
.dvzc .dayscale span{position:absolute;top:0;transform:translateX(-50%)}
@media (max-width:720px){.dvzc .daytrack{display:none}}

/* The LIVE badge keeps its meaning after dark, but stops pretending to move. */
.dvzc .pill.live.at-rest::before{animation:none;opacity:.55}
