/* RASTREACRE V39 — FICHA DEFINITIVA REORGANIZADA
   Uma unica camada: sem V32-V37. Somente variaveis dos temas.
   Nao altera logica de rastreamento nem comandos. */
body.map61-body #detailPanel.rt38-card {
  position:absolute!important;
  left:var(--rt38-left, 294px)!important;
  right:12px!important;
  bottom:10px!important;
  top:auto!important;
  width:auto!important;
  height:120px!important;
  min-height:120px!important;
  max-height:none!important;
  padding:9px 36px 9px 11px!important;
  box-sizing:border-box!important;
  display:grid!important;
  grid-template-columns:minmax(190px, 24%) minmax(245px, 28%) minmax(0, 1fr)!important;
  grid-template-rows:100px!important;
  gap:12px!important;
  align-items:stretch!important;
  overflow:hidden!important;
  background:var(--rt-card,#fff)!important;
  color:var(--rt-text,#18221c)!important;
  border:1px solid var(--rt-line,#d9dfdb)!important;
  border-radius:12px!important;
  box-shadow:var(--rt-shadow,0 5px 20px rgba(0,0,0,.12))!important;
}
body.map61-body #detailPanel.rt38-card.hidden{display:none!important}
body.map61-body #detailPanel.rt38-card *{box-sizing:border-box}
body.map61-body #detailPanel.rt38-card .rt38-identity{
  grid-column:1;min-width:0;display:flex;flex-direction:column;gap:2px;
  overflow:hidden;
}
body.map61-body #detailPanel.rt38-card .rt38-status{height:15px;display:flex;align-items:center}
body.map61-body #detailPanel.rt38-card .rt38-status .badge56{
  font-size:8px!important;line-height:12px!important;padding:0 5px!important;min-height:12px!important;
}
body.map61-body #detailPanel.rt38-card #detailTitle{
  margin:0!important;font-size:16px!important;line-height:18px!important;
  color:var(--rt-text)!important;font-weight:800!important;
}
body.map61-body #detailPanel.rt38-card #detailSubtitle{
  margin:0 0 3px!important;font-size:9px!important;line-height:12px!important;
  color:var(--rt-muted)!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
