/* ============================================================
   PowerShare - Stylesheet
   People's Powerhouse branding
   Palette: Teal #1A7A6E | Slate #2C3E50 | Green pastel #EAF6EE
   ============================================================ */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --teal:       #1A7A6E;
  --teal-dark:  #145f55;
  --teal-light: #e8f4f2;
  --slate:      #2C3E50;
  --slate-mid:  #4a6070;
  --grey-bg:    #EAF6EE;   /* page / view background */
  --surface:    #f0f8f4;   /* inner element surfaces on white cards */
  --grey-border:#c0d4ca;   /* green-tinted border */
  --white:      #ffffff;
  --text:       #1a2630;
  --text-muted: #596570;
  --error:      #c0392b;
  --success:    #27ae60;
  --warning:    #e67e22;

  --radius:     10px;
  --radius-sm:  6px;
  --shadow:     0 2px 12px rgba(0,0,0,0.08);
  --shadow-lg:  0 4px 24px rgba(0,0,0,0.12);

  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--grey-bg);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--teal); text-decoration: underline; }
a:hover { color: var(--teal-dark); }

/* --- View switching --- */
.view { display: none; min-height: 100vh; }
.view.active { display: flex; flex-direction: column; }

/* ============================================================
   LANDING PAGE
   ============================================================ */

#view-landing {
  background: var(--white);
}

/* ── Header ── */
.landing-header {
  background: var(--white);
  border-bottom: 1px solid var(--grey-border);
  padding: 1rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 10;
}

.landing-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.pp-logo-link { display: inline-flex; text-decoration: none; flex-shrink: 0; }
.pp-logo { height: 40px; width: auto; }

.landing-header-product {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--slate);
  letter-spacing: -0.02em;
  padding-left: 1rem;
  border-left: 2px solid var(--grey-border);
  margin-left: 0.25rem;
}

/* ── Hero ── */
.landing-hero {
  background: linear-gradient(135deg, var(--slate) 0%, #1a3040 60%, #0e2030 100%);
  padding: 3.5rem 1.5rem 4rem;
  position: relative;
  overflow: hidden;
}

.landing-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 70% 50%, rgba(26,122,110,0.25) 0%, transparent 65%);
  pointer-events: none;
}

.landing-hero-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  position: relative;
  z-index: 1;
}

@media (min-width: 700px) {
  .landing-hero-inner {
    grid-template-columns: 1fr 380px;
    align-items: center;
  }
}

.landing-hero-text,
.landing-form-card { min-width: 0; }
.landing-hero-text { color: white; width: 100%; }

.landing-headline {
  font-size: clamp(2.2rem, 6vw, 3.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
  color: white;
}

.landing-sub {
  font-size: clamp(1rem, 2.5vw, 1.15rem);
  line-height: 1.7;
  color: rgba(255,255,255,0.75);
  max-width: 520px;
  width: 100%;
}

/* ── Form card ── */
.landing-form-card {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.postcode-label {
  display: block;
  font-weight: 700;
  font-size: 1rem;
  color: var(--slate);
  margin-bottom: 0.6rem;
}

.postcode-row {
  display: flex;
  gap: 0.5rem;
}

.postcode-input {
  flex: 1;
  min-width: 0;
  width: 0; /* flex will expand it; prevents input's intrinsic size from pushing layout */
  padding: 0.875rem 1rem;
  font-size: 1.15rem;
  font-family: var(--font);
  border: 2px solid var(--grey-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  background: var(--white);
  transition: border-color 0.15s, box-shadow 0.15s;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.postcode-input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(26,122,110,0.15);
}

.postcode-input.error { border-color: var(--error); }

.postcode-error {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--error);
}

.postcode-note {
  margin-top: 0.75rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  white-space: nowrap;
  text-decoration: none;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--teal);
  color: var(--white);
}

.btn-primary:hover { background: var(--teal-dark); }

.btn-hero {
  padding: 0.875rem 1.75rem;
  font-size: 1.1rem;
  background: var(--teal);
  color: white;
  border-radius: var(--radius-sm);
  font-weight: 700;
}

.btn-hero:hover { background: var(--teal-dark); }

/* ── Features ── */
.landing-features {
  padding: 5rem 1.5rem;
  background: var(--grey-bg);
}

.landing-features-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.landing-features-heading {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 800;
  color: var(--slate);
  letter-spacing: -0.02em;
  text-align: center;
  margin-bottom: 0.5rem;
}

.landing-features-sub {
  text-align: center;
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 3rem;
}

.features-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 560px) {
  .features-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 900px) {
  .features-grid { grid-template-columns: repeat(4, 1fr); }
}

.feature-card {
  background: white;
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  box-shadow: var(--shadow);
  border-top: 3px solid var(--teal);
  transition: transform 0.15s, box-shadow 0.15s;
}

.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.feature-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  line-height: 1;
}

.feature-card h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--slate);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.feature-card p {
  font-size: 0.83rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ── Mission strip ── */
.landing-mission {
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-dark) 100%);
  padding: 4rem 1.5rem;
  text-align: center;
}

.landing-mission-inner {
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.mission-pp-logo { height: 48px; width: auto; }

.mission-text {
  font-size: clamp(1rem, 2.5vw, 1.15rem);
  line-height: 1.7;
  color: rgba(255,255,255,0.9);
  font-style: italic;
}

.mission-link {
  font-size: 0.9rem;
  font-weight: 600;
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.35);
  padding-bottom: 2px;
  transition: color 0.15s, border-color 0.15s;
}

.mission-link:hover {
  color: white;
  border-color: white;
}

/* ── FAQs ── */
.landing-faqs {
  padding: 5rem 1.5rem;
  background: var(--white);
}

.landing-faqs-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.faq-columns {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  margin-top: 3rem;
}

@media (min-width: 800px) {
  .faq-columns { grid-template-columns: 1fr 1fr; }
}

.faq-group-heading {
  font-size: 1rem;
  font-weight: 700;
  color: var(--teal);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--teal-light);
}

.faq-item {
  border-bottom: 1px solid var(--grey-border);
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-q {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--slate);
  cursor: pointer;
  list-style: none;
  gap: 0.75rem;
  line-height: 1.4;
}

.faq-q::-webkit-details-marker { display: none; }

