:root {
  color-scheme: dark;
  --bg: #05080d;
  --ink: #f6f7fb;
  --muted: #91a5b6;
  --soft: #c7d6e4;
  --panel: #0b141d;
  --panel-2: #101a24;
  --line: rgba(255,255,255,.12);
  --line-strong: rgba(255,255,255,.20);
  --cyan: #19bdf2;
  --violet: #8b5cf6;
  --red: #e5402f;
  --amber: #f0b44d;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 0 0, rgba(229,64,47,.14), transparent 250px),
    radial-gradient(circle at 190px 170px, rgba(25,189,242,.11), transparent 300px),
    var(--bg);
}
.cuyum-live {
  min-height: 100svh;
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
}
.readout,
.map-panel {
  background: rgba(11,20,29,.97);
  border: 1px solid var(--line);
  box-shadow: 0 20px 46px rgba(0,0,0,.30);
  border-radius: 20px;
}
.readout {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  overflow: auto;
}
.brand-bar {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 11px;
  align-items: center;
  padding-bottom: 4px;
}
.brand-mark {
  width: 48px;
  height: 48px;
  display: block;
  flex: 0 0 48px;
  object-fit: contain;
  border-radius: 50%;
  background: transparent;
  border: 0;
  outline: none;
  box-shadow: none;
}
.brand-copy { display: grid; gap: 1px; }
.brand-copy strong {
  font-size: 1.45rem;
  letter-spacing: -.035em;
  line-height: 1;
}
.brand-copy span {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .66rem;
  font-weight: 760;
}
.audio-button,
.map-button {
  border: 1px solid var(--line-strong);
  background: #101b26;
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 760;
  cursor: pointer;
}
.audio-button.active { outline: 2px solid rgba(25,189,242,.65); }
.state-board,
.measure-board,
.system-note {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.zones-board {
  border-top: 0;
  padding-top: 0;
}
.state-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}
.state-label,
.measure-title,
.map-kicker {
  color: #9fdcff;
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .68rem;
  font-weight: 820;
}
.time-mark { color: var(--muted); font-size: .82rem; }
.state-word {
  margin-top: 6px;
  font-size: clamp(2rem, 4vw, 2.55rem);
  line-height: .95;
  letter-spacing: -.055em;
  font-weight: 860;
}
.status-hint {
  min-height: 1.2em;
  margin: 8px 0 12px;
  color: var(--soft);
  font-size: .92rem;
}
.status-scale {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.scale-step {
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  text-indent: -999px;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.06);
}
.state-normal .scale-normal { background: var(--cyan); }
.state-watch .scale-normal,
.state-watch .scale-signal { background: var(--amber); }
.state-alert .scale-normal,
.state-alert .scale-signal,
.state-alert .scale-alert { background: var(--red); }
.measure-board { display: grid; gap: 10px; }
.measure-title { margin-bottom: 2px; }
.measure-row {
  display: grid;
  grid-template-columns: 78px 1fr 40px;
  align-items: center;
  gap: 10px;
}
.measure-row span { color: var(--soft); font-size: .86rem; }
.measure-row b { text-align: right; font-size: 1.35rem; line-height: 1; }
.measure-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.09);
  overflow: hidden;
}
.measure-track i {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--violet), var(--cyan));
  transition: width .35s ease;
}
.zones-board { display: grid; gap: 6px; }
.zones-head,
.zone-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 82px 48px;
  gap: 8px;
  align-items: center;
}
.zones-head {
  color: var(--muted);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 760;
}
.zone-rows { display: grid; gap: 2px; }
.zone-row {
  min-height: 34px;
  padding: 5px 0;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.zone-row:last-child { border-bottom: 0; }
.zone-name-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.zone-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--cell-color, var(--cyan));
  box-shadow: 0 0 0 2px rgba(255,255,255,.82);
  flex: 0 0 auto;
}
.zone-name {
  font-weight: 770;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.quality-stack {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
}
.quality-stack i {
  height: 7px;
  border-radius: 999px;
  background: rgba(255,255,255,.10);
}
.quality-stack[data-level="1"] i:nth-child(-n+1),
.quality-stack[data-level="2"] i:nth-child(-n+2),
.quality-stack[data-level="3"] i:nth-child(-n+3),
.quality-stack[data-level="4"] i:nth-child(-n+4) {
  background: var(--cell-color, var(--cyan));
}
.zone-sensors { color: var(--soft); text-align: right; font-size: .88rem; }
.system-note {
  color: var(--muted);
  font-size: .83rem;
}
.system-note summary {
  cursor: pointer;
  color: var(--soft);
  font-weight: 700;
}
.system-note p {
  margin: 8px 0 0;
  line-height: 1.45;
}
.map-panel {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(390px, 1fr) auto;
  overflow: hidden;
  max-height: calc(100svh - 28px);
}
.map-head {
  padding: 14px 18px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}
.map-head h1 {
  margin: 3px 0 0;
  font-size: clamp(1.35rem, 2vw, 1.9rem);
  line-height: 1;
  letter-spacing: -.04em;
}
.map-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: .9rem;
}
.coverage-map { position: relative; width: 100%; min-height: 0; background: #dfe9f3; overflow: hidden; }
#leafletMap { width: 100%; height: 100%; min-height: 390px; background: #dfe9f3; }
.leaflet-container { font-family: inherit; background: #dfe9f3; }
.leaflet-control-attribution { font-size: 10px; background: rgba(255,255,255,.72); }
.leaflet-control-zoom a { background: rgba(15, 23, 42, .92); color: #eef6ff; border-color: rgba(255,255,255,.18); }
.leaflet-control-zoom a:hover { background: rgba(30, 41, 59, .96); color: #ffffff; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: #102030; color: var(--ink); }
.leaflet-popup-content { margin: 10px 12px; }
.zone-number-icon span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  font-weight: 900;
  border: 2px solid #ffffff;
  box-shadow: 0 3px 14px rgba(0,0,0,.42);
}
.map-empty { position: absolute; inset: 0; display: grid; place-items: center; color: #102030; padding: 24px; text-align: center; background: rgba(223,233,243,.72); z-index: 500; }
.map-empty.hidden { display: none; }
.map-footer {
  padding: 8px 12px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: .86rem;
  text-align: center;
}
@media (max-width: 900px) {
  .cuyum-live { grid-template-columns: 1fr; padding: 10px; }
  .readout { overflow: visible; }
  .map-panel { max-height: none; grid-template-rows: auto 56svh auto; }
  #leafletMap { min-height: 360px; }
}
@media (max-width: 560px) {
  .brand-bar { grid-template-columns: 48px 1fr; }
  .brand-mark { width: 48px; height: 48px; }
  .audio-button { grid-column: 1 / -1; width: 100%; }
  .zones-head, .zone-row { grid-template-columns: minmax(0, 1fr) 68px 42px; }
  .map-panel { grid-template-rows: auto 52svh auto; }
  #leafletMap { min-height: 340px; }
}

/* Ajuste quirúrgico de estado: sin barras falsas ni porotitos */
.state-board {
  padding-bottom: 14px;
}
.state-board::after {
  content: "";
  display: block;
  width: 42px;
  height: 3px;
  border-radius: 999px;
  margin-top: 14px;
  background: var(--cyan);
}
.state-watch::after { background: var(--amber); }
.state-alert::after { background: var(--red); }
.state-offline::after { background: var(--muted); }
.state-alert .state-word { color: #fff0f0; }
.state-watch .state-word { color: #fff3cf; }
.state-offline .state-word { color: var(--muted); }
.status-hint {
  margin-bottom: 0;
  font-size: .95rem;
  line-height: 1.25;
}
.measure-board {
  gap: 6px;
}
.plain-measure {
  grid-template-columns: 1fr auto;
  min-height: 30px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.plain-measure:last-child {
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.plain-measure span {
  color: var(--soft);
  font-size: .94rem;
}
.plain-measure b {
  font-size: 1.55rem;
  line-height: 1;
}
.zones-head,
.zone-row {
  grid-template-columns: minmax(0, 1fr) 78px 44px;
}
.zone-level {
  color: var(--soft);
  font-size: .88rem;
  text-align: left;
  white-space: nowrap;
}
.zone-sensors {
  font-size: 1rem;
  font-weight: 740;
}
.system-note,
.status-scale,
.measure-track,
.quality-stack {
  display: none !important;
}
@media (max-width: 560px) {
  .zones-head, .zone-row { grid-template-columns: minmax(0, 1fr) 70px 38px; }
  .zone-level { font-size: .82rem; }
}


/* Hotfix registros recientes + limpieza mínima */
.state-board::after { display: none !important; }
.zones-head, .zone-row { grid-template-columns: minmax(0, 1fr) 78px 72px; }
.zone-name { font-size: .95rem; }
.map-kicker { display: none !important; }
.map-head h1 { margin: 0; }
.map-footer {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}
.raw-json-link {
  color: #c7d6e4;
  text-decoration: none;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(11,20,29,.74);
  font-weight: 700;
}
.raw-json-link:hover { color: #fff; border-color: rgba(25,189,242,.55); }
@media (max-width: 560px) {
  .zones-head, .zone-row { grid-template-columns: minmax(0, 1fr) 68px 64px; }
  .zone-name { font-size: .88rem; }
}

.simulation-button {
  border: 1px solid rgba(255, 255, 255, .22);
  background: #e00000;
  color: #ffffff;
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(0,0,0,.18), 0 8px 22px rgba(224,0,0,.22);
}

.simulation-button:hover {
  background: #ff1f1f;
}

.simulation-banner {
  position: fixed;
  z-index: 99999;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: #e00000;
  color: #ffffff;
  border: 2px solid #ffffff;
  border-radius: 16px;
  padding: 12px 22px;
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: .04em;
  box-shadow: 0 16px 45px rgba(0,0,0,.35);
  display: none;
  text-align: center;
}


/* Refined simulation test button */
.simulation-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 150px;
  max-width: 190px;
  min-height: 38px;
  box-sizing: border-box;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;

  border-radius: 10px;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, .28);

  background: #b91c1c;
  color: #ffffff;

  font-size: .88rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;

  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0,0,0,.22);
}

.simulation-button:hover {
  background: #dc2626;
}

.simulation-button:active {
  transform: translateY(1px);
}

/* Disable old floating simulation banner */
.simulation-banner {
  display: none !important;
}


/* Simulation button beside map center button */
.simulation-button-inline {
  margin-left: 8px;
  vertical-align: middle;
}

.simulation-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 168px;
  min-height: 38px;
  box-sizing: border-box;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;

  border-radius: 10px;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, .28);

  background: #b91c1c;
  color: #ffffff;

  font-size: .88rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;

  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0,0,0,.22);
}

.simulation-button:hover {
  background: #dc2626;
}

.simulation-button:active {
  transform: translateY(1px);
}

/* Audio button attention pulse */
.audio-attention {
  position: relative;
  animation: cuyumAudioPulse 1.2s ease-in-out infinite;
  box-shadow:
    0 0 0 0 rgba(255, 255, 255, .55),
    0 0 0 0 rgba(224, 0, 0, .45);
}

.audio-attention::after {
  content: "activar";
  position: absolute;
  top: -12px;
  right: -10px;
  background: #e00000;
  color: #ffffff;
  font-size: .68rem;
  font-weight: 900;
  line-height: 1;
  padding: 4px 6px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.85);
  text-transform: uppercase;
  letter-spacing: .03em;
  pointer-events: none;
}

.audio-enabled {
  animation: none !important;
}

.audio-enabled::after {
  display: none !important;
}

@keyframes cuyumAudioPulse {
  0% {
    transform: scale(1);
    box-shadow:
      0 0 0 0 rgba(255, 255, 255, .55),
      0 0 0 0 rgba(224, 0, 0, .45);
  }
  55% {
    transform: scale(1.045);
    box-shadow:
      0 0 0 7px rgba(255, 255, 255, .12),
      0 0 0 15px rgba(224, 0, 0, .08);
  }
  100% {
    transform: scale(1);
    box-shadow:
      0 0 0 0 rgba(255, 255, 255, 0),
      0 0 0 0 rgba(224, 0, 0, 0);
  }
}


/* Canonical bottom controls: compact, same visual scale as map button */
.simulation-bottom-row {
  display: flex;
  justify-content: center;
  padding: 6px 12px 9px;
}

.map-footer {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.raw-json-link,
a.raw-json-link,
.simulation-button.simulation-bottom-button,
button.simulation-button.simulation-bottom-button {
  height: 30px !important;
  min-height: 30px !important;
  min-width: 0 !important;
  width: auto !important;
  padding: 5px 10px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(255,255,255,.16) !important;
  background: rgba(15,23,42,.88) !important;
  color: #eef6ff !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  letter-spacing: 0 !important;
  text-decoration: none !important;
  box-shadow: none !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;
  cursor: pointer !important;
}

.raw-json-link:hover,
.simulation-button.simulation-bottom-button:hover,
button.simulation-button.simulation-bottom-button:hover {
  color: #ffffff !important;
  background: rgba(30,41,59,.94) !important;
  border-color: rgba(255,255,255,.28) !important;
}

.simulation-button.simulation-bottom-button:active,
button.simulation-button.simulation-bottom-button:active {
  transform: translateY(1px);
}



/* Audio button: original behavior, compact size */
.brand-bar {
  grid-template-columns: 48px minmax(0, 1fr) auto;
}

.audio-button,
button.audio-button {
  height: 32px;
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  width: auto;
  min-width: 92px;
  max-width: 112px;
  box-sizing: border-box;
}

.audio-button.active {
  outline: 2px solid rgba(25,189,242,.65);
}

.audio-attention::after {
  top: -9px;
  right: -7px;
  font-size: .52rem;
  font-weight: 800;
  padding: 3px 5px;
  line-height: 1;
}

.audio-attention {
  animation: cuyumAudioPulse 1.2s ease-in-out infinite;
}


/* Canonical type scale */
:root {
  --fs-xs: 10px;
  --fs-sm: 12px;
  --fs-base: 14px;
  --fs-md: 16px;
  --fs-lg: 23px;
  --fs-xl: 25px;
  --fs-status: 38px;

  --fw-regular: 500;
  --fw-medium: 650;
  --fw-bold: 750;
  --fw-heavy: 820;
}

.brand-copy strong {
  font-size: var(--fs-lg) !important;
  font-weight: var(--fw-heavy) !important;
  letter-spacing: -0.03em !important;
}

.brand-copy span {
  font-size: var(--fs-xs) !important;
  font-weight: var(--fw-bold) !important;
  letter-spacing: .12em !important;
}

.map-head h1 {
  font-size: var(--fs-xl) !important;
  font-weight: var(--fw-heavy) !important;
  letter-spacing: -0.035em !important;
}

.map-head p {
  font-size: var(--fs-base) !important;
  font-weight: var(--fw-regular) !important;
}

.state-label,
.measure-title,
.zones-head,
.map-kicker {
  font-size: 12px !important;
  font-weight: var(--fw-bold) !important;
  letter-spacing: .12em !important;
}

.time-mark {
  font-size: var(--fs-sm) !important;
  font-weight: var(--fw-regular) !important;
}

.state-word {
  font-size: var(--fs-status) !important;
  font-weight: var(--fw-heavy) !important;
  letter-spacing: -0.045em !important;
}

.status-hint {
  font-size: 15px !important;
  font-weight: var(--fw-regular) !important;
  line-height: 1.25 !important;
}

.plain-measure span,
.measure-row span {
  font-size: var(--fs-md) !important;
  font-weight: var(--fw-regular) !important;
}

.plain-measure b,
.measure-row b {
  font-size: var(--fs-xl) !important;
  font-weight: var(--fw-heavy) !important;
}

.zone-name,
.zone-level {
  font-size: var(--fs-base) !important;
  font-weight: var(--fw-medium) !important;
}

.zone-name {
  font-weight: var(--fw-bold) !important;
}

.zone-sensors {
  font-size: var(--fs-base) !important;
  font-weight: var(--fw-bold) !important;
}

.map-footer {
  font-size: var(--fs-sm) !important;
  font-weight: var(--fw-regular) !important;
}

.audio-button,
.map-button,
.raw-json-link,
a.raw-json-link,
.simulation-button.simulation-bottom-button,
button.simulation-button.simulation-bottom-button {
  font-size: var(--fs-sm) !important;
  font-weight: var(--fw-bold) !important;
}

@media (max-width: 900px) {
  .state-word {
    font-size: 35px !important;
  }

  .map-head h1 {
    font-size: 25px !important;
  }
}

@media (max-width: 560px) {
  .state-word {
    font-size: 32px !important;
  }

  .brand-copy strong {
    font-size: 21px !important;
  }

  .map-head h1 {
    font-size: 20px !important;
  }
}


/* Header and controls balance */
.brand-copy strong {
  font-size: 25px !important;
  font-weight: 820 !important;
  line-height: 1 !important;
}

.brand-copy span {
  font-size: 11px !important;
  font-weight: 750 !important;
  letter-spacing: .13em !important;
  white-space: nowrap !important;
}

.audio-button,
button.audio-button,
.map-button,
button.map-button,
.raw-json-link,
a.raw-json-link,
.simulation-button.simulation-bottom-button,
button.simulation-button.simulation-bottom-button {
  height: 34px !important;
  min-height: 34px !important;
  padding: 7px 12px !important;
  font-size: 13px !important;
  font-weight: 750 !important;
  line-height: 1 !important;
  border-radius: 999px !important;
  white-space: nowrap !important;
}

.audio-attention::after {
  font-size: .55rem !important;
  padding: 3px 5px !important;
  top: -9px !important;
  right: -7px !important;
}

.map-footer {
  font-size: 13px !important;
}
/* Cuyum logo circle mask */
.brand-mark {
  width: 52px !important;
  height: 52px !important;
  aspect-ratio: 1 / 1;
  border-radius: 50% !important;
  overflow: hidden !important;
  object-fit: cover !important;
  object-position: center !important;
  background: #081019;
  display: block;
}

.cuyum-zone-icon span {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid;
  box-shadow: 0 0 0 4px rgba(255,255,255,.45), 0 6px 14px rgba(0,0,0,.35);
  overflow: hidden;
}

.cuyum-zone-icon img {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: block;
}

.zone-center-dot span {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  display: block;
  border: 2px solid;
  box-shadow: 0 0 0 3px rgba(255,255,255,.55), 0 3px 10px rgba(0,0,0,.35);
}

.cuyum-home-icon span {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 16, 28, .92);
  border: 2px solid rgba(255,255,255,.75);
  box-shadow: 0 0 0 5px rgba(139,92,246,.30), 0 8px 18px rgba(0,0,0,.38);
  overflow: hidden;
}

.cuyum-home-icon img {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: block;
}

.cuyum-system-center-icon span {
  width: 22px;
  height: 22px;
  display: block;
  border-radius: 999px;
  background: rgba(15, 23, 42, .85);
  border: 3px solid rgba(255,255,255,.9);
  box-shadow:
    0 0 0 4px rgba(56,189,248,.28),
    0 0 0 8px rgba(139,92,246,.18),
    0 5px 14px rgba(0,0,0,.38);
}

.cuyum-system-center-icon span {
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 16, 28, .90);
  border: 2px solid rgba(255,255,255,.82);
  box-shadow:
    0 0 0 3px rgba(56,189,248,.22),
    0 0 0 6px rgba(139,92,246,.13),
    0 4px 12px rgba(0,0,0,.32);
  overflow: hidden;
}

.cuyum-system-center-icon img {
  border-radius: 999px;
  display: block;
}

.zone-center-dot {
  display: none !important;
}

.cuyum-system-center-icon span {
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 16, 28, .92);
  border: 2px solid rgba(255,255,255,.88);
  box-shadow:
    0 0 0 4px rgba(56,189,248,.24),
    0 0 0 8px rgba(139,92,246,.16),
    0 5px 14px rgba(0,0,0,.34);
  overflow: hidden;
}