body.map61-body #detailPanel.rt38-card .rt38-field{
  display:grid;grid-template-columns:49px minmax(0,1fr);gap:4px;
  align-items:start;border-bottom:1px solid var(--rt-line);min-width:0;
  font-size:9px;line-height:14px;
}
body.map61-body #detailPanel.rt38-card .rt38-field span{color:var(--rt-muted)}
body.map61-body #detailPanel.rt38-card .rt38-field b{
  color:var(--rt-text);font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
  min-width:0;
}
body.map61-body #detailPanel.rt38-card .rt38-address b{
  white-space:normal;display:-webkit-box;-webkit-box-orient:vertical;
  -webkit-line-clamp:2;line-clamp:2;overflow:hidden;line-height:12px;
  overflow-wrap:anywhere;
}
body.map61-body #detailPanel.rt38-card .rt38-operations{
  min-width:0;display:grid;grid-template-rows:29px 76px;gap:7px;
  position:relative;
}
body.map61-body #detailPanel.rt38-card #commandSection.rt38-buttons{
  position:static!important;inset:auto!important;transform:none!important;
  width:100%!important;min-width:0!important;height:29px!important;
  display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;
  grid-template-rows:29px!important;gap:3px!important;
  padding:0!important;margin:0!important;background:transparent!important;
}
body.map61-body #detailPanel.rt38-card #commandSection.rt38-buttons > *{
  display:flex!important;align-items:center!important;justify-content:center!important;
  flex-direction:row!important;gap:2px!important;min-width:0!important;
  width:100%!important;height:29px!important;min-height:29px!important;
  margin:0!important;padding:2px!important;
  border-radius:7px!important;font-size:9px!important;line-height:1!important;
  text-decoration:none!important;white-space:nowrap!important;
}
body.map61-body #detailPanel.rt38-card #commandSection.rt38-buttons .material-symbols-rounded{
  font-size:13px!important;line-height:14px!important;
}
body.map61-body #detailPanel.rt38-card #commandSection.rt38-buttons b{
  font-size:9px!important;line-height:12px!important;font-weight:700!important;
}
body.map61-body #detailPanel.rt38-card .rt38-stats{
  min-width:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));
  grid-template-rows:repeat(2,minmax(0,1fr));gap:4px;
}
body.map61-body #detailPanel.rt38-card .rt38-stats article{
  min-width:0;min-height:0;padding:4px 7px;border:1px solid var(--rt-line);
  border-radius:6px;background:var(--rt-surface-2,var(--rt-card));
  display:flex;flex-direction:column;justify-content:center;gap:2px;
}
body.map61-body #detailPanel.rt38-card .rt38-stats article span{
  font-size:8px;line-height:10px;text-transform:uppercase;color:var(--rt-muted);
}
body.map61-body #detailPanel.rt38-card .rt38-stats article strong{
  font-size:11px;line-height:13px;color:var(--rt-text);white-space:nowrap;
  overflow:hidden;text-overflow:ellipsis;
}
body.map61-body #detailPanel.rt38-card .rt38-sensors{
  min-width:0;display:flex;flex-direction:column;gap:5px;
  padding-top:0;overflow:hidden;
}
body.map61-body #detailPanel.rt38-card .rt38-sensors h3{
  margin:0!important;padding:0!important;line-height:11px!important;
  font-size:9px!important;font-weight:700;color:var(--rt-muted);
  text-transform:uppercase;flex:0 0 11px;
}
body.map61-body #detailPanel.rt38-card .rt38-sensor-row{
  min-width:0;display:grid;grid-template-columns:repeat(7,minmax(0,1fr));
  grid-template-rows:78px;gap:4px;flex:0 0 78px;height:78px;overflow:hidden;
}
body.map61-body #detailPanel.rt38-card .rt38-sensor{
  min-width:0;min-height:0;display:flex;flex-direction:column;
  align-items:center;justify-content:center;gap:2px;
  padding:2px 1px;border:1px solid var(--rt-line);
  border-radius:6px;background:var(--rt-surface-2,var(--rt-card));
  text-align:center;overflow:hidden;
}
body.map61-body #detailPanel.rt38-card .rt38-sensor .material-symbols-rounded{
  font-size:14px!important;line-height:15px!important;color:var(--rt-green);
}
body.map61-body #detailPanel.rt38-card .rt38-sensor b{
  display:block;max-width:100%;font-size:9px!important;line-height:11px!important;
  color:var(--rt-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
body.map61-body #detailPanel.rt38-card .rt38-sensor small{
  display:block;max-width:100%;font-size:8px!important;line-height:10px!important;
  color:var(--rt-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
body.map61-body #detailPanel.rt38-card #closeDetail.rt38-close{
  position:absolute!important;right:7px!important;top:7px!important;
  width:25px!important;height:25px!important;min-height:25px!important;
  padding:0!important;display:grid!important;place-items:center!important;
  border-radius:6px!important;color:var(--rt-text)!important;
  background:var(--rt-surface-2,var(--rt-card))!important;
  border:1px solid var(--rt-line)!important;
}
body.map61-body #detailPanel.rt38-card #closeDetail .material-symbols-rounded{font-size:18px!important}
body.map61-body #detailPanel.rt38-card .rt38-internal,
body.map61-body #detailPanel.rt38-card .rt38-location-tools{display:none!important}
body.map61-body #detailPanel.rt38-card .rt38-message:not(:empty){
  position:absolute;top:34px;left:0;right:0;z-index:2;
  background:var(--rt-card);color:var(--rt-text);border:1px solid var(--rt-line);
  border-radius:6px;padding:4px;font-size:10px;
}
@media (min-width:851px) and (max-width:1200px){
  body.map61-body #detailPanel.rt38-card{
    grid-template-columns:minmax(170px,25%) minmax(215px,30%) minmax(0,1fr)!important;
    gap:7px!important;padding-left:9px!important;
  }
  body.map61-body #detailPanel.rt38-card .rt38-sensor-row{
    overflow-x:auto;grid-template-columns:repeat(7,minmax(60px,1fr));
  }
}
@media (max-width:850px){
  body.map61-body #detailPanel.rt38-card{
    left:8px!important;right:8px!important;bottom:8px!important;
    height:auto!important;min-height:0!important;max-height:min(74vh,420px)!important;
    padding:10px!important;overflow:auto!important;
    grid-template-columns:1fr!important;grid-template-rows:auto!important;gap:8px!important;
  }
  body.map61-body #detailPanel.rt38-card .rt38-identity{max-height:none}
  body.map61-body #detailPanel.rt38-card .rt38-operations{grid-template-rows:32px 85px}
  body.map61-body #detailPanel.rt38-card .rt38-sensors{padding-top:0}
  body.map61-body #detailPanel.rt38-card .rt38-sensor-row{
    min-height:64px;overflow-x:auto;grid-template-columns:repeat(7,minmax(72px,1fr));
  }
}

