/* Macro Map · MODE · TRAFFIC CAMS · fase 1 (shell · fit EUA · zero pins) */

#ih-panel-macro-map[data-mm-mode="traffic_cams"] {
  --tcam-accent: #4A8FA0;
  --tcam-mint: #3FE3BC;
  --tcam-coral: #E85C5C;
  --tcam-bg: #07090c;
  --tcam-panel: rgba(8, 10, 14, 0.96);
  --tcam-line: rgba(74, 143, 160, 0.38);
  --tcam-muted: #7a8494;
  --tcam-dock-h: 248px;
  --tcam-foot-h: 58px;
  --tcam-film-h: 62px;
}

#ih-panel-macro-map[data-mm-mode="traffic_cams"] .ih-map-stage {
  background: #05070a !important;
  border: 1px solid rgba(40, 48, 58, 0.95) !important;
  overflow: hidden;
}

#ih-panel-macro-map[data-mm-mode="traffic_cams"] #cal-map-host,
body.ih-hub-full #view-caleco.ih-view.active.ih-show-calendar #ih-panel-macro-map[data-mm-mode="traffic_cams"] #cal-map-host,
#view-caleco.ih-show-calendar #ih-panel-macro-map[data-mm-mode="traffic_cams"] #cal-map-host {
  background: #0a121c !important;
  inset: auto !important;
  top: var(--tcam-film-h) !important;
  left: 0 !important;
  right: 0 !important;
  bottom: calc(var(--tcam-dock-h) + var(--tcam-foot-h)) !important;
  height: auto !important;
  width: auto !important;
  min-height: 160px !important;
  z-index: 1 !important;
}

#ih-panel-macro-map[data-mm-mode="traffic_cams"] #cal-map-host .ih-mm-maplibre,
#ih-panel-macro-map[data-mm-mode="traffic_cams"] #cal-map-ml {
  background: #0a121c !important;
  bottom: 0 !important;
  height: 100% !important;
  left: 0 !important;
  position: absolute !important;
  right: 0 !important;
  top: 0 !important;
  width: 100% !important;
}

#ih-panel-macro-map[data-mm-mode="traffic_cams"] #cal-map-ml,
#ih-panel-macro-map[data-mm-mode="traffic_cams"] .maplibregl-canvas-container,
#ih-panel-macro-map[data-mm-mode="traffic_cams"] .maplibregl-canvas {
  cursor: grab;
  pointer-events: auto !important;
  touch-action: none;
}

#ih-panel-macro-map[data-mm-mode="traffic_cams"] .ih-mm-kpi,
#ih-panel-macro-map[data-mm-mode="traffic_cams"] .ih-mm-sessions,
#ih-panel-macro-map[data-mm-mode="traffic_cams"] #ih-mm-disaster-foot,
#ih-panel-macro-map[data-mm-mode="traffic_cams"] .ih-module-bar,
#ih-panel-macro-map[data-mm-mode="traffic_cams"] #ih-mm-data-source,
#ih-panel-macro-map[data-mm-mode="traffic_cams"] #ih-mm-eq-legend,
#ih-panel-macro-map[data-mm-mode="traffic_cams"] .ih-mm-layer-menu {
  display: none !important;
  pointer-events: none !important;
}

#ih-panel-macro-map[data-mm-mode="traffic_cams"] #ih-mm-bmap {
  display: flex !important;
  opacity: 1 !important;
  pointer-events: none !important;
  visibility: visible !important;
  z-index: 130 !important;
}
#ih-panel-macro-map[data-mm-mode="traffic_cams"] #ih-mm-bmap .ih-mm-bmap__chrome,
#ih-panel-macro-map[data-mm-mode="traffic_cams"] #ih-mm-bmap.is-open .ih-mm-bmap__list,
#ih-panel-macro-map[data-mm-mode="traffic_cams"] #ih-mm-bmap.is-open .ih-mm-bmap__q {
  pointer-events: auto;
}

#ih-panel-macro-map[data-mm-mode="traffic_cams"] .ih-mm-film {
  background: #07090c !important;
  border-bottom: 1px solid rgba(74, 143, 160, 0.32) !important;
  left: 0;
  padding: 0 !important;
  right: 0;
  z-index: 14;
}

