:root {
  --primary-red: #c8102e;
  --primary-red-dark: #991127;
  --primary-red-deep: #74111f;
  --red-muted: #f8e9ed;
  --red-muted-strong: #f3d6dd;
  --bg: #f4f5f7;
  --bg-alt: #f7f7f7;
  --surface: #ffffff;
  --surface-strong: #f1f2f4;
  --surface-tint: #fbf4f6;
  --surface-tint-strong: #f7eaee;
  --ink: #111111;
  --ink-soft: #222222;
  --muted: #4b4f55;
  --heading: #8f1026;
  --link: #991127;
  --link-hover: #74111f;
  --accent: #7d1b2f;
  --success: #1f6a31;
  --success-bg: #e6f3e8;
  --info: #234f7d;
  --info-bg: #eaf1f8;
  --warning-bg: #fdf3f5;
  --warning-border: #dfb2bc;
  --error: #922437;
  --error-bg: #fdf0f3;
  --border: #d7dbe0;
  --border-strong: #bcc4cd;
  --shadow: 0 18px 38px rgba(29, 33, 39, 0.08);
  --radius: 20px;
  --radius-sm: 14px;
  --container: 1120px;
  --font-heading: Georgia, "Times New Roman", serif;
  --font-body: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(200, 16, 46, 0.06), transparent 24rem),
    linear-gradient(180deg, #ffffff 0%, #ffffff 100%);
  line-height: 1.68;
}

a {
  color: var(--link);
  text-underline-offset: 0.14em;
}

a:hover,
a:focus-visible {
  color: var(--link-hover);
}

img {
  max-width: 100%;
}

.container {
  width: min(calc(100% - 2rem), var(--container));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 2000;
  isolation: isolate;
  backdrop-filter: blur(18px);
  background:
    linear-gradient(90deg, rgba(200, 16, 46, 0.08) 0%, rgba(200, 16, 46, 0.02) 26%, rgba(255, 255, 255, 0) 58%),
    linear-gradient(180deg, rgba(246, 247, 249, 0.97) 0%, rgba(234, 237, 241, 0.97) 100%);
  border-bottom: 1px solid rgba(188, 196, 205, 0.92);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    inset 0 -1px 0 rgba(188, 196, 205, 0.38),
    0 2px 10px rgba(200, 16, 46, 0.1),
    0 10px 24px rgba(29, 33, 39, 0.09);
}

.site-header::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.86);
  pointer-events: none;
  opacity: 0.9;
}

.site-header__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.2rem 0;
}

.site-header__left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  position: relative;
}

.site-header__right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1.25rem;
  flex-wrap: wrap;
  position: relative;
}

.site-header__menu {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.site-header__menu nav {
  padding: 0.45rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(188, 196, 205, 0.8);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    0 6px 16px rgba(29, 33, 39, 0.06);
}

.site-brand {
  display: inline-flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--ink);
  min-width: 0;
}

.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 3rem;
  padding: 0.7rem 0.95rem;
  border: 1px solid rgba(188, 196, 205, 0.82);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--heading);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(29, 33, 39, 0.08);
}

.mobile-menu-btn:hover,
.mobile-menu-btn:focus-visible {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(153, 17, 39, 0.24);
}

.mobile-menu-btn__lines {
  display: inline-flex;
  flex-direction: column;
  gap: 0.2rem;
}

.mobile-menu-btn__lines span {
  display: block;
  width: 1rem;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.site-title {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.12rem;
}

.site-name {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 2vw + 0.8rem, 2.15rem);
  font-weight: 700;
  letter-spacing: 0.035em;
  line-height: 1.1;
  color: #991127;
  transition: color 0.2s ease, text-shadow 0.2s ease;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.72),
    0 2px 10px rgba(29, 33, 39, 0.08);
}

.site-brand:hover .site-name,
.site-brand:focus-visible .site-name {
  color: var(--primary-red-dark);
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.8),
    0 4px 16px rgba(29, 33, 39, 0.1);
}

.site-ward,
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  color: var(--primary-red);
  font-weight: 700;
}

.site-ward {
  text-transform: none;
  letter-spacing: 0.01em;
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
}

.site-nav {
  display: flex;
  gap: 0.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.site-nav a {
  text-decoration: none;
  padding: 0.75rem 1.15rem;
  border-radius: 24px;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 1rem;
}

.site-nav__cta {
  background: var(--heading);
  color: #fff !important;
  padding: 0.6rem 1rem !important;
  font-size: 1rem;
  font-weight: 700;
}

.site-nav a.is-active,
.site-nav a:hover,
.site-nav a:focus-visible {
  background: rgba(200, 16, 46, 0.08);
  color: var(--heading);
}

.site-nav a.is-active {
  box-shadow: inset 0 -2px 0 rgba(200, 16, 46, 0.5);
}

.site-nav__cta:hover,
.site-nav__cta:focus-visible,
.site-nav__cta.is-active {
  background: var(--primary-red-deep) !important;
  color: #fff !important;
  box-shadow: 0 10px 22px rgba(143, 16, 38, 0.18);
}

.site-contact {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.site-contact__link {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  color: var(--ink-soft);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
  font-size: 1rem;
}

.site-contact__link:hover,
.site-contact__link:focus-visible {
  color: var(--heading);
}

.site-contact__label {
  font-weight: 700;
  color: var(--muted);
}

.site-contact__value {
  font-weight: 600;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.hero,
.section {
  padding: 3.2rem 0;
}

.hero {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(239, 242, 246, 0.96) 100%);
  border-bottom: 1px solid rgba(215, 219, 224, 0.78);
}

.hero--actions-only {
  padding: 1.75rem 0 1.25rem;
}

.hero__grid,
.form-layout,
.card-grid,
.homepage-grid {
  display: grid;
  gap: 1.5rem;
}

.hero__grid {
  grid-template-columns: 1.5fr 1fr;
  align-items: start;
}

h1,
h2,
h3 {
  font-family: var(--font-heading);
  line-height: 1.15;
  margin-top: 0;
  color: var(--heading);
}

h1 {
  font-size: clamp(2.2rem, 6vw, 4.4rem);
  margin-bottom: 1rem;
  max-width: 12ch;
}

.lead {
  font-size: 1.14rem;
  color: var(--ink-soft);
  max-width: 58ch;
}

.lead.compact {
  font-size: 1.04rem;
}

.hero__actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.hero__actions--homepage {
  margin-top: 0;
}

.section-heading {
  margin-bottom: 1.35rem;
}

.section-heading h2 {
  margin-bottom: 0.5rem;
}

.section-heading--homepage {
  max-width: 46rem;
}

.section--homepage-notice {
  padding-top: 0;
  background: var(--bg-alt);
}

.section--homepage-links {
  background: var(--bg-alt);
}

.homepage-notice-card {
  max-width: 960px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.85rem 1.25rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease, border-color 150ms ease, color 150ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
}

.button:focus-visible,
.map-filter-select:focus-visible,
.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible,
.site-nav a:focus-visible {
  outline: 3px solid rgba(200, 16, 46, 0.2);
  outline-offset: 2px;
}

.button--primary {
  background: var(--primary-red);
  color: #fff;
  box-shadow: var(--shadow);
}

.button--secondary {
  background: var(--red-muted);
  border-color: rgba(200, 16, 46, 0.16);
  color: var(--primary-red-dark);
}

.button--primary:hover,
.button--primary:focus-visible {
  background: var(--primary-red-dark);
}

.button--report-problem {
  background: var(--heading);
  color: #fff;
}

.button--report-problem:hover,
.button--report-problem:focus-visible {
  background: var(--primary-red-deep);
  color: #fff;
}

.button--secondary:hover,
.button--secondary:focus-visible {
  background: var(--red-muted-strong);
  border-color: rgba(153, 17, 39, 0.28);
  color: var(--primary-red-deep);
}

.button--danger {
  background: #b42318;
  border-color: #b42318;
  color: #fff;
  box-shadow: 0 10px 20px rgba(180, 35, 24, 0.18);
}

.button--danger:hover,
.button--danger:focus-visible {
  background: #912018;
  border-color: #912018;
  color: #fff;
}

.button--ghost {
  background: #f4f5f7;
  border-color: rgba(107, 114, 128, 0.2);
  color: #6b7280;
  box-shadow: none;
}

.button--amber {
  background: #d97706;
  color: #fff;
  border-color: #b45309;
}

.button--amber:hover,
.button--amber:focus-visible {
  background: #b45309;
  color: #fff;
  border-color: #92400e;
}

.button--outline {
  background: transparent;
  border-color: rgba(153, 17, 39, 0.28);
  color: var(--primary-red-dark);
  box-shadow: none;
}

.button--outline:hover,
.button--outline:focus-visible {
  background: var(--red-muted);
  border-color: rgba(153, 17, 39, 0.4);
  color: var(--primary-red-deep);
}

.button--full {
  width: 100%;
}

.notice-card,
.info-card,
.form-panel,
.side-card,
.narrow-card,
.admin-card,
.admin-table-wrap {
  background: var(--surface);
  border: 1px solid rgba(215, 219, 224, 0.92);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.notice-card,
.info-card,
.form-panel,
.side-card,
.narrow-card,
.admin-card,
.admin-detail-card,
.public-map-card,
.admin-table-wrap {
  position: relative;
}

/* Keep overflow clipping only on cards where content must not escape the border-radius */
.notice-card,
.info-card,
.side-card,
.narrow-card,
.admin-card,
.admin-detail-card,
.public-map-card {
  overflow: hidden;
}

/* admin-table-wrap must not clip the search dropdown — keep it visible */
.admin-table-wrap {
  overflow: visible;
}

.notice-card::before,
.info-card::before,
.form-panel::before,
.side-card::before,
.narrow-card::before,
.admin-card::before,
.admin-detail-card::before,
.public-map-card::before,
.admin-table-wrap::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-red) 0%, var(--primary-red-dark) 100%);
}

.notice-card,
.info-card,
.side-card,
.narrow-card,
.admin-card {
  padding: 1.5rem;
}

.notice-list,
.side-card ul,
.prose ul {
  padding-left: 1.2rem;
}

.card-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.homepage-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.homepage-grid--overview {
  align-items: start;
}

.homepage-intro {
  max-width: 64rem;
}

.homepage-intro h1 {
  max-width: 14ch;
}

.homepage-hero {
  background:
    radial-gradient(circle at top right, rgba(200, 16, 46, 0.16), transparent 20rem),
    radial-gradient(circle at left center, rgba(35, 79, 125, 0.08), transparent 22rem),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(237, 240, 244, 0.98) 100%);
}

.homepage-hero-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 1fr);
  align-items: center;
}

.homepage-hero-visual {
  min-width: 0;
}

.homepage-hero-visual__panel {
  border-radius: calc(var(--radius) + 4px);
  background:
    radial-gradient(circle at 20% 20%, rgba(200, 16, 46, 0.16), transparent 9rem),
    radial-gradient(circle at 80% 30%, rgba(35, 79, 125, 0.14), transparent 10rem),
    linear-gradient(160deg, rgba(255, 255, 255, 0.98) 0%, rgba(228, 233, 239, 0.98) 100%);
  border: 1px solid rgba(188, 196, 205, 0.62);
  box-shadow: var(--shadow);
  padding: 1.25rem;
}


.homepage-hero-visual__summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  align-content: start;
}

.homepage-hero-visual__stat {
  display: grid;
  gap: 0.25rem;
  align-content: start;
  padding: 0.85rem 0.9rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(188, 196, 205, 0.58);
}

.homepage-hero-visual__stat strong {
  font-size: 0.85rem;
  line-height: 1.4;
}

.homepage-hero-visual__label {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary-red-dark);
  font-weight: 700;
}

.homepage-tracker {
  position: relative;
  margin-top: 1rem;
  border-radius: calc(var(--radius) + 6px);
  background:
    radial-gradient(circle at 90% 50%, rgba(200, 16, 46, 0.08), transparent 10rem),
    linear-gradient(160deg, rgba(255, 255, 255, 0.99) 0%, rgba(248, 233, 237, 0.65) 100%);
  border: 2px solid rgba(200, 16, 46, 0.22);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.1), 0 1px 4px rgba(0, 0, 0, 0.06);
  padding: 1.75rem 1.75rem;
}

.homepage-tracker__label {
  font-size: 1.4rem;
  letter-spacing: -0.02em;
  text-transform: none;
  color: var(--primary-red-dark);
  font-weight: 800;
  margin: 0 0 1.1rem;
  line-height: 1.15;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid rgba(200, 16, 46, 0.15);
}

.homepage-tracker__fields {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 0.65rem;
}

.homepage-tracker__input {
  border: 1.5px solid rgba(188, 196, 205, 0.9);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-size: 1rem;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.95);
  min-width: 0;
  font-family: inherit;
}

.homepage-tracker__input:focus {
  outline: 2px solid var(--primary-red);
  outline-offset: 1px;
  border-color: var(--primary-red);
}

.homepage-tracker__btn {
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-sm);
  background: var(--primary-red);
  color: #fff;
  border: none;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
}

.homepage-tracker__btn:hover,
.homepage-tracker__btn:focus-visible {
  background: var(--primary-red-dark);
}

/* In-flow result panel — expands the tracker card naturally, no scrollbar */
.homepage-tracker #case-tracker-result:not(:empty) {
  position: relative;
  margin-top: 1rem;
  background: var(--surface);
  border: 1.5px solid var(--border, rgba(188, 196, 205, 0.9));
  border-radius: var(--radius);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  padding: 1rem 1.25rem;
  overflow: visible;
}

/* Suppress the top-margin that the inner classes add — the container provides the gap already */
.homepage-tracker #case-tracker-result .case-tracker__result,
.homepage-tracker #case-tracker-result .case-tracker__error,
.homepage-tracker #case-tracker-result .case-tracker__loading {
  margin-top: 0;
}

/* Fade-in animation when content is injected — opacity only avoids stacking-context side effects */
@keyframes trackerReveal {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.homepage-tracker #case-tracker-result > * {
  animation: trackerReveal 0.18s ease both;
}

.homepage-tracker__result {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  line-height: 1.6;
}

.homepage-tracker__result--found {
  background: rgba(35, 79, 125, 0.07);
  border: 1px solid rgba(35, 79, 125, 0.18);
}

.homepage-tracker__result--error {
  background: rgba(200, 16, 46, 0.06);
  border: 1px solid rgba(200, 16, 46, 0.18);
  color: var(--accent);
}

.homepage-links {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.homepage-link-card {
  display: grid;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--ink);
  min-height: 100%;
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}

.homepage-link-card:hover,
.homepage-link-card:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 20px 36px rgba(29, 33, 39, 0.12);
  border-color: rgba(153, 17, 39, 0.25);
}

.homepage-link-card h2 {
  margin-bottom: 0.15rem;
}

.homepage-link-card .eyebrow {
  color: var(--muted);
}

.homepage-link-card p:last-child {
  margin-bottom: 0;
  color: var(--ink-soft);
}

.homepage-summary-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.homepage-summary-grid--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.homepage-summary-card p:last-child {
  margin-bottom: 0;
}

.homepage-summary-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(244, 246, 248, 0.98) 100%);
}

.faq-shell {
  display: grid;
  gap: 2rem;
}

.faq-intro {
  margin: 0 0 0.25rem;
  max-width: none;
  text-align: center;
}

.faq-page-title {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
  max-width: none;
  white-space: normal;
  overflow-wrap: anywhere;
}

.faq-group {
  position: relative;
  display: grid;
  gap: 0.8rem;
  padding: 1.55rem;
  border-radius: calc(var(--radius) + 2px);
  background:
    radial-gradient(circle at top right, rgba(200, 16, 46, 0.08), transparent 11rem),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(247, 247, 247, 0.98) 100%);
  border: 1px solid rgba(215, 219, 224, 0.88);
  box-shadow: 0 18px 34px rgba(29, 33, 39, 0.07), 0 6px 16px rgba(29, 33, 39, 0.04);
  overflow: hidden;
}

.faq-group::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-red) 0%, #ff6b8a 55%, var(--primary-red-dark) 100%);
}

.faq-group h2 {
  margin: 0 0 0.3rem;
  font-size: 1.6rem;
}

.faq-item {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(215, 219, 224, 0.84);
  border-radius: 18px;
  box-shadow: 0 10px 22px rgba(29, 33, 39, 0.05);
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.faq-item:hover,
.faq-item:focus-within {
  transform: translateY(-1px);
  border-color: rgba(200, 16, 46, 0.16);
  box-shadow: 0 14px 28px rgba(29, 33, 39, 0.07);
}

.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 1.15rem 3.4rem 1.15rem 1.15rem;
  font-weight: 700;
  color: var(--ink);
  position: relative;
  line-height: 1.45;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(244, 246, 248, 0.86));
  border-bottom: 1px solid rgba(215, 219, 224, 0.72);
  transition: background 0.15s ease, color 0.15s ease;
}

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

.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 1.25rem;
  top: 50%;
  width: 1.85rem;
  height: 1.85rem;
  display: grid;
  place-items: center;
  transform: translateY(-50%);
  color: var(--primary-red-dark);
  font-size: 1.05rem;
  border-radius: 999px;
  background: rgba(200, 16, 46, 0.08);
  border: 1px solid rgba(200, 16, 46, 0.16);
}

.faq-item:hover summary,
.faq-item:focus-within summary {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 233, 237, 0.78));
}

.faq-item[open] summary::after {
  content: "-";
}

.faq-item[open] {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(251, 244, 246, 0.96));
  border-color: rgba(200, 16, 46, 0.16);
  box-shadow: 0 16px 30px rgba(29, 33, 39, 0.07);
}

.faq-item[open] summary {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(251, 244, 246, 0.92));
  color: var(--primary-red-dark);
}

.faq-answer {
  padding: 0 1.2rem 1.2rem;
  color: var(--ink);
  line-height: 1.68;
}

.faq-answer p {
  margin-top: 0;
  margin-bottom: 0.95rem;
}

.faq-answer p:last-child {
  margin-bottom: 0;
}

.section--updates-map {
  padding-bottom: 0;
}

.report-page-title-wrap {
  margin-bottom: 1.75rem;
}

.report-page-title {
  max-width: none;
  margin: 0;
  text-align: center;
}

.form-layout {
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.8fr);
  align-items: start;
}

.form-panel {
  padding: 2rem;
}

.side-panel {
  display: grid;
  gap: 1rem;
}

.side-card--warning {
  border-color: var(--warning-border);
  background: var(--warning-bg);
}

.info-card--warning {
  border-color: var(--warning-border);
  background: var(--warning-bg);
}

.map-section {
  display: grid;
  gap: 1.25rem;
}

.map-section__intro {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
  flex-wrap: wrap;
}

.map-filter-control {
  display: grid;
  gap: 0.45rem;
  min-width: min(100%, 15rem);
}

.map-filter-control label {
  font-weight: 700;
  color: var(--ink-soft);
}