/* V39: travas de geometria para impedir crescimento dos sensores e da ficha */
body.map61-body #detailPanel.rt38-card.rt38-card {
  grid-auto-rows:0!important;
  align-content:start!important;
  min-width:0!important;
}
body.map61-body #detailPanel.rt38-card .rt38-identity,
body.map61-body #detailPanel.rt38-card .rt38-operations,
body.map61-body #detailPanel.rt38-card .rt38-sensors{
  height:100px!important;min-height:0!important;max-height:100px!important;
  margin:0!important;
}
body.map61-body #detailPanel.rt38-card .rt38-operations{
  grid-template-rows:27px 66px!important;gap:6px!important;
}
body.map61-body #detailPanel.rt38-card .rt38-stats{
  height:66px!important;min-height:0!important;
  grid-template-rows:repeat(2,31px)!important;gap:4px!important;
}
body.map61-body #detailPanel.rt38-card .rt38-stats article{
  height:31px!important;min-height:0!important;padding:2px 6px!important;
}
body.map61-body #detailPanel.rt38-card .rt38-sensors{
  display:grid!important;grid-template-rows:12px 64px!important;
  align-content:start!important;gap:5px!important;
  padding-top:15px!important;min-width:0!important;
}
body.map61-body #detailPanel.rt38-card .rt38-sensors h3{
  height:13px!important;min-height:0!important;line-height:13px!important;
}
body.map61-body #detailPanel.rt38-card .rt38-sensor-row{
  height:64px!important;min-height:0!important;max-height:64px!important;
  grid-template-rows:64px!important;align-items:stretch!important;
}
body.map61-body #detailPanel.rt38-card .rt38-sensor{
  height:64px!important;min-height:0!important;max-height:64px!important;
  align-self:stretch!important;
}
body.map61-body #detailPanel.rt38-card .rt38-address .rt39-address-link{
  min-width:0;display:flex;align-items:flex-start;gap:3px;
  color:var(--rt-green,var(--rt-text))!important;text-decoration:none;
  font-weight:600;font-size:9px;line-height:12px;
}
body.map61-body #detailPanel.rt38-card .rt38-address .rt39-address-link:hover{
  text-decoration:underline;
}
body.map61-body #detailPanel.rt38-card .rt38-address #dAddress{
  min-width:0;display:-webkit-box;-webkit-box-orient:vertical;
  -webkit-line-clamp:2;line-clamp:2;overflow:hidden;overflow-wrap:anywhere;
}
body.map61-body #detailPanel.rt38-card .rt39-external{
  flex:none;font-size:12px!important;line-height:12px!important;
}
body.map61-body #detailPanel.rt38-card .rt39-address-link[aria-disabled="true"]{
  pointer-events:none;opacity:.6;text-decoration:none;
}
@media(max-width:850px){
 body.map61-body #detailPanel.rt38-card{
  height:auto!important;min-height:0!important;
  grid-template-rows:auto!important;grid-auto-rows:auto!important;
 }
 body.map61-body #detailPanel.rt38-card .rt38-identity,
 body.map61-body #detailPanel.rt38-card .rt38-operations,
 body.map61-body #detailPanel.rt38-card .rt38-sensors{
  height:auto!important;min-height:0!important;max-height:none!important;
 }
 body.map61-body #detailPanel.rt38-card .rt38-operations{
  grid-template-rows:27px 66px!important;
 }
 body.map61-body #detailPanel.rt38-card .rt38-sensors{
  padding-top:0!important;grid-template-rows:12px 64px!important;
 }
}

/* V40: a altura deve ser calculada pela ficha, nunca pelo CSS legado. */
@media (min-width:851px){
  html body.map61-body aside#detailPanel.rt38-card:not(.hidden){
    position:fixed!important;
    top:auto!important;bottom:9px!important;
    height:120px!important;min-height:0!important;max-height:120px!important;
    grid-template-rows:100px!important;grid-auto-rows:0!important;
    align-content:start!important;overflow:hidden!important;
  }
}