#ih-panel-macro-map[data-mm-mode="traffic_cams"] .ih-mm-film__gct-word {
  color: var(--tcam-accent);
  font: 800 24px/1 "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  letter-spacing: 0.06em;
}

#ih-panel-macro-map[data-mm-mode="traffic_cams"] .ih-mm-film__gct-product {
  color: #ebe5d8;
  font: 600 16px/1.25 "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

#ih-panel-macro-map[data-mm-mode="traffic_cams"] .ih-mm-film__mode-center {
  color: var(--tcam-accent) !important;
  font: 700 20px/1.2 "Segoe UI", "Helvetica Neue", Arial, sans-serif !important;
  letter-spacing: 0.16em !important;
}

#ih-panel-macro-map .ih-mm-tcam-dock {
  align-items: stretch;
  background: var(--tcam-panel, rgba(8, 10, 14, 0.96));
  border-top: 1px solid var(--tcam-line, rgba(74, 143, 160, 0.38));
  bottom: var(--tcam-foot-h, 54px);
  display: flex;
  flex-direction: row;
  gap: 18px;
  height: var(--tcam-dock-h, 168px);
  left: 0;
  overflow: hidden;
  padding: 10px 16px 8px;
  pointer-events: auto;
  position: absolute;
  right: 0;
  z-index: 12;
}

#ih-panel-macro-map .ih-mm-tcam-rail {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 10px 22px;
  min-width: 0;
  overflow: hidden;
  pointer-events: auto;
}

#ih-panel-macro-map .ih-mm-tcam-rail[hidden],
#ih-panel-macro-map .ih-mm-tcam-dock[hidden],
#ih-panel-macro-map .ih-mm-tcam-foot[hidden] {
  display: none !important;
}

#ih-panel-macro-map .ih-mm-tcam-rail__hd {
  color: var(--tcam-muted, #7a8494);
  font: 700 15px/1.2 "Segoe UI", sans-serif;
  letter-spacing: 0.12em;
  margin-bottom: 8px;
}

#ih-panel-macro-map .ih-mm-tcam-rail__empty {
  display: none;
}

#ih-panel-macro-map .ih-mm-tcam-regions {
  display: grid;
  gap: 8px 10px;
  grid-auto-columns: max-content;
  grid-auto-flow: column;
  grid-template-rows: repeat(4, auto);
  max-width: none;
  width: max-content;
}

#ih-panel-macro-map .ih-mm-tcam-chip {
  background: #1c2128;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  box-shadow: inset 0 -3px 0 transparent;
  color: #9aa3ab;
  cursor: pointer;
  font: 700 16px/1.2 "Segoe UI", sans-serif;
  letter-spacing: 0.03em;
  min-height: 40px;
  min-width: 132px;
  opacity: 1;
  padding: 8px 14px 10px;
  text-align: center;
  white-space: nowrap;
}

#ih-panel-macro-map .ih-mm-tcam-rail > section:first-child .ih-mm-tcam-chip {
  font-size: 15px;
  min-height: 38px;
  min-width: 0;
}

#ih-panel-macro-map .ih-mm-tcam-chip.is-on {
  background: #2a313a;
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 -3px 0 #4A8FA0;
  color: #fff;
}

#ih-panel-macro-map .ih-mm-tcam-chip:hover:not(.is-on) {
  background: #242a32;
  color: #d7dde4;
}

#ih-panel-macro-map .ih-mm-tcam-query {
  display: flex;
  flex: 0 0 248px;
  flex-direction: column;
  gap: 4px;
  min-height: 0;
  min-width: 0;
}

#ih-panel-macro-map .ih-mm-tcam-query input {
  background: #1c2128;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  color: #fff;
  font: 600 14px/1.2 "Segoe UI", sans-serif;
  padding: 6px 8px;
  width: 100%;
}

#ih-panel-macro-map .ih-mm-tcam-query input::placeholder {
  color: #7a8494;
}