.faq-q::after {
  content: '+';
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--teal);
  flex-shrink: 0;
  transition: transform 0.2s;
}

details[open] .faq-q::after {
  transform: rotate(45deg);
}

.faq-a {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.7;
  padding-bottom: 0.9rem;
  padding-right: 1.5rem;
}

/* ── Footer ── */
.site-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--grey-border);
  background: var(--white);
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.footer-logos {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--grey-border);
}

.footer-logo--pp  { height: 44px; width: auto; }
.footer-logo--tnlcf { height: 44px; width: auto; }

.footer-funder {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.footer-funder-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.footer-inner p {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Keep pp-badge for results view header usage */
.pp-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal);
  background: var(--teal-light);
  padding: 0.3rem 0.75rem;
  border-radius: 100px;
}

/* ============================================================
   LOADING VIEW
   ============================================================ */

#view-loading {
  background: var(--grey-bg);
  align-items: center;
  justify-content: center;
}

.loading-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--grey-border);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-text {
  font-size: 1rem;
  color: var(--text-muted);
}

/* ============================================================
   RESULTS VIEW
   ============================================================ */

#view-results {
  background: var(--grey-bg);
}

/* Results header */
.results-header {
  background: var(--white);
  border-bottom: 1px solid var(--grey-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.results-header-inner {
  max-width: 780px;
  margin: 0 auto;
  padding: 0.875rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.back-btn {
  background: none;
  border: none;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--teal);
  cursor: pointer;
  padding: 0.3rem 0;
  white-space: nowrap;
  font-family: var(--font);
}

.back-btn:hover { text-decoration: underline; }

.share-btn {
  margin-left: auto;
  background: none;
  border: 1.5px solid var(--teal);
  border-radius: 999px;
  color: var(--teal);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.25rem 0.85rem;
  cursor: pointer;
  font-family: var(--font);
  white-space: nowrap;
  flex-shrink: 0;
}
.share-btn:hover { background: var(--teal); color: #fff; }

.results-location {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.results-postcode {
  font-size: 1rem;
  font-weight: 700;
  color: var(--slate);
  letter-spacing: 0.05em;
}

.results-region {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Results main */
.results-main {
  flex: 1;
  max-width: 780px;
  margin: 0 auto;
  width: 100%;
  padding: 1.5rem 1.25rem 3rem;
}

/* Topic filter */
.topic-filter-section {
  margin-bottom: 2rem;
}

.topic-filter-wrap {
  background: var(--white);
  border: 1px solid var(--grey-border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.topic-label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--slate);
  margin-bottom: 0.6rem;
}

.topic-search-row {
  display: flex;
  align-items: center;
  position: relative;
}

.topic-input {
  width: 100%;
  padding: 0.7rem 2.5rem 0.7rem 0.875rem;
  font-size: 0.95rem;
  font-family: var(--font);
  border: 2px solid var(--grey-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  background: var(--white);
  transition: border-color 0.15s;
}

.topic-input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(26,122,110,0.15);
}

.topic-clear {
  position: absolute;
  right: 0.5rem;
  background: none;
  border: none;
  font-size: 0.875rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.3rem;
}

.topic-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.topic-tag {
  display: inline-block;
  padding: 0.3rem 0.7rem;
  font-size: 0.8rem;
  font-weight: 500;
  background: var(--white);
  border: 1px solid var(--grey-border);
  border-radius: 100px;
  cursor: pointer;
  color: var(--slate);
  transition: background 0.12s, border-color 0.12s;
  list-style: none;
}

.topic-tag:hover,
.topic-tag.active {
  background: var(--teal-light);
  border-color: var(--teal);
  color: var(--teal-dark);
}

.topic-result {
  margin-top: 0.875rem;
  padding: 0.875rem 1rem;
  background: var(--teal-light);
  border-left: 3px solid var(--teal);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.875rem;
  color: var(--slate);
  line-height: 1.5;
}

.topic-result strong {
  color: var(--teal-dark);
}

.topic-result .topic-result-link {
  display: inline-block;
  margin-top: 0.4rem;
  font-weight: 600;
  color: var(--teal);
}

.topic-legal-hint {
  display: inline;
}

.topic-legal-btn {
  display: inline;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: var(--teal);
  cursor: pointer;
  text-decoration: underline;
}

.topic-legal-btn:hover {
  color: var(--teal-dark);
}

/* Governance stack */
.stack-section {
  margin-bottom: 1.5rem;
}

.stack-heading {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--slate);
  margin-bottom: 0.25rem;
}

.stack-subheading {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.governance-stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Layer cards */
.layer-card {
  background: var(--white);
  border: 1px solid var(--grey-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow 0.15s;
}

.layer-card.highlighted {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(26,122,110,0.15), var(--shadow);
}

.layer-card-header {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 1rem 1.25rem;
  cursor: pointer;
  user-select: none;
}

.layer-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  line-height: 1;
}

.layer-titles {
  flex: 1;
  min-width: 0;
}

.layer-type {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.1rem;
}

.layer-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--slate);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.layer-expand-btn {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  background: var(--white);
  border: 1px solid var(--grey-border);
  border-radius: 50%;
  font-size: 1rem;
  font-weight: 600;
  color: var(--slate-mid);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s;
  line-height: 1;
}

.layer-expand-btn:hover { background: var(--teal-light); }

.layer-expand-btn[aria-expanded="true"] .expand-icon {
  content: "−";
}

.layer-card-body {
  padding: 0 1.25rem 1.25rem;
  border-top: 1px solid rgba(0,0,0,0.06);
}

/* Representative */
.layer-representative {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.875rem;
  background: var(--teal-light);
  border-radius: var(--radius-sm);
  margin-bottom: 0.875rem;
}

.rep-photo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid white;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.rep-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.rep-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--teal-dark);
}

.rep-role {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

/* Responsibilities list */
.layer-responsibilities,
.layer-responsibilities-extra {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.875rem;
}

.layer-responsibilities li,
.layer-responsibilities-extra li {
  font-size: 0.875rem;
  color: var(--text);
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.layer-responsibilities li::before,
.layer-responsibilities-extra li::before {
  content: '•';
  color: var(--teal);
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 0.05em;
}

.layer-more {
  border-top: 1px solid rgba(0,0,0,0.06);
  padding-top: 0.875rem;
  margin-top: -0.25rem;
  margin-bottom: 0.875rem;
}

.show-more-btn {
  background: none;
  border: none;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--teal);
  cursor: pointer;
  padding: 0;
  font-family: var(--font);
  text-decoration: underline;
  margin-bottom: 0.875rem;
}

/* Contact block */
.layer-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--teal);
  background: var(--white);
  border: 1px solid var(--grey-border);
  border-radius: 100px;
  text-decoration: none;
  transition: background 0.12s, border-color 0.12s;
}

.contact-address {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
  width: 100%;
  line-height: 1.5;
}

.contact-link:hover {
  background: var(--teal-light);
  border-color: var(--teal);
  color: var(--teal-dark);
}

/* Layer type colour accents */
.layer-card[data-layer="parish"]         { border-left: 4px solid #8e44ad; }
.layer-card[data-layer="district"]       { border-left: 4px solid #2980b9; }
.layer-card[data-layer="unitary"]        { border-left: 4px solid #2980b9; }
.layer-card[data-layer="county"]         { border-left: 4px solid #16a085; }
.layer-card[data-layer="combined"]       { border-left: 4px solid var(--teal); }
.layer-card[data-layer="mp"]             { border-left: 4px solid var(--slate); }
.layer-card[data-layer="central"]        { border-left: 4px solid #c0392b; }

/* ============================================================
   MP RECORD CARD
   ============================================================ */

.mp-record-card {
  border-left: none !important; /* overridden per-party inline */
}

.mp-card-header {
  cursor: default;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--white);
}

.mp-header-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
}

.mp-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 800;
  flex-shrink: 0;
  letter-spacing: -0.02em;
}

.mp-header-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.mp-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.mp-party-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 100px;
  width: fit-content;
}

.mp-constituency {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Tabs */
.mp-tabs {
  display: flex;
  border-bottom: 1px solid var(--grey-border);
  background: var(--surface);
  padding: 0 1rem;
  gap: 0;
}

.mp-tab {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 0.65rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  font-family: var(--font);
  transition: color 0.12s, border-color 0.12s;
  margin-bottom: -1px;
}

.mp-tab:hover { color: var(--slate); }

.mp-tab.active {
  color: var(--teal);
  border-bottom-color: var(--teal);
  background: var(--white);
}

/* Panels */
.mp-panels {
  background: var(--white);
  border-radius: 0 0 var(--radius) var(--radius);
}

.mp-panel {
  display: none;
  padding: 1.25rem;
}

.mp-panel.active { display: block; }

/* Contact within About tab */
.mp-contact { margin-bottom: 0.5rem; }
.mp-contact-note {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
}

.write-link {
  background: var(--teal-light) !important;
  border-color: var(--teal) !important;
  color: var(--teal-dark) !important;
}

/* Loading state */
.tab-loading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-muted);
  font-size: 0.875rem;
  padding: 1rem 0;
}

.spinner.small {
  width: 20px;
  height: 20px;
  border-width: 2px;
  flex-shrink: 0;
}

.tab-intro {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.tab-empty {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

/* Activity list */
.activity-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  margin-bottom: 1rem;
}

.activity-item {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding-bottom: 0.875rem;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.activity-item:last-child { border-bottom: none; }

.activity-badge {
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  margin-top: 0.1rem;
}

.activity-badge--speech  { background: #eaf4fb; color: #1a6fa0; }
.activity-badge--written { background: var(--teal-light); color: var(--teal-dark); }

.activity-body { flex: 1; min-width: 0; }

.activity-heading {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--slate);
  margin-bottom: 0.25rem;
  line-height: 1.4;
}

.activity-heading a {
  color: var(--slate);
  text-decoration: none;
}
.activity-heading a:hover { color: var(--teal); text-decoration: underline; }

.activity-excerpt {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 0.3rem;
}

.activity-date {
  font-size: 0.73rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Voting record */
.voting-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.voting-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.85rem;
  line-height: 1.5;
}

.vote-indicator {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  margin-top: 0.1em;
}

.vote-indicator--aye  { background: #d4edda; color: #155724; }
.vote-indicator--no   { background: #f8d7da; color: #721c24; }
.vote-indicator--both { background: #fff3cd; color: #856404; }

.vote-desc  { flex: 1; color: var(--text); }

.vote-strength {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  flex-shrink: 0;
  align-self: center;
}

.vote-source {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.view-more-link {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--teal);
  text-decoration: none;
  margin-top: 0.25rem;
}

.view-more-link:hover { text-decoration: underline; }

/* Attribution */
.attribution {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--grey-border);
}

.attribution p {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (min-width: 600px) {
  .how-it-works {
    flex-direction: row;
  }

  .how-step {
    flex: 1;
    flex-direction: column;
    text-align: center;
    align-items: center;
  }

  .layer-card-body {
    padding: 0 1.5rem 1.5rem;
  }
}

@media (min-width: 780px) {
  .results-main {
    padding: 2rem 1.5rem 3rem;
  }

  .layer-name {
    white-space: normal;
  }
}

/* ============================================================
   MODULE B - CIVIC ACTIONS HUB
   ============================================================ */

.actions-section {
  margin-top: 2rem;
}

.section-header {
  margin-bottom: 1rem;
}

.action-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 0.75rem;
  overflow: hidden;
  border-left: 4px solid var(--grey-border);
  transition: border-color 0.15s;
}

.action-card:hover { border-left-color: var(--teal); }

.action-card-header {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1rem 1.1rem;
  cursor: pointer;
  user-select: none;
}

.action-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.action-header-text {
  flex: 1;
  min-width: 0;
}

.action-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--slate);
  margin-bottom: 0.2rem;
  line-height: 1.3;
}

.action-when {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.action-toggle { flex-shrink: 0; margin-top: 0.1rem; }

.action-card-body {
  padding: 0 1.1rem 1.1rem 3.2rem;
  border-top: 1px solid rgba(0,0,0,0.06);
}

.action-body {
  font-size: 0.875rem;
  color: var(--text);
  line-height: 1.6;
  margin: 0.85rem 0 1rem;
}

.action-steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.action-steps li {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.5;
}

.action-step-num {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--teal-light);
  color: var(--teal-dark);
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.1em;
}

.action-links {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}

.action-link {
  font-size: 0.82rem;
  color: var(--teal);
  text-decoration: none;
  font-weight: 500;
}

.action-link:hover { text-decoration: underline; }

.action-cta-wrap { margin-top: 0.5rem; }

.action-cta {
  display: inline-block;
  padding: 0.6rem 1.25rem;
  background: var(--teal);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font);
  text-decoration: none;
  transition: background 0.15s;
}

.action-cta:hover { background: var(--teal-dark); color: var(--white); text-decoration: none; }

/* FOI rights box */
.foi-rights-box {
  background: var(--teal-light);
  border-left: 3px solid var(--teal);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 0.85rem 1rem;
  margin-top: 1.25rem;
}

.foi-rights-box h4 {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--teal-dark);
  margin-bottom: 0.5rem;
}

.foi-rights-box ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.foi-rights-box li {
  font-size: 0.82rem;
  color: var(--slate);
  line-height: 1.5;
  padding-left: 1rem;
  position: relative;
}

.foi-rights-box li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--teal);
  font-size: 0.75rem;
}