.map-filter-select {
  width: 100%;
  min-height: 3rem;
  padding: 0.8rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(200, 16, 46, 0.2);
  background: #fff;
  color: var(--primary-red-dark);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.map-filter-select:hover {
  border-color: rgba(153, 17, 39, 0.35);
}

.map-filter-select:focus,
.map-filter-select:focus-visible {
  outline: none;
  border-color: var(--primary-red);
  box-shadow: 0 0 0 4px rgba(200, 16, 46, 0.08);
}

.map-ward-filter {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  justify-content: flex-end;
  justify-self: end;
  margin-top: 0.2rem;
}

.map-ward-filter label {
  font-weight: 700;
  color: var(--ink-soft);
  margin: 0;
}

.map-ward-filter__select {
  min-width: 13.5rem;
}

.public-map-card {
  background: var(--surface);
  border: 1px solid rgba(215, 219, 224, 0.92);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
  display: grid;
  gap: 0.85rem;
}

.map-status-filters {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}

.map-status-button {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.7rem 1rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  background: #fff;
  color: var(--ink-soft);
}

.map-status-button--reported {
  border-color: var(--primary-red-dark);
  color: var(--primary-red-dark);
}

.map-status-button--dealt {
  border-color: #c2600f;
  color: #c2600f;
}

.map-status-button--completed {
  border-color: #1f6a31;
  color: #1f6a31;
}

.map-status-button--all {
  margin-left: 0;
  border-color: rgba(200, 16, 46, 0.2);
  color: var(--primary-red-dark);
}

.map-status-button--reported.is-active,
.map-status-button--reported:hover,
.map-status-button--reported:focus-visible {
  background: var(--primary-red);
  color: #fff;
}

.map-status-button--dealt.is-active,
.map-status-button--dealt:hover,
.map-status-button--dealt:focus-visible {
  background: #f97316;
  color: #fff;
}

.map-status-button--completed.is-active,
.map-status-button--completed:hover,
.map-status-button--completed:focus-visible {
  background: #3aa374;
  color: #fff;
}

.map-status-button--all.is-active,
.map-status-button--all:hover,
.map-status-button--all:focus-visible {
  background: var(--primary-red-dark);
  color: #fff;
}

.map-legend {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}

.map-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  color: var(--muted);
}

.map-legend__dot {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 999px;
  border: 2px solid transparent;
}

.map-legend__dot--reported {
  background: #c8102e;
  border-color: #a00d24;
}

.map-legend__dot--dealt {
  background: #f97316;
  border-color: #c2600f;
}

.map-legend__dot--completed {
  background: #16a34a;
  border-color: #10793a;
}

.public-map-shell {
  position: relative;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 6px);
  overflow: hidden;
  background: var(--surface-strong);
}

.public-map-shell .public-map-panel {
  display: block;
  width: 100%;
  height: 760px;
  min-height: 760px;
  border: 0;
  border-radius: 0;
}

.public-map-status {
  margin: 0.85rem 0 0;
}

.public-map-note {
  margin: 0.45rem 0 0;
}

.report-form {
  display: grid;
  gap: 1.2rem;
}

.field,
.checkbox-field {
  display: grid;
  gap: 0.45rem;
  min-width: 0;
}

.field[hidden],
.checkbox-field[hidden] {
  display: none;
}

.field label,
.field legend,
.checkbox-field label {
  font-weight: 700;
  font-size: 1rem;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #fff;
  font: inherit;
  color: var(--ink);
}

.field input:hover,
.field select:hover,
.field textarea:hover {
  border-color: var(--border-strong);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--primary-red);
  box-shadow: 0 0 0 4px rgba(200, 16, 46, 0.08);
  outline: none;
}

.field textarea {
  resize: vertical;
  min-height: 7rem;
}

.field fieldset,
.radio-group {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.radio-group legend {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  white-space: normal;
  overflow-wrap: anywhere;
}

.radio-group__options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  min-width: 0;
}

.radio-option {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  box-sizing: border-box;
  max-width: 100%;
  min-height: 2.75rem;
  padding: 0.7rem 0.95rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #fff;
  font-weight: 600;
  cursor: pointer;
  overflow: hidden;
}

.radio-option span {
  flex: 0 1 auto;
  overflow-wrap: anywhere;
}

.radio-option input {
  margin: 0;
  flex: 0 0 auto;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.lookup-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr auto;
  align-items: end;
}

.lookup-input-row,
.lookup-select-row {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.lookup-input-row--issue {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.form-row {
  display: grid;
  gap: 1rem;
}

.form-row--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.required-mark {
  color: var(--primary-red);
  font-weight: 700;
}

.field--button {
  min-width: 10rem;
}

.finder-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-width: 3.25rem;
  min-height: 3.25rem;
  padding: 0.75rem 0.95rem;
  border-radius: 16px;
  white-space: nowrap;
}

.icon-button[hidden] {
  display: none;
}

.icon-button__icon {
  width: 1.1rem;
  height: 1.1rem;
  flex: 0 0 auto;
}

.icon-button__label {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1;
}

.icon-button--reset {
  min-width: 6.75rem;
}

#report-form #refresh-addresses.icon-button--reset {
  min-width: 3.25rem;
  padding-inline: 0.75rem;
}

#report-form #lookup-addresses,
#report-form #refresh-addresses {
  background: var(--primary-red-dark);
  border-color: var(--primary-red-dark);
  color: #fff;
}

#report-form #lookup-addresses:hover,
#report-form #lookup-addresses:focus-visible,
#report-form #refresh-addresses:hover,
#report-form #refresh-addresses:focus-visible {
  background: var(--primary-red-deep);
  border-color: var(--primary-red-deep);
  color: #fff;
}

.field-hint,
.muted {
  color: var(--ink-soft);
  font-size: 1rem;
}

.map-panel {
  width: 100%;
  height: 340px;
  min-height: 340px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-strong);
}

.field--map {
  gap: 0.75rem;
}

.map-section-heading {
  display: grid;
  gap: 0.6rem;
}

.map-section-title {
  margin: 0;
  font-weight: 700;
  color: var(--ink);
}

.map-section-divider {
  height: 1px;
  background: rgba(215, 219, 224, 0.92);
}

.report-map-shell {
  position: relative;
  width: 100%;
  min-height: 340px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface-strong);
}

.leaflet-control-locationfinder {
  border-radius: 10px;
  overflow: hidden;
}

.leaflet-control-locationfinder__button {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: #ffffff;
  color: #1f2329;
  cursor: pointer;
}

.leaflet-control-locationfinder__button:hover,
.leaflet-control-locationfinder__button:focus-visible {
  background: #f0f2f5;
  color: #111111;
}

.leaflet-control-locationfinder__button--active {
  background: #1d5fa5;
  color: #ffffff;
}

.leaflet-control-locationfinder__button--active:hover,
.leaflet-control-locationfinder__button--active:focus-visible {
  background: #154b82;
  color: #ffffff;
}

.leaflet-control-locationfinder__button:focus-visible {
  outline: 2px solid rgba(17, 17, 17, 0.2);
  outline-offset: -2px;
}

.leaflet-control-locationfinder__button[disabled] {
  opacity: 0.6;
  cursor: wait;
}

.leaflet-control-locationfinder__icon {
  width: 18px;
  height: 18px;
}

.leaflet-control-attribution {
  font-size: 0.6rem !important;
  opacity: 0.8;
  background: rgba(255, 255, 255, 0.75) !important;
  padding: 1px 4px !important;
  border-radius: 2px;
}

.leaflet-control-attribution a {
  font-size: 0.6rem !important;
}

.report-map-panel {
  display: block;
  width: 100%;
  height: 340px;
  min-height: 340px;
  border: 0;
  border-radius: 0;
}

.report-map-panel--pin-drop-active {
  box-shadow: inset 0 0 0 3px rgba(153, 17, 39, 0.25);
}

.report-map-panel--pin-drop-over {
  box-shadow: inset 0 0 0 4px rgba(116, 17, 31, 0.38);
}

.map-pin-tray {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin-top: 0.65rem;
  padding: 0.6rem 0.75rem;
  border: 1px dashed rgba(153, 17, 39, 0.28);
  border-radius: 12px;
  background: #fcf8f9;
}

.map-pin-dock {
  width: 3.4rem;
  height: 3.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(153, 17, 39, 0.45);
  border-radius: 10px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.map-pin-dock--detached {
  border-style: dashed;
  border-color: rgba(153, 17, 39, 0.28);
  background: #fbf1f4;
}

.map-pin-token {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.15rem;
  height: 2.15rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #1d5fa5;
  cursor: grab;
  transition: transform 140ms ease, opacity 140ms ease;
}

.map-pin-token:active {
  cursor: grabbing;
}

.map-pin-token:hover,
.map-pin-token:focus-visible {
  color: #154b82;
  transform: scale(1.05);
}

.map-pin-token--detached {
  opacity: 0.08;
  transform: scale(0.82);
}

.map-pin-token__icon {
  width: 1.8rem;
  height: 1.8rem;
  flex: 0 0 auto;
  filter: drop-shadow(0 2px 4px rgba(29, 33, 39, 0.26));
}

.map-pin-tray__help {
  margin: 0;
  flex: 1 1 16rem;
}

.leaflet-container {
  font-family: var(--font-body);
  width: 100%;
}

.leaflet-container img {
  max-width: none;
  max-height: none;
}

.leaflet-control-zoom a {
  color: var(--primary-red-dark);
  border-bottom-color: rgba(215, 219, 224, 0.9);
}

.leaflet-control-zoom a:hover,
.leaflet-control-zoom a:focus-visible {
  background: var(--red-muted);
  color: var(--primary-red-deep);
}

.leaflet-popup-content-wrapper {
  border-radius: 16px;
  border: 1px solid rgba(215, 219, 224, 0.92);
  box-shadow: 0 16px 32px rgba(29, 33, 39, 0.16);
}

.leaflet-popup-content {
  color: var(--ink);
}

.leaflet-popup-tip {
  box-shadow: none;
}

/* ── Map popup ── */
.mp-popup .leaflet-popup-content-wrapper {
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  border: none;
  padding: 0;
  overflow: visible;
}

.mp-popup .leaflet-popup-content {
  margin: 0;
  width: auto !important;
}

.mp-popup .leaflet-popup-tip-container {
  display: block !important;
  width: 30px;
  height: 15px;
  margin: 0 auto;
}

.mp-popup .leaflet-popup-tip {
  background: #ffffff;
  box-shadow: none;
  width: 16px;
  height: 16px;
}

.mp-card {
  padding: 0.9rem 1rem 0.85rem;
  min-width: 220px;
  background: #ffffff;
  border-radius: 18px;
}

.mp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
}

.mp-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #1a1a2e;
  -webkit-text-fill-color: #1a1a2e;
  -webkit-text-stroke: 0 transparent;
  background: none !important;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.mp-title-label {
  font-weight: 800;
  color: inherit;
  -webkit-text-fill-color: currentColor;
}

.mp-title-value {
  font-weight: 800;
  color: inherit;
  -webkit-text-fill-color: currentColor;
}

.mp-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: #9ca3af;
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
  line-height: 1;
  flex-shrink: 0;
  transition: color 0.15s;
}

.mp-close:hover {
  color: #374151;
  background: #f3f4f6;
}

.mp-divider {
  height: 1px;
  background: #f0f0f0;
  margin: 0 0 0.55rem;
}

.mp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.18rem 0;
}

.mp-label {
  font-size: 0.875rem;
  color: #9ca3af;
  font-weight: 500;
  white-space: nowrap;
}

.mp-date {
  font-size: 0.9rem;
  color: #1a1a2e;
  font-weight: 500;
  text-align: right;
  white-space: nowrap;
}

.mp-badge {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.28rem 0.75rem;
  border-radius: 99px;
  white-space: nowrap;
}

.mp-badge--reported {
  background: #ffe4e6;
  color: #be123c;
}

.mp-badge--being-dealt-with {
  background: #fef3c7;
  color: #92400e;
}

.mp-badge--completed {
  background: #d1fae5;
  color: #065f46;
}

.mp-note-block {
  margin-top: 0.45rem;
  padding-top: 0.45rem;
  border-top: 1px solid #f0f0f0;
}

.mp-note-label {
  margin: 0 0 0.28rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  color: #9ca3af;
}

.mp-note {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.5;
  color: #1a1a2e;
}

.map-meta {
  margin-top: 0.75rem;
}

.map-location-summary {
  margin: 0 0 0.6rem;
}

.map-warning {
  margin: 0;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(146, 36, 55, 0.26);
  background: var(--error-bg);
  color: var(--error);
  font-weight: 600;
}

.confirmation-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, #ffffff 0%, #f8f4f5 100%);
  padding: 1rem;
}

.confirmation-card:focus {
  outline: 3px solid rgba(200, 16, 46, 0.18);
  outline-offset: 2px;
}

.confirmation-card__header {
  margin-bottom: 0.9rem;
}

.confirmation-card__header h2 {
  margin-bottom: 0.35rem;
}

.confirmation-list {
  display: grid;
  gap: 0.9rem;
  margin: 0;
}

.confirmation-list div {
  display: grid;
  gap: 0.3rem;
  padding: 0.9rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(215, 219, 224, 0.85);
}

.confirmation-list dt {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.confirmation-list dd {
  margin: 0;
  font-weight: 600;
  word-break: break-word;
}

.confirmation-status {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  border-radius: 999px;
  padding: 0.5rem 0.85rem;
}

.status-pill,
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 999px;
  padding: 0.5rem 0.9rem;
  font-size: 0.95rem;
  font-weight: 700;
}

.status-pill[data-state="pending"],
.status-badge,
.confirmation-status[data-state="pending"] {
  background: #eef1f4;
  color: #4b5562;
}

.status-pill[data-state="valid"],
.confirmation-status[data-state="valid"] {
  background: var(--success-bg);
  color: var(--success);
}

.status-pill[data-state="invalid"],
.confirmation-status[data-state="invalid"] {
  background: var(--error-bg);
  color: var(--error);
}

.checkbox-field {
  grid-template-columns: auto 1fr;
  align-items: start;
}

.checkbox-field input {
  margin-top: 0.2rem;
}

.error-summary {
  border: 1px solid rgba(146, 36, 55, 0.26);
  background: var(--error-bg);
  color: #6f1f30;
  border-radius: var(--radius-sm);
  padding: 1rem 1.1rem;
}

.info-summary {
  border: 1px solid rgba(35, 79, 125, 0.2);
  background: var(--info-bg);
  color: var(--info);
  border-radius: var(--radius-sm);
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
}

.confirm-dialog {
  width: min(calc(100% - 2rem), 34rem);
  border: 1px solid rgba(215, 219, 224, 0.92);
  border-radius: var(--radius);
  padding: 0;
  box-shadow: 0 24px 48px rgba(29, 33, 39, 0.2);
}

.confirm-dialog::backdrop {
  background: rgba(29, 33, 39, 0.48);
}

.confirm-dialog__content {
  display: grid;
  gap: 1rem;
  padding: 1.5rem;
}

.confirm-dialog__content h2 {
  margin-bottom: 0;
}

.confirm-dialog__note {
  margin: 0;
  padding: 1rem;
  border-radius: var(--radius-sm);
  background: var(--surface-tint);
  border: 1px solid rgba(215, 219, 224, 0.92);
}

.confirm-dialog__actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.honeypot {
  position: absolute;
  left: -9999px;
}

.prose {
  max-width: 70ch;
}

.about-container {
  display: grid;
  grid-template-columns: minmax(250px, 320px) minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
}

.about-image {
  position: sticky;
  top: 6rem;
}

.about-image img {
  display: block;
  width: 100%;
  max-width: 320px;
  height: auto;
  border-radius: 18px;
  box-shadow: 0 16px 30px rgba(29, 33, 39, 0.12);
}

.about-text {
  min-width: 0;
}

.about-text p + p {
  margin-top: 1.4rem;
}

.updates-intro {
  margin: 0 auto 1.5rem;
  max-width: none;
  text-align: center;
}

.updates-page-title {
  display: block;
  width: 100%;
  max-width: none;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.updates-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.updates-feed {
  margin-top: 1rem;
}

.updates-table-shell {
  border: 1px solid rgba(215, 219, 224, 0.9);
  border-radius: 14px;
  background: #fff;
  overflow-x: auto;
}

.updates-table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
}

.updates-table thead th {
  text-align: left;
  font-size: 0.86rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  background: #f4f6f8;
  border-bottom: 1px solid rgba(215, 219, 224, 0.92);
  padding: 0.75rem 0.9rem;
  font-weight: 700;
  white-space: nowrap;
}

.updates-table tbody td {
  padding: 0.9rem;
  border-bottom: 1px solid rgba(215, 219, 224, 0.82);
  vertical-align: top;
  white-space: nowrap;
}

.updates-table tbody tr:last-child td {
  border-bottom: 0;
}

.updates-table tbody tr:hover {
  background: rgba(200, 16, 46, 0.04);
}

.updates-table__row {
  cursor: pointer;
}

.updates-table__focus-link {
  font-weight: 600;
  color: inherit;
  text-decoration: none;
}

.updates-table__focus-link:hover,
.updates-table__focus-link:focus-visible {
  text-decoration: underline;
}

.updates-grid--compact {
  gap: 0.85rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.updates-card {
  display: grid;
  gap: 0.9rem;
}

.updates-card--compact {
  gap: 0.7rem;
  padding: 1rem;
}

.updates-card--compact h3 {
  margin: 0;
  font-size: 1.5rem;
}

.updates-card__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.updates-card__date {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
}

.updates-card__status {
  align-self: flex-start;
}

.updates-card__road {
  width: fit-content;
  max-width: 100%;
  margin: 0;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(153, 17, 39, 0.22);
  background: rgba(200, 16, 46, 0.05);
  font-size: 0.85rem;
  color: var(--text);
}

.ward-finder-intro {
  margin-bottom: 1.5rem;
}

.ward-finder-intro .prose {
  width: 100%;
  max-width: none;
  margin: 0 auto;
  text-align: center;
}

.ward-finder-title {
  display: block;
  width: 100%;
  margin: 0 0 2.5rem;
  max-width: none;
  text-align: center;
}

.ward-finder-panel {
  position: relative;
  max-width: 980px;
  margin: 0 auto 1.75rem;
  padding: 2.2rem 2.35rem 2rem;
  border-radius: calc(var(--radius) + 2px);
  border-color: rgba(200, 16, 46, 0.16);
  background:
    radial-gradient(circle at top right, rgba(200, 16, 46, 0.11), transparent 12rem),
    linear-gradient(160deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 233, 237, 0.52) 100%);
  box-shadow: 0 20px 40px rgba(29, 33, 39, 0.08), 0 6px 18px rgba(200, 16, 46, 0.08);
}

