/* Nepal Public Data — shared look. Neutral slate palette, one blue accent, system fonts, light and dark.
   Tokens only: every color comes from :root and is redefined for dark. Spacing on a 4/8 px scale. */
:root{
  color-scheme:light;
  --bg:#ffffff; --bg-2:#f8fafc; --surface:#ffffff; --surface-2:#f1f5f9; --surface-3:#e2e8f0;
  --line:#e2e8f0; --line-2:#cbd5e1;
  /* --line-strong marks out a control or a scale (field borders, meter tracks, "no figure" hatching): 3.45:1 on
     --surface, 3.15:1 on --surface-2 (WCAG 1.4.11 asks 3:1). --line and --line-2 stay for decorative rules. */
  --line-strong:#7d8ba1;
  --ink:#0f172a; --ink-2:#334155; --muted:#5b6b80;
  --accent:#2563eb; --accent-ink:#1d4ed8; --accent-soft:#eff6ff; --on-accent:#ffffff;
  --good:#047857; --bad:#b91c1c; --warn:#b45309; --warn-ink:#9a3412;
  --c1:#2563eb; --c2:#64748b; --c3:#0f766e; --c4:#b45309; --c5:#7c3aed; --grid:#e2e8f0;
  /* data palette: categorical k1-k8, sequential q1-q5 (q0 = no data), diverging d1-d5 (d3 = middle) */
  --k1:#2563eb; --k2:#0f766e; --k3:#c2410c; --k4:#9333ea; --k5:#be185d; --k6:#4d7c0f; --k7:#ca8a04; --k8:#475569;
  --q0:#e2e8f0; --q1:#dbeafe; --q2:#93c5fd; --q3:#3b82f6; --q4:#1d4ed8; --q5:#1e3a8a;
  --d1:#c2410c; --d2:#fdba74; --d3:#e2e8f0; --d4:#93c5fd; --d5:#1d4ed8;
  --shadow:0 1px 2px rgba(15,23,42,.06),0 4px 16px rgba(15,23,42,.06);
  --sans:-apple-system,BlinkMacSystemFont,"SF Pro Text","SF Pro Display","Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans Devanagari","Kohinoor Devanagari","Nirmala UI",sans-serif;
  --mono:ui-monospace,"SF Mono",SFMono-Regular,Menlo,Consolas,monospace;
  --r:16px; --r-s:10px; --gut:16px; --max:1120px; --ease:150ms ease;
  /* header: --bar-h is the bar's own height; --hdr the whole header, measured by assets/npd.js (bar + border);
     --hdr-vis the part of it on screen (0 while it is hidden on scrolling down), for anything sticky under it */
  --bar-h:56px; --hdr:57px; --hdr-vis:var(--hdr);
}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){
  color-scheme:dark;
  --bg:#0b1120; --bg-2:#0f172a; --surface:#0f172a; --surface-2:#1e293b; --surface-3:#334155;
  --line:#1e293b; --line-2:#334155; --line-strong:#64748b;
  --ink:#e2e8f0; --ink-2:#cbd5e1; --muted:#94a3b8;
  --accent:#60a5fa; --accent-ink:#93c5fd; --accent-soft:rgba(96,165,250,.12); --on-accent:#0b1120;
  --good:#34d399; --bad:#f87171; --warn:#fbbf24; --warn-ink:#fbbf24;
  --c1:#60a5fa; --c2:#64748b; --c3:#2dd4bf; --c4:#fbbf24; --c5:#a78bfa; --grid:#1e293b;
  --k1:#60a5fa; --k2:#2dd4bf; --k3:#fb923c; --k4:#e879f9; --k5:#fb7185; --k6:#a3e635; --k7:#fef08a; --k8:#94a3b8;
  --q0:#1e293b; --q1:#172554; --q2:#1e40af; --q3:#2563eb; --q4:#60a5fa; --q5:#bfdbfe;
  --d1:#fb923c; --d2:#9a3412; --d3:#334155; --d4:#1e40af; --d5:#60a5fa;
  --shadow:0 1px 2px rgba(0,0,0,.3),0 4px 16px rgba(0,0,0,.25);
}}
:root[data-theme="dark"]{
  color-scheme:dark;
  --bg:#0b1120; --bg-2:#0f172a; --surface:#0f172a; --surface-2:#1e293b; --surface-3:#334155;
  --line:#1e293b; --line-2:#334155; --line-strong:#64748b;
  --ink:#e2e8f0; --ink-2:#cbd5e1; --muted:#94a3b8;
  --accent:#60a5fa; --accent-ink:#93c5fd; --accent-soft:rgba(96,165,250,.12); --on-accent:#0b1120;
  --good:#34d399; --bad:#f87171; --warn:#fbbf24; --warn-ink:#fbbf24;
  --c1:#60a5fa; --c2:#64748b; --c3:#2dd4bf; --c4:#fbbf24; --c5:#a78bfa; --grid:#1e293b;
  --k1:#60a5fa; --k2:#2dd4bf; --k3:#fb923c; --k4:#e879f9; --k5:#fb7185; --k6:#a3e635; --k7:#fef08a; --k8:#94a3b8;
  --q0:#1e293b; --q1:#172554; --q2:#1e40af; --q3:#2563eb; --q4:#60a5fa; --q5:#bfdbfe;
  --d1:#fb923c; --d2:#9a3412; --d3:#334155; --d4:#1e40af; --d5:#60a5fa;
  --shadow:0 1px 2px rgba(0,0,0,.3),0 4px 16px rgba(0,0,0,.25);
}
@media (min-width:768px){:root{--gut:24px}}
@media (min-width:1024px){:root{--gut:32px}}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;background:var(--bg)}
body{margin:0;background:var(--bg);color:var(--ink);font:17px/1.5 var(--sans);-webkit-font-smoothing:antialiased;overflow-x:hidden}
h1,h2,h3,h4,p,figure{margin:0}
h1,h2,h3{text-wrap:balance;letter-spacing:-.015em;line-height:1.15}
h1{font-size:clamp(32px,6vw,48px);font-weight:700}
h2{font-size:clamp(24px,3.2vw,30px);font-weight:700}
h3{font-size:19px;font-weight:650}
a{color:var(--accent-ink);text-underline-offset:3px;transition:color var(--ease)}
a:hover{color:var(--accent)}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
button,input,select{font:inherit;color:inherit}
.num,table td,table th{font-variant-numeric:tabular-nums}
.wrap{max-width:var(--max);margin:0 auto;padding-inline:var(--gut)}
.prose{max-width:65ch}
.prose p+p{margin-top:12px}
.prose .cols2{columns:2 16rem;column-gap:32px;padding-left:20px;max-width:none}
.prose .cols2 li{break-inside:avoid;margin-bottom:4px}
.muted{color:var(--muted)}
.small{font-size:14px;line-height:1.45}
.xs{font-size:12.5px;line-height:1.4}
.vh{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.skip:focus,.skip:focus-visible{position:fixed!important;left:12px;top:calc(12px + env(safe-area-inset-top,0px));width:auto;height:auto;clip:auto;white-space:normal;z-index:100;background:var(--ink);color:var(--bg);padding:10px 14px;border-radius:10px;font-weight:600;text-decoration:none}
[hidden]{display:none!important}

/* ---------- header ---------- */
.hdr{position:sticky;top:env(safe-area-inset-top,0px);z-index:30;background:color-mix(in srgb,var(--bg) 86%,transparent);backdrop-filter:saturate(1.4) blur(14px);-webkit-backdrop-filter:saturate(1.4) blur(14px);border-bottom:1px solid var(--line)}
.hdr .bar{display:flex;align-items:center;gap:12px;height:var(--bar-h)}
.brand{display:flex;align-items:center;gap:8px;text-decoration:none;color:var(--ink);font-weight:700;font-size:19px;letter-spacing:-.02em;white-space:nowrap}
.brand small{font-weight:500;font-size:15px;color:var(--muted);letter-spacing:0}
.brand .mark{width:24px;height:24px;flex:none;align-self:center}
.brand:hover{color:var(--ink)}
.nav{display:flex;gap:4px;margin-left:12px;overflow-x:auto;scrollbar-width:none}
.nav::-webkit-scrollbar{display:none}
.nav a{display:block;padding:8px 12px;border-radius:999px;text-decoration:none;color:var(--ink-2);font-size:15px;font-weight:550;white-space:nowrap;transition:background var(--ease),color var(--ease)}
.nav a:hover{background:var(--surface-2);color:var(--ink)}
.nav a[aria-current="page"]{background:var(--accent-soft);color:var(--accent-ink)}
.tools{margin-left:auto;display:flex;gap:8px;align-items:center}
.seg{display:inline-flex;border:1px solid var(--line);border-radius:999px;padding:2px;background:var(--surface)}
.seg button{border:0;background:transparent;border-radius:999px;padding:6px 10px;min-width:38px;min-height:36px;font-size:13px;font-weight:600;color:var(--muted);cursor:pointer;transition:background var(--ease),color var(--ease)}
.seg button:hover{color:var(--ink)}
.seg button[aria-pressed="true"]{background:var(--ink);color:var(--bg)}
.iconbtn{display:inline-grid;place-items:center;width:40px;height:40px;border-radius:999px;border:1px solid var(--line);background:var(--surface);color:var(--ink-2);cursor:pointer;transition:background var(--ease),border-color var(--ease)}
.iconbtn:hover{border-color:var(--line-2);background:var(--surface-2)}
.iconbtn svg{width:16px;height:16px}
/* one row at every width, a Menu sheet below 1180 px: see "header, menu sheet and in-page navigation" at the end */
@media (max-width:719px){
  /* without JavaScript (no Menu button) the sections stay a scrolling row under the brand */
  html:not(.npd-js) .hdr .bar{height:auto;flex-wrap:wrap;padding-block:8px;row-gap:6px}
  html:not(.npd-js) .nav{order:3;width:calc(100% + 24px);margin-left:-8px;margin-right:-16px;gap:2px}
  html:not(.npd-js) .nav a{padding:8px;font-size:14px}
}

/* ---------- page head ---------- */
.head{padding-block:40px 24px}
.head .kicker{font-size:13px;font-weight:650;letter-spacing:.06em;text-transform:uppercase;color:var(--accent-ink)}
.head h1{margin-top:8px}
.head .lede{margin-top:12px;font-size:19px;color:var(--ink-2);max-width:60ch}
.head .meta{margin-top:12px;font-size:14px;color:var(--muted)}
.section{padding-block:24px 40px}
.section+.section{border-top:1px solid var(--line)}
.section>h2{margin-bottom:8px}
.section>.sub{color:var(--muted);margin-bottom:20px;max-width:65ch}

/* ---------- cards ---------- */
.grid{display:grid;gap:16px;grid-template-columns:repeat(auto-fill,minmax(min(100%,300px),1fr))}
.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:20px;display:flex;flex-direction:column;gap:8px;min-width:0;transition:border-color var(--ease),box-shadow var(--ease),transform var(--ease)}
a.card{text-decoration:none;color:inherit}
a.card:hover{border-color:var(--line-2);box-shadow:var(--shadow)}
a.card:active{transform:translateY(1px)}
.card .lab{font-size:14px;font-weight:600;color:var(--ink-2)}
.card .val{font-size:34px;font-weight:700;letter-spacing:-.02em;line-height:1.1}
.card .val small{font-size:17px;font-weight:600;color:var(--muted);margin-left:4px}
.card .per{font-size:13.5px;color:var(--muted)}
.card .src{font-size:12.5px;color:var(--muted);margin-top:auto;padding-top:8px;border-top:1px solid var(--line)}
.chip{display:inline-flex;align-items:center;gap:4px;font-size:13px;font-weight:600;padding:2px 8px;border-radius:999px;background:var(--surface-2);color:var(--ink-2);width:fit-content}
.chip.up{color:var(--ink-2)}
.chip .arrow{font-size:11px}
.spark{display:block;width:100%;height:44px}
/* status badges in sentence case ("Provisional", whatever case the script wrote): ::first-letter needs a block box */
.badge{display:inline-block;font-size:12.5px;font-weight:650;line-height:1.35;letter-spacing:0;padding:1px 6px;border-radius:6px;background:var(--surface-2);color:var(--ink-2)}
.badge::first-letter{text-transform:uppercase}
.badge.prov{background:color-mix(in srgb,var(--warn) 14%,transparent);color:var(--warn-ink)}