/* ============================================================
   MODULE C - LIVE ISSUES / PETITIONS
   ============================================================ */

.petitions-section {
  margin-top: 2rem;
}

.petitions-loading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-muted);
  font-size: 0.875rem;
  padding: 1.5rem 0;
}

.petitions-search-wrap {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.25rem 0.85rem;
  margin-bottom: 1rem;
}

.petitions-search-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.petitions-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.petitions-empty {
  font-size: 0.875rem;
  color: var(--text-muted);
  padding: 1.5rem 0;
  line-height: 1.5;
}

#petition-results {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

@media (max-width: 600px) {
  #petition-results { grid-template-columns: 1fr; }
}

.petition-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  border-top: 3px solid var(--teal);
  transition: box-shadow 0.15s;
}

.petition-card:hover { box-shadow: var(--shadow-lg); }

.petition-card-inner {
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  height: 100%;
}

.petition-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  min-height: 1.4rem;
}

.petition-dept {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--surface);
  color: var(--text-muted);
  padding: 0.15rem 0.45rem;
  border-radius: 100px;
}

.petition-milestone {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.milestone--debated   { background: #d4edda; color: #155724; }
.milestone--scheduled { background: #cce5ff; color: #004085; }
.milestone--response  { background: #fff3cd; color: #856404; }
.milestone--threshold { background: var(--teal-light); color: var(--teal-dark); }

.petition-action {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--slate);
  line-height: 1.4;
  flex: 1;
}

.petition-action a {
  color: var(--slate);
  text-decoration: none;
}

.petition-action a:hover { color: var(--teal); text-decoration: underline; }

.petition-background {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.petition-signatures {
  margin-top: 0.25rem;
}

.petition-sig-bar {
  height: 6px;
  background: var(--surface);
  border-radius: 100px;
  overflow: visible;
  position: relative;
  margin-bottom: 0.35rem;
}

.petition-sig-fill {
  height: 100%;
  background: var(--teal);
  border-radius: 100px;
  transition: width 0.4s;
  min-width: 2px;
}

.petition-sig-marker {
  position: absolute;
  right: 0;
  top: -3px;
  width: 2px;
  height: 12px;
  background: var(--grey-border);
  border-radius: 1px;
}

.petition-sig-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.petition-sig-count {
  font-size: 0.8rem;
  color: var(--slate);
}

.petition-sig-goal {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.petition-sign-btn {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--teal);
  text-decoration: none;
  margin-top: 0.25rem;
}

.petition-sign-btn:hover { text-decoration: underline; }

/* ============================================================
   MODULE 4 - WARD COUNCILLORS
   ============================================================ */

.councillors-card {
  border-left: 4px solid #e8a838;
}

.councillors-heading {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 1rem 0 0.6rem;
}

.councillors-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.councillor-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  background: var(--surface);
  border-radius: var(--radius-sm);
}

.councillor-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 800;
  flex-shrink: 0;
  letter-spacing: -0.02em;
  overflow: hidden;
}

.councillor-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.councillor-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.councillor-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--slate);
  word-break: break-word;
}

