.community-launch,
.community-dialog button:not(.community-surface),
.community-dialog select {
  box-sizing: border-box;
  min-width: 44px;
  min-height: 44px;
  padding: .45rem .7rem;
  border: 1px solid #a4b8bf;
  border-radius: .5rem;
  background: #fff;
  color: #183841;
  font: inherit;
  cursor: pointer;
}
.community-launch { align-self: flex-start; font-size: .875rem; font-weight: 650; }
.community-launch:disabled { opacity: .55; cursor: default; }
.community-dialog {
  box-sizing: border-box;
  width: min(28rem, calc(100vw - 1.25rem));
  max-height: 85vh;
  max-height: 85dvh;
  padding: 1rem;
  overflow: auto;
  border: 1px solid #b5c6cc;
  border-radius: .75rem;
  background: #fff;
  color: #183841;
  font: 1rem/1.45 system-ui, sans-serif;
}
.community-dialog::backdrop { background: rgb(15 33 40 / 48%); }
.community-dialog [hidden] { display: none !important; }
.community-dialog header { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.community-dialog h2 { margin: 0; font-size: 1.2rem; }
.community-dialog label { display: block; margin-bottom: .5rem; }
.community-dialog ul { padding: 0; list-style: none; }
.community-dialog li { margin-top: .75rem; padding-top: .75rem; border-top: 1px solid #d4dfe2; }
.community-dialog p { margin: .5rem 0; }
.community-dialog button + button { margin-inline-start: .25rem; }
.community-dialog :focus-visible, .community-launch:focus-visible { outline: 3px solid #147989; outline-offset: -3px; }
.community-dialog.is-picking {
  position: fixed;
  inset: auto;
  margin: 0;
  max-width: none;
  max-height: none;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.community-dialog.is-picking::backdrop { background: transparent; }
.community-picker, .community-surface { position: absolute; inset: 0; }
.community-dialog .community-surface {
  width: 100%; height: 100%; padding: 0; border: 0; border-radius: 0;
  background: transparent; cursor: crosshair; touch-action: none;
}
.community-cross {
  position: absolute; transform: translate(-50%, -50%); pointer-events: none;
  border-radius: .5rem; background: #173e49; color: white; font: bold 1rem/1.4 system-ui;
  padding: .05rem .35rem; box-shadow: 0 0 0 2px white;
}
.community-markers .community-pin {
  width: 44px; height: 44px; margin: -22px; border: 0; border-radius: 50%;
  color: #fff; font: bold 15px/1 system-ui; text-align: center;
  background: radial-gradient(circle, var(--pin-color, #534381) 0 18px, white 19px 20px, transparent 21px);
  box-shadow: none; cursor: pointer; padding: 0;
}
.community-markers[hidden], .community-pin[hidden] { display: none !important; }
.community-help {
  position: absolute; inset: auto .5rem .5rem; display: flex; align-items: center; gap: .5rem;
  justify-content: space-between; padding: .4rem; border-radius: .5rem;
  background: #fff; color: #183841; font-size: .875rem;
}


:is(.community-pin, .community-types button)[data-type="accident"] { --pin-color: #a5232e; }
:is(.community-pin, .community-types button)[data-type="closure"] { --pin-color: #824510; }
:is(.community-pin, .community-types button)[data-type="traffic_light"] { --pin-color: #165e69; }
:is(.community-pin, .community-types button)[data-type="hazard"] { --pin-color: #7a3c00; }
.community-dialog h3 { font-size: 1rem; margin-bottom: .4rem; }
.community-launch:not(:disabled) { background: #175a62; color: white; }

.community-pin svg { display: block; width: 28px; height: 28px; margin: auto; pointer-events: none; }

.community-launch {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  border-radius: 2rem; padding-inline: .9rem; box-shadow: 0 3px 10px #103b492b;
}
.community-launch::before {
  content: "+"; display: grid; place-items: center; width: 1.35rem; height: 1.35rem;
  border-radius: 50%; background: #fff; color: #175a62; font: bold 1.1rem/1 system-ui;
}
.community-launch[aria-expanded="true"]::before { transform: rotate(45deg); }
.community-dialog:not(.is-picking) {
  border-radius: 1.1rem; border-top: 4px solid #19716f;
  box-shadow: 0 18px 60px #0c343e3d;
}
/* The pictogram is the button's visual center; the whole label is tappable. */
.community-types { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .55rem .25rem; }
body[data-theme] .community-dialog .community-types button {
  display: flex; flex-direction: column-reverse; justify-content: flex-end; align-items: center;
  gap: .4rem; padding: .3rem .1rem; margin: 0; min-width: 0; text-align: center;
  color: var(--fm-text); font-family: inherit; font-weight: 600; font-size: .86rem; line-height: 1.22;
  background: transparent; border: 0; border-radius: .9rem; box-shadow: none;
}
.community-types svg {
  box-sizing: content-box; flex: none; width: 1.75rem; height: 1.75rem; padding: .7rem;
  color: white; background: var(--pin-color, #534381); border-radius: 50%;
}
:is(.community-pin, .community-types button)[data-type="parked_vehicle"] { --pin-color: #315c88; }
:is(.community-pin, .community-types button)[data-type="damaged_road"] { --pin-color: #78552b; }
:is(.community-pin, .community-types button)[data-type="police"] { --pin-color: #255c49; }
.community-dialog button.community-sos {
  width: 100%; margin-top: 1rem; background: #fff3f1; color: #922f32; border-color: #dcb7b5;
}
.community-dialog a[href="tel:123"] {
  display: inline-flex; align-items: center; min-height: 44px; padding-inline: 1rem;
  border-radius: .5rem; background: #923537; color: white; font-weight: 700; margin-inline-end: .5rem;
}
.community-dialog section > button { margin-block: .15rem; }
.community-dialog section > p { margin-bottom: .8rem; }
.community-dialog section > h3 { font-size: 1.1rem; }
@media (hover: hover) {
  body[data-theme] .community-dialog .community-types button:hover { background: var(--fm-active); }
}
@media (max-width: 24rem) {
  .community-types { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .community-dialog:not(.is-picking) { padding: .75rem; }
}
@media (prefers-reduced-motion: no-preference) {
  .community-launch::before { transition: transform .18s ease-out; }
  .community-dialog[open]:not(.is-picking) { animation: community-expand .21s ease-out; }
  .community-dialog section:not([hidden]) { animation: community-reveal .16s ease-out; }
  @keyframes community-expand { from { opacity: 0; transform: translateY(10px) scale(.95); } }
  @keyframes community-reveal { from { opacity: .3; transform: translateY(4px); } }
}

.community-dialog:not(.is-picking) {
  font-family: ui-rounded, "Segoe UI", system-ui, sans-serif;
  border-top-color: var(--fm-edge, #b5c6cc);
}
@media (max-width: 38rem) {
  .community-dialog:not(.is-picking) {
    position: fixed; inset: auto 0 0; width: 100%; max-width: 100%; margin: 0;
    border-radius: 1.6rem 1.6rem 0 0; padding: 1rem 1rem max(1rem, env(safe-area-inset-bottom));
  }
}
