

:root {
    --primary-green: #41885b;
    --primary-hover: #326b46;
    --bg-color: #f7f6f2;
    --text-dark: #1e201f;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --card-bg: #ffffff;
    --input-bg: #e9e8e3;
  }
  
  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  }
  
  body {
    background-color: var(--bg-color);
    color: var(--text-dark);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
  }
  
  /* Header — responsive; compact row + drawer nav on small screens */
  .site-header {
    position: relative;
    z-index: 100;
    display: grid;
    align-items: center;
    column-gap: 0.75rem;
    row-gap: 0;
    padding: 0.65rem clamp(0.75rem, 3vw, 2rem);
    padding-left: max(0.75rem, env(safe-area-inset-left));
    padding-right: max(0.75rem, env(safe-area-inset-right));
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset;
  }

  @media (min-width: 768px) {
    .site-header {
      grid-template-columns: auto 1fr auto;
      grid-template-areas: 'logo nav actions';
    }

    .site-header .logo {
      grid-area: logo;
    }

    .site-header .nav-menu-toggle {
      display: none;
    }

    .site-header .site-nav {
      grid-area: nav;
      display: flex;
      justify-content: center;
      align-items: center;
      flex-wrap: wrap;
      gap: clamp(0.75rem, 2vw, 2rem);
    }

    .site-header .header-actions {
      grid-area: actions;
      justify-self: end;
    }
  }

  @media (max-width: 767px) {
    .site-header {
      grid-template-columns: 1fr auto auto;
      grid-template-areas:
        'logo toggle actions'
        'nav nav nav';
    }

    .site-header .logo {
      grid-area: logo;
      min-width: 0;
    }

    .site-header .nav-menu-toggle {
      grid-area: toggle;
      justify-self: end;
    }

    .site-header .header-actions {
      grid-area: actions;
      justify-self: end;
    }

    .site-header .site-nav {
      grid-area: nav;
      display: none;
      flex-direction: column;
      align-items: stretch;
      gap: 0.25rem;
      padding: 0.75rem 0 0.25rem;
      margin-top: 0.5rem;
      border-top: 1px solid var(--border-color);
    }

    .site-header.nav-open .site-nav {
      display: flex;
    }
  }

  .nav-menu-toggle {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    border-radius: 12px;
    background: var(--input-bg);
    color: var(--text-dark);
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
  }

  .nav-menu-toggle:focus-visible {
    outline: 2px solid var(--primary-green);
    outline-offset: 2px;
  }

  .nav-menu-bar {
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 1px;
    background: currentColor;
    transition: transform 0.2s, opacity 0.2s;
  }

  .site-header.nav-open .nav-menu-toggle .nav-menu-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .site-header.nav-open .nav-menu-toggle .nav-menu-bar:nth-child(2) {
    opacity: 0;
  }

  .site-header.nav-open .nav-menu-toggle .nav-menu-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .site-nav a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.6rem 0.5rem;
    border-radius: 10px;
    transition: color 0.2s, background-color 0.2s;
    text-align: center;
  }

  @media (min-width: 768px) {
    .site-nav a {
      padding: 0.35rem 0.25rem;
      font-size: 0.95rem;
    }

    .site-nav a:hover {
      color: var(--text-dark);
    }
  }

  @media (max-width: 767px) {
    .site-nav a {
      text-align: left;
      padding: 0.65rem 0.75rem;
    }

    .site-nav a:hover,
    .site-nav a:focus-visible {
      color: var(--text-dark);
      background: var(--input-bg);
    }
  }

  .site-nav a.active {
    color: var(--primary-green);
    font-weight: 600;
  }

  @media (min-width: 768px) {
    .site-nav a.active {
      border-bottom: 2px solid var(--primary-green);
      border-radius: 0;
    }
  }

  .logo {
    font-size: clamp(1.15rem, 3.5vw, 1.5rem);
    font-weight: 700;
    color: var(--primary-green);
    letter-spacing: -0.5px;
    text-decoration: none;
    white-space: nowrap;
  }

  a.logo:hover {
    color: var(--primary-hover);
  }

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

  @media (min-width: 480px) {
    .header-actions {
      gap: 0.65rem;
    }
  }

  @media (min-width: 768px) {
    .header-actions {
      gap: 1rem;
    }
  }

  .btn-login {
    background-color: var(--primary-green);
    color: white;
    border: none;
    padding: 0.5rem 0.9rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background-color 0.2s;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  @media (min-width: 480px) {
    .btn-login {
      padding: 0.55rem 1.25rem;
      font-size: 0.875rem;
    }
  }

  @media (min-width: 768px) {
    .btn-login {
      padding: 0.6rem 1.5rem;
      font-size: 1rem;
    }
  }

  .btn-login:hover {
    background-color: var(--primary-hover);
  }

  .btn-theme-map {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--card-bg);
    color: var(--text-muted);
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
  }

  .btn-theme-map:hover {
    background: var(--input-bg);
    color: var(--text-dark);
  }

  .btn-theme-map .material-symbols-outlined {
    font-size: 22px;
    line-height: 1;
  }

  .icon-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.15rem;
    color: var(--text-muted);
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, color 0.2s;
  }

  @media (min-width: 480px) {
    .icon-btn {
      display: inline-flex;
    }
  }

  .icon-btn:hover {
    background: var(--input-bg);
    color: var(--text-dark);
  }
  
  /* Main — light, calm clinical feel */
  main.dashboard-main {
    --dm-bg-top: #fafbf9;
    --dm-bg-mid: #f3f5f4;
    --dm-green-wash: rgba(65, 136, 91, 0.09);
    --dm-green-soft: rgba(65, 136, 91, 0.05);

    flex-grow: 1;
    position: relative;
    isolation: isolate;
    overflow-x: hidden;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: clamp(0.75rem, 2.5vw, 1.5rem) clamp(0.75rem, 3vw, 1.25rem);
    padding-bottom: max(1.25rem, env(safe-area-inset-bottom));
    min-height: 0;

    background:
      radial-gradient(ellipse 75% 55% at 88% 8%, rgba(232, 228, 245, 0.85), transparent 52%),
      radial-gradient(ellipse 65% 50% at 6% 88%, rgba(245, 232, 224, 0.75), transparent 50%),
      radial-gradient(ellipse 55% 45% at 72% 78%, rgba(225, 238, 248, 0.7), transparent 48%),
      radial-gradient(ellipse 100% 70% at 50% -15%, var(--dm-green-wash), transparent 52%),
      radial-gradient(ellipse 60% 45% at 100% 80%, var(--dm-green-soft), transparent 50%),
      radial-gradient(ellipse 50% 40% at 0% 60%, rgba(65, 136, 91, 0.04), transparent 48%),
      linear-gradient(180deg, var(--dm-bg-top) 0%, var(--dm-bg-mid) 55%, #eef1ef 100%);
  }

  @media (min-width: 768px) {
    main.dashboard-main {
      align-items: center;
    }
  }

  .dashboard-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
  }

  .dashboard-bg-noise {
    position: absolute;
    inset: 0;
    opacity: 0.04;
    mix-blend-mode: multiply;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 180px 180px;
  }

  .dashboard-bg-sweep {
    position: absolute;
    width: 130%;
    height: 100%;
    top: -30%;
    left: -15%;
    background: radial-gradient(
      ellipse 50% 40% at 50% 50%,
      rgba(65, 136, 91, 0.12) 0%,
      rgba(65, 136, 91, 0.03) 45%,
      transparent 70%
    );
    filter: blur(48px);
    animation: dashboard-bg-sweep 16s ease-in-out infinite;
  }

  @keyframes dashboard-bg-sweep {
    0%,
    100% {
      transform: translate(-3%, 1%) scale(1);
      opacity: 0.9;
    }
    50% {
      transform: translate(4%, -2%) scale(1.05);
      opacity: 1;
    }
  }

  .dashboard-bg-threads {
    position: absolute;
    inset: -12%;
    z-index: 1;
    pointer-events: none;
    opacity: 0.92;
    mask-image: radial-gradient(
      ellipse 85% 80% at 50% 42%,
      black 0%,
      transparent 78%
    );
    -webkit-mask-image: radial-gradient(
      ellipse 85% 80% at 50% 42%,
      black 0%,
      transparent 78%
    );
  }

  .threads-canvas {
    width: 100%;
    height: 100%;
    display: block;
    filter: drop-shadow(0 0 20px rgba(65, 136, 91, 0.06));
  }

  .threads-canvas .thread-path {
    vector-effect: non-scaling-stroke;
  }

  .threads-layer--back {
    will-change: transform;
    animation: threads-drift-slow 48s ease-in-out infinite alternate;
  }

  .threads-layer--fore {
    will-change: transform;
    animation: threads-drift-fore 34s ease-in-out infinite alternate;
  }

  @keyframes threads-drift-slow {
    0% {
      transform: translate(-1.2%, -0.4%) rotate(-0.35deg);
    }
    100% {
      transform: translate(1.4%, 0.6%) rotate(0.35deg);
    }
  }

  @keyframes threads-drift-fore {
    0% {
      transform: translate(0.8%, 0.3%) rotate(0.25deg);
    }
    100% {
      transform: translate(-1.1%, -0.5%) rotate(-0.25deg);
    }
  }

  .dashboard-bg-rings {
    position: absolute;
    left: 50%;
    top: 40%;
    width: min(100vmin, 720px);
    height: min(100vmin, 720px);
    transform: translate(-50%, -50%);
  }

  .dashboard-ring {
    position: absolute;
    left: 50%;
    top: 50%;
    border-radius: 50%;
    border: 1px solid rgba(65, 136, 91, 0.1);
    box-shadow: inset 0 0 40px rgba(65, 136, 91, 0.03);
    transform: translate(-50%, -50%);
    animation: dashboard-ring-pulse 12s ease-in-out infinite;
  }

  .dashboard-ring:nth-child(1) {
    width: 36%;
    height: 36%;
  }

  .dashboard-ring:nth-child(2) {
    width: 58%;
    height: 58%;
    animation-delay: -4s;
    border-color: rgba(65, 136, 91, 0.07);
  }

  .dashboard-ring:nth-child(3) {
    width: 82%;
    height: 82%;
    animation-delay: -8s;
    border-color: rgba(30, 32, 31, 0.04);
  }

  @keyframes dashboard-ring-pulse {
    0%,
    100% {
      opacity: 0.45;
      transform: translate(-50%, -50%) scale(1);
    }
    50% {
      opacity: 0.85;
      transform: translate(-50%, -50%) scale(1.015);
    }
  }

  .dashboard-bg-vignette {
    position: absolute;
    inset: 0;
    background: radial-gradient(
      ellipse 90% 80% at 50% 45%,
      transparent 35%,
      rgba(255, 255, 255, 0.55) 100%
    );
    pointer-events: none;
  }

  .bg-text {
    position: absolute;
    bottom: clamp(0.5rem, 2vw, 1rem);
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    font-size: clamp(0.62rem, 1.8vw, 0.78rem);
    font-weight: 600;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    z-index: 1;
    color: rgba(30, 32, 31, 0.38);
    white-space: nowrap;
    pointer-events: none;
  }

  @media (prefers-reduced-motion: reduce) {
    .dashboard-bg-sweep,
    .dashboard-ring,
    .threads-layer--back,
    .threads-layer--fore {
      animation: none;
    }

    .dashboard-bg-sweep {
      opacity: 0.85;
      transform: none;
    }

    .dashboard-ring {
      opacity: 0.6;
    }

    .threads-layer--back,
    .threads-layer--fore {
      transform: none;
    }
  }

  .dashboard-columns {
    display: flex;
    flex-flow: row wrap;
    gap: clamp(1rem, 3vw, 1.75rem);
    align-items: stretch;
    justify-content: center;
    width: 100%;
    max-width: 1180px;
    position: relative;
    z-index: 10;
    min-width: 0;
    flex: 1 1 auto;
  }

  .map-panel {
    flex: 1 1 min(100%, 320px);
    max-width: 560px;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-width: 0;
  }

  .map-wrap {
    position: relative;
    border-radius: clamp(12px, 2vw, 16px);
    overflow: hidden;
    box-shadow:
      0 8px 28px rgba(30, 32, 31, 0.08),
      0 0 0 1px rgba(65, 136, 91, 0.1);
    border: 1px solid rgba(65, 136, 91, 0.12);
    flex: 1;
    min-height: 220px;
    height: clamp(220px, 32vh, 400px);
    background: #e8ebe9;
  }

  .dashboard-map {
    width: 100%;
    height: 100%;
    min-height: 220px;
    z-index: 1;
  }

  /* Custom pin for Leaflet divIcon (center = GPS point) */
  .dashboard-pin-marker {
    background: transparent !important;
    border: none !important;
  }

  .dashboard-pin-marker .dashboard-pin-inner {
    width: 20px;
    height: 20px;
    background: var(--primary-green);
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(30, 32, 31, 0.22);
  }

  .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;
  }
  
  /* Verified Location Card (summary above map) */
  .location-card {
    position: relative;
    width: 100%;
    background: var(--card-bg);
    padding: clamp(1rem, 3vw, 1.25rem);
    border-radius: clamp(12px, 2vw, 16px);
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    box-shadow:
      0 6px 22px rgba(30, 32, 31, 0.06),
      0 0 0 1px var(--border-color);
    border: 1px solid var(--border-color);
    z-index: 5;
    min-width: 0;
  }

  .loc-header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    min-width: 0;
  }

  .loc-details {
    min-width: 0;
    flex: 1;
  }

  .loc-icon {
    background: #e6f0eb;
    color: var(--primary-green);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
  }
  
  .loc-details h4 {
    font-size: 0.9rem;
    color: var(--text-dark);
    margin-bottom: 0.1rem;
  }
  
  .loc-details p {
    font-size: 0.8rem;
    color: var(--text-muted);
    word-wrap: break-word;
    overflow-wrap: anywhere;
  }
  
  .signal-bar {
    width: 100%;
    height: 4px;
    background: #ddd;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 5px;
  }
  
  .signal-fill {
    width: 85%;
    height: 100%;
    background: linear-gradient(90deg, var(--primary-green), #66b37e);
    transition: width 420ms cubic-bezier(.2,.9,.2,1), background 300ms;
  }
  
  .signal-text {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-style: italic;
  }

  .loc-coords {
    font-size: 0.72rem;
    color: var(--text-muted);
    opacity: 0.95;
  }
  
  /* Central Emergency Modal */
  .emergency-modal {
    background: var(--card-bg);
    border-radius: clamp(18px, 4vw, 28px);
    padding: clamp(1.25rem, 5vw, 2.5rem);
    width: 100%;
    flex: 1 1 min(100%, 300px);
    max-width: 500px;
    box-shadow:
      0 12px 40px rgba(30, 32, 31, 0.08),
      0 0 0 1px var(--border-color);
    border: 1px solid var(--border-color);
    z-index: 10;
    text-align: center;
    align-self: stretch;
    min-width: 0;
  }

  @media (min-width: 768px) {
    .emergency-modal {
      align-self: center;
    }
  }

  .modal-title {
    font-size: clamp(1.35rem, 4.5vw, 1.75rem);
    margin-bottom: 0.5rem;
    color: var(--text-dark);
    line-height: 1.2;
  }

  .modal-subtitle {
    color: var(--text-muted);
    font-size: clamp(0.875rem, 2.5vw, 0.95rem);
    margin-bottom: clamp(1.25rem, 4vw, 2rem);
    line-height: 1.45;
  }

  .service-options {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-bottom: clamp(1.25rem, 4vw, 2rem);
  }

  .service-btn {
    flex: 1 1 calc(33.333% - 0.5rem);
    min-width: 5.5rem;
    max-width: 100%;
    background: transparent;
    border: 2px solid transparent;
    border-radius: 14px;
    padding: clamp(0.85rem, 2.5vw, 1.25rem) 0.4rem;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s, transform 0.15s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }

  @media (max-width: 380px) {
    .service-btn {
      flex: 1 1 100%;
      flex-direction: row;
      justify-content: flex-start;
      padding: 0.75rem 1rem;
      gap: 1rem;
    }

    .service-btn .icon-wrapper {
      width: 48px;
      height: 48px;
      flex-shrink: 0;
    }
  }

  .service-btn .icon-wrapper {
    width: clamp(52px, 14vw, 60px);
    height: clamp(52px, 14vw, 60px);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(1.5rem, 4vw, 1.8rem);
    background-color: white;
    box-shadow: 0 2px 8px rgba(30, 32, 31, 0.06);
  }
  
  .service-btn[data-service="ambulance"] .icon-wrapper { background: #e8f5e9; }
  .service-btn[data-service="fire"] .icon-wrapper { background: #ffebee; }
  .service-btn[data-service="police"] .icon-wrapper { background: #f3e5f5; }
  
  .service-btn span {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }
  
  .service-btn.active {
    border-color: var(--primary-green);
    background-color: white;
  }

  .service-btn:focus-visible {
    outline: 2px solid var(--primary-green);
    outline-offset: 3px;
  }

  .dial-bar {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 1180px;
    margin-top: auto;
    flex-shrink: 0;
    padding: 0.75rem clamp(0.75rem, 3vw, 1.25rem);
    padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(30, 32, 31, 0.06);
  }

  .dial-bar__title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 0.6rem;
  }

  .dial-bar__actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
  }

  .dial-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    padding: 0.6rem 0.35rem;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    background: var(--card-bg);
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s, transform 0.15s;
    -webkit-tap-highlight-color: transparent;
    min-width: 0;
  }

  .dial-btn:hover,
  .dial-btn:focus-visible {
    border-color: var(--primary-green);
    background-color: #f0f7f2;
    outline: none;
  }

  .dial-btn:focus-visible {
    outline: 2px solid var(--primary-green);
    outline-offset: 2px;
  }

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

  .dial-btn__icon {
    font-size: 1.25rem;
    line-height: 1;
  }

  .dial-btn__label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.2;
  }

  .dial-btn__number {
    font-size: 1rem;
    font-weight: 800;
    color: var(--primary-green);
    letter-spacing: 0.02em;
  }

  @media (max-width: 380px) {
    .dial-btn__label {
      font-size: 0.6rem;
    }

    .dial-btn__number {
      font-size: 0.95rem;
    }
  }
  
  .input-group {
    text-align: left;
    margin-bottom: 2rem;
  }

  .input-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    margin-bottom: 0.75rem;
  }
  
  .input-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .btn-voice {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--primary-green);
    background: white;
    color: var(--primary-green);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, color 0.2s, transform 0.15s;
  }

  .btn-voice:hover:not(:disabled) {
    background: #e6f0eb;
  }

  .btn-voice:active:not(:disabled) {
    transform: scale(0.96);
  }

  .btn-voice:disabled {
    opacity: 0.55;
    cursor: not-allowed;
  }

  .btn-voice.listening {
    background: var(--primary-green);
    color: #fff;
    animation: voice-pulse 1.25s ease-in-out infinite;
  }

  @keyframes voice-pulse {
    0%,
    100% {
      box-shadow: 0 0 0 0 rgba(65, 136, 91, 0.45);
    }
    50% {
      box-shadow: 0 0 0 10px rgba(65, 136, 91, 0);
    }
  }

  .voice-status {
    font-size: 0.82rem;
    color: var(--text-muted);
    min-height: 1.35rem;
    margin: 0 0 0.65rem;
    line-height: 1.35;
  }
  
  .input-group textarea {
    width: 100%;
    background-color: var(--input-bg);
    border: none;
    border-radius: 12px;
    padding: 1rem;
    font-size: 0.95rem;
    resize: none;
    min-height: 80px;
    color: var(--text-dark);
  }
  
  .input-group textarea:focus {
    outline: 2px solid var(--primary-green);
  }
  
  .btn-submit {
    width: 100%;
    background-color: var(--primary-green);
    color: white;
    border: none;
    padding: 1.25rem;
    border-radius: 16px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    transition: background-color 0.2s;
    margin-bottom: 1.5rem;
  }
  
  .btn-submit:hover {
    background-color: var(--primary-hover);
  }

  .btn-submit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
  }

  .incident-form-error {
    color: #b91c1c;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.4;
  }

  .incident-form-success {
    color: var(--primary-green);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.4;
  }
  
  .location-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    background: #f0eee9;
    padding: 0.75rem;
    border-radius: 12px;
  }
  
  /* Footer */
  footer {
    padding: clamp(1rem, 4vw, 2rem) max(1rem, env(safe-area-inset-right))
      max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
    text-align: center;
    background-color: var(--bg-color);
    z-index: 10;
  }

  .footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.65rem 1.25rem;
    margin-bottom: 1rem;
  }
  
  .footer-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.9rem;
  }
  
  .footer-links a:hover {
    color: var(--text-dark);
  }
  
  .copyright {
    color: var(--text-muted);
    font-size: 0.85rem;
  }
  
  .copyright strong {
    color: var(--primary-green);
  }