.councillor-party {
  font-size: 0.75rem;
  font-weight: 600;
}

.councillor-actions {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  flex-shrink: 0;
}

.councillor-link {
  font-size: 0.75rem !important;
  padding: 0.25rem 0.5rem !important;
}

.councillors-verify-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0.75rem 0 0;
  line-height: 1.4;
  padding: 0.5rem 0.65rem;
  background: var(--surface);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--grey-border);
}

.councillors-verify-note a {
  color: var(--teal);
  text-decoration: underline;
}

.councillors-no-data {
  font-size: 0.83rem;
  color: var(--text-muted);
  margin: 0.75rem 0;
  line-height: 1.5;
}

/* ============================================================
   MODULE 3 - WRITE A LETTER
   ============================================================ */

.write-main {
  flex: 1;
  padding: 1.5rem 1rem 3rem;
  max-width: 680px;
  margin: 0 auto;
  width: 100%;
}

/* Progress bar */
.write-progress {
  margin-bottom: 1.75rem;
}

.write-progress-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.write-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: color 0.2s;
}

.write-step-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--grey-border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  transition: background 0.2s, color 0.2s;
}

.write-step.active .write-step-dot {
  background: var(--teal);
  color: var(--white);
}

.write-step.active {
  color: var(--teal);
}

.write-step.completed .write-step-dot {
  background: var(--teal-dark);
  color: var(--white);
  content: '✓';
}

.write-step.completed .write-step-dot::after {
  content: '✓';
  font-size: 0.75rem;
}

.write-step.completed .write-step-dot { font-size: 0; }
.write-step.completed .write-step-dot::after { font-size: 0.85rem; }

.write-step-line {
  flex: 1;
  height: 2px;
  background: var(--grey-border);
  min-width: 20px;
  max-width: 60px;
  margin-bottom: 1.4rem;
}

/* Recipient banner */
.write-recipient-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--teal-light);
  border: 1px solid var(--teal);
  border-radius: var(--radius);
  padding: 0.85rem 1.1rem;
  margin-bottom: 1.5rem;
}

.write-recipient-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.write-recipient-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.write-recipient-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--teal-dark);
}

.write-recipient-text strong {
  font-size: 1rem;
  color: var(--slate);
}

/* Step panels */
.write-step-panel {
  display: none;
}

