/* A&E Activity. Every rule is a class: the Content Security Policy admits no inline style.
 *
 * The frame follows the other Wider Systems tools (Hospital Waiting Times, NHS 111) and the shell's tokens. Series colours are fixed by
 * meaning: the selected scope blue, England slate, the previous year grey. A figure that is not a number is words, never a zero.
 */
.ae-wrap { color: var(--hs-ink, #1a2a3b); padding: 0 0 24px; }
.ae-head { margin: 0 0 14px; }
.ae-eyebrow { font-size: 11px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--hs-teal-deep, #0f6e57); margin: 0 0 3px; }
.ae-title { font-size: 22px; font-weight: 800; margin: 0; }
.ae-subtitle { font-size: 15px; font-weight: 600; color: var(--hs-ink-muted, #55657a); margin: 2px 0 8px; }
.ae-lead { margin: 0 0 8px; color: var(--hs-ink-muted, #55657a); max-width: 80ch; line-height: 1.5; }
.ae-source { font-size: 13px; margin: 0; color: var(--hs-ink-muted, #55657a); max-width: 90ch; }
.ae-muted { color: var(--hs-ink-muted, #55657a); font-size: 13px; font-weight: 400; line-height: 1.5; }
.ae-small { font-size: 12px; margin: 8px 0 0; }
.ae-code { color: var(--hs-ink-muted, #55657a); font-size: 12px; font-weight: 400; white-space: nowrap; }
.ae-strong { font-weight: 600; }
.ae-sub { display: block; font-size: 11px; font-weight: 400; color: var(--hs-ink-muted, #55657a); white-space: normal; }

.ae-card { background: var(--hs-surface-card, var(--hs-surface, #fff)); border: 1px solid var(--hs-border, #e3e8ee); border-radius: 12px; padding: 14px 18px; margin: 0 0 16px; min-width: 0; }
.ae-card-head { margin: 0 0 12px; }
.ae-h2 { font-size: 16px; font-weight: 700; margin: 0 0 6px; }
.ae-h3 { font-size: 14px; font-weight: 700; margin: 4px 0 6px; }
.ae-per { font-size: 12px; color: var(--hs-ink-muted, #55657a); margin: 0 0 6px; }

.ae-filter-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.ae-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.ae-field-wide { flex: 1 1 18rem; }
.ae-field-wide .ae-select, .ae-field-wide .ae-input { width: 100%; }
.ae-label { font-weight: 600; font-size: 13px; }
.ae-select, .ae-input { min-width: 10rem; max-width: 100%; padding: 7px 9px; border: 1px solid var(--hs-border-strong, #c7d0da); border-radius: 8px; background: var(--hs-surface-card, #fff); color: inherit; font: inherit; }
.ae-actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin: 12px 0 0; }
.ae-hint { margin: 0; }
.ae-button { padding: 8px 18px; border: 0; border-radius: 8px; background: var(--hs-navy, #111827); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.ae-button:hover, .ae-button:focus-visible { background: var(--hs-navy-2, #1d4466); }
.ae-button-quiet { background: var(--hs-ground, #f4f7f9); color: var(--hs-ink, #1a2a3b); border: 1px solid var(--hs-border-strong, #c7d0da); }
.ae-button-quiet:hover, .ae-button-quiet:focus-visible { background: #e8eef4; }
.ae-link { color: var(--hs-link, #0b5cad); }
.ae-find { padding-top: 10px; padding-bottom: 10px; }
.ae-find-results { margin: 10px 0 0; }
.ae-find-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; font-size: 13px; }
.ae-find-list li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 14px; padding: 6px 0; border-bottom: 1px solid var(--hs-border, #e3e8ee); }

.ae-tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--hs-border, #e3e8ee); margin: 0 0 16px; }
.ae-tab { padding: 9px 14px; color: var(--hs-ink-muted, #55657a); text-decoration: none; font-weight: 600; font-size: 14px; border-bottom: 3px solid transparent; white-space: nowrap; }
.ae-tab:hover { color: var(--hs-ink, #1a2a3b); }
.ae-tab.is-current { color: var(--hs-ink, #1a2a3b); border-bottom-color: var(--hs-teal-deep, #0f6e57); }
.ae-tab:focus-visible, .ae-pill:focus-visible, .ae-toggle:focus-visible, .ae-sort:focus-visible, .ae-link:focus-visible { outline: 3px solid var(--hs-focus, #0b5cad); outline-offset: 2px; }

.ae-alert { border-radius: 8px; padding: 9px 14px; margin: 0 0 14px; font-size: 13px; line-height: 1.5; border: 1px solid var(--hs-border, #e3e8ee); }
.ae-alert-info { background: var(--hs-ground, #f4f7f9); }
.ae-alert-warn { background: var(--hs-warn-bg, #fff6e0); border-color: var(--hs-warn-border, #f0d48a); color: var(--hs-warn-ink, #6b4b00); }
.ae-badge { display: inline-block; padding: 1px 9px; border-radius: 999px; background: var(--hs-teal-tint, #e3f3ef); color: var(--hs-teal-deep, #0f6e57); font-size: 12px; font-weight: 700; margin: 0 6px 0 0; white-space: nowrap; }

.ae-summary { margin: 6px 0 10px; padding: 9px 14px; border-left: 4px solid #2563eb; background: #f3f7ff; border-radius: 0 8px 8px 0; font-size: 14px; line-height: 1.55; }
.ae-tiles { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 10px; }
.ae-tile { border: 1px solid var(--hs-border, #e3e8ee); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ae-tile-label { font-size: 12px; font-weight: 700; color: var(--hs-ink-muted, #55657a); text-transform: uppercase; letter-spacing: .04em; }
.ae-tile-value { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ae-tile-sep { color: var(--hs-ink-muted, #55657a); font-weight: 400; }
.ae-tile-note { font-size: 12px; color: var(--hs-ink-muted, #55657a); }
.ae-partial { color: var(--hs-warn-ink, #6b4b00); }

.ae-controls { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin: 0 0 8px; }
.ae-pills { list-style: none; display: flex; flex-wrap: wrap; gap: 0; margin: 0 0 10px; padding: 0; }
.ae-controls .ae-pills { margin: 0; }
.ae-pill { display: inline-block; padding: 6px 12px; border: 1px solid #2563eb; color: #1d4ed8; text-decoration: none; font-size: 13px; font-weight: 600; margin: 0 -1px 0 0; background: #fff; }
.ae-pills li:first-child .ae-pill { border-radius: 6px 0 0 6px; }
.ae-pills li:last-child .ae-pill { border-radius: 0 6px 6px 0; }
.ae-pill.is-current { background: #2563eb; color: #fff; }
.ae-inline-form { margin: 0; }
.ae-toggle { padding: 6px 12px; border: 1px solid var(--hs-border-strong, #c7d0da); border-radius: 6px; background: #fff; color: inherit; font: inherit; font-size: 13px; cursor: pointer; }
.ae-toggle[aria-pressed="true"] { background: #eef4ff; border-color: #2563eb; color: #1d4ed8; font-weight: 600; }

.ae-scroll { position: relative; overflow-x: auto; max-width: 100%; }
.ae-scroll:focus-visible { outline: 3px solid var(--hs-focus, #0b5cad); outline-offset: 2px; }
.ae-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ae-table th, .ae-table td { padding: 7px 9px; border-bottom: 1px solid var(--hs-border, #e3e8ee); text-align: left; vertical-align: top; }
.ae-table thead th { font-size: 12px; font-weight: 700; color: var(--hs-ink-muted, #55657a); border-bottom-width: 2px; vertical-align: bottom; }
.ae-table tbody th { font-weight: 600; }
.ae-table .ae-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ae-table-compact { max-width: 44rem; }
.ae-compare thead th { white-space: normal; min-width: 5rem; }
.ae-compare thead th:first-child { min-width: 14rem; }
.ae-wrap-cell { white-space: normal; min-width: 14rem; }
.ae-benchmark th, .ae-benchmark td { background: var(--hs-ground, #f4f7f9); font-weight: 600; }
tr.is-chosen th, tr.is-chosen td { background: #f3f7ff; }
tr.is-chosen th { box-shadow: inset 3px 0 0 #2563eb; }
.ae-sort { color: inherit; text-decoration: none; }
.ae-sort:hover { text-decoration: underline; }
.ae-sort.is-current { color: var(--hs-ink, #1a2a3b); text-decoration: underline; }
.ae-tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 3px 0 0; }
.ae-tag { font-size: 11px; font-weight: 600; padding: 0 7px; border-radius: 999px; background: var(--hs-ground, #f4f7f9); border: 1px solid var(--hs-border, #e3e8ee); color: var(--hs-ink-muted, #55657a); }

.ae-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; }
.ae-breakdown { min-width: 0; margin: 0 0 12px; }
.ae-chart { position: relative; height: 260px; margin: 0 0 6px; }
.ae-chart-hbar, .ae-chart-rank { height: 420px; }
.ae-table-toggle summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--hs-link, #0b5cad); margin: 4px 0 8px; }

.ae-about summary { cursor: pointer; font-weight: 600; font-size: 14px; margin: 10px 0 6px; }
.ae-files, .ae-notes { margin: 6px 0 8px; padding: 0 0 0 18px; font-size: 13px; line-height: 1.55; }
.ae-files li { overflow-wrap: anywhere; }
.ae-defs { display: grid; grid-template-columns: minmax(10rem, 16rem) 1fr; gap: 8px 18px; margin: 8px 0 0; font-size: 13px; line-height: 1.5; }
.ae-defs dt { font-weight: 700; }
.ae-defs dd { margin: 0; }
.ae-share-input { width: 100%; margin: 6px 0 0; font-size: 13px; }
.ae-foot { margin: 8px 0 0; max-width: 100ch; }

@media (max-width: 900px) {
  .ae-grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .ae-card { padding: 12px; }
  .ae-select, .ae-input { min-width: 0; width: 100%; }
  .ae-filter-row .ae-field { flex: 1 1 100%; }
  .ae-tile-value { font-size: 20px; }
  .ae-defs { grid-template-columns: 1fr; }
  .ae-chart-hbar, .ae-chart-rank { height: 520px; }
}