/* ---------- search ---------- */
.search{position:relative;max-width:520px}
.search input{width:100%;height:48px;border-radius:12px;border:1px solid var(--line-strong);background:var(--surface);padding:0 16px 0 44px;font-size:17px;transition:border-color var(--ease),box-shadow var(--ease)}
.search input:hover{border-color:var(--muted)}
/* the field focus ring (every field uses the same one): the border and a 1px ring in --accent make a 2px edge at
   5.2:1, with a soft halo outside it */
.search input:focus{outline:none;border-color:var(--accent);box-shadow:0 0 0 1px var(--accent),0 0 0 4px color-mix(in srgb,var(--accent) 28%,transparent)}
.search svg{position:absolute;left:14px;top:14px;width:20px;height:20px;color:var(--muted)}
.results{list-style:none;margin:8px 0 0;padding:4px;border:1px solid var(--line);border-radius:12px;background:var(--surface);max-height:360px;overflow:auto;box-shadow:var(--shadow)}
.results a{display:flex;justify-content:space-between;gap:12px;padding:10px 12px;border-radius:8px;text-decoration:none;color:var(--ink)}
.results a:hover,.results a:focus-visible,.results a.hl{background:var(--surface-2)}
.results small{color:var(--muted)}

/* ---------- bars ---------- */
/* a meter's track has a 1px --line-strong edge, so its end (100%) is visible at 3:1 (.hm-meter: the home cards) */
.meter{height:12px;border-radius:999px;background:var(--surface-2);overflow:hidden;position:relative;box-shadow:inset 0 0 0 1px var(--line-strong)}
.hm-meter{box-shadow:inset 0 0 0 1px var(--line-strong)}
.meter i{display:block;height:100%;background:var(--accent);border-radius:999px}
.meter b{position:absolute;top:-4px;bottom:-4px;width:2px;background:var(--ink-2)}
.rows{display:grid;gap:14px}
/* T.barsH rows: the label keeps at least 14ch (or 45%) and the value wraps under itself, so the two never overlap;
   a comparison (.cmp) wraps as one piece. Phones stack label, value and bar. */