.write-step-panel.active {
  display: block;
}

.write-step-heading {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--slate);
  margin-bottom: 0.75rem;
}

/* Tips */
.write-tip {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  background: #fffbea;
  border-left: 3px solid #f4c542;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 0.65rem 0.85rem;
  margin-bottom: 1.25rem;
  font-size: 0.83rem;
  color: var(--slate);
  line-height: 1.5;
}

.write-tip.small {
  margin-top: 0.5rem;
  margin-bottom: 0;
  font-size: 0.78rem;
}

.write-tip-icon {
  flex-shrink: 0;
  font-size: 1rem;
}

/* Form fields */
.write-field {
  margin-bottom: 1.25rem;
}

.write-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--slate);
  margin-bottom: 0.35rem;
}

.write-required {
  color: var(--error);
  margin-left: 0.1rem;
}

.write-input,
.write-textarea {
  width: 100%;
  border: 1.5px solid var(--grey-border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  font-size: 0.9rem;
  font-family: var(--font);
  color: var(--text);
  background: var(--white);
  transition: border-color 0.15s;
  line-height: 1.5;
}

.write-input:focus,
.write-textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(26,122,110,0.12);
}

.write-input.error,
.write-textarea.error {
  border-color: var(--error);
}

.write-textarea {
  resize: vertical;
  min-height: 80px;
}

.write-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

/* Radio group (tone) */
.write-radio-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.write-radio {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.875rem;
  cursor: pointer;
  padding: 0.55rem 0.75rem;
  border: 1.5px solid var(--grey-border);
  border-radius: var(--radius-sm);
  background: var(--white);
  transition: border-color 0.15s, background 0.15s;
}

.write-radio:has(input:checked) {
  border-color: var(--teal);
  background: var(--teal-light);
}

.write-radio input {
  accent-color: var(--teal);
}

/* Step navigation */
.write-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2rem;
  gap: 1rem;
}

.btn-secondary {
  background: var(--white);
  border: 1.5px solid var(--grey-border);
  color: var(--slate);
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  transition: border-color 0.15s, background 0.15s;
}

.btn-secondary:hover {
  border-color: var(--slate);
  background: var(--surface);
}

/* Letter preview */
.write-preview-wrap {
  background: var(--white);
  border: 1.5px solid var(--grey-border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.write-preview {
  font-family: 'Georgia', 'Times New Roman', serif;
  font-size: 0.9rem;
  line-height: 1.8;
  color: var(--text);
  padding: 1.5rem;
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 300px;
  outline: none;
}

.write-preview:focus {
  box-shadow: inset 0 0 0 2px var(--teal);
}

.write-editable-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 0.5rem 1rem;
  background: var(--surface);
  border-top: 1px solid var(--grey-border);
}

/* Send options */
.write-send-heading {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--slate);
  margin-bottom: 0.75rem;
}

.write-send-cards {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.write-send-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: var(--white);
  border: 1.5px solid var(--grey-border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  text-decoration: none;
  color: var(--text);
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.875rem;
  text-align: left;
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.write-send-card:hover {
  border-color: var(--teal);
  box-shadow: 0 2px 8px rgba(26,122,110,0.1);
  color: var(--text);
  text-decoration: none;
}

.write-send-card--info {
  cursor: default;
  background: var(--surface);
}

.write-send-card--info:hover {
  border-color: var(--grey-border);
  box-shadow: none;
}

.write-send-card > div {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.write-send-card strong {
  font-weight: 700;
  color: var(--slate);
}

.write-send-card span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.write-send-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}

.write-send-arrow {
  color: var(--text-muted);
  font-size: 1rem;
  flex-shrink: 0;
}

.write-copy-success {
  margin-top: 0.75rem;
  padding: 0.6rem 0.9rem;
  background: #d4edda;
  color: #155724;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
}

/* Write a Letter button on layer cards */
.write-letter-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.75rem;
  padding: 0.45rem 0.85rem;
  border: 1.5px solid var(--teal);
  border-radius: var(--radius-sm);
  background: var(--teal-light);
  color: var(--teal-dark);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}

.write-letter-btn:hover {
  background: var(--teal);
  color: var(--white);
  border-color: var(--teal);
  text-decoration: none;
}

/* Header title in write view */
.write-header-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--slate);
}

/* ============================================================
   ACCESSIBILITY
   ============================================================ */

:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ============================================================
   MODULE A - UPCOMING ELECTIONS
   ============================================================ */

#elections-section {
  margin-top: 2rem;
}

.election-card {
  background: var(--white);
  border: 1.5px solid var(--grey-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
  overflow: hidden;
}

.election-card-header {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1rem 1rem 0.75rem;
}

.election-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.election-header-text {
  flex: 1;
  min-width: 0;
}

.election-type-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.election-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--slate);
  margin: 0 0 0.2rem;
  line-height: 1.3;
}

.election-ward {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.election-date-block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.3rem;
  flex-shrink: 0;
}

.election-date {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: right;
}

.election-countdown {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  white-space: nowrap;
}

.election-countdown--urgent {
  background: #fdecea;
  color: #c0392b;
}

.election-countdown--soon {
  background: #fef9e7;
  color: #e67e22;
}

.election-countdown--upcoming {
  background: var(--teal-light);
  color: var(--teal-dark);
}

.election-cancelled,
.election-uncontested {
  margin: 0 1rem 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
}

