/* Related services section */
.daw-related-services {
  background: var(--daw-surface-subtle);
  border-top: 1px solid var(--daw-border);
  padding: 1rem 0;
  margin-top: 0;
}
/* Ensure it overrides the generic .daw-section margin */
.daw-section.daw-related-services { margin-top: 0; }
/* DAW Service Finder — Minimal, Consistent System
   Scope: only within #daw-service-finder-app and related views
   Uses native CSS nesting for readability (no preprocessing required) */

/* Print styles for single-service page */
@media print {
  /* Page margin for print (applies in supporting browsers) */
  @page { margin: 10mm; }

  /* Hide global site header */
  #masthead { display: none !important; }

  /* Focus on main service content; remove non-essential blocks */
  .daw-related-services,
  .daw-page-toolbar,
  .daw-service-aside,
  .daw-map-container,
  .daw-services-map,
  .daw-single-map,
  .leaflet-container,
  .daw-sidebar-return,
  .daw-return-bottom { display: none !important; }

  /* Hide breadcrumbs and footer/site nav elements */
  .daw-breadcrumbs,
  .footer-nav,
  .footer-logos,
  a[href="#top"],
  .daw-status-badge { display: none !important; }

  /* Remove backgrounds and borders for clean print */
  .daw-service-single,
  .daw-service,
  .daw-section,
  .daw-kv-list,
  .daw-open-list { box-shadow: none !important; background: transparent !important; }
  .daw-kv-list,
  .daw-open-list { border: 0 !important; }
  .daw-open-row,
  .daw-kv-row { border: 0 !important; padding: 0.15rem 0 !important; }

  /* Typography adjustments */
  html, body { font-size: 13px !important; line-height: 1.35 !important; }
  .daw-service-title { font-size: 1.1rem !important; }
  .daw-section-heading { margin-top: 0.6rem !important; margin-bottom: 0.35rem !important; }
  .daw-open-row, .daw-kv-row { gap: 0.6rem !important; }
  .daw-open-row { grid-template-columns: 7rem 1fr !important; }
  .daw-kv-row { grid-template-columns: 7rem 1fr !important; }

  /* Replace buttons with their URLs for print */
  a.daw-btn, .daw-btn, .daw-btn-primary, .daw-btn-secondary {
    color: #000 !important;
    background: none !important;
    border: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
  }
  a.daw-btn .daw-btn-text::after,
  a.daw-btn-primary .daw-btn-text::after,
  a.daw-btn-secondary .daw-btn-text::after {
    content: " (" attr(href) ")";
    font-weight: normal;
  }
  /* Hide decorative button icons */
  .daw-btn-icon { display: none !important; }

  /* Ensure links show URLs when inside text too */
  .content-section a[href]::after,
  .daw-service-details a[href]::after { content: " (" attr(href) ")"; }

  /* In the header actions, show only the website link */
  .daw-archive-actions { display: block !important; margin-top: 0.5rem !important; }
  .daw-archive-actions .daw-btn-secondary { display: none !important; }

  /* Preserve organisation information: never hide org sections on print */
  .daw-provider-card,
  .daw-card-organization,
  .daw-service-keyinfo { display: block !important; }

  /* Compact spacing */
  .daw-service-details { padding-bottom: 0 !important; }
  .daw-service { padding: 0 !important; margin-bottom: 0.75rem !important; }
  .daw-service-content > div { padding: 0.5rem !important; margin-bottom: 0.5rem !important; border-left: 0 !important; }
  .daw-contact-item, .daw-location-item { padding: 0.5rem 0.6rem !important; }
  .daw-contact-list, .daw-location-list { gap: 0.5rem !important; }

  /* Remove container padding for print */
  .container { padding: 0 !important; }

  /* Avoid awkward page breaks within grouped elements */
  .daw-open-list, .daw-kv-list, .daw-contact-list, .daw-location-list { break-inside: avoid; page-break-inside: avoid; }

  /* Remove container padding for print */
  .container { padding: 0 !important; }
}