.cuyum-system-center-icon img {
  border-radius: 999px;
  display: block;
}

.zone-center-dot {
  display: none !important;
}

/* Leaflet zoom controls: signo visible sobre fondo claro */
.leaflet-control-zoom a,
.leaflet-control-zoom a:visited {
  color: #94A3B8 !important;
  background: #F8FAFC !important;
}

.leaflet-control-zoom a:hover,
.leaflet-control-zoom a:focus {
  color: #64748B !important;
  background: #E2E8F0 !important;
}

.leaflet-control-zoom a.leaflet-disabled {
  color: #CBD5E1 !important;
  background: #F8FAFC !important;
}

/* Enlace de marca hacia el sitio público */
.brand-link{
  display:grid;
  grid-template-columns:auto 1fr;
  align-items:center;
  gap:12px;
  min-width:0;
  color:inherit;
  text-decoration:none;
}

.brand-link:hover .brand-copy strong{
  text-decoration:underline;
  text-underline-offset:3px;
}

.brand-link:focus-visible{
  outline:2px solid #19bdf2;
  outline-offset:5px;
  border-radius:10px;
}

/* Corrección definitiva del encabezado: marca completa + botón de audio */
.brand-bar {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 12px !important;
}

.brand-link {
  grid-column: 1 !important;
  min-width: 0 !important;
}