#ih-panel-macro-map .ih-mm-tcam-query__note {
  color: #7a8494;
  font: 600 12px/1.2 "Segoe UI", sans-serif;
  letter-spacing: 0.04em;
  min-height: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#ih-panel-macro-map .ih-mm-tcam-query__list {
  flex: 1 1 auto;
  list-style: none;
  margin: 0;
  min-height: 0;
  overflow: auto;
  padding: 0;
}

#ih-panel-macro-map .ih-mm-tcam-query__list button {
  background: transparent;
  border: 0;
  color: #d7dde4;
  cursor: pointer;
  font: 600 13px/1.35 "Segoe UI", sans-serif;
  padding: 2px 0;
  text-align: left;
  width: 100%;
}

#ih-panel-macro-map .ih-mm-tcam-query__list button:hover {
  color: #fff;
}

#ih-panel-macro-map .ih-mm-tcam-dock__meta {
  align-items: flex-end;
  display: flex;
  flex: 0 0 auto;
  margin-left: auto;
}

#ih-panel-macro-map .ih-mm-tcam-clock-lab {
  color: var(--tcam-muted, #7a8494);
  font: 700 12px/1.2 "Segoe UI", sans-serif;
  letter-spacing: 0.1em;
}

#ih-panel-macro-map .ih-mm-tcam-clock {
  color: var(--tcam-accent, #4A8FA0);
  font: 700 22px/1.2 "Segoe UI", sans-serif;
}

#ih-panel-macro-map .ih-mm-tcam-foot {
  align-items: center;
  background: #07090c;
  border-top: 1px solid rgba(74, 143, 160, 0.28);
  bottom: 0;
  color: var(--tcam-muted, #7a8494);
  display: flex;
  font: 600 16px/1 "Segoe UI", sans-serif;
  gap: 16px;
  height: var(--tcam-foot-h, 54px);
  left: 0;
  letter-spacing: 0.08em;
  padding: 0 16px;
  pointer-events: auto;
  position: absolute;
  right: 0;
  z-index: 12;
}

#ih-panel-macro-map .ih-mm-tcam-foot button {
  background: transparent;
  border: 0;
  color: var(--tcam-accent, #4A8FA0);
  cursor: pointer;
  font: 700 16px/1 "Segoe UI", sans-serif;
}

#ih-panel-macro-map:has(#ih-mm-region-foot:not([hidden])) .ih-mm-tcam-foot {
  bottom: var(--mm-region-foot-h, 60px) !important;
}
#ih-panel-macro-map:has(#ih-mm-region-foot:not([hidden])) .ih-mm-tcam-dock {
  bottom: calc(var(--tcam-foot-h, 54px) + var(--mm-region-foot-h, 60px)) !important;
}

.ih-mm-eq-popup.ih-mm-eq-popup--tcam-tip .maplibregl-popup-content {
  background: rgba(10, 14, 20, 0.96);
  border: 1px solid rgba(255, 107, 107, 0.35);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
  font: 15px/1.35 "IBM Plex Sans", system-ui, sans-serif;
  max-width: 280px;
  min-width: 0;
  overflow: hidden;
  padding: 12px 14px;
  width: max-content;
}

.ih-mm-eq-popup.ih-mm-eq-popup--tcam-tip .ih-mm-tcam-tip {
  max-width: 252px;
}