.rowline{display:grid;grid-template-columns:minmax(min(45%,14ch),1fr) minmax(0,max-content);gap:4px 12px;align-items:baseline}
.rowline>span:first-child{min-width:0;overflow-wrap:break-word}
.rowline>.num{text-align:right}
.rowline .cmp{display:inline-block;font-size:inherit;font-weight:400;color:var(--muted)}
.rowline .meter{grid-column:1/-1}
@media (max-width:519px){.rowline{grid-template-columns:minmax(0,1fr)}.rowline>.num{text-align:left}}

/* ---------- tables ---------- */
.tablewrap{overflow-x:auto;border:1px solid var(--line);border-radius:12px}
/* ---------- wide tables: scroll shadows (design review #11) ----------
   A shadow shows at each edge that has more table beyond it. The two --surface covers scroll with the table
   (attachment local) and hide each shadow once that end is reached; the shadows stay put (scroll). Cells keep no
   background of their own, so the shadows show through them. assets/npd.js ("wide tables") makes a box that
   overflows a focusable region named after its table. */
.tablewrap{background:
    linear-gradient(90deg,var(--surface) 30%,transparent) left/24px 100% no-repeat local,
    linear-gradient(270deg,var(--surface) 30%,transparent) right/24px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%,color-mix(in srgb,var(--ink) 18%,transparent),transparent) left/12px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%,color-mix(in srgb,var(--ink) 18%,transparent),transparent) right/12px 100% no-repeat scroll;
  background-color:var(--surface)}
