/* Find Care Scotland — minimal directory styles (expand as needed) */
/* Self-hosted fonts (latin + latin-ext): Bricolage Grotesque, IBM Plex Sans. SIL Open Font Licence. */
/* latin-ext */
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 500 800;
  font-stretch: 100%;
  font-display: swap;
  src: url('/assets/fonts/bricolage-grotesque-500-800-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 500 800;
  font-stretch: 100%;
  font-display: swap;
  src: url('/assets/fonts/bricolage-grotesque-500-800-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400;
  font-stretch: 100%;
  font-display: swap;
  src: url('/assets/fonts/ibm-plex-sans-400-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400;
  font-stretch: 100%;
  font-display: swap;
  src: url('/assets/fonts/ibm-plex-sans-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 500;
  font-stretch: 100%;
  font-display: swap;
  src: url('/assets/fonts/ibm-plex-sans-400-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 500;
  font-stretch: 100%;
  font-display: swap;
  src: url('/assets/fonts/ibm-plex-sans-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 600;
  font-stretch: 100%;
  font-display: swap;
  src: url('/assets/fonts/ibm-plex-sans-400-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 600;
  font-stretch: 100%;
  font-display: swap;
  src: url('/assets/fonts/ibm-plex-sans-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Loch ink + thistle — see CLAUDE.md Design Context */
  --ink: #0d2b2e;
  --ink-soft: #2f484b;
  --muted: #53686a;
  --paper: #f7f5f0;
  --surface: #ffffff;
  --rule: #dcd8cd;
  --rule-soft: #ebe8df;
  --brand: #0e5f5a;
  --brand-deep: #0a4440;
  --brand-tint: #e6f1ef;
  --thistle: #5b3a8c;
  --thistle-deep: #3f2766;
  --thistle-tint: #f1ecf8;
  --gold: #b8892b;
  --gold-tint: #f8f0dc;
  --radius: 6px;
  --radius-lg: 10px;
}
:root {
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: 'IBM Plex Sans', system-ui, -apple-system, Segoe UI, sans-serif; background: var(--paper); color: var(--ink); line-height: 1.5; }
h1, h2, h3, h4,
.home-hero__h1, .hero h1, .council-map-page-header h1, .profile-header h1,
.profile-overview-header h1, .provider-overview-header h1, .insights-header h1,
.news-page__header h1, .cm-header h1, .complaints-hub-header h1, .logo {
  font-family: 'Bricolage Grotesque', 'IBM Plex Sans', system-ui, sans-serif;
  font-weight: 600;
}
a { color: var(--brand); }
.container { max-width: 1100px; margin: 0 auto; padding: 0 1.25rem; }

.site-header { background: #fff; border-bottom: 1px solid var(--rule); padding: 0.75rem 0; }
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }

.nav-disclosure { position: relative; display: flex; align-items: center; }
.nav-toggle-input {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
.nav-toggle {
  display: none;
  width: 2.5rem; height: 2.5rem;
  align-items: center; justify-content: center;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.25rem;
  color: var(--brand);
  user-select: none;
}
.nav-toggle:hover { background: var(--brand-tint); }
.nav-toggle-input:focus-visible + .nav-toggle { outline: 2px solid var(--brand); outline-offset: 2px; }

.site-header__nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem 1.1rem;
  font-size: 0.92rem;
}
.site-header__nav a { color: var(--brand); font-weight: 600; text-decoration: none; }
.site-header__nav a:hover { text-decoration: underline; }
.site-header__nav a[aria-current="page"] { text-decoration: underline; }
.logo { font-weight: 700; color: var(--brand); text-decoration: none; display: inline-flex; align-items: center; gap: 0.35rem; }
.logo-icon { color: #c41e3a; display: inline-flex; }

@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .site-header__nav {
    display: flex;
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    z-index: 20;
    flex-direction: column;
    align-items: flex-start;
    flex-wrap: nowrap;
    gap: 0.25rem;
    min-width: 200px;
    background: #fff;
    border: 1px solid var(--rule);
    border-radius: 10px;
    padding: 0.6rem;
    box-shadow: 0 8px 24px rgba(10, 30, 20, 0.12);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-6px);
    transition: opacity 180ms var(--ease-out-quart), transform 180ms var(--ease-out-quart), visibility 0s linear 180ms;
  }
  .nav-toggle-input:checked ~ .site-header__nav {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
    transition: opacity 180ms var(--ease-out-quart), transform 180ms var(--ease-out-quart), visibility 0s linear 0s;
  }
  .site-header__nav a { display: block; width: 100%; padding: 0.5rem 0.6rem; border-radius: 6px; transition: background 150ms var(--ease-out-quart); }
  .site-header__nav a:hover { background: var(--brand-tint); text-decoration: none; }
}

/* ── Homepage hero ──────────────────────────────────────────── */
.home-hero {
  background: linear-gradient(135deg, var(--brand-deep) 0%, var(--brand) 100%);
  padding: 4rem 0 3.5rem;
  text-align: center;
}
.home-hero__inner { max-width: 700px; margin: 0 auto; }
.home-hero__inner > * { animation: hero-rise 600ms var(--ease-out-quart) both; }
.home-hero__inner > *:nth-child(1) { animation-delay: 0ms; }
.home-hero__inner > *:nth-child(2) { animation-delay: 80ms; }
.home-hero__inner > *:nth-child(3) { animation-delay: 150ms; }
.home-hero__inner > *:nth-child(4) { animation-delay: 220ms; }
@keyframes hero-rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
.home-hero__h1 {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  color: #fff;
  margin: 0 0 0.75rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.home-hero__sub {
  color: rgba(255,255,255,0.82);
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  margin: 0 0 2rem;
  line-height: 1.55;
}
.home-hero__form {
  display: flex;
  gap: 0;
  max-width: 580px;
  margin: 0 auto 1.5rem;
  box-shadow: 0 4px 24px rgba(0,0,0,0.2);
  border-radius: 10px;
  overflow: hidden;
  transition: box-shadow 200ms var(--ease-out-quart);
}
.home-hero__form:focus-within { box-shadow: 0 4px 24px rgba(0,0,0,0.2), 0 0 0 3px rgba(255,255,255,0.55); }
.home-hero__input {
  flex: 1;
  min-width: 0;
  height: 52px;
  border: none;
  padding: 0 1rem;
  font-size: 1rem;
  background: #fff;
  color: var(--ink);
}
.home-hero__input:focus { outline: none; }
.home-hero__btn {
  height: 52px;
  padding: 0 1.5rem;
  background: #c41e3a;
  color: #fff;
  border: none;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 150ms var(--ease-out-quart), transform 100ms var(--ease-out-quart);
}
.home-hero__btn:hover { background: #a8172e; }
.home-hero__btn:active { transform: scale(0.97); }
.home-hero__links {
  color: rgba(255,255,255,0.65);
  font-size: 0.88rem;
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.home-hero__links a { color: rgba(255,255,255,0.85); text-decoration: none; }
.home-hero__links a:hover { color: #fff; text-decoration: underline; }
.home-hero__links span { opacity: 0.4; }

/* ── Proof: real grade data + trust stats ────────────────────── */
.home-proof {
  background: #fff;
  border-bottom: 1px solid var(--rule);
  padding: clamp(2rem, 4vw, 3.25rem) 0;
}
.home-proof__grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
@media (max-width: 780px) { .home-proof__grid { grid-template-columns: 1fr; } }

.home-proof__h { font-size: clamp(1.15rem, 2vw, 1.4rem); margin: 0 0 0.5rem; color: var(--brand-deep); letter-spacing: -0.01em; }
.home-proof__p { font-size: 0.92rem; color: #555; margin: 0 0 1.5rem; line-height: 1.55; max-width: 40rem; }

.grade-bars { display: flex; flex-direction: column; gap: 0.55rem; }
.grade-bar-row { display: grid; grid-template-columns: 6.5rem 1fr 3rem; align-items: center; gap: 0.75rem; }
.grade-bar-label { font-size: 0.8rem; color: #555; text-align: right; }
.grade-bar-track { background: #f0efe9; border-radius: 999px; height: 10px; overflow: hidden; }
.grade-bar-fill {
  height: 100%;
  border-radius: 999px;
  transform-origin: left;
  animation: grade-bar-grow 700ms var(--ease-out-quint) both;
}
.grade-bar-row:nth-child(1) .grade-bar-fill { animation-delay: 0ms; }
.grade-bar-row:nth-child(2) .grade-bar-fill { animation-delay: 70ms; }
.grade-bar-row:nth-child(3) .grade-bar-fill { animation-delay: 140ms; }
.grade-bar-row:nth-child(4) .grade-bar-fill { animation-delay: 210ms; }
.grade-bar-row:nth-child(5) .grade-bar-fill { animation-delay: 280ms; }
.grade-bar-row:nth-child(6) .grade-bar-fill { animation-delay: 350ms; }
@keyframes grade-bar-grow {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}
.grade-bar-fill--g1 { background: var(--grade-1); }
.grade-bar-fill--g2 { background: var(--grade-2); }
.grade-bar-fill--g3 { background: var(--grade-3); }
.grade-bar-fill--g4 { background: var(--grade-4); }
.grade-bar-fill--g5 { background: var(--grade-5); }
.grade-bar-fill--g6 { background: var(--grade-6); }
.grade-bar-pct { font-size: 0.8rem; color: #666; text-align: right; font-variant-numeric: tabular-nums; }
.home-proof__chart-link { display: inline-block; margin-top: 1.25rem; font-size: 0.88rem; font-weight: 600; color: var(--brand); text-decoration: none; }
.home-proof__chart-link:hover { text-decoration: underline; }

.home-proof__stats { border-left: 1px solid var(--rule); padding-left: clamp(1.5rem, 3vw, 2.5rem); }
@media (max-width: 780px) { .home-proof__stats { border-left: none; padding-left: 0; border-top: 1px solid var(--rule); padding-top: 1.5rem; } }
.home-proof__lead { margin-bottom: 1.25rem; }
.home-proof__num {
  display: block;
  font-size: clamp(2.25rem, 5vw, 3rem);
  font-weight: 700;
  color: var(--brand);
  line-height: 1;
  letter-spacing: -0.02em;
}
.home-proof__num-label { display: block; font-size: 0.85rem; color: #666; margin-top: 0.4rem; }
.home-proof__list { list-style: none; margin: 0; padding: 1rem 0 0; border-top: 1px solid var(--rule); font-size: 0.88rem; color: #555; }
.home-proof__list li { padding: 0.4rem 0; }
.home-proof__list strong { color: var(--ink); font-weight: 700; }

/* ── Shared section heading ─────────────────────────────────── */
.home-section-h {
  font-size: 1.2rem;
  margin: 0 0 1.1rem;
  color: var(--ink);
}

/* ── Homepage news section ──────────────────────────────────── */
.home-news {
  background: #fff;
  border-top: 1px solid var(--rule);
  padding: 2.5rem 0;
}
.home-news__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.home-news__sub { font-size: 0.85rem; color: #777; margin: 0.25rem 0 0; }
.home-news__all {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--brand);
  text-decoration: none;
  white-space: nowrap;
}
.home-news__all:hover { text-decoration: underline; }
.news-grid--home { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.news-card__provider {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--brand);
  text-decoration: none;
  margin-bottom: 0.3rem;
}
.news-card__provider:hover { text-decoration: underline; }

/* Legacy hero (used on non-home pages if referenced) */
.hero { background: linear-gradient(180deg, #fff 0%, var(--brand-tint) 100%); padding: 2rem 0 1.5rem; border-bottom: 1px solid var(--rule); }
.hero h1 { font-size: clamp(1.35rem, 3vw, 1.85rem); margin: 0 0 0.5rem; }
.hero-sub { color: #555; margin: 0 0 1rem; }
.search-form { display: flex; gap: 0.5rem; flex-wrap: wrap; max-width: 640px; }
.search-input { flex: 1; min-width: 200px; height: 44px; border: 1px solid #ccc; border-radius: 8px; padding: 0 12px; font-size: 1rem; }
.btn-primary { height: 44px; padding: 0 20px; background: var(--brand); color: #fff; border: none; border-radius: 8px; font-weight: 600; cursor: pointer; transition: background 150ms var(--ease-out-quart), transform 100ms var(--ease-out-quart); }
.btn-primary:hover { background: var(--brand-deep); }
.btn-secondary { height: 44px; padding: 0 16px; background: #fff; color: var(--brand); border: 1px solid var(--brand); border-radius: 8px; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; transition: background 150ms var(--ease-out-quart), transform 100ms var(--ease-out-quart); }
.btn-secondary:hover { background: var(--brand-tint); }
.btn-primary:active, .btn-secondary:active { transform: scale(0.97); }

.directory { padding: 1.5rem 0 3rem; }

.council-map-promo {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1rem;
  margin-bottom: 1.1rem;
  padding: 0.65rem 0.85rem;
  background: var(--brand-tint);
  border: 1px solid #c5d5ce;
  border-radius: 10px;
}
.council-map-promo__link { font-weight: 600; color: var(--brand); text-decoration: none; }
.council-map-promo__link:hover { text-decoration: underline; }
.council-map-promo__meta { font-size: 0.82rem; color: #555; }

body.council-map-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.council-map-page-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding-bottom: 1rem;
}
.council-map-page-header h1 {
  font-size: clamp(1.2rem, 2.5vw, 1.55rem);
  margin: 0.35rem 0 0.35rem;
}
.council-map-page-lead {
  font-size: 0.9rem;
  color: #555;
  max-width: 62ch;
  margin: 0 0 0.75rem;
  line-height: 1.45;
}
.council-map-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin: 0 0 1rem;
}
.council-map {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--rule);
  overflow: hidden;
  background: #e8f2ee;
}
.council-map .leaflet-container {
  font-family: inherit;
  border-radius: 10px;
}
.council-map--page {
  flex: 1 1 auto;
  min-height: max(540px, calc(100dvh - 200px));
}
@media (min-width: 900px) {
  .council-map--page {
    min-height: max(640px, calc(100dvh - 185px));
  }
}
.site-footer--compact {
  margin-top: auto;
  padding: 0.85rem 0;
  font-size: 0.78rem;
}

.filter-bar {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}
.filter-bar__row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.filter-bar__row--secondary {
  padding-top: 0.15rem;
  border-top: 1px solid #e8e6e0;
}
.filter-bar select {
  height: 38px;
  border-radius: 6px;
  border: 1px solid #ccc;
  padding: 0 8px;
  background: #fff;
  max-width: 100%;
}
.filter-bar__provider {
  flex: 1 1 220px;
  min-width: min(220px, 100%);
}
.filter-bar__note {
  font-size: 0.78rem;
  color: #666;
  margin: 0;
  width: 100%;
  max-width: 100%;
  line-height: 1.45;
}

.directory-slice-meta {
  font-size: 0.88rem;
  color: #444;
  margin: 0 0 1rem;
  padding: 0.5rem 0.65rem;
  background: #faf9f7;
  border: 1px solid var(--rule);
  border-radius: 8px;
}
.filter-bar__reset {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--brand);
  margin-left: auto;
}
.filter-bar__row--secondary .results-count {
  margin-left: 0;
  font-size: 0.9rem;
  color: #666;
}
@media (min-width: 720px) {
  .filter-bar__row--secondary .results-count {
    margin-left: auto;
  }
}

.results-count { font-size: 0.9rem; color: #666; }

/* Results toolbar: count + view toggle */
.results-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.75rem; }
.results-toolbar .directory-slice-meta { margin-bottom: 0; }
.view-toggle { display: flex; gap: 4px; }
.view-btn { display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px; border: 1px solid #ddd; border-radius: 6px; background: #fff; font-size: 0.82rem; color: #555; cursor: pointer; transition: background 0.15s, color 0.15s; }
.view-btn[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.view-btn:hover:not([aria-pressed="true"]) { background: #f0f0f0; }

/* Card grid */
.cards-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

/* Directory table view */
.dir-table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--rule); border-radius: 10px; }
.dir-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.dir-table thead { position: sticky; top: 0; z-index: 1; }
.dir-table th { background: #f5f4f0; padding: 9px 12px; text-align: left; white-space: nowrap; border-bottom: 2px solid var(--rule); font-size: 0.78rem; color: #555; }
.dir-table th a { color: #333; text-decoration: none; display: inline-flex; align-items: center; gap: 2px; }
.dir-table th a:hover { color: var(--brand); }
.dir-table td { padding: 8px 12px; border-bottom: 1px solid #f0eeea; vertical-align: middle; }
.dir-table tbody tr:last-child td { border-bottom: none; }
.dir-table tbody tr:hover td { background: #faf9f7; }
.sort-active { color: var(--brand); font-size: 0.75rem; }
.sort-hint   { color: #ccc; font-size: 0.75rem; }
.dt-name a   { font-weight: 600; color: var(--ink); text-decoration: none; }
.dt-name a:hover { text-decoration: underline; color: var(--brand); }
.dt-town  { display: block; font-size: 0.78rem; color: #888; margin-top: 1px; }
.dt-type, .dt-council { font-size: 0.82rem; color: #555; white-space: nowrap; }
.dt-date  { white-space: nowrap; font-size: 0.82rem; color: #777; }
.dt-beds  { text-align: right; color: #777; font-size: 0.82rem; }
.dt-avg   { text-align: center; }
.dt-grade { text-align: center; }
.grade-pip { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; font-size: 0.8rem; font-weight: 700; background: var(--g); color: #fff; }
.grade-pip.grade-g3, .grade-pip.grade-g4, .grade-pip.grade-g5 { color: var(--ink); }
.service-card {
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 200ms var(--ease-out-quart), box-shadow 200ms var(--ease-out-quart), border-color 200ms var(--ease-out-quart);
}
.service-card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(10, 30, 20, 0.09); border-color: #d3e6dd; }
.service-card.card--premium { border-color: var(--brand); box-shadow: 0 4px 14px rgba(15, 110, 86, 0.08); }
.service-card.card--premium:hover { box-shadow: 0 10px 24px rgba(15, 110, 86, 0.16); }
.card-body { padding: 1.1rem 1.2rem; flex: 1; }
.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem; align-items: flex-start; margin-bottom: 0.35rem; }
.card-name { font-size: 1.05rem; margin: 0; }
.card-name a { color: var(--brand); text-decoration: none; }
.card-name a:hover { text-decoration: underline; }
.type-badge { font-size: 0.72rem; padding: 2px 8px; border-radius: 999px; background: var(--brand-tint); color: var(--brand-deep); white-space: nowrap; }
.card-location { color: #555; font-size: 0.9rem; margin: 0.25rem 0 0.75rem; }
.card-grade-published { font-size: 0.8rem; color: #666; margin: 0.35rem 0 0; }
.card-tagline { color: #333; font-style: italic; margin: 0 0 0.75rem; }

.tier-badge { position: absolute; top: 10px; right: 10px; font-size: 0.7rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.tier-pro { background: var(--ink); color: #fff; }
.tier-premium { background: #c9a227; color: var(--ink); }
.service-card { position: relative; }

.grade-row { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; margin-top: 0.5rem; }
.grade-avg { font-weight: 700; padding: 4px 10px; border-radius: 6px; font-size: 0.95rem; }
.grade-label-text { font-size: 0.8rem; color: #666; }
.grade-pill { font-size: 0.75rem; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--rule); }

/* ── Grade color scale (1=Unsatisfactory … 6=Excellent) ──────
   Canonical across the whole site: directory pills/pips, service
   grade cards, and the Insights/homepage charts all share these
   six hues (defined once as tokens) so a color always means the
   same grade everywhere. Text/tint variants are darkened where
   needed to keep 4.5:1 contrast (orange/gold/olive hues are too
   light to use as their own text color). ── */
:root {
  --grade-1: #8b1538; --grade-1-tint: #f7e9ee; --grade-1-border: #e3b9c7; --grade-1-text: #8b1538;
  --grade-2: #b83232; --grade-2-tint: #fbeceb; --grade-2-border: #eec3c1; --grade-2-text: #b83232;
  --grade-3: #c97a2d; --grade-3-tint: #fbf1e6; --grade-3-border: #eed3b7; --grade-3-text: #7d4c1c;
  --grade-4: #c9a227; --grade-4-tint: #fbf6e3; --grade-4-border: #eee0ae; --grade-4-text: #6f5915;
  --grade-5: #6a9c3e; --grade-5-tint: #eef5e7; --grade-5-border: #cde3ba; --grade-5-text: #405e25;
  --grade-6: #0f6e56; --grade-6-tint: #e8f5ef; --grade-6-border: #b8e0cc; --grade-6-text: #0f6e56;
}
.grade-g1 { --g: var(--grade-1); --g-tint: var(--grade-1-tint); --g-border: var(--grade-1-border); --g-text: var(--grade-1-text); }
.grade-g2 { --g: var(--grade-2); --g-tint: var(--grade-2-tint); --g-border: var(--grade-2-border); --g-text: var(--grade-2-text); }
.grade-g3 { --g: var(--grade-3); --g-tint: var(--grade-3-tint); --g-border: var(--grade-3-border); --g-text: var(--grade-3-text); }
.grade-g4 { --g: var(--grade-4); --g-tint: var(--grade-4-tint); --g-border: var(--grade-4-border); --g-text: var(--grade-4-text); }
.grade-g5 { --g: var(--grade-5); --g-tint: var(--grade-5-tint); --g-border: var(--grade-5-border); --g-text: var(--grade-5-text); }
.grade-g6 { --g: var(--grade-6); --g-tint: var(--grade-6-tint); --g-border: var(--grade-6-border); --g-text: var(--grade-6-text); }

.grade-pill, .grade-avg, .avg-grade-circle, .grade-card {
  background: var(--g-tint);
  color: var(--g-text);
  border-color: var(--g-border);
}

.card-meta { font-size: 0.85rem; color: #666; display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; margin-top: 0.5rem; }
.vacancy.has-vacancy { color: var(--brand); font-weight: 600; }
.vacancy.no-vacancy { color: #888; }

.card-footer { padding: 0.85rem 1.2rem; border-top: 1px solid #f0ede8; display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: space-between; align-items: center; }
.btn-view { font-size: 0.88rem; font-weight: 600; color: var(--brand); text-decoration: none; }
.btn-claim { font-size: 0.82rem; color: #666; text-decoration: none; }
.btn-claim:hover { color: var(--brand); }

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-top: 1.5rem;
  max-width: 100%;
}
.pagination a,
.pagination span:not(.pagination__ellipsis) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 8px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
  text-decoration: none;
  color: #333;
  font-size: 0.9rem;
}
.pagination a:hover { border-color: var(--brand); color: var(--brand); }
.pagination a.active, .pagination span.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.pagination__ellipsis {
  border: none;
  background: transparent;
  min-width: auto;
  padding: 0 0.15rem;
  color: #888;
  font-size: 0.9rem;
}
.pagination__step {
  font-weight: 600;
  min-width: 40px;
}
.pagination__meta {
  width: 100%;
  flex-basis: 100%;
  font-size: 0.82rem;
  color: #666;
  margin-bottom: 0.25rem;
}

.provider-cta { background: var(--brand); color: #fff; padding: 2rem 0; text-align: center; }
.provider-cta h2 { margin: 0 0 0.5rem; }
.provider-cta p { max-width: 560px; margin: 0 auto 1rem; opacity: 0.95; }
.provider-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: center;
  align-items: center;
}
.provider-cta .btn-primary { background: #fff; color: var(--brand); }
.provider-cta .btn-primary:hover { background: var(--brand-tint); }
.provider-cta .btn-secondary:hover { background: rgba(255,255,255,0.12); }
.provider-cta .btn-secondary { border-color: #fff; color: #fff; }

.grade-scale { font-size: 0.72rem; font-weight: 500; opacity: 0.9; }

.site-footer { padding: 1.5rem 0; text-align: center; font-size: 0.82rem; color: #777; border-top: 1px solid var(--rule); margin-top: 2rem; background: #fff; }
.site-footer a { color: var(--brand); }
.site-footer__legal { margin-top: 0.6rem; font-size: 0.8rem; color: #999; }
.site-footer__legal a { color: #777; }
.site-footer__legal a:hover { color: var(--brand); }
.site-footer__admin { margin-top: 0.5rem; font-size: 0.78rem; }
.site-footer__admin a { color: #aaa; }
.site-footer__admin a:hover { color: var(--brand); }

/* ── Legal pages (terms, privacy) ─────────────────────────────── */
.legal-page { max-width: 720px; padding: 1.5rem 0 3rem; }
.legal-page h1 { font-size: clamp(1.5rem, 3vw, 1.9rem); margin: 0.5rem 0 0.25rem; }
.legal-updated { color: #888; font-size: 0.85rem; margin: 0 0 1.75rem; }
.legal-page h2 { font-size: 1.05rem; margin: 1.75rem 0 0.6rem; color: var(--brand-deep); }
.legal-page p { line-height: 1.65; color: #333; margin: 0 0 0.85rem; }
.legal-page ul { line-height: 1.65; color: #333; margin: 0 0 0.85rem; padding-left: 1.2rem; }
.legal-page li { margin-bottom: 0.4rem; }
.legal-page a { color: var(--brand); }

/* ── Cookie banner (assets/js/cookie-banner.js) ──────────────── */
.cookie-banner {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 100;
  background: var(--brand-deep);
  color: #f0f4f2;
  padding: 1rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem 1.5rem;
  font-size: 0.88rem;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.12);
}
.cookie-banner p { margin: 0; max-width: 46rem; line-height: 1.5; }
.cookie-banner a { color: #fff; text-decoration: underline; }
.cookie-banner__btn {
  flex-shrink: 0;
  background: #fff;
  color: var(--brand-deep);
  border: none;
  padding: 0.55rem 1.25rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
}
.cookie-banner__btn:hover { background: #e8f5ef; }
@media (prefers-reduced-motion: no-preference) {
  .cookie-banner { animation: cookie-banner-in 0.25s ease-out; }
}
@keyframes cookie-banner-in {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.no-results { text-align: center; padding: 3rem; color: #666; }

/* Profile */
.profile-layout { display: grid; grid-template-columns: 1fr 320px; gap: 1.5rem; padding: 1.5rem 0 3rem; max-width: 1100px; margin: 0 auto; padding-left: 1.25rem; padding-right: 1.25rem; }
@media (max-width: 900px) { .profile-layout { grid-template-columns: 1fr; } }

.breadcrumb { font-size: 0.85rem; color: #666; margin-bottom: 1rem; }
.breadcrumb a { color: var(--brand); text-decoration: none; }
.profile-header { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: flex-start; margin-bottom: 1rem; }
.profile-header h1 { margin: 0.35rem 0 0; font-size: 1.5rem; color: var(--ink); }
.status-badge { font-size: 0.75rem; padding: 2px 8px; border-radius: 4px; margin-left: 0.35rem; }
.status-active { background: #e8f5ef; color: var(--brand); }
.profile-grade-summary { flex-shrink: 0; max-width: 220px; text-align: right; }
@media (max-width: 640px) { .profile-grade-summary { text-align: left; max-width: none; } }
.avg-grade-circle {
  width: 136px;
  min-height: 136px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  margin-left: auto;
  padding: 0.5rem;
  box-sizing: border-box;
}
@media (max-width: 640px) { .avg-grade-circle { margin-left: 0; } }
.avg-num { font-size: 2rem; line-height: 1.05; }
.avg-sublabel { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; opacity: 0.95; }
.avg-label { font-size: 0.85rem; font-weight: 500; line-height: 1.25; opacity: 0.92; max-width: 8.5rem; text-align: center; }
.avg-range-hint { font-size: 0.8rem; color: #555; line-height: 1.4; margin: 0.6rem 0 0; font-weight: 400; }

.profile-section { margin-top: 1.75rem; }
.profile-section h2 { font-size: 1.05rem; margin: 0 0 0.75rem; }
.grade-date { font-size: 0.88rem; color: #666; margin: 0 0 0.35rem; }
.grade-date-note { font-size: 0.78rem; color: #777; line-height: 1.45; margin: 0 0 0.75rem; max-width: 42rem; }
.grade-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.65rem; }
.grade-card { border-radius: 10px; padding: 0.75rem; text-align: center; border: 1px solid; }
.grade-card .grade-score { display: block; font-size: 1.4rem; font-weight: 700; color: var(--g-text); }
.grade-card .grade-name { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.03em; color: #444; }
.grade-card .grade-desc { font-size: 0.85rem; color: #555; }
.grade-note { font-size: 0.8rem; color: #777; margin-top: 0.75rem; }
/* Stale inspection data banner */
.stale-banner { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; margin-bottom: 1.25rem; font-size: 0.88rem; line-height: 1.5; border: 1px solid; }
.stale-banner__icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }
.stale-banner a { font-weight: 600; }
.stale-banner--very-old  { background: #fce4ec; border-color: #c62828; color: #7f0000; }
.stale-banner--very-old a { color: #7f0000; text-decoration: underline; }
.stale-banner--old       { background: #fff8e1; border-color: #f9a825; color: #5d4000; }
.stale-banner--old a     { color: var(--thistle); }
.stale-banner--warn      { background: #fff8e1; border-color: #ffe082; color: #5d4000; }
.stale-banner--warn a    { color: #5d4000; text-decoration: underline; }
.stale-banner--ungraded  { background: #e8eaf6; border-color: #5c6bc0; color: #1a237e; }
.stale-banner--ungraded a { color: #3949ab; }

.ci-report-link { display: inline-block; margin-top: 0.85rem; font-size: 0.88rem; color: var(--brand); text-decoration: none; }
.ci-report-link:hover { text-decoration: underline; }

/* Grade history chart */
.chart-wrap { position: relative; margin-top: 1rem; max-height: 280px; }

/* Comparison cards */
.cmp-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-top: 0.75rem; }
.cmp-card { background: #fff; border: 1px solid #e4e4e4; border-radius: 10px; padding: 16px; }
.cmp-card__meta  { font-size: 0.75rem; color: #aaa; margin-bottom: 2px; }
.cmp-card__group { font-size: 0.88rem; font-weight: 600; color: #333; margin-bottom: 10px; line-height: 1.3; }
.cmp-card__headline { font-size: 0.85rem; font-weight: 700; padding: 6px 10px; border-radius: 6px; margin-bottom: 10px; }
.hl--good  { background: #e8f5e9; color: #1b5e20; }
.hl--poor  { background: #fce4ec; color: #b71c1c; }
.hl--mixed { background: #fff8e1; color: var(--thistle); }
.cmp-card__list { list-style: none; padding: 0; margin: 0; font-size: 0.82rem; }
.cmp-item { padding: 3px 0; border-bottom: 1px solid #f5f5f5; color: #444; }
.cmp-item:last-child { border-bottom: none; }
.cmp-item--above { color: #1b5e20; }
.cmp-item--below { color: #b71c1c; }
.cmp-item--inline { color: #555; }
.muted-text { color: #ccc; }

.report-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; margin-top: 0.75rem; }
.report-table th { text-align: left; padding: 7px 10px; background: #f5f5f5; border-bottom: 2px solid #e0e0e0; font-size: 0.8rem; color: #666; }
.report-table td { padding: 8px 10px; border-bottom: 1px solid #f0f0f0; vertical-align: middle; }
.report-table tr:last-child td { border-bottom: none; }
.report-table tr:hover td { background: #fafafa; }
.report-latest td { background: #f5f9ff; }
.report-date { white-space: nowrap; color: #555; width: 130px; }
.report-title { color: #222; }
.report-badge { display: inline-block; font-size: 0.7rem; font-weight: 700; background: var(--brand); color: #fff; padding: 1px 6px; border-radius: 3px; margin-left: 6px; vertical-align: middle; }
.btn-report-dl { display: inline-block; font-size: 0.8rem; padding: 4px 10px; background: #f0f4ff; color: var(--brand); border: 1px solid #bbdefb; border-radius: 4px; text-decoration: none; white-space: nowrap; }
.btn-report-dl:hover { background: var(--brand); color: #fff; }

.fact-list { display: grid; grid-template-columns: 140px 1fr; gap: 0.35rem 1rem; font-size: 0.92rem; }
.fact-list dt { color: #777; margin: 0; }
.fact-list dd { margin: 0; }

.claim-nudge {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: #f4faf8;
  border: 1px solid var(--rule);
  padding: 1.25rem 1.5rem;
  margin-top: 1.75rem;
}
.claim-nudge__body { flex: 1; min-width: 240px; }
.claim-nudge__h { font-size: 1.05rem; margin: 0 0 0.3rem; color: var(--brand-deep); }
.claim-nudge__body p { margin: 0; font-size: 0.92rem; color: #3a3a36; line-height: 1.5; max-width: 42rem; }
.claim-nudge__btn {
  flex-shrink: 0;
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.65rem 1.25rem;
  border-radius: 8px;
  text-decoration: none;
  white-space: nowrap;
  transition: background 150ms var(--ease-out-quart), transform 100ms var(--ease-out-quart);
}
.claim-nudge__btn:hover { background: var(--brand-deep); }
.claim-nudge__btn:active { transform: scale(0.97); }

.profile-sidebar .sidebar-card { background: #fff; border: 1px solid var(--rule); border-radius: 10px; padding: 1rem; margin-bottom: 1rem; }
.sidebar-card--ci { border-color: #bbdefb; background: #f5f9ff; }
.btn-ci-report { display: block; text-align: center; background: var(--brand); color: #fff; padding: 9px 14px; border-radius: 6px; font-size: 0.88rem; font-weight: 600; text-decoration: none; }
.btn-ci-report:hover { background: #0d47a1; }
.profile-sidebar h3 { margin: 0 0 0.75rem; font-size: 0.95rem; }

.enquiry-form label { display: block; font-size: 0.82rem; margin-bottom: 0.65rem; color: #444; }
.enquiry-form input, .enquiry-form textarea { width: 100%; margin-top: 0.25rem; padding: 0.45rem 0.5rem; border: 1px solid #ccc; border-radius: 6px; font: inherit; }
.form-error { color: #a32d2d; font-size: 0.88rem; }
.enquiry-success { color: var(--brand); font-weight: 600; }
.form-note { font-size: 0.75rem; color: #888; margin-top: 0.5rem; }

.profile-tagline { font-size: 1.05rem; color: #333; margin: 0 0 1rem; }
.profile-description { margin-bottom: 1rem; }

.fact-hint { font-size: 0.78rem; color: #888; font-weight: 400; }

.sibling-note { font-size: 0.88rem; color: #555; margin: 0 0 0.75rem; line-height: 1.5; }
.sibling-list { list-style: none; margin: 0; padding: 0; }
.sibling-list li { padding: 0.5rem 0; border-top: 1px solid #f0ede8; font-size: 0.92rem; }
.sibling-list li:first-child { border-top: none; }
.sibling-list a { color: var(--brand); font-weight: 600; text-decoration: none; }
.sibling-list a:hover { text-decoration: underline; }

/* Provider overview (/provider/{sp}/{slug}) */
.provider-overview { padding: 1rem 0 3rem; }
.provider-overview-header h1 { font-size: 1.45rem; margin: 0 0 0.35rem; color: var(--ink); }
.provider-overview-meta { color: #555; font-size: 0.92rem; margin: 0 0 1.5rem; line-height: 1.45; }
.provider-overview-stats .stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.stat-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  text-align: center;
}
.stat-card .stat-value { display: block; font-size: 1.5rem; font-weight: 700; color: var(--brand); }
.stat-card .stat-label { font-size: 0.72rem; color: #666; line-height: 1.3; }
.provider-subh { font-size: 0.88rem; margin: 1rem 0 0.4rem; color: #444; }
.provider-type-list { margin: 0; padding-left: 1.2rem; font-size: 0.88rem; color: #444; }
.provider-type-list .type-count { font-weight: 700; color: var(--brand); margin-right: 0.25rem; }
.provider-councils { font-size: 0.85rem; color: #555; line-height: 1.45; margin: 0; }

.provider-service-table-wrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: 10px; background: #fff; scroll-margin-top: 0.75rem; }
.provider-service-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.provider-service-table th,
.provider-service-table td { padding: 0.55rem 0.75rem; text-align: left; border-bottom: 1px solid #eee; vertical-align: top; }
.provider-service-table th {
  background: var(--paper);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #555;
  vertical-align: bottom;
  padding: 0.45rem 0.5rem;
}
.provider-service-table th .th-sort {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  width: 100%;
  box-sizing: border-box;
  color: #2a2a2a;
  text-decoration: none;
  font-weight: 600;
  border-radius: 6px;
  padding: 0.4rem 0.5rem;
  border: 1px solid #c5d5ce;
  background: #fff;
  box-shadow: 0 1px 0 rgba(15, 110, 86, 0.06);
  transition: border-color 0.12s ease, box-shadow 0.12s ease, color 0.12s ease;
}
.provider-service-table th .th-sort:hover {
  color: var(--brand);
  border-color: var(--brand);
  box-shadow: 0 1px 3px rgba(15, 110, 86, 0.12);
}
.provider-service-table th .th-sort:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
.provider-service-table th .th-sort--active {
  color: var(--brand);
  border-color: var(--brand);
  background: #f0faf7;
}
.provider-service-table th .th-sort__glyph {
  flex-shrink: 0;
  font-size: 0.72rem;
  line-height: 1;
  color: #7a8f99;
  font-weight: 700;
  min-width: 1em;
  text-align: center;
}
.provider-service-table th .th-sort--active .th-sort__glyph { color: var(--brand); }
.provider-service-table th .th-sort:hover .th-sort__glyph { color: var(--brand); }
.provider-service-table tbody tr:last-child td { border-bottom: none; }
.provider-service-table tr.row-muted td { color: #999; }
.provider-service-table a { color: var(--brand); font-weight: 600; text-decoration: none; }
.provider-service-table a:hover { text-decoration: underline; }
.provider-service-table .td-sub { font-size: 0.8rem; color: #888; font-weight: 400; }

.provider-filters {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  margin-bottom: 0.75rem;
}
.provider-filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  align-items: flex-end;
}
.provider-filter {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.78rem;
  color: #555;
}
.provider-filter span { font-weight: 600; }
.provider-filter select,
.provider-filter input[type="search"] {
  min-width: 10rem;
  height: 36px;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 0 0.5rem;
  font: inherit;
  background: #fff;
}
.provider-filter--grow { flex: 1 1 180px; }
.provider-filter--grow input { width: 100%; min-width: 0; }
.provider-filters-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.provider-filters .btn-primary {
  height: 36px;
  padding: 0 1rem;
  border-radius: 6px;
  border: none;
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}
.provider-filters .btn-secondary {
  height: 36px;
  padding: 0 1rem;
  border-radius: 6px;
  border: 1px solid #ccc;
  background: #fff;
  color: #333;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.provider-results-meta { font-size: 0.88rem; color: #555; margin: 0 0 0.75rem; }
.provider-results-meta .filter-active { color: var(--brand); font-weight: 600; }
.provider-overview-linkrow { margin: 0.5rem 0 0; font-size: 0.9rem; }
.provider-overview-linkrow a { color: var(--brand); font-weight: 600; text-decoration: none; }
.provider-overview-linkrow a:hover { text-decoration: underline; }

/* Provider analytics section */
.pa-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-bottom: 1rem; }
.pa-tile { background: #fff; border: 1px solid #e4e4e4; border-radius: 10px; padding: 16px; text-align: left; }
.pa-tile--good  { border-color: #a5d6a7; background: #f1f8f1; }
.pa-tile--vgood { border-color: #81c784; background: #e8f5e9; }
.pa-tile__val   { font-size: 2rem; font-weight: 700; line-height: 1; color: var(--ink); display: block; }
.pa-tile--good  .pa-tile__val { color: #2e7d32; }
.pa-tile--vgood .pa-tile__val { color: #1b5e20; }
.pa-tile__label { font-size: 0.78rem; color: #666; margin-top: 6px; line-height: 1.35; display: block; }
.pa-tile--btn   { cursor: pointer; transition: box-shadow 0.15s, transform 0.1s; font-family: inherit; }
.pa-tile--btn:hover { box-shadow: 0 2px 10px rgba(0,0,0,0.1); transform: translateY(-1px); }
.pa-tile--btn:hover .pa-tile__cta { color: var(--brand); }
.pa-tile--active { outline: 2px solid var(--brand); box-shadow: 0 0 0 4px rgba(21,101,192,0.1); }
.pa-tile__cta  { font-size: 0.75rem; color: #888; margin-top: 8px; display: block; }

/* Drilldown panels */
.pa-drill { background: #fff; border: 1px solid #e4e4e4; border-radius: 10px; padding: 20px; margin-bottom: 1.25rem; }
.pa-drill__header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.pa-drill__header h3 { font-size: 1rem; font-weight: 600; margin: 0; }
.pa-drill__close { background: none; border: 1px solid #ddd; border-radius: 5px; padding: 3px 10px; font-size: 0.8rem; cursor: pointer; color: #666; }
.pa-drill__close:hover { background: #f5f5f5; }
.pa-drill__empty { color: #aaa; font-size: 0.9rem; margin-top: 8px; }
.pa-drill__table-wrap { overflow-x: auto; margin-top: 12px; }
.pa-drill__table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.pa-drill__table th { background: #f7f7f7; padding: 7px 10px; text-align: left; border-bottom: 2px solid #eee; font-size: 0.75rem; color: #666; white-space: nowrap; }
.pa-drill__table td { padding: 7px 10px; border-bottom: 1px solid #f5f5f5; vertical-align: middle; }
.pa-drill__table tr:last-child td { border-bottom: none; }
.pa-drill__table tr:hover td { background: #fafafa; }

.pa-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 1.5rem; }
@media (max-width: 680px) { .pa-charts { grid-template-columns: 1fr; } }
.pa-chart-box { background: #fff; border: 1px solid #e4e4e4; border-radius: 10px; padding: 16px; }
.pa-chart-box h3 { font-size: 0.9rem; font-weight: 600; margin: 0 0 12px; }
.pa-chart-sub { font-weight: 400; color: #999; font-size: 0.82em; }
.pa-chart-wrap { position: relative; height: 220px; }

.pa-questions { display: flex; flex-direction: column; gap: 14px; margin-top: 10px; }
.pa-q-row { display: grid; grid-template-columns: 180px 1fr; gap: 8px; align-items: center; }
@media (max-width: 600px) { .pa-q-row { grid-template-columns: 1fr; } }
.pa-q-label { font-size: 0.85rem; font-weight: 600; color: #333; }
.pa-q-bars { display: flex; flex-direction: column; gap: 4px; }
.pa-q-bar-wrap { display: flex; align-items: center; gap: 8px; }
.pa-q-bar-tag { font-size: 0.72rem; color: #888; width: 88px; flex-shrink: 0; }
.pa-q-nat .pa-q-bar-tag { color: #bbb; }
.pa-q-bar { flex: 1; height: 12px; background: #f0f0f0; border-radius: 6px; overflow: hidden; }
.pa-q-fill { height: 100%; border-radius: 6px; transition: width 0.4s ease; }
.pa-q-fill--prov { background: var(--brand); }
.pa-q-fill--nat  { background: #bdbdbd; }
.pa-q-fill--cmp  { background: var(--thistle); }

/* Compare search */
.pa-compare { margin-bottom: 1.25rem; }
.pa-compare__form { display: flex; gap: 8px; flex-wrap: wrap; }
.pa-compare__input { flex: 1; min-width: 240px; padding: 8px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 0.875rem; }
.pa-compare__btn { padding: 8px 16px; background: var(--ink); color: #fff; border: none; border-radius: 6px; font-size: 0.875rem; cursor: pointer; }
.pa-compare__btn:hover { background: #333; }
.pa-compare__none { color: #888; font-size: 0.85rem; margin-top: 6px; }
.pa-compare__results { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.pa-compare__result { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; background: #f5f5f5; border: 1px solid #e0e0e0; border-radius: 20px; font-size: 0.82rem; text-decoration: none; color: #222; }
.pa-compare__result:hover { background: var(--brand); color: #fff; border-color: var(--brand); }
.pa-compare__cnt { color: #888; font-size: 0.78em; }
.pa-compare__result:hover .pa-compare__cnt { color: rgba(255,255,255,0.7); }
.pa-compare__active { display: flex; align-items: center; gap: 10px; background: #f0f4ff; border: 1px solid #bbdefb; border-radius: 8px; padding: 10px 14px; font-size: 0.88rem; flex-wrap: wrap; }
.pa-compare__remove { margin-left: auto; color: #888; text-decoration: none; font-size: 0.82rem; }
.pa-compare__remove:hover { color: #c62828; }
.pa-compare__dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.pa-compare__dot--a { background: var(--brand); }
.pa-compare__dot--b { background: var(--thistle); }

/* Comparison tile grid */
.pa-cmp-grid { border: 1px solid #e4e4e4; border-radius: 10px; overflow: hidden; margin-bottom: 1.5rem; }
.pa-cmp-header { display: grid; grid-template-columns: 1fr 1fr 1fr; background: #f7f7f7; border-bottom: 2px solid #e4e4e4; }
.pa-cmp-header > div { padding: 10px 16px; font-size: 0.82rem; font-weight: 600; color: #444; display: flex; align-items: center; gap: 6px; }
.pa-cmp-col-a { color: var(--brand); }
.pa-cmp-col-b { color: var(--thistle); }
.pa-cmp-row { display: grid; grid-template-columns: 1fr 1fr 1fr; border-bottom: 1px solid #f0f0f0; }
.pa-cmp-row:last-child { border-bottom: none; }
.pa-cmp-row:hover { background: #fafafa; }
.pa-cmp-label { padding: 12px 16px; font-size: 0.85rem; color: #555; }
.pa-cmp-val { padding: 12px 16px; font-size: 1.4rem; font-weight: 700; }
.pa-cmp-val--a { color: var(--brand); border-left: 1px solid #f0f0f0; }
.pa-cmp-val--b { color: var(--thistle); border-left: 1px solid #f0f0f0; }
.pa-q-val { font-size: 0.82rem; font-weight: 600; color: #333; width: 28px; flex-shrink: 0; }
.pa-q-diff { font-size: 0.75rem; font-weight: 700; padding: 1px 5px; border-radius: 3px; }
.diff--above { background: #e8f5e9; color: #1b5e20; }
.diff--below { background: #fce4ec; color: #b71c1c; }
.diff--same  { background: #f5f5f5; color: #888; }

/* —— Insights (/insights) —— */
.insights-page .insights-main { padding: 1rem 0 2.5rem; }
.insights-header h1 { font-size: clamp(1.2rem, 2.5vw, 1.65rem); margin: 0.35rem 0 0.35rem; }
.insights-lead { color: #555; max-width: 65ch; margin: 0 0 1.25rem; line-height: 1.45; }
.insights-subh { font-size: 1rem; margin: 0 0 0.65rem; color: var(--ink); }
.insights-scopes {
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 1rem 1.1rem 1.1rem;
  margin-bottom: 1.5rem;
}
.insights-scope-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  align-items: end;
}
.insights-scope-card {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  border: 1px solid #c5d5ce;
  background: #f0faf7;
  color: var(--brand);
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  min-height: 44px;
}
.insights-scope-card:hover { border-color: var(--brand); }
.insights-scope-card.is-active { background: var(--brand); color: #fff; border-color: var(--brand); }
.insights-scope-form label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #555;
}
.insights-scope-form select {
  width: 100%;
  min-height: 40px;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 0 0.4rem;
  font: inherit;
  background: #fff;
}
.insights-scope-note { font-size: 0.78rem; color: #666; margin: 0.85rem 0 0; max-width: 72ch; line-height: 1.4; }
.insights-chart-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  margin-bottom: 2rem;
}
.insights-chart-wrap {
  margin: 0;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 0.65rem 0.75rem 0.85rem;
}
.insights-chart-cap { font-size: 0.82rem; font-weight: 600; color: #444; margin-bottom: 0.5rem; }
.insights-chart-canvas {
  position: relative;
  height: min(320px, 42vh);
  min-height: 220px;
}
.insights-chart-canvas canvas { max-height: 100%; }
.insights-table-section { margin-bottom: 2rem; }
.insights-table-scroll { overflow-x: auto; border: 1px solid var(--rule); border-radius: 8px; background: #fff; }
.insights-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.insights-table th,
.insights-table td {
  padding: 0.45rem 0.65rem;
  text-align: left;
  border-bottom: 1px solid #eee;
}
.insights-table th { background: var(--paper); font-weight: 600; font-size: 0.78rem; }
.insights-table tbody tr:last-child td { border-bottom: none; }
.insights-table-foot { font-size: 0.82rem; color: #555; margin: 0.65rem 0 0; }
.insights-table-foot a { color: var(--brand); font-weight: 600; }

/* ── Provider news thread ───────────────────────────────────── */
.provider-news__attr {
  font-size: 0.82rem;
  color: #777;
  margin: 0 0 1rem;
}
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.85rem;
}
.news-card {
  background: #fff;
  border: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  transition: background 200ms var(--ease-out-quart), box-shadow 200ms var(--ease-out-quart);
}
.news-card:hover { background: #fafdfb; box-shadow: 0 2px 10px rgba(10, 30, 20, 0.06); }
.news-card__title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  line-height: 1.4;
}
.news-card__title:hover { color: var(--brand); text-decoration: underline; }
.news-card__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
  font-size: 0.78rem;
  color: #666;
}
.news-card__source { font-weight: 600; color: #444; }
.news-card__sep { color: #aaa; }
.news-card__date { color: #777; }
.news-card__snippet {
  font-size: 0.82rem;
  color: #555;
  margin: 0;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-card__council {
  color: var(--brand);
  font-weight: 600;
  text-decoration: none;
}
.news-card__council:hover { text-decoration: underline; }

/* ── News page (/news) ──────────────────────────────────────── */
.news-main { padding: 1.5rem 0 3rem; }
.news-page__header { margin-bottom: 1.5rem; }
.news-page__header h1 {
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  margin: 0 0 0.5rem;
}
.news-page__lead {
  color: #555;
  margin: 0;
  max-width: 62ch;
  line-height: 1.5;
}
.news-filter {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 8px;
}
.news-filter__form {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}
.news-filter__label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #444;
}
.news-filter select {
  min-width: 220px;
  height: 40px;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 0 10px;
  font-size: 0.9rem;
  background: #fff;
}
.news-filter__clear {
  font-size: 0.82rem;
  color: #666;
  text-decoration: none;
}
.news-filter__clear:hover { color: var(--brand); }
.news-page__count {
  font-size: 0.82rem;
  color: #777;
  margin: 0 0 1rem;
}
.news-empty {
  padding: 2rem;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 8px;
  text-align: center;
  color: #555;
}
.news-empty a { color: var(--brand); font-weight: 600; }

/* ── Complaints metrics page ─────────────────────────────── */
.cm-header h1 { font-size: 1.6rem; margin: 0 0 0.2rem; }
.cm-sub { font-size: 0.88rem; color: #666; margin: 0 0 1.25rem; }

/* Service type breakdown cards */
.cm-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.6rem;
  margin-bottom: 0;
}
.cm-type-card {
  display: block;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s;
}
.cm-type-card:hover { border-color: var(--brand); }
.cm-type-card__name { font-size: 0.85rem; font-weight: 600; color: var(--ink); margin-bottom: 0.3rem; line-height: 1.3; }
.cm-type-card__stats { display: flex; flex-wrap: wrap; gap: 0.5rem; font-size: 0.75rem; color: #666; margin-bottom: 0.4rem; }
.cm-type-card__ratio { font-weight: 700; }
.ratio--above { color: #c41e3a; }
.ratio--below { color: #2e7d32; }

/* Mini bar in type cards */
.cm-mini-bar { height: 4px; background: #f0eeea; border-radius: 2px; overflow: hidden; }
.cm-mini-bar__fill { height: 100%; border-radius: 2px; transition: width 0.3s; }
.fill--above { background: #c41e3a; }
.fill--below { background: var(--brand); }

/* Provider metrics table */
.cm-table-wrap {
  overflow-x: auto;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 10px;
  margin-bottom: 1rem;
}
.cm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.cm-table thead th {
  background: #f5f4f0;
  padding: 9px 12px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 2px solid var(--rule);
  font-size: 0.78rem;
  color: #555;
}
.cm-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #f0eeea;
  vertical-align: middle;
}
.cm-table tbody tr:last-child td { border-bottom: none; }
.cm-table tbody tr:hover td { background: #faf9f7; }
.cm-row--pinned td { background: #fffbea !important; }
.cm-row--pinned:hover td { background: #fff8d6 !important; }
.cm-row--zero td { opacity: 0.6; }

/* Rank number */
.cm-rank {
  display: inline-block;
  font-size: 0.72rem;
  color: #aaa;
  min-width: 1.6rem;
  margin-right: 2px;
}

/* Pinned badge */
.cm-pinned-badge {
  font-size: 0.68rem;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 4px;
  vertical-align: middle;
}

/* Type list in table */
.cm-types { font-size: 0.78rem; color: #666; max-width: 200px; }

/* Ratio bar cell */
.cm-bar-cell {
  min-width: 160px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.cm-bar {
  position: relative;
  flex: 1;
  height: 10px;
  background: #f0eeea;
  border-radius: 5px;
  overflow: visible;
  min-width: 80px;
}
.cm-bar__fill {
  height: 100%;
  border-radius: 5px;
  min-width: 2px;
  transition: width 0.2s;
}
.cm-bar__fill--above { background: #e53935; }
.cm-bar__fill--below { background: var(--brand); }

/* Sector average marker line */
.cm-bar__avg {
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 2px;
  background: #555;
  border-radius: 1px;
  transform: translateX(-50%);
  z-index: 1;
}

/* Avg label in header */
.cm-avg-marker-label {
  font-weight: 400;
  font-size: 0.72rem;
  color: #888;
  background: #f0eeea;
  padding: 1px 5px;
  border-radius: 4px;
  margin-left: 4px;
}

/* Diff label */
.cm-diff {
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}
.cm-diff.diff--below { color: #c41e3a; }   /* more complaints than avg */
.cm-diff.diff--above { color: #2e7d32; }   /* fewer complaints than avg */
.cm-diff.diff--same  { color: #888; font-weight: 400; }

@media (max-width: 680px) {
  .cm-type-grid { grid-template-columns: 1fr 1fr; }
  .cm-types, .cm-bar-cell { display: none; }
}

/* Complaint outcome badges */
.outcome-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
}
.outcome-upheld     { background: #fde8e8; color: #b91c1c; }
.outcome-not-upheld { background: #e8f5e9; color: #2e7d32; }
.outcome-partial    { background: #fff3e0; color: var(--thistle); }
.outcome-other      { background: #f3f4f6; color: #6b7280; }

/* Complaint category list inside service profile table */
.complaint-cats {
  margin: 0;
  padding: 0 0 0 1.1rem;
  font-size: 0.85em;
  line-height: 1.6;
}
.complaint-cats li { margin: 0; }

/* ── Complaints hub & provider complaints section ─────────── */
.complaints-hub-header {
  margin-bottom: 1.25rem;
}
.complaints-hub-header h1 {
  font-size: 1.6rem;
  margin: 0 0 0.25rem;
  color: var(--ink);
}
.complaints-hub-sub {
  font-size: 0.88rem;
  color: #666;
  margin: 0;
}

/* Stats strip */
.complaints-stats {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.complaints-stats--compact {
  margin-bottom: 1rem;
}
.complaints-stat {
  flex: 1 1 140px;
  background: #fff;
  border: 1px solid var(--rule);
  padding: 0.85rem 1.1rem;
  min-width: 120px;
}
.complaints-stat__val {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
}
.complaints-stat--upheld   .complaints-stat__val { color: #c41e3a; }
.complaints-stat--not-upheld .complaints-stat__val { color: var(--brand); }
.complaints-stat__label {
  font-size: 0.72rem;
  color: #666;
  line-height: 1.3;
}

/* Filter form */
.complaints-filters {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  margin-bottom: 0.75rem;
}
.complaints-filters__row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: flex-end;
}
.complaints-filter {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.82rem;
  flex: 0 0 auto;
}
.complaints-filter span { font-weight: 600; color: #333; }
.complaints-filter input[type="search"],
.complaints-filter select {
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 0.85rem;
  background: #fff;
  min-width: 0;
}
.complaints-filter input[type="search"] { min-width: 200px; }
.complaints-filter--actions {
  flex-direction: row;
  align-items: flex-end;
  gap: 0.4rem;
  padding-top: 1.05rem;
}

/* Results meta */
.complaints-meta {
  font-size: 0.85rem;
  color: #555;
  margin: 0.5rem 0 0.75rem;
}

/* Results table */
.complaints-table-wrap {
  overflow-x: auto;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 10px;
  margin-bottom: 1rem;
}
.complaints-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.complaints-table thead th {
  background: #f5f4f0;
  padding: 9px 12px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 2px solid var(--rule);
  font-size: 0.78rem;
  color: #555;
}
.complaints-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #f0eeea;
  vertical-align: middle;
}
.complaints-table tbody tr:last-child td { border-bottom: none; }
.complaints-table tbody tr:hover td { background: #faf9f7; }
.complaints-table .num-col {
  text-align: right;
  white-space: nowrap;
  min-width: 60px;
}
.complaints-table thead .num-col { text-align: right; }
.complaints-upheld-num { font-weight: 600; color: #c41e3a; }
.complaints-total-num  { font-weight: 700; color: var(--ink); }
.td-service a { color: var(--brand); text-decoration: none; font-weight: 500; }
.td-service a:hover { text-decoration: underline; }
.td-service .td-sub,
.td-provider .td-sub { display: block; font-size: 0.78rem; color: #888; }
.td-type   { color: #555; font-size: 0.82rem; }
.td-council a { color: #555; text-decoration: none; }
.td-council a:hover { color: var(--brand); text-decoration: underline; }
.td-action { text-align: right; white-space: nowrap; }
.td-provider a { color: #555; font-size: 0.85rem; }
.td-provider a:hover { color: var(--brand); }

/* Source note */
.complaints-source-note {
  font-size: 0.8rem;
  color: #888;
  margin-top: 1.5rem;
  border-top: 1px solid var(--rule);
  padding-top: 0.75rem;
}
.complaints-source-note a { color: var(--brand); }

/* Responsive */
@media (max-width: 680px) {
  .complaints-stats { flex-direction: column; }
  .complaints-filter input[type="search"] { min-width: 100%; }
  .complaints-filters__row { flex-direction: column; }
  .complaints-filter--actions { flex-direction: row; }
  .td-type, .td-provider { display: none; }
}

/* ── Provider claim page (portal/claim.php) ──────────────────── */
.container.narrow { max-width: 700px; padding-top: clamp(1.5rem, 3vw, 2.5rem); padding-bottom: 3rem; }

.claim-header { margin-bottom: 1.75rem; }
.claim-header h1 { font-size: clamp(1.5rem, 3vw, 1.9rem); margin: 0 0 0.4rem; }
.claim-header p { color: #555; font-size: 0.95rem; margin: 0; }

.alert-success, .alert-warning, .alert-error {
  padding: 0.9rem 1.1rem;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  line-height: 1.5;
}
.alert-success { background: #f1f8e9; border: 1px solid #c5e0a5; }
.alert-success h2 { font-size: 1.05rem; margin: 0 0 0.4rem; color: #33691e; }
.alert-success p { margin: 0 0 0.6rem; }
.alert-success .btn-primary { margin-top: 0.4rem; text-decoration: none; display: inline-flex; align-items: center; }
.alert-warning { background: #fff8e1; border: 1px solid #f0d98a; color: #5d4000; }
.alert-warning a { color: #5d4000; font-weight: 600; }
.alert-error { background: #fce4ec; border: 1px solid #efb3c4; color: #7f0000; }
.alert-error ul { margin: 0; padding-left: 1.1rem; }

.claim-form {
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: clamp(1.25rem, 3vw, 1.75rem);
  margin-bottom: 2rem;
}
.claim-form fieldset {
  border: none;
  padding: 0;
  margin: 0 0 1.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1rem;
}
.claim-form fieldset:last-of-type { margin-bottom: 0; }
.claim-form legend {
  grid-column: 1 / -1;
  width: 100%;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--brand-deep);
  padding: 0 0 0.6rem;
  margin-bottom: 0.9rem;
  border-bottom: 1px solid var(--rule);
}
.claim-form label {
  display: block;
  font-size: 0.85rem;
  color: #444;
  font-weight: 500;
  margin-bottom: 1.1rem;
}
.claim-form label.field-full { grid-column: 1 / -1; }
.claim-form input {
  display: block;
  width: 100%;
  margin-top: 0.4rem;
  padding: 0.6rem 0.7rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  font: inherit;
  font-size: 0.95rem;
}
.claim-form input:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.field-hint { grid-column: 1 / -1; font-size: 0.8rem; color: #888; margin: -0.5rem 0 0; line-height: 1.5; }
.terms-note { font-size: 0.8rem; color: #888; margin: 0 0 1.1rem; line-height: 1.5; }
.terms-note a { color: var(--brand); }
.claim-form > button[type="submit"] { width: 100%; height: 46px; font-size: 0.95rem; }

@media (max-width: 560px) {
  .claim-form fieldset { grid-template-columns: 1fr; }
  .claim-form label.field-full { grid-column: 1; }
  .field-hint { grid-column: 1; }
}

.tier-preview h2 { font-size: 1.15rem; margin: 0 0 1rem; }
.tier-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; }
.tier-card {
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 1.25rem 1.4rem;
  display: flex;
  flex-direction: column;
  position: relative;
}
.tier-card--highlight { border-color: var(--brand); box-shadow: 0 4px 14px rgba(15, 110, 86, 0.08); }
.tier-card--highlight::before {
  content: "Most popular";
  position: absolute;
  top: -0.6rem;
  left: 1.4rem;
  background: #c9a227;
  color: var(--ink);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 10px;
  border-radius: 999px;
}
.tier-card h3 { font-size: 1.1rem; margin: 0 0 0.2rem; }
.tier-card .price { font-size: 1.6rem; font-weight: 700; color: var(--brand); margin: 0 0 1rem; }
.tier-card ul { list-style: none; margin: 0; padding: 0; flex: 1; }
.tier-card li { font-size: 0.85rem; color: #444; padding: 0.5rem 0; border-top: 1px solid #f0ede8; }
.tier-card li:first-child { border-top: none; }

/* ============================================================
   Provider portal, pricing and billing
   ============================================================ */
.portal { padding-top: 1.75rem; padding-bottom: 2rem; }
.portal .narrow { max-width: 600px; margin-inline: auto; }
.portal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.portal-head h1 { margin: 0; font-size: clamp(1.4rem, 3vw, 1.9rem); }
.portal-sub { margin: 0.2rem 0 0; color: var(--muted); font-size: 0.9rem; }
.portal-back { margin: 0 0 0.75rem; font-size: 0.9rem; }
.portal-empty { background: #fff; border: 1px dashed #cfcdc4; border-radius: 12px; padding: 2rem; text-align: center; }
.portal-empty h2 { margin-top: 0; }

.portal-listings { display: grid; gap: 1rem; }
.portal-listing { background: #fff; border: 1px solid var(--rule); border-radius: 12px; padding: 1.25rem; margin-bottom: 1rem; }
.portal-listing > header { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.portal-listing h2 { margin: 0; font-size: 1.15rem; }
.portal-stats { display: flex; flex-wrap: wrap; gap: 0.75rem 2rem; margin: 1rem 0; }
.portal-stats dt { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.portal-stats dd { margin: 0.15rem 0 0; font-size: 1.05rem; font-weight: 600; }
.portal-stats__held dd { color: #8a4b00; }
.portal-callout { background: #fff8e1; border: 1px solid #f0d98a; border-radius: 6px; padding: 0.7rem 0.9rem; margin: 0 0 1rem; color: #5d4000; }
.portal-callout a { color: #5d4000; font-weight: 600; }
.portal-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.portal-actions .btn-primary, .portal-actions .btn-secondary, .portal-actions .btn-upgrade { text-decoration: none; display: inline-flex; align-items: center; }
.inline-form { display: inline; margin: 0; }

.plan-chip { display: inline-block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.03em; padding: 3px 10px; border-radius: 999px; border: 1px solid #cfcdc4; background: var(--paper); color: #3d3d39; white-space: nowrap; }
.plan-chip--premium { background: #e8f5ef; border-color: #b8e0cc; color: #0a5441; }
.plan-chip--pro { background: var(--ink); border-color: var(--ink); color: #fff; }

.btn-upgrade { height: 44px; padding: 0 18px; background: var(--ink); color: #fff; border: none; border-radius: 8px; font-weight: 600; cursor: pointer; text-decoration: none; transition: background 150ms var(--ease-out-quart), transform 100ms var(--ease-out-quart); }
.btn-upgrade:hover { background: var(--brand); }
.btn-upgrade:active { transform: scale(0.97); }
.btn-primary:focus-visible, .btn-secondary:focus-visible, .btn-upgrade:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }

.claim-form fieldset.is-locked { opacity: 0.6; }
.claim-form fieldset.is-locked .portal-callout { grid-column: 1 / -1; opacity: 1; }
.claim-form textarea { width: 100%; font: inherit; padding: 0.6rem 0.75rem; border: 1px solid #cfcdc4; border-radius: 8px; }

.enquiry-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.enquiry { background: #fff; border: 1px solid var(--rule); border-radius: 10px; padding: 1rem 1.15rem; }
.enquiry p { margin: 0.4rem 0 0; }
.enquiry__top { display: flex; justify-content: space-between; gap: 1rem; }
.enquiry__top time { color: var(--muted); font-size: 0.85rem; }
.enquiry__contact { font-size: 0.92rem; }
.enquiry--locked { border-style: dashed; background: #fffdf5; }
.enquiry--locked .btn-upgrade { display: inline-flex; align-items: center; margin-top: 0.6rem; }

.portal-stats-card { background: #fff; border: 1px solid var(--rule); border-radius: 12px; padding: 1rem 1.25rem; margin-bottom: 1.25rem; }
.portal-stats-card h2 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin: 0 0 0.75rem; }
.month-bars { list-style: none; display: grid; grid-template-columns: repeat(6, 1fr); gap: 0.5rem; margin: 0; padding: 0; height: 110px; align-items: end; }
.month-bars li { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; position: relative; }
.month-bars__bar { width: 100%; max-width: 44px; min-height: 3px; background: var(--brand); border-radius: 4px 4px 0 0; }
.month-bars b { font-size: 0.85rem; margin-top: 0.2rem; }
.month-bars i { font-style: normal; font-size: 0.75rem; color: var(--muted); }

.pricing-head { max-width: 640px; margin: 0 auto 2rem; text-align: center; }
.pricing-head h1 { margin-bottom: 0.5rem; }
.pricing-head p { color: #4a4a45; }
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; align-items: stretch; max-width: 980px; margin: 0 auto; }
.plan { position: relative; background: #fff; border: 1px solid var(--rule); border-radius: 14px; padding: 1.5rem 1.35rem; display: flex; flex-direction: column; }
.plan h2 { margin: 0; font-size: 1.1rem; }
.plan__price { font-family: 'Bricolage Grotesque', system-ui, sans-serif; font-size: 2.2rem; font-weight: 600; margin: 0.4rem 0 1rem; }
.plan__price span { font-size: 0.9rem; font-weight: 400; color: var(--muted); }
.plan ul { list-style: none; padding: 0; margin: 0 0 1.5rem; flex: 1; }
.plan li { padding: 0.35rem 0 0.35rem 1.5rem; position: relative; font-size: 0.94rem; }
.plan li::before { content: ''; position: absolute; left: 0; top: 0.65rem; width: 0.8rem; height: 0.4rem; border-left: 2px solid var(--brand); border-bottom: 2px solid var(--brand); transform: rotate(-45deg); }
.plan .btn-primary, .plan .btn-secondary { width: 100%; justify-content: center; text-decoration: none; display: inline-flex; align-items: center; }
.plan form { margin: 0; }
.plan--highlight { border: 2px solid var(--brand); box-shadow: 0 8px 24px rgba(15, 110, 86, 0.12); }
.plan--current { background: #f4faf7; }
.plan__flag { position: absolute; top: -0.75rem; left: 1.35rem; background: var(--brand); color: #fff; font-size: 0.72rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.plan__current { display: block; text-align: center; font-size: 0.88rem; font-weight: 600; color: #3d3d39; padding: 0.7rem 0; }
.pricing-note { max-width: 640px; margin: 1.5rem auto 0; text-align: center; font-size: 0.85rem; color: var(--muted); }

/* ============================================================
   REDESIGN LAYER — "Survey sheet" (loch ink + thistle)
   Sits after the legacy rules; tokens live in the first :root.
   ============================================================ */
body { background: var(--paper); color: var(--ink); font-feature-settings: 'tnum' 1, 'lnum' 1; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-underline-offset: 0.18em; }
:focus-visible { outline: 3px solid var(--thistle); outline-offset: 2px; border-radius: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
h1, h2, h3 { letter-spacing: -0.015em; }
.eyebrow { margin: 0 0 0.9rem; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; color: rgba(255,255,255,0.72); }

/* ── Header ─────────────────────────────────────────────── */
.site-header { background: var(--paper); border-bottom: 1px solid var(--rule); padding: 0.7rem 0; position: sticky; top: 0; z-index: 30; }
.logo { font-family: 'Bricolage Grotesque', system-ui, sans-serif; font-size: 1.2rem; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); gap: 0.5rem; }
.logo-icon { width: 28px; height: 28px; border-radius: 6px; background: var(--ink); color: #fff; align-items: center; justify-content: center; }
.logo-icon svg { width: 16px; height: 16px; }
.site-header__nav { gap: 0.25rem 0.35rem; }
.site-header__nav a { color: var(--ink-soft); font-weight: 500; padding: 0.4rem 0.7rem; border-radius: var(--radius); text-decoration: none; transition: background 150ms var(--ease-out-quart), color 150ms var(--ease-out-quart); }
.site-header__nav a:hover { background: var(--brand-tint); color: var(--brand-deep); text-decoration: none; }
.site-header__nav a[aria-current="page"] { color: var(--ink); font-weight: 600; text-decoration: none; box-shadow: inset 0 -2px 0 var(--ink); border-radius: 0; }
.site-header__nav a.nav-cta { background: var(--ink); color: #fff; font-weight: 600; margin-left: 0.4rem; }
.site-header__nav a.nav-cta:hover { background: var(--thistle); color: #fff; }

/* ── Buttons ────────────────────────────────────────────── */
.btn-primary { background: var(--ink); border-radius: var(--radius); }
.btn-primary:hover { background: var(--brand); }
.btn-secondary { border-color: var(--ink); color: var(--ink); border-radius: var(--radius); }
.btn-secondary:hover { background: var(--ink); color: #fff; }
.btn-upgrade { background: var(--thistle); border-radius: var(--radius); }
.btn-upgrade:hover { background: var(--thistle-deep); }

/* ── Hero ───────────────────────────────────────────────── */
.home-hero { background: var(--ink); padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(2.5rem, 5vw, 3.75rem); text-align: left; position: relative; overflow: hidden; }
.home-hero::before { /* faint survey-sheet grid */
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,0.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.045) 1px, transparent 1px);
  background-size: 48px 48px; mask-image: linear-gradient(100deg, transparent 20%, #000 100%); -webkit-mask-image: linear-gradient(100deg, transparent 20%, #000 100%);
}
.home-hero__grid { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: clamp(1.5rem, 5vw, 4rem); align-items: end; }
.home-hero__main > * { animation: hero-rise 600ms var(--ease-out-quart) both; }
.home-hero__main > *:nth-child(2) { animation-delay: 70ms; } .home-hero__main > *:nth-child(3) { animation-delay: 130ms; }
.home-hero__main > *:nth-child(4) { animation-delay: 190ms; } .home-hero__main > *:nth-child(5) { animation-delay: 250ms; }
.home-hero__h1 { color: #fff; font-size: clamp(2.2rem, 5.4vw, 3.9rem); line-height: 1.02; letter-spacing: -0.03em; margin: 0 0 1rem; font-weight: 700; max-width: 14ch; }
.home-hero__h1 span { color: #9fd3cb; }
.home-hero__sub { color: rgba(255,255,255,0.82); font-size: 1.05rem; margin: 0 0 1.6rem; max-width: 34rem; line-height: 1.55; }
.home-hero__form { display: flex; background: #fff; border-radius: var(--radius-lg); padding: 5px; box-shadow: none; max-width: 38rem; }
.home-hero__form:focus-within { box-shadow: 0 0 0 3px var(--thistle), 0 0 0 5px #fff; }
.home-hero__input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 1.05rem; padding: 0.85rem 1rem; color: var(--ink); }
.home-hero__input::placeholder { color: var(--muted); }
.home-hero__btn { background: var(--ink); color: #fff; border: 0; border-radius: 7px; padding: 0 1.6rem; font: inherit; font-weight: 600; cursor: pointer; transition: background 150ms var(--ease-out-quart), transform 100ms var(--ease-out-quart); }
.home-hero__btn:hover { background: var(--brand); }
.home-hero__btn:active { transform: scale(0.97); }
.quick-types { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1.1rem 0 0; padding: 0; }
.quick-types a { display: inline-block; padding: 0.4rem 0.85rem; font-size: 0.88rem; font-weight: 500; color: #fff; border: 1px solid rgba(255,255,255,0.32); border-radius: 999px; text-decoration: none; transition: background 150ms var(--ease-out-quart), color 150ms var(--ease-out-quart), border-color 150ms; }
.quick-types a:hover { background: #fff; color: var(--ink); border-color: #fff; }

.grade-key { border-left: 1px solid rgba(255,255,255,0.22); padding-left: 1.5rem; color: #fff; animation: hero-rise 700ms 200ms var(--ease-out-quart) both; }
.grade-key h2 { font-size: 0.78rem; letter-spacing: 0.09em; text-transform: uppercase; font-family: 'IBM Plex Sans', sans-serif; font-weight: 600; color: rgba(255,255,255,0.72); margin: 0 0 0.9rem; }
.grade-key ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.grade-key li { display: grid; grid-template-columns: 1.9rem 1fr; align-items: center; background: var(--g); color: #fff; border-radius: 3px; height: 2.05rem; font-size: 0.88rem; }
.grade-key li b { text-align: center; font-family: 'Bricolage Grotesque', sans-serif; font-size: 1.05rem; background: rgba(0,0,0,0.2); height: 100%; display: grid; place-items: center; border-radius: 3px 0 0 3px; }
.grade-key li span { padding-left: 0.65rem; font-weight: 600; }
.grade-key li.grade-g4, .grade-key li.grade-g5 { color: var(--ink); }
.grade-key li.grade-g4 b, .grade-key li.grade-g5 b { background: rgba(0,0,0,0.12); }
.grade-key p { font-size: 0.82rem; color: rgba(255,255,255,0.75); margin: 0.9rem 0 0; line-height: 1.5; }

/* ── Proof strip ────────────────────────────────────────── */
.home-proof { background: var(--surface); border-bottom: 1px solid var(--rule); }
.home-proof__h { color: var(--ink); font-size: clamp(1.2rem, 2.2vw, 1.55rem); }
.home-proof__num { font-family: 'Bricolage Grotesque', sans-serif; color: var(--ink); }
.grade-bar-track { border-radius: 2px; } .grade-bar-fill { border-radius: 2px; }
.home-proof__chart-link { color: var(--brand-deep); }

/* ── Filters ────────────────────────────────────────────── */
.home-section-h { color: var(--ink); }
.filter-bar { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-lg); }
.filter-bar select { border-radius: var(--radius); border-color: var(--rule); color: var(--ink); background-color: var(--paper); }
.filter-bar select:hover { border-color: var(--ink-soft); }
.filter-bar__reset { color: var(--thistle); font-weight: 600; }
.results-count { color: var(--ink); font-weight: 600; }
.view-btn { border-radius: var(--radius); border-color: var(--rule); }
.view-btn[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); }

/* ── Grade profile strip ────────────────────────────────── */
.gstrip { display: inline-flex; align-items: flex-end; gap: 3px; height: 26px; }
.gstrip i { display: block; width: 8px; height: var(--h); min-height: 4px; background: var(--g); border-radius: 1.5px 1.5px 0 0; transform-origin: bottom; animation: bar-grow 600ms var(--ease-out-quart) both; }
.gstrip i:nth-child(2) { animation-delay: 40ms; } .gstrip i:nth-child(3) { animation-delay: 80ms; } .gstrip i:nth-child(4) { animation-delay: 120ms; } .gstrip i:nth-child(5) { animation-delay: 160ms; } .gstrip i:nth-child(6) { animation-delay: 200ms; }
@keyframes bar-grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }

/* ── Service cards: free / premium / pro ────────────────── */
.cards-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 0.85rem; }
.service-card { position: relative; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-lg); overflow: hidden; display: flex; flex-direction: column; animation: card-in 480ms var(--ease-out-quart) both; transition: border-color 160ms var(--ease-out-quart), box-shadow 160ms var(--ease-out-quart), transform 160ms var(--ease-out-quart); }
.cards-grid .service-card:nth-child(1) { animation-delay: 0ms; } .cards-grid .service-card:nth-child(2) { animation-delay: 40ms; } .cards-grid .service-card:nth-child(3) { animation-delay: 80ms; }
.cards-grid .service-card:nth-child(4) { animation-delay: 120ms; } .cards-grid .service-card:nth-child(5) { animation-delay: 160ms; } .cards-grid .service-card:nth-child(n+6) { animation-delay: 200ms; }
@keyframes card-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.service-card:hover { transform: translateY(-2px); border-color: var(--ink); box-shadow: 0 1px 0 var(--ink); }
.service-card:focus-within { border-color: var(--ink); }
.card-link { position: absolute; inset: 0; z-index: 1; }
.card-link:focus-visible { outline: 3px solid var(--thistle); outline-offset: -3px; border-radius: var(--radius-lg); }
.card-main { display: grid; grid-template-columns: 64px 1fr; gap: 0.95rem; padding: 1rem 1.1rem 0.9rem; flex: 1; }
.card-score { align-self: start; border-radius: var(--radius); background: var(--g-tint); border: 1px solid var(--g-border); color: var(--g-text); text-align: center; padding: 0.5rem 0.2rem 0.4rem; }
.card-score b { display: block; font-family: 'Bricolage Grotesque', sans-serif; font-size: 1.65rem; font-weight: 700; line-height: 1; letter-spacing: -0.02em; }
.card-score span { display: block; font-size: 0.64rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; margin-top: 0.3rem; line-height: 1.15; }
.card-score.is-ungraded { background: var(--paper); border-color: var(--rule); color: var(--muted); }
.card-info { min-width: 0; }
.card-name { font-size: 1.06rem; line-height: 1.25; margin: 0; }
.card-name a { color: var(--ink); text-decoration: none; }
.card-location { color: var(--muted); font-size: 0.86rem; margin: 0.3rem 0 0; }
.card-tagline { color: var(--ink-soft); font-style: normal; font-size: 0.92rem; margin: 0.55rem 0 0; line-height: 1.4; }
.card-profile { display: flex; align-items: flex-end; gap: 0.7rem; margin-top: 0.8rem; }
.card-range { font-size: 0.78rem; color: var(--muted); line-height: 1.3; }
.card-facts { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0; padding: 0.7rem 1.1rem 0.9rem; border-top: 1px solid var(--rule-soft); }
.card-facts li { font-size: 0.8rem; color: var(--ink-soft); background: var(--paper); border: 1px solid var(--rule); border-radius: 999px; padding: 0.15rem 0.65rem; }
.card-facts .fact-vacancy.has-vacancy { background: var(--brand-tint); border-color: #b4d6d1; color: var(--brand-deep); font-weight: 600; }
.card-facts .fact-vacancy.no-vacancy { color: var(--muted); }

/* Premium: thistle band + tinted body */
.service-card.tier-premium { border-color: #cdbfe3; }
.service-card.tier-premium:hover { border-color: var(--thistle); box-shadow: 0 1px 0 var(--thistle); }
.card-tier { margin: 0; padding: 0.3rem 1.1rem; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; display: flex; align-items: center; gap: 0.5rem; }
.tier-premium .card-tier { background: var(--thistle-tint); color: var(--thistle-deep); border-bottom: 1px solid #ddd1ee; }
.tier-premium .card-tier::before { content: ''; width: 6px; height: 6px; background: var(--thistle); border-radius: 50%; }
.tier-premium .card-tagline { color: var(--thistle-deep); font-weight: 500; }
.tier-premium .card-facts { background: #faf8fd; }

/* Pro: ink-banded, spans two columns on wide screens */
.service-card.tier-pro { border: 2px solid var(--ink); }
.service-card.tier-pro:hover { box-shadow: 0 2px 0 var(--ink); }
.tier-pro .card-tier { background: var(--ink); color: #fff; padding: 0.4rem 1.1rem; }
.tier-pro .card-tier::before { content: '★'; color: var(--gold); letter-spacing: 0; font-size: 0.8rem; }
.tier-pro .card-main { grid-template-columns: 78px 1fr; padding: 1.15rem 1.25rem 1rem; }
.tier-pro .card-score b { font-size: 2rem; }
.tier-pro .card-name { font-size: 1.25rem; }
.tier-pro .card-tagline { font-size: 1rem; color: var(--ink); font-weight: 500; }
.tier-pro .gstrip { height: 34px; } .tier-pro .gstrip i { width: 10px; }
.tier-pro .card-facts { background: var(--gold-tint); border-top-color: #ecdcb0; padding-inline: 1.25rem; }
.tier-pro .card-facts li { background: #fff; border-color: #e3d2a0; }
@media (min-width: 760px) { .cards-grid .service-card.tier-pro { grid-column: span 2; } }

/* ── Table view ─────────────────────────────────────────── */
.dir-table-wrap { border-radius: var(--radius-lg); border-color: var(--rule); }
.dir-table th { background: var(--paper); color: var(--ink-soft); }
.dir-table th a { color: var(--ink); }
.dir-table th a:hover, .dt-name a:hover, .sort-active { color: var(--thistle); }
.dir-table tbody tr:hover td { background: var(--brand-tint); }

/* ── Pagination ─────────────────────────────────────────── */
.pagination a, .pagination span:not(.pagination__ellipsis) { border-radius: var(--radius); }
.pagination a:hover { border-color: var(--ink); color: var(--ink); }
.pagination a.active, .pagination span.active { background: var(--ink); border-color: var(--ink); }

/* ── Service profile ────────────────────────────────────── */
.breadcrumb a { color: var(--brand-deep); }
.profile-header { background: var(--ink); color: #fff; border-radius: var(--radius-lg); padding: clamp(1.1rem, 3vw, 1.75rem); gap: 1.25rem 2rem; align-items: center; margin-bottom: 1.25rem; }
.profile-header h1 { color: #fff; font-size: clamp(1.5rem, 3.4vw, 2.15rem); line-height: 1.1; margin-top: 0.6rem; letter-spacing: -0.025em; }
.profile-header .profile-location { color: rgba(255,255,255,0.78); margin: 0.5rem 0 0; font-size: 0.95rem; }
.profile-header .type-badge { background: rgba(255,255,255,0.14); color: #fff; border-radius: 3px; font-weight: 600; letter-spacing: 0.02em; }
.profile-header .status-badge { background: transparent; color: #9fd3cb; border: 1px solid rgba(159,211,203,0.5); border-radius: 3px; }
.tier-flag { display: inline-block; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; padding: 2px 9px; border-radius: 3px; margin-left: 0.35rem; }
.tier-flag--premium { background: var(--thistle-tint); color: var(--thistle-deep); }
.tier-flag--pro { background: var(--gold); color: var(--ink); }
.profile-grade-summary { max-width: 15rem; }
.avg-grade-circle { border-radius: var(--radius-lg); border: 0; padding: 0.9rem 1.1rem; background: var(--g-tint); color: var(--g-text); width: auto; height: auto; }
.avg-num { font-family: 'Bricolage Grotesque', sans-serif; font-weight: 700; font-size: 2.6rem; letter-spacing: -0.03em; }
.profile-header .avg-range-hint { color: rgba(255,255,255,0.75); }
.profile-header .avg-range-hint strong { color: #fff; }
.profile-tagline { font-size: 1.25rem; line-height: 1.35; color: var(--ink); font-weight: 500; letter-spacing: -0.01em; margin: 0 0 1.25rem; }
.profile-section h2 { font-size: 0.8rem; letter-spacing: 0.09em; text-transform: uppercase; font-family: 'IBM Plex Sans', sans-serif; font-weight: 700; color: var(--ink-soft); padding-bottom: 0.55rem; border-bottom: 2px solid var(--ink); margin-bottom: 1rem; }
.grade-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.6rem; }
.grade-card { border-radius: var(--radius); text-align: left; padding: 0.8rem 0.9rem; border-width: 1px; display: grid; gap: 0.1rem; }
.grade-card .grade-score { font-family: 'Bricolage Grotesque', sans-serif; font-size: 2rem; line-height: 1; }
.grade-card .grade-name { text-transform: none; font-size: 0.86rem; font-weight: 600; color: var(--ink); letter-spacing: 0; }
.grade-card .grade-desc { font-size: 0.8rem; color: var(--g-text); font-weight: 600; }
.profile-sidebar .sidebar-card { border-radius: var(--radius-lg); border-color: var(--rule); }
.claim-nudge { border-radius: var(--radius-lg); background: var(--thistle-tint); border: 1px solid #ddd1ee; }
.claim-nudge__h { color: var(--thistle-deep); }
.claim-nudge__btn { background: var(--thistle); border-radius: var(--radius); }
.claim-nudge__btn:hover { background: var(--thistle-deep); }
@media (max-width: 860px) { .profile-header { flex-direction: column; align-items: flex-start; } .profile-grade-summary { max-width: none; } }

/* ── Footer ─────────────────────────────────────────────── */
.site-footer { background: var(--ink); color: rgba(255,255,255,0.78); border-top: 0; margin-top: 3rem; padding: 2rem 0; }
.site-footer a { color: #fff; }

/* ── Portal + pricing share the tier language ──────────── */
.plan { border-radius: var(--radius-lg); border-color: var(--rule); }
.plan--highlight { border: 2px solid var(--thistle); box-shadow: none; background: linear-gradient(var(--thistle-tint) 0 4.2rem, var(--surface) 4.2rem); }
.plan--highlight .plan__flag { background: var(--thistle); border-radius: 3px; }
.plan--highlight li::before { border-color: var(--thistle); }
.plan--highlight .btn-primary { background: var(--thistle); }
.plan--highlight .btn-primary:hover { background: var(--thistle-deep); }
.plan:nth-child(3) { border: 2px solid var(--ink); }
.plan--current { background: var(--brand-tint); }
.plan-chip--premium { background: var(--thistle-tint); border-color: #ddd1ee; color: var(--thistle-deep); }
.plan-chip--pro { background: var(--ink); border-color: var(--ink); }
.portal-listing, .portal-stats-card, .enquiry, .claim-form { border-radius: var(--radius-lg); }
.month-bars__bar { background: var(--ink); }
.pricing-head h1 { font-size: clamp(1.9rem, 4.5vw, 2.8rem); letter-spacing: -0.03em; }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 860px) {
  .home-hero__grid { grid-template-columns: 1fr; }
  .grade-key { border-left: 0; border-top: 1px solid rgba(255,255,255,0.22); padding: 1.25rem 0 0; }
  .grade-key ol { grid-template-columns: repeat(3, 1fr); }
  .grade-key li { grid-template-columns: 1.6rem 1fr; font-size: 0.78rem; }
  .grade-key li span { padding-left: 0.4rem; }
  .grade-key p { display: none; }
}
@media (max-width: 520px) {
  .home-hero__form { flex-direction: column; gap: 4px; }
  .home-hero__btn { height: 3rem; }
  .card-main { grid-template-columns: 56px 1fr; gap: 0.75rem; }
  .site-header { position: static; }
}

/* ── Redesign fixes (round 2) ───────────────────────────── */
.home-hero { padding-block: clamp(2rem, 5vw, 3.5rem) clamp(2rem, 4vw, 3rem); }
.home-hero__h1 { max-width: 19ch; font-size: clamp(2.1rem, 5vw, 3.6rem); }
.home-hero__form { margin: 0; }
.filter-bar { padding: 0.9rem; }
.filter-bar__row--secondary { border-top-color: var(--rule-soft); }
.filter-bar__note { margin: 0; }
.filter-bar select { min-width: 0; }
.card-main { grid-template-columns: 72px 1fr; }
.card-score span { letter-spacing: 0.02em; font-size: 0.62rem; }
.card-profile { flex-direction: column; align-items: flex-start; gap: 0.4rem; }
.tier-pro .card-profile { flex-direction: row; align-items: flex-end; gap: 0.9rem; }
.tier-pro .card-main { grid-template-columns: 84px 1fr; }

.profile-header > div:first-child { flex: 1 1 22rem; min-width: 0; }
.profile-grade-summary { flex: 0 0 auto; max-width: 14rem; }
.profile-grade-summary .avg-range-hint { text-align: left; }
.avg-grade-circle { display: block; text-align: left; min-width: 11.5rem; }
.avg-label { max-width: none; text-align: left; }
.sidebar-card--ci { border-color: var(--rule); background: var(--surface); }
.btn-ci-report { background: var(--surface); color: var(--ink); border: 1px solid var(--ink); border-radius: var(--radius); }
.btn-ci-report:hover { background: var(--ink); color: #fff; }
.ci-report-link { color: var(--brand-deep); }

@media (max-width: 860px) {
  .home-hero__grid { grid-template-columns: minmax(0, 1fr); }
  .profile-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .filter-bar__row > select { flex: 1 1 100%; }
  .grade-key ol { grid-template-columns: repeat(2, 1fr); }
  .grade-key li { grid-template-columns: 1.6rem 1fr; }
  .quick-types a { padding: 0.45rem 0.8rem; }
  .tier-pro .card-main { grid-template-columns: 72px 1fr; }
}
body { overflow-x: clip; }

/* Pro = full-width featured banner (score | story | facts) */
@media (min-width: 760px) {
  .cards-grid .service-card.tier-pro { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) 16rem; }
  .tier-pro .card-tier { grid-column: 1 / -1; }
  .tier-pro .card-facts { flex-direction: column; align-items: flex-start; align-content: center; gap: 0.5rem; border-top: 0; border-left: 1px solid #ecdcb0; padding: 1rem 1.25rem; }
  .tier-pro .card-facts li { font-size: 0.88rem; }
  .tier-pro .card-main { align-items: center; }
}
.avg-grade-circle .avg-num, .avg-grade-circle .avg-sublabel, .avg-grade-circle .avg-label { display: block; }
.avg-grade-circle .avg-sublabel { margin-top: 0.15rem; }
.avg-grade-circle .avg-label { font-weight: 500; opacity: 0.9; }

/* ============================================================
   SITE-WIDE SYSTEM (round 3): chrome, page heroes, inner pages
   ============================================================ */
.skip-link { position: absolute; left: 0.75rem; top: -4rem; z-index: 100; background: var(--ink); color: #fff; padding: 0.6rem 1rem; border-radius: var(--radius); font-weight: 600; text-decoration: none; transition: top 150ms var(--ease-out-quart); }
.skip-link:focus { top: 0.75rem; }
#main { height: 0; outline: 0; }

/* Header additions */
.nav-sep { width: 1px; height: 1.2rem; background: var(--rule); margin: 0 0.35rem; }
.site-header__nav a.nav-signin { color: var(--ink); font-weight: 600; }
@media (max-width: 900px) {
  .nav-sep { width: 100%; height: 1px; margin: 0.25rem 0; }
  .site-header__nav a.nav-cta { margin-left: 0; text-align: center; }
}

/* Footer */
.site-footer { text-align: left; padding: clamp(2rem, 5vw, 3.25rem) 0 1.5rem; margin-top: clamp(2.5rem, 6vw, 4.5rem); font-size: 0.92rem; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 2rem clamp(1.5rem, 4vw, 3rem); padding-bottom: 2rem; border-bottom: 1px solid rgba(255,255,255,0.16); }
.footer-brand .logo { color: #fff; }
.footer-brand .logo-icon { background: #fff; color: var(--ink); }
.footer-brand p { margin: 0.85rem 0 0; max-width: 28ch; line-height: 1.55; color: rgba(255,255,255,0.72); }
.footer-grid h2 { font-family: 'IBM Plex Sans', sans-serif; font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 600; color: rgba(255,255,255,0.6); margin: 0 0 0.85rem; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.footer-grid a { color: #fff; text-decoration: none; }
.footer-grid a:hover { text-decoration: underline; text-underline-offset: 0.2em; }
.footer-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.75rem 2rem; padding-top: 1.25rem; font-size: 0.82rem; color: rgba(255,255,255,0.65); }
.footer-base p { margin: 0; max-width: 62ch; }
.footer-base a { color: rgba(255,255,255,0.9); }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }

/* Page hero (inner pages) */
.page-hero { background: var(--ink); color: #fff; padding: clamp(1.1rem, 3vw, 1.75rem) 0 clamp(1.5rem, 4vw, 2.5rem); position: relative; overflow: hidden; }
.page-hero::before { content: ''; position: absolute; inset: 0; pointer-events: none; background-image: linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px); background-size: 40px 40px; mask-image: linear-gradient(100deg, transparent 35%, #000 100%); -webkit-mask-image: linear-gradient(100deg, transparent 35%, #000 100%); }
.page-hero .container { position: relative; animation: hero-rise 500ms var(--ease-out-quart) both; }
.page-hero .breadcrumb { color: rgba(255,255,255,0.62); font-size: 0.82rem; margin: 0 0 1.1rem; display: flex; flex-wrap: wrap; gap: 0.35rem; }
.page-hero .breadcrumb a { color: rgba(255,255,255,0.85); text-decoration: none; }
.page-hero .breadcrumb a:hover { color: #fff; text-decoration: underline; }
.page-hero .breadcrumb [aria-current] { color: rgba(255,255,255,0.62); }
.page-hero h1 { color: #fff; font-size: clamp(1.8rem, 4.2vw, 2.8rem); line-height: 1.06; letter-spacing: -0.028em; margin: 0; max-width: 24ch; font-weight: 700; }
.page-hero .eyebrow { margin-bottom: 0.5rem; }
.page-hero__sub { color: rgba(255,255,255,0.82); font-size: 1.02rem; line-height: 1.55; margin: 0.85rem 0 0; max-width: 60ch; }
.page-hero__sub strong, .page-hero__sub a { color: #fff; }
.page-hero__actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.25rem; }
.btn-hero { display: inline-flex; align-items: center; height: 42px; padding: 0 1.1rem; background: #fff; color: var(--ink); font-weight: 600; font-size: 0.92rem; border-radius: var(--radius); text-decoration: none; transition: background 150ms var(--ease-out-quart), transform 100ms var(--ease-out-quart); }
.btn-hero:hover { background: #cfe6e2; }
.btn-hero:active { transform: scale(0.97); }
.btn-hero--ghost { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,0.4); }
.btn-hero--ghost:hover { background: rgba(255,255,255,0.12); }

/* Inner-page content rhythm */
.insights-main, .news-main, .provider-overview, .council-map-page-main { padding-top: clamp(1.5rem, 3vw, 2.25rem); }
.complaints-stat, .pa-tile, .cm-type-card, .insights-scopes, .insights-chart-wrap, .news-card, .news-filter { border-radius: var(--radius-lg); border: 1px solid var(--rule); background: var(--surface); }
.complaints-stat__val, .pa-tile__val { font-family: 'Bricolage Grotesque', sans-serif; letter-spacing: -0.02em; }
.complaints-stat--upheld .complaints-stat__val { color: var(--grade-2-text); }
.pa-tile--good { background: var(--brand-tint); border-color: #b4d6d1; }
.pa-tile--vgood { background: #d9ebe8; border-color: #9cc7c1; }
.insights-header h1, .provider-overview-header h1 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); }
.insights-scope-card { border-radius: var(--radius); }
.insights-scope-card.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }
.news-card { transition: border-color 150ms var(--ease-out-quart), transform 150ms var(--ease-out-quart); }
.news-card:hover { background: var(--surface); border-color: var(--ink); transform: translateY(-2px); box-shadow: none; }
.news-card__title { color: var(--ink); }
.news-card__provider, .news-card__council { color: var(--thistle); }
.profile-section.provider-overview-stats h2, .provider-overview .profile-section h2 { border-bottom-color: var(--ink); }

/* Tables */
.insights-table-scroll, .complaints-table-wrap { border-radius: var(--radius-lg); border-color: var(--rule); }
.insights-table th, .complaints-table th, .cm-table th { background: var(--paper); color: var(--ink-soft); font-size: 0.76rem; letter-spacing: 0.04em; text-transform: uppercase; }
.complaints-table tbody tr:hover td, .insights-table tbody tr:hover td, .cm-table tbody tr:hover td { background: var(--brand-tint); }

/* Forms (global) */
input[type="text"], input[type="email"], input[type="tel"], input[type="password"], input[type="number"], input[type="date"], input[type="search"], textarea, select { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid #c3bfb2; border-radius: var(--radius); }
input:focus, textarea:focus, select:focus { outline: 3px solid var(--thistle); outline-offset: 1px; border-color: var(--thistle); }
.claim-form label, .enquiry-form label { color: var(--ink-soft); font-weight: 500; }
.claim-form legend { color: var(--ink); border-bottom-color: var(--ink); }
.form-error { color: var(--grade-1); font-weight: 600; }
.enquiry-success { background: var(--brand-tint); border: 1px solid #b4d6d1; padding: 0.75rem 0.9rem; border-radius: var(--radius); color: var(--brand-deep); font-weight: 500; }

/* Alerts */
.alert-success { background: var(--brand-tint); border-left-color: var(--brand); } .alert-success h2 { color: var(--brand-deep); }
.alert-warning { background: var(--gold-tint); border-left-color: var(--gold); color: #5a4313; } .alert-warning a { color: #5a4313; }
.alert-error { background: #f7e9ee; border-left-color: var(--grade-1); color: #5e0f26; }

/* Legal pages */
.legal-page { max-width: 46rem; margin-inline: auto; padding-top: clamp(1.5rem, 3vw, 2.5rem); }
.legal-page h2 { font-size: 1.15rem; border-top: 1px solid var(--rule); padding-top: 1.25rem; color: var(--ink); }
.legal-updated { color: var(--muted); font-size: 0.88rem; margin: 0 0 1.5rem; }
.legal-page p, .legal-page li { color: var(--ink-soft); }

/* Portal tabs */
.portal-tabs-wrap { background: var(--surface); border-bottom: 1px solid var(--rule); }
.portal-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem; }
.portal-tabs a { padding: 0.8rem 0.9rem; color: var(--ink-soft); text-decoration: none; font-weight: 500; font-size: 0.92rem; border-bottom: 3px solid transparent; }
.portal-tabs a:hover { color: var(--ink); }
.portal-tabs a[aria-current="page"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--thistle); }
.portal-tabs__who { margin-left: auto; font-size: 0.85rem; color: var(--muted); }
.portal-tabs__who a { padding: 0; border: 0; font-weight: 600; display: inline; color: var(--brand-deep); text-decoration: underline; }
@media (max-width: 640px) { .portal-tabs__who { display: none; } }
.portal-head h1 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); letter-spacing: -0.025em; }

/* Claim page: pitch first, form beside it */
.claim-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 26rem); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: start; padding-top: clamp(1.5rem, 4vw, 3rem); }
.claim-pitch h1 { font-size: clamp(1.9rem, 4.4vw, 3rem); line-height: 1.05; letter-spacing: -0.03em; margin: 0 0 0.75rem; }
.claim-pitch > p { color: var(--ink-soft); font-size: 1.05rem; max-width: 40rem; }
.claim-steps { list-style: none; counter-reset: s; padding: 0; margin: 1.5rem 0; display: grid; gap: 0.9rem; }
.claim-steps li { counter-increment: s; position: relative; padding-left: 2.6rem; line-height: 1.45; }
.claim-steps li::before { content: counter(s); position: absolute; left: 0; top: -0.1rem; width: 1.8rem; height: 1.8rem; display: grid; place-items: center; background: var(--ink); color: #fff; font-family: 'Bricolage Grotesque', sans-serif; font-weight: 700; border-radius: 50%; }
.claim-steps strong { display: block; }
.claim-layout .claim-form { margin: 0; position: sticky; top: 5rem; }
.claim-layout .claim-form fieldset { grid-template-columns: 1fr; }
.claim-tiers .tier-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0.75rem; }
@media (max-width: 900px) { .claim-layout { grid-template-columns: minmax(0, 1fr); } .claim-layout .claim-form { position: static; } }

/* Friendly error page */
.error-page { text-align: center; padding: clamp(3rem, 10vw, 6rem) 1rem; }
.error-page h1 { font-size: clamp(2rem, 6vw, 3.4rem); margin: 0 0 0.5rem; }
.error-page p { color: var(--ink-soft); max-width: 34rem; margin: 0 auto 1.5rem; }
.eyebrow--ink { color: var(--thistle); }
.claim-tiers .tier-card { border-radius: var(--radius-lg); border-color: var(--rule); }
.claim-tiers .tier-card--highlight { border: 2px solid var(--thistle); }
.claim-tiers .price small { font-size: 0.8rem; font-weight: 400; color: var(--muted); }

/* Provider overview: at-a-glance + type chips */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0.75rem; margin-bottom: 1.5rem; }
.stat-card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-lg); padding: 1rem 1.15rem; text-align: left; }
.stat-value { display: block; font-family: 'Bricolage Grotesque', sans-serif; font-size: clamp(1.8rem, 3.5vw, 2.4rem); font-weight: 700; line-height: 1; letter-spacing: -0.03em; color: var(--ink); }
.stat-label { display: block; margin-top: 0.5rem; font-size: 0.84rem; color: var(--muted); line-height: 1.35; }
.provider-subh { font-size: 0.78rem; letter-spacing: 0.09em; text-transform: uppercase; font-family: 'IBM Plex Sans', sans-serif; color: var(--ink-soft); margin: 1.25rem 0 0.6rem; }
.provider-type-list { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0; margin: 0; }
.provider-type-list li { display: inline-flex; align-items: center; gap: 0.5rem; background: var(--surface); border: 1px solid var(--rule); border-radius: 999px; padding: 0.3rem 0.85rem 0.3rem 0.35rem; font-size: 0.9rem; }
.provider-type-list .type-count { display: inline-grid; place-items: center; min-width: 1.7rem; height: 1.7rem; padding: 0 0.4rem; background: var(--ink); color: #fff; border-radius: 999px; font-weight: 600; font-size: 0.8rem; }
.provider-councils a { color: var(--brand-deep); }

/* Claim page tiers: always one row of three */
.claim-tiers .tier-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.claim-tiers .tier-card { padding: 0.9rem; }
.claim-tiers .tier-card li { font-size: 0.84rem; }
@media (max-width: 640px) { .claim-tiers .tier-cards { grid-template-columns: minmax(0, 1fr); } }

/* Align inner-page content with hero/header gutters */
.insights-main, .provider-overview, .news-main, .council-map-page-main, .legal-page, .portal, main.container { padding-left: 1.25rem; padding-right: 1.25rem; }
.council-map-page-main { width: 100%; max-width: 1100px; }
.council-map--page { border-radius: var(--radius-lg); border: 1px solid var(--rule); }
.claim-form fieldset.is-locked { opacity: 1; }
.claim-form fieldset.is-locked label { opacity: 0.55; }
.claim-form fieldset.is-locked .portal-callout { opacity: 1; }
.claim-form fieldset.is-locked .portal-callout a { color: #5a4313; }
.portal-callout { background: var(--thistle-tint); border: 1px solid #ddd1ee; color: var(--thistle-deep); }
.portal-callout a { color: var(--thistle-deep); }
.portal-stats__held dd { color: var(--thistle); }
.container > .complaints-stats, .container > .cm-type-grid { margin-top: 1.5rem; }
.complaints-filters, .complaints-filter-form, .cm-filters { border-radius: var(--radius-lg); }

/* ── Complaints pages: layout fixes ─────────────────────── */
.container > .complaints-stats { margin-top: 1.75rem; margin-bottom: 1.25rem; }
.complaints-stat { padding: 1rem 1.25rem; }
.complaints-stat__val { font-size: clamp(1.8rem, 3.5vw, 2.4rem); line-height: 1; }
.complaints-filters { background: var(--surface); border: 1px solid var(--rule); padding: 1rem; margin-bottom: 1.25rem; }
.complaints-filters__row { display: grid; grid-template-columns: minmax(180px, 1.4fr) repeat(4, minmax(130px, 1fr)) auto; gap: 0.75rem; align-items: end; }
.complaints-filter { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
.complaints-filter span { font-size: 0.78rem; font-weight: 600; color: var(--ink-soft); }
.complaints-filter input[type="search"], .complaints-filter select { width: 100%; min-width: 0; height: 42px; padding: 0 0.7rem; }
.complaints-filter--actions { flex-direction: row; gap: 0.5rem; }
.complaints-filter--actions .btn-primary, .complaints-filter--actions .btn-secondary { height: 42px; }
@media (max-width: 1000px) { .complaints-filters__row { grid-template-columns: repeat(2, minmax(0, 1fr)); } .complaints-filter--actions { grid-column: 1 / -1; } }
@media (max-width: 520px) { .complaints-filters__row { grid-template-columns: minmax(0, 1fr); } }
.complaints-table { table-layout: auto; }
.complaints-table td:nth-child(3), .complaints-table td:nth-child(4) { white-space: nowrap; font-size: 0.88rem; }
.complaints-table td:nth-child(2) { max-width: 22rem; }
.complaints-table td, .complaints-table th { padding: 0.75rem 0.9rem; }
.complaints-table-wrap { overflow-x: auto; }
.complaints-table tbody tr:hover td { background: var(--brand-tint); }

/* ── Complaints benchmarking table ──────────────────────── */
.cm-table td { vertical-align: middle; padding: 0.7rem 0.9rem; }
.cm-table td.cm-bar-cell { display: table-cell; min-width: 200px; white-space: nowrap; }
.cm-bar-cell .cm-bar { display: inline-block; width: calc(100% - 4.5rem); min-width: 100px; vertical-align: middle; height: 8px; border-radius: 4px; background: var(--rule-soft); }
.cm-bar-cell .cm-bar__fill { border-radius: 4px; }
.cm-bar-cell .cm-diff { display: inline-block; width: 4rem; margin-left: 0.5rem; text-align: right; vertical-align: middle; }
.cm-bar__fill--above { background: var(--grade-2); }
.cm-bar__avg { background: var(--ink); }
.cm-types { max-width: 15rem; font-size: 0.82rem; line-height: 1.35; color: var(--muted); }
.cm-diff.diff--below { color: var(--grade-2-text); }
.cm-diff.diff--above { color: var(--grade-6-text); }
.cm-type-card__ratio.ratio--above, .fill--above { color: var(--grade-2-text); }
.cm-mini-bar__fill.fill--above { background: var(--grade-2); }
.cm-mini-bar__fill.fill--below { background: var(--brand); }
.cm-type-card { padding: 0.9rem 1rem; }
.cm-type-grid { gap: 0.75rem; margin-bottom: 1.5rem; }
.container > .cm-type-grid { margin-top: 0.75rem; }

/* Benchmark readout + switch above the trend chart */
.bench-row { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; margin: 0.25rem 0 1rem; padding: 0; }
.bench-row__item { min-width: 8rem; }
.bench-row dt { font-size: 0.76rem; color: var(--muted); line-height: 1.3; }
.bench-row dd { margin: 0.1rem 0 0; font-family: 'Bricolage Grotesque', sans-serif; font-size: 1.7rem; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); line-height: 1.1; }
.bench-row__item--you dd { color: var(--brand); }
.bench-row dd small { font-family: 'IBM Plex Sans', sans-serif; font-size: 0.8rem; font-weight: 600; color: var(--muted); margin-left: 0.25rem; letter-spacing: 0; }
.bench-row dd small.is-up { color: var(--grade-6-text); } .bench-row dd small.is-down { color: var(--grade-2-text); }
.bench-switch { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin-bottom: 0.75rem; }
.bench-switch > span { font-size: 0.8rem; color: var(--muted); margin-right: 0.25rem; }
.bench-switch__btn { font: inherit; font-size: 0.82rem; padding: 0.3rem 0.8rem; border: 1px solid var(--rule); border-radius: 999px; background: var(--surface); color: var(--ink-soft); cursor: pointer; transition: background 150ms var(--ease-out-quart), color 150ms var(--ease-out-quart); }
.bench-switch__btn:hover { border-color: var(--ink); }
.bench-switch__btn[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.bench-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr)); gap: 0.75rem 1rem; }
.bench-row dd { font-size: 1.5rem; }

/* Provider match panel above search results */
.provider-match { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-lg); padding: 1rem 1.15rem; margin-bottom: 1rem; }
.provider-match h2 { font-family: 'IBM Plex Sans', sans-serif; font-size: 0.76rem; letter-spacing: 0.09em; text-transform: uppercase; font-weight: 600; color: var(--muted); margin: 0 0 0.6rem; }
.provider-match ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.provider-match li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.5rem 1.5rem; }
.provider-match li + li { padding-top: 0.6rem; border-top: 1px solid var(--rule-soft); }
.provider-match strong { display: block; font-size: 1.05rem; color: var(--ink); }
.provider-match li span { font-size: 0.86rem; color: var(--muted); }
.provider-match__links { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.provider-match__links a { display: inline-flex; align-items: center; height: 36px; padding: 0 0.9rem; border: 1px solid var(--ink); border-radius: var(--radius); color: var(--ink); font-weight: 600; font-size: 0.86rem; text-decoration: none; }
.provider-match__links a:first-child { background: var(--ink); color: #fff; }
.provider-match__links a:hover { background: var(--brand); border-color: var(--brand); color: #fff; }
.grade-asat { color: var(--muted); }

.logo { white-space: nowrap; }