.audio-button,
button.audio-button {
  grid-column: 2 !important;
  position: relative !important;
  margin: 0 !important;
  align-self: center !important;
  justify-self: end !important;
}

@media (max-width: 560px) {
  .brand-bar {
    grid-template-columns: minmax(0, 1fr) auto !important;
  }

  .audio-button,
  button.audio-button {
    grid-column: 2 !important;
    width: auto !important;
  }
}

/* Corrección compacta definitiva de la cabecera */
.brand-bar {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 8px !important;
}

.brand-link {
  min-width: 0 !important;
}

.audio-button,
button.audio-button {
  grid-column: 2 !important;
  position: relative !important;
  justify-self: end !important;
  align-self: center !important;

  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;

  height: 30px !important;
  min-height: 30px !important;
  padding: 5px 9px !important;

  font-size: 12px !important;
  font-weight: 700 !important;
  line-height: 1 !important;

  margin: 0 !important;
  border-radius: 999px !important;
  white-space: nowrap !important;
}

.audio-attention::after {
  top: -8px !important;
  right: -5px !important;
  font-size: 8px !important;
  padding: 2px 4px !important;
}

/* Ajuste final equilibrado del botón de audio */
.audio-button,
button.audio-button {
  height: 32px !important;
  min-height: 32px !important;
  padding: 6px 11px !important;
  font-size: 13px !important;
  font-weight: 750 !important;
  min-width: 86px !important;
  max-width: 104px !important;
}