/* App color theme — map / incident dashboard */
html[data-theme="dark"] {
  color-scheme: dark;
  --primary-green: #6b9c78;
  --primary-hover: #558763;
  --bg-color: #0f1411;
  --text-dark: #e8ebe9;
  --text-muted: #9aaa9f;
  --border-color: #2d3830;
  --card-bg: #1e2520;
  --input-bg: #252d27;
}

html[data-theme="dark"] .location-notice {
  background: #252d27;
  color: var(--text-muted);
}

@media (prefers-color-scheme: dark) {
  html[data-theme="system"] {
    color-scheme: dark;
    --primary-green: #6b9c78;
    --primary-hover: #558763;
    --bg-color: #0f1411;
    --text-dark: #e8ebe9;
    --text-muted: #9aaa9f;
    --border-color: #2d3830;
    --card-bg: #1e2520;
    --input-bg: #252d27;
  }

  html[data-theme="system"] .location-notice {
    background: #252d27;
    color: var(--text-muted);
  }
}

/* Dark / system-dark — main dashboard canvas (gradients, chrome, controls) */
html[data-theme="dark"] .site-header {
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.35) inset;
}

html[data-theme="dark"] main.dashboard-main {
  --dm-bg-top: #1a201c;
  --dm-bg-mid: #141916;
  --dm-green-wash: rgba(107, 156, 120, 0.14);
  --dm-green-soft: rgba(107, 156, 120, 0.08);
  background:
    radial-gradient(ellipse 75% 55% at 88% 8%, rgba(55, 48, 75, 0.42), transparent 52%),
    radial-gradient(ellipse 65% 50% at 6% 88%, rgba(85, 50, 38, 0.32), transparent 50%),
    radial-gradient(ellipse 55% 45% at 72% 78%, rgba(38, 52, 68, 0.32), transparent 48%),
    radial-gradient(ellipse 100% 70% at 50% -15%, var(--dm-green-wash), transparent 52%),
    radial-gradient(ellipse 60% 45% at 100% 80%, var(--dm-green-soft), transparent 50%),
    radial-gradient(ellipse 50% 40% at 0% 60%, rgba(107, 156, 120, 0.06), transparent 48%),
    linear-gradient(180deg, var(--dm-bg-top) 0%, var(--dm-bg-mid) 55%, var(--bg-color) 100%);
}