table{border-collapse:collapse;width:100%;font-size:15px}
th,td{padding:10px 12px;text-align:left;border-bottom:1px solid var(--line);vertical-align:top}
th{font-size:13px;font-weight:650;color:var(--muted);background:var(--bg-2);position:sticky;top:0}
tr:last-child td{border-bottom:0}
td.r,th.r{text-align:right}
td.r,td.num{white-space:nowrap}
tbody tr:hover{background:var(--bg-2)}

/* ---------- charts ---------- */
.chart{width:100%;height:auto;display:block}
.chart text{fill:var(--muted);font-size:12px;font-family:var(--sans)}
.chart .ax{stroke:var(--line-2)}
.chart .gd{stroke:var(--grid)}
.chart .l1{stroke:var(--c1);fill:none;stroke-width:2.25}
.chart .l2{stroke:var(--c2);fill:none;stroke-width:2;stroke-dasharray:5 4}
/* earlier years: full --c2 (4.8:1 light, 3.8:1 dark) told apart by dash and width, not by fading below 3:1 */
.chart .l3{stroke:var(--c2);fill:none;stroke-width:1.75;stroke-dasharray:2 3}
.chart .l4{stroke:var(--c2);fill:none;stroke-width:1.5;stroke-dasharray:1 3}
.chart .a1{fill:var(--c1);opacity:.1}
.chart .dot{fill:var(--c1)}
.chart .lbl{fill:var(--ink);font-weight:600}
.chart .hov{stroke:var(--line-2);stroke-dasharray:3 3}
.legend{display:flex;flex-wrap:wrap;gap:16px;font-size:13.5px;color:var(--ink-2);margin-bottom:8px}
.legend i{display:inline-block;width:18px;height:3px;border-radius:2px;background:var(--c1);vertical-align:middle;margin-right:6px}
.legend i.c2{background:repeating-linear-gradient(90deg,var(--c2) 0 5px,transparent 5px 9px)}
.legend i.c3{background:repeating-linear-gradient(90deg,var(--c2) 0 2px,transparent 2px 5px)}
.legend i.c4{background:repeating-linear-gradient(90deg,var(--c2) 0 1.5px,transparent 1.5px 4.5px)}
.tip{position:absolute;pointer-events:none;background:var(--ink);color:var(--bg);font-size:13px;padding:6px 8px;border-radius:8px;white-space:nowrap;transform:translate(-50%,-110%);z-index:5}
.figure{position:relative;background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:16px 16px 12px}
.figure h3{margin-bottom:4px}
.figure .note{margin-top:8px}

/* ---------- key-value ---------- */
.kv{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,150px),1fr));gap:12px}
.kv div{background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:12px 14px}
.kv dt{font-size:13px;color:var(--muted);font-weight:600}
.kv dd{margin:4px 0 0;font-size:22px;font-weight:700;letter-spacing:-.01em}
.kv dd small{font-size:13px;font-weight:500;color:var(--muted);display:block;letter-spacing:0}
dl{margin:0}

/* ---------- breadcrumbs, lists ---------- */
.crumbs{font-size:14px;color:var(--muted);display:flex;flex-wrap:wrap;gap:6px}
.crumbs a{color:var(--muted)}
.crumbs a:hover{color:var(--ink)}
.plist{columns:3 220px;column-gap:24px;padding:0;margin:0;list-style:none}
.plist li{break-inside:avoid;padding:6px 0;border-bottom:1px solid var(--line);display:flex;justify-content:space-between;gap:8px}
.plist a{text-decoration:none;color:var(--ink)}
.plist a:hover{color:var(--accent-ink);text-decoration:underline}
.plist span{color:var(--muted);font-size:14px}