.audio-attention::after {
  top: -8px !important;
  right: -6px !important;
  font-size: 8px !important;
  padding: 2px 4px !important;
}

/* Controles agrupados en el encabezado del mapa */
.brand-bar {
  grid-template-columns: minmax(0, 1fr) !important;
}

.map-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.map-head-actions .audio-button,
.map-head-actions button.audio-button {
  grid-column: auto !important;
  justify-self: auto !important;
  align-self: auto !important;
  margin: 0 !important;
}

@media (max-width: 560px) {
  .map-head {
    flex-wrap: wrap;
  }

  .map-head-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

/* Ajuste final del botón de audio en el encabezado del mapa */
.map-head-actions {
  gap: 12px;
}

.map-head-actions .audio-button,
.map-head-actions button.audio-button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  min-width: 96px !important;
  max-width: none !important;
  padding-inline: 14px !important;
}

.audio-attention::after {
  content: "ACTIVAR" !important;
  top: -9px !important;
  left: 50% !important;
  right: auto !important;
  transform: translateX(-50%) !important;
  font-size: 8px !important;
  line-height: 1 !important;
  padding: 2px 5px !important;
  white-space: nowrap !important;
}

html[lang="en"] .audio-attention::after {
  content: "ENABLE" !important;
}

/* SELECTOR COPIADO LITERALMENTE DESDE /web */
/* Selector flotante del idioma alternativo */
  .cuyum-language-control {
    margin-top: 8px !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

.cuyum-language-switch {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 38px !important;
    height: 38px !important;
    border: 1px solid rgba(255,255,255,.35) !important;
    border-radius: 10px !important;
    overflow: hidden !important;
    text-decoration: none !important;
    box-shadow: 0 4px 12px rgba(0,0,0,.32) !important;
  }

.cuyum-language-switch.is-es {
    background: linear-gradient(
      180deg,
      #74acdf 0 33%,
      #ffffff 33% 66%,
      #74acdf 66% 100%
    ) !important;
  }

.cuyum-language-switch.is-en {
    background: repeating-linear-gradient(
      180deg,
      #b22234 0 4px,
      #ffffff 4px 8px
    ) !important;
  }

.cuyum-language-bubble {
    font-size: 24px;
    line-height: 1;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,.45));
  }

