/* NHS Payments to General Practice - Funding Intelligence dashboard.
 *
 * Phase 4C.47A. The monolith's `<style>` block from website/nhs_payments.html, taken at monolith commit
 * cb02cf0 with no selector, value or colour changed except: `--theme`, the monolith site's variable,
 * which the shell does not define, is `--np-theme` here; the three `i` selectors (Font Awesome glyphs
 * there, inline SVG here), which are the same declarations on `svg`; and `.np-wrap`, whose 1180px
 * marketing column is the normal full-width tool layout (the shell supplies the gutter). The
 * additions are at the end and are listed there: they exist because the Content Security Policy admits
 * no style attribute and no inline style element, so the monolith's were moved here. The picker's chip
 * and modal are `tools/shared/static/tools/shared/picker.v1.css`, not this file.
 */
  :root { --np-border:#e6ebf1; --np-ink:#0f172a; --np-mut:#64748b; --np-soft:#94a3b8;
          --np-good:#15803d; --np-goodbg:#e8f6ec; --np-bad:#b91c1c; --np-badbg:#fdeaea;
          --np-neutralbg:#eef1f6;
          --np-practice:#0d5bb8; --np-pcn:#16a085; --np-icb:#8e44ad; --np-region:#e67e22; --np-national:#94a3b8; }

  .np-wrap { max-width:none; margin:0; padding:0; }
  .np-eyebrow { font-size:11px; font-weight:800; letter-spacing:.09em; text-transform:uppercase; color:var(--np-theme); margin:0 0 3px; }
  .np-lead { color:var(--np-mut); font-size:15px; margin:0 0 22px; max-width:780px; }

  .np-attribution { background:#f6f8fc; border:1px solid var(--np-border); border-left:3px solid var(--np-theme); border-radius:8px; padding:14px 18px; font-size:13px; color:#4b5563; margin-bottom:24px; }

  .np-card { background:#fff; border:1px solid var(--np-border); border-radius:12px; padding:22px 24px; margin-bottom:18px; }
  .np-h { font-size:16px; font-weight:800; color:var(--np-ink); margin:0 0 6px; }
  .np-sub { color:var(--np-mut); font-size:12.5px; margin:0 0 16px; }

  /* mode toggle + controls */
  .np-controls { display:flex; align-items:center; gap:16px; flex-wrap:wrap; }
  .np-modes { display:inline-flex; background:#eef2f7; border-radius:10px; padding:4px; }
  .np-mode { border:none; background:none; padding:9px 20px; font-size:13.5px; font-weight:700; color:var(--np-mut); border-radius:8px; cursor:pointer; }
  .np-mode.active { background:#fff; color:var(--np-ink); box-shadow:0 1px 3px rgba(15,23,42,.12); }
  .np-ctl-label { font-size:11px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--np-mut); }
  .np-year { padding:10px 14px; font-size:14px; font-weight:700; border:1px solid #d1d9e0; border-radius:8px; background:#fff; color:var(--np-ink); cursor:pointer; }

  .np-context { display:flex; justify-content:space-between; align-items:flex-end; flex-wrap:wrap; gap:10px; border-bottom:1px solid var(--np-border); padding-bottom:16px; margin-bottom:18px; }
  .np-context h2 { font-size:22px; font-weight:800; color:var(--np-ink); margin:0; }
  .np-context .meta { color:var(--np-mut); font-size:13px; margin-top:4px; }
  .np-context .code { color:var(--np-soft); font-weight:600; font-size:14px; }

  /* KPI band */
  .np-kpis { display:grid; grid-template-columns:repeat(auto-fit,minmax(190px,1fr)); gap:14px; margin-bottom:20px; }
  .np-kpi { border:1px solid var(--np-border); border-radius:11px; padding:15px 17px; }
  .np-kpi .lbl { font-size:10px; font-weight:800; letter-spacing:.05em; text-transform:uppercase; color:var(--np-mut); }
  .np-kpi .big { font-size:1.7rem; font-weight:800; color:var(--np-ink); line-height:1.1; margin-top:4px; }
  .np-kpi .big small { font-size:.95rem; color:var(--np-soft); font-weight:700; }
  .np-kpi .sub { font-size:11.5px; color:var(--np-soft); margin-top:4px; }
  .np-kpi.accent { background:linear-gradient(135deg,#0d3b6e,#0d5bb8); border:none; color:#fff; }
  .np-kpi.accent .lbl, .np-kpi.accent .sub { color:rgba(255,255,255,.82); }
  .np-kpi.accent .big { color:#fff; }
  .np-kpi.good .big { color:var(--np-good); } .np-kpi.bad .big { color:var(--np-bad); }

  .np-legend { display:flex; gap:16px; flex-wrap:wrap; align-items:center; font-size:11.5px; color:var(--np-mut); margin:6px 0 14px; }
  .np-legend .dot { width:18px; height:10px; border-radius:3px; display:inline-block; vertical-align:middle; margin-right:5px; }

  .np-grid2 { display:grid; grid-template-columns:1.3fr 1fr; gap:18px; }
  @media (max-width:820px){ .np-grid2 { grid-template-columns:1fr; } }
  .np-chart-box { position:relative; }

  table.np-table { width:100%; border-collapse:collapse; font-size:13px; }
  table.np-table th, table.np-table td { padding:10px 12px; text-align:left; border-bottom:1px solid #eef2f7; }
  table.np-table th { font-size:10.5px; text-transform:uppercase; letter-spacing:.05em; color:var(--np-mut); font-weight:800; cursor:pointer; white-space:nowrap; }
  table.np-table th.num, table.np-table td.num { text-align:right; font-variant-numeric:tabular-nums; }
  table.np-table tr:hover td { background:#fafcff; }
  table.np-table tr.me td { background:#eef6ff !important; font-weight:700; }
  .np-bar-mini { height:7px; border-radius:4px; background:var(--np-pcn); display:inline-block; vertical-align:middle; }

  .np-chip { font-size:11px; font-weight:700; border-radius:20px; padding:2px 9px; white-space:nowrap; }
  .np-chip.good { background:var(--np-goodbg); color:var(--np-good); }
  .np-chip.bad  { background:var(--np-badbg);  color:var(--np-bad);  }
  .np-chip.neutral { background:var(--np-neutralbg); color:var(--np-mut); }

  .np-panel { border:1px solid var(--np-border); border-radius:12px; margin:18px 0; overflow:hidden; }
  .np-panel > summary { list-style:none; cursor:pointer; padding:14px 18px; display:flex; align-items:center; gap:10px; font-size:14px; font-weight:800; color:var(--np-ink); }
  .np-panel > summary::-webkit-details-marker { display:none; }
  .np-panel > summary .chev { margin-left:auto; transition:transform .2s; color:var(--np-theme); }
  .np-panel[open] > summary .chev { transform:rotate(90deg); }
  .np-panel > summary .pill { font-size:11px; font-weight:600; color:var(--np-soft); }
  .np-panel-inner { padding:6px 18px 22px; }

  /* category detail cards */
  .np-cards { display:grid; grid-template-columns:repeat(2,1fr); gap:16px; }
  @media (max-width:760px){ .np-cards { grid-template-columns:1fr; } }
  .np-dcard { border:1px solid var(--np-border); border-radius:12px; padding:16px 18px; border-top:3px solid; }
  .np-dcard .dc-head { display:flex; align-items:center; gap:10px; margin-bottom:10px; }
  .np-dcard .dc-head svg { font-size:16px; }
  .np-dcard .dc-title { font-size:14px; font-weight:800; color:var(--np-ink); flex:1; }
  .np-dcard .dc-amt { font-size:1.5rem; font-weight:800; color:var(--np-ink); line-height:1.1; }
  .np-dcard .dc-amt small { font-size:.85rem; color:var(--np-soft); font-weight:700; }
  .np-dcard .dc-meta { display:flex; gap:10px; flex-wrap:wrap; font-size:11.5px; color:var(--np-mut); margin:6px 0 12px; }
  .np-dcard .dc-scopes { display:grid; grid-template-columns:repeat(6,1fr); gap:4px; margin-bottom:12px; }
  .np-dcard .dc-sc { text-align:center; }
  .np-dcard .dc-sc .b { height:42px; display:flex; align-items:flex-end; }
  .np-dcard .dc-sc .b span { width:100%; border-radius:3px 3px 0 0; display:block; }
  .np-dcard .dc-sc .l { font-size:8.5px; font-weight:700; text-transform:uppercase; color:var(--np-soft); margin-top:3px; }
  .np-dcard .dc-sc .v { font-size:9.5px; font-weight:700; color:var(--np-mut); }
  .np-dcard table.dc-lines { width:100%; font-size:12px; border-collapse:collapse; }
  .np-dcard table.dc-lines td { padding:5px 4px; border-bottom:1px solid #f1f5f9; }
  .np-dcard table.dc-lines td.num { text-align:right; font-variant-numeric:tabular-nums; }
  .np-dcard table.dc-lines td .d-up { color:var(--np-good); font-weight:700; }
  .np-dcard table.dc-lines td .d-dn { color:var(--np-bad); font-weight:700; }

  /* compare */
  .np-compare-chips { display:flex; gap:8px; flex-wrap:wrap; }
  .np-csearch { position:relative; max-width:520px; }
  .np-csearch > svg { position:absolute; left:12px; top:50%; transform:translateY(-50%); color:#b6bfc8; font-size:13px; }
  .np-csearch input { width:100%; padding:11px 14px 11px 34px; border:1px solid #d1d9e0; border-radius:9px; font-size:14px; color:var(--np-ink); background:#fff; }
  .np-csearch input:focus { outline:none; border-color:var(--np-theme); box-shadow:0 0 0 3px rgba(13,91,184,.08); }
  .np-ac { position:absolute; top:100%; left:0; right:0; z-index:40; background:#fff; border:1px solid var(--np-border); border-radius:9px; margin-top:5px; max-height:300px; overflow:auto; box-shadow:0 14px 34px rgba(15,23,42,.16); display:none; }
  .np-ac.show { display:block; }
  .np-ac-item { padding:10px 13px; cursor:pointer; font-size:13px; border-bottom:1px solid #f3f6f9; display:flex; gap:11px; align-items:center; }
  .np-ac-item:last-child { border-bottom:none; }
  .np-ac-item:hover, .np-ac-item.active { background:#f0f6ff; }
  .np-ac-item .c { font-size:11px; font-weight:800; color:var(--np-theme); min-width:56px; }
  .np-ac-item .n { flex:1; color:var(--np-ink); }
  .np-ac-item .n .s { color:var(--np-soft); font-size:11px; display:block; }
  .np-ac-item.dim { color:var(--np-soft); cursor:default; }
  .np-ac-empty { padding:14px 13px; color:var(--np-soft); font-size:12.5px; text-align:center; }
  .np-cchip { display:inline-flex; align-items:center; gap:8px; padding:7px 12px; border:1px solid var(--np-border); border-radius:20px; font-size:12.5px; font-weight:700; color:var(--np-ink); background:#fff; }
  .np-cchip .x { cursor:pointer; color:var(--np-soft); font-weight:800; }
  .np-cchip .x:hover { color:var(--np-bad); }
  .np-cchip .sw { width:10px; height:10px; border-radius:50%; }

  .np-report-btn { display:inline-flex; align-items:center; gap:7px; margin-top:8px; padding:8px 14px;
    background:var(--np-theme); color:#fff; font-size:12.5px; font-weight:700; border-radius:8px;
    text-decoration:none; transition:background .15s; }
  .np-report-btn:hover { background:#0a4a96; color:#fff; }
  .np-report-btn svg { font-size:14px; }

  .np-empty { text-align:center; color:var(--np-mut); padding:48px 20px; }
  .np-msg { display:none; padding:14px 18px; border-radius:8px; font-size:13.5px; margin-bottom:16px; }
  .np-msg.err { display:block; background:var(--np-badbg); color:var(--np-bad); }
  .np-loading { display:none; text-align:center; color:var(--np-mut); padding:40px; font-size:14px; }
  .np-spin { width:34px; height:34px; border:3px solid #e3e9f0; border-top-color:var(--np-theme); border-radius:50%; animation:npspin .8s linear infinite; margin:0 auto 12px; }
  @keyframes npspin { to { transform:rotate(360deg); } }

/* ---- Phase 4C.47A additions ---------------------------------------------------------------------
 * Each replaces a `style=""` attribute of the source's template, with the same declarations. */
:root { --np-theme:#0d5bb8; }
.np-ico { width:1em; height:1em; vertical-align:-.125em; fill:none; stroke:currentColor; stroke-width:2;
  stroke-linecap:round; stroke-linejoin:round; flex:none; }
[data-np-hidden] { display:none; }
.np-title { font-size:28px; font-weight:800; color:var(--np-ink); margin:0 0 6px; }
.np-chipwrap { display:inline-flex; }
.np-chipwrap[hidden] { display:none; }
.np-yearwrap { display:flex; align-items:center; gap:8px; }
.np-pcn-views { margin-top:14px; }
.np-pcn-note { margin:10px 0 0; }
.np-panel > summary > .np-ico:first-child { color:var(--np-theme); }
.np-ctx-right { text-align:right; }
.np-h300 { height:300px; } .np-h320 { height:320px; } .np-h340 { height:340px; }
.np-h360 { height:360px; } .np-h380 { height:380px; }
/* the source's wrapper is `display:flex; gap:10px` inline, and its script then clears that display (`sel.parentElement.style.display = ""`),
   so what a reader sees is block flow; the wrapper here is block from the start and the script's clearing is a no-op */
.np-trend-controls { align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:10px; }
.np-trend-stream { min-width:260px; }
.np-realterms-wrap { align-items:center; gap:6px; font-size:12.5px; font-weight:700; color:var(--np-mut); cursor:pointer; }
.np-realterms-base { color:var(--np-soft); font-weight:600; }
.np-m0 { margin:0; }
.np-realterms-note { margin:-4px 0 10px; background:#f6f8fc; border-left:3px solid var(--np-theme); border-radius:6px; padding:8px 12px; }
.np-realterms-note .np-ico { color:var(--np-theme); }
.np-dist-controls { display:flex; align-items:center; gap:14px; flex-wrap:wrap; margin-bottom:10px; }
.np-mt16 { margin-top:16px; }
.np-xscroll { overflow-x:auto; margin-top:18px; }
.np-xscroll-bare { overflow-x:auto; }
.np-mb10 { margin-bottom:10px; }
.np-mt12 { margin-top:12px; }
.np-mt14 { margin-top:14px; }
.np-code-soft { color:var(--np-soft); font-size:11px; }
.np-cell-soft { color:var(--np-soft); font-size:12px; }
.np-bad-text { color:var(--np-bad); font-weight:700; }
.np-good-text { color:var(--np-good); font-weight:700; }
.np-th-head { font-weight:700; color:var(--np-mut); }
.np-w120 { width:120px; }
.np-ico-w18 { width:18px; }
.np-softnote { color:var(--np-soft); }
/* the inline compare search's glyph sits where the source's `<i>` did */
.np-csearch > .np-ico { position:absolute; left:12px; top:50%; transform:translateY(-50%); color:#b6bfc8; }
.np-report-btn .np-ico { font-size:14px; }
.np-dcard .dc-head .np-ico { font-size:16px; }
