/* NHS organisation enrichment (tpl/nhs.js): regulator, performance, money, people, leadership */
body.ux.cec .nhs-toprow { margin-bottom: 1rem; }
body.ux.cec .nhs-toprow + .wrap, body.ux.cec .wrap > .cec-tabs { margin-top: 0; }
body.ux.cec .cec-card h3 { margin: 1.5rem 0 0.6rem; font-size: 1.02rem; color: var(--c-deep); }
body.ux.cec .cec-card h3:first-child, body.ux.cec .cec-card .nhs-kpis + h3 { margin-top: 0.4rem; }
body.ux.cec .nhs-kpis { margin: 0 0 1.2rem !important; grid-template-columns: repeat(auto-fit, minmax(11.5rem, 1fr)); }
body.ux.cec .nhs-kpis .kpi-num { font-size: clamp(1.4rem, 1.2rem + 0.6vw, 1.8rem); }
body.ux.cec .nhs-per { font-size: 0.8rem; }
body.ux.cec td.nhs-per { white-space: nowrap; }
body.ux.cec .nhs-src .nhs-per { white-space: normal; }
body.ux.cec .nhs-src { overflow-wrap: anywhere; margin: 1.1rem 0 0; border-top: 1px solid var(--c-line); padding-top: 0.7rem; }
body.ux.cec .nhs-src a { font-weight: 600; }
body.ux.cec .nhs-tbl td.tnum, body.ux.cec .nhs-tbl th.cec-right { text-align: right; font-variant-numeric: tabular-nums; }
body.ux.cec .nhs-tbl { table-layout: fixed; width: 100%; }
body.ux.cec .nhs-tbl th:first-child, body.ux.cec .nhs-tbl td:first-child { width: 44%; }
body.ux.cec .nhs-unk { margin: 0.2rem 0 0; }