.election-cancelled   { background: #fdecea; color: #c0392b; }
.election-uncontested { background: #fef9e7; color: #e67e22; }

.election-reg-warning {
  margin: 0 1rem 0.75rem;
  padding: 0.65rem 0.85rem;
  background: #fef9e7;
  border-left: 3px solid var(--warning);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.82rem;
  color: var(--slate);
  line-height: 1.5;
}

.election-reg-warning a { color: var(--teal); font-weight: 600; }

.election-candidates {
  padding: 0 1rem 0.75rem;
}

.election-candidates-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.election-candidates-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.election-candidate {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
}

.election-candidate-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.election-candidate-name {
  font-weight: 600;
  color: var(--slate);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.election-candidate-party {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.election-candidate-link {
  font-size: 0.75rem;
  color: var(--teal);
  text-decoration: none;
  flex-shrink: 0;
}

.election-candidate-link:hover { text-decoration: underline; }

.election-candidate-more {
  font-size: 0.75rem;
  color: var(--text-muted);
  padding-left: 1.25rem;
}

.election-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0 1rem 0.75rem;
}

.election-action-btn {
  display: inline-block;
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1.5px solid var(--grey-border);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--slate);
  text-decoration: none;
  cursor: pointer;
  font-family: var(--font);
  transition: border-color 0.15s, background 0.15s;
}

.election-action-btn:hover {
  border-color: var(--teal);
  color: var(--teal-dark);
  text-decoration: none;
}

.election-action-btn--primary {
  background: var(--teal);
  border-color: var(--teal);
  color: var(--white);
}

.election-action-btn--primary:hover {
  background: var(--teal-dark);
  border-color: var(--teal-dark);
  color: var(--white);
}

.election-deadlines {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  padding: 0.65rem 1rem;
  border-top: 1px solid var(--grey-border);
  background: var(--surface);
}

.election-deadline {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ============================================================
   MORE TOOLS NAVIGATION
   ============================================================ */

.more-tools-section {
  margin-top: 2rem;
}

.more-tools-grid {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.more-tool-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  background: var(--white);
  border: 1.5px solid var(--grey-border);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  text-align: left;
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.875rem;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.more-tool-card:hover {
  border-color: var(--teal);
  box-shadow: 0 2px 8px rgba(26,122,110,0.1);
}

.more-tool-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.more-tool-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.more-tool-text strong {
  font-weight: 700;
  color: var(--slate);
  font-size: 0.9rem;
}

.more-tool-text span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.more-tool-arrow {
  color: var(--text-muted);
  font-size: 1.1rem;
  flex-shrink: 0;
}

@media (min-width: 640px) {
  .more-tools-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ============================================================
   MODULE B - YOUR RIGHTS IN PLAIN ENGLISH
   ============================================================ */

.rights-main {
  flex: 1;
  max-width: 680px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
  width: 100%;
}

.rights-hero {
  text-align: center;
  padding: 1.25rem 0 1rem;
}

.rights-hero-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--slate);
  margin-bottom: 0.4rem;
}

.rights-hero-sub {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.rights-search-wrap {
  margin-bottom: 1rem;
}

.rights-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}

.rights-filter {
  padding: 0.3rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1.5px solid var(--grey-border);
  border-radius: 20px;
  background: var(--white);
  color: var(--slate);
  cursor: pointer;
  font-family: var(--font);
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.rights-filter:hover,
.rights-filter.active {
  border-color: var(--teal);
  background: var(--teal);
  color: var(--white);
}

.rights-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.rights-card {
  background: var(--white);
  border: 1.5px solid var(--grey-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.rights-card-header {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1rem;
  cursor: pointer;
}

.rights-card-header:hover { background: var(--surface); }

.rights-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.rights-header-text {
  flex: 1;
  min-width: 0;
}

.rights-category-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--teal-dark);
  background: var(--teal-light);
  padding: 0.1rem 0.5rem;
  border-radius: 10px;
  margin-bottom: 0.3rem;
}

.rights-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--slate);
  margin: 0 0 0.25rem;
  line-height: 1.3;
}

.rights-summary {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

.rights-card-body {
  padding: 0 1rem 1rem;
  border-top: 1px solid var(--grey-border);
}

.rights-detail {
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.7;
  margin: 0.85rem 0;
}

.rights-detail p { margin-bottom: 0.65rem; }

.rights-contacts {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  margin-bottom: 0.75rem;
}

.rights-contacts h4 {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--slate);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.rights-contacts ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.rights-contacts li {
  font-size: 0.82rem;
  color: var(--slate);
  padding-left: 1rem;
  position: relative;
}

.rights-contacts li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--teal);
  font-size: 0.75rem;
}

.rights-links {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.rights-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
  padding: 2rem 0;
}

/* ============================================================
   MODULE C - COUNCIL SPENDING EXPLORER
   ============================================================ */

.spending-main {
  flex: 1;
  max-width: 680px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
  width: 100%;
}

.spending-hero {
  text-align: center;
  padding: 1.25rem 0 0.75rem;
}

.spending-hero-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--slate);
  margin-bottom: 0.4rem;
}

.spending-hero-sub {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.spending-council-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  padding: 0.65rem 0.85rem;
  background: var(--teal-light);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.spending-council-label {
  color: var(--teal-dark);
}

.spending-council-wrap strong {
  color: var(--teal-dark);
}

.spending-chart {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 0.75rem;
}

.spending-row {
  background: var(--white);
  border: 1.5px solid var(--grey-border);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
}

.spending-label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.4rem;
}

.spending-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--slate);
}

.spending-pct {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--slate);
}

.spending-bar-track {
  height: 8px;
  background: var(--surface);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.4rem;
}

.spending-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}

.spending-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.4;
}

.spending-source {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 1.75rem;
}

.spending-data-section {
  margin-top: 0.5rem;
}

.spending-data-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--slate);
  margin-bottom: 0.85rem;
}

.spending-links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.spending-link-card {
  display: flex;
  gap: 0.85rem;
  background: var(--white);
  border: 1.5px solid var(--grey-border);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
}

.spending-link-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.spending-link-body {
  flex: 1;
  min-width: 0;
}

.spending-link-body strong {
  display: block;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--slate);
  margin-bottom: 0.3rem;
}

.spending-link-body p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 0.5rem;
}

/* ============================================================
   MODULE D - POLITICAL LITERACY
   ============================================================ */

.learn-main {
  flex: 1;
  max-width: 680px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
  width: 100%;
}

.learn-hero {
  text-align: center;
  padding: 1.25rem 0 1.25rem;
}

.learn-hero-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--slate);
  margin-bottom: 0.4rem;
}

.learn-hero-sub {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.learn-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.learn-card {
  background: var(--white);
  border: 1.5px solid var(--grey-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.learn-card-header {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1rem;
  cursor: pointer;
}

.learn-card-header:hover { background: var(--surface); }

.learn-card-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.learn-card-titles {
  flex: 1;
  min-width: 0;
}

.learn-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--slate);
  margin: 0 0 0.25rem;
  line-height: 1.3;
}

.learn-card-intro {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

.learn-card-body {
  padding: 0 1rem 1rem;
  border-top: 1px solid var(--grey-border);
}

.learn-facts {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0.85rem 0 1rem;
  padding: 0.75rem;
  background: var(--surface);
  border-radius: var(--radius-sm);
}

.learn-facts li {
  font-size: 0.85rem;
  color: var(--slate);
  line-height: 1.6;
  padding-left: 1.1rem;
  position: relative;
}

.learn-facts li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--teal);
  font-size: 0.75rem;
  font-weight: 700;
  top: 0.2em;
}