/* Tokens */
:root {
  --daw-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --daw-radius-sm: 0.275rem;
  --daw-radius-md: 0.25rem;
  --daw-radius-lg: 50vh;

  --daw-gap-sm: 0.625rem;
  --daw-gap-md: 1rem;

  --daw-shadow-sm: 0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.08);
  --daw-shadow-md: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.12);
  --daw-shadow-lg: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.16);

  --daw-primary: var(--primary, #007cba);
  --daw-primary-600: var(--primary-dark, #005a87);
  --daw-secondary: var(--secondary, #003a63);

  --daw-surface: #ffffff;
  --daw-surface-subtle: #f6f7f9;
  --daw-border: #dfe3e7;
  --daw-text: #1f2937;
  --daw-text-muted: #5b6470;

  --daw-success-bg: #e8f5e8;
  --daw-success-text: #2d5a2d;
  --daw-error-bg: #fff5f5; /* legacy red theme */
  --daw-error-text: #b71c1c;
  --daw-warning-bg: #FFF4D6; /* softer amber tint */
  --daw-warning-text: #5C4200; /* dark amber text for contrast */
  --daw-warning-border: #FFB81C; /* brand yellow border */

  --daw-focus: 0 0 0 0.1875rem rgba(0, 124, 186, 0.18);
}

/* Accessibility utilities */
.daw-sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Breadcrumbs */
.daw-breadcrumbs {
  font-family: var(--daw-font);
  color: var(--daw-text-muted);
  padding: 0.75rem 0; /* a bit more vertical space */
  margin: 0; /* sit snug under header */
  background: transparent;
  border-bottom: solid 1px var(--medium);
  text-transform: capitalize;
}

.daw-breadcrumbs .daw-breadcrumb-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.daw-breadcrumbs .daw-breadcrumb-item {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--daw-text-muted);
}

.daw-breadcrumbs .daw-breadcrumb-item + .daw-breadcrumb-item::before {
  content: "›";
  color: var(--daw-primary);
  margin: 0 0.25rem;
}

.daw-breadcrumbs a {
  color: var(--daw-text-muted);
  text-decoration: none;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

.daw-breadcrumbs a:hover {
  color: var(--daw-primary);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.daw-breadcrumbs a:focus-visible {
  outline: 2px solid var(--daw-primary);
  outline-offset: 2px;
  text-decoration: none;
}

.daw-breadcrumbs .daw-breadcrumb-item.is-current,
.daw-breadcrumbs .daw-breadcrumb-item.is-current span,
.daw-breadcrumbs .daw-breadcrumb-item.is-current a {
  color: var(--daw-text);
  font-weight: 600;
}

/* (removed legacy background caret on selects to avoid double icons) */

/* Scope base */
#daw-service-finder-app,
.filter-bar,
.daw-service-archive,
.daw-service-single {
  font-family: var(--daw-font);
  color: var(--daw-text);

  :is(a, button, input, select, textarea) {
    outline: none;

    &:focus-visible {
      box-shadow: var(--daw-focus);
    }
  }

  /* Global controls: inputs/selects/textarea */
  :is(
    input[type="text"],
    input[type="search"],
    input[type="email"],
    input[type="tel"],
    input[type="url"],
    input[type="number"],
    input[type="password"],
    select
  ) {
    appearance: none;
    -webkit-appearance: none;
    font: inherit;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    font-size: 0.8rem;
    font-family: var(--daw-font) !important;
    font-weight: 450 !important;
    height: 2.5rem;
    padding: 0 1rem;

    border: 0.0625rem solid var(--daw-border);
    border-radius: var(--daw-radius-md);
    background: #fff;
    color: var(--daw-text);

    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;

    &::placeholder {
      color: var(--daw-text-muted);
      opacity: 1;
    }

    &:hover { border-color: #c9cfd6; }
    &:focus { border-color: var(--daw-primary); box-shadow: var(--daw-focus); }
    &[disabled] { opacity: .6; cursor: not-allowed; }
  }

  select {
    cursor: pointer;
    background-image: none !important;
  }

  textarea {
    appearance: none;
    -webkit-appearance: none;
    font: inherit;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;

    min-height: 6rem;
    padding: 0.75rem 1rem;

    border: 0.0625rem solid var(--daw-border);
    border-radius: var(--daw-radius-md);
    background: #fff;
    color: var(--daw-text);
    resize: vertical;

    &::placeholder { color: var(--daw-text-muted); opacity: 1; }
    &:hover { border-color: #c9cfd6; }
    &:focus { border-color: var(--daw-primary); box-shadow: var(--daw-focus); }
    &[disabled] { opacity: .6; cursor: not-allowed; }
  }
}

/* Controls */
.daw-control {
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;

  height: 2.5rem;
  padding: 0 0.875rem;

  border: 0.0625rem solid var(--daw-border);
  border-radius: var(--daw-radius-md);
  background: #fff;
  color: var(--daw-text);

  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;

  &::placeholder {
    color: var(--daw-text-muted);
    opacity: 1;
  }

  &:hover {
    border-color: #c9cfd6;
  }

  &:focus {
    border-color: var(--daw-primary);
    box-shadow: var(--daw-focus);
  }

  &[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
  }
}

.daw-select { cursor: pointer; background-image: none !important; }

/* Wrapper that draws a caret regardless of select background overrides */
.daw-select-wrap {
  position: relative;
}
.daw-select-wrap select {
  padding-right: 2.6rem; /* ensure space for larger caret */
}
.daw-select-wrap::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 0.75rem;
  width: 0.9rem;
  height: 0.9rem;
  transform: translateY(-50%);
  pointer-events: none;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" fill="%23666"><path d="M480-361q-8 0-15-2.5t-13-8.5L268-556q-11-11-11-28t11-28q11-11 28-11t28 11l156 156 156-156q11-11 28-11t28 11q11 11 11 28t-11 28L508-372q-6 6-13 8.5t-15 2.5Z"/></svg>');
  background-size: 100% 100%;
  background-repeat: no-repeat;
}
.daw-select-wrap:has(select:focus)::after {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="http://www.w3.org/2000/svg" fill="%23007cba"><path d="M480-361q-8 0-15-2.5t-13-8.5L268-556q-11-11-11-28t11-28q11-11 28-11t28 11l156 156 156-156q11-11 28-11t28 11q11 11 11 28t-11 28L508-372q-6 6-13 8.5t-15 2.5Z"/></svg>');
}

/* Buttons */
:is(.daw-btn, .daw-btn-primary, .daw-btn-secondary) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  white-space: nowrap;
    font-family: var(--daw-font);
  height: 2.5rem;
  line-height: 1.2;
  padding: 0 1rem;
  border-radius: var(--daw-radius-lg);

  font-weight: 600;
  font-size: 0.875rem;

  border: 0.0625rem solid transparent;
  cursor: pointer;
  text-decoration: none;

  transition: transform 0.1s ease, box-shadow 0.2s ease, background-color 0.15s ease, border-color 0.15s ease;

  &:active {
    transform: translateY(0);
  }
}

.daw-btn-primary {
  background: var(--daw-primary);
  color: var(--primary-contrast-alt, #fff);
  border-color: var(--daw-primary);
  display: flex;
  align-items: center;
  justify-content: center;

  &:hover {
    background: var(--tertiary, var(--daw-primary-600));
    border-color: var(--tertiary, var(--daw-primary-600));
    box-shadow: 0 0.25rem 0.625rem rgba(0, 124, 186, 0.2);
    color: #fff;
  }
}

.daw-btn-secondary {
  background: #6c757d;
  color: #fff;
  border-color: #6c757d;

  &:hover {
    background: #545b62;
    border-color: #545b62;
    box-shadow: 0 0.25rem 0.625rem rgba(108, 117, 125, 0.2);
  }
}


/* Ensure inline SVG icons in secondary buttons inherit white */
.daw-btn-secondary svg { fill: currentColor; display: block; }
.daw-show-map-btn .daw-show-map-icon svg,
.daw-map-control-btn .daw-map-icon svg { width: 20px; height: 20px; }

/* Global button helpers for icon/text layout */
.daw-btn-text { flex: 0 0 auto; text-align: center; }
.daw-btn-icon { display: inline-flex; align-items: center; opacity: 0.9; }
.daw-btn-icon svg { width: 1.1rem; height: 1.1rem; fill: currentColor; display: block; }
.daw-btn-disabled {
  background: var(--daw-surface-subtle);
  color: var(--daw-text-muted);
  border-color: var(--daw-border);
  cursor: not-allowed;
  opacity: 0.6;
}

/* Archive header actions */
.daw-archive-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

/* Top Filter Bar */
.filter-bar {
  background: var(--daw-secondary);
  border-bottom: 0.125rem solid rgba(255, 255, 255, 0.15);
  padding: 1.2rem 0 1.45rem;
  margin-bottom: 1.5rem;
  border-bottom: solid 3px var(--tertiary);

  .daw-top-filters {
    display: flex;
    align-items: end;
    gap: var(--daw-gap-md);
    flex-wrap: wrap;
  }

  .daw-quick-filters {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--daw-gap-sm);
    flex: 1;
    min-width: 0;
  }

  .daw-filter-group {
    display: flex;
    flex-direction: column;
    min-width: 0;

    label {
      margin-bottom: 0.375rem;
      font-weight: 700;
      color: #fff;
      font-size: 0.85rem;
      line-height: 1.4;
      white-space: nowrap;
    }
  }

  /* Target the Search Services button specifically for tertiary hover */
  #daw-search-btn.daw-btn-primary:hover {
    background: var(--tertiary, var(--daw-primary-600));
    border-color: var(--tertiary, var(--daw-primary-600));
  }
}

@media (max-width: 64em) {
  .filter-bar {
    margin-bottom: 0; /* remove extra gap in stacked view */
    padding: 1.25rem 0; /* more breathing room in 2-col collapsed view */
    .daw-quick-filters {
      grid-template-columns: repeat(2, 1fr);
      /* Make the Search button group span both columns on 2-col layout */
      .daw-search-group { grid-column: 1 / -1; }
      /* Hide the empty label that was used for alignment */
      .daw-search-group > label { display: none; }
      /* Add a touch more space above the button in collapsed layout */
      .daw-search-group { margin-top: 0.5rem; }
    }
    /* Full-width Search button on 2-col layout */
    #daw-search-btn { width: 100%; }
  }
}

@media (max-width: 48em) {
  .filter-bar {
    margin-bottom: 0; /* keep flush spacing in 1-col stacked view */
    padding: 1.375rem 0; /* more vertical space in 1-col collapsed view */

    .daw-top-filters {
      flex-direction: column;
      align-items: stretch;
      gap: 0.75rem;
    }

    .daw-quick-filters {
      grid-template-columns: repeat(2, 1fr); /* keep 2 columns down to ~25rem */
      gap: 0.625rem;
      /* Extra space above full-width Search button */
      .daw-search-group { margin-top: 0.625rem; }
    }
    /* Full-width Search button on 1-col layout */
    #daw-search-btn { width: 100%; }
    /* Hide the empty label on 1-col layout as well */
    .daw-quick-filters .daw-search-group > label { display: none; }
  }
}

/* Below ~400px (25rem), collapse quick filters to 1 column */
@media (max-width: 25rem) {
  .filter-bar {
    .daw-quick-filters {
      grid-template-columns: 1fr;
    }
    #daw-search-btn { width: 100%; }
  }
}

/* Tweak top bar label icon alignment and tone (more precise centering) */
.filter-bar .daw-quick-filters .daw-filter-group > label {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}
.filter-bar .daw-quick-filters .daw-filter-group > label .daw-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  vertical-align: middle;
  opacity: 0.7; /* slightly reduced for a softer tone */
}

/* Utility: show only on desktop, hide when filters stack */
@media (max-width: 64em) {
  .filter-bar .daw-quick-filters .daw-search-group > label.daw-show-desktop-only { display: none !important; }
}

/* Layout */
.daw-finder-layout {
  display: grid;
  grid-template-columns: 17rem 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 64em) {
  .daw-finder-layout {
    grid-template-columns: 1fr; /* collapse to single column on mobile/tablet */
    padding: 1.375rem 0; /* more vertical space in 1-col collapsed view */
    gap: 1rem;
  }
}

/* Sidebar */
.daw-sidebar-filters {
  background: var(--daw-surface-subtle);
  padding: 0.8rem 1.125rem 1rem; /* per collapsed header spec */
  border-radius: var(--daw-radius-md);
  border: 0.0625rem solid var(--daw-border);
  position: static;
  margin-bottom: 0; /* per collapsed header spec */

  .daw-filters-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.25rem 0; /* symmetrical padding for vertical centering */
    min-height: 2rem; /* align with 2rem toggle button */
  }
  /* On mobile, show pointer over the whole header as the tap target */
  @media (max-width: 64em) {
    .daw-filters-head { cursor: pointer; }
  }
  .daw-filters-head h4 {
    margin: 0;
    color: var(--daw-text);
    font-size: 1rem;
    line-height: 1; /* per collapsed header spec */
    margin-top: 2px; /* subtle visual centering tweak */
  }
  .daw-filters-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: none;
    background: transparent;
    color: var(--daw-text-muted);
    cursor: pointer;
    border-radius: var(--daw-radius-md);
  }
  .daw-filters-toggle:hover { color: var(--daw-text); }
  .daw-filters-toggle:focus-visible { outline: 2px solid var(--daw-primary); outline-offset: 2px; }
  .daw-filters-toggle svg { transition: transform .2s ease; transform-origin: 50% 50%; }
  /* Rotate plus 45deg when expanded to form a close-like icon */
  &.is-expanded .daw-filters-toggle svg { transform: rotate(45deg); }

  /* Green rule that slides with the body */
  .daw-filters-body .daw-filters-rule {
    border: none;
    border-top: 1px solid var(--daw-primary);
    margin: 0.375rem 0 0.75rem 0; /* slightly less space above */
  }

  /* Let jQuery control visibility via inline styles; avoid CSS overrides */
  .daw-filters-body { overflow: hidden; }

  .daw-filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    margin-bottom: 0.875rem;
  }

  label {
    font-size: 0.9rem;
    color: var(--daw-text);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
  }
}