.ward-finder-panel::before {
  height: 4px;
  background: linear-gradient(90deg, var(--primary-red) 0%, #ff6b8a 55%, var(--primary-red-dark) 100%);
}

.ward-finder-panel > .eyebrow {
  margin-bottom: 0.35rem;
}

.ward-finder-panel h2 {
  margin: 0 0 0.45rem;
  font-size: 1.9rem;
  color: var(--primary-red-dark);
  letter-spacing: -0.02em;
}

.ward-finder-panel > .field-hint {
  max-width: 56ch;
  margin: 0 0 1.45rem;
  color: var(--ink-soft);
  font-size: 0.98rem;
  line-height: 1.6;
}

.ward-finder-panel .report-form {
  gap: 1.1rem;
}

.ward-finder-panel .lookup-grid {
  gap: 0.95rem;
  grid-template-columns: minmax(0, 1fr) auto;
}

.ward-finder-panel .field {
  gap: 0.5rem;
}

.ward-finder-panel .field label {
  font-size: 0.92rem;
  color: var(--ink-soft);
}

.ward-finder-panel .field input,
.ward-finder-panel .field select {
  min-height: 3.35rem;
  border-color: rgba(188, 196, 205, 0.92);
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  font-weight: 500;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.ward-finder-panel .field input:focus,
.ward-finder-panel .field select:focus {
  background: #fff;
}

.ward-finder-panel .field select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%),
    linear-gradient(135deg, var(--ink-soft) 50%, transparent 50%);
  background-position:
    calc(100% - 1.15rem) calc(50% - 0.14rem),
    calc(100% - 0.8rem) calc(50% - 0.14rem);
  background-size: 0.4rem 0.4rem, 0.4rem 0.4rem;
  background-repeat: no-repeat;
  padding-right: 2.5rem;
}

.ward-finder-panel .field select option {
  color: #111111;
  background: #ffffff;
}

.ward-finder-panel #finderAddressResults {
  color: var(--ink);
}

.ward-finder-panel #finderAddressResults:disabled {
  color: var(--muted);
  background: var(--surface-strong);
}

.ward-finder-panel .field--button {
  min-width: 17.5rem;
}

.ward-finder-panel .finder-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 0.7rem;
  width: 100%;
}

.ward-finder-panel .finder-actions .button {
  min-height: 3.35rem;
  padding: 0.8rem 1.1rem;
  justify-content: center;
  box-shadow: 0 10px 22px rgba(29, 33, 39, 0.08);
}

.ward-finder-panel .finder-actions .button--primary {
  background: linear-gradient(180deg, var(--primary-red) 0%, var(--primary-red-dark) 100%);
  box-shadow: 0 12px 24px rgba(200, 16, 46, 0.18);
}

.ward-finder-panel .finder-actions .button--primary:hover,
.ward-finder-panel .finder-actions .button--primary:focus-visible {
  background: linear-gradient(180deg, var(--primary-red-dark) 0%, var(--primary-red-deep) 100%);
  box-shadow: 0 16px 28px rgba(200, 16, 46, 0.22);
}

.ward-finder-panel .finder-actions #refresh-finder-addresses {
  min-width: 3.35rem;
  padding-inline: 0.75rem;
  background: var(--primary-red-dark);
  border-color: var(--primary-red-dark);
  color: #fff;
}

.ward-finder-panel .finder-actions #refresh-finder-addresses:hover,
.ward-finder-panel .finder-actions #refresh-finder-addresses:focus-visible {
  background: var(--primary-red-deep);
  border-color: var(--primary-red-deep);
  color: #fff;
}

.ward-finder-panel #finder-status {
  margin-top: 0.15rem;
  font-size: 0.9rem;
}

.ward-finder-results[hidden] {
  display: none;
}

.ward-finder-grid {
  align-items: start;
}

.ward-finder-card {
  min-height: 100%;
  padding-bottom: 1.25rem;
}

.ward-finder-card h2 {
  margin-bottom: 0.6rem;
}

#finder-selected-address {
  margin: 0 0 0.85rem;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--ink);
}

.ward-finder-card > .eyebrow {
  margin-bottom: 0.35rem;
}

.ward-finder-attribution {
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(215, 219, 224, 0.92);
}

.ward-finder-summary {
  display: grid;
  gap: 0.85rem;
  margin: 0;
}

.ward-finder-summary div {
  display: grid;
  gap: 0.3rem;
  padding: 0.95rem 1rem;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.ward-finder-summary dt {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.ward-finder-summary dd {
  margin: 0;
  font-weight: 600;
  word-break: break-word;
}

.ward-finder-widget {
  margin-top: 1rem;
}

.ward-finder-widget-linkbox {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  background: var(--surface);
}

.ward-finder-widget-link {
  width: 100%;
}

.ward-finder-widget-linkhint {
  margin: 0.7rem 0 0;
}

.ward-finder-directions {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(215, 219, 224, 0.92);
}

.ward-finder-directions h3 {
  margin-bottom: 0.6rem;
}

.ward-finder-directions-map {
  min-height: 260px;
}

.ward-finder-source-note {
  margin: 0.42rem 0 0.15rem;
  font-size: 0.72rem;
  color: var(--muted);
}

.ward-finder-ward-value {
  font-size: 1.34rem;
  font-weight: 800;
  color: #1c2028;
}

.ward-finder-councillors {
  display: grid;
  gap: 0.95rem;
  padding-left: 0;
  margin: 0;
  list-style: none;
}

.ward-finder-councillors-subtitle {
  margin: 0 0 0.75rem;
  font-size: 1.15rem;
  font-weight: 800;
  color: #1c2028;
}

.ward-finder-councillor {
  display: grid;
  gap: 0.35rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.ward-finder-councillor__body {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}

.ward-finder-councillor__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.ward-finder-contact-row {
  display: flex;
  flex-wrap: wrap;
  min-width: 0;
}

.ward-finder-councillor__name {
  font-size: 1.05rem;
  font-weight: 800;
  color: #000000;
  letter-spacing: -0.01em;
}

.ward-finder-email-icon {
  width: 0.95em;
  height: 0.75em;
  flex-shrink: 0;
  margin-right: 0.45em;
  vertical-align: middle;
  position: relative;
  top: -0.05em;
}

.ward-finder-contact-link,
.ward-finder-profile-link {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
}

.ward-finder-contact-link__text {
  min-width: 0;
  flex: 1 1 auto;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.ward-finder-contact-link {
  background: transparent;
  color: #000000;
  border: 0;
  padding: 0;
  width: 100%;
  align-items: flex-start;
  font-size: 1rem;
  line-height: 1.4;
  min-height: auto;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  text-decoration-color: rgba(0, 0, 0, 0.45);
}

.ward-finder-contact-link:hover,
.ward-finder-contact-link:focus-visible {
  background: transparent;
  color: #000000;
  text-decoration-color: #000000;
}

.ward-finder-no-email {
  display: inline-flex;
  align-items: center;
  font-size: 0.88rem;
  color: var(--muted);
}

.ward-finder-profile-link {
  display: inline-flex;
  align-items: center;
  margin-top: 0.55rem;
  padding: 0.45rem 1rem;
  min-height: auto;
  background: #f1f3f5;
  color: #1c2028;
  border: 1px solid #bcc4cd;
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: 6px;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.ward-finder-profile-link:hover,
.ward-finder-profile-link:focus-visible {
  background: #e2e6ea;
  border-color: #9aa3ad;
  color: #1c2028;
}

/* Neutral overrides for ward finder results — no party colours */
.ward-finder-card::before {
  background: linear-gradient(90deg, var(--primary-red) 0%, #ff6b8a 55%, var(--primary-red-dark) 100%);
}

.ward-finder-card h2 {
  color: #1c2028;
  text-shadow: none;
}

.ward-finder-card > .eyebrow {
  color: #4b5463;
}

.ward-finder-sources {
  margin-top: 1rem;
  padding: 1rem 1.1rem 0;
  border-top: 1px solid rgba(215, 219, 224, 0.92);
}

.narrow-card,
.success-card {
  max-width: 42rem;
}

.success-shell {
  position: relative;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  overflow: visible;
}

.success-shell::before {
  display: none;
}

.success-card {
  position: relative;
  overflow: hidden;
  padding: 2rem 2rem 1.75rem;
  border: 1px solid rgba(200, 16, 46, 0.12);
  border-radius: 28px;
  background:
    radial-gradient(circle at top right, rgba(200, 16, 46, 0.12), transparent 13rem),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(249, 250, 251, 0.96) 100%);
  box-shadow: 0 26px 60px rgba(17, 24, 39, 0.12), 0 10px 24px rgba(17, 24, 39, 0.07);
}

.success-card__accent {
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, #991127 0%, #c8102e 55%, #f26b7a 100%);
}

.success-card__eyebrow {
  margin: 0 0 0.9rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--primary-red);
}

.success-card h1 {
  margin-bottom: 0.8rem;
  letter-spacing: -0.02em;
}

.success-card__lead {
  margin: 0 0 1.4rem;
  color: var(--ink-soft);
  font-size: 1.02rem;
  line-height: 1.65;
}

.success-reference {
  margin: 0 0 1.35rem;
  padding: 1.15rem 1.2rem;
  border: 1px solid rgba(200, 16, 46, 0.14);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(252, 246, 247, 0.98));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.success-reference__meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.success-reference__label {
  margin: 0 0 0.35rem;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.success-reference__hint {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.success-reference__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-top: 0.6rem;
}

.success-reference__value {
  font-size: clamp(1.5rem, 4vw, 1.95rem);
  color: var(--heading);
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
}

.success-reference__copy {
  min-height: 2.6rem;
  padding: 0.6rem 0.95rem;
  border: 1px solid rgba(153, 17, 39, 0.22);
  border-radius: 999px;
  background: rgba(255, 240, 243, 0.96);
  color: var(--primary-red-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
}

.success-reference__copy:hover,
.success-reference__copy:focus-visible {
  background: rgba(255, 229, 234, 0.98);
  color: var(--primary-red-deep);
  box-shadow: 0 10px 20px rgba(200, 16, 46, 0.12);
  transform: translateY(-1px);
}

.success-reference__copy-icon {
  width: 1.15rem;
  height: 1.15rem;
}

.success-reference__status {
  margin: 0.45rem 0 0;
  min-height: 1.2rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.success-next {
  margin-bottom: 1.5rem;
}

.success-next__panel {
  padding: 1.1rem 1.2rem;
  border-radius: 20px;
  background: rgba(246, 247, 249, 0.95);
  border: 1px solid rgba(215, 219, 224, 0.86);
}

.success-next__label {
  margin: 0 0 0.7rem;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--heading);
}

.success-next__list {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--ink-soft);
}

.success-next__list li + li {
  margin-top: 0.55rem;
}

.success-actions {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.success-actions .button {
  min-width: 12rem;
  justify-content: center;
}

.admin-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
}

.admin-card {
  width: min(100%, 28rem);
}

.admin-card--wide {
  width: min(100%, 38rem);
}

/* ── MFA login pages ─────────────────────────────────────────────────────── */

.mfa-step-indicator {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 1.25rem;
}

.mfa-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  font-size: 0.78rem;
  font-weight: 700;
  flex-shrink: 0;
  background: var(--surface-strong);
  color: var(--muted);
  border: 2px solid var(--border);
}

.mfa-step--done {
  background: var(--primary-red);
  border-color: var(--primary-red);
  color: #fff;
}

.mfa-step--active {
  background: var(--surface);
  border-color: var(--primary-red);
  color: var(--primary-red-dark);
}

.mfa-step-line {
  flex: 1;
  height: 2px;
  background: var(--border);
  min-width: 1.5rem;
  max-width: 2.5rem;
}

.mfa-step-label {
  font-size: 0.78rem;
  color: var(--muted);
  margin-left: 0.5rem;
  white-space: nowrap;
}

.mfa-instruction {
  margin: 0 0 1.25rem;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--ink-soft);
}

.mfa-code-input {
  font-size: 1.5rem;
  letter-spacing: 0.22em;
  text-align: center;
  font-variant-numeric: tabular-nums;
  padding: 0.6rem 1rem;
}

.mfa-back-link {
  margin-top: 1.25rem;
  font-size: 0.875rem;
  text-align: center;
}

.mfa-back-link a {
  color: var(--link);
}

.mfa-action-stack {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.mfa-action-form {
  margin: 0;
}

.mfa-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.2rem 0 0.4rem;
}

.mfa-subtle-link-wrap {
  margin: 0.8rem 0 0;
  text-align: center;
}

.mfa-subtle-link {
  font-size: 0.84rem;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.mfa-subtle-link:hover,
.mfa-subtle-link:focus-visible {
  color: var(--ink);
}

/* ── TOTP first-time setup ───────────────────────────────────────────────── */

.setup-steps {
  margin: 0 0 1.5rem;
  padding-left: 1.4rem;
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--ink-soft);
}

.setup-steps li + li {
  margin-top: 0.35rem;
}

.setup-qr-wrap {
  display: flex;
  justify-content: center;
  margin: 1.25rem 0;
}

.setup-qr-img {
  border: 6px solid var(--surface);
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 12px rgba(0,0,0,.10);
  image-rendering: pixelated;
}

.setup-manual {
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

.setup-manual summary {
  cursor: pointer;
  color: var(--link);
  font-weight: 600;
  padding: 0.4rem 0;
}

.setup-manual__body {
  margin-top: 0.75rem;
  padding: 0.85rem 1rem;
  background: var(--surface-strong);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  line-height: 1.6;
}

.setup-manual__body ul {
  padding-left: 1.25rem;
  margin: 0.5rem 0;
}

.setup-secret {
  font-size: 0.85rem;
  word-break: break-all;
  background: var(--bg-alt);
  padding: 0.1em 0.35em;
  border-radius: 4px;
  border: 1px solid var(--border);
  user-select: all;
}

.setup-manual__save-hint {
  margin-top: 0.75rem;
  padding: 0.65rem 0.85rem;
  background: rgba(200,16,46,.06);
  border: 1px solid rgba(200,16,46,.18);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: var(--primary-red-dark);
  line-height: 1.55;
}

.admin-login__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.admin-login__header h1 {
  max-width: none;
  margin-bottom: 0;
}

.admin-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.admin-toolbar__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Forms inside the toolbar act as transparent layout wrappers */
.admin-toolbar__actions form {
  display: contents;
}

.admin-toolbar__actions .theme-toggle,
.admin-login__header .theme-toggle {
  flex-shrink: 0;
}

.admin-session-warning {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 11000;
  max-width: min(92vw, 760px);
  padding: 0.8rem 1rem;
  border: 1px solid rgba(201, 76, 17, 0.28);
  border-radius: 12px;
  background: #fff4e8;
  color: #7c2d12;
  box-shadow: 0 12px 30px rgba(29, 33, 39, 0.16);
  font-size: 0.92rem;
  line-height: 1.45;
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 1rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

.admin-table th {
  color: var(--heading);
  background: var(--surface-tint);
}

.admin-action {
  white-space: nowrap;
}

.status-badge--public {
  background: var(--success-bg);
  color: var(--success);
}

.status-badge--private {
  background: #eef1f4;
  color: #4b5562;
}

.status-badge--draft {
  background: var(--info-bg);
  color: var(--info);
}

.status-badge--approved {
  background: var(--success-bg);
  color: var(--success);
}

.status-badge--rejected {
  background: var(--error-bg);
  color: var(--error);
}

.status-badge--posted {
  background: var(--red-muted);
  color: var(--primary-red-dark);
}

.admin-detail-layout {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.9fr);
}

.admin-sidebar-stack {
  display: grid;
  gap: 1.25rem;
}

.admin-detail-card {
  background: var(--surface);
  border: 1px solid rgba(215, 219, 224, 0.92);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

.admin-detail-list {
  display: grid;
  gap: 0.9rem;
  margin: 0;
}

.admin-detail-list div {
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--border);
}

.admin-detail-list dt {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 700;
}

.admin-detail-list dd {
  margin: 0.3rem 0 0;
  word-break: break-word;
}

.admin-message-block {
  margin-top: 1.25rem;
  padding: 1rem;
  background: var(--surface-strong);
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--primary-red);
}

.admin-message-block p {
  margin: 0;
  white-space: pre-wrap;
}

.admin-social-meta {
  display: grid;
  gap: 0.5rem;
  margin: 1rem 0;
  color: var(--muted);
}

.admin-social-preview {
  display: grid;
  gap: 0.75rem;
  margin: 1rem 0 1.25rem;
}

.admin-social-preview__frame {
  overflow: hidden;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
}

.admin-social-preview__image {
  display: block;
  width: 100%;
  height: auto;
}

.admin-form-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.admin-date-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-success {
  border: 1px solid rgba(31, 106, 49, 0.26);
  background: var(--success-bg);
  color: var(--success);
  border-radius: var(--radius-sm);
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
}

.empty-state {
  padding: 1.25rem;
  margin: 0;
}

.site-footer {
  padding: 2rem 0 3rem;
  color: rgba(255, 255, 255, 0.8);
  background: linear-gradient(180deg, #262b33 0%, #1d2127 100%);
  border-top: 4px solid var(--primary-red);
}

.site-footer .container {
  display: grid;
  gap: 1rem;
  justify-items: center;
  text-align: center;
}

.site-footer__contact {
  display: grid;
  gap: 0.35rem;
  justify-items: center;
  justify-self: center;
  width: auto;
  text-align: center;
}

.site-footer__contact p,
.site-footer__links {
  margin: 0;
}

.site-footer__contact-line {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.site-footer__icon {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
  color: #fff;
  opacity: 0.96;
}

.site-footer__contact strong {
  color: #fff;
}

.site-footer__links {
  padding-top: 0.1rem;
}

.site-footer__statement {
  margin: 0;
  max-width: 68ch;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.95rem;
  text-align: center;
  justify-self: center;
}

.site-footer__copyright {
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
  text-align: center;
  justify-self: center;
}

.site-footer__imprint {
  margin: 0.75rem 0 0;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.55);
  text-align: center;
}

.site-footer a {
  color: #fff;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: #ffd9df;
}

@media (max-width: 900px) {
  .hero__grid,
  .form-layout,
  .card-grid,
  .homepage-grid,
  .homepage-links,
  .homepage-summary-grid,
  .homepage-hero-grid,
  .admin-detail-layout,
  .about-container {
    grid-template-columns: 1fr;
  }

  .homepage-tracker__fields {
    grid-template-columns: 1fr 1fr auto;
  }

  .admin-toolbar,
  .site-header__inner,
  .map-section__intro {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-name {
    font-size: 26px;
  }

  .site-ward {
    font-size: 18px;
  }

  .site-header__left,
  .site-header__right,
  .site-contact,
  .site-nav,
  .site-header__menu {
    width: 100%;
    justify-content: flex-start;
  }

  .site-header__menu nav {
    width: 100%;
  }

  .about-image {
    position: static;
  }

  .about-image img {
    max-width: 350px;
  }
}

@media (max-width: 768px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  .container {
    width: min(calc(100% - 1.5rem), var(--container));
  }

  .site-header,
  .site-header__inner,
  .site-header__left,
  .site-header__right,
  .site-header__menu,
  main,
  .section {
    max-width: 100%;
  }

  .site-header__inner {
    gap: 0.85rem;
    padding: 0.95rem 0;
    align-items: stretch;
  }

  .site-header__left {
    width: 100%;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: flex-start;
  }

  .site-header__right {
    width: 100%;
    align-items: stretch;
    gap: 0.75rem;
  }

  .site-brand {
    flex: 1 1 auto;
    min-width: 0;
  }

  .site-title {
    max-width: 100%;
  }

  .site-name {
    font-size: clamp(1.3rem, 5vw, 1.65rem);
    line-height: 1.05;
    letter-spacing: 0.02em;
    overflow-wrap: anywhere;
  }

  .site-ward {
    font-size: 1rem;
    line-height: 1.2;
    overflow-wrap: anywhere;
  }

  .mobile-menu-btn {
    display: inline-flex;
    align-self: stretch;
    width: 100%;
    justify-content: center;
  }

  .site-header__menu {
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    width: 100%;
  }

  .site-header__right.is-open .site-header__menu {
    display: flex;
  }

  .site-header__menu nav {
    width: 100%;
    padding: 0.45rem;
    border-radius: 20px;
  }

  .site-nav {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }

  .site-nav a {
    width: 100%;
    text-align: left;
    padding: 0.85rem 1rem;
  }

  .site-contact {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .site-contact__link {
    width: 100%;
    align-items: flex-start;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.25rem 0;
  }

  .site-contact__label,
  .site-contact__value {
    line-height: 1.35;
  }

  .site-contact__value {
    font-size: 0.95rem;
  }

  .acc-dropdown__panel {
    left: 0;
    right: 0;
    min-width: 0;
    width: 100%;
    max-width: 100%;
  }

  .form-layout {
    grid-template-columns: 1fr;
  }

  .side-panel {
    display: none;
  }

  .hero__actions,
  .hero__actions--homepage,
  .image-upload-controls,
  .admin-toolbar__actions,
  .crm-close-form__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero__actions .button,
  .hero__actions--homepage .button,
  .image-upload-controls .button,
  .admin-toolbar__actions .button,
  .admin-toolbar__actions .crm-trash-btn,
  .admin-toolbar__actions form,
  .crm-close-form__actions .button,
  .crm-close-form__actions .crm-trash-btn {
    width: 100%;
  }

  .homepage-hero-visual__summary,
  .homepage-links {
    grid-template-columns: 1fr;
  }

  .acc-dropdown {
    position: static;
  }

  .homepage-hero-visual__stat,
  .homepage-link-card,
  .homepage-notice-card,
  .homepage-tracker__label,
  .homepage-tracker__result,
  .homepage-tracker #case-tracker-result {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .homepage-tracker,
  .case-tracker,
  .public-map-card,
  .faq-group,
  .form-panel,
  .side-card,
  .notice-card,
  .info-card,
  .crm-section {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .public-map-shell .public-map-panel {
    height: 360px;
    min-height: 360px;
  }

  .map-panel,
  .report-map-panel {
    height: 320px;
    min-height: 320px;
  }

  .ward-finder-directions-map {
    min-height: 220px;
  }

  .map-status-filters {
    grid-template-columns: 1fr 1fr;
  }

  .faq-page-title,
  .updates-page-title,
  .ward-finder-title,
  .report-page-title {
    max-width: none;
  }

  .crm-tabs__inner {
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .crm-tabs .crm-tab {
    white-space: nowrap;
    flex: 0 0 auto;
  }

  .admin-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 640px) {
  .homepage-hero-visual__summary {
    grid-template-columns: 1fr;
  }

  .homepage-tracker__fields {
    grid-template-columns: 1fr;
  }

  .homepage-tracker__btn {
    width: 100%;
  }

  .hero,
  .section {
    padding: 2rem 0;
  }

  .report-page-title-wrap {
    margin-bottom: 1.25rem;
  }

  .form-panel,
  .notice-card,
  .info-card,
  .side-card,
  .narrow-card,
  .admin-card {
    padding: 1.25rem;
  }

  .faq-group {
    padding: 1.15rem;
  }

  .lookup-grid {
    grid-template-columns: 1fr;
  }

  .lookup-input-row,
  .lookup-select-row {
    grid-template-columns: 1fr;
  }

  .lookup-input-row--issue {
    grid-template-columns: 1fr;
  }

  .lookup-input-row--issue .button,
  .lookup-input-row--issue .icon-button {
    width: 100%;
  }

  .finder-actions {
    width: 100%;
  }

  .map-panel {
    height: 320px;
    min-height: 320px;
  }

  .report-map-panel {
    height: 320px;
    min-height: 320px;
  }

  .public-map-shell .public-map-panel {
    height: 460px;
    min-height: 460px;
  }

  .form-row--two {
    grid-template-columns: 1fr;
  }

  .map-status-button--all {
    margin-left: 0;
  }

  .map-ward-filter {
    justify-self: stretch;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 0.45rem;
  }

  .map-filter-control {
    width: 100%;
  }

  .map-ward-filter__select {
    width: 100%;
    min-width: 0;
  }

  .map-status-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
  }

  .map-status-button {
    width: 100%;
  }

  .map-legend {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
  }

  .updates-table-shell {
    border: 0;
    background: transparent;
    overflow-x: visible;
  }

  .updates-table {
    min-width: 0;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.65rem;
  }

  .updates-table thead {
    display: none;
  }

  .updates-table tbody,
  .updates-table tr,
  .updates-table td {
    display: block;
    width: 100%;
  }

  .updates-table tbody tr {
    border: 1px solid rgba(215, 219, 224, 0.92);
    border-radius: 12px;
    background: #fff;
    padding: 0.6rem 0.75rem;
    box-shadow: 0 8px 18px rgba(29, 33, 39, 0.06);
  }

  .updates-table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.8rem;
    border-bottom: 0;
    padding: 0.28rem 0;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .updates-table tbody td::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--muted);
    flex: 0 0 4.6rem;
  }

  .admin-date-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 2.3rem;
  }

  .site-name {
    font-size: clamp(1.18rem, 5.5vw, 1.45rem);
  }

  .site-ward {
    font-size: 0.95rem;
  }

  .confirmation-list div {
    padding: 0.8rem;
  }

  .site-contact {
    gap: 0.65rem 1rem;
  }

  .site-contact__link {
    font-size: 0.95rem;
  }
}

@media (max-width: 480px) {
  .site-nav {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }

  .site-nav a {
    width: 100%;
    text-align: center;
    padding: 0.68rem 0.9rem;
  }

  .map-legend {
    grid-template-columns: 1fr;
  }

  #report-form .radio-group__options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }

  #report-form .radio-option {
    width: 100%;
    min-width: 0;
    justify-content: flex-start;
    padding: 0.7rem 0.75rem;
    gap: 0.28rem;
  }

  #report-form .radio-option input {
    width: 1rem;
    height: 1rem;
    min-width: 1rem;
  }

  #report-form .radio-option span {
    white-space: nowrap;
    flex: 0 0 auto;
  }
}

/* ============================================================
   Case tracker
   ============================================================ */

.section--tracker {
  padding-top: 0;
}

.case-tracker {
  position: relative;
  max-width: 980px;
  margin: 0 auto;
  background:
    radial-gradient(circle at top right, rgba(200, 16, 46, 0.12), transparent 12rem),
    linear-gradient(160deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 233, 237, 0.52) 100%);
  border: 1px solid rgba(200, 16, 46, 0.18);
  border-radius: calc(var(--radius) + 2px);
  box-shadow: 0 18px 38px rgba(29, 33, 39, 0.08), 0 6px 18px rgba(200, 16, 46, 0.08);
  padding: 2.1rem 2.35rem 2rem;
  overflow: hidden;
}