.learn-quiz {
  background: var(--white);
  border: 1.5px solid var(--grey-border);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
}

.learn-quiz-q {
  font-size: 0.875rem;
  color: var(--slate);
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

.learn-quiz-options {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
}

.learn-quiz-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--slate);
  cursor: pointer;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  transition: border-color 0.1s, background 0.1s;
}

.learn-quiz-option:hover {
  background: var(--surface);
  border-color: var(--grey-border);
}

.learn-quiz-option input { cursor: pointer; }

.learn-quiz-submit {
  padding: 0.5rem 1.1rem;
  background: var(--teal);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font);
  transition: background 0.15s;
}

.learn-quiz-submit:hover { background: var(--teal-dark); }

.learn-quiz-result {
  margin-top: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  line-height: 1.6;
}

.learn-quiz-result--correct {
  background: #d4edda;
  color: #155724;
}

.learn-quiz-result--wrong {
  background: #fdecea;
  color: #721c24;
}

.learn-quiz-result--info {
  background: var(--surface);
  color: var(--text-muted);
}

.quiz-label { font-weight: 700; }
.quiz-label--correct { color: #155724; }
.quiz-label--wrong   { color: #721c24; }


/* ============================================================
   SHARED MODULE UTILITIES
   ============================================================ */

.module-loading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-muted);
  font-size: 0.875rem;
  padding: 1.5rem 0;
}

.module-empty {
  font-size: 0.875rem;
  color: var(--text-muted);
  padding: 0.75rem 0;
  line-height: 1.5;
}

/* ============================================================
   LOCAL NEWS - #news-section
   ============================================================ */

.news-list {
  list-style: none;
  background: var(--white);
  border: 1.5px solid var(--grey-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.news-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.news-item:last-child { border-bottom: none; }

.news-headline {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--slate);
  text-decoration: none;
  line-height: 1.4;
  flex: 1;
}
.news-headline:hover { color: var(--teal); text-decoration: underline; }

.news-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.news-attribution {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.6rem;
}
.news-attribution a { color: var(--teal); }

/* ============================================================
   FOI PROMPT SUGGESTIONS
   ============================================================ */

.foi-prompt-wrap { margin-top: 0.6rem; }

.foi-prompt-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.foi-prompt-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.foi-prompt-btn {
  padding: 0.3rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--white);
  border: 1.5px solid var(--grey-border);
  border-radius: 100px;
  color: var(--teal);
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s, border-color 0.12s;
}
.foi-prompt-btn:hover {
  background: var(--teal-light);
  border-color: var(--teal);
}

/* FOI rights box */
.foi-rights-box {
  background: var(--teal-light);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  margin-top: 1.5rem;
}
.foi-rights-box h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--teal-dark);
  margin-bottom: 0.5rem;
}
.foi-rights-box ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.foi-rights-box li {
  font-size: 0.85rem;
  color: var(--text);
  padding-left: 1rem;
  position: relative;
}
.foi-rights-box li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--teal);
}

/* ============================================================
   PLANNING NEAR ME - #planning-section
   ============================================================ */

.planning-group {
  background: var(--white);
  border: 1.5px solid var(--grey-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
}

.planning-group-header {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-bottom: 0.65rem;
}

.planning-group-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  margin-top: 0.05rem;
}

.planning-group-meta { flex: 1; min-width: 0; }

.planning-group-heading {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--slate);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.15rem;
}

.planning-group-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35em;
  height: 1.35em;
  padding: 0 0.3em;
  font-size: 0.72rem;
  background: var(--teal-light);
  color: var(--teal-dark);
  border-radius: 100px;
  font-weight: 700;
}

.planning-group-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.planning-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding-top: 0.2rem;
}

.planning-item {
  font-size: 0.85rem;
  color: var(--text);
  padding-left: 1rem;
  position: relative;
  line-height: 1.5;
}
.planning-item::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--teal);
  font-size: 0.75rem;
  top: 0.05em;
}

.planning-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

/* ============================================================
   ENGAGEMENT LOG - #engagement-section
   ============================================================ */

.engagement-summary {
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-dark) 100%);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  color: white;
}

.engagement-summary-title {
  font-size: 0.95rem;
  margin-bottom: 0.85rem;
  opacity: 0.95;
}
.engagement-summary-title strong { font-weight: 800; }

.engagement-stats {
  display: flex;
  gap: 1.75rem;
}

.engagement-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
}

.engagement-stat-num {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
}

.engagement-stat-label {
  font-size: 0.75rem;
  opacity: 0.85;
}

.engagement-history {
  background: var(--white);
  border: 1.5px solid var(--grey-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.25rem;
}

.engagement-history-heading {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.65rem;
}

.engagement-list {
  list-style: none;
  display: flex;
  flex-direction: column;
}

.engagement-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.engagement-item:last-child { border-bottom: none; }

.engagement-type-icon { font-size: 1rem; flex-shrink: 0; margin-top: 0.1rem; }

.engagement-event-body {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  flex: 1;
  min-width: 0;
}

.engagement-type-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--teal);
}

.engagement-summary-text {
  font-size: 0.875rem;
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.engagement-recipient {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.engagement-date {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 0.15rem;
}

/* ============================================================
   AREA DASHBOARD - #area-dashboard-section
   ============================================================ */

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 560px) {
  .dashboard-grid { grid-template-columns: 1fr 1fr; }
}

.dashboard-card {
  background: var(--white);
  border: 1.5px solid var(--grey-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.dashboard-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.dashboard-card-icon { font-size: 1.5rem; flex-shrink: 0; }

.dashboard-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--slate);
  margin: 0;
}

.dashboard-card-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0;
}

.dashboard-stat-big {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}

.dashboard-stat-number {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--slate);
  line-height: 1;
}

.dashboard-stat-label {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.dashboard-aqi-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  align-self: flex-start;
  color: white;
}

.dashboard-aqi-number {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1;
}

