/* Digital Front Door.
 *
 * Calculator batch. The monolith's `<style>` block from website/digital_front_door.html and the shared
 * entity picker's `<style>` block from website/partials/_entity_picker.html, taken at monolith commit
 * cb02cf0 with no selector, value or colour changed except the four `i` selectors (Font Awesome glyphs
 * there, inline SVG here), which are the same declarations on `svg`. 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.
 */
  :root { --df-border:#e6ebf1; --df-ink:#0f172a; --df-mut:#64748b; --df-soft:#94a3b8;
          --df-good:#15803d; --df-bad:#b91c1c; --df-blue:#0d5bb8; }
  .df-wrap { max-width:1160px; margin:0 auto; padding:30px 20px 70px; }
  .df-lead { color:var(--df-mut); font-size:15px; margin:0 0 16px; max-width:840px; }
  .df-note { background:#f6f8fc; border:1px solid var(--df-border); border-left:3px solid var(--df-blue);
    border-radius:8px; padding:13px 17px; font-size:13px; color:#4b5563; margin-bottom:18px; }
  .df-card { background:#fff; border:1px solid var(--df-border); border-radius:12px; padding:20px 22px; margin-bottom:18px; }
  .df-h { font-size:16px; font-weight:800; color:var(--df-ink); margin:0 0 4px; }
  .df-sub { color:var(--df-mut); font-size:12.5px; margin:0 0 14px; }

  .df-controls { display:flex; align-items:center; gap:16px; flex-wrap:wrap; min-height:46px; }
  .df-modes { display:inline-flex; background:#eef2f7; border-radius:10px; padding:4px; }
  .df-mode { border:none; background:none; padding:9px 20px; font-size:13.5px; font-weight:700; color:var(--df-mut); border-radius:8px; cursor:pointer; }
  .df-mode.active { background:#fff; color:var(--df-ink); box-shadow:0 1px 3px rgba(15,23,42,.12); }
  .df-monthwrap { display:inline-flex; align-items:center; gap:9px; margin-left:auto; }
  .df-ctl-label { font-size:11px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--df-mut); }
  .df-month { padding:11px 14px; font-size:14px; font-weight:700; border:1px solid #d1d9e0; border-radius:10px; background:#fff; color:var(--df-ink); cursor:pointer; }
  .df-msg { display:none; }
  .df-msg.err { display:block; background:#fdeaea; color:var(--df-bad); border-radius:8px; padding:11px 15px; font-size:13.5px; margin:14px 0; }

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

  /* hero score */
  .df-hero { display:grid; grid-template-columns:230px 1fr; gap:24px; align-items:center; }
  @media (max-width:720px){ .df-hero { grid-template-columns:1fr; } }
  .df-gauge { position:relative; }
  .df-score-num { position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; }
  .df-score-num .v { font-size:2.8rem; font-weight:800; color:var(--df-ink); line-height:1; }
  .df-score-num .l { font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:.06em; margin-top:4px; }
  .df-hero-txt .band { font-size:1.3rem; font-weight:800; }
  .df-hero-txt p { color:var(--df-mut); font-size:13.5px; margin:8px 0 0; max-width:560px; }
  .df-hero-meta { display:flex; gap:22px; margin-top:14px; flex-wrap:wrap; }
  .df-hero-meta .m .k { font-size:10px; font-weight:800; text-transform:uppercase; letter-spacing:.05em; color:var(--df-mut); }
  .df-hero-meta .m .x { font-size:1.1rem; font-weight:800; color:var(--df-ink); }

  /* channel cards */
  .df-channels { display:grid; grid-template-columns:repeat(3,1fr); gap:16px; }
  @media (max-width:820px){ .df-channels { grid-template-columns:1fr; } }
  .df-ch { border:1px solid var(--df-border); border-radius:12px; padding:18px; display:flex; flex-direction:column; }
  .df-ch .top { display:flex; align-items:center; gap:11px; }
  .df-ch .ic { width:40px; height:40px; border-radius:10px; background:#eef6ff; color:var(--df-blue); display:flex; align-items:center; justify-content:center; font-size:18px; }
  .df-ch .nm { font-size:14.5px; font-weight:800; color:var(--df-ink); }
  .df-ch .big { font-size:2rem; font-weight:800; color:var(--df-ink); margin:12px 0 2px; }
  .df-ch .big small { font-size:.9rem; color:var(--df-soft); font-weight:700; }
  .df-ch .desc { font-size:12px; color:var(--df-soft); margin:4px 0 12px; flex:1; }
  .df-ch .bench { font-size:11.5px; color:var(--df-mut); }
  .df-pill { display:inline-block; padding:3px 10px; border-radius:20px; font-size:11.5px; font-weight:800; }
  .df-pill.good { background:#e8f6ec; color:var(--df-good); }
  .df-pill.mid { background:#fef6e7; color:#b45309; }
  .df-pill.bad { background:#fdeaea; color:var(--df-bad); }
  .df-pill.na { background:#eef1f6; color:var(--df-soft); }
  .df-ch a.link { margin-top:12px; font-size:12.5px; font-weight:700; color:var(--df-blue); text-decoration:none; }
  .df-ch a.link svg { font-size:11px; }
  .df-ch.unavailable { opacity:.62; }

  .df-grid2 { display:grid; grid-template-columns:1fr 1fr; gap:18px; }
  @media (max-width:820px){ .df-grid2 { grid-template-columns:1fr; } }
  .df-chart-box { position:relative; min-height:320px; }
  .df-empty { text-align:center; color:var(--df-soft); padding:60px 20px; font-size:15px; }

  /* insights */
  .df-ins { display:flex; gap:13px; padding:12px 0; border-bottom:1px solid #f1f4f8; }
  .df-ins:last-child { border-bottom:none; }
  .df-ins .ic { width:34px; height:34px; border-radius:9px; display:flex; align-items:center; justify-content:center; flex:0 0 auto; font-size:15px; }
  .df-ins.good .ic { background:#e8f6ec; color:var(--df-good); }
  .df-ins.priority .ic { background:#fdeaea; color:var(--df-bad); }
  .df-ins.info .ic { background:#eef6ff; color:var(--df-blue); }
  .df-ins .t { font-size:13.5px; font-weight:800; color:var(--df-ink); }
  .df-ins .d { font-size:12.5px; color:var(--df-mut); margin-top:2px; }

  /* league table */
  table.df-table { width:100%; border-collapse:collapse; font-size:13px; }
  table.df-table th { text-align:left; font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; color:var(--df-mut); padding:9px 10px; border-bottom:2px solid var(--df-border); cursor:pointer; white-space:nowrap; }
  table.df-table th.num, table.df-table td.num { text-align:right; }
  table.df-table td { padding:9px 10px; border-bottom:1px solid #f1f4f8; }
  table.df-table tr.me { background:#eef6ff; font-weight:700; }
  .df-rank { font-weight:800; color:var(--df-mut); }

  /* tabs */
  @keyframes dfFade { from { opacity:0; transform:translateY(4px);} to { opacity:1; transform:none;} }
  .df-tabs { display:grid; grid-template-columns:repeat(7,1fr); gap:8px; margin:18px 0 22px; }
  @media (max-width:1100px){ .df-tabs { grid-template-columns:repeat(4,1fr); } }
  @media (max-width:560px){ .df-tabs { grid-template-columns:repeat(2,1fr); } }
  /* national tab gets a distinct accent so it reads as the country-wide view */
  .df-tab[data-tab="national"] svg { color:#0d5bb8; }
  .df-yoy { display:inline-block; font-size:11.5px; font-weight:800; padding:2px 7px; border-radius:20px; margin-left:6px; }
  .df-yoy.up { background:#e8f6ec; color:var(--df-good); }
  .df-yoy.down { background:#fdeaea; color:var(--df-bad); }
  .df-yoy.flat { background:#eef1f6; color:var(--df-soft); }
  .df-tab { border:1px solid var(--df-border); background:#fff; padding:13px 8px 11px; font-size:11.5px; font-weight:700;
    color:var(--df-mut); border-radius:11px; cursor:pointer; display:flex; flex-direction:column; align-items:center; gap:7px; transition:.12s; }
  .df-tab svg { font-size:17px; color:#94a3b8; transition:color .12s; }
  .df-tab:hover { border-color:#bcd0ea; box-shadow:0 3px 10px rgba(13,91,184,.08); transform:translateY(-1px); }
  .df-tab.active { background:linear-gradient(135deg,#0d3b6e,#0d5bb8); border-color:transparent; color:#fff; box-shadow:0 6px 16px rgba(13,91,184,.28); }
  .df-tab.active svg { color:#fff; }
  .df-panel { display:none; animation:dfFade .2s ease-out; }
  .df-panel.active { display:block; }

  /* KPI strip */
  .df-kpis { display:grid; grid-template-columns:repeat(4,1fr); gap:14px; }
  @media (max-width:820px){ .df-kpis { grid-template-columns:repeat(2,1fr); } }
  @media (max-width:480px){ .df-kpis { grid-template-columns:1fr; } }
  .df-kpi { border:1px solid var(--df-border); border-radius:12px; padding:16px 18px; background:#fff; }
  .df-kpi .k { font-size:10.5px; font-weight:800; text-transform:uppercase; letter-spacing:.05em; color:var(--df-mut); }
  .df-kpi .v { font-size:1.8rem; font-weight:800; color:var(--df-ink); margin:6px 0 2px; line-height:1; }
  .df-kpi .v small { font-size:.85rem; color:var(--df-soft); font-weight:700; }
  .df-kpi .s { font-size:11.5px; color:var(--df-mut); }

  .df-cardhead { display:flex; justify-content:space-between; align-items:flex-start; gap:14px; flex-wrap:wrap; }

  /* national distribution rows */
  .df-dist-row { margin:16px 0; }
  .df-dist-row:first-child { margin-top:6px; }
  .df-dist-head { display:flex; justify-content:space-between; align-items:baseline; font-size:12.5px; margin-bottom:7px; }
  .df-dist-head .nm { font-weight:800; color:var(--df-ink); }
  .df-dist-head .you { font-weight:700; }
  .df-dist-track { position:relative; height:24px; background:#f1f4f8; border-radius:6px; }
  .df-dist-iqr { position:absolute; top:0; bottom:0; background:#cfe2fb; border-radius:6px; }
  .df-dist-med { position:absolute; top:-3px; bottom:-3px; width:2px; background:#475569; }
  .df-dist-you { position:absolute; top:50%; width:15px; height:15px; border-radius:50%; transform:translate(-50%,-50%); border:2px solid #fff; box-shadow:0 1px 4px rgba(15,23,42,.35); z-index:2; }
  .df-dist-ticks { position:relative; height:15px; margin-top:3px; font-size:10px; color:var(--df-soft); }
  .df-dist-ticks span { position:absolute; transform:translateX(-50%); white-space:nowrap; }
  .df-pos { color:var(--df-good); } .df-neg { color:var(--df-bad); }

/* ── The shared entity picker (partials/_entity_picker.html) ── */
  .epick-chip { display:inline-flex; align-items:center; gap:10px; padding:10px 14px;
    background:#fff; border:1px solid #d1d9e0; border-radius:10px; font-size:14px;
    font-weight:600; color:#5a6b7b; cursor:pointer; transition:border-color .12s, box-shadow .12s; }
  .epick-chip:hover { border-color:#b6c2cd; }
  .epick-chip.set { color:#1a2a3b; border-color:#16a085; }
  .epick-chip .epick-trigger-val { font-weight:700; }

  .epick-modal { position:fixed; inset:0; z-index:100000; display:flex; align-items:flex-start; justify-content:center; }
  .epick-modal[hidden] { display:none; }
  .epick-backdrop { position:absolute; inset:0; background:rgba(15,30,42,.45); backdrop-filter:blur(2px); }
  .epick-box { position:relative; background:#fff; width:min(560px,92vw); margin-top:clamp(110px,16vh,200px);
    border-radius:14px; box-shadow:0 24px 60px rgba(0,0,0,.3); overflow:hidden; animation:epickPop .14s ease-out; }
  @keyframes epickPop { from { opacity:0; transform:translateY(-8px) scale(.98); } to { opacity:1; transform:none; } }
  .epick-head { display:flex; align-items:center; gap:11px; padding:16px 18px; border-bottom:1px solid #eef1f4; }
  .epick-head span { font-size:15px; font-weight:800; color:#1a2a3b; flex:1; }
  .epick-head button { background:none; border:none; font-size:22px; line-height:1; color:#b6bfc8; cursor:pointer; }
  .epick-head button:hover { color:#1a2a3b; }
  .epick-search { display:flex; align-items:center; gap:10px; padding:14px 18px; }
  .epick-search input { flex:1; border:none; outline:none; font-size:16px; color:#1a2a3b; background:none; }
  .epick-hint { padding:0 18px 8px; font-size:11.5px; color:#9aa5b1; }
  .epick-results { max-height:46vh; overflow-y:auto; border-top:1px solid #f0f3f6; }
  .epick-item { display:flex; align-items:center; gap:12px; padding:11px 18px; cursor:pointer; border-bottom:1px solid #f5f7f9; }
  .epick-item:hover, .epick-item.active { background:#f0faf8; }
  .epick-item .epick-code { font-size:11px; font-weight:700; color:#16a085; min-width:62px; }
  .epick-item .epick-name { flex:1; font-size:13.5px; color:#1a2a3b; }
  .epick-item .epick-name .epick-sub { color:#9aa5b1; font-size:11.5px; font-weight:600; }
  .epick-item .epick-go { color:#cdd3da; font-size:12px; }
  .epick-item.active .epick-go { color:#16a085; }
  .epick-empty { padding:24px 18px; text-align:center; color:#b6bfc8; font-size:13px; }


/* ── What the monolith's inline style="" attributes became ─────────────────────────────────────
   The Content Security Policy admits no style attribute, so each one the template carried is a
   class here with the same declarations. An element the monolith hid with `style="display:none;"`
   and its script later shows carries `data-df-hidden`, which `digital_front_door.v1.js` turns into
   the same inline display through the style object model on load. Markup the script builds still
   carries `style=""` in its strings, exactly as the source's does; the script's safe `innerHTML`
   applies each one through the same object model. */
  :root { --theme:#0d5bb8; }  /* the monolith site's --theme, which the shell does not define */
  .df-ico { width:1em; height:1em; vertical-align:-.125em; fill:none; stroke:currentColor; stroke-width:2;
    stroke-linecap:round; stroke-linejoin:round; flex:none; }
  .df-empty .df-empty-ico { width:34px; height:34px; color:#cbd5e1; }
  .df-mt14 { margin-top:14px; }
  .df-scrollx { overflow-x:auto; }
  .df-card.df-card-bare { border:none; padding:0; background:none; }
  .df-sub.df-sub-cap { font-weight:800; text-transform:uppercase; letter-spacing:.05em; color:var(--df-mut); margin-bottom:10px; }
  .df-note .df-ico, .df-month-note .df-ico { margin-right:5px; }
  .df-month-note { margin:14px 0 0; }
  .df-month-note[hidden] { display:none; }
  .df-month-note div + div { margin-top:6px; }
  .df-ch .ic svg { width:18px; height:18px; }
  .df-ins .ic svg { width:15px; height:15px; }
  .epick-chip > svg:last-child { color:#aab4be; font-size:12px; }
  .epick-head > svg { color:#16a085; }
  .epick-search svg { color:#b6bfc8; }
  .epick-item .epick-go { width:12px; height:12px; }

/* ── Fitting the monolith's page inside this service's shell ───────────────────────────────────
   The monolith's dashboard had the viewport to itself and a centred 1160px column. Here the shell's
   full-width workspace is the container (the marketing width constraint is not carried across), and
   the sidebar takes ~250px of the viewport, so the breakpoints the source chose fire too late. These
   rules only move the column rules out; no colour, size or arrangement the source defines changes at
   any width it defined it for. A table wider than its card scrolls inside the card, so the document
   itself never gains a horizontal scrollbar. */
.df-wrap { max-width:none; margin:0; padding:0; }
.df-title { font-size:28px; font-weight:800; color:var(--df-ink); margin:0 0 16px; }
.df-controls > *, .df-kpis > *, .df-grid2 > *, .df-channels > *, .df-hero > * { min-width:0; }
.df-card, .df-chart-box { min-width:0; max-width:100%; }
@media (max-width:1300px){ .df-tabs { grid-template-columns:repeat(4,1fr); } }
@media (max-width:1150px){ .df-kpis { grid-template-columns:repeat(2,1fr); } }
@media (max-width:1100px){ .df-grid2 { grid-template-columns:1fr; } .df-channels { grid-template-columns:1fr; } }
@media (max-width:800px){ .df-kpis { grid-template-columns:1fr; } }
@media (max-width:560px){ .df-tabs { grid-template-columns:repeat(2,1fr); } }
.df-kpi { min-width:0; overflow-wrap:anywhere; }
.df-score-num { pointer-events:none; }
.df-gauge { min-height:200px; }
/* the shell's `thead th` (11px, upper case, tracked) is for its own tables; the monolith's tables set their own */
table.df-table thead th { font-size:11px; letter-spacing:.04em; text-transform:uppercase; }
table.df-table tbody tr:last-child td { border-bottom:1px solid #f1f4f8; }  /* the shell drops the last row's rule; the monolith's tables keep it */