.case-tracker::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-red) 0%, #ff6b8a 52%, var(--primary-red-dark) 100%);
}

.case-tracker__heading {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 0.45rem;
  color: var(--primary-red-dark);
  max-width: 18ch;
}

.case-tracker__desc {
  color: var(--ink-soft);
  margin: 0 0 1.4rem;
  font-size: 0.98rem;
  max-width: 58ch;
  line-height: 1.6;
}

.case-tracker__contact {
  margin-top: 1.15rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.case-tracker__contact a {
  color: var(--link);
  font-weight: 600;
}

.case-tracker__form {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 0.9rem;
  align-items: flex-end;
}

.case-tracker__input-group {
  min-width: 0;
}

.case-tracker__label {
  display: block;
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.55rem;
  letter-spacing: 0.01em;
  color: var(--ink-soft);
}

.case-tracker__input {
  width: 100%;
  min-height: 3.25rem;
  padding: 0.85rem 1rem;
  border: 1.5px solid rgba(188, 196, 205, 0.92);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: var(--font-body);
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.case-tracker__input:focus {
  outline: 2px solid var(--primary-red);
  outline-offset: 2px;
  border-color: var(--primary-red);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(200, 16, 46, 0.08);
}

.case-tracker__btn {
  min-height: 3.25rem;
  padding: 0.8rem 1.65rem;
  background: linear-gradient(180deg, var(--primary-red) 0%, var(--primary-red-dark) 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--font-body);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 12px 24px rgba(200, 16, 46, 0.18);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.case-tracker__btn:hover,
.case-tracker__btn:focus-visible {
  background: linear-gradient(180deg, var(--primary-red-dark) 0%, var(--primary-red-deep) 100%);
  outline: 2px solid var(--primary-red-dark);
  outline-offset: 2px;
  transform: translateY(-1px);
  box-shadow: 0 16px 28px rgba(200, 16, 46, 0.22);
}

.case-tracker__result {
  margin-top: 1.75rem;
}

.case-tracker__meta {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.case-tracker__meta-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 0.3rem;
}

.case-tracker__meta-row:last-of-type {
  margin-bottom: 0;
}

.case-tracker__meta-label {
  font-weight: 600;
  color: var(--ink-soft);
  min-width: 7rem;
}

.case-tracker__deadline {
  margin-top: 0.85rem;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
}

.case-tracker__deadline--ok {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid #b3d9bc;
}

.case-tracker__deadline--overdue {
  background: var(--error-bg);
  color: var(--error);
  border: 1px solid var(--warning-border);
}

.case-tracker__deadline--done {
  background: var(--red-muted);
  color: var(--heading);
  border: 1px solid var(--red-muted-strong);
}

.case-tracker__deadline--completed {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid #b3d9bc;
}

.case-tracker__closed-note {
  margin: 0.5rem 0 0;
  font-size: 0.88rem;
  color: var(--ink-soft);
  line-height: 1.5;
}

.case-tracker__warning {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  line-height: 1.5;
}

.case-tracker__warning--amber {
  background: #fff7ed;
  color: #92400e;
  border: 1px solid #fed7aa;
}

.tracker-step--amber .tracker-step__dot {
  background: #fff7ed;
  border-color: #d97706;
  border-width: 2.5px;
}

.tracker-step--amber .tracker-step__dot::after {
  content: "";
  display: block;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: #d97706;
}

.tracker-step--amber .tracker-step__title {
  color: #92400e;
}

.case-tracker__error {
  margin-top: 1.25rem;
  padding: 0.9rem 1.1rem;
  background: var(--error-bg);
  border: 1px solid var(--warning-border);
  border-radius: var(--radius-sm);
  color: var(--error);
  font-weight: 600;
  font-size: 0.95rem;
}

.case-tracker__loading {
  margin-top: 1.25rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.case-tracker #case-tracker-result:not(:empty) {
  margin-top: 1.2rem;
  padding: 1.15rem 1.25rem 1.25rem;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(188, 196, 205, 0.82);
  box-shadow: 0 12px 28px rgba(29, 33, 39, 0.08);
}

/* Tracker result close button */
#case-tracker-result:not(:empty) {
  position: relative;
}

/* Sticky close button wrapper — sits at the top of the results box and sticks as user scrolls */
.tracker-close-wrap {
  display: flex;
  justify-content: flex-end;
  position: sticky;
  top: 0.25rem;
  z-index: 10;
  /* Negative bottom margin so the wrapper doesn't add extra space above the results content */
  margin-bottom: -2rem;
  pointer-events: none;
}

.tracker-close-btn {
  pointer-events: auto;
  background: transparent;
  border: none;
  color: var(--primary-red);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.2rem 0.35rem;
  min-width: 2.5rem;
  min-height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.15s ease;
}

.tracker-close-btn:hover,
.tracker-close-btn:focus-visible {
  opacity: 0.7;
  outline: none;
}

[data-theme="dark"] .tracker-close-btn {
  color: #ff6b81;
}

/* Timeline */

.tracker-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
  padding-left: 2.5rem;
  overflow: visible;
}

.tracker-step {
  position: relative;
  padding-bottom: 1.75rem;
}

.tracker-step:last-child {
  padding-bottom: 0;
}

.tracker-step__line,
.tracker-line {
  position: absolute;
  left: -1.8125rem;
  top: 1.625rem;
  bottom: -0.125rem;
  width: 2px;
  border-radius: 999px;
  background: rgba(188, 196, 205, 0.8);
}

.tracker-step__line--pending {
  background: rgba(188, 196, 205, 0.8);
}

.tracker-line--completed {
  background: linear-gradient(180deg, var(--primary-red) 0%, #ff6b8a 50%, var(--primary-red) 100%);
  background-size: 100% 200%;
  animation: line-shimmer 2.4s ease-in-out infinite alternate;
}

.tracker-step__dot,
.tracker-dot {
  position: absolute;
  left: -2.5rem;
  top: 0.15rem;
  width: 1.375rem;
  height: 1.375rem;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
}

.tracker-step--done .tracker-step__dot {
  background: var(--primary-red);
  border-color: var(--primary-red);
}

.tracker-step--done .tracker-step__dot::after {
  content: "";
  display: block;
  width: 0.35rem;
  height: 0.6rem;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translateY(-1px);
}

.tracker-step--completed .tracker-step__dot,
.tracker-step--completed .tracker-dot {
  background: var(--success);
  border-color: var(--success);
}

.tracker-step--completed .tracker-step__dot::after,
.tracker-step--completed .tracker-dot::after {
  content: "";
  display: block;
  width: 0.35rem;
  height: 0.6rem;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translateY(-1px);
}

.tracker-step--active .tracker-step__dot {
  background: var(--surface);
  border-color: var(--primary-red);
  border-width: 2.5px;
}

.tracker-step--active .tracker-step__dot::after {
  content: "";
  display: block;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--primary-red);
}

.tracker-step__title {
  font-weight: 700;
  font-size: 0.975rem;
  color: var(--ink);
  margin: 0 0 0.15rem;
  line-height: 1.4;
}

.tracker-step__subtitle {
  font-size: 0.875rem;
  color: var(--ink-soft);
  margin: 0 0 0.25rem;
}

.tracker-step--pending .tracker-step__title {
  color: var(--muted);
  font-weight: 600;
}

.tracker-step--pending .tracker-step__subtitle,
.tracker-step--pending .tracker-step__date {
  color: var(--muted);
}

.tracker-step__date {
  font-size: 0.875rem;
  color: var(--muted);
  margin: 0;
}

.tracker-step--done .tracker-step__date {
  color: var(--primary-red-dark);
}

.tracker-step--active .tracker-step__date {
  color: var(--ink-soft);
}

/* Pulsing dot for the current active stage — box-shadow only avoids stacking-context clipping */
@keyframes pulse-current {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(200, 16, 46, 0.4);
    opacity: 0.95;
  }
  50% {
    transform: scale(1.2);
    box-shadow: 0 0 0 8px rgba(200, 16, 46, 0);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(200, 16, 46, 0);
    opacity: 0.95;
  }
}

.tracker-step--current .tracker-step__dot,
.tracker-step--current .tracker-dot {
  animation: pulse-current 1.5s ease-in-out infinite;
  background: var(--primary-red);
  border-color: var(--primary-red);
}

.tracker-step--current .tracker-step__dot::after,
.tracker-step--current .tracker-dot::after {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: #fff;
}

/* "In progress" badge beneath the current step title */
.tracker-step__in-progress {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary-red);
  background: rgba(200, 16, 46, 0.08);
  border: 1px solid rgba(200, 16, 46, 0.2);
  border-radius: 20px;
  padding: 0.15rem 0.6rem;
  margin-bottom: 0.25rem;
}

/* Animated shimmer on the vertical connecting line */
@keyframes line-shimmer {
  0% { background-position: center -200%; }
  100% { background-position: center 200%; }
}

@media (max-width: 640px) {
  .case-tracker {
    padding: 1.25rem;
  }

  .case-tracker__form {
    grid-template-columns: 1fr;
  }

  .case-tracker__btn {
    width: 100%;
  }

  .ward-finder-panel {
    padding: 1.4rem 1.25rem;
  }

  .ward-finder-panel .lookup-grid,
  .ward-finder-panel .finder-actions {
    grid-template-columns: 1fr;
  }

  .ward-finder-panel .field--button {
    min-width: 0;
  }

  .ward-finder-contact-link {
    width: 100%;
    align-items: flex-start;
  }
}

/* ─── CRM Admin styles ─────────────────────────────────────────────────────── */

