/* PCN DES (Network Contract DES achievement) dashboard.
 *
 * Phase 4C.48A. The monolith's `<style>` block from website/pcn_des_dashboard.html, taken at monolith
 * commit cb02cf0 with no selector, value or colour changed except:
 *
 *  - the page header, "about" and selector bands, which were full-bleed strips inside the marketing
 *    site's `.container`, are cards in the shell's normal full-width tool layout, and the selector bar
 *    is sticky only where there is room for it (wide and tall); the source's was always sticky;
 *  - the search modal (`.des-modal*`) and the chip (`.des-chip*`) are gone: the shared chip and modal
 *    are `tools/shared/static/tools/shared/picker.v1.css`, not this file;
 *  - the selectors that styled Font Awesome `<i>` glyphs style the inline SVG that replaces them.
 *
 * 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 every `style=""` the monolith's template
 * carried is a class below.
 */
:root { --des-theme: #16a085; }
.des-wrap { max-width: none; margin: 0; padding: 0; }
.des-eyebrow { font-size: 11px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--des-theme); margin: 0 0 3px; }
.des-title { font-size: 22px; font-weight: 800; color: #1a2a3b; margin: 0 0 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.des-ico { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; vertical-align: -0.125em; }
.des-body { padding: 0 0 24px; }
  /* ── Compact "about" panel ──────────────────────────────────────────── */
  .des-about { background: #fff; border: 1px solid #e3e8ee; border-radius: 12px; padding: 0 18px; margin-bottom: 14px; }
  .des-about summary {
    list-style: none; cursor: pointer; padding: 12px 0;
    display: flex; align-items: center; gap: 10px; font-size: 13px; color: #5a6b7b; flex-wrap: wrap;
  }
  .des-about summary::-webkit-details-marker { display: none; }
  .des-about summary .chev { transition: transform .2s; color: #16a085; }
  .des-about details[open] summary .chev { transform: rotate(90deg); }
  .des-about summary .title { font-weight: 700; color: #1a2a3b; }
  .des-about summary .badge { background: #eafaf6; color: #0f6e57; border: 1px solid #cdeee4; border-radius: 20px; padding: 2px 9px; font-size: 11px; font-weight: 700; }
  .des-about-body { padding: 4px 0 18px; color: #5a6b7b; font-size: 13px; line-height: 1.6; }
  .des-about-body p { margin: 0 0 10px; max-width: 880px; }
  .des-about-areas { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 6px; }
  .des-area-tag { display: inline-flex; align-items: center; gap: 6px; background: #f4f7f9; border: 1px solid #e3e8ee; border-radius: 20px; padding: 4px 12px; font-size: 12px; font-weight: 600; color: #5a6b7b; }
  .des-about-body a.src { color: #16a085; font-size: 12px; text-decoration: none; }
  .des-about-body a.src:hover { text-decoration: underline; }

  /* ── Selector bar with chips ────────────────────────────────────────── */
  /* Park below the shell's sticky 60px topbar so the bar isn't tucked under it when scrolled. */
  .des-selector-bar { background: #fff; border: 1px solid #e3e8ee; border-radius: 12px; padding: 12px 16px; margin-bottom: 24px; box-shadow: 0 2px 8px rgba(0,0,0,.05); }
  @media (min-width: 1025px) and (min-height: 700px) { .des-selector-bar { position: sticky; top: 68px; z-index: 20; } }
  .des-selector-inner { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
  .des-chips { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
  .chip-clear { width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; border: 1px solid #e3e8ee; color: #999; text-decoration: none; font-size: 12px; }
  .chip-clear:hover { background: #fdeceb; border-color: #f3c0bb; color: #c0392b; }

  .date-pills { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-left: auto; }
  .date-pill { display: inline-flex; align-items: center; gap: 5px; background: #fff; border: 1px solid #cdd3da; border-radius: 6px; padding: 4px 11px; font-size: 12px; color: #555; font-weight: 600; text-decoration: none; transition: background .15s; white-space: nowrap; }
  .date-pill.active { background: #16a085; color: #fff; border-color: #16a085; }
  .date-pill:hover:not(.active) { background: #f0faf8; color: #16a085; border-color: #16a085; text-decoration: none; }

  /* ── Landing chooser cards ──────────────────────────────────────────── */
  .des-landing { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 8px 0 28px; }
  @media (max-width: 640px) { .des-landing { grid-template-columns: 1fr; } }
  .des-choice { background: #fff; border: 1px solid #e3e8ee; border-radius: 14px; padding: 30px 26px; cursor: pointer; text-align: center; transition: transform .15s, box-shadow .15s, border-color .15s; }
  .des-choice:hover { transform: translateY(-3px); box-shadow: 0 10px 26px rgba(15,61,46,.12); border-color: #16a085; }
  .des-choice-icon { width: 64px; height: 64px; border-radius: 16px; margin: 0 auto 16px; display: flex; align-items: center; justify-content: center; font-size: 26px; color: #fff; }
  .des-choice.pcn .des-choice-icon { background: linear-gradient(135deg, #0f3d2e, #16a085); }
  .des-choice.prac .des-choice-icon { background: linear-gradient(135deg, #0a5a73, #00b4d9); }
  .des-choice h3 { font-size: 18px; font-weight: 800; color: #1a2a3b; margin: 0 0 6px; }
  .des-choice p { font-size: 13px; color: #7a8896; margin: 0 0 16px; line-height: 1.5; }
  .des-choice .go { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700; color: #16a085; }
  .des-choice.prac .go { color: #0a7ea4; }

  /* ── Context notice ─────────────────────────────────────────────────── */
  .context-notice { border-radius: 8px; padding: 12px 16px; font-size: 13px; margin-bottom: 20px; display: flex; align-items: flex-start; gap: 10px; }
  .context-notice svg { margin-top: 1px; flex-shrink: 0; }
  .context-notice.info    { background: #e8f7fc; border: 1px solid #b6e9f7; color: #1a6a8a; }
  .context-notice.success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
  .context-notice.warning { background: #fff3cd; border: 1px solid #ffc107; color: #856404; }

  .no-data-banner { background: #fff3cd; border: 1px solid #ffc107; border-radius: 10px; padding: 24px; text-align: center; color: #856404; margin-bottom: 28px; }

  /* ── Summary header ─────────────────────────────────────────────────── */
  .des-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 24px; }
  .sum-card { background: #fff; border: 1px solid #e3e8ee; border-radius: 12px; padding: 16px 18px; }
  .sum-card .lbl { font-size: 10px; text-transform: uppercase; letter-spacing: .07em; color: #9aa5b1; font-weight: 700; }
  .sum-card .big { font-size: 30px; font-weight: 900; line-height: 1.05; margin-top: 4px; color: #1a2a3b; }
  .sum-card .sub { font-size: 12px; color: #7a8896; margin-top: 3px; }
  .sum-card.accent { background: linear-gradient(135deg, #0f3d2e, #16a085); border: none; color: #fff; }
  .sum-card.accent .lbl { color: rgba(255,255,255,.75); }
  .sum-card.accent .big { color: #fff; }
  .sum-card.accent .sub { color: rgba(255,255,255,.85); }
  .sum-card.gold { background: linear-gradient(135deg, #8a6d10, #c79a1e); border: none; color: #fff; }
  .sum-card.gold .lbl, .sum-card.gold .sub { color: rgba(255,255,255,.82); }
  .sum-card.gold .big { color: #fff; }
  .sum-card .mini { font-size: 12px; color: #1a2a3b; font-weight: 700; }
  .sum-pos { color: #27ae60; } .sum-neg { color: #e74c3c; }

  /* ── Collapsible analysis panels ────────────────────────────────────── */
  .panel { background: #fff; border: 1px solid #e3e8ee; border-radius: 12px; margin-bottom: 24px; overflow: hidden; }
  .panel > summary { list-style: none; cursor: pointer; padding: 15px 18px; display: flex; align-items: center; gap: 11px; font-size: 14px; font-weight: 700; color: #1a2a3b; }
  .panel > summary::-webkit-details-marker { display: none; }
  .panel > summary .chev { transition: transform .2s; color: #16a085; margin-left: auto; }
  .panel[open] > summary .chev { transform: rotate(90deg); }
  .panel > summary .pill { font-size: 11px; font-weight: 600; color: #888; }
  .panel-inner { padding: 4px 18px 20px; }

  /* ── League table ───────────────────────────────────────────────────── */
  .league-wrap { overflow-x: auto; }
  table.league { width: 100%; border-collapse: collapse; font-size: 12.5px; }
  table.league th, table.league td { padding: 8px 10px; text-align: center; white-space: nowrap; }
  table.league thead th { position: sticky; top: 0; background: #f8fafb; color: #5a6b7b; font-size: 11px; font-weight: 700; border-bottom: 2px solid #e3e8ee; cursor: pointer; user-select: none; }
  table.league thead th:hover { color: #16a085; }
  table.league th.name-col, table.league td.name-col { text-align: left; font-weight: 600; color: #1a2a3b; }
  table.league th.iif-col { color: #c79a1e; }
  table.league tbody tr { border-bottom: 1px solid #f0f3f6; }
  table.league tbody tr:hover { background: #f8fafb; cursor: pointer; }
  table.league tbody tr.hl { background: #eaf8fd; }
  table.league tbody tr.hl .name-col { color: #0a7ea4; font-weight: 800; }
  .rag { display: inline-block; min-width: 42px; padding: 2px 6px; border-radius: 5px; font-weight: 700; }
  .rag-g { background: #e7f7ee; color: #1e874b; }
  .rag-a { background: #fdf0e3; color: #c4690f; }
  .rag-r { background: #fdeceb; color: #c0392b; }
  .rag-n { color: #c4ccd4; }
  th .sort-ind { font-size: 9px; color: #16a085; }

  /* ── Trend grid ─────────────────────────────────────────────────────── */
  .trend-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
  .trend-card { border: 1px solid #eef1f4; border-radius: 10px; padding: 12px 14px; }
  .trend-card .tc-title { font-size: 12px; font-weight: 700; color: #1a2a3b; margin-bottom: 8px; }
  .trend-card .tc-canvas { position: relative; height: 130px; }

  /* ── Section blocks ─────────────────────────────────────────────────── */
  .ruleset-block { background: #fff; border: 1px solid #e3e8ee; border-radius: 10px; overflow: hidden; margin-bottom: 24px; }
  .ruleset-block.iif { border-color: #ecd9a0; box-shadow: 0 1px 0 #f4e9c9; }
  .ruleset-header { display: flex; align-items: center; gap: 14px; padding: 16px 20px 14px; border-bottom: 1px solid #e3e8ee; }
  .ruleset-block.iif .ruleset-header { background: linear-gradient(180deg, #fffdf5, #fff); border-bottom-color: #f1e6c4; }
  .ruleset-icon { width: 40px; height: 40px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 17px; flex-shrink: 0; }
  .ruleset-title { font-size: 15px; font-weight: 700; color: #1a2a3b; margin: 0; }
  .ruleset-sub   { font-size: 12px; color: #888; margin: 2px 0 0; }
  .ruleset-inner { padding: 20px; }
  .iif-score { margin-left: auto; text-align: right; }
  .iif-score-num { font-size: 26px; font-weight: 900; color: #c79a1e; line-height: 1; }
  .iif-score-num span { font-size: 15px; color: #c4ccd4; font-weight: 700; }
  .iif-score-lbl { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: #b08c1c; font-weight: 700; margin-top: 3px; }

  /* ── Indicator cards ────────────────────────────────────────────────── */
  .ind-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 16px; }
  .ind-card { background: #fff; border: 1px solid #e3e8ee; border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; }
  .ind-card.iif { border-color: #ecd9a0; }
  .ind-card-header { padding: 14px 16px 10px; border-bottom: 1px solid #f0f3f6; }
  .ind-code  { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: #aaa; margin-bottom: 2px; display: flex; align-items: center; gap: 7px; }
  .ind-code .iif-tag { background: #fbf2d6; color: #b08c1c; border-radius: 4px; padding: 1px 6px; font-size: 9px; letter-spacing: .04em; }
  .ind-label { font-size: 14px; font-weight: 700; color: #1a2a3b; margin: 0 0 4px; }
  .ind-desc  { font-size: 11px; color: #777; margin: 0; line-height: 1.45; }

  .ind-stats { display: flex; gap: 0; border-bottom: 1px solid #f0f3f6; }
  .ind-stat  { flex: 1; padding: 10px 12px; border-right: 1px solid #f0f3f6; text-align: center; }
  .ind-stat:last-child { border-right: none; }
  .ind-stat-val { font-size: 22px; font-weight: 800; line-height: 1; }
  .ind-stat-val.empty { font-size: 18px; color: #ddd; }
  .ind-stat-lbl { font-size: 10px; text-transform: uppercase; letter-spacing: .07em; color: #999; margin-top: 3px; }
  .ind-stat-sub { font-size: 10px; color: #bbb; margin-top: 1px; }

  /* Month-on-month review panel */
  .mom-review { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 26px; padding: 4px 4px 16px; border-bottom: 1px solid #f0f3f6; margin-bottom: 16px; }
  .mom-stat-big { font-size: 32px; font-weight: 900; line-height: 1; color: #7f8c8d; }
  .mom-stat-big.up { color: #1e8449; } .mom-stat-big.down { color: #c0392b; }
  .mom-stat-big span { font-size: 13px; font-weight: 700; opacity: .6; margin-left: 3px; }
  .mom-stat-lbl { font-size: 11px; color: #8a97a4; margin-top: 4px; }
  .mom-tally { display: flex; flex-wrap: wrap; gap: 8px; }
  .mom-pip { font-size: 12px; font-weight: 700; border-radius: 6px; padding: 4px 10px; }
  .mom-pip.up { color: #1e8449; background: #e7f6ed; } .mom-pip.down { color: #c0392b; background: #fdecea; } .mom-pip.flat { color: #7f8c8d; background: #f0f2f4; }
  .mom-text { flex: 1 1 320px; min-width: 280px; font-size: 12.5px; line-height: 1.55; color: #55606b; margin: 0; }
  .mom-text .mom-up { color: #1e8449; font-weight: 700; } .mom-text .mom-down { color: #c0392b; font-weight: 700; }
  .mom-chart-title { font-size: 12px; font-weight: 700; color: #5a6b7b; margin: 8px 0 6px; }
  .mom-chart-wrap { position: relative; margin-bottom: 14px; }

  /* PCN-in-ICB comparison */
  .icb-rank-row { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 26px; padding: 4px 4px 16px; border-bottom: 1px solid #f0f3f6; margin-bottom: 14px; }
  .icb-rank-badge { background: #f6effb; border: 1px solid #ecdcf6; border-radius: 12px; padding: 10px 18px; text-align: center; }
  .icb-rank-badge .rk { font-size: 34px; font-weight: 900; line-height: 1; color: #8e44ad; }
  .icb-rank-badge .rk span { font-size: 15px; font-weight: 700; opacity: .55; margin-left: 2px; }
  .icb-rank-badge .rk-lbl { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: #9b7bb0; margin-top: 4px; font-weight: 700; }
  .icb-rank-stats { display: flex; flex-wrap: wrap; gap: 22px; }
  .icb-rank-stats .rk-stat { text-align: center; }
  .icb-rank-stats .rk-stat .v { font-size: 22px; font-weight: 800; color: #1a2a3b; line-height: 1; }
  .icb-rank-stats .rk-stat .l { font-size: 10.5px; color: #8a97a4; margin-top: 4px; }

  /* Month-on-month change */
  .ind-mom { display: flex; flex-wrap: wrap; gap: 8px; padding: 9px 16px; border-bottom: 1px solid #f0f3f6; background: #fafbfc; }
  .mom-chip { display: inline-flex; align-items: baseline; gap: 6px; font-size: 11px; color: #667; }
  .mom-chip .mom-who { text-transform: uppercase; letter-spacing: .06em; font-size: 9px; color: #999; font-weight: 700; }
  .mom-chip .mom-delta { font-weight: 800; font-size: 12px; border-radius: 5px; padding: 1px 7px; }
  .mom-delta.up   { color: #1e8449; background: #e7f6ed; }
  .mom-delta.down { color: #c0392b; background: #fdecea; }
  .mom-delta.flat { color: #7f8c8d; background: #f0f2f4; }
  .mom-chip .mom-from { color: #aab; font-size: 10px; }

  /* IIF points band */
  .iif-band { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 10px 16px; background: #fffdf5; border-bottom: 1px solid #f1e6c4; }
  .iif-band .iif-pts { font-size: 20px; font-weight: 900; color: #c79a1e; line-height: 1; }
  .iif-band .iif-pts small { font-size: 11px; color: #b6bfc8; font-weight: 700; margin-left: 3px; }
  .iif-band .iif-thr { font-size: 11px; color: #b08c1c; background: #fbf2d6; border-radius: 5px; padding: 3px 8px; font-weight: 600; }
  .iif-band .iif-prac { font-size: 11px; color: #0a7ea4; background: #e8f7fc; border-radius: 5px; padding: 3px 8px; font-weight: 600; margin-left: auto; }
  .iif-band .iif-gauge { position: relative; width: 64px; height: 64px; flex-shrink: 0; }

  .ind-chart-wrap { padding: 12px 14px 6px; position: relative; }
  .ind-chart-empty { padding: 22px 16px; text-align: center; color: #b6bfc8; font-size: 12px; }

  .ind-extra { padding: 10px 16px; display: flex; flex-wrap: wrap; gap: 6px; border-top: 1px solid #f0f3f6; }
  .extra-chip { display: inline-flex; align-items: center; gap: 4px; background: #f8f9fa; border: 1px solid #e3e8ee; border-radius: 20px; padding: 3px 10px; font-size: 11px; color: #555; }
  .extra-chip strong { color: #1a2a3b; }

  .bench-legend { display: flex; gap: 14px; flex-wrap: wrap; padding: 10px 16px; border-top: 1px solid #f0f3f6; background: #fafbfc; align-items: center; margin-top: auto; }
  .bench-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: #666; }
  .dot-practice { width: 10px; height: 10px; border-radius: 3px; background: #00b4d9; flex-shrink:0; }
  .dot-g { width: 10px; height: 10px; border-radius: 3px; background: #27ae60; flex-shrink:0; }
  .dot-a { width: 10px; height: 10px; border-radius: 3px; background: #e67e22; flex-shrink:0; }
  .dot-r { width: 10px; height: 10px; border-radius: 3px; background: #e74c3c; flex-shrink:0; }

  /* ── Additions: landing cards are links, so with scripting off they still go somewhere ─────────── */
  a.des-choice { display: block; text-decoration: none; color: inherit; }
  .des-choice-icon .des-ico { width: 26px; height: 26px; }

  /* ── Additions: what the monolith's `style=""` attributes said ──────────────────────────────────── */
  .des-ic-teal { color: #16a085; }
  .des-ic-cancer { color: #c0392b; } .des-ic-smr { color: #8e44ad; } .des-ic-hi { color: #27ae60; }
  .des-ic-purple { color: #8e44ad; } .des-ic-cyan { color: #00b4d9; }
  .des-ic-flag { color: #bdc3c7; }
  .des-ic-purple.des-ico-xs, .des-ic-cyan.des-ico-xs { width: 10px; height: 10px; }
  .des-muted12 { color: #9aa5b1; font-size: 12px; }
  .date-pills-lbl { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: #aaa; }
  .no-data-banner .des-ico { width: 28px; height: 28px; display: block; margin: 0 auto 10px; }
  .ctx-sub { font-size: 12px; opacity: .8; display: block; }
  .ctx-dim { opacity: .8; }
  .sum-of { font-size: 16px; opacity: .7; }
  .sum-of-grey { font-size: 16px; color: #c4ccd4; }
  .sum-card .mini.mini-top { margin-top: 6px; }
  .sum-card .big.big-sm { font-size: 22px; }
  .icb-rank-stats .rk-stat .v.v-purple { color: #8e44ad; }
  .mom-chart-wrap.h340 { height: 340px; }
  .league-wrap.mt14 { margin-top: 14px; }
  .panel-title-ico { color: #16a085; }
  .panel-title-ico.purple { color: #8e44ad; }
  .des-empty { text-align: center; padding: 48px 24px; color: #aaa; }
  .des-empty .des-ico { width: 36px; height: 36px; display: block; margin: 0 auto 12px; }
  .ruleset-icon .des-ico { width: 17px; height: 17px; }
  .ruleset-icon.rs-iif { background: #c79a1e18; color: #c79a1e; }
  .ruleset-icon.rs-cancer { background: #c0392b18; color: #c0392b; }
  .ruleset-icon.rs-smr { background: #8e44ad18; color: #8e44ad; }
  .ruleset-icon.rs-health_inequalities { background: #27ae6018; color: #27ae60; }
  .iif-score-num.is-empty { color: #c4ccd4; }
  .ind-stat-val.c-pcn { color: #16a085; } .ind-stat-val.c-icb { color: #8e44ad; } .ind-stat-val.c-nat { color: #7f8c8d; }
  .mom-chip.push { margin-left: auto; }
  .ind-chart-empty .des-ico { margin-right: 4px; }
  .ind-chart-empty strong { color: #7f8c8d; }
  .bench-legend .bench-date { margin-left: auto; font-size: 11px; color: #aaa; }
  .mom-pip .des-ico, .mom-delta .des-ico { width: 11px; height: 11px; }
  table.league .des-ico { width: 10px; height: 10px; }
  .chip-clear .des-ico { width: 12px; height: 12px; }
  .des-about summary .chev { width: 12px; height: 12px; }
  .panel > summary .chev { width: 14px; height: 14px; }
  /* one chip per kind, with its clear control beside it */
  .des-chip-group { display: inline-flex; align-items: center; gap: 6px; }
  .des-source-link .des-ico { width: 12px; height: 12px; }