html[data-theme="dark"] .dashboard-bg-noise {
  opacity: 0.032;
  mix-blend-mode: soft-light;
}

html[data-theme="dark"] .dashboard-bg-vignette {
  background: radial-gradient(
    ellipse 90% 80% at 50% 45%,
    transparent 32%,
    rgba(0, 0, 0, 0.52) 100%
  );
}

html[data-theme="dark"] .bg-text {
  color: rgba(232, 235, 233, 0.22);
}

html[data-theme="dark"] .map-wrap {
  background: #1a221c;
  box-shadow:
    0 8px 28px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(107, 156, 120, 0.2);
  border-color: rgba(107, 156, 120, 0.22);
}

html[data-theme="dark"] .dashboard-pin-marker .dashboard-pin-inner {
  border-color: var(--card-bg);
}

html[data-theme="dark"] .loc-icon {
  background: rgba(107, 156, 120, 0.2);
}

html[data-theme="dark"] .signal-bar {
  background: #3d4540;
}

html[data-theme="dark"] .location-card,
html[data-theme="dark"] .emergency-modal {
  box-shadow:
    0 10px 36px rgba(0, 0, 0, 0.42),
    0 0 0 1px var(--border-color);
}

html[data-theme="dark"] .dashboard-ring {
  border-color: rgba(107, 156, 120, 0.14);
  box-shadow: inset 0 0 40px rgba(107, 156, 120, 0.05);
}