/* Badges */
.crm-badge {
  display: inline-block;
  padding: 0.15em 0.6em;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.crm-badge--web       { background: #e8f0fe; color: #1a56b0; }
.crm-badge--manual    { background: #fff3e0; color: #b45309; }
.crm-badge--outbound  { background: #e8f0fe; color: #1a56b0; }
.crm-badge--inbound   { background: #f0fdf4; color: #166534; }
.crm-badge--new       { background: var(--bg-alt); color: var(--ink-soft); }
.crm-badge--sent      { background: #eff6ff; color: #1d4ed8; }
.crm-badge--response  { background: #fefce8; color: #854d0e; }
.crm-badge--resolved  { background: #f0fdf4; color: #166534; }
.crm-badge--overdue   { background: #fef2f2; color: #991b1b; }
.crm-badge--closed    { background: #f0f0f0; color: #6b7280; }

/* Alerts */
.crm-alert {
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.crm-alert--success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.crm-alert--error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.crm-alert--warning {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
}

.crm-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  background: #eef1f4;
  color: #4b5562;
}

.crm-status-badge--pending {
  background: #eef1f4;
  color: #4b5562;
}

.crm-status-badge--in_progress {
  background: #fff7ed;
  color: #b45309;
}

.crm-status-badge--completed {
  background: #dcfce7;
  color: #166534;
}

/* Dashboard search */
.crm-search-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.crm-search-input {
  flex: 1;
  max-width: 480px;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  background: var(--surface);
  color: var(--ink);
}

.crm-search-count {
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.session-page__hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.session-page__hint {
  margin: 0.25rem 0 0;
}

.session-page__bulk-form {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.session-page__count {
  font-weight: 700;
  color: var(--heading);
}

.session-page__empty-note {
  margin-top: 0;
}

.session-table {
  min-width: 1080px;
}

.session-table__row--current td:first-child {
  border-left: 4px solid #16a34a;
}

.session-table__device {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.session-table__icon {
  font-size: 1.3rem;
  line-height: 1;
}

.session-table__meta {
  margin-top: 0.25rem;
  max-width: 18rem;
  word-break: break-word;
  font-size: 0.82rem;
}

.crm-overdue-banner {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

/* Closed case banner */
.crm-closed-banner {
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  color: #374151;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.crm-closed-banner p { margin: 0 0 0.2rem; }
.crm-closed-banner p:last-child { margin: 0; }

/* Dashboard case filter tabs */
.crm-filter-tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.crm-filter-tab {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.crm-filter-tab:hover {
  background: var(--surface-strong);
  color: var(--ink);
  border-color: var(--border-strong);
}

.crm-filter-tab--active {
  background: var(--ink);
  color: var(--surface);
  border-color: var(--ink);
}

/* Inline close form */
.crm-close-form {
  margin-top: 0.75rem;
  padding: 1rem;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.crm-close-form textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-size: 0.9rem;
  font-family: inherit;
  resize: vertical;
  min-height: 72px;
}

.crm-close-form__actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.crm-dashboard-table td { vertical-align: middle; }

.crm-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.crm-table-controls {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.crm-bulk-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.6rem 0.9rem;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.crm-bulk-actions--dashboard {
  padding: 0.8rem 0.95rem;
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(29, 33, 39, 0.06);
}

.crm-bulk-actions form {
  display: contents;
}

.crm-bulk-actions__label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted);
  margin-right: 0.25rem;
}

.crm-bulk-form {
  display: inline-flex;
}

.crm-select-column {
  width: 4.5rem;
  text-align: center;
}

.crm-select-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  user-select: none;
}

.crm-select-toggle input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--primary-red);
}

.crm-select-toggle--toolbar {
  padding: 0.65rem 0.95rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--ink);
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.crm-select-toggle--toolbar:hover,
.crm-select-toggle--toolbar:focus-within {
  border-color: var(--primary-red);
  background: var(--surface);
}

.crm-case-select {
  width: 1rem;
  height: 1rem;
  accent-color: var(--primary-red);
}

.crm-inline-form {
  display: inline;
  margin: 0;
}

.crm-row--overdue {
  background: #fffbfb;
}

.crm-row--overdue .crm-ref {
  color: #991b1b;
}

/* CRM case detail layout */
.crm-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 900px) {
  .crm-layout {
    grid-template-columns: 1fr;
  }
}

.crm-case-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  font-size: 1.4rem;
}

/* CRM section cards */
.crm-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}

.crm-section__heading {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
}

/* Meta grid */
.crm-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1.25rem;
  margin-bottom: 1rem;
}

@media (max-width: 600px) {
  .crm-meta-grid { grid-template-columns: 1fr; }
}

.crm-meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.crm-meta-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--ink-soft);
}

.crm-message-block {
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: var(--bg-alt);
  border-radius: var(--radius);
}

.crm-summary-card {
  border: 1px solid var(--border);
}

.crm-summary-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.crm-summary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.crm-message-text {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.9rem;
  margin: 0.25rem 0 0;
}

.crm-message-text--muted {
  color: var(--ink-soft);
}

/* Email thread */
.crm-thread-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.crm-thread-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.crm-thread-item--outbound { border-left: 3px solid #3b82f6; }
.crm-thread-item--inbound  { border-left: 3px solid #22c55e; }

.crm-thread-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.75rem;
  background: var(--bg-alt);
  flex-wrap: wrap;
}

.crm-thread-subject {
  flex: 1;
  font-size: 0.9rem;
}

.crm-thread-meta {
  font-size: 0.8rem;
  color: var(--ink-soft);
  white-space: nowrap;
}

.crm-thread-addresses {
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  color: var(--ink-soft);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.crm-thread-body {
  padding: 0.75rem;
  font-family: inherit;
  font-size: 0.875rem;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
  background: var(--surface);
}

.crm-thread-delete-form {
  display: inline;
  margin-left: auto;
}

.crm-delete-btn {
  background: none;
  border: none;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 1rem;
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  line-height: 1;
}

.crm-delete-btn:hover {
  background: #fef2f2;
  color: #991b1b;
}

.crm-trash-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.55rem;
  padding: 0.7rem 1rem;
  border: 1px solid #f3b8c2;
  border-radius: 999px;
  background: #fff1f2;
  color: #991127;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}

.crm-trash-btn:hover,
.crm-trash-btn:focus-visible {
  background: #ffe4e9;
  border-color: #e08b9d;
  color: #74111f;
}

.crm-trash-btn--toolbar {
  min-width: 8rem;
}

.crm-trash-btn--danger {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.crm-trash-btn--danger:hover,
.crm-trash-btn--danger:focus-visible {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #7f1d1d;
}

/* Notes */
.crm-notes-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.crm-note-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 0.75rem;
  background: var(--bg-alt);
}

.crm-note-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}

.crm-note-text {
  font-size: 0.9rem;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}

/* Documents */
.crm-docs-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.crm-doc-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-alt);
}

.crm-doc-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  min-width: 0;
}

.crm-doc-link {
  font-weight: 600;
  word-break: break-all;
}

.crm-doc-size {
  font-size: 0.8rem;
}

/* Add form collapsible */
.crm-add-form-details {
  margin-top: 0.75rem;
}

.crm-add-form-summary {
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary-red);
  user-select: none;
  list-style: none;
  padding: 0.4rem 0;
}

.crm-add-form-summary::-webkit-details-marker { display: none; }

.crm-add-form {
  margin-top: 0.75rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-alt);
}

.crm-form-row {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 0;
}

.crm-form-row--two   { grid-template-columns: 1fr 1fr; }
.crm-form-row--three { grid-template-columns: 1fr 1fr 1fr; }

.crm-resident-template-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.crm-resident-template-btn {
  min-width: 10rem;
}

@media (max-width: 600px) {
  .crm-form-row--two,
  .crm-form-row--three { grid-template-columns: 1fr; }

  .crm-resident-template-btn {
    width: 100%;
  }
}

/* Timeline / timestamps */
.crm-timeline-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 1rem;
  padding-left: 0.5rem;
}

.crm-timeline-step {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 0 0.75rem;
  padding-bottom: 1.25rem;
  position: relative;
}

.crm-timeline-step:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 20px;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.crm-timeline-step.is-done:not(:last-child)::before {
  background: var(--primary-red);
}

.crm-timeline-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface);
  margin-top: 2px;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

.crm-timeline-step.is-done .crm-timeline-dot {
  border-color: var(--primary-red);
  background: var(--primary-red);
}

.crm-timeline-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.25rem;
  display: block;
}

.crm-timeline-date {
  font-size: 0.8rem;
  margin: 0;
}

.crm-timeline-step.is-next .crm-timeline-dot {
  border-color: var(--primary-red);
}

.crm-timeline-action-btn {
  margin-top: 0.4rem;
}

.crm-timeline-action-form {
  display: grid;
  gap: 0.45rem;
  align-content: start;
}

.crm-timeline-action-form--stacked {
  margin-top: 0.5rem;
}

.crm-timeline-action-field {
  display: grid;
  gap: 0.2rem;
}

.crm-timeline-action-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
}

.crm-timeline-action-input {
  min-width: 0;
  padding: 0.4rem 0.55rem;
  font-size: 0.84rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--input-bg, var(--card-bg));
  color: var(--text);
  line-height: 1.3;
}

.crm-timeline-action-input:focus {
  outline: 2px solid var(--primary-red);
  outline-offset: 1px;
  border-color: var(--primary-red);
}

.crm-timeline-undo {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.78rem;
  color: var(--muted);
  cursor: pointer;
  text-decoration: underline;
  margin-top: 0.2rem;
}

.crm-timeline-undo:hover {
  color: var(--ink);
}

.crm-status-undo-form {
  display: block;
}

/* Amber timeline step (Follow Up with Resident) */
.crm-timeline-step--amber.is-done:not(:last-child)::before,
.crm-timeline-step--amber.is-next:not(:last-child)::before {
  background: #d97706;
}

.crm-timeline-dot--amber {
  border-color: #d97706 !important;
}

.crm-timeline-step--amber.is-done .crm-timeline-dot--amber {
  background: #d97706;
}

.crm-timeline-step--amber.is-next .crm-timeline-dot--amber {
  background: #fff7ed;
}

/* Follow Up with Resident sidebar section */
.crm-followup-section {
  border-left: 3px solid #d97706;
  padding-left: 1rem;
  margin-bottom: 1.5rem;
}

.crm-followup-sent-card {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
}

/* ── Public map section ───────────────────────────────────────────── */

.crm-public-map-section {
  border-left: 3px solid #9ca3af;
  transition: border-color 0.2s;
}

.crm-public-map-section--live {
  border-left-color: #16a34a;
}

.crm-public-map-section--hidden {
  border-left-color: #dc2626;
}

.crm-public-map-status-badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: #f3f4f6;
  color: #6b7280;
  margin-bottom: 0.75rem;
}

.crm-public-map-status-badge--live {
  background: #dcfce7;
  color: #15803d;
}

.crm-public-map-status-badge--hidden {
  background: #fee2e2;
  color: #b91c1c;
}

.crm-public-map-toggle {
  width: 100%;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.crm-public-map-toggle--on {
  background: #16a34a;
  color: #fff;
  border-color: #15803d;
}

.crm-public-map-toggle--on:hover {
  background: #15803d;
}

.crm-public-map-toggle--off {
  background: #e5e7eb;
  color: #374151;
  border-color: #d1d5db;
}

.crm-public-map-toggle--off:hover {
  background: #d1d5db;
}

.crm-public-map-msg {
  font-size: 0.8125rem;
  margin-top: 0.5rem;
}

.crm-public-map-msg--ok   { color: #15803d; }
.crm-public-map-msg--error { color: #dc2626; }

.crm-public-map-nocoords {
  color: #b45309;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
}

.crm-public-map-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.25rem;
}

.crm-public-map-toggle-copy {
  min-width: 0;
}

.crm-public-map-toggle-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
}

.crm-public-map-toggle-help {
  margin: 0.2rem 0 0;
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

.crm-public-map-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--ink);
  padding: 0.45rem 0.7rem;
  font-weight: 700;
  min-width: 7rem;
  justify-content: center;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.crm-public-map-switch:hover,
.crm-public-map-switch:focus-visible {
  border-color: var(--border-strong);
  box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.08);
}

.crm-public-map-switch:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

.crm-public-map-switch__track {
  position: relative;
  width: 2.8rem;
  height: 1.55rem;
  border-radius: 999px;
  background: #cbd5e1;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.16);
  flex: 0 0 auto;
  transition: background 0.18s ease;
}

.crm-public-map-switch__thumb {
  position: absolute;
  top: 0.16rem;
  left: 0.16rem;
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 5px rgba(15, 23, 42, 0.2);
  transition: transform 0.18s ease;
}

.crm-public-map-switch--on {
  background: #ecfdf5;
  border-color: #86efac;
  color: #166534;
}

.crm-public-map-switch--on .crm-public-map-switch__track {
  background: #22c55e;
}

.crm-public-map-switch--on .crm-public-map-switch__thumb {
  transform: translateX(1.25rem);
}

.crm-public-map-switch--off {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #b91c1c;
}

.crm-public-map-switch--off .crm-public-map-switch__track {
  background: #fca5a5;
}

.crm-public-map-switch--off .crm-public-map-switch__thumb {
  transform: translateX(0);
}

.crm-public-map-switch__text {
  min-width: 1.8rem;
  text-align: center;
}

@media (max-width: 720px) {
  .crm-public-map-toggle-row {
    flex-direction: column;
    align-items: stretch;
  }

  .crm-public-map-switch {
    width: 100%;
  }
}

/* AI email panel */
.crm-ai-panel { }

.crm-ai-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.crm-ai-btn {
  text-align: left;
}

.crm-ai-result { margin-top: 0.75rem; }

.crm-ai-subject,
.crm-ai-body {
  width: 100%;
  font-family: inherit;
  font-size: 0.875rem;
}

.crm-ai-loading {
  font-size: 0.9rem;
  color: var(--ink-soft);
  padding: 0.5rem 0;
}

.crm-ai-error {
  font-size: 0.875rem;
  color: #991b1b;
  padding: 0.5rem 0;
}

/* New case form */
.crm-new-case-wrap {
  max-width: 760px;
}

.crm-subsection-heading {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
  margin: 1.25rem 0 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

.crm-new-case-form .field {
  margin-bottom: 0.75rem;
}

.crm-form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

/* empty state helper */
.empty-state {
  color: var(--ink-soft);
  font-size: 0.9rem;
  margin: 0.5rem 0 1rem;
}

/* ── AI summary edit mode ────────────────────────────────────────────── */

.crm-summary-textarea {
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.55;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink);
  resize: vertical;
  margin-top: 0.25rem;
}

.crm-summary-edit-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.6rem;
}

.crm-summary-cancel {
  background: none;
  border: none;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0.25rem 0.4rem;
  text-decoration: underline;
}

.crm-summary-cancel:hover { color: var(--ink); }

/* ── Council correspondence entries ─────────────────────────────────── */

.crm-council-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.crm-council-entry {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
}

.crm-council-entry--sent     { border-left: 3px solid #3b82f6; }
.crm-council-entry--received { border-left: 3px solid #22c55e; }

.crm-council-entry-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.crm-council-entry-meta {
  font-size: 0.85rem;
  color: var(--ink-soft);
  flex: 1;
  min-width: 0;
}

.crm-council-entry-subject {
  font-weight: 600;
  margin: 0 0 0.4rem;
  font-size: 0.9rem;
}

.crm-council-files {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.crm-council-file-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.crm-council-file-item a {
  color: var(--link);
  text-decoration: underline;
}

/* ── GDPR panel ──────────────────────────────────────────────────────── */

.crm-gdpr-result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

/* ==========================================
   DARK MODE
   ========================================== */

[data-theme="dark"] {
  --bg: #121417;
  --bg-alt: #181b20;
  --surface: #1f242b;
  --surface-strong: #2a313a;
  --surface-tint: #311b22;
  --surface-tint-strong: #44212b;
  --ink: #f5f7fa;
  --ink-soft: #dde3ea;
  --muted: #b4bcc7;
  --heading: #c8102e;
  --link: #c8102e;
  --link-hover: #e14a63;
  --accent: #991127;
  --border: #4d5866;
  --border-strong: #6b7787;
  --red-muted: #442028;
  --red-muted-strong: #5a2933;
  --success-bg: #14301d;
  --success: #7fd69c;
  --info-bg: #13293c;
  --info: #8ec9f5;
  --warning-bg: #392028;
  --warning-border: #87606b;
  --error-bg: #3b171e;
  --error: #e14a63;
  --shadow: 0 18px 38px rgba(0, 0, 0, 0.45);
}

/* Smooth transitions on key elements */
body,
.site-header,
.site-footer,
input,
select,
textarea {
  transition: background-color 0.25s, color 0.25s, border-color 0.25s;
}

[data-theme="dark"] body {
  background:
    radial-gradient(circle at top left, rgba(255, 108, 137, 0.08), transparent 24rem),
    #121417;
}

[data-theme="dark"] .site-header {
  background:
    linear-gradient(90deg, rgba(255, 108, 137, 0.08) 0%, rgba(255, 108, 137, 0.02) 28%, transparent 58%),
    linear-gradient(180deg, rgba(24, 27, 32, 0.97) 0%, rgba(18, 20, 23, 0.97) 100%);
  border-bottom-color: rgba(77, 88, 102, 0.78);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    inset 0 -1px 0 rgba(0, 0, 0, 0.28),
    0 10px 24px rgba(0, 0, 0, 0.24);
}

[data-theme="dark"] .site-header::before {
  background: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .site-header__menu nav {
  background: rgba(31, 36, 43, 0.92);
  border-color: rgba(107, 119, 135, 0.55);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 8px 18px rgba(0, 0, 0, 0.16);
}

[data-theme="dark"] .mobile-menu-btn {
  background: rgba(31, 36, 43, 0.92);
  border-color: rgba(107, 119, 135, 0.55);
  color: var(--ink);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

[data-theme="dark"] .site-name {
  color: var(--primary-red);
  text-shadow:
    0 1px 0 rgba(0, 0, 0, 0.55),
    0 4px 16px rgba(0, 0, 0, 0.18);
}

[data-theme="dark"] .site-ward {
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.42);
}

[data-theme="dark"] .hero {
  background: linear-gradient(180deg, rgba(31, 36, 43, 0.96) 0%, rgba(24, 27, 32, 0.98) 100%);
  border-bottom-color: rgba(77, 88, 102, 0.78);
}

[data-theme="dark"] .homepage-hero {
  background:
    radial-gradient(circle at top right, rgba(200, 16, 46, 0.12), transparent 20rem),
    radial-gradient(circle at left center, rgba(35, 79, 125, 0.07), transparent 22rem),
    linear-gradient(180deg, rgba(26, 30, 36, 0.98) 0%, rgba(20, 23, 28, 0.98) 100%);
}

[data-theme="dark"] .homepage-hero-visual__panel {
  background:
    radial-gradient(circle at 20% 20%, rgba(200, 16, 46, 0.12), transparent 9rem),
    radial-gradient(circle at 80% 30%, rgba(35, 79, 125, 0.10), transparent 10rem),
    linear-gradient(160deg, rgba(31, 36, 43, 0.98) 0%, rgba(24, 29, 36, 0.98) 100%);
  border-color: rgba(77, 88, 102, 0.5);
}

[data-theme="dark"] .homepage-hero-visual__stat {
  background: rgba(38, 44, 52, 0.9);
  border-color: rgba(77, 88, 102, 0.48);
}

[data-theme="dark"] .homepage-tracker {
  background:
    radial-gradient(circle at 90% 50%, rgba(200, 16, 46, 0.08), transparent 10rem),
    linear-gradient(160deg, rgba(31, 36, 43, 0.99) 0%, rgba(38, 26, 29, 0.6) 100%);
  border-color: rgba(200, 16, 46, 0.3);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.3), 0 1px 4px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] .homepage-tracker #case-tracker-result:not(:empty) {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .case-tracker {
  background:
    radial-gradient(circle at top right, rgba(200, 16, 46, 0.14), transparent 12rem),
    linear-gradient(160deg, rgba(31, 36, 43, 0.98) 0%, rgba(52, 34, 39, 0.82) 100%);
  border-color: rgba(200, 16, 46, 0.3);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.28), 0 6px 18px rgba(200, 16, 46, 0.14);
}

[data-theme="dark"] .case-tracker__desc,
[data-theme="dark"] .case-tracker__contact,
[data-theme="dark"] .case-tracker__label {
  color: var(--ink-soft);
}

[data-theme="dark"] .case-tracker__input {
  background: rgba(38, 44, 52, 0.92);
  border-color: rgba(77, 88, 102, 0.72);
}

[data-theme="dark"] .case-tracker #case-tracker-result:not(:empty) {
  background: rgba(24, 29, 36, 0.94);
  border-color: rgba(77, 88, 102, 0.64);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);
}

[data-theme="dark"] .ward-finder-panel {
  background:
    radial-gradient(circle at top right, rgba(200, 16, 46, 0.14), transparent 12rem),
    linear-gradient(160deg, rgba(31, 36, 43, 0.98) 0%, rgba(52, 34, 39, 0.82) 100%);
  border-color: rgba(200, 16, 46, 0.28);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.28), 0 6px 18px rgba(200, 16, 46, 0.14);
}

[data-theme="dark"] .ward-finder-panel > .field-hint,
[data-theme="dark"] .ward-finder-panel .field label,
[data-theme="dark"] .ward-finder-panel #finder-status {
  color: var(--ink-soft);
}

[data-theme="dark"] .ward-finder-panel .field input,
[data-theme="dark"] .ward-finder-panel .field select {
  background: rgba(38, 44, 52, 0.92);
  border-color: rgba(77, 88, 102, 0.72);
  color: var(--ink);
}