/* ---------- source note ---------- */
.srcnote{font-size:13px;color:var(--muted);margin-top:8px;line-height:1.45}
details.data{margin-top:8px}
details.data summary{cursor:pointer;font-size:14px;color:var(--accent-ink);font-weight:600;width:fit-content}
details.data summary:hover{color:var(--accent)}

/* ---------- buttons ---------- */
/* a 44px tap target that grows when a long label wraps (never a fixed height the text can spill out of) */
.btn{display:inline-flex;align-items:center;gap:8px;min-height:44px;height:auto;padding:8px 16px;line-height:1.25;text-align:center;border-radius:999px;border:1px solid var(--line-2);background:var(--surface);color:var(--ink);text-decoration:none;font-size:15px;font-weight:600;cursor:pointer;transition:background var(--ease),border-color var(--ease),color var(--ease)}
.btn:hover{background:var(--surface-2);color:var(--ink)}
.btn:active{background:var(--surface-3)}
.btn.primary{background:var(--accent);border-color:var(--accent);color:var(--on-accent)}
.btn.primary:hover{background:var(--accent-ink);border-color:var(--accent-ink);color:var(--on-accent)}
.btn[disabled]{opacity:.5;cursor:not-allowed}

/* ---------- loading / empty / error ---------- */
.skel{background:linear-gradient(90deg,var(--surface-2),var(--surface-3),var(--surface-2));background-size:200% 100%;animation:sk 1.2s ease-in-out infinite;border-radius:8px;min-height:20px}
@keyframes sk{0%{background-position:200% 0}100%{background-position:-200% 0}}
@media (prefers-reduced-motion:reduce){.skel{animation:none}*{transition:none!important}}
.empty,.error{padding:24px;border:1px dashed var(--line-2);border-radius:12px;color:var(--muted);text-align:center}
.error{border-color:color-mix(in srgb,var(--bad) 40%,transparent);color:var(--bad)}

/* ---------- footer ---------- */
.ftr{margin-top:48px;border-top:1px solid var(--line);background:var(--bg-2);padding-block:32px calc(32px + env(safe-area-inset-bottom,0px));font-size:14px;color:var(--muted)}
.ftr .cols{display:flex;flex-wrap:wrap;gap:16px 32px;justify-content:space-between}
.ftr nav{display:flex;flex-wrap:wrap;gap:8px 16px}
.ftr a{color:var(--ink-2);text-decoration:none;display:inline-block;padding-block:10px}
.ftr a:hover{color:var(--ink);text-decoration:underline}
.ftr nav.other-sites{flex-basis:100%;align-items:baseline}
.ftr .other-sites b{padding-block:10px;color:var(--ink-2);font-weight:600}
.notice{display:flex;gap:8px;align-items:flex-start;max-width:60ch}
.notice b{color:var(--ink-2)}