.cuyum-language-code {
  position: absolute !important;

  inset: auto !important;
  left: 50% !important;
  top: 45% !important;
  transform: translate(-50%, -50%) !important;

  min-width: 16px !important;
  height: 10px !important;
  padding: 0 2px !important;

  border: 0 !important;
  border-radius: 999px !important;

  background: #ffffff !important;
  color: #111111 !important;

  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;

  font-family: Arial, Helvetica, sans-serif !important;
  font-size: 7px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  letter-spacing: -0.02em !important;

  text-shadow: none !important;
  box-shadow: none !important;
  pointer-events: none !important;
  white-space: nowrap !important;
}

/* Fondo liso detrás de ES / EN para limpiar el emoji de diálogo */
  .cuyum-language-code {
    inset: auto !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;

    min-width: 22px;
    height: 15px;
    padding: 0 3px;
    border-radius: 4px;

    background: #fff8e7;
    color: #111111 !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    font-size: 10px !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    letter-spacing: .02em !important;

    text-shadow: none !important;
    box-shadow: 0 1px 2px rgba(0,0,0,.28);
  }

/* LANGUAGE SWITCH V2 START */
.cuyum-language-switch {
  position: absolute !important;
  left: 10px !important;
  top: 82px !important;
  z-index: 800 !important;

  width: 38px !important;
  height: 38px !important;

  display: flex !important;
  align-items: center !important;
  justify-content: center !important;

  border: 1px solid rgba(255,255,255,.45) !important;
  border-radius: 11px !important;
  overflow: hidden !important;

  text-decoration: none !important;
  cursor: pointer !important;

  box-shadow:
    0 5px 14px rgba(0,0,0,.42),
    inset 0 1px 0 rgba(255,255,255,.25) !important;
}

/* Argentina: celeste, blanco y celeste */
.cuyum-language-switch.is-es {
  background:
    linear-gradient(
      180deg,
      #74acdf 0 34%,
      #ffffff 34% 66%,
      #74acdf 66% 100%
    ) !important;
}

/* Estados Unidos: composición limpia, sin franjas */
.cuyum-language-switch.is-en {
  background:
    linear-gradient(
      135deg,
      #263f73 0 43%,
      #ffffff 43% 57%,
      #b22234 57% 100%
    ) !important;
}

.cuyum-language-bubble {
  font-size: 25px !important;
  line-height: 1 !important;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.48)) !important;
}

.cuyum-language-code {
  position: absolute !important;

  inset: auto !important;
  left: 50% !important;
  top: 45% !important;
  transform: translate(-50%, -50%) !important;

  min-width: 17px !important;
  width: 17px !important;
  height: 10px !important;
  padding: 0 2px !important;

  border: 0 !important;
  border-radius: 999px !important;

  background: #fff6dc !important;
  color: #151515 !important;

  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;

  font-size: 8px !important;
  font-weight: 900 !important;
  line-height: 10px !important;
  letter-spacing: 0 !important;

  text-shadow: none !important;
  box-shadow: none !important;
  pointer-events: none !important;
}

/*
  El selector tiene z-index 800:
  - supera map-fade, que usa 400;
  - supera map-bottom-cover, que usa 650;
  - permanece debajo del encabezado fijo, que usa 2000;
  - al estar dentro del mapa, se desplaza junto con él.
*/
.cuyum-language-switch:hover {
  transform: translateY(-1px) !important;
}

.cuyum-language-switch:active {
  transform: translateY(1px) !important;
}

/* LANGUAGE SWITCH V2 END */