[data-theme="dark"] .ward-finder-card {
  background: linear-gradient(180deg, rgba(31, 36, 43, 0.98), rgba(24, 29, 36, 0.98));
  border-color: rgba(77, 88, 102, 0.52);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.18);
}

[data-theme="dark"] #finder-selected-address,
[data-theme="dark"] .ward-finder-source-note,
[data-theme="dark"] .ward-finder-widget-linkhint {
  color: var(--ink-soft);
}

[data-theme="dark"] .ward-finder-summary div,
[data-theme="dark"] .ward-finder-councillor,
[data-theme="dark"] .ward-finder-widget-linkbox {
  background: rgba(31, 36, 43, 0.98);
  border-color: rgba(77, 88, 102, 0.46);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .ward-finder-panel #finderAddressResults,
[data-theme="dark"] .ward-finder-panel #finderAddressResults:disabled,
[data-theme="dark"] .ward-finder-panel .field select option {
  color: var(--ink);
  background: rgba(31, 36, 43, 0.98);
}

[data-theme="dark"] .ward-finder-summary dt,
[data-theme="dark"] .ward-finder-summary dd,
[data-theme="dark"] .ward-finder-ward-value,
[data-theme="dark"] .ward-finder-councillors-subtitle,
[data-theme="dark"] .ward-finder-councillor__header,
[data-theme="dark"] .ward-finder-profile-link,
[data-theme="dark"] .ward-finder-directions h3 {
  color: var(--ink);
}

[data-theme="dark"] .ward-finder-contact-link {
  color: #000000;
}

[data-theme="dark"] .ward-finder-directions {
  border-top-color: rgba(77, 88, 102, 0.42);
}

[data-theme="dark"] .ward-finder-contact-link:hover,
[data-theme="dark"] .ward-finder-contact-link:focus-visible,
[data-theme="dark"] .ward-finder-profile-link:hover,
[data-theme="dark"] .ward-finder-profile-link:focus-visible {
  color: #ffffff;
}

[data-theme="dark"] .ward-finder-contact-link:hover,
[data-theme="dark"] .ward-finder-contact-link:focus-visible {
  color: #000000;
}

[data-theme="dark"] .site-footer {
  background: var(--surface);
  border-top-color: var(--border);
}

[data-theme="dark"] .admin-session-warning {
  background: #3b2410;
  color: #fed7aa;
  border-color: rgba(251, 146, 60, 0.35);
}

[data-theme="dark"] input:not([type="submit"]):not([type="button"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not(.honeypot),
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background-color: var(--surface-strong);
  color: var(--ink);
  border-color: var(--border-strong);
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
  color: var(--muted);
}

[data-theme="dark"] .site-brand,
[data-theme="dark"] .site-ward,
[data-theme="dark"] .lead,
[data-theme="dark"] .section-heading p,
[data-theme="dark"] .faq-intro,
[data-theme="dark"] .map-legend__item,
[data-theme="dark"] .updates-intro,
[data-theme="dark"] .public-map-note,
[data-theme="dark"] .public-map-status,
[data-theme="dark"] .field-hint,
[data-theme="dark"] .char-count,
[data-theme="dark"] .site-contact__label,
[data-theme="dark"] .site-contact__link,
[data-theme="dark"] .site-nav a {
  color: var(--ink-soft);
}

@media (prefers-reduced-motion: reduce) {
  .site-name {
    animation: none !important;
    transition: none !important;
  }
}


[data-theme="dark"] .site-nav a {
  color: var(--ink-soft);
}

[data-theme="dark"] .site-nav a.is-active,
[data-theme="dark"] .site-nav a:hover,
[data-theme="dark"] .site-nav a:focus-visible {
  background: rgba(255, 108, 137, 0.18);
  color: var(--ink);
}

[data-theme="dark"] .notice-card,
[data-theme="dark"] .info-card,
[data-theme="dark"] .faq-group,
[data-theme="dark"] .faq-item,
[data-theme="dark"] .public-map-card,
[data-theme="dark"] .form-panel,
[data-theme="dark"] .side-card,
[data-theme="dark"] .updates-table-shell,
[data-theme="dark"] .updates-card,
[data-theme="dark"] .success-reference,
[data-theme="dark"] .crm-panel,
[data-theme="dark"] .crm-card,
[data-theme="dark"] .finder-card,
[data-theme="dark"] .ward-summary-card {
  background: var(--surface);
  border-color: var(--border);
}

[data-theme="dark"] .success-card {
  background:
    radial-gradient(circle at top right, rgba(255, 108, 137, 0.14), transparent 12rem),
    linear-gradient(180deg, rgba(31, 36, 43, 0.98) 0%, rgba(24, 29, 36, 0.98) 100%);
  border-color: rgba(255, 108, 137, 0.18);
  box-shadow: 0 28px 64px rgba(0, 0, 0, 0.28), 0 10px 24px rgba(0, 0, 0, 0.18);
}

[data-theme="dark"] .success-card__lead,
[data-theme="dark"] .success-reference__hint,
[data-theme="dark"] .success-next__list {
  color: #d1d5db;
}

[data-theme="dark"] .success-card__eyebrow {
  color: #ff9cad;
}

[data-theme="dark"] .faq-item summary,
[data-theme="dark"] .faq-answer,
[data-theme="dark"] .updates-table,
[data-theme="dark"] .updates-table thead th,
[data-theme="dark"] .updates-table tbody td,
[data-theme="dark"] .updates-table__focus-link,
[data-theme="dark"] .map-filter-control label,
[data-theme="dark"] .map-ward-filter label,
[data-theme="dark"] .success-next__label {
  color: var(--ink);
}

[data-theme="dark"] .mp-popup .leaflet-popup-content-wrapper {
  background: #1f2937;
}

[data-theme="dark"] .mp-card {
  background: #1f2937;
}

[data-theme="dark"] .mp-popup .leaflet-popup-tip {
  background: #1f2937;
}

[data-theme="dark"] .mp-title {
  color: #f9fafb;
  -webkit-text-fill-color: #f9fafb;
  -webkit-text-stroke: 0 transparent;
  background: none !important;
}

[data-theme="dark"] .mp-date {
  color: #e5e7eb;
}

[data-theme="dark"] .mp-divider {
  background: #374151;
}

[data-theme="dark"] .mp-note-block {
  border-top-color: #374151;
}

[data-theme="dark"] .mp-note {
  color: #e5e7eb;
}

[data-theme="dark"] .mp-close {
  color: #9ca3af;
}

[data-theme="dark"] .mp-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #f9fafb;
}

[data-theme="dark"] .faq-group {
  background:
    radial-gradient(circle at top right, rgba(255, 108, 137, 0.12), transparent 11rem),
    linear-gradient(180deg, rgba(31, 36, 43, 0.98) 0%, rgba(24, 29, 36, 0.98) 100%);
  border-color: rgba(77, 88, 102, 0.56);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.24), 0 6px 16px rgba(0, 0, 0, 0.16);
}

[data-theme="dark"] .faq-item {
  background: rgba(38, 44, 52, 0.92);
  border-color: rgba(77, 88, 102, 0.48);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.14);
}

[data-theme="dark"] .faq-item[open] {
  background: linear-gradient(180deg, rgba(38, 44, 52, 0.96), rgba(52, 34, 39, 0.88));
  border-color: rgba(255, 108, 137, 0.2);
}

[data-theme="dark"] .faq-item summary {
  background: linear-gradient(180deg, rgba(38, 44, 52, 0.98), rgba(31, 36, 43, 0.92));
  border-bottom-color: rgba(77, 88, 102, 0.42);
}

[data-theme="dark"] .faq-item:hover summary,
[data-theme="dark"] .faq-item:focus-within summary,
[data-theme="dark"] .faq-item[open] summary {
  background: linear-gradient(180deg, rgba(46, 52, 61, 0.98), rgba(52, 34, 39, 0.86));
}

[data-theme="dark"] .faq-item summary::after,
[data-theme="dark"] .updates-table__focus-link:hover,
[data-theme="dark"] .updates-table__focus-link:focus-visible {
  color: var(--link);
}

[data-theme="dark"] .faq-item summary::after {
  background: rgba(255, 108, 137, 0.12);
  border-color: rgba(255, 108, 137, 0.2);
}

[data-theme="dark"] .button--secondary,
[data-theme="dark"] .button--outline,
[data-theme="dark"] .status-pill[data-state="pending"],
[data-theme="dark"] .status-badge--posted,
[data-theme="dark"] .report-consent-note,
[data-theme="dark"] .success-reference__copy {
  background: var(--red-muted);
  border-color: rgba(255, 156, 173, 0.35);
  color: var(--ink);
}

[data-theme="dark"] .button--secondary:hover,
[data-theme="dark"] .button--secondary:focus-visible,
[data-theme="dark"] .button--outline:hover,
[data-theme="dark"] .button--outline:focus-visible,
[data-theme="dark"] .success-reference__copy:hover,
[data-theme="dark"] .success-reference__copy:focus-visible {
  background: var(--red-muted-strong);
  color: var(--ink);
}

[data-theme="dark"] .button--outline {
  background: transparent;
}

[data-theme="dark"] .success-reference {
  background: linear-gradient(180deg, rgba(38, 44, 52, 0.98), rgba(46, 31, 36, 0.94));
  border-color: rgba(255, 108, 137, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .success-next__panel {
  background: rgba(38, 44, 52, 0.92);
  border-color: rgba(77, 88, 102, 0.5);
}

[data-theme="dark"] .button--danger {
  background: #dc2626;
  border-color: #ef4444;
  color: #fff;
}

[data-theme="dark"] .button--danger:hover,
[data-theme="dark"] .button--danger:focus-visible {
  background: #b91c1c;
  border-color: #ef4444;
}

[data-theme="dark"] .button--ghost {
  background: var(--surface-strong);
  border-color: var(--border-strong);
  color: var(--ink-soft);
}

[data-theme="dark"] .crm-select-banner {
  background: rgba(146, 64, 14, 0.24);
  border-color: rgba(252, 211, 77, 0.34);
  color: #fde68a;
}

[data-theme="dark"] .crm-select-banner__action {
  color: #fbbf24;
}

[data-theme="dark"] .map-filter-select,
[data-theme="dark"] .map-status-button,
[data-theme="dark"] .leaflet-control-locationfinder__button {
  background: var(--surface-strong);
  color: var(--ink);
  border-color: var(--border-strong);
}

[data-theme="dark"] .map-filter-select:hover,
[data-theme="dark"] .map-status-button:hover,
[data-theme="dark"] .map-status-button:focus-visible,
[data-theme="dark"] .leaflet-control-locationfinder__button:hover,
[data-theme="dark"] .leaflet-control-locationfinder__button:focus-visible {
  background: #323b46;
  color: var(--ink);
}

[data-theme="dark"] .map-status-button--reported,
[data-theme="dark"] .map-status-button--dealt,
[data-theme="dark"] .map-status-button--completed,
[data-theme="dark"] .map-status-button--all {
  color: var(--ink);
}

[data-theme="dark"] .radio-option {
  background: var(--surface-strong);
  border-color: var(--border-strong);
  color: var(--ink);
}

[data-theme="dark"] .radio-option:hover,
[data-theme="dark"] .radio-option:focus-within {
  background: #323b46;
  border-color: var(--border-strong);
}

[data-theme="dark"] .radio-option input {
  accent-color: var(--primary-red);
}

[data-theme="dark"] .map-pin-tray {
  background: var(--surface);
  border-color: rgba(107, 119, 135, 0.6);
}

[data-theme="dark"] .map-pin-dock {
  background: var(--surface-strong);
  border-color: rgba(107, 119, 135, 0.9);
  box-shadow: inset 0 0 0 1px rgba(221, 227, 234, 0.06);
}

[data-theme="dark"] .map-pin-dock--detached {
  background: #252a31;
  border-color: rgba(107, 119, 135, 0.6);
}

[data-theme="dark"] .map-pin-tray__help,
[data-theme="dark"] .map-location-summary {
  color: var(--ink-soft);
}

[data-theme="dark"] .updates-table tbody tr:hover,
[data-theme="dark"] .updates-table tbody tr,
[data-theme="dark"] .faq-item,
[data-theme="dark"] .map-search-results,
[data-theme="dark"] .ward-finder-results {
  background: var(--surface);
}

[data-theme="dark"] .updates-table thead th {
  border-bottom-color: var(--border-strong);
}

[data-theme="dark"] .updates-table tbody td {
  border-top-color: rgba(107, 119, 135, 0.35);
}

[data-theme="dark"] .status-pill[data-state="valid"],
[data-theme="dark"] .status-badge--approved,
[data-theme="dark"] .status-badge--public {
  background: var(--success-bg);
  color: var(--success);
}

[data-theme="dark"] .status-pill[data-state="invalid"],
[data-theme="dark"] .status-badge--rejected,
[data-theme="dark"] .error-summary,
[data-theme="dark"] .form-error {
  background: var(--error-bg);
  color: var(--error);
  border-color: var(--warning-border);
}

[data-theme="dark"] .info-summary {
  background: var(--info-bg);
  color: var(--info);
  border-color: rgba(142, 201, 245, 0.2);
}

[data-theme="dark"] .status-badge--draft,
[data-theme="dark"] .status-badge--private {
  background: var(--info-bg);
  color: var(--info);
}

[data-theme="dark"] .crm-badge--web,
[data-theme="dark"] .crm-badge--outbound,
[data-theme="dark"] .crm-badge--sent {
  background: #16324a;
  color: #9fd3ff;
}

[data-theme="dark"] .crm-badge--manual,
[data-theme="dark"] .crm-badge--response {
  background: #3b2c16;
  color: #ffd792;
}

[data-theme="dark"] .crm-badge--inbound,
[data-theme="dark"] .crm-badge--resolved {
  background: #183423;
  color: #9fe0b3;
}

[data-theme="dark"] .crm-badge--new {
  background: var(--surface-strong);
  color: var(--ink-soft);
}

[data-theme="dark"] .crm-badge--overdue {
  background: #411920;
  color: #ffb0bc;
}

[data-theme="dark"] .crm-badge--closed {
  background: #2a2d33;
  color: #9ca3af;
}

[data-theme="dark"] .crm-closed-banner {
  background: #1f2937;
  border-color: #374151;
  color: #d1d5db;
}

[data-theme="dark"] .crm-filter-tab--active {
  background: var(--ink);
  color: var(--surface);
  border-color: var(--ink);
}

[data-theme="dark"] .crm-alert--warning {
  background: #3b2c16;
  border-color: #8b6a3a;
  color: #ffd792;
}

[data-theme="dark"] .crm-status-badge--pending {
  background: #1f2937;
  color: #d1d5db;
}

[data-theme="dark"] .crm-status-badge--in_progress {
  background: rgba(245, 158, 11, 0.16);
  color: #fcd34d;
}

[data-theme="dark"] .crm-status-badge--completed {
  background: rgba(34, 197, 94, 0.16);
  color: #bbf7d0;
}

[data-theme="dark"] .crm-trash-btn {
  background: #442028;
  border-color: #8a4a59;
  color: #f5d6dc;
}

[data-theme="dark"] .crm-trash-btn:hover,
[data-theme="dark"] .crm-trash-btn:focus-visible {
  background: #5a2933;
  border-color: #b76c7d;
  color: #ffffff;
}

[data-theme="dark"] .crm-trash-btn--danger {
  background: #522029;
  border-color: #9c4d5c;
  color: #ffd7de;
}

[data-theme="dark"] .crm-trash-btn--danger:hover,
[data-theme="dark"] .crm-trash-btn--danger:focus-visible {
  background: #6a2834;
  border-color: #c86e81;
  color: #ffffff;
}

/* Theme toggle button */
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--ink-soft);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  flex-shrink: 0;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.theme-toggle:hover {
  background-color: var(--surface-strong);
  border-color: var(--border-strong);
  color: var(--ink);
}

.theme-toggle__icon {
  width: 18px;
  height: 18px;
}

/* Sun visible in light mode; moon visible in dark mode */
.theme-toggle__moon { display: none; }
.theme-toggle__sun  { display: block; }
[data-theme="dark"] .theme-toggle__moon { display: block; }
[data-theme="dark"] .theme-toggle__sun  { display: none; }

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

.acc-dropdown {
  position: relative;
  flex-shrink: 0;
}

/* Chevron trigger button */
.acc-dropdown__trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  flex-shrink: 0;
}

.acc-dropdown__trigger:hover,
.acc-dropdown__trigger:focus-visible {
  background: var(--surface-strong);
  border-color: var(--border-strong);
  color: var(--ink);
  outline: 2px solid rgba(200, 16, 46, 0.2);
  outline-offset: 2px;
}

.acc-dropdown__chevron {
  width: 14px;
  height: 14px;
  transition: transform 0.2s ease;
  pointer-events: none;
}

.acc-dropdown__trigger--open .acc-dropdown__chevron {
  transform: rotate(180deg);
}

/* Dropdown panel */
.acc-dropdown__panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 230px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.13), 0 2px 6px rgba(0, 0, 0, 0.07);
  z-index: 2010;
  overflow: hidden;

  /* Closed state */
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.18s ease, visibility 0.18s ease, transform 0.18s ease;
  pointer-events: none;
}

.acc-dropdown__panel--open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

[data-theme="dark"] .acc-dropdown__panel {
  background: var(--surface-strong);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4), 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Each row inside the panel */
.acc-dropdown__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border);
}

.acc-dropdown__row:last-of-type {
  border-bottom: none;
}

.acc-install-row {
  border-bottom: 1px solid var(--border);
}

.acc-dropdown__label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
  white-space: normal;
}

/* Toggle switch */
.acc-toggle-switch {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: 12px;
  border: none;
  background: var(--border-strong);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: background 0.2s ease;
}

.acc-toggle-switch--on {
  background: var(--primary-red);
}

.acc-toggle-switch:focus-visible {
  outline: 2px solid rgba(200, 16, 46, 0.4);
  outline-offset: 2px;
}

.acc-toggle-switch__thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
  pointer-events: none;
}

.acc-toggle-switch--on .acc-toggle-switch__thumb {
  transform: translateX(18px);
}

/* Install button inside dropdown */
.acc-install-btn {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: none;
  color: var(--ink);
  cursor: pointer;
  font-family: var(--font-body);
  white-space: nowrap;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.acc-install-btn:hover,
.acc-install-btn:focus-visible {
  background: var(--surface-strong);
  border-color: var(--primary-red);
  color: var(--primary-red);
}

@media (max-width: 768px) {
  .site-header__left {
    position: relative;
  }

  .site-header__left .acc-dropdown {
    position: static;
  }

  .site-header__left .acc-dropdown__panel {
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    min-width: 0;
    width: auto;
    max-width: none;
  }

  .acc-dropdown__row {
    flex-wrap: wrap;
    align-items: center;
  }

  .font-size-controls {
    margin-left: auto;
    flex-shrink: 0;
  }

  .acc-install-btn {
    margin-left: auto;
  }
}

@media (max-width: 420px) {
  .acc-dropdown__row {
    align-items: flex-start;
  }

  .font-size-controls {
    width: 100%;
    justify-content: flex-start;
    margin-left: 0;
  }

  .acc-install-btn {
    margin-left: 0;
  }
}

/* Countdown bar */
.acc-countdown-bar {
  height: 3px;
  background: var(--border);
}

.acc-countdown-bar__fill {
  height: 100%;
  width: 100%;
  background: var(--primary-red);
  opacity: 0.45;
}

/* ==========================================
   CHARACTER COUNT
   ========================================== */

.char-count {
  font-size: 0.825rem;
  color: var(--muted);
  text-align: right;
  margin-top: 0.3rem;
  min-height: 1.3em;
  transition: color 0.2s;
}

.char-count--warn {
  color: #d97706;
  font-weight: 600;
}

.char-count--danger {
  color: #dc2626;
  font-weight: 600;
}

/* ==========================================
   SPEECH TO TEXT BUTTON
   ========================================== */

.speech-btn-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.75rem;
}

