.aemet-radar-card {
      width: 100%;
      background: #fff;
      border: 1px solid #dce1e6;
      border-radius: 10px;
      overflow: hidden;
      box-shadow: 0 2px 10px rgba(0,0,0,.08);
    }
    .aemet-radar-toolbar {
      min-height: 46px;
      padding: 8px 12px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      border-bottom: 1px solid #e5e8eb;
      background: #fff;
    }
    .aemet-radar-title-wrap { min-width: 0; }
    .aemet-radar-title {
      font-size: 15px;
      font-weight: 700;
      line-height: 1.2;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .aemet-radar-subtitle {
      margin-top: 2px;
      font-size: 11px;
      line-height: 1.2;
      color: #737b84;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .aemet-source-badge {
      flex: 0 0 auto;
      padding: 5px 8px;
      border-radius: 999px;
      background: #edf3f8;
      color: #425466;
      font-size: 11px;
      font-weight: 700;
      white-space: nowrap;
    }
    .aemet-controls {
      padding: 10px 12px;
      border-bottom: 1px solid #e5e8eb;
      background: #fafbfd;
    }
    .aemet-controls-row {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
    }
    .aemet-controls-row + .aemet-controls-row { margin-top: 8px; }
    .aemet-btn {
      border: 1px solid #ced6de;
      background: #fff;
      color: #22303c;
      border-radius: 8px;
      min-width: 40px;
      height: 36px;
      padding: 0 10px;
      font-size: 14px;
      font-weight: 700;
      cursor: pointer;
    }
    .aemet-btn:hover { background: #f4f8fb; }
    .aemet-btn:disabled {
      opacity: .45;
      cursor: default;
      background: #fafafa;
    }
    .aemet-play-btn { min-width: 52px; }
    .aemet-range-wrap {
      flex: 1 1 260px;
      display: flex;
      align-items: center;
      gap: 8px;
      min-width: 180px;
    }
    /* Un solo deslizador de fotogramas, con dos pestanas arriba que
       delimitan el tramo reproducido sin ocultar el historico restante. */
    .aemet-frame-scrubber {
      position: relative;
      flex: 1 1 auto;
      min-width: 0;
      padding-top: 23px;
    }
    .aemet-range-wrap .aemet-frame-scrubber input[type=range] {
      display: block;
      box-sizing: border-box;
      width: 100%;
      height: 20px;
      margin: 0;
      padding: 0;
      position: relative;
      z-index: 2;
      background: transparent;
      -webkit-appearance: none;
      appearance: none;
      cursor: pointer;
    }
    .aemet-frame-scrubber input[type=range]::-webkit-slider-runnable-track {
      height: 6px;
      border: 0;
      background: transparent;
    }
    .aemet-frame-scrubber input[type=range]::-webkit-slider-thumb {
      -webkit-appearance: none;
      appearance: none;
      width: 16px;
      height: 16px;
      border-radius: 50%;
      background: #386d9a;
      border: 2px solid #fff;
      box-shadow: 0 0 0 1px #386d9a;
      margin-top: -5px;
    }
    .aemet-frame-scrubber input[type=range]::-moz-range-track {
      height: 6px;
      background: transparent;
      border: 0;
    }
    .aemet-frame-scrubber input[type=range]::-moz-range-thumb {
      width: 12px;
      height: 12px;
      border-radius: 50%;
      background: #386d9a;
      border: 2px solid #fff;
      box-shadow: 0 0 0 1px #386d9a;
    }
    .aemet-loop-track {
      position: absolute;
      top: 30px;
      left: 8px;
      right: 8px;
      height: 6px;
      border-radius: 10px;
      background: #cdd8e1;
      pointer-events: none;
    }
    .aemet-loop-track-selected {
      position: absolute;
      top: 0;
      bottom: 0;
      background: #87b3da;
      border-radius: 10px;
    }
    .aemet-loop-marker {
      position: absolute;
      top: 0;
      z-index: 3;
      width: 23px;
      height: 20px;
      padding: 0;
      border-radius: 5px 5px 2px 2px;
      transform: translateX(-50%);
      font: 700 10px/18px Arial, sans-serif;
      text-align: center;
      color: white;
      cursor: ew-resize;
      touch-action: none;
      user-select: none;
      -webkit-user-select: none;
    }
    .aemet-loop-marker::after {
      content: '';
      position: absolute;
      top: 100%;
      left: calc(50% - 1px);
      width: 2px;
      height: 9px;
      background: currentColor;
    }
    .aemet-loop-marker-start { background: #20794d; border: 1px solid #155838; }
    .aemet-loop-marker-end { background: #af6323; border: 1px solid #8a4712; }
    .aemet-loop-marker:focus-visible { outline: 2px solid #173e7c; outline-offset: 2px; }
    .aemet-loop-marker:disabled { opacity: .45; cursor: default; }
    /* Si los dos topes quedan proximos, van a distinta altura para poder
       agarrar ambos incluso cuando el usuario elige un tramo de 20 min. */
    .aemet-frame-scrubber.aemet-loop-stacked { padding-top: 45px; }
    .aemet-loop-stacked .aemet-loop-track { top: 52px; }
    .aemet-loop-stacked .aemet-loop-marker-start { top: 0; }
    .aemet-loop-stacked .aemet-loop-marker-start::after { height: 32px; }
    .aemet-loop-stacked .aemet-loop-marker-end { top: 22px; }
    .aemet-loop-stacked .aemet-loop-marker-end::after { height: 10px; }
    .aemet-loop-times {
      margin-top: 3px;
      min-height: 12px;
      font-size: 10px;
      line-height: 1.2;
      color: #536475;
      text-align: center;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .aemet-frame-count {
      flex: 0 0 auto;
      min-width: 58px;
      text-align: right;
      font-size: 12px;
      color: #586574;
      font-variant-numeric: tabular-nums;
    }
    .aemet-speed-wrap {
      display: flex;
      align-items: center;
      gap: 6px;
      color: #5c6976;
      font-size: 12px;
      white-space: nowrap;
    }
    .aemet-speed-wrap select {
      height: 32px;
      border: 1px solid #ced6de;
      border-radius: 8px;
      background: #fff;
      padding: 0 8px;
      font-size: 13px;
      color: #22303c;
    }

    .aemet-transparency-wrap {
      display: flex;
      align-items: center;
      gap: 7px;
      color: #5c6976;
      font-size: 12px;
      white-space: nowrap;
      flex: 1 1 230px;
      max-width: 330px;
    }
    .aemet-transparency-wrap input[type=range] {
      flex: 1 1 auto;
      min-width: 90px;
      accent-color: #386d9a;
    }
    .aemet-transparency-value {
      min-width: 34px;
      text-align: right;
      font-variant-numeric: tabular-nums;
      color: #445566;
    }
    .aemet-timestamp-pill {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      min-height: 32px;
      padding: 5px 10px;
      border-radius: 999px;
      background: #eef4f8;
      color: #445566;
      font-size: 12px;
      font-variant-numeric: tabular-nums;
    }
    .aemet-map-wrap {
      position: relative;
      width: 100%;
      height: 560px;
      background: #e7ebef;
    }
    #aemetRadarMap { width: 100%; height: 100%; }

    .aemet-radar-clock {
      position: absolute;
      top: 12px;
      right: 12px;
      z-index: 800;
      pointer-events: none;
      width: 200px;
      box-sizing: border-box;
      padding: 8px 10px 7px;
      border-radius: 9px;
      background: rgba(255,255,255,.94);
      box-shadow: 0 2px 9px rgba(0,0,0,.25);
      text-align: center;
      color: #18222c;
    }
    .aemet-radar-clock-label {
      font-size: 10px;
      line-height: 1;
      text-transform: uppercase;
      letter-spacing: .06em;
      color: #687684;
      font-weight: 700;
    }
    .aemet-radar-clock-time {
      margin-top: 2px;
      font-size: 25px;
      line-height: 1;
      font-weight: 800;
      font-variant-numeric: tabular-nums;
    }
    .aemet-radar-clock-date {
      margin-top: 3px;
      font-size: 10px;
      line-height: 1.1;
      color: #687684;
    }

    .aemet-radar-clock-kind {
      margin: 5px auto 0;
      display: block;
      width: max-content;
      max-width: 100%;
      box-sizing: border-box;
      padding: 3px 7px;
      white-space: nowrap;
      text-align: center;
      border-radius: 999px;
      font-size: 9px;
      line-height: 1;
      font-weight: 800;
      letter-spacing: .04em;
      text-transform: uppercase;
      background: #e9f4ec;
      color: #2f6b3d;
    }
    .aemet-radar-clock-kind.interpolated {
      background: #fff2d9;
      color: #8a5a00;
    }
    .aemet-radar-info {
      background: rgba(255,255,255,.95);
      padding: 8px 10px;
      border-radius: 7px;
      box-shadow: 0 1px 7px rgba(0,0,0,.24);
      font: 12px/1.32 Arial, sans-serif;
      max-width: 320px;
    }
    .aemet-radar-info strong {
      display: block;
      margin-bottom: 2px;
      font-size: 13px;
    }
    .aemet-pill {
      display: inline-block;
      margin-top: 4px;
      margin-right: 4px;
      padding: 2px 7px;
      border-radius: 999px;
      background: #eaf0f7;
      color: #405064;
      font-size: 10px;
    }
    .aemet-reflectivity-legend {
      padding: 9px 12px 8px;
      border-top: 1px solid #e5e8eb;
      background: #fff;
    }
    .aemet-reflectivity-legend-title {
      width: min(430px, 100%);
      margin: 0 auto 6px;
      color: #4f5c68;
      font-size: 11px;
      font-weight: 700;
      text-align: center;
    }
    .aemet-reflectivity-scale-wrap {
      width: min(430px, 100%);
      margin: 0 auto;
    }
    .aemet-reflectivity-scale {
      display: grid;
      grid-template-columns: repeat(11, 1fr);
      gap: 0;
      width: 100%;
      border: 1px solid rgba(0,0,0,.22);
    }
    .aemet-reflectivity-step {
      min-width: 0;
    }
    .aemet-reflectivity-color {
      height: 11px;
      border-right: 1px solid rgba(0,0,0,.22);
    }
    .aemet-reflectivity-step:last-child .aemet-reflectivity-color {
      border-right: 0;
    }
    .aemet-reflectivity-labels {
      position: relative;
      height: 14px;
      margin-top: 3px;
      color: #596673;
      font-size: 9px;
      line-height: 1;
      white-space: nowrap;
    }
    .aemet-reflectivity-label {
      position: absolute;
      top: 0;
      transform: translateX(-50%);
    }
    .aemet-reflectivity-label:first-child {
      transform: none;
    }

    .aemet-radar-footer {
      padding: 8px 12px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      border-top: 1px solid #e5e8eb;
      background: #fff;
      color: #6b747e;
      font-size: 11px;
      line-height: 1.3;
    }
    .aemet-footer-right { text-align: right; white-space: nowrap; }

    /* Descarga MP4 bajo demanda. Sin reproductor ni precarga del vídeo. */
    .aemet-video-download {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 14px;
      padding: 12px 14px;
      border-top: 1px solid #e5e8eb;
      background: #f8fafc;
    }
    .aemet-video-download[hidden] { display: none; }
    .aemet-video-download-copy { min-width: 0; }
    .aemet-video-download-title {
      font-size: 13px;
      font-weight: 700;
      line-height: 1.35;
      color: #263442;
    }
    .aemet-video-download-subtitle {
      margin-top: 3px;
      font-size: 11px;
      line-height: 1.4;
      color: #647383;
    }
    .aemet-video-download-button {
      display: inline-flex;
      flex: 0 0 auto;
      align-items: center;
      justify-content: center;
      min-height: 36px;
      padding: 8px 14px;
      border: 1px solid #235f8d;
      border-radius: 7px;
      background: #286b9c;
      color: #fff;
      text-decoration: none;
      font-size: 13px;
      font-weight: 700;
      line-height: 1.2;
      white-space: nowrap;
      box-sizing: border-box;
    }
    .aemet-video-download-button:hover,
    .aemet-video-download-button:focus-visible {
      background: #1e547d;
      color: #fff;
      text-decoration: none;
    }
    @media (max-width: 600px) {
      .aemet-video-download { flex-wrap: wrap; padding: 11px 10px; gap: 9px; }
      .aemet-video-download-button { width: 100%; }
    }

    @media (max-width: 800px) {
      .aemet-map-wrap { height: 500px; }
    }
    @media (max-width: 600px) {
      .aemet-radar-integration .wrapper,
      .aemet-radar-integration main.right,
      .aemet-radar-integration .contents.long,
      .aemet-radar-integration .body {
        width: 100% !important;
        max-width: none !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        box-sizing: border-box !important;
      }
      .aemet-radar-integration .contents.long {
        padding-left: 0 !important;
        padding-right: 0 !important;
      }
      .aemet-radar-integration .body {
        padding-left: 4px !important;
        padding-right: 4px !important;
      }
      .aemet-radar-viewer {
        position: static;
        width: 100%;
        max-width: none;
        transform: none;
      }
      .aemet-radar-card {
        border-left: 0; border-right: 0; border-radius: 0; box-shadow: none;
      }
      .aemet-radar-toolbar { min-height: 44px; padding: 7px 10px; }
      .aemet-radar-title { font-size: 14px; }
      .aemet-radar-subtitle { font-size: 10px; }
      .aemet-source-badge { padding: 4px 7px; font-size: 10px; }
      .aemet-controls { padding: 8px 10px; }
      .aemet-btn { min-width: 38px; height: 34px; font-size: 13px; }
      .aemet-play-btn { min-width: 50px; }
      .aemet-controls-row { gap: 6px; }
      .aemet-range-wrap { min-width: 100%; }
      .aemet-frame-count { min-width: 50px; font-size: 11px; }
      .aemet-speed-wrap { font-size: 11px; }
      .aemet-speed-wrap select { height: 30px; font-size: 12px; }
      .aemet-transparency-wrap {
        flex: 1 1 100%;
        max-width: none;
        font-size: 11px;
      }
      .aemet-transparency-wrap input[type=range] { min-width: 120px; }
      .aemet-timestamp-pill { font-size: 11px; padding: 4px 9px; }
      .aemet-map-wrap { height: 430px; }
      .aemet-radar-clock {
        top: 7px;
        right: 7px;
        width: 155px;
        max-width: calc(100vw - 14px);
        padding: 5px 7px 5px;
        border-radius: 8px;
      }
      .aemet-radar-clock-time { font-size: 19px; }
      .aemet-radar-clock-label, .aemet-radar-clock-date { font-size: 8px; }
      .aemet-radar-clock-kind {
        margin-top: 4px;
        padding: 2px 5px;
        font-size: 8px;
        letter-spacing: .025em;
      }
      .aemet-radar-info { max-width: 230px; padding: 6px 8px; font-size: 10.5px; }
      .aemet-radar-info strong { font-size: 11.5px; }
      .aemet-reflectivity-legend { padding: 8px 8px 7px; }
      .aemet-reflectivity-legend-title {
        width: min(360px, 100%);
        margin: 0 auto 5px;
        font-size: 10px;
        text-align: center;
      }
      .aemet-reflectivity-scale-wrap { width: min(360px, 100%); }
      .aemet-reflectivity-labels { font-size: 8px; }
      .aemet-radar-footer { padding: 7px 10px; font-size: 10px; }
      .aemet-footer-right { display: none; }
      .aemet-radar-viewer .leaflet-control-zoom a {
        width: 34px !important; height: 34px !important; line-height: 34px !important;
      }
      .aemet-radar-viewer .leaflet-control-attribution { font-size: 8px !important; }
    }
  
    .aemet-radar-viewer {
      width: 100%;
      margin: 0;
      padding: 0;
      font-family: Arial, Helvetica, sans-serif;
      color: #20242a;
    }