/* ---------- utility ---------- */
.stack{display:grid;gap:16px}
.stack>*{min-width:0}
.two{display:grid;gap:16px;grid-template-columns:repeat(auto-fit,minmax(min(100%,420px),1fr))}
.three{display:grid;gap:16px;grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr))}
.mt8{margin-top:8px}.mt16{margin-top:16px}.mt24{margin-top:24px}.mt32{margin-top:32px}
.row{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.pill{font-size:13px;color:var(--muted)}

/* ---------- language: every bilingual text carries both, one shows ---------- */
html:not([data-lang="ne"]) .ne{display:none!important}
html[data-lang="ne"] .en{display:none!important}
html[data-lang="ne"] body{font-size:17.5px;line-height:1.6}

/* ---------- grouped lists (corrections page) ---------- */
.igroup{border:1px solid var(--line);border-radius:12px;background:var(--surface);margin-top:12px}
.igroup>summary{cursor:pointer;padding:14px 16px;list-style:none;display:flex;gap:6px;flex-wrap:wrap;align-items:baseline;border-radius:12px;transition:background var(--ease)}
.igroup>summary::-webkit-details-marker{display:none}
.igroup>summary::before{content:"";flex:none;width:7px;height:7px;border-right:2px solid var(--muted);border-bottom:2px solid var(--muted);transform:rotate(-45deg);margin-right:8px;align-self:center;transition:transform var(--ease)}
.igroup[open]>summary::before{transform:rotate(45deg)}
.igroup>summary:hover{background:var(--surface-2)}
.ilist{margin:0;padding:0 16px 8px 40px}
.ilist li{padding:12px 0;border-top:1px solid var(--line)}
.ilist li p{max-width:75ch}
.ilist li p+p{margin-top:4px}

/* ---------- sources page ---------- */
.src-group+.src-group{margin-top:32px}
.src-list{list-style:none;margin:16px 0 0;padding:0;display:grid;gap:10px}
/* scoped to the Sources page's list: a bare .src is the one-line source of a card (.card .src) */
.src-list>.src{border:1px solid var(--line);border-radius:12px;background:var(--surface);padding:14px 16px;display:grid;gap:4px;min-width:0;scroll-margin-top:150px;transition:border-color var(--ease),background var(--ease)}
.src-list>.src.hit{border-color:var(--accent);background:var(--accent-soft)}
.src-t{font-weight:600}
.src-sha code{font-family:var(--mono);font-size:11.5px;word-break:break-all}
.src-open{font-size:14px;font-weight:600;width:fit-content;padding-block:6px}

/* ---------------- copy and share charts (assets/share.js) ---------------- */
.sh-bar{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px}
.sh-b{display:inline-flex;align-items:center;gap:6px;min-height:32px;padding:4px 10px;border:1px solid var(--line);border-radius:999px;
  background:var(--surface);color:var(--ink-2);font:inherit;font-size:12.5px;font-weight:550;cursor:pointer;
  transition:background-color .15s ease,border-color .15s ease,color .15s ease}
.sh-b svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.sh-b:hover{background:var(--surface-2);border-color:var(--line-2);color:var(--ink)}
.sh-b:active{background:var(--surface-3)}
.sh-b:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.sh-b[aria-busy="true"]{opacity:.6;cursor:progress}
.sh-b:disabled{opacity:.45;cursor:not-allowed}
.sh-toast{position:fixed;left:50%;bottom:calc(20px + env(safe-area-inset-bottom,0px));transform:translate(-50%,12px);z-index:60;
  padding:10px 16px;border-radius:12px;background:var(--ink);color:var(--bg);font-size:13.5px;font-weight:550;
  box-shadow:0 6px 24px rgba(0,0,0,.18);opacity:0;pointer-events:none;transition:opacity .15s ease,transform .15s ease}
.sh-toast.on{opacity:1;transform:translate(-50%,0)}
/* copy or share one figure (assets/share.js facts): two quiet icon buttons in a card's top corner, above its
   stretched link; on the figure page's hero, the labelled buttons of the chart toolbar */
.has-fx{position:relative}
.fx-bar{position:absolute;top:8px;right:8px;z-index:2;display:flex;gap:2px}
.fx-b{display:inline-grid;place-items:center;width:34px;height:34px;padding:0;border:1px solid transparent;border-radius:10px;
  background:transparent;color:var(--muted);cursor:pointer;transition:background-color .15s ease,border-color .15s ease,color .15s ease}
.fx-b svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.fx-b:hover{background:var(--surface-2);border-color:var(--line);color:var(--ink)}
.fx-b:active{background:var(--surface-3)}
.fx-b:focus-visible{outline:2px solid var(--accent);outline-offset:1px;color:var(--ink)}
.fx-b[aria-busy="true"]{opacity:.6;cursor:progress}
.kpi.has-fx .kpi-a,.pl-tile.has-fx h3{padding-right:68px}
.fx-bar.fx-wide{position:static;margin-top:12px}
/* one Share button under each chart and its menu (assets/share.js enhance) */
.sh-bar{position:relative}
.sh-main{min-height:40px}
.sh-menu{position:absolute;left:0;top:calc(100% + 6px);z-index:30;display:grid;min-width:220px;padding:6px;border:1px solid var(--line);
  border-radius:12px;background:var(--surface);box-shadow:0 10px 30px rgba(15,23,42,.16)}
.sh-menu[hidden]{display:none}
.sh-menu.up{top:auto;bottom:calc(100% + 6px)}
.sh-mi{display:flex;align-items:center;gap:10px;min-height:44px;padding:0 12px;border:0;border-radius:8px;background:transparent;
  color:var(--ink);font:inherit;font-size:14px;text-align:left;cursor:pointer}
.sh-mi svg{width:17px;height:17px;flex:none;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;color:var(--muted)}
.sh-mi:hover,.sh-mi:focus-visible{background:var(--surface-2);outline:none}
.sh-mi:focus-visible{box-shadow:inset 0 0 0 2px var(--accent)}
@media (prefers-reduced-motion:reduce){.sh-b,.sh-toast,.fx-b{transition:none}}
@media print{.sh-bar,.fx-bar{display:none}}
/* figures that are not the government's own (site_src/origins.json): a plain label before the source line */
.ng{display:inline-block;font-weight:600;color:var(--warn-ink);border:1px solid currentColor;border-radius:4px;padding:0 5px;margin-right:4px;font-size:.95em;line-height:1.45}

/* ---------- what "Provisional" and "Calculated" mean (design review #8, quick win 14) ----------
   assets/npd.js ("status words") puts one line, in both languages, under the first place on the page where each
   badge appears. */
.npd-def{display:block;flex-basis:100%;margin:8px 0 0;max-width:72ch;font-size:13px;font-weight:400;line-height:1.45;color:var(--muted);text-align:left}
.npd-def b{font-weight:600;color:var(--ink-2)}
.npd-def+.npd-def{margin-top:2px}

/* ---------- Nepali reading (design review #15, quick win 15) ----------
   Devanagari needs room above and below for its vowel signs, and any letter-spacing breaks the top bar (shirorekha)
   that joins the letters of a word; capitals-only styles do nothing for it. Small text reads smaller than Latin at the
   same size, so the smallest sizes go up to 13.5px. Each :is() list names the most specific rule it overrides, which
   lets these win over the page stylesheets that load after this one. Charts drawn by assets/charts.js already use a
   larger size in Nepali (13 or 14px). */
html[data-lang="ne"] :is(h1,h2,h3){line-height:1.3;letter-spacing:0}
html[data-lang="ne"] :is(.story.st-hero h1,.thead h1,.tsec>h2,.tcard .tname,.st-line,.p100-say,.rp-card-t,.rp-banner-t,.rc-title,.rp-doc-t){line-height:1.3;letter-spacing:0}
html[data-lang="ne"] .st-num{letter-spacing:0;line-height:1.12}
html[data-lang="ne"] :is(.head .kicker,.story .kicker,.kicker,.rp-banner-k,.brief-h,.hm-dk,.badge,.rp-doc-p,.rp-dl dt,.rc-kick,.mx-side h3,.rp-years-l){letter-spacing:0;text-transform:none}
html[data-lang="ne"] :is(.fig .srcnote,.kpi .spk .spkc,.card .src,.srcnote,.xs,.badge,.npc-key,.npc-note,.npd-def){font-size:13.5px}
html[data-lang="ne"] .chart text{font-size:13px}

/* ================================================================ header, menu sheet and in-page navigation
   (scripts: assets/npd.js, "header and in-page navigation"; markup: pipeline/pages.py shell)
   - One header row at every width. From 1180 px the nine sections sit in it; below, the Menu button (#menubtn)
     opens the same <nav> (#site-nav) as a sheet under the header. Phones (719 px and narrower) get brand, search,
     EN/ने and Menu; the theme switch is the sheet's last row (.nav-theme) instead of #themebtn.
   - The header hides while the reader scrolls down and comes back on any scroll up or focus (.hdr.is-away;
     html.hdr-away sets --hdr-vis to 0). Anything sticky under it uses top:var(--hdr-vis), as .tocbar and .pl-nav do.
   - Jumps (an #anchor, scrollIntoView, the skip link) land below the header and a sticky chip bar: one offset from
     the measured --hdr and --subnav, so no section needs its own scroll-margin-top. It sits on the targets (anything
     with an id in <main>, but not links, fields or listbox options), not as html scroll-padding: with scroll-padding,
     Chrome scrolls the page half a screen up whenever focus enters the sticky header or a sticky chip bar.
   - Chip rows that scroll fade at an edge with more chips (.ovf-l, .ovf-r); back to top (.totop) after two screens. */
:target,main,main [id]:not(a,button,input,select,textarea,summary,[role="option"]){
  scroll-margin-top:calc(var(--hdr) + var(--subnav,0px) + env(safe-area-inset-top,0px) + 12px)}
html.hdr-away{--hdr-vis:0px}
.hdr{transition:transform var(--ease)}
.hdr.is-away{transform:translateY(calc(-100% - env(safe-area-inset-top,0px)))}
.brand .bw{white-space:nowrap}
#menubtn,.nav-theme{display:none}
#menubtn svg{width:20px;height:20px}
#menubtn .i-close,#menubtn[aria-expanded="true"] .i-menu{display:none}
#menubtn[aria-expanded="true"] .i-close{display:block}
#menubtn[aria-expanded="true"]{background:var(--surface-2);border-color:var(--line-2)}
/* desktop: all nine sections on one line (1180 px is the narrowest; labels stay short, see NAV in pages.py) */
@media (min-width:1180px) and (max-width:1279px){
  .hdr .bar{gap:8px}
  .brand{font-size:17px}
  .nav{gap:2px;margin-left:4px}
  .nav a{padding:8px 6px;font-size:14.5px}
  .tools{gap:6px}
}
@media (min-width:1280px){
  .nav{gap:2px}
  .nav a{padding:8px 6px;font-size:14.5px}
}
/* below 1180 px: the sections open from the Menu button as a sheet; the page behind is dimmed and does not scroll */
@media (max-width:1179px){
  .npd-js #menubtn{display:inline-grid}
  .npd-js .hdr .nav{display:none}
  .npd-js .hdr.menu-open .nav{position:absolute;left:0;right:0;top:100%;z-index:2;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));
    gap:8px;margin:1px 0 0;padding:12px max(var(--gut),env(safe-area-inset-right,0px)) 16px max(var(--gut),env(safe-area-inset-left,0px));
    max-height:calc(100vh - var(--hdr) - env(safe-area-inset-top,0px));max-height:calc(100dvh - var(--hdr) - env(safe-area-inset-top,0px));
    overflow:auto;overscroll-behavior:contain;background:var(--bg);border-bottom:1px solid var(--line);
    box-shadow:0 16px 32px rgba(15,23,42,.14);animation:npd-sheet var(--ease)}
  .npd-js .hdr.menu-open .nav a{display:flex;align-items:center;min-height:48px;padding:4px 16px;border-radius:12px;background:var(--surface-2);
    color:var(--ink);font-size:16px;font-weight:600;line-height:1.25;white-space:normal}
  .npd-js .hdr.menu-open .nav a:hover{background:var(--surface-3);color:var(--ink)}
  .npd-js .hdr.menu-open .nav a[aria-current="page"]{background:var(--accent-soft);color:var(--accent-ink)}
  .menu-scrim{position:absolute;left:0;right:0;top:100%;z-index:1;height:100vh;height:100dvh;margin-top:1px;background:rgba(15,23,42,.4);
    touch-action:none;animation:npd-fade var(--ease)}
}
@media (min-width:1180px){.menu-scrim{display:none}}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]) .menu-scrim{background:rgba(0,0,0,.55)}}
:root[data-theme="dark"] .menu-scrim{background:rgba(0,0,0,.55)}
html.menu-lock{overflow:hidden;scrollbar-gutter:stable}
html.menu-lock body{overflow:visible}   /* body's overflow-x would otherwise make it the scroller and unstick the header */
@keyframes npd-sheet{from{opacity:0;transform:translateY(-8px)}}
@keyframes npd-fade{from{opacity:0}}
/* phones: one 56 px row. The brand shrinks a little, and on the narrowest screens its second word group wraps
   ("Nepal / Public Data") rather than pushing the buttons off screen */