.speech-btn-wrap[hidden] {
  display: none;
}

.speech-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 1.1rem;
  border: 1px solid rgba(200, 16, 46, 0.24);
  border-radius: var(--radius-sm);
  background: #fff7f8;
  color: var(--primary-red-dark);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.speech-btn:hover,
.speech-btn:focus-visible {
  background: #ffe9ed;
  border-color: rgba(153, 17, 39, 0.36);
  box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.12);
  outline: none;
}

.speech-btn.is-listening {
  background: var(--primary-red);
  border-color: var(--primary-red-dark);
  color: #fff;
}

.speech-btn.is-listening:hover,
.speech-btn.is-listening:focus-visible {
  background: var(--primary-red-dark);
  border-color: var(--primary-red-dark);
  color: #fff;
  box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.2);
}

.speech-pulse {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.6);
  animation: speech-pulse 1.15s ease-in-out infinite;
}

@keyframes speech-pulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.45);
  }

  70% {
    transform: scale(1.05);
    box-shadow: 0 0 0 0.55rem rgba(255, 255, 255, 0);
  }

  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
  }
}

#speech-interim {
  align-self: stretch;
  font-size: 0.875rem;
  color: var(--muted);
  font-style: italic;
  margin: 0;
  padding-left: 0.1rem;
  line-height: 1.5;
}

#speech-error {
  align-self: stretch;
  font-size: 0.84rem;
  color: #b42318;
  margin: 0;
}

/* ==========================================
   DRAFT AUTO-SAVE
   ========================================== */

.draft-banner {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 1rem;
  padding: 0.45rem 0.75rem;
  background: var(--surface-tint);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.draft-banner a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  margin-left: 0.5rem;
}

.draft-toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--success);
  border-radius: 8px;
  padding: 0.6rem 1rem;
  font-size: 0.875rem;
  color: var(--success);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
  z-index: 9999;
}

.draft-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================
   SUCCESS PAGE ANIMATIONS
   ========================================== */

#confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9998;
}

.success-anim {
  display: flex;
  justify-content: center;
  margin: 0 auto 1.75rem;
}

.success-checkmark {
  width: 84px;
  height: 84px;
}

.success-checkmark__circle {
  stroke: #22c55e;
  stroke-width: 2.5;
  fill: none;
  stroke-dasharray: 251;
  stroke-dashoffset: 251;
  animation: ck-circle 0.65s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.success-checkmark__tick {
  stroke: #22c55e;
  stroke-width: 2.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 52;
  stroke-dashoffset: 52;
  animation: ck-tick 0.4s ease 0.55s forwards;
}

@media (max-width: 760px) {
  .success-card {
    padding: 1.55rem 1.1rem 1.2rem;
    border-radius: 24px;
  }

  .success-reference {
    padding: 1rem;
    border-radius: 18px;
  }

  .success-reference__row {
    align-items: stretch;
  }

  .success-reference__copy {
    width: 100%;
  }

  .success-actions .button {
    width: 100%;
    min-width: 0;
  }

  .session-page__bulk-form {
    width: 100%;
    justify-content: flex-start;
  }

  .session-table,
  .session-table thead,
  .session-table tbody,
  .session-table tr,
  .session-table th,
  .session-table td {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .session-table thead {
    display: none;
  }

  .session-table__row {
    border: 1px solid var(--border);
    border-radius: 16px;
    margin-bottom: 1rem;
    overflow: hidden;
    background: var(--surface);
  }

  .session-table__row td {
    border-bottom: 1px solid var(--border);
    padding: 0.85rem 1rem;
  }

  .session-table__row td:last-child {
    border-bottom: 0;
  }

  .session-table__row td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--muted);
  }

  .session-table__row--current td:first-child {
    border-left: 0;
    box-shadow: inset 4px 0 0 #16a34a;
  }
}

@keyframes ck-circle {
  to { stroke-dashoffset: 0; }
}

@keyframes ck-tick {
  to { stroke-dashoffset: 0; }
}

.success-card {
  animation: success-fade-in 0.55s ease both;
}

@keyframes success-fade-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================
   MULTI-PHOTO UPLOAD
   ========================================== */

.image-upload-controls {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.button--sm {
  padding: 0.45rem 0.9rem;
  font-size: 0.9rem;
}

.image-upload-counter {
  font-size: 0.875rem;
  color: var(--muted);
}

.image-preview-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.image-preview-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  width: 100px;
}

.image-preview-thumb {
  width: 100px;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
  display: block;
}

.image-preview-remove {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary-red);
  border: 2px solid var(--surface);
  color: #fff;
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background-color 0.15s;
}

.image-preview-remove:hover {
  background: var(--primary-red-dark);
}

.image-preview-name {
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  word-break: break-all;
  max-width: 100px;
}

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

/* CRM photo grid */
.crm-photo-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

.crm-photo-link {
  display: block;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.crm-photo-link:hover {
  border-color: var(--border-strong);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.crm-photo-thumb {
  width: 160px;
  height: 120px;
  object-fit: cover;
  display: block;
}

/* ── CRM tabs ─────────────────────────────────────────────────────────────── */
.crm-tabs {
  background: var(--surface);
  border-bottom: 2px solid var(--border);
  margin-bottom: 0;
}

.crm-tabs__inner {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.crm-tabs .crm-tab {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
}

.crm-tabs .crm-tab:hover {
  color: var(--ink);
}

.crm-tabs .crm-tab--active {
  color: var(--primary-red);
  border-bottom-color: var(--primary-red);
}

.sar-row--urgent {
  background: #fff7ed;
}

.sar-row--overdue {
  background: #fef2f2;
}

.sar-deadline {
  font-weight: 600;
  color: #14532d;
}

.sar-deadline--urgent {
  color: #b45309;
}

.sar-deadline--overdue {
  color: #b91c1c;
}

[data-theme="dark"] .sar-row--urgent {
  background: rgba(245, 158, 11, 0.12);
}

[data-theme="dark"] .sar-row--overdue {
  background: rgba(220, 38, 38, 0.15);
}

[data-theme="dark"] .sar-deadline {
  color: #bbf7d0;
}

[data-theme="dark"] .sar-deadline--urgent {
  color: #fcd34d;
}

[data-theme="dark"] .sar-deadline--overdue {
  color: #fca5a5;
}

@media (max-width: 640px) {
  .crm-tabs__inner {
    justify-content: stretch;
  }

  .crm-tabs .crm-tab {
    flex: 1 1 100%;
    text-align: center;
  }
}

/* ── Email Database – general ─────────────────────────────────────────────── */
.edb-empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--muted);
}

.edb-empty-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.edb-batch-history {
  font-size: 0.875rem;
}

.edb-batch-history > summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 600;
}

.edb-case-count-link {
  font-weight: 600;
  color: var(--link);
  text-decoration: none;
}

.edb-case-count-link:hover {
  text-decoration: underline;
}

/* ── Email DB – resident page ─────────────────────────────────────────────── */
.edb-resident-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 800px) {
  .edb-resident-layout {
    grid-template-columns: 1fr;
  }
}

.edb-section-heading {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 1rem;
  color: var(--heading);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.edb-link-notice {
  margin-top: 1rem;
  padding: 0.75rem;
  background: var(--info-bg);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
}

.edb-link-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
}

.edb-link-list li {
  padding: 0.25rem 0;
}

.edb-unlink-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.75rem;
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
}

.edb-unlink-btn:hover {
  color: var(--error);
  background: var(--error-bg);
}

.edb-link-toggle {
  cursor: pointer;
  color: var(--link);
  font-size: 0.875rem;
  font-weight: 600;
}

.edb-link-form {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
}

/* ── Email DB – case cards ────────────────────────────────────────────────── */
.edb-case-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.edb-case-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.edb-case-card:hover {
  border-color: var(--border-strong);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.edb-case-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.edb-case-card__title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.25rem;
  color: var(--heading);
}

.edb-case-card__location,
.edb-case-card__summary,
.edb-case-card__deadline {
  font-size: 0.875rem;
  margin: 0.25rem 0 0;
  color: var(--muted);
}

.edb-case-card__actions {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
  font-size: 0.8125rem;
  color: var(--muted);
}

.edb-case-dates {
  font-size: 0.8125rem;
  white-space: nowrap;
}

.edb-mi-ref {
  display: inline-block;
  font-size: 0.75rem;
  font-family: monospace;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
  color: var(--muted);
}

.edb-mi-ref--heading {
  font-size: 0.85rem;
  vertical-align: middle;
}

/* ── Email DB – case view ─────────────────────────────────────────────────── */
.edb-case-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 900px) {
  .edb-case-layout {
    grid-template-columns: 1fr;
  }
}

.edb-thread-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
  font-size: 0.8125rem;
}

.edb-legend-item {
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-weight: 600;
}

.edb-legend-item--from-resident    { background: #dbeafe; color: #1e40af; }
.edb-legend-item--to-resident      { background: #fee2e2; color: #991b1b; }
.edb-legend-item--to-council       { background: #fef3c7; color: #92400e; }
.edb-legend-item--from-council     { background: #d1fae5; color: #065f46; }
.edb-legend-item--resident-to-council-cc { background: #ede9fe; color: #5b21b6; }

.edb-thread {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.edb-email {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  overflow: hidden;
}

.edb-email--from_resident    { border-left: 4px solid #3b82f6; }
.edb-email--to_resident      { border-left: 4px solid #ef4444; }
.edb-email--to_council       { border-left: 4px solid #f59e0b; }
.edb-email--from_council     { border-left: 4px solid #10b981; }
.edb-email--resident_to_council_cc { border-left: 4px solid #8b5cf6; }

.edb-email__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  background: var(--surface-strong);
  padding: 0.6rem 0.875rem;
  font-size: 0.8125rem;
}

.edb-email__meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.edb-email__from,
.edb-email__to,
.edb-email__cc,
.edb-email__subject {
  display: block;
}

.edb-email__date {
  white-space: nowrap;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.edb-email__body {
  padding: 0.75rem 0.875rem;
}

.edb-email__body-text {
  font-family: var(--font-body);
  font-size: 0.875rem;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
  color: var(--ink-soft);
}

.edb-email__body-preview {
  font-family: var(--font-body);
  font-size: 0.875rem;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--ink-soft);
  margin-bottom: 0.5rem;
}

.edb-email__body-full > summary {
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--link);
  font-weight: 600;
}

.edb-email__attachments {
  padding: 0.4rem 0.875rem 0.6rem;
  background: var(--surface-strong);
  font-size: 0.8125rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.edb-attachment {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.15rem 0.5rem;
}

/* ── Email DB – action panel ──────────────────────────────────────────────── */
.edb-action-panel {
  position: sticky;
  top: 1rem;
}

.edb-ai-summary {
  margin-top: 1rem;
  padding: 0.75rem;
  background: var(--info-bg);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
}

.edb-ai-summary h3 {
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 0.4rem;
  color: var(--info);
}

.edb-followup-actions {
  margin-top: 1rem;
  font-size: 0.875rem;
}

.edb-followup-actions h3 {
  font-size: 0.875rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
}

.edb-followup-actions ul {
  margin: 0;
  padding-left: 1.25rem;
}

.edb-overdue { color: var(--error); font-weight: 600; }
.edb-urgent  { color: #b45309; font-weight: 600; }

/* ── Email DB – import page ───────────────────────────────────────────────── */
.edb-import-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 800px) {
  .edb-import-layout {
    grid-template-columns: 1fr;
  }
}

.edb-format-guide {
  background: var(--surface-strong);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin: 1rem 0;
  font-size: 0.875rem;
}

.edb-format-guide h3 {
  margin: 0 0 0.5rem;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.edb-format-list {
  margin: 0;
  display: grid;
  gap: 0.5rem;
}

.edb-format-list dt {
  font-family: monospace;
  font-weight: 700;
  color: var(--primary-red);
}

.edb-format-list dd {
  margin: 0 0 0.5rem 0;
  color: var(--muted);
}

.edb-file-input {
  display: block;
  width: 100%;
  margin-top: 0.4rem;
  padding: 0.6rem;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-alt);
  font-size: 0.875rem;
  cursor: pointer;
}

.edb-import-notice {
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  font-size: 0.875rem;
  margin: 1rem 0;
}

/* ── Email DB – progress page ─────────────────────────────────────────────── */
.edb-progress-card {
  max-width: 640px;
  margin: 0 auto;
}

.edb-stages {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  gap: 0.25rem;
}

.edb-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  flex: 1;
}

.edb-stage__dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--border-strong);
  transition: background 0.3s;
}

.edb-stage__label {
  font-size: 0.72rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.2;
}

.edb-stage--done  .edb-stage__dot { background: var(--success); }
.edb-stage--active .edb-stage__dot {
  background: var(--primary-red);
  box-shadow: 0 0 0 4px var(--red-muted-strong);
}

.edb-progress-bar {
  height: 8px;
  background: var(--surface-strong);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.edb-progress-bar__fill {
  height: 100%;
  background: var(--primary-red);
  border-radius: 4px;
  transition: width 0.5s ease;
}

.edb-progress-status {
  font-size: 0.9375rem;
  color: var(--muted);
  text-align: center;
  margin-bottom: 1rem;
}

.edb-progress-stats {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  margin-top: 0.5rem;
}

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

.edb-stat span:first-child {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--heading);
}

.edb-stat span:last-child {
  font-size: 0.8125rem;
  color: var(--muted);
}

/* ── All cases – source badges ────────────────────────────────────────────── */
.edb-source-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  margin-right: 0.25rem;
}

.edb-source-badge--website {
  background: #dbeafe;
  color: #1e40af;
}

.edb-source-badge--email {
  background: #fef3c7;
  color: #92400e;
}

/* ── Cookie consent banner ──────────────────────────────────────────────── */

.cookie-banner {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(calc(100% + 20px));
  z-index: 9999;
  width: calc(100% - 2.5rem);
  max-width: 760px;
  background: #1a1f2e;
  border-radius: 14px;
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.35),
    0 1px 4px rgba(0, 0, 0, 0.2),
    0 0 0 1px rgba(255, 255, 255, 0.07);
  padding: 1.25rem 1.5rem;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s ease;
  opacity: 0;
  pointer-events: auto;
}

.cookie-banner--visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.cookie-banner--hiding {
  transform: translateX(-50%) translateY(calc(100% + 20px));
  opacity: 0;
  pointer-events: none;
}

.cookie-banner__inner {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.cookie-banner__icon {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  color: var(--primary-red);
  opacity: 0.9;
}

.cookie-banner__content {
  flex: 1;
  min-width: 0;
}

.cookie-banner__heading {
  font-weight: 700;
  font-size: 1rem;
  color: #ffffff;
  margin: 0 0 0.25rem;
  letter-spacing: -0.01em;
}

.cookie-banner__text {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.65);
  margin: 0;
  line-height: 1.5;
}

.cookie-banner__text a {
  color: rgba(255, 255, 255, 0.88);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cookie-banner__text a:hover {
  color: #ffffff;
}

.cookie-banner__actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
  align-items: center;
}

.cookie-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1.2rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  line-height: 1;
  white-space: nowrap;
  font-family: inherit;
}

.cookie-btn--reject {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.3);
  color: rgba(255, 255, 255, 0.8);
}

.cookie-btn--reject:hover,
.cookie-btn--reject:focus-visible {
  border-color: rgba(255, 255, 255, 0.65);
  color: #ffffff;
  background: rgba(255, 255, 255, 0.07);
}

.cookie-btn--accept {
  background: var(--primary-red);
  border-color: var(--primary-red);
  color: #ffffff;
}

.cookie-btn--accept:hover,
.cookie-btn--accept:focus-visible {
  background: var(--primary-red-dark);
  border-color: var(--primary-red-dark);
}

@media (max-width: 600px) {
  .cookie-banner {
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: none;
    transform: translateX(0) translateY(100%);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    padding: 1.25rem 1.1rem 1.4rem;
  }

  .cookie-banner--visible {
    transform: translateX(0) translateY(0);
  }

  .cookie-banner--hiding {
    transform: translateX(0) translateY(100%);
  }

  .cookie-banner__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.9rem;
  }

  .cookie-banner__icon {
    display: none;
  }

  .cookie-banner__actions {
    width: 100%;
    gap: 0.5rem;
  }

  .cookie-btn {
    flex: 1;
    justify-content: center;
    padding: 0.6rem 1rem;
  }
}

/* ── Font size controls ─────────────────────────────────────────────────── */

.font-size-controls {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.font-size-btn {
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  min-width: 2.1rem;
  min-height: 2.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 700;
  line-height: 1;
  padding: 0.35rem 0.55rem;
  transition: background 0.12s, border-color 0.12s, color 0.12s, box-shadow 0.12s;
}

.font-size-btn[data-size="medium"] {
  font-size: 0.9rem;
}

.font-size-btn[data-size="large"] {
  font-size: 1.1rem;
}

.font-size-btn[data-size="extra-large"] {
  font-size: 1.35rem;
}

.font-size-btn:hover,
.font-size-btn:focus-visible {
  background: var(--surface-strong);
  border-color: var(--border-strong);
}

.font-size-btn--active {
  background: var(--red-muted);
  border-color: var(--primary-red);
  color: var(--primary-red);
  box-shadow: 0 0 0 1px rgba(200, 16, 46, 0.08);
}

[data-theme="dark"] .font-size-btn { color: var(--ink-soft); }
[data-theme="dark"] .font-size-btn:hover,
[data-theme="dark"] .font-size-btn:focus-visible { background: var(--surface-strong); }
[data-theme="dark"] .font-size-btn--active {
  background: rgba(200, 16, 46, 0.18);
  border-color: var(--primary-red);
  color: var(--primary-red);
}

html[data-font-size="medium"] {
  font-size: 100%;
}

html[data-font-size="large"] {
  font-size: 115%;
}

html[data-font-size="extra-large"] {
  font-size: 130%;
}

/* ── Push notification prompt ───────────────────────────────────────────── */

.push-prompt {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.1rem 1.25rem;
  margin: 1.5rem 0;
}

.push-prompt__icon {
  flex-shrink: 0;
  color: var(--primary-red);
  margin-top: 2px;
}

.push-prompt__content {
  flex: 1;
  min-width: 0;
}

.push-prompt__heading {
  display: block;
  font-size: 0.95rem;
  color: var(--ink);
  margin-bottom: 0.25rem;
}

.push-prompt__text {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 0.75rem;
  line-height: 1.5;
}

.push-prompt__status {
  font-size: 0.82rem;
  margin: 0.4rem 0 0;
  min-height: 1em;
}

.push-prompt__actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.push-confirmed {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--success);
  font-weight: 600;
  margin: 1rem 0;
}

@media (max-width: 480px) {
  .push-prompt {
    flex-direction: column;
    gap: 0.6rem;
  }
  .push-prompt__icon { display: none; }
}

/* ── Send to Council button & status ───────────────────────────────────── */

.crm-ai-send-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.9rem;
}

.crm-send-council-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.crm-send-spinner {
  animation: crm-spin 0.8s linear infinite;
  flex-shrink: 0;
}

.crm-summary-spinner {
  animation: crm-spin 0.8s linear infinite;
  flex-shrink: 0;
}

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

.crm-summary-status,
.crm-send-status {
  margin-top: 0.6rem;
  padding: 0.55rem 0.85rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
}

.crm-send-status--success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success);
}