/* CQC ratings */
body.ux.cec .nhs-rating { display: inline-block; padding: 0.22rem 0.7rem; border-radius: 999px; font-weight: 700; font-size: 0.82rem; line-height: 1.3; background: #ececea; color: #3a3c40; }
body.ux.cec .nhs-r-outstanding { background: #cfe9da; color: #0b4a2e; }
body.ux.cec .nhs-r-good { background: #e4f1e9; color: #0e5a38; }
body.ux.cec .nhs-r-requires-improvement { background: #fbecc8; color: #6b4300; }
body.ux.cec .nhs-r-inadequate { background: var(--c-accent-tint); color: var(--c-accent-ink); }
body.ux.cec .nhs-cqc { display: flex; gap: 1.6rem; align-items: flex-start; flex-wrap: wrap; margin: 0.2rem 0 0.4rem; }
body.ux.cec .nhs-cqc-main { display: flex; flex-direction: column; gap: 0.4rem; min-width: 11rem; padding-right: 1.6rem; border-right: 1px solid var(--c-line); }
body.ux.cec .nhs-cqc-main .nhs-rating { font-size: 1.05rem; padding: 0.35rem 1rem; align-self: flex-start; }
body.ux.cec .nhs-dom-l { font-size: 0.68rem; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ux-muted); }
body.ux.cec .nhs-doms { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: 0.8rem 1.2rem; flex: 1; min-width: 14rem; }
body.ux.cec .nhs-dom { display: flex; flex-direction: column; gap: 0.3rem; align-items: flex-start; }

/* NHS England oversight */
body.ux.cec .nhs-oversight { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
body.ux.cec .nhs-big { display: flex; flex-direction: column; gap: 0.15rem; padding: 0.9rem 1rem; border: 1px solid var(--c-line); border-radius: 12px; background: #fff; }
body.ux.cec .nhs-bigl { font-size: 0.68rem; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; color: var(--c-accent); }
body.ux.cec .nhs-bign { font-size: 2rem; font-weight: 300; line-height: 1.15; color: var(--c-deep); font-variant-numeric: tabular-nums; }
body.ux.cec .nhs-bign small { font-size: 0.95rem; color: var(--ux-muted); font-weight: 400; }
body.ux.cec .nhs-bign.nhs-small { font-size: 1.5rem; }
body.ux.cec .nhs-seg-4, body.ux.cec .nhs-seg-5 { color: var(--c-accent); font-weight: 700; }
body.ux.cec .nhs-sub { margin: 1rem 0 0.3rem; }
body.ux.cec .nhs-domlist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0 1.6rem; }
body.ux.cec .nhs-domlist li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.45rem 0; border-top: 1px solid var(--c-line); font-size: 0.9rem; }
body.ux.cec .nhs-domlist li b { font-variant-numeric: tabular-nums; }

/* board vs workforce bars */
body.ux.cec .nhs-eqwrap { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.4rem; }
body.ux.cec .nhs-eq h4 { margin: 0 0 0.7rem; font-size: 0.86rem; font-weight: 700; color: var(--ux-ink-2); }
body.ux.cec .nhs-pc { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.15rem 0.8rem; font-size: 0.84rem; margin-bottom: 0.6rem; }
body.ux.cec .nhs-pc .l { grid-column: 1; }
body.ux.cec .nhs-pc .v { grid-column: 2; grid-row: 1; font-weight: 700; font-variant-numeric: tabular-nums; }
body.ux.cec .nhs-pc .t { grid-column: 1 / -1; height: 8px; border-radius: 999px; background: var(--c-pale); overflow: hidden; }
body.ux.cec .nhs-pc .t i { display: block; height: 100%; background: var(--c-accent); border-radius: 999px; }

body.ux.cec .nhs-srcs { list-style: none; margin: 0 0 0.8rem; padding: 0; }
body.ux.cec .nhs-srcs li { padding: 0.55rem 0; border-top: 1px solid var(--c-line); font-size: 0.86rem; line-height: 1.45; }
body.ux.cec .nhs-srcs li:first-child { border-top: 0; padding-top: 0; }
body.ux.cec #nhs-regulator, body.ux.cec #nhs-performance, body.ux.cec #nhs-money, body.ux.cec #nhs-people, body.ux.cec #nhs-leaders, body.ux.cec #nhs-links, body.ux.cec #nhs-assurance { scroll-margin-top: 1rem; }

@media (max-width: 760px) {
  body.ux.cec .nhs-oversight, body.ux.cec .nhs-eqwrap { grid-template-columns: minmax(0, 1fr); }
  body.ux.cec .nhs-cqc-main { padding-right: 0; border-right: 0; border-bottom: 1px solid var(--c-line); padding-bottom: 0.9rem; width: 100%; }
}
@media (max-width: 620px) {
  body.ux.cec .nhs-tbl { table-layout: auto; }
  body.ux.cec .nhs-tbl th:first-child, body.ux.cec .nhs-tbl td:first-child { width: auto; }
  body.ux.cec .nhs-tbl td.tnum, body.ux.cec td.nhs-per { text-align: left; white-space: normal; }
  body.ux.cec .nhs-tbl td.cec-strong { font-weight: 700; }
}
body.ux.cec .nhs-lead { table-layout: auto; }
body.ux.cec .nhs-lead th:first-child, body.ux.cec .nhs-lead td:first-child { width: 24%; }
body.ux.cec .nhs-lead .tag { margin-top: 0.25rem; white-space: normal; }
body.ux.cec .nhs-money th:first-child, body.ux.cec .nhs-money td:first-child { width: 36%; }
body.ux.cec .nhs-money th:nth-child(3), body.ux.cec .nhs-money td:nth-child(3) { width: 18%; }
body.ux.cec .nhs-money td:nth-child(2) { text-align: left; }
/* figure and period cells wrap inside their columns (long figures overlapped the period) */
body.ux.cec .nhs-tbl td, body.ux.cec td.nhs-per { white-space: normal; overflow-wrap: anywhere; }
body.ux.cec .nhs-tbl td.nhs-per, body.ux.cec .nhs-tbl th:last-child { padding-left: 1rem; }
body.ux.cec .nhs-money td:nth-child(2) { padding-right: 0.8rem; }
body.ux.cec .nhs-money th:nth-child(3), body.ux.cec .nhs-money td:nth-child(3) { width: 20%; }
/* A (13 Oct): leadership names no longer squeezed to 24% width on phones */
@media (max-width: 620px) { body.ux.cec .nhs-lead th:first-child, body.ux.cec .nhs-lead td:first-child { width: auto; } }
/* A (13 Oct): phones - the Size and money table rows were squeezed by column widths meant for desktop */
@media (max-width: 620px) {
  body.ux.cec .nhs-money th:first-child, body.ux.cec .nhs-money td:first-child, body.ux.cec .nhs-money th:nth-child(3), body.ux.cec .nhs-money td:nth-child(3) { width: auto; }
  body.ux.cec .nhs-tbl td, body.ux.cec td.nhs-per { overflow-wrap: break-word; }
  body.ux.cec .nhs-tbl td.nhs-per { padding-left: 0; }
}