@media (max-width:719px){
  .hdr .bar{gap:8px}
  .brand{gap:6px;font-size:clamp(15px,4.2vw,17px);line-height:1.1;white-space:normal}
  html[data-lang="ne"] .brand{line-height:1.3}
  .tools{gap:4px}
  .seg button{min-width:32px;padding:6px 8px}
  .npd-js #themebtn{display:none}
  .npd-js .hdr.menu-open .nav{grid-template-columns:repeat(2,minmax(0,1fr))}
  .npd-js .hdr.menu-open .nav-theme{grid-column:1/-1;display:flex;align-items:center;gap:12px;min-height:48px;margin-top:4px;padding:4px 16px;
    border:1px solid var(--line);border-radius:12px;background:transparent;color:var(--ink);font-size:16px;font-weight:600;text-align:left;cursor:pointer}
}
.nav-theme svg{width:18px;height:18px;flex:none;color:var(--ink-2)}
.nav-theme:hover{background:var(--surface-2)}
.nav-sw{position:relative;flex:none;width:40px;height:24px;margin-left:auto;border-radius:999px;background:var(--line-strong,var(--line-2));transition:background-color var(--ease)}
.nav-sw::after{content:"";position:absolute;top:3px;left:3px;width:18px;height:18px;border-radius:50%;background:var(--surface);transition:transform var(--ease)}
.nav-theme[aria-pressed="true"] .nav-sw{background:var(--accent)}
.nav-theme[aria-pressed="true"] .nav-sw::after{transform:translateX(16px)}
/* chip rows that scroll sideways: fade the edge that has more; keep a focused chip clear of the fade */
.ovf-r{-webkit-mask-image:linear-gradient(90deg,#000 calc(100% - 32px),transparent);mask-image:linear-gradient(90deg,#000 calc(100% - 32px),transparent)}
.ovf-l{-webkit-mask-image:linear-gradient(90deg,transparent,#000 32px);mask-image:linear-gradient(90deg,transparent,#000 32px)}
.ovf-l.ovf-r{-webkit-mask-image:linear-gradient(90deg,transparent,#000 32px,#000 calc(100% - 32px),transparent);
  mask-image:linear-gradient(90deg,transparent,#000 32px,#000 calc(100% - 32px),transparent)}
.npd-js :is(.toc,.tocbar .toc,.pl-chips,.ct-jump,.rp-segnav,.m-toc){scroll-padding-inline:40px}
/* back to top: bottom right, clear of the home indicator and notches */
.totop{position:fixed;right:calc(16px + env(safe-area-inset-right,0px));bottom:calc(16px + env(safe-area-inset-bottom,0px));z-index:25;
  display:grid;place-items:center;width:44px;height:44px;border-radius:999px;border:1px solid var(--line-strong,var(--line-2));
  background:var(--surface);color:var(--ink-2);box-shadow:var(--shadow);text-decoration:none;opacity:0;visibility:hidden;transform:translateY(8px);
  transition:opacity var(--ease),transform var(--ease),visibility 0s linear 150ms,background-color var(--ease)}
.totop.on{opacity:1;visibility:visible;transform:none;transition:opacity var(--ease),transform var(--ease),visibility 0s,background-color var(--ease)}
.totop:hover{background:var(--surface-2);color:var(--ink)}
.totop svg{width:20px;height:20px}
html:not(.npd-js) .totop{display:none}
@media (prefers-reduced-motion:reduce){.npd-js .hdr.menu-open .nav,.menu-scrim{animation:none}}
@media print{.hdr{position:static;transform:none}.totop,#menubtn,.menu-scrim{display:none!important}}
