#map .leaflet-overlay-pane svg {
  width: auto;
  min-height: 0;
  max-width: none;
}
#map {
  isolation: isolate;
}

/* Keep the attribution icon clear of the site's full-size SVG styles. */
#map .leaflet-attribution-flag {
  display: inline;
  width: 12px;
  height: 8px;
  min-height: 0;
}

#dashboard .map-controls {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 6fr) minmax(0, 3fr);
  gap: 12px;
  padding: 14px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}

#dashboard .map-controls button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 44px;
  padding: 8px 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--soft);
  color: var(--ink);
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.25;
  white-space: normal;
}

#dashboard .map-controls button[aria-pressed="true"] {
  background: #006779;
  border-color: #006779;
  color: #fff;
}

#dashboard .map-controls button:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

#map-follow-state {
  flex: none;
  padding: 2px 5px;
  border: 1px solid currentColor;
  border-radius: 5px;
  font-size: 0.7rem;
}

.map-view {
  position: relative;
}

#map-status {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  color: var(--mut);
  font-size: 0.75rem;
  text-align: center;
  pointer-events: none;
}

#map-status[data-state="error"] {
  inset: auto 8px 28px;
  padding: 6px;
  border-radius: 8px;
  background: var(--card);
}

@media (max-width: 360px) {
  #dashboard .map-controls {
    grid-template-columns: minmax(0, 3fr) minmax(0, 7fr) minmax(0, 3fr);
    gap: 6px;
    padding-inline: 8px;
  }
}


#map-location-status:not(:empty) {
  padding: 8px 12px;
  color: var(--mut);
  text-align: center;
  font-size: 0.75rem;
}

#dashboard .phone-share {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin: 16px 0 8px;
}

#dashboard .phone-share input,
#dashboard .phone-share button {
  min-width: 0;
  margin: 0;
}

#phone-result {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--mut);
  font-size: 0.75rem;
}

#phone-result:empty {
  display: none;
}

#map .map-device-name {
  padding: 2px 6px;
  max-width: min(125px, 42vw);
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
  font-weight: 650;
  pointer-events: none;
}

#dashboard .phone-card {
  padding: 0;
  min-width: 0;
}

.phone-card summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 12px;
  cursor: pointer;
  list-style: none;
}

.phone-card summary::-webkit-details-marker { display: none; }
.phone-card summary::after { content: '▾'; }
.phone-card[open] summary::after { content: '▴'; }
.phone-card summary strong { overflow-wrap: anywhere; }
.phone-card summary span { color: var(--mut); font-size: 0.75rem; }
.phone-card > div { padding: 0 12px 8px; }

#dashboard .layout,
#dashboard .layout > * { min-width: 0; }

.brand-feature {
  display: block;
  margin-top: 4px;
  color: #b1cbd5;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0;
}

#home-install summary {
  color: #ffb703;
  cursor: pointer;
}
#home-install .home-install-guide {
  max-width: 32rem;
  margin-top: .65rem;
  padding: .75rem;
  border: 1px solid #577786;
  border-radius: .65rem;
  color: #fff;
  background: #062f41;
}
#home-install .home-install-guide img {
  border-radius: .45rem;
}
#home-install .home-install-guide p {
  margin: .4rem 0 0;
}

.header-shortcuts {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: flex-end;
  column-gap: .9rem;
  max-width: 100%;
}
.header-group-share {
  display: none;
}
body:has(#dashboard:not([hidden])) .header-group-share {
 display: grid;
 justify-items: start;
 gap: .4rem;
 min-width: 0;
}
header .header-shortcuts #group-share {
  appearance: none;
  min-height: 44px;
  padding: 0 .125rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #9be5ed;
  cursor: pointer;
  font-size: inherit;
  font-weight: 650;
  line-height: 1.25;
  white-space: nowrap;
  text-shadow: 0 1px 2px #0005;
}
header .header-shortcuts #group-share:hover {
  text-decoration: underline;
  text-underline-offset: .22em;
}
header .header-shortcuts #group-share:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}
:root[data-theme=dark] header .header-shortcuts #group-share {
  color: #8fdfed;
  text-shadow: 0 1px 2px #0007;
}
#group-share-status {
 margin: 0;
}
#group-share-url {
 width: 100%;
}

#dashboard .guest-location {
  padding: clamp(1rem, 3vw, 1.5rem);
  border: 2px solid #ffb703;
  border-radius: 1rem;
  margin: 1rem 0 1.5rem;
}
#guest-location-intro {
  grid-column: 1 / -1;
}
#guest-location-intro p {
  margin: .25rem 0 .5rem;
}
#dashboard .guest-location button {
  background: #ffb703;
  border-color: #ffb703;
  color: #062f41;
}
#dashboard .guest-location button:disabled {
  opacity: .65;
}
@media (max-width: 560px) {
  #dashboard .guest-location {
    grid-template-columns: minmax(0, 1fr);
  }
  #dashboard .guest-location input,
  #dashboard .guest-location button {
    width: 100%;
  }
}

body > header:has(.group-brand-row) {
  flex-wrap: wrap;
}
.group-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex: 1 0 100%;
  min-width: 0;
}
.group-brand-row .brand {
  min-width: 0;
}
.group-brand-row .group-back {
  display: none;
  flex: 0 0 auto;
  align-items: center;
  gap: .32em;
  min-height: 44px;
  padding: 0 .7rem;
  margin: 0;
  border: 1px solid rgb(255 255 255 / .28);
  border-radius: 999px;
  background: linear-gradient(rgb(255 255 255 / .20), rgb(255 255 255 / .08));
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .22), 0 2px 6px rgb(0 0 0 / .15);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
  backdrop-filter: blur(12px) saturate(150%);
  color: #fff;
  font-size: .875rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.group-brand-row .group-back span {
  font-size: 1.5em;
  line-height: 1;
}
.group-brand-row .group-back:hover {
  text-decoration: underline;
  text-underline-offset: .2em;
}
.group-brand-row .group-back:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

body:has(#dashboard:not([hidden])) .group-brand-row .group-back {
  display: inline-flex;
}