.dashboard-aqi-label {
  font-size: 0.9rem;
  font-weight: 700;
}

.dashboard-top-list {
  list-style: none;
  display: flex;
  flex-direction: column;
}

.dashboard-top-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  padding: 0.3rem 0;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.dashboard-top-item:last-child { border-bottom: none; }

.dashboard-top-label { color: var(--text); }

.dashboard-top-count {
  font-weight: 700;
  color: var(--slate);
}

.dashboard-source-link {
  font-size: 0.78rem;
  color: var(--teal);
  text-decoration: none;
  margin-top: auto;
}
.dashboard-source-link:hover { text-decoration: underline; }

.news-fallback {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.news-fallback-text {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ============================================================
   BOTTOM TAB NAVIGATION
   ============================================================ */

.app-tabs {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 500;
  display: flex;
  background: #fff;
  border-top: 1.5px solid #e4e8ec;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.07);
  height: 60px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.app-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 8px 4px 6px;
  color: #a0a8b0;
  font-family: var(--font);
  transition: color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  min-width: 0;
}

.app-tab:hover { color: #555; }

.app-tab-icon {
  font-size: 1.3rem;
  line-height: 1;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.app-tab-label {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.app-tab.active {
  color: var(--teal);
}

.app-tab.active .app-tab-icon {
  transform: translateY(-2px) scale(1.1);
}

/* Active indicator bar at top of tab */
.app-tab::after {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 28px;
  height: 3px;
  background: var(--teal);
  border-radius: 0 0 3px 3px;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.app-tab.active::after {
  transform: translateX(-50%) scaleX(1);
}

/* Extra bottom padding on views that show the tab bar */
#view-results,
#view-rights,
#view-spending,
#view-learn,
#view-foi {
  padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px));
}

/* ── Feature view header ─────────────────────────────────────── */

.feature-header-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
}

.feature-header-icon {
  font-size: 1.3rem;
  line-height: 1;
  flex-shrink: 0;
}

.feature-header-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--slate);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.feature-postcode-chip {
  flex-shrink: 0;
  background: var(--teal);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 14px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ── Councillor claim button ──────────────────────────────────── */

.claim-profile-btn {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--grey-border);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.claim-profile-btn:hover {
  background: #e8f5e9;
  color: var(--teal);
  border-color: var(--teal);
}

/* ── Claim modal ──────────────────────────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-box {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 8px 40px rgba(0,0,0,0.18);
  padding: 1.5rem;
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  font-size: 1.4rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}
.modal-close:hover { color: var(--slate); }

.modal-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--slate);
  margin: 0 0 0.5rem;
}

.modal-intro {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0 0 1rem;
  line-height: 1.5;
}

.modal-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--slate);
  margin-bottom: 0.75rem;
}

.modal-required { color: var(--teal); }

.modal-input {
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--grey-border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  outline: none;
  transition: border-color 0.15s;
}
.modal-input:focus { border-color: var(--teal); }

.modal-textarea { resize: vertical; min-height: 72px; }

.modal-error {
  font-size: 0.8rem;
  color: #c62828;
  background: #fce4e4;
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  margin-bottom: 0.75rem;
}

.modal-success {
  font-size: 0.875rem;
  color: #1b5e20;
  background: #e8f5e9;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-weight: 600;
}

.claim-submit-btn {
  width: 100%;
  background: var(--teal);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 11px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
}
.claim-submit-btn:hover { opacity: 0.88; }
.claim-submit-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Statutory Tools section ──────────────────────────────────── */

.statutory-section {
  padding: 1.25rem 1rem 0.5rem;
  border-bottom: 2px solid rgba(0,0,0,0.06);
  margin-bottom: 0.25rem;
}

.statutory-section-header {
  margin-bottom: 1rem;
}

.statutory-section-title-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.statutory-section-icon {
  font-size: 1.5rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}

.statutory-section-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--slate);
  margin: 0 0 0.2rem;
}

.statutory-section-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.45;
}

.rights-guides-section {
  padding: 1.25rem 1rem 0.5rem;
}

.rights-guides-header {
  margin-bottom: 1rem;
}

/* ── Statutory tool card ──────────────────────────────────────── */

.statutory-tool-card {
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  overflow: hidden;
  transition: border-color 0.15s;
}

.statutory-tool-card:hover {
  border-color: var(--teal);
}

.statutory-tool-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  cursor: pointer;
  user-select: none;
}

.statutory-tool-icon {
  font-size: 1.4rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}

.statutory-tool-header-text {
  flex: 1;
  min-width: 0;
}

.statutory-tool-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}

.statutory-duty-badge {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  background: #1A7A6E;
  color: #fff;
  border-radius: 4px;
  padding: 2px 7px;
  white-space: nowrap;
  flex-shrink: 0;
}

.statutory-act-ref {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

.statutory-tool-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--slate);
  margin: 0 0 0.3rem;
  line-height: 1.3;
}

.statutory-tool-summary {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.45;
}

/* ── Tool body ────────────────────────────────────────────────── */

.statutory-tool-body {
  padding: 0 1rem 1rem;
  border-top: 1px solid #f0f4f8;
}

.statutory-tool-section {
  margin-top: 1rem;
}

.statutory-tool-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--slate);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 0.5rem;
}

.statutory-when-list,
.statutory-steps,
.statutory-contacts {
  margin: 0;
  padding-left: 1.25rem;
  font-size: 0.875rem;
  color: var(--text);
  line-height: 1.6;
}

.statutory-when-list li,
.statutory-steps li,
.statutory-contacts li {
  margin-bottom: 0.3rem;
}

.statutory-detail {
  font-size: 0.875rem;
  color: var(--text);
  line-height: 1.65;
}

.statutory-detail p { margin: 0 0 0.6rem; }

.statutory-timescale-row {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.85rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.statutory-timescale-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #065f46;
  white-space: nowrap;
  flex-shrink: 0;
}

.statutory-timescale-value {
  font-size: 0.8rem;
  color: #065f46;
  line-height: 1.45;
}

.statutory-escalation {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0.5rem 0 0;
}

.statutory-escalation strong {
  color: var(--slate);
}

.statutory-tool-actions {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.statutory-letter-btn {
  background: var(--teal);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
}

.statutory-letter-btn:hover { opacity: 0.88; }