/* Mobile: tighter padding for stacked view */
@media (max-width: 64em) {
  .daw-sidebar-filters { padding: 0.6rem 1rem; }
}

/* Sidebar mobile/desktop visibility for toggle */
@media (max-width: 64em) {
  /* Toggle is visible on mobile */
  .daw-sidebar-filters .daw-filters-toggle { display: inline-flex; }
}

@media (min-width: 64.01em) {
  /* Hide the toggle button on desktop */
  .daw-sidebar-filters .daw-filters-toggle { display: none !important; }
}

/* Extra space above action buttons */
.daw-filter-actions {
  margin-top: 1.25rem;
}

/* Pagination */
.daw-pagination {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--daw-gap-sm);
  padding-top: 1.5rem;
  margin-top: 0.75rem;
  margin-bottom: 2rem;
  border-top: 0.0625rem solid var(--daw-border);
}

.daw-pagination > #daw-prev-page {
  justify-self: start;
}

.daw-pagination > #daw-next-page {
  justify-self: end;
}

.daw-pagination .daw-page-info {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--daw-text);
  font-weight: 600;
  font-size: 0.85rem;
}

.daw-page-input {
  width: 2.5rem;
  text-align: center;
  padding: 0 0.375rem;
}

/* Buttons in pagination use global .daw-btn styles (no override) */
/* Make pagination buttons a touch wider for easier tap targets */
.daw-pagination .daw-btn-primary,
.daw-pagination .daw-btn-secondary {
  padding-left: 1.125rem;
  padding-right: 1.125rem;
}

/* Strongly fade disabled pagination buttons */
.daw-pagination .daw-btn-primary[disabled],
.daw-pagination .daw-btn-secondary[disabled] {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
  filter: saturate(60%) contrast(0.9);
  box-shadow: none;
}

/* If a side button is missing, keep space by reserving grid track; grid already does this.
   On very small screens stack neatly */
@media (max-width: 30em) {
  .daw-pagination {
    grid-template-columns: auto 1fr auto;
    gap: 0.5rem;
  }
}

.daw-help-text {
  font-size: 0.8rem;
  color: var(--daw-text-muted);
  font-style: italic;
  line-height: 1;
  margin-top: 0.25rem; /* reduce space above help text (e.g., Age) */
}

/* Checkbox */
.daw-checkbox-group {
  display: grid;
  grid-template-columns: 1fr;
  gap: calc(0.1rem + 2px);

  .daw-checkbox-label {
    font-weight: 400;
    display: grid;
    grid-template-columns: 1.25rem auto;
    align-items: center;
    gap: calc(0.4rem - 4px);
    padding: 0.05rem 0; /* tighter vertical padding per row */
      border-radius: 0;
    cursor: pointer;

    /* Only highlight label text area on hover (not checkbox square) */
    &:hover .daw-checkbox-text {
      background: rgba(0, 124, 186, 0.08);
      border-radius: 0.25rem;
    }

    input[type="checkbox"],
    input[type="radio"] {
      appearance: none;
      -webkit-appearance: none;
      -moz-appearance: none;
  width: 1.25rem;
  height: 1.25rem;
      margin: 0;
      border: 0.0625rem solid var(--daw-border);
        border-radius: 0;
      background: #fff;
      display: grid;
      place-items: center;
      transition: border-color 0.15s ease, background-color 0.15s ease;

      &:hover {
        border-color: #c9cfd6;
      }

      &:focus-visible {
        box-shadow: var(--daw-focus);
      }

      &::after {
        content: "";
  width: 0.8rem;
  height: 0.8rem;
        /* Default uses check icon; radio will override shape with border-radius */
        mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 14"><path fill="currentColor" d="M5.2 10.1 2.4 7.3l-1 1 3.8 3.8L12.6 4.7l-1-1z"/></svg>') center/contain no-repeat;
        -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 14"><path fill="currentColor" d="M5.2 10.1 2.4 7.3l-1 1 3.8 3.8L12.6 4.7l-1-1z"/></svg>') center/contain no-repeat;
        background-color: transparent;
        opacity: 0;
        transition: opacity 0.1s ease;
      }

      &:checked {
        background: var(--daw-primary);
        border-color: var(--daw-primary);
      }

      &:checked::after {
        opacity: 1;
        background-color: #fff;
      }
    }

    /* Radio-specific tweaks: circular dot when selected */
    input[type="radio"] {
      border-radius: 50%;
    }
    input[type="radio"]::after {
      mask: none;
      -webkit-mask: none;
      width: 0.55rem;
      height: 0.55rem;
      border-radius: 50%;
      background-color: transparent;
    }
    input[type="radio"]:checked::after {
      background-color: #fff; /* white inner dot on primary background */
    }
  }

  .daw-checkbox-text {
    font-size: 0.9rem;
    color: var(--daw-text);
    font-weight: 400;
    line-height: 1.2;
    display: block;
    padding: 0.1rem 0.5rem; /* smaller vertical padding to reduce row height */
    transition: background-color 0.15s ease;
  }
}