.crm-summary-status--success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success);
}

.crm-summary-status--error,
.crm-send-status--error {
  background: var(--error-bg);
  color: var(--error);
  border: 1px solid var(--error);
}

.crm-ai-attach-note {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.5rem;
}

/* ── Scroll to top ───────────────────────────────────────────────────────── */

.scroll-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 10000;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary-red);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(200, 16, 46, 0.4), 0 2px 6px rgba(0, 0, 0, 0.2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease, background-color 0.15s ease, bottom 0.3s ease;
  pointer-events: none;
}

.scroll-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.scroll-to-top:hover,
.scroll-to-top:focus-visible {
  background: var(--primary-red-dark);
  outline: 2px solid var(--primary-red-dark);
  outline-offset: 3px;
}

.scroll-to-top__icon {
  width: 22px;
  height: 22px;
  display: block;
  flex-shrink: 0;
}

/* ── CRM PDF actions ─────────────────────────────────────────────────────── */

.crm-pdf-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

/* ── CRM council reference block ─────────────────────────────────────────── */

.crm-council-ref-block {
  margin-top: 0.75rem;
}

.crm-council-ref-form {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 0.375rem;
}

.crm-council-ref-input {
  flex: 1 1 160px;
  min-width: 0;
  padding: 0.375rem 0.625rem;
  font-size: 0.875rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--input-bg, var(--card-bg));
  color: var(--text);
  line-height: 1.4;
}

.crm-council-ref-input:focus {
  outline: 2px solid var(--primary-red);
  outline-offset: 1px;
  border-color: var(--primary-red);
}

/* ── CRM draft saved indicator ───────────────────────────────────────────── */

.crm-draft-saved {
  display: inline-block;
  font-size: 0.8125rem;
  color: #1a7a3f;
  font-weight: 600;
  margin-left: 0.5rem;
  transition: opacity 0.3s ease;
}

[data-theme="dark"] .crm-draft-saved {
  color: #4ade80;
}

/* ── CRM AI action row ───────────────────────────────────────────────────── */

.crm-ai-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.75rem;
}

/* ── Bulk selection ──────────────────────────────────────────────────────── */

.crm-row--selected td {
  background-color: rgba(200, 16, 46, 0.06);
}

[data-theme="dark"] .crm-row--selected td {
  background-color: rgba(200, 16, 46, 0.15);
}

.crm-selected-count {
  font-size: 0.95rem;
  font-weight: 700;
  white-space: nowrap;
  padding: 0.8rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-strong);
}

.crm-selected-count--none {
  color: var(--text-muted, #888);
}

.crm-selected-count--some,
.crm-selected-count--all {
  color: var(--primary-red, #c8102e);
  font-weight: 600;
}

.crm-select-banner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  padding: 0.8rem 1rem;
  border: 1px solid #fcd34d;
  border-radius: 12px;
  background: #fef3c7;
  color: #92400e;
  font-size: 0.92rem;
  font-weight: 600;
}

.crm-select-banner__action {
  border: 0;
  background: transparent;
  color: #9a3412;
  font: inherit;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 0.15em;
  cursor: pointer;
  padding: 0;
}

.crm-select-banner__action:hover,
.crm-select-banner__action:focus-visible {
  color: #7c2d12;
}

/* Larger tap target for checkboxes */
.crm-select-column input[type="checkbox"],
.crm-select-toggle input[type="checkbox"] {
  width: 1.25rem;
  height: 1.25rem;
  cursor: pointer;
  accent-color: var(--primary-red, #c8102e);
}

/* ── Council AI email box ────────────────────────────────────────────────── */

@media (max-width: 760px) {
  .crm-table-controls {
    align-items: stretch;
  }

  .crm-selected-count,
  .crm-bulk-actions--dashboard {
    width: 100%;
  }

  .crm-bulk-actions--dashboard {
    justify-content: stretch;
  }

  .crm-bulk-actions--dashboard .button {
    flex: 1 1 100%;
  }

  .crm-select-banner {
    align-items: flex-start;
  }
}

.crm-ai-council-box {
  border: 1.5px solid rgba(200, 16, 46, 0.3);
  border-radius: 6px;
  padding: 1rem;
  background: rgba(200, 16, 46, 0.03);
  margin-bottom: 1rem;
}

[data-theme="dark"] .crm-ai-council-box {
  background: rgba(200, 16, 46, 0.08);
  border-color: rgba(200, 16, 46, 0.35);
}

.crm-ai-council-box__header {
  display: flex;
  align-items: baseline;
  gap: 0.625rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.crm-ai-council-box__title {
  font-size: 0.9375rem;
  font-weight: 600;
  margin: 0;
  color: var(--text);
}

.crm-ai-council-box__hint {
  font-size: 0.8125rem;
  color: var(--text-muted, #888);
}

/* ── Sent email record (blue left border) ────────────────────────────────── */

.crm-sent-email-record {
  border-left: 3px solid #2563eb;
  padding: 0.75rem 1rem;
  background: rgba(37, 99, 235, 0.04);
  border-radius: 0 4px 4px 0;
}

[data-theme="dark"] .crm-sent-email-record {
  background: rgba(37, 99, 235, 0.1);
  border-left-color: #60a5fa;
}

.crm-sent-email-record__label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #2563eb;
  margin: 0 0 0.375rem;
}

[data-theme="dark"] .crm-sent-email-record__label {
  color: #60a5fa;
}

.crm-sent-email-record__subject {
  font-weight: 600;
  font-size: 0.875rem;
  margin: 0 0 0.375rem;
  color: var(--text);
}

.crm-sent-email-record__body {
  font-family: inherit;
  font-size: 0.8125rem;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
  margin: 0;
  line-height: 1.55;
}

.crm-council-compose-section {
  position: relative;
}

.crm-council-toast {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 1000;
  max-width: min(28rem, calc(100vw - 2rem));
  padding: 0.875rem 1rem;
  border-radius: 12px;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.14);
  font-size: 0.9rem;
  font-weight: 600;
}

.crm-council-toast--success {
  background: #fff8ea;
  color: #6b2f00;
  border: 1px solid #f7c97d;
}

.crm-council-toast--error {
  background: #fff1f1;
  color: #8b1f1f;
  border: 1px solid #f3b0b0;
}

.crm-council-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  border: 1px solid #f0d58a;
  background: #fff6d9;
  color: #725200;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.crm-council-empty {
  min-height: 15rem;
  border: 1px dashed rgba(120, 130, 150, 0.35);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(247, 248, 252, 0.95));
  display: grid;
  place-items: center;
  text-align: center;
  padding: 2rem 1.5rem;
}

.crm-council-empty__subtitle {
  margin: 0.85rem 0 0;
  color: var(--text-muted, #667085);
  max-width: 26rem;
}

.crm-council-loading {
  min-height: 15rem;
  display: grid;
  place-items: center;
  text-align: center;
  gap: 0.9rem;
  color: var(--text);
}

.crm-council-loading p {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.crm-council-spinner {
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 999px;
  border: 2px solid rgba(200, 16, 46, 0.2);
  border-top-color: var(--primary-red, #c8102e);
  animation: crm-spin 0.8s linear infinite;
  display: inline-block;
}

.crm-council-spinner--button {
  width: 1rem;
  height: 1rem;
  border-width: 2px;
}

.crm-council-meta-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.5rem;
}

.crm-council-save-status {
  min-height: 1rem;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-muted, #667085);
}

.crm-council-save-status--saving {
  color: #8a5b00;
}

.crm-council-save-status--saved {
  color: #1a7a3f;
}

.crm-council-save-status--error {
  color: #b42318;
}

.crm-gmail-compose {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.crm-gmail-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
  min-height: 3.25rem;
  border-bottom: 1px solid #e0e0e0;
  padding: 0 1rem;
  gap: 0.75rem;
}

.crm-gmail-row label {
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text-muted, #667085);
}

.crm-gmail-row input,
.crm-gmail-body textarea {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  padding: 0;
  box-shadow: none;
}

.crm-gmail-row input:focus,
.crm-gmail-body textarea:focus {
  outline: none;
}

.crm-gmail-row:focus-within,
.crm-gmail-body:focus-within {
  box-shadow: inset 0 0 0 2px rgba(26, 115, 232, 0.2);
}

.crm-gmail-row input[readonly] {
  color: var(--text-muted, #667085);
}

.crm-gmail-body {
  min-height: 22rem;
  padding: 1rem;
}

.crm-gmail-body textarea {
  min-height: 20rem;
  resize: vertical;
  line-height: 1.7;
}

.crm-gmail-toolbar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.9rem;
  flex-wrap: wrap;
}

.crm-gmail-send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 0;
  border-radius: 999px;
  background: #d93025;
  color: #fff;
  padding: 0.8rem 1.45rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(217, 48, 37, 0.22);
}

.crm-gmail-send:hover,
.crm-gmail-send:focus-visible {
  background: #b3261e;
}

.crm-gmail-send:disabled {
  opacity: 0.7;
  cursor: wait;
}

.crm-gmail-send--hero {
  min-width: min(22rem, 100%);
}

.crm-council-textlink {
  border: 0;
  background: transparent;
  color: #667085;
  font-size: 0.84rem;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.15rem;
}

.crm-council-textlink:hover,
.crm-council-textlink:focus-visible {
  color: var(--text);
}

.crm-council-sent-card,
.crm-council-original-draft {
  border: 1px solid #dfe3e8;
  border-radius: 16px;
  background: #f8fafc;
  padding: 1rem 1.05rem;
}

.crm-council-sent-card__status {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: #1a7a3f;
  font-weight: 700;
  margin: 0 0 0.6rem;
  flex-wrap: wrap;
}

.crm-council-sent-card__subject {
  margin: 0 0 0.55rem;
  font-weight: 700;
  color: var(--text);
}

.crm-council-sent-card__body {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 0.95rem 1rem;
  line-height: 1.65;
}

.crm-council-sent-card__body--draft {
  background: #fffdf3;
}

.crm-council-sent-card__links {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-top: 0.8rem;
  flex-wrap: wrap;
}

.crm-council-sent-card__links form {
  margin: 0;
}

.crm-council-original-draft {
  margin-top: 0.85rem;
}

@media (max-width: 720px) {
  .crm-council-toast {
    right: 1rem;
    left: 1rem;
    max-width: none;
  }

  .crm-gmail-row {
    grid-template-columns: 1fr;
    align-items: start;
    padding: 0.85rem 1rem;
    gap: 0.35rem;
  }

  .crm-gmail-body {
    min-height: 16rem;
  }

  .crm-gmail-body textarea {
    min-height: 14rem;
  }

  .crm-gmail-send--hero,
  .crm-gmail-send {
    width: 100%;
  }
}

[data-theme="dark"] .crm-council-toast--success {
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(245, 158, 11, 0.45);
  color: #fcd34d;
}

[data-theme="dark"] .crm-council-toast--error {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(248, 113, 113, 0.45);
  color: #fca5a5;
}

[data-theme="dark"] .crm-council-banner {
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(245, 158, 11, 0.35);
  color: #fcd34d;
}

[data-theme="dark"] .crm-council-empty {
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.92), rgba(15, 23, 42, 0.96));
  border-color: rgba(148, 163, 184, 0.25);
}

[data-theme="dark"] .crm-gmail-compose {
  background: #111827;
  border-color: rgba(148, 163, 184, 0.22);
}

[data-theme="dark"] .crm-gmail-row {
  border-bottom-color: rgba(148, 163, 184, 0.16);
}

[data-theme="dark"] .crm-council-sent-card,
[data-theme="dark"] .crm-council-original-draft {
  background: rgba(15, 23, 42, 0.94);
  border-color: rgba(148, 163, 184, 0.2);
}

[data-theme="dark"] .crm-council-sent-card__body {
  background: rgba(17, 24, 39, 0.9);
  border-color: rgba(148, 163, 184, 0.18);
}

.crm-location-map-card {
  margin-top: 1.25rem;
  border: 1px solid #dbe2ea;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  padding: 1rem;
}

.crm-location-map-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.crm-location-map-hint {
  margin: 0.2rem 0 0;
  color: #64748b;
  font-size: 0.9rem;
}

.crm-location-map-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.crm-location-map-image {
  display: block;
  width: 100%;
  border-radius: 16px;
  border: 1px solid #dbe2ea;
  background: #eef2f7;
}

.crm-location-map-coords {
  margin: 0.75rem 0 0;
  font-size: 0.875rem;
}

.crm-location-marker-form {
  margin-top: 0.85rem;
}

.crm-location-marker-editor {
  height: 320px;
  margin-bottom: 0.85rem;
}

.crm-location-marker-checkbox {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
  color: var(--ink);
}

@media (max-width: 720px) {
  .crm-location-map-header {
    flex-direction: column;
    align-items: stretch;
  }
}

[data-theme="dark"] .crm-location-map-card {
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.98), rgba(15, 23, 42, 0.98));
  border-color: rgba(148, 163, 184, 0.18);
}

[data-theme="dark"] .crm-location-map-hint,
[data-theme="dark"] .crm-location-map-coords {
  color: #94a3b8;
}

[data-theme="dark"] .crm-location-map-image {
  border-color: rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.8);
}

[data-theme="dark"] .crm-location-marker-checkbox {
  color: var(--ink-soft);
}

[data-theme="dark"] .crm-public-map-toggle-title,
[data-theme="dark"] .crm-public-map-toggle-help {
  color: var(--ink-soft);
}

[data-theme="dark"] .crm-public-map-switch {
  background: rgba(31, 41, 55, 0.95);
  border-color: rgba(148, 163, 184, 0.24);
  color: var(--ink);
}

[data-theme="dark"] .crm-public-map-switch:hover,
[data-theme="dark"] .crm-public-map-switch:focus-visible {
  border-color: rgba(248, 113, 113, 0.42);
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.12);
}

[data-theme="dark"] .crm-public-map-switch__track {
  background: rgba(100, 116, 139, 0.72);
}

[data-theme="dark"] .crm-public-map-switch__thumb {
  background: #f8fafc;
}

[data-theme="dark"] .crm-public-map-switch--on {
  background: rgba(20, 83, 45, 0.32);
  border-color: rgba(34, 197, 94, 0.44);
  color: #bbf7d0;
}

[data-theme="dark"] .crm-public-map-switch--on .crm-public-map-switch__track {
  background: #16a34a;
}

[data-theme="dark"] .crm-public-map-switch--off {
  background: rgba(127, 29, 29, 0.3);
  border-color: rgba(248, 113, 113, 0.45);
  color: #fecaca;
}

[data-theme="dark"] .crm-public-map-switch--off .crm-public-map-switch__track {
  background: rgba(239, 68, 68, 0.72);
}

[data-theme="dark"] .crm-public-map-section--hidden {
  border-left-color: #ef4444;
}

[data-theme="dark"] .crm-public-map-status-badge--hidden {
  background: rgba(127, 29, 29, 0.32);
  color: #fca5a5;
}

/* Response time notice box */
.response-time-notice {
  background: var(--info-bg);
  border-left: 3px solid var(--primary-red);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 0.75rem 0 1.25rem;
  color: var(--ink-soft);
}

/* Back navigation button */
.crm-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.875rem;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 0.25rem 0;
  margin-bottom: 0.5rem;
}
.crm-back-btn:hover {
  color: var(--ink);
}

/* Update request button and form */
.update-request-wrap {
  margin-top: 0.5rem;
}
.update-request-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  font-size: 0.8rem;
  border: 1.5px solid var(--primary-red);
  border-radius: 4px;
  background: transparent;
  color: var(--primary-red);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.update-request-btn:hover {
  background: var(--primary-red);
  color: #fff;
}
.update-request-form {
  margin-top: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.update-request-form__label {
  font-size: 0.82rem;
  color: var(--ink-soft);
}
.update-request-form__textarea {
  width: 100%;
  min-height: 68px;
  font-size: 0.85rem;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  resize: vertical;
  background: var(--surface);
  color: var(--ink);
  box-sizing: border-box;
}
.update-request-form__actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.update-request-submit {
  padding: 0.3rem 0.75rem;
  font-size: 0.82rem;
  background: var(--primary-red);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
.update-request-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.update-request-cancel {
  padding: 0.3rem 0.75rem;
  font-size: 0.82rem;
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
}
.update-request-cancel:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.update-request-form__error {
  font-size: 0.82rem;
  color: #b91c1c;
  margin: 0;
}
.update-request-success {
  font-size: 0.85rem;
  color: #2e7d32;
  margin-top: 0.4rem;
}

/* CRM search autocomplete dropdown */
.crm-search-wrap {
  position: relative;
  flex: 1;
}
.crm-search-dropdown {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  z-index: 200;
  overflow: visible;
}
.crm-search-result {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--ink);
}
.crm-search-result:hover,
.crm-search-result:focus {
  background: var(--bg);
  outline: none;
}
.crm-search-result:last-child {
  border-bottom: none;
}
.crm-search-result__ref {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--primary-red);
  white-space: nowrap;
  flex-shrink: 0;
}
.crm-search-result__info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.crm-search-result__name {
  font-size: 0.875rem;
  font-weight: 500;
}
.crm-search-result__meta {
  font-size: 0.8rem;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.crm-search-no-results {
  padding: 0.9rem 1rem;
  color: var(--ink-soft);
  font-size: 0.875rem;
  text-align: center;
}
.crm-search-highlight {
  background: #fff3b0;
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}
[data-theme="dark"] .crm-search-highlight {
  background: #7a6200;
}

/* Dashboard notification badge for pending update requests */
.crm-notif-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-red);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 99px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  margin-left: 0.4rem;
  vertical-align: middle;
  line-height: 1;
}

/* Tracker step title row with Request Update button */
.tracker-step__title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.tracker-step__title-row .tracker-step__title {
  margin: 0;
}

/* Update request form: intro text, char count, success */
.update-request-form__intro {
  font-size: 0.875rem;
  color: var(--ink-soft);
  margin: 0 0 0.5rem;
}
.update-request-char-count {
  font-size: 0.78rem;
  color: var(--ink-soft);
  text-align: right;
  margin: 0.15rem 0 0.4rem;
}
.update-request-success__check {
  font-size: 0.9rem;
  font-weight: 600;
  color: #2e7d32;
  margin: 0 0 0.2rem;
}
.update-request-success__note {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin: 0;
}