html[data-theme="dark"] .dashboard-ring:nth-child(2) {
  border-color: rgba(107, 156, 120, 0.1);
}

html[data-theme="dark"] .dashboard-ring:nth-child(3) {
  border-color: rgba(255, 255, 255, 0.05);
}

html[data-theme="dark"] .threads-canvas {
  filter: drop-shadow(0 0 18px rgba(0, 0, 0, 0.35));
}

html[data-theme="dark"] .service-btn .icon-wrapper {
  background-color: var(--input-bg);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] .service-btn[data-service="ambulance"] .icon-wrapper {
  background: rgba(56, 142, 60, 0.22);
}

html[data-theme="dark"] .service-btn[data-service="fire"] .icon-wrapper {
  background: rgba(198, 40, 40, 0.2);
}

html[data-theme="dark"] .service-btn[data-service="police"] .icon-wrapper {
  background: rgba(123, 31, 162, 0.22);
}

html[data-theme="dark"] .service-btn.active {
  background-color: rgba(107, 156, 120, 0.14);
}

html[data-theme="dark"] .dial-bar {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.32);
}

html[data-theme="dark"] .dial-btn:hover,
html[data-theme="dark"] .dial-btn:focus-visible {
  background-color: rgba(107, 156, 120, 0.12);
}