/* Ajuste fino definitivo del código ES / EN dentro del globo */
.cuyum-language-code{
  position:absolute !important;
  left:50% !important;
  top:50% !important;
  inset:auto !important;
  transform:translate(-50%,-50%) !important;

  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;

  min-width:22px !important;
  height:14px !important;
  padding:0 4px !important;

  background:#ffffff !important;
  border:none !important;
  border-radius:999px !important;
  box-shadow:none !important;
  text-shadow:none !important;

  color:#111111 !important;
  font-family:Arial, Helvetica, sans-serif !important;
  font-size:9px !important;
  font-weight:900 !important;
  line-height:1 !important;
  letter-spacing:-0.02em !important;
  white-space:nowrap !important;

  overflow:hidden !important;
  pointer-events:none !important;
}

/* Microajuste final del selector de idioma */
  .cuyum-language-code {
    top: 43% !important;
  }

.cuyum-language-switch,
  .cuyum-language-switch.is-en,
  .cuyum-language-switch.is-es {
    border-color: rgba(255,255,255,.55) !important;
    outline: none !important;
  }

.cuyum-language-switch:focus,
  .cuyum-language-switch:focus-visible {
    outline: 2px solid #19bdf2 !important;
    outline-offset: 2px !important;
  }

/* Corrección real del selector de idioma */
  .cuyum-language-code {
    top: 51% !important;
  }

.cuyum-language-switch,
  .cuyum-language-switch.is-en,
  .cuyum-language-switch.is-es {
    border: 1px solid rgba(5, 8, 13, .72) !important;
    outline: none !important;
  }

/* Ajuste visual definitivo */
  .cuyum-language-code{top:47% !important;}