/* Results info */
.daw-results-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  font-weight: 500;
  padding: 0.6rem 0;
  color: #334155;
  border-bottom: solid 1px var(--daw-border);

  & button {
    font-size: 0.75rem;
    padding: 0.2rem 1rem;
    height: 2rem;
  }

  & select {
    height: 2rem !important;
    font-size: 0.75rem !important;
    padding-right: 2.6rem !important; /* ensure room for caret */
  }
}

.daw-results-info .daw-results-sort .daw-select-wrap {
  position: relative;
}
.daw-results-info .daw-results-sort .daw-select-wrap .daw-select-leading-icon {
  position: absolute;
  left: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  color: var(--daw-text-muted);
  opacity: 0.85;
}
.daw-results-info .daw-results-sort select.daw-select {
  padding-left: 2.2em !important; /* adjusted space for leading icon */
}

#daw-results-count {
  &.loading::after {
    content: "";
    display: inline-block;
    width: 0.75rem;
    height: 0.75rem;
    margin-left: 0.5rem;
    border: 0.125rem solid #d0d7de;
    border-top: 0.125rem solid #64748b;
    border-radius: 50%;
    animation: daw-spin 1s linear infinite;
    vertical-align: -0.125rem;
  }
}

.daw-results-controls {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  flex-wrap: wrap;
}

.daw-results-sort {
  display: flex;
  align-items: center;
  gap: 0.5rem;

  label {
    font-size: 0.9rem;
    color: var(--daw-text);
    font-weight: 600;
    white-space: nowrap;
  }

  select {
    /* Keep pill look, inherit global sizing */
    border-radius: 1.125rem;
    min-width: 11.25rem;
  }
}

@media (max-width: 48em) {
  .daw-results-info {
    flex-direction: column;
    gap: 0.625rem;
    text-align: center;
    border-bottom: none; /* remove border on mobile only */
    /* mobile margin adjustment */
    margin-bottom: 0.5rem;
  }

  .daw-results-sort select {
    min-width: 8.75rem;
  }
}

/* Mobile: tidy results info bar */
@media (max-width: 640px) {
  #daw-results-info { align-items: flex-start; gap: 0.5rem; padding: 0.5rem 0; }
  #daw-results-count { font-size: 0.875rem; }
  /* Hide the Show/Hide Map toggle on mobile */
  #daw-show-map-results { display: none !important; }
  /* Spread Expand Map and Sort across the row */
  .daw-results-info .daw-results-controls {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
  }
}

/* Map */
.daw-map-container {
  display: block;
  margin-bottom: 1rem;
}

.daw-services-map {
  height: 23.75rem;
  width: 100%;
  border-radius: var(--daw-radius-md);
  background: #f5f5f5;
  box-shadow: var(--daw-shadow-sm);
  position: relative;
}

/* Ensure Leaflet controls (incl. attribution) are positioned relative to the map */
#daw-services-map .leaflet-control-container { position: absolute !important; top: 0 !important; right: 0 !important; bottom: 0 !important; left: 0 !important; }
#daw-services-map .leaflet-bottom { position: absolute !important; bottom: 0 !important; }
#daw-services-map .leaflet-right { position: absolute !important; right: 0 !important; }
#daw-services-map .leaflet-control { pointer-events: auto !important; }

.daw-services-map.compact {
  height: 10rem;
}

.daw-services-map.loading {
  opacity: 0.25;
  transition: opacity 0.2s ease;
  animation: daw-pulse 0.9s ease-in-out infinite;
  will-change: opacity;
}

.daw-services-map.expanded {
  width: 100% !important;
  height: 100% !important;
  margin: 0;
  border-radius: var(--daw-radius-md);
  box-shadow: var(--daw-shadow-lg);
}

/* Fixed portal container used when map is expanded */
.daw-map-portal {
  position: fixed;
  top: 2rem;
  left: 2rem;
  width: calc(100vw - 4rem);
  height: calc(100vh - 4rem);
  z-index: 10001;
}

@media (max-width: 48em) {
  .daw-services-map {
    height: 18.75rem;
  }
  .daw-map-portal {
    top: 1rem;
    left: 1rem;
    width: calc(100vw - 2rem);
    height: calc(100vh - 2rem);
  }
}

/* (removed legacy caret override blocks to prevent double icons) */

.daw-map-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--daw-shadow-md);
  font-size: 1.375rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 0.1s ease, box-shadow 0.2s ease;
  z-index: 10002;
}

.daw-map-close:hover {
  transform: scale(1.06);
  box-shadow: var(--daw-shadow-lg);
}

.daw-map-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 10000;
  display: none;
  cursor: pointer;
}

.daw-map-overlay.active {
  display: block;
}

body.daw-no-scroll {
  overflow: hidden;
}

/* Branded map markers and clusters */
.daw-marker-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary, var(--daw-primary));
  border: 2px solid #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
  display: grid;
  place-items: center;
}

