/* Mapa das estações (webapp e landing). Mesmo arquivo nos dois sites; usa as
   variáveis de cor de cada um (--card/--fg no app, --paper/--ink na landing). */
.cbm, .cb-station-specs, .cb-station-directions {
  --cbm-bg: var(--card, var(--paper, #fff));
  --cbm-fg: var(--fg, var(--ink, #262B29));
  --cbm-muted: var(--muted, #5A6A64);
  --cbm-line: var(--line, #DCE3DC);
  --cbm-brand: var(--cerrado, #123B31);
  --cbm-action: var(--ipe, #F6B40E);
  --cbm-ok: #123B31; --cbm-busy: #F6B40E; --cbm-off: #7E8984; --cbm-bad: #262B29;
  min-width: 0;
}
.cbm-toolbar { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: end; margin: 0 0 8px; padding: 12px; border: 1px solid var(--cbm-line); border-radius: 16px; background: var(--cal, var(--cbm-bg)); box-shadow: 0 6px 20px rgba(18,59,49,.06); }
.cbm-toolbar label { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; min-height: 44px; }
.cbm-toolbar input[type="checkbox"] { accent-color: var(--cbm-brand); }
.cbm-toolbar .cbm-search { display: flex; flex: 1 1 260px; flex-direction: column; align-items: stretch; gap: 4px; }
.cbm-search span { font-size: 12px; color: var(--cbm-muted); }
.cbm-search input { width: 100%; min-height: 42px; padding: 8px 12px; border: 1px solid var(--cbm-line); border-radius: 10px; background: var(--cbm-bg); color: var(--cbm-fg); font: inherit; }
.cbm-search input:hover { border-color: color-mix(in srgb, var(--cbm-brand) 44%, var(--cbm-line)); }
.cbm-search input:focus-visible { outline: 3px solid var(--ipe, #F6B40E); outline-offset: 2px; }
.cbm-map { height: clamp(340px, 58vh, 560px); border-radius: 18px; border: 1px solid var(--cbm-line); overflow: hidden; background: var(--cal, #F3F5EF); z-index: 0; box-shadow: 0 12px 30px rgba(18,59,49,.1); }
.cbm-map .leaflet-tile-pane { filter: saturate(.66) contrast(.98) brightness(1.025); }
.cbm-map--small { height: 220px; }
.cbm-msg { margin: 8px 0; padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--cbm-action) 46%, transparent); border-radius: 12px; background: color-mix(in srgb, var(--cbm-action) 22%, var(--cbm-bg)); color: var(--cbm-fg); font-size: 14px; }
.cbm-refresh { min-height: 22px; margin: 2px 2px 8px; color: var(--cbm-muted); font-size: 12px; }
.cbm-refresh [data-cbm-stale] { color: var(--cbm-busy); font-weight: 700; }
.cbm-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 12px; margin-top: 14px; }
.cbm-card { background: var(--cbm-bg); color: var(--cbm-fg); border: 1px solid var(--cbm-line); border-radius: 14px; padding: 14px; min-width: 0; transition: border-color .16s ease, box-shadow .16s ease; }
.cbm-card--selected { border-color: var(--cbm-brand); box-shadow: 0 0 0 2px color-mix(in srgb, var(--cbm-brand) 18%, transparent); }
.cbm-empty { color: var(--cbm-muted); }

.cbm-info { min-width: 0; overflow-wrap: anywhere; }
.cbm-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.cbm-name { margin: 0; font-family: var(--f-display, inherit); font-size: 15px; line-height: 1.3; color: inherit; letter-spacing: -.01em; }
.cbm-addr, .cbm-facts, .cbm-notes { margin: 6px 0 0; font-size: 14px; color: var(--cbm-muted); line-height: 1.45; }
.cbm-notes { font-style: italic; }
.cbm-specs { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; }
.cbm-spec { display: inline-block; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--cbm-line); font-size: 12px; font-weight: 700; }
.cbm-status { flex: 0 0 auto; display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; color: #fff; white-space: nowrap; }
.cbm-status--available { background: var(--cbm-ok); }
.cbm-status--busy { background: var(--cbm-busy); color: var(--cbm-brand); }
.cbm-status--unavailable { background: var(--cbm-bad); }
.cbm-status--offline { background: var(--cbm-line); color: var(--cbm-fg); }
.cbm-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.cbm-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 8px 12px; border-radius: 10px;
  border: 1.5px solid var(--cbm-line); background: transparent; color: inherit; font: inherit; font-size: 14px; font-weight: 700; text-decoration: none; cursor: pointer; }
.cbm-btn--primary { background: var(--cbm-action); border-color: var(--cbm-action); color: var(--cbm-brand); }
.cbm-btn--link { border-color: transparent; text-decoration: underline; padding-inline: 4px; }
.cbm-btn:focus-visible { outline: 3px solid var(--ipe, #F6B40E); outline-offset: 2px; }
.cbm-btn:disabled { opacity: .6; cursor: wait; }
.cbm-view-toggle { display: none; gap: 4px; padding: 3px; border: 1px solid var(--cbm-line); border-radius: 12px; background: var(--cal, var(--cbm-bg)); }
.cbm-view-toggle .cbm-btn { min-height: 36px; padding: 6px 12px; border-color: transparent; }
.cbm-view-toggle .cbm-btn[aria-pressed="true"] { background: var(--cbm-brand); color: #fff; }

/* Pinos da marca: verde para livre, amarelo para ocupado e tons de asfalto
   para indisponível/offline. O contorno e a forma preservam o contraste. */
.cbm-pin { background: none; border: 0; }
.cbm-pin__dot { position: relative; display: block; width: 28px; height: 28px; margin: 1px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  background: #fff; border: 2px solid var(--cbm-brand); box-shadow: 0 3px 10px rgba(18,59,49,.28); }
.cbm-pin__dot::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--cbm-off); }
.cbm-pin--available .cbm-pin__dot::after { background: var(--cbm-ok); }
.cbm-pin--busy .cbm-pin__dot::after { background: var(--cbm-busy); }
.cbm-pin--unavailable .cbm-pin__dot::after { background: var(--cbm-bad); }
.cbm-pin--offline .cbm-pin__dot { border-color: var(--cbm-off); border-style: dashed; }
.cbm-pin--offline .cbm-pin__dot::after { background: var(--cbm-off); }
.cbm-pin--selected .cbm-pin__dot { transform: rotate(-45deg) scale(1.12); box-shadow: 0 0 0 3px var(--cbm-action), 0 4px 12px rgba(18,59,49,.3); }
.cbm-me { fill: #8CC3EC; fill-opacity: .96; stroke: #123B31; stroke-width: 3; filter: drop-shadow(0 1px 3px rgba(18,59,49,.35)); }

.cbm-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 8px 0 0; padding: 0; list-style: none; font-size: 13px; color: var(--cbm-muted); }
.cbm-legend li { display: inline-flex; align-items: center; gap: 6px; }
.cbm-legend i { width: 10px; height: 10px; border-radius: 50%; background: var(--cbm-off); display: inline-block; }
.cbm-legend .available { background: var(--cbm-ok); } .cbm-legend .busy { background: var(--cbm-busy); }
.cbm-legend .unavailable { background: var(--cbm-bad); }

/* Controles, créditos e popup do Leaflet acompanham a identidade da marca. */
.cbm .leaflet-bar { border: 1px solid var(--cbm-line); border-radius: 12px; overflow: hidden; box-shadow: 0 4px 14px rgba(18,59,49,.14); }
.cbm .leaflet-bar a, .cbm .leaflet-bar a:hover, .cbm .leaflet-bar a:focus { background: var(--cal, var(--cbm-bg)); color: var(--cbm-brand); border-bottom-color: var(--cbm-line); }
.cbm .leaflet-bar a:hover, .cbm .leaflet-bar a:focus { background: color-mix(in srgb, var(--cbm-action) 22%, var(--cbm-bg)); }
.cbm .leaflet-popup-content-wrapper, .cbm .leaflet-popup-tip { background: var(--cbm-bg); color: var(--cbm-fg); box-shadow: 0 8px 24px rgba(18,59,49,.18); }
.cbm .leaflet-popup-content-wrapper { border: 1px solid var(--cbm-line); border-radius: 14px; }
.cbm .leaflet-popup-content { margin: 12px 14px; font-family: var(--f-body, inherit); }
.cbm .leaflet-popup-close-button { color: var(--cbm-brand) !important; }
.cbm .leaflet-control-attribution { color: var(--cbm-muted); background: rgba(243,245,239,.94); border-top-left-radius: 8px; }
.cbm .leaflet-control-attribution a { color: var(--cbm-brand); }
.cbm .leaflet-container a.cbm-btn { color: inherit; }
.cbm .leaflet-container a.cbm-btn--primary { color: var(--cbm-brand); }
.cbm .leaflet-container { font-family: var(--f-body, inherit); }

@media (max-width: 720px) {
  .cbm-toolbar { align-items: stretch; gap: 8px; padding: 10px; }
  .cbm-toolbar > label:not(.cbm-search) { flex: 1 1 100%; min-height: 40px; }
  .cbm-toolbar > .cbm-btn { flex: 1 1 calc(50% - 8px); }
  .cbm-view-toggle { display: flex; flex: 1 1 100%; }
  .cbm-view-toggle .cbm-btn { flex: 1; }
  .cbm[data-cbm-view="map"] [data-cbm-list], .cbm[data-cbm-view="map"] .cbm-legend { display: none; }
  .cbm[data-cbm-view="list"] [data-cbm-map], .cbm[data-cbm-view="list"] .cbm-legend { display: none; }
  .cbm-map { height: min(55svh, 480px); min-height: 340px; border-radius: 15px; }
  .cbm-list { grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: 10px; }
  .cbm-card { padding: 12px; }
  .cbm-card .cbm-actions .cbm-btn { flex: 1 1 auto; }
}

/* Tela do conector (webapp) */
.cb-station-addr { margin-top: 0; }
.cb-station-specs { margin: 0 0 10px; }
.cb-station-directions { margin: 0 0 12px; }
.cbm .cbm-map--small { margin-bottom: 12px; }
.cb-energy-details { margin-top: 8px; }
.cb-energy-details summary { cursor: pointer; color: var(--cbm-brand); font-size: 14px; font-weight: 700; }
.cb-energy-details p { margin-bottom: 0; }