html[data-theme="dark"] .dial-btn__number {
  color: #8bc4a8;
}

html[data-theme="dark"] .btn-voice {
  background: var(--input-bg);
  color: var(--primary-green);
}

html[data-theme="dark"] .btn-voice:hover:not(:disabled) {
  background: rgba(107, 156, 120, 0.22);
}

html[data-theme="dark"] .incident-form-error {
  color: #f87171;
}

@media (prefers-color-scheme: dark) {
  html[data-theme="system"] .site-header {
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.35) inset;
  }

  html[data-theme="system"] main.dashboard-main {
    --dm-bg-top: #1a201c;
    --dm-bg-mid: #141916;
    --dm-green-wash: rgba(107, 156, 120, 0.14);
    --dm-green-soft: rgba(107, 156, 120, 0.08);
    background:
      radial-gradient(ellipse 75% 55% at 88% 8%, rgba(55, 48, 75, 0.42), transparent 52%),
      radial-gradient(ellipse 65% 50% at 6% 88%, rgba(85, 50, 38, 0.32), transparent 50%),
      radial-gradient(ellipse 55% 45% at 72% 78%, rgba(38, 52, 68, 0.32), transparent 48%),
      radial-gradient(ellipse 100% 70% at 50% -15%, var(--dm-green-wash), transparent 52%),
      radial-gradient(ellipse 60% 45% at 100% 80%, var(--dm-green-soft), transparent 50%),
      radial-gradient(ellipse 50% 40% at 0% 60%, rgba(107, 156, 120, 0.06), transparent 48%),
      linear-gradient(180deg, var(--dm-bg-top) 0%, var(--dm-bg-mid) 55%, var(--bg-color) 100%);
  }

  html[data-theme="system"] .dashboard-bg-noise {
    opacity: 0.032;
    mix-blend-mode: soft-light;
  }

  html[data-theme="system"] .dashboard-bg-vignette {
    background: radial-gradient(
      ellipse 90% 80% at 50% 45%,
      transparent 32%,
      rgba(0, 0, 0, 0.52) 100%
    );
  }

  html[data-theme="system"] .bg-text {
    color: rgba(232, 235, 233, 0.22);
  }

  html[data-theme="system"] .map-wrap {
    background: #1a221c;
    box-shadow:
      0 8px 28px rgba(0, 0, 0, 0.45),
      0 0 0 1px rgba(107, 156, 120, 0.2);
    border-color: rgba(107, 156, 120, 0.22);
  }

  html[data-theme="system"] .dashboard-pin-marker .dashboard-pin-inner {
    border-color: var(--card-bg);
  }

  html[data-theme="system"] .loc-icon {
    background: rgba(107, 156, 120, 0.2);
  }

  html[data-theme="system"] .signal-bar {
    background: #3d4540;
  }

  html[data-theme="system"] .location-card,
  html[data-theme="system"] .emergency-modal {
    box-shadow:
      0 10px 36px rgba(0, 0, 0, 0.42),
      0 0 0 1px var(--border-color);
  }

  html[data-theme="system"] .dashboard-ring {
    border-color: rgba(107, 156, 120, 0.14);
    box-shadow: inset 0 0 40px rgba(107, 156, 120, 0.05);
  }

  html[data-theme="system"] .dashboard-ring:nth-child(2) {
    border-color: rgba(107, 156, 120, 0.1);
  }

  html[data-theme="system"] .dashboard-ring:nth-child(3) {
    border-color: rgba(255, 255, 255, 0.05);
  }

  html[data-theme="system"] .threads-canvas {
    filter: drop-shadow(0 0 18px rgba(0, 0, 0, 0.35));
  }

  html[data-theme="system"] .service-btn .icon-wrapper {
    background-color: var(--input-bg);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
  }

  html[data-theme="system"] .service-btn[data-service="ambulance"] .icon-wrapper {
    background: rgba(56, 142, 60, 0.22);
  }

  html[data-theme="system"] .service-btn[data-service="fire"] .icon-wrapper {
    background: rgba(198, 40, 40, 0.2);
  }

  html[data-theme="system"] .service-btn[data-service="police"] .icon-wrapper {
    background: rgba(123, 31, 162, 0.22);
  }

  html[data-theme="system"] .service-btn.active {
    background-color: rgba(107, 156, 120, 0.14);
  }

  html[data-theme="system"] .dial-bar {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.32);
  }

  html[data-theme="system"] .dial-btn:hover,
  html[data-theme="system"] .dial-btn:focus-visible {
    background-color: rgba(107, 156, 120, 0.12);
  }

  html[data-theme="system"] .dial-btn__number {
    color: #8bc4a8;
  }

  html[data-theme="system"] .btn-voice {
    background: var(--input-bg);
    color: var(--primary-green);
  }

  html[data-theme="system"] .btn-voice:hover:not(:disabled) {
    background: rgba(107, 156, 120, 0.22);
  }

  html[data-theme="system"] .incident-form-error {
    color: #f87171;
  }
}