.ih-mm-eq-popup.ih-mm-eq-popup--tcam-tip .ih-mm-tcam-tip b {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.ih-mm-eq-popup.ih-mm-eq-popup--tcam-tip .ih-mm-tcam-tip div {
  font-size: 12px;
  line-height: 1.35;
}

/* Card sticky: centro do mapa (JS força left/top/transform); sem seta. */
.ih-mm-eq-popup.ih-mm-eq-popup--tcam {
  margin: 0 !important;
  width: auto !important;
  height: auto !important;
  max-width: none !important;
  max-height: none !important;
  pointer-events: auto;
  z-index: 40;
}
.ih-mm-eq-popup.ih-mm-eq-popup--tcam .maplibregl-popup-tip {
  display: none !important;
}

.ih-mm-eq-popup.ih-mm-eq-popup--tcam .maplibregl-popup-content {
  background: #07090c;
  border: 1px solid var(--tcam-line, rgba(74, 143, 160, 0.38));
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  font: 21px/1.35 "IBM Plex Sans", system-ui, sans-serif;
  min-height: 0;
  min-width: 0;
  /* Sem scroll no content — o rodapé fica sempre dentro da altura do clamp.
     (sticky falha: MapLibre aplica transform no popup.) */
  overflow: hidden !important;
  padding: 0;
  width: 100% !important;
  height: auto !important;
  max-width: none !important;
  max-height: none !important;
}

.ih-mm-eq-popup.ih-mm-eq-popup--tcam .maplibregl-popup-close-button {
  color: var(--tcam-accent, #4A8FA0);
  font-size: 31px;
  padding: 6px 14px;
  right: 8px;
  top: 8px;
  z-index: 6;
}

.ih-mm-tcam-card {
  background: #07090c;
  color: #ebe5d8;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  overflow: hidden;
  position: relative;
  width: 100%;
}

.ih-mm-tcam-card__hd {
  align-items: center;
  border-bottom: 1px solid var(--tcam-line, rgba(74, 143, 160, 0.38));
  display: grid;
  gap: 14px;
  grid-template-columns: auto 1fr auto;
  padding: 14px 67px 14px 20px;
}

.ih-mm-tcam-card__camid {
  color: var(--tcam-accent, #4A8FA0);
  font: 700 22px/1 "IBM Plex Mono", ui-monospace, monospace;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.ih-mm-tcam-card__uplink {
  color: var(--tcam-muted, #7a8494);
  font: 600 20px/1 "IBM Plex Mono", ui-monospace, monospace;
  letter-spacing: 0.12em;
  text-align: center;
  text-transform: uppercase;
}

.ih-mm-tcam-card__secure {
  color: var(--tcam-mint, #3FE3BC);
  font: 700 20px/1 "IBM Plex Mono", ui-monospace, monospace;
  letter-spacing: 0.1em;
}

.ih-mm-tcam-card__place {
  align-items: center;
  display: flex;
  gap: 20px;
  padding: 20px 22px 17px;
}

.ih-mm-tcam-card__flag {
  align-items: center;
  background: rgba(74, 143, 160, 0.16);
  border: 1px solid var(--tcam-line, rgba(74, 143, 160, 0.38));
  border-radius: 50%;
  color: var(--tcam-accent, #4A8FA0);
  display: inline-flex;
  flex: 0 0 62px;
  font: 700 20px/1 "IBM Plex Mono", ui-monospace, monospace;
  height: 62px;
  justify-content: center;
  letter-spacing: 0.04em;
  width: 62px;
}

.ih-mm-tcam-card__place-body {
  min-width: 0;
}

.ih-mm-tcam-card__place-t {
  color: #fff;
  font: 700 31px/1.25 "IBM Plex Sans", system-ui, sans-serif;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.ih-mm-tcam-card__place-s {
  color: var(--tcam-muted, #7a8494);
  font: 600 21px/1.4 "IBM Plex Mono", ui-monospace, monospace;
  letter-spacing: 0.06em;
  margin-top: 7px;
  text-transform: uppercase;
}

.ih-mm-tcam-card__stage {
  background: #111;
  border-top: 0;
  aspect-ratio: auto;
  flex: 0 0 auto;
  height: auto;
  min-height: 0;
  overflow: hidden;
  position: relative;
  width: 100%;
}

.ih-mm-tcam-card__live {
  align-items: center;
  background: rgba(8, 10, 14, 0.82);
  border: 1px solid rgba(232, 92, 92, 0.45);
  border-radius: 3px;
  color: #ebe5d8;
  display: inline-flex;
  font: 700 18px/1 "IBM Plex Mono", ui-monospace, monospace;
  gap: 10px;
  left: 17px;
  letter-spacing: 0.08em;
  padding: 10px 14px;
  position: absolute;
  top: 17px;
  z-index: 2;
}

.ih-mm-tcam-card__live--still {
  border-color: rgba(232, 180, 74, 0.55);
  color: #E8B44A;
}

.ih-mm-tcam-card__live--still i {
  background: #E8B44A;
  box-shadow: 0 0 0 3px rgba(232, 180, 74, 0.22);
}

.ih-mm-tcam-card__live i {
  background: #E85C5C;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(232, 92, 92, 0.25);
  display: block;
  height: 10px;
  width: 10px;
}

.ih-mm-tcam-card .ih-mm-tcam-tip__img,
.ih-mm-tcam-card .ih-mm-tcam-card__vid {
  background: #111;
  display: block;
  height: 100%;
  left: 0;
  margin: 0;
  object-fit: cover;
  position: absolute;
  top: 0;
  width: 100%;
}

.ih-mm-tcam-card .ih-mm-tcam-tip__loading {
  align-items: center;
  color: #3FE3BC;
  display: flex;
  font: 600 18px/1.3 system-ui, sans-serif;
  height: 100%;
  justify-content: center;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ih-mm-tcam-card__hd,
.ih-mm-tcam-card__place,
.ih-mm-tcam-card__ft {
  flex-shrink: 0;
}

.ih-mm-tcam-card__ft {
  align-items: center;
  background: #07090c;
  border-top: 1px solid var(--tcam-line, rgba(74, 143, 160, 0.38));
  display: grid;
  flex-shrink: 0;
  gap: 17px;
  grid-template-columns: minmax(168px, 1fr) auto auto;
  padding: 17px 20px;
  position: relative;
  z-index: 5;
}

.ih-mm-tcam-card__kind {
  color: #ebe5d8;
  font: 600 21px/1.35 "IBM Plex Mono", ui-monospace, monospace;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ih-mm-tcam-card__kind div + div {
  color: var(--tcam-muted, #7a8494);
  font-size: 18px;
  margin-top: 4px;
}

.ih-mm-tcam-card__status {
  font: 700 21px/1 "IBM Plex Mono", ui-monospace, monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.ih-mm-tcam-card__status.is-live {
  color: var(--tcam-mint, #3FE3BC);
}

.ih-mm-tcam-card__status.is-off {
  color: var(--tcam-coral, #E85C5C);
}

.ih-mm-tcam-card__status.is-photo {
  color: #E8B44A;
}

.ih-mm-tcam-card__acts {
  display: flex;
  flex-wrap: wrap;
  gap: 11px;
  justify-content: flex-end;
}

.ih-mm-tcam-card__btn {
  background: transparent;
  border: 1px solid var(--tcam-accent, #4A8FA0);
  border-radius: 2px;
  color: var(--tcam-accent, #4A8FA0);
  cursor: pointer;
  font: 700 18px/1 "IBM Plex Mono", ui-monospace, monospace;
  letter-spacing: 0.06em;
  padding: 14px 20px;
  text-transform: uppercase;
  white-space: nowrap;
}

.ih-mm-tcam-card__btn--feed {
  border-color: var(--tcam-accent, #4A8FA0);
  color: var(--tcam-accent, #4A8FA0);
  opacity: 0.45;
}

.ih-mm-tcam-card__btn--feed:disabled {
  cursor: not-allowed;
}

.ih-mm-tcam-card__btn--map {
  border-color: #74DEC6;
  color: #74DEC6;
}

.ih-mm-tcam-card__btn--map:hover {
  background: rgba(116, 222, 198, 0.1);
}

.ih-mm-tcam-card .ih-mm-tcam-tip__empty {
  align-items: center;
  color: #9aa3b2;
  display: flex;
  font-size: 31px;
  height: 100%;
  justify-content: center;
  left: 0;
  margin: 0;
  position: absolute;
  top: 0;
  width: 100%;
}

.ih-mm-tcam-card .ih-mm-tcam-tip__empty[hidden] {
  display: none;
}

@media (max-width: 720px) {
  .ih-mm-tcam-card__hd {
    grid-template-columns: 1fr auto;
  }
  .ih-mm-tcam-card__uplink {
    display: none;
  }
  .ih-mm-tcam-card__ft {
    grid-template-columns: 1fr;
  }
  .ih-mm-tcam-card__acts {
    justify-content: flex-start;
  }
}