.daw-marker-dot svg { fill: #fff; display: block; }

.daw-user-marker-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgb(108, 117, 125);
  border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.daw-cluster-icon { background: transparent; border: none; }
.daw-cluster-badge {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: #fff;
  font-weight: 700;
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
.daw-cluster-badge span { font-size: 0.8rem; line-height: 1; }
.daw-cluster-badge.digits-3 span { font-size: 0.72rem; }
.daw-cluster-badge.digits-4 span { font-size: 0.64rem; letter-spacing: -0.02em; }
.daw-cluster-badge.daw-primary { background: var(--primary, var(--daw-primary)); }
.daw-cluster-badge.daw-secondary { background: var(--secondary, var(--daw-secondary)); }
.daw-cluster-badge.daw-tertiary { background: var(--tertiary, #F59E0B); }

.daw-map-controls {
  position: absolute;
  top: 0.625rem;
  right: 0.625rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;

  .daw-map-control-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    padding: 0.375rem 0.625rem;
    background: rgba(255, 255, 255, 0.96);
    border: 0.0625rem solid #cfd6dd;
    color: #333;
    border-radius: 0.25rem;
    transition: transform 0.1s ease, box-shadow 0.2s ease, background-color 0.15s ease;
    white-space: nowrap;
    box-shadow: var(--daw-shadow-sm);
  }
}

.daw-map-controls .daw-map-control-btn:hover {
  background: #fff;
  transform: translateY(-0.0625rem);
  box-shadow: var(--daw-shadow-md);
}

/* Cards */
.daw-services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
  transition: opacity 0.2s ease;

  &.loading {
    opacity: 0.25;
    pointer-events: none;
    animation: daw-pulse 0.9s ease-in-out infinite;
    will-change: opacity;
  }
}

@media (max-width: 48em) {
  .daw-services-grid {
    grid-template-columns: 1fr;
    gap: 0.875rem;
  }
}

/* Pulse keyframes for loading fade */
@keyframes daw-pulse {
  0% { opacity: 0.2; }
  50% { opacity: 0.6; }
  100% { opacity: 0.2; }
}

.daw-service-card {
  background: var(--daw-surface);
  border: 0.0625rem solid var(--daw-border);
  border-radius: var(--daw-radius-md);
  padding: 1.125rem;
  box-shadow: none;
  transition: none;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
  padding-bottom: 0; /* ensure footer sits at the bottom without gap */
}

.daw-card-bottom {
  margin-top: auto; /* anchor bottom section to the bottom */
}

.daw-card-header {
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 0.0625rem solid var(--daw-border);
}

.daw-card-distance {
  color: var(--daw-text-muted);
  font-size: 0.875rem;
  margin: 0.25rem 0 0.5rem 0;
}

.daw-card-title {
  margin: 0;
  font-size: 1.125rem;
  line-height: 1.25;
  text-wrap: pretty !important;

  a {
    color: var(--daw-primary);
    text-decoration: none;
    text-underline-offset: 0.18em;
    transition: text-decoration-color 0.15s ease, color 0.15s ease;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;

    &:hover {
      text-decoration: underline;
    }

    &:focus-visible {
      outline: 2px solid var(--daw-primary);
      outline-offset: 2px;
      text-decoration: none;
    }
  }
}

.daw-card-organization {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.375rem;
  color: var(--daw-text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  margin-top: 0.25rem;
  margin-bottom: 0.25rem;
  min-width: 0; /* allow children to shrink for ellipsis */
  overflow: visible; /* avoid clipping text descenders */
  /* Keep org text nice and tight */
  

  .daw-card-org-left {
    display: inline-flex;
    align-items: center; /* center favicon and text vertically */
    gap: 0.375rem;
    min-width: 0;
    flex: 1 1 auto;
  }

  .daw-service-favicon,
  .daw-service-placeholder {
    width: 1rem;
    height: 1rem;
    margin: 0;
  }

  a {
    color: var(--daw-text-muted);
    text-decoration: none;
    text-underline-offset: 0.15em;
    transition: color 0.15s ease, text-decoration-color 0.15s ease;
    line-height: 1.3; /* slightly taller to prevent clipping */
    padding-bottom: 1px; /* micro-adjust to preserve descenders */

    &:hover {
      color: var(--daw-primary);
      text-decoration: underline;
    }

    &:focus-visible {
      outline: 2px solid var(--daw-primary);
      outline-offset: 2px;
      text-decoration: none;
    }
  }
}

/* Truncate organisation name to a single line with ellipsis */
.daw-card-organization .daw-card-org-left { min-width: 0; }
.daw-card-organization .daw-card-org-left a {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
  width: 100%;
}

/* Ensure the status badge aligns to the top of the organisation row */
.daw-card-organization .daw-status-badge {
  align-self: center;
  margin-top: 0; /* keep flush alignment */
  padding-top: 0.3rem;
  padding-bottom: 0.3rem;
}

.daw-card-content {
  margin-bottom: 0.875rem;
  line-height: 1.55;
  color: var(--daw-text);
  font-size: 0.875rem; /* slightly smaller */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  -webkit-line-clamp: 4; /* clamp to 4 lines */
  line-clamp: 4;
  text-overflow: ellipsis;
}

.daw-card-meta {
  margin-bottom: 0.875rem;

  > div {
    margin-bottom: 0.375rem;
    font-size: 0.9rem;
  }
}


/* Service Finder: Chips */
.daw-card-tags {
	margin-top: 0.5rem; /* reduced top space */
	display: flex;
	flex-direction: column;
	gap: 0.5rem; /* slightly tighter rows */
}

.daw-tags-group {
	display: flex;
	flex-direction: column;
	gap: 0.25rem; /* reduce space between label and chips */
}

.daw-tags-label {
	font-size: 0.7rem;
	line-height: 1.1;
    font-weight: 500;
	color: #231f20;
	opacity: 0.85; /* slightly toned down */
	text-transform: capitalize; /* capitalize each word */
}

.daw-tags-container {
	display: flex;
	flex-wrap: wrap;
	gap: 0.3rem 0.3rem; /* slightly tighter chip gaps */
	margin-bottom: 0.25rem; /* small space after each row */
}

.daw-tag {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  background: transparent; /* outlined by default */
  border-radius: 999px;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
  border: 0.0625rem solid currentColor; /* border follows text color */
  text-transform: capitalize; /* Title case chips */
}

.daw-tag--sm {
  font-size: 0.7rem;
  line-height: 1;
  padding: 0.2rem 0.5rem;
}

.daw-tag:hover, .daw-tag:focus { text-decoration: none; }

/* Outlined chips by row: text + border color, fill on hover/focus */
.daw-tags-areas .daw-tag { color: var(--primary); background: transparent; }
.daw-tags-services .daw-tag { color: var(--secondary); background: transparent; }
.daw-tags-circumstances .daw-tag { color: var(--tertiary); background: transparent; }

.daw-tags-areas .daw-tag:hover,
.daw-tags-areas .daw-tag:focus-visible { background: var(--primary); color: #fff; }
.daw-tags-services .daw-tag:hover,
.daw-tags-services .daw-tag:focus-visible { background: var(--secondary); color: #fff; }
.daw-tags-circumstances .daw-tag:hover,
.daw-tags-circumstances .daw-tag:focus-visible { background: var(--tertiary); color: #fff; }

/* Active chips: solid fill same as hover */
.daw-tags-areas .daw-tag.is-active { background: var(--primary); color: #fff; }
.daw-tags-services .daw-tag.is-active { background: var(--secondary); color: #fff; }
.daw-tags-circumstances .daw-tag.is-active { background: var(--tertiary); color: #fff; }

/* Ensure readable focus outline on dark chips */
.daw-tag:focus { outline: 2px solid rgba(255,255,255,0.75); outline-offset: 2px; }

/* Hidden tags (collapsed state) */
.daw-tag.daw-tag-hidden { display: none !important; }

/* +X more button */
.daw-tag-more {
  cursor: pointer;
  border: 1px solid currentColor;
  font-weight: 500;
}
.daw-tags-services .daw-tag-more { color: var(--secondary); }
.daw-tags-circumstances .daw-tag-more { color: var(--tertiary); }
.daw-tags-services .daw-tag-more:hover { background: var(--secondary); color: #fff; }
.daw-tags-circumstances .daw-tag-more:hover { background: var(--tertiary); color: #fff; }

/* Card enhancements for redesigned template */
.daw-card-identity {
  display: block;
  margin-bottom: 0.375rem;
}

.daw-service-favicon,
.daw-service-placeholder {
  flex-shrink: 0;
}

.daw-service-placeholder {
  background: var(--daw-surface-subtle);
  border-radius: var(--daw-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
}

.daw-card-title-group {
  flex: 1;
  min-width: 0;
}

.daw-card-status {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex-wrap: wrap;
  margin-top: 0.25rem;
  margin-bottom: 0.25rem;
}

.daw-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem 0.25rem; /* reduced top & bottom equally */
  border-radius: var(--daw-radius-lg);
  font-size: 0.64rem; /* slightly smaller font */
  font-weight: 600;
  line-height: 1 !important;
  white-space: nowrap; /* never wrap status label */
  border: 0.0625rem solid transparent; /* set per-status */
  margin-top: 4px; /* subtle top alignment tweak */
}

.daw-status-badge.status-open {
  color: var(--daw-success-text);
  background: var(--daw-success-bg);
  border-color: rgba(45, 90, 45, 0.35);
}

.daw-status-badge.status-closed {
  color: var(--daw-warning-text);
  background: var(--daw-warning-bg);
  border-color: var(--daw-warning-border);
}

/* Fill on hover/focus, similar to chips */
.daw-status-badge.status-open:hover,
.daw-status-badge.status-open:focus-visible {
  background: #dff0df; /* slightly stronger on hover */
}
.daw-status-badge.status-closed:hover,
.daw-status-badge.status-closed:focus-visible {
  background: #FFE8A6; /* slightly stronger amber on hover */
}

/* Keep badge links from adopting global link hover styles */
a.daw-status-badge,
a.daw-status-badge:hover,
a.daw-status-badge:focus,
a.daw-status-badge:active {
  text-decoration: none !important;
  color: inherit; /* keep the status-set color */
}

.daw-status-indicator {
  width: 0.3rem;
  height: 0.3rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-open .daw-status-indicator {
  background: currentColor;
  opacity: 0.8;
}

.status-closed .daw-status-indicator {
  background: currentColor;
  opacity: 0.8;
}

.daw-distance-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  background: var(--daw-surface-subtle);
  border-radius: var(--daw-radius-lg);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--daw-text-muted);
}

.daw-card-info {
  margin-bottom: var(--daw-gap-sm);
}

.daw-info-grid {
  display: grid;
  gap: 0; /* remove inter-row gap; padding handles spacing */
  font-size: 0.75rem; /* smaller table content */
}

.daw-info-item {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 0.5rem; /* ensure gap between label and value */
  align-items: start;
  padding: 0.25rem 0;
}

.daw-info-item:not(:last-child) {
  border-bottom: 0.0625rem solid var(--daw-border); /* match card border color */
}

/* Add top border to the first row and bottom border to the last row */
.daw-info-grid > .daw-info-item:first-child { border-top: 0.0625rem solid var(--daw-border); }
.daw-info-grid > .daw-info-item:last-child { border-bottom: 0.0625rem solid var(--daw-border); }

.daw-info-label {
  font-weight: 500;
  color: var(--daw-text-muted);
  text-align: right; /* align label to the right edge of its column */
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}
/* Global icon utilities */
.daw-icon { display: inline-flex; align-items: center; justify-content: center; line-height: 0; vertical-align: middle; }
.daw-icon svg { width: 1rem; height: 1rem; fill: currentColor; display: block; }

/* Contextual icon colors */
/* Service card info table: use primary to highlight */
.daw-card-info .daw-info-item .daw-icon { color: var(--daw-primary); }
/* Sidebar labels: use muted color to fade */
.daw-sidebar-filters .daw-filter-group > label .daw-icon { color: var(--daw-text-muted); opacity: 0.7; }

/* Inline icon helpers for labels */
.daw-icon { display: inline-flex; align-items: center; justify-content: center; line-height: 0; vertical-align: -0.125em; }
.daw-icon svg { width: 1rem; height: 1rem; fill: currentColor; display: block; }
.daw-info-item.daw-info-age .daw-info-label { text-align: right; }

.daw-info-value {
  font-weight: 600;
  color: var(--daw-text);
  min-width: 0; /* allow truncation within grid */
  text-align: right; /* keep row contents right aligned */
}

/* Truncate long cost text to a single line */
.daw-info-cost-value {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  text-overflow: ellipsis;
  max-width: 100%;
}

.daw-card-areas {
  margin-bottom: var(--daw-gap-md);
  font-size: 0.875rem;
  color: var(--daw-text-muted);
}

.daw-areas-label {
  font-weight: 500;
  margin-right: 0.5rem;
}

.daw-area-link {
  color: var(--daw-primary);
  text-decoration: none;
  
  &:hover {
    text-decoration: underline;
  }
}

.daw-areas-more {
  font-weight: 500;
  opacity: 0.7;
}

.daw-card-tags {
  margin-bottom: 0.75rem; /* a bit more space below chips before footer */
}

/* Remove bottom margin on the last content block so footer sits at bottom */
.daw-service-card > :where(.daw-card-content, .daw-card-info, .daw-card-areas, .daw-card-tags):last-of-type {
  margin-bottom: 0;
}

.daw-tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  align-items: center;
}

.daw-tags-row { margin-top: 0.25rem; }
.daw-tags-row:first-child { margin-top: 0; }

.daw-tag--sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.65rem;
  line-height: 1;
  border-radius: var(--daw-radius-sm);
}

.daw-tag {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: var(--daw-radius-lg);
  font-size: 0.75rem;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid currentColor; /* border follows text color */
  text-transform: capitalize; /* Title case chips */
}

/* Ensure small chips remain small even if base `.daw-tag` sets a size later */
.daw-tag.daw-tag--sm {
  font-size: 0.65rem;
  line-height: 1;
  padding: 0.3rem 0.5rem;
}

/* Single Service: Layout */
.daw-service-details { margin-top: 0; padding-bottom: 3.5rem; }
.daw-service-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--daw-gap-lg, 1.5rem);
  align-items: start;
}
@media (min-width: 64em) {
  .daw-service-layout { grid-template-columns: minmax(0, 1fr) 22rem; }
}
.daw-service-main { min-width: 0; }
.daw-service-aside { min-width: 0; }

/* Provider card (sidebar) */
.daw-aside-card {
  border: 1px solid var(--daw-border, #e1e5ea);
  border-radius: 8px;
  padding: 1rem;
  background: var(--daw-surface-subtle);
}

.daw-provider-card h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1rem;
  color: var(--daw-primary);
}
.daw-provider-header { margin-bottom: 0.75rem; }
.daw-provider-name a { color: var(--daw-text); }
.daw-provider-name { margin-top: 0.125rem; }

.daw-provider-name a {
  font-weight: 600;
  color: var(--daw-text);
  text-decoration: none;
}
.daw-provider-name a:hover { text-decoration: underline; }
.daw-provider-name { display: inline-flex; align-items: center; gap: 0.4rem; }
.daw-provider-icon { display: inline-flex; color: var(--daw-text-muted); }
/* Match provider favicon size to org favicon on cards */
.daw-provider-name .daw-service-favicon { width: 1rem; height: 1rem; margin: 0; }

.daw-provider-desc {
  margin: 0.5rem 0 0.75rem;
  color: var(--daw-text-muted);
  line-height: 1.5;
  font-size: 0.9375rem; /* slightly smaller */
}

/* Other services list in provider card */
.daw-org-services-block { margin-top: 0.75rem; }
.daw-org-services-title {
  margin: 0 0 0.5rem 0;
  font-size: 0.95rem;
  color: var(--daw-text);
}
.daw-org-services {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.25rem;
}
.daw-org-services li { padding: 0.25rem 0; border-bottom: 1px dashed var(--daw-border); }
.daw-org-services li:last-child { border-bottom: 0; }
.daw-org-service-link {
  color: var(--daw-primary);
  text-decoration: none;
}
.daw-org-service-link:hover { text-decoration: underline; }

.daw-provider-actions { margin: 1rem 0 1.25rem; }

.daw-org-meta { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.4rem; }
.daw-org-item { color: var(--daw-text); }
.daw-org-item a { color: var(--daw-primary); text-decoration: none; }
.daw-org-item a:hover { text-decoration: underline; }

/* Sections */
.daw-section { margin-top: 1.25rem; }
.daw-section:first-child { margin-top: 0; }

/* Contacts */
.daw-contact-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.75rem; }
.daw-contact-item {
  border: 0.0625rem solid var(--daw-border);
  border-radius: var(--daw-radius-md);
  padding: 0.75rem 1rem;
  background: var(--daw-surface, #fff);
}
.daw-contact-name { font-weight: 600; margin-bottom: 0.25rem; color: var(--daw-text); }
.daw-contact-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.daw-contact-tel a, .daw-contact-email a { color: var(--daw-primary); text-decoration: none; }
.daw-contact-tel a:hover, .daw-contact-email a:hover { text-decoration: underline; }

/* Opening times */
.daw-open-status { margin: 0.25rem 0 0.75rem; }
.daw-opening-table { width: 100%; border-collapse: separate; border-spacing: 0 6px; }
.daw-opening-table th, .daw-opening-table td { padding: 0.5rem 0.6rem; }
.daw-opening-table th { text-align: left; width: 9rem; }
.daw-opening-table tr { background: var(--daw-surface-subtle); }
.daw-opening-table tr.is-today th { font-weight: 700; }
.daw-opening-table tr > th:first-child { border-radius: 6px 0 0 6px; }
.daw-opening-table tr > td:last-child { border-radius: 0 6px 6px 0; }

/* Opening times — modern list layout */
.daw-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1.75rem;
  margin-bottom: 1rem;
}
.daw-section > h3 { margin-top: 1.25rem; }
.daw-section-heading h3 { margin: 0; }
.daw-section-heading .daw-open-status { margin: 0; }

.daw-open-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 0.0625rem solid var(--daw-border);
  border-radius: var(--daw-radius-md);
  background: var(--daw-surface, #fff);
}
.daw-open-row {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: 1rem;
  padding: 0.6rem 0.8rem;
  border-top: 0.0625rem solid var(--daw-border);
}
.daw-open-row:first-child { border-top: 0; }
.daw-open-row.is-today {
  background: var(--daw-surface-subtle);
  font-weight: 700;
  color: var(--daw-primary);
}
.daw-open-row.is-today .daw-open-day { color: var(--daw-primary); }
.daw-open-row.is-closed { color: var(--daw-text-muted); }
.daw-open-row.is-closed .daw-open-day { color: var(--daw-text-muted); }
.daw-open-day { color: var(--daw-text-muted); }
.daw-open-times { color: var(--daw-text); }

/* Larger badge variant for headings */
.daw-status-badge.daw-status-badge--lg {
  font-size: 0.85rem;
  padding: 0.28rem 0.7rem; /* more side padding on single */
  line-height: 1; /* crisp vertical alignment */
}
.daw-status-badge.daw-status-badge--lg .daw-status-indicator { display: none; }

@media (max-width: 640px) {
  .daw-open-row { grid-template-columns: 6.5rem 1fr; }
}

/* Key information list, matching opening-times aesthetics */
.daw-kv-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 0.0625rem solid var(--daw-border);
  border-radius: var(--daw-radius-md);
  background: var(--daw-surface, #fff);
}
.daw-kv-row {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: 1rem;
  padding: 0.6rem 0.8rem;
  border-top: 0.0625rem solid var(--daw-border);
}
.daw-kv-row:first-child { border-top: 0; }
.daw-kv-label { color: var(--daw-text-muted); }
.daw-kv-value { color: var(--daw-text); }
@media (max-width: 640px) {
  .daw-kv-row { grid-template-columns: 6.5rem 1fr; }
}

/* Locations & map */
.daw-service-locations .daw-single-map {
  height: 450px;
  border: 0.0625rem solid var(--daw-border);
  border-radius: var(--daw-radius-md);
  margin: 0.5rem 0 1rem;
}
.daw-location-list { display: grid; gap: 0.75rem; }
.daw-location-item {
  border: 0.0625rem solid var(--daw-border);
  border-radius: var(--daw-radius-md);
  padding: 0.75rem 1rem;
  background: var(--daw-surface, #fff);
}
.daw-location-name { font-weight: 600; margin-bottom: 0.25rem; color: var(--daw-text); }
.daw-location-address { white-space: pre-line; }
.daw-location-postcode { margin-top: 0.25rem; }

/* Large chips for single page */
.daw-tag.daw-tag--lg { font-size: 0.875rem; line-height: 1.1; padding: 0.4rem 0.7rem; }

.daw-tag-service-type {
  background: var(--daw-surface-subtle);
  color: var(--daw-primary);
  border-color: var(--daw-border);
  
  &:hover {
    background: var(--daw-primary);
    color: var(--daw-surface);
    text-decoration: none;
  }
}

/* Areas chips use secondary tone */
.daw-tag-areas {
  background: var(--daw-surface-subtle);
  color: var(--daw-secondary);
  border-color: var(--daw-border);
}
.daw-tags-areas .daw-tag-areas:hover { background: var(--daw-secondary); color: var(--daw-surface); }

.daw-tag-circumstances {
  background: var(--daw-surface-subtle);
  color: var(--daw-secondary);
  border-color: var(--daw-border);
  
  &:hover {
    background: var(--daw-secondary);
    color: var(--daw-surface);
    text-decoration: none;
  }
}

/* Services row already uses primary via .daw-tag-service-type */
.daw-tags-services { margin-top: 0.25rem; }
.daw-tags-circumstances { margin-top: 0.25rem; }

.daw-tags-toggle {
  appearance: none;
  background: var(--daw-surface-subtle);
  color: var(--daw-text-muted);
  border: 0.0625rem solid var(--daw-border);
  border-radius: var(--daw-radius-lg);
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  
  &:hover {
    background: var(--daw-border);
    color: var(--daw-text);
  }
}

.daw-tags-hidden {
  margin-top: 0.375rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.daw-card-footer {
  margin-top: auto;
  margin-left: -1.125rem;
  margin-right: -1.125rem;
  padding: var(--daw-gap-md) 1.125rem 1.125rem;
  border-top: 0.0625rem solid var(--daw-border);
  background: var(--light, var(--daw-surface-subtle));
  border-bottom-left-radius: var(--daw-radius-md);
  border-bottom-right-radius: var(--daw-radius-md);
}

.daw-card-distance-bar {
  margin: 0 -1.125rem 0; /* align to card edges */
  padding: 0.5rem 1.125rem;
  background: var(--daw-surface-subtle);
  border-top: 0.0625rem solid var(--daw-border);
  color: var(--daw-text-muted);
  font-weight: 600;
  font-size: 0.8125rem;
}

/* Footer naturally follows distance bar inside bottom container */

.daw-card-distance-bar .daw-distance-text {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.daw-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--daw-gap-sm);
}

/* Add a little breathing room between chips and the bottom section */
.daw-card-bottom {
  margin-top: auto;
  padding-top: 0.5rem;
}

/* (using global .daw-btn styles above to avoid duplication) */

/* Mobile responsive adjustments */
@media (max-width: 480px) {
  .daw-card-actions {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  
  .daw-btn {
    font-size: 0.8125rem;
    padding: 0.5rem 0.75rem;
    min-height: 2.5rem;
  }
  
  .daw-card-identity {
    gap: 0.5rem;
  }
  
  .daw-info-grid {
    font-size: 0.8125rem;
  }
}

/* Status */
.daw-service-status {
  display: inline-block;
  padding: 0.625rem 0.875rem;
  border-radius: 9999rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;

  &.status-active {
    background: #d4edda;
    color: #155724;
    border: 0.0625rem solid #c3e6cb;
  }

  &.status-inactive {
    background: #f8d7da;
    color: #721c24;
    border: 0.0625rem solid #f5c6cb;
  }
}

/* Single & Archive: layout handled by theme containers */

.daw-service {
  background: var(--daw-surface);
  border-radius: var(--daw-radius-md);
  padding: 1.375rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--daw-shadow-sm);
}

.daw-service-header {
  border-bottom: 0.125rem solid var(--daw-primary);
  padding-bottom: 0.875rem;
  margin-bottom: 1.25rem;
}

.daw-service-title {
  margin: 0 0 0.5rem 0;
  color: var(--daw-primary);
  font-size: 2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.daw-service-content {
  > div {
    margin-bottom: 1.25rem;
    padding: 1rem;
    background: var(--daw-surface-subtle);
    border-radius: var(--daw-radius-sm);
    border-left: 0.25rem solid var(--daw-primary);
  }

  h3 {
    margin: 0 0 0.625rem 0;
    color: var(--daw-primary);
    font-size: 1.25rem;
  }

  h4 {
    margin: 0.5rem 0;
    color: var(--daw-text);
  }
}

.daw-contact,
.daw-location {
  background: #fff;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
  border-radius: var(--daw-radius-sm);
  border: 0.0625rem solid var(--daw-border);
}

.daw-schedule-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: 0.95rem;

  th,
  td {
    padding: 0.625rem;
    text-align: left;
    border-bottom: 0.0625rem solid var(--daw-border);
  }

  th {
    background: var(--daw-primary);
    color: #fff;
    font-weight: 600;
  }
}

/* Archive header & pagination */
.daw-archive-header {
  text-align: center;
  margin-bottom: 1.75rem;
  padding-bottom: 0.875rem;
  border-bottom: 0.125rem solid var(--daw-primary);
}

.daw-archive-title {
  color: var(--daw-primary);
  font-size: 2.2rem;
  margin-bottom: 0.625rem;
}

.daw-archive-pagination {
  display: flex;
  justify-content: center;
  margin-top: 1.75rem;

  .page-numbers {
    display: inline-block;
    padding: 0.5rem 0.75rem;
    margin: 0 0.3125rem;
    background: #fff;
    border: 0.0625rem solid var(--daw-border);
    color: var(--daw-primary);
    text-decoration: none;
    border-radius: var(--daw-radius-sm);

    &:hover,
    &.current {
      background: var(--daw-primary);
      color: #fff;
    }
  }
}

/* States */
.daw-no-services {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--daw-text-muted);
}

.daw-no-services .daw-no-services-actions {
  margin-top: 0.75rem;
  display: flex;
  justify-content: center;
}

.daw-no-services .daw-clear-filters-inline {
  margin-top: 0.5rem;
}

/* Empty state illustration */
.daw-empty-illustration-wrap {
  max-width: 320px;
  margin: 0 auto 1rem;
}
.daw-empty-illustration {
  width: 100%;
  height: auto;
  display: block;
}

/* Lighten primary for empty state without hardcoding a hex; fallback if no var */
:root {
  --daw-empty-primary: color-mix(in oklab, var(--daw-primary, #0366d6) 90%, white 10%);
}

.daw-error {
  border-left: 0.25rem solid #dc3545;
  background: var(--daw-error-bg);
  color: var(--daw-error-text);
}

.daw-loading {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--daw-text-muted);
  font-style: italic;
}

#daw-postcode.error {
  border-color: #dc3545 !important;
  background: var(--daw-error-bg);
  animation: daw-shake 0.45s ease-in-out;
}

@keyframes daw-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-0.25rem);
  }
  75% {
    transform: translateX(0.25rem);
  }
}

/* Favicon */
.daw-service-favicon {
  display: inline-block;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 0.25rem;
  background: #f8f9fa;
  padding: 0.125rem;
  border: 0.0625rem solid #e9ecef;
  vertical-align: middle;
}

.daw-service-favicon[src=""],
.daw-service-favicon:not([src]) {
  display: none;
}

/* Leaflet popups - minimal service card style */
.leaflet-popup-content-wrapper {
  background: var(--daw-surface) !important;
  border: 0.0625rem solid var(--daw-border) !important;
  border-radius: var(--daw-radius-sm) !important;
  box-shadow: none !important;
}

/* Page Toolbar */
.daw-page-toolbar {
  border-top: 1px solid var(--daw-border);
  background: var(--daw-surface);
  margin-top: 2rem;
  padding: 1rem 0; /* ensure ample vertical spacing */
}
.daw-page-toolbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
}
.daw-toolbar-meta {
  color: var(--daw-text-muted);
  font-size: 0.875rem;
}
.daw-toolbar-actions a {
  color: var(--daw-primary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
}
.daw-toolbar-actions a:hover { text-decoration: underline; }
.daw-toolbar-actions .daw-btn-icon { line-height: 0; display: inline-flex; }
.daw-toolbar-actions .daw-btn-icon svg { width: 1rem; height: 1rem; display: block; }
/* Toolbar buttons layout */
.daw-toolbar-actions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.daw-toolbar-actions .daw-btn { height: 2.25rem; padding: 0 0.9rem; font-size: 0.9rem; }
.daw-toolbar-actions .daw-btn .daw-btn-icon { display: inline-flex; margin-right: 0.4rem; }
@media (max-width: 640px) {
  .daw-page-toolbar .container { flex-direction: column; align-items: flex-start; }
}

/* Sidebar return link spacing */
.daw-sidebar-return { margin-top: 0.75rem; }

/* Single page map height */
.daw-single-map { height: 450px; }
.leaflet-popup-tip {
  background: var(--daw-surface) !important;
  border: 0.0625rem solid var(--daw-border) !important;
}

.leaflet-popup-content {
  margin: 0.75rem 0.875rem;
  line-height: 1.4;
  min-width: 12.5rem;
  max-width: 16.25rem;
}

.daw-map-popup-title {
  margin: 0 0 0.375rem 0;
  font-size: 1rem;
  line-height: 1.25;
  font-weight: 700;
  color: var(--daw-text) !important;
}
.daw-map-popup-title a {
  color: var(--daw-primary) !important;
  text-decoration: none !important;
  text-underline-offset: 0.18em !important;
}
.daw-map-popup-title a:hover {
  text-decoration: underline !important;
}

.daw-map-popup-distance {
  color: var(--daw-text-muted);
  font-size: 0.8125rem;
  margin: 0 0 0.375rem 0;
}

.daw-map-popup-org {
  color: var(--daw-text-muted) !important;
  font-size: 0.8125rem;
  margin: 0 0 0.375rem 0;
}

.daw-map-popup-link {
  margin-top: 0.25rem;
  color: var(--daw-primary) !important;
  font-weight: 700 !important;
  text-decoration: none !important;
  font-size: 0.875rem !important;
  text-underline-offset: 0.18em !important;
}
.daw-map-popup-link:hover {
  text-decoration: underline !important;
}

/* Animations */
@keyframes daw-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Schedule info icon tooltip */
.daw-schedule-info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: help;
  margin-left: 0.5rem;
  vertical-align: middle;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.daw-schedule-info-icon svg {
  width: 20px;
  height: 20px;
  color: var(--daw-primary);
  transition: transform 0.2s ease;
}

.daw-schedule-info-icon:hover svg {
  transform: scale(1.15);
  filter: brightness(1.1);
}

.daw-schedule-info-icon::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  padding: 0.625rem 0.875rem;
  background: rgba(0, 0, 0, 0.92);
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1.4;
  text-align: center;
  border-radius: 6px;
  white-space: normal;
  width: max-content;
  max-width: min(280px, calc(100vw - 2rem));
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease;
  transform: translateY(-4px);
  z-index: 1000;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.daw-schedule-info-icon::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 2px);
  right: 10px;
  border: 6px solid transparent;
  border-top-color: rgba(0, 0, 0, 0.92);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease;
  transform: translateY(-4px);
  z-index: 1000;
}

.daw-schedule-info-icon:hover::after,
.daw-schedule-info-icon:hover::before {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Ensure tooltip appears above other elements and maintain right alignment */
.daw-info-value {
  position: relative;
}

/* When info value contains schedule icon, use flex for alignment */
.daw-info-value:has(.daw-schedule-info-icon) {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.daw-status-badge {
  position: relative;
}