.cuyum-language-switch,.cuyum-language-switch.is-en,.cuyum-language-switch.is-es{border:1px solid #aeb7c2 !important;outline:none !important;}

/* Subida adicional de la etiqueta ES / EN */
  .cuyum-language-code{top:44% !important;}

/* POSICION Y BORDE DEFINITIVOS DEL SELECTOR */
.cuyum-language-code {
  top: 34% !important;
}

.cuyum-language-switch,
.cuyum-language-switch.is-en,
.cuyum-language-switch.is-es {
  border: 0 !important;
  outline: 0 !important;
}

/* Normalización exacta del selector únicamente en /app */
.cuyum-language-switch {
  box-sizing: border-box !important;
  font-size: 16px !important;
  font-weight: 400 !important;
  line-height: 1 !important;
  font-style: normal !important;
  font-variant: normal !important;
}

.cuyum-language-bubble {
  display: block !important;
  width: 25px !important;
  height: 25px !important;
  margin: 0 !important;
  padding: 0 !important;

  font-family:
    "Noto Color Emoji",
    "Segoe UI Emoji",
    "Apple Color Emoji",
    sans-serif !important;
  font-variant-emoji: emoji;
  font-size: 25px !important;
  font-weight: 400 !important;
  line-height: 25px !important;

  text-align: center !important;
  vertical-align: middle !important;
  letter-spacing: 0 !important;
  transform: none !important;
}

.cuyum-language-code {
  box-sizing: border-box !important;
  margin: 0 !important;
  vertical-align: middle !important;
}

/* /app: selector de idioma como control Leaflet real */
.leaflet-control.cuyum-language-control {
  margin-top: 8px !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  clear: both !important;
}

.leaflet-control.cuyum-language-control .cuyum-language-switch {
  position: relative !important;
  left: auto !important;
  top: auto !important;
  z-index: auto !important;
  margin: 0 !important;
}

.leaflet-control.cuyum-language-control .cuyum-language-switch:focus,
.leaflet-control.cuyum-language-control .cuyum-language-switch:focus-visible {
  outline: none !important;
}

/* /app: mover el emoji de diálogo 2 px a la izquierda */
.cuyum-language-bubble {
  transform: translateX(-2px) !important;
}

/* /app: acumulado total, emoji 4 px a la izquierda */
.cuyum-language-bubble {
  transform: translateX(-4px) !important;
}

/* /app: emoji 3 px a la izquierda */
.cuyum-language-bubble {
  transform: translateX(-3px) !important;
}

/* Etiqueta de prueba visible cuando el audio está habilitado */
.audio-test {
  position: relative !important;
}

.audio-test::after {
  content: "PROBAR" !important;
  position: absolute !important;
  top: -9px !important;
  left: 50% !important;
  right: auto !important;
  transform: translateX(-50%) !important;

  padding: 2px 5px !important;
  border: 0 !important;
  border-radius: 999px !important;

  background: #168ec8 !important;
  color: #ffffff !important;

  font-size: 8px !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  letter-spacing: .03em !important;
  white-space: nowrap !important;

  box-shadow: 0 2px 6px rgba(0,0,0,.32) !important;
  pointer-events: none !important;
}

html[lang="en"] .audio-test::after {
  content: "TEST" !important;
}

/* Estado de prueba: reutiliza exactamente el letrero ACTIVAR / ENABLE */
.audio-button.audio-attention.audio-test {
  animation: none !important;
}

.audio-button.audio-attention.audio-test::after,
button.audio-button.audio-attention.audio-test::after {
  content: "PROBAR" !important;
  background: #168ec8 !important;
  color: #ffffff !important;
}

html[lang="en"] .audio-button.audio-attention.audio-test::after,
html[lang="en"] button.audio-button.audio-attention.audio-test::after {
  content: "TEST" !important;
}

/* PROBAR / TEST usa exactamente el letrero de ACTIVAR / ENABLE */
.audio-button.audio-attention.audio-test::after,
button.audio-button.audio-attention.audio-test::after {
  content: "PROBAR" !important;
  background: #168ec8 !important;
  color: #ffffff !important;
}

html[lang="en"] .audio-button.audio-attention.audio-test::after,
html[lang="en"] button.audio-button.audio-attention.audio-test::after {
  content: "TEST" !important;
}

.audio-button.audio-attention.audio-test,
button.audio-button.audio-attention.audio-test {
  animation: none !important;
}

/* Un único letrero para ACTIVAR/ENABLE y PROBAR/TEST */
.audio-button.audio-attention::after,
button.audio-button.audio-attention::after {
  content: attr(data-audio-label) !important;
}

.audio-button.audio-attention.audio-test::after,
button.audio-button.audio-attention.audio-test::after {
  background: #168ec8 !important;
  color: #ffffff !important;
}

.audio-button.audio-attention.audio-test,
button.audio-button.audio-attention.audio-test {
  animation: none !important;
}

/* PROBAR / TEST debe conservar el mismo letrero de ACTIVAR / ENABLE */
.audio-button.audio-enabled.audio-test::after,
button.audio-button.audio-enabled.audio-test::after {
  display: block !important;
  content: attr(data-audio-label) !important;
  background: #168ec8 !important;
  color: #ffffff !important;
}


/* Selector de idioma sin bandera: conservar íntegros emoji y etiqueta */
.cuyum-language-switch,
.cuyum-language-switch.is-es,
.cuyum-language-switch.is-en {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}


/* APP HISTORY AND SCREEN SNAP V22 */

html {
  scroll-behavior: smooth;
  scroll-snap-type: y proximity;
}

body {
  min-height: 100dvh;
}

.cuyum-live {
  display: block;
  min-height: 100dvh;
  padding: 0;
}

.dashboard-screen {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  scroll-snap-align: start;
  scroll-snap-stop: normal;
}

.dashboard-screen > .readout,
.dashboard-screen > .map-panel {
  min-width: 0;
}

.history-panel {
  min-height: 100dvh;
  padding: 28px;
  background:
    radial-gradient(circle at 100% 0, rgba(25,189,242,.10), transparent 340px),
    radial-gradient(circle at 0 100%, rgba(139,92,246,.10), transparent 360px),
    var(--bg);
  scroll-snap-align: start;
  scroll-snap-stop: normal;
}

.history-head {
  width: min(1180px, 100%);
  margin: 0 auto 18px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.history-kicker {
  margin: 0 0 6px;
  color: var(--cyan);
  font-size: .7rem;
  font-weight: 820;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.history-head h2 {
  margin: 0;
  font-size: clamp(1.75rem, 3vw, 2.8rem);
  line-height: 1;
  letter-spacing: -.045em;
}

.history-head p:not(.history-kicker) {
  margin: 9px 0 0;
  color: var(--muted);
}

.history-count {
  flex: 0 0 auto;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--soft);
  background: rgba(16,26,36,.9);
  font-size: .82rem;
  font-weight: 760;
}

.history-table-wrap {
  width: min(1180px, 100%);
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(11,20,29,.97);
  box-shadow: 0 20px 46px rgba(0,0,0,.30);
}

.history-table {
  width: 100%;
  border-collapse: collapse;
}

.history-table th,
.history-table td {
  padding: 15px 18px;
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.history-table th {
  color: var(--muted);
  background: rgba(255,255,255,.025);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.history-table tbody tr:last-child td {
  border-bottom: 0;
}

.history-table tbody tr:hover {
  background: rgba(25,189,242,.045);
}

.history-time {
  color: var(--soft);
  white-space: nowrap;
}

.history-region {
  font-weight: 760;
  text-transform: capitalize;
}

.history-cell {
  display: grid;
  gap: 3px;
}

.history-cell strong {
  font-size: .95rem;
}

.history-cell small {
  color: var(--muted);
  font-size: .74rem;
}

.history-warning {
  color: var(--cyan);
  white-space: nowrap;
}

.history-warning strong {
  font-size: 1.02rem;
}

.history-reconstructed {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: .68rem;
}

.history-empty {
  display: none;
  min-height: 220px;
  place-items: center;
  padding: 32px;
  color: var(--muted);
  text-align: center;
}

.history-empty.visible {
  display: grid;
}

@media (max-width: 900px) {
  .dashboard-screen {
    min-height: auto;
    display: block;
    padding: 0;
  }

  .dashboard-screen > .readout,
  .dashboard-screen > .map-panel,
  .history-panel {
    min-height: 100dvh;
    scroll-snap-align: start;
    scroll-snap-stop: normal;
  }

  .dashboard-screen > .readout {
    margin: 10px;
    padding: 14px;
    overflow: visible;
  }

  .dashboard-screen > .map-panel {
    height: calc(100dvh - 20px);
    min-height: calc(100dvh - 20px);
    margin: 10px;
    grid-template-rows: auto minmax(0, 1fr) auto;
    max-height: none;
  }

  .dashboard-screen #leafletMap {
    height: 100%;
    min-height: 0;
  }

  .history-panel {
    padding: 20px 10px;
  }
}

@media (max-width: 680px) {
  html {
    scroll-snap-type: y proximity;
  }

  .history-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .history-table-wrap {
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .history-table,
  .history-table tbody,
  .history-table tr,
  .history-table td {
    display: block;
    width: 100%;
  }

  .history-table thead {
    display: none;
  }

  .history-table tbody {
    display: grid;
    gap: 10px;
  }

  .history-table tr {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(11,20,29,.97);
    box-shadow: 0 12px 28px rgba(0,0,0,.22);
  }

  .history-table td {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 10px;
    padding: 7px 0;
    border-bottom: 1px solid rgba(255,255,255,.07);
  }

  .history-table td:last-child {
    border-bottom: 0;
  }

  .history-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
  }

  .history-time {
    white-space: normal;
  }
}

/* =========================================================
   /app V24
   Flujo normal, sin sticky/snap y tabla tipográficamente
   integrada con el dashboard original
   ========================================================= */

/* Quitar por completo el desplazamiento por pantallas */
html {
  scroll-snap-type: none !important;
  scroll-behavior: auto !important;
}

.dashboard-screen,
.history-panel,
.dashboard-screen > .readout,
.dashboard-screen > .map-panel {
  scroll-snap-align: none !important;
  scroll-snap-stop: normal !important;
  position: static !important;
  top: auto !important;
}

/* El dashboard de escritorio conserva su composición original */
.cuyum-live {
  display: block !important;
  min-height: 100svh !important;
  padding: 0 !important;
}

.dashboard-screen {
  display: grid !important;
  grid-template-columns: 330px minmax(0, 1fr) !important;
  gap: 14px !important;
  min-height: 100svh !important;
  padding: 14px !important;
}

/* Historial: bloque normal debajo del dashboard */
.history-panel {
  min-height: 0 !important;
  height: auto !important;
  padding: 28px !important;
}

/* Mismo tamaño visual que "Mapa de cobertura" */
.history-head h2 {
  margin: 3px 0 0 !important;
  font-size: clamp(1.35rem, 2vw, 1.9rem) !important;
  line-height: 1 !important;
  letter-spacing: -.04em !important;
  font-weight: 820 !important;
}

.history-head p:not(.history-kicker) {
  margin-top: 6px !important;
  font-size: .9rem !important;
  line-height: 1.35 !important;
}

.history-kicker {
  font-size: .68rem !important;
}

/* Tabla coherente con el resto de /app */
.history-table th {
  padding: 12px 16px !important;
  font-size: .68rem !important;
  line-height: 1.2 !important;
  font-weight: 760 !important;
}

.history-table td {
  padding: 13px 16px !important;
  font-size: .86rem !important;
  line-height: 1.3 !important;
  font-weight: 400 !important;
}

.history-time {
  color: var(--soft) !important;
  font-size: .86rem !important;
  font-weight: 400 !important;
}

.history-region {
  font-size: .86rem !important;
  font-weight: 700 !important;
}

.history-cell {
  display: block !important;
}

.history-cell strong {
  font-size: .86rem !important;
  line-height: 1.3 !important;
  font-weight: 600 !important;
  text-transform: none !important;
}

.history-cell small:empty {
  display: none !important;
}

/* "Al centro: 65,9 s" siempre unido */
.history-warning {
  display: block !important;
  color: var(--cyan) !important;
  font-size: .86rem !important;
  line-height: 1.3 !important;
  font-weight: 400 !important;
  white-space: nowrap !important;
}

.history-warning strong {
  display: inline !important;
  font-size: inherit !important;
  line-height: inherit !important;
  font-weight: 700 !important;
}

.history-reconstructed {
  display: block !important;
  margin-top: 3px !important;
  color: var(--muted) !important;
  font-size: .68rem !important;
  line-height: 1.25 !important;
  white-space: normal !important;
}


/* ---------------------------------------------------------
   TABLET Y CELULAR: flujo normal, no pantallas obligatorias
   --------------------------------------------------------- */

@media (max-width: 900px) {
  .dashboard-screen {
    display: block !important;
    min-height: 0 !important;
    padding: 10px !important;
  }

  .dashboard-screen > .readout {
    min-height: 0 !important;
    height: auto !important;
    margin: 0 0 10px !important;
    overflow: visible !important;
  }

  .dashboard-screen > .map-panel {
    min-height: 0 !important;
    height: auto !important;
    margin: 0 !important;
    max-height: none !important;
    grid-template-rows: auto 56svh auto !important;
    overflow: hidden !important;
  }

  .dashboard-screen #leafletMap {
    height: 100% !important;
    min-height: 360px !important;
  }

  .history-panel {
    min-height: 0 !important;
    height: auto !important;
    padding: 20px 10px 28px !important;
  }

  .history-head h2 {
    font-size: 25px !important;
  }
}


@media (max-width: 680px) {
  .history-head {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
  }

  .history-head h2 {
    font-size: 20px !important;
  }

  .history-head p:not(.history-kicker) {
    font-size: .84rem !important;
  }

  .history-count {
    padding: 6px 10px !important;
    font-size: .72rem !important;
  }

  /* Tarjetas móviles compactas */
  .history-table tbody {
    gap: 8px !important;
  }

  .history-table tr {
    padding: 10px 12px !important;
    border-radius: 14px !important;
  }

  .history-table td {
    display: grid !important;
    grid-template-columns: 82px minmax(0, 1fr) !important;
    gap: 8px !important;
    align-items: baseline !important;
    padding: 7px 0 !important;
    font-size: 13px !important;
    line-height: 1.25 !important;
  }

  .history-table td::before {
    font-size: 10px !important;
    line-height: 1.2 !important;
    letter-spacing: .05em !important;
    font-weight: 760 !important;
  }

  .history-time,
  .history-region,
  .history-cell strong,
  .history-warning {
    font-size: 13px !important;
    line-height: 1.25 !important;
  }

  .history-region {
    font-weight: 700 !important;
  }

  .history-warning {
    white-space: nowrap !important;
  }

  .history-reconstructed {
    margin-top: 2px !important;
    font-size: 10px !important;
  }
}


@media (max-width: 560px) {
  .dashboard-screen > .map-panel {
    grid-template-rows: auto 52svh auto !important;
  }

  .dashboard-screen #leafletMap {
    min-height: 340px !important;
  }
}


/* /app: mantener etiqueta y valor de propagación unidos */
.history-warning-main {
  display: inline-flex !important;
  align-items: baseline !important;
  gap: 4px !important;
  white-space: nowrap !important;
}

.history-warning-main strong {
  display: inline !important;
  font-size: inherit !important;
  line-height: inherit !important;
  font-weight: 700 !important;
}

@media (max-width: 680px) {
  .history-warning {
    white-space: normal !important;
  }

  .history-warning-main,
  .history-reconstructed {
    grid-column: 2 !important;
  }

  .history-warning-main {
    grid-row: 1 !important;
  }

  .history-reconstructed {
    grid-row: 2 !important;
    margin-top: 2px !important;
  }
}
