/* TECTONIQ desktop-only layout reflow.
   Deliberately scoped to the existing desktop breakpoint (>=1201 CSS px).
   Mobile/tablet styles and the separate native Android repository are untouched. */

@media screen and (min-width: 1201px) {
  :root {
    --tq-desktop-gutter: 14px;
    --tq-desktop-gap: 12px;
    --tq-desktop-left-width: clamp(300px, 22vw, 356px);
    --tq-desktop-right-width: clamp(340px, 25.4vw, 410px);
    --tq-desktop-top-offset: 76px;
    --tq-desktop-bottom-offset: 14px;
    --tq-desktop-legend-cap: clamp(190px, 30dvh, 270px);
  }

  html,
  body {
    width: 100%;
    height: 100%;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }

  /* Keep the map as the full-bleed canvas behind the three dashboard zones. */
  #map {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
  }

  .map-overlay {
    position: absolute !important;
    inset: 0 !important;
    pointer-events: none !important;
  }

  /* Left upper panel fills only the space above the legend.
     Its own scroll prevents long event details from covering other cards. */
  #cardRealtime.left-top {
    position: fixed !important;
    top: var(--tq-desktop-top-offset) !important;
    right: auto !important;
    bottom: calc(var(--tq-desktop-bottom-offset) + var(--tq-desktop-legend-cap) + var(--tq-desktop-gap)) !important;
    left: var(--tq-desktop-gutter) !important;
    width: var(--tq-desktop-left-width) !important;
    max-width: calc(100vw - var(--tq-desktop-left-width) - var(--tq-desktop-right-width) - 48px) !important;
    min-height: 0 !important;
    max-height: none !important;
    height: auto !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    scrollbar-width: thin !important;
    z-index: 520 !important;
  }

  #cardRealtime .world-clock-panel {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Keep one parameter block: the existing BMKG/InaTEWS parameter area
     inside the lower clock panel remains the source of the displayed values. */
  #cardRealtime .world-clock-param {
    min-width: 0 !important;
    overflow-wrap: anywhere !important;
  }

  /* The legend occupies a reserved lower-left slot, never the same space
     as the realtime card. If its content grows, it scrolls inside its card. */
  .left-bottom {
    position: fixed !important;
    top: auto !important;
    right: auto !important;
    bottom: var(--tq-desktop-bottom-offset) !important;
    left: var(--tq-desktop-gutter) !important;
    width: var(--tq-desktop-left-width) !important;
    max-width: calc(100vw - var(--tq-desktop-left-width) - var(--tq-desktop-right-width) - 48px) !important;
    height: auto !important;
    max-height: var(--tq-desktop-legend-cap) !important;
    min-height: 0 !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    scrollbar-width: thin !important;
    z-index: 521 !important;
  }

  /* Right-hand event detail is a self-contained scroll area with a small
     outer gutter, so long ShakeMaps and BMKG notes cannot spill over the map. */
  .right-panel {
    position: fixed !important;
    top: var(--tq-desktop-gutter) !important;
    right: var(--tq-desktop-gutter) !important;
    bottom: var(--tq-desktop-gutter) !important;
    left: auto !important;
    width: var(--tq-desktop-right-width) !important;
    max-width: calc(100vw - var(--tq-desktop-left-width) - 48px) !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: calc(100dvh - var(--tq-desktop-gutter) - var(--tq-desktop-gutter)) !important;
    box-sizing: border-box !important;
    border: 1px solid rgba(125, 170, 205, .28) !important;
    border-radius: 18px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    scrollbar-width: thin !important;
    z-index: 530 !important;
  }

  .right-panel > * {
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Do not apply image sizing rules to Leaflet's 256px map tiles.
     The previous generic img rule collapsed the tiles and left only the
     epicentre marker visible in the desktop event inset. */
  .right-panel .rp-shakemap img,
  .right-panel .rp-shakemap svg {
    display: block !important;
    max-width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
  }

  #rightPanel .rp-mini-map {
    flex: 0 0 130px !important;
    width: 100% !important;
    min-height: 130px !important;
    height: 130px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    background: #e8edf2 !important;
  }

  #rightPanel #miniFocus.leaflet-container {
    width: 100% !important;
    height: 130px !important;
    min-height: 130px !important;
    background: #e8edf2 !important;
  }

  #rightPanel #miniFocus .leaflet-tile {
    max-width: none !important;
    max-height: none !important;
    object-fit: fill !important;
  }

  /* Keep map controls inside the map column instead of underneath the
     right-hand detail panel. */
  .v-toolbar {
    position: fixed !important;
    top: 50% !important;
    right: calc(var(--tq-desktop-right-width) + 28px) !important;
    bottom: auto !important;
    left: auto !important;
    transform: translateY(-50%) !important;
    z-index: 610 !important;
  }

  .basemap-menu {
    position: fixed !important;
    top: 50% !important;
    right: calc(var(--tq-desktop-right-width) + 78px) !important;
    bottom: auto !important;
    left: auto !important;
    transform: translateY(-50%) !important;
    max-height: 72dvh !important;
    overflow-y: auto !important;
    z-index: 611 !important;
  }

  /* Center connection status in the usable map column, not across the
     entire browser window where it could collide with the side panels. */
  .wrs-health {
    left: calc(
      var(--tq-desktop-gutter) + var(--tq-desktop-left-width) +
      (100vw - var(--tq-desktop-gutter) - var(--tq-desktop-gutter) - var(--tq-desktop-left-width) - var(--tq-desktop-right-width)) / 2
    ) !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    width: max-content !important;
    max-width: min(650px, calc(100vw - var(--tq-desktop-left-width) - var(--tq-desktop-right-width) - 48px)) !important;
    box-sizing: border-box !important;
    z-index: 620 !important;
  }

  /* Prevent long labels and metadata from forcing the side panels wider. */
  #cardRealtime,
  #cardRealtime *,
  .left-bottom,
  .left-bottom *,
  .right-panel,
  .right-panel * {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  /* Avoid oversized controls on short desktop/laptop screens. */
  @media (max-height: 720px) {
    :root {
      --tq-desktop-top-offset: 68px;
      --tq-desktop-legend-cap: clamp(160px, 27dvh, 220px);
    }

    #cardRealtime.left-top {
      top: var(--tq-desktop-top-offset) !important;
    }
  }
}


/* Follow-up polish: stop the live card from stretching to the legend.
   Restore the midnight-glass visual language on desktop even when the
   optional light theme is selected; mobile keeps its own theme unchanged. */
@media screen and (min-width: 1201px) {
  /* The live card must size to its content, not fill the entire left rail. */
  #cardRealtime.left-top {
    top: var(--tq-desktop-top-offset) !important;
    bottom: auto !important;
    height: fit-content !important;
    max-height: min(58dvh, 560px) !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }

  #cardRealtime .panel-header {
    min-height: 38px !important;
    padding: 9px 12px !important;
    color: #f5f9ff !important;
    background: linear-gradient(100deg, rgba(12, 49, 76, .98), rgba(8, 30, 51, .98)) !important;
    border-bottom: 1px solid rgba(93, 187, 225, .22) !important;
  }

  #cardRealtime .panel-sub,
  #cardRealtime #rtFilter,
  #cardRealtime #rtCoord,
  #cardRealtime #rtDist,
  #cardRealtime #rtSrc {
    color: #b9cadd !important;
  }

  #cardRealtime #rtDate,
  #cardRealtime #rtPlace {
    color: #f2f7ff !important;
  }

  #cardRealtime #worldClockPanel.world-clock-panel {
    margin: 8px 10px 10px !important;
    width: calc(100% - 20px) !important;
    padding: 10px 11px !important;
    border: 1px solid rgba(77, 190, 224, .28) !important;
    border-radius: 12px !important;
    background: linear-gradient(145deg, #0b2940, #071a2b) !important;
    box-shadow: inset 0 1px rgba(255,255,255,.045), 0 8px 20px rgba(0,0,0,.2) !important;
    color: #edf6ff !important;
  }

  #cardRealtime .world-clock-head {
    color: #8de8f7 !important;
    margin-bottom: 8px !important;
  }

  #cardRealtime .world-clock-grid > .world-clock-time {
    background: transparent !important;
  }

  #cardRealtime .world-clock-grid > .world-clock-time small,
  #cardRealtime .world-clock-param small {
    color: #a9c6da !important;
  }

  #cardRealtime .world-clock-grid > .world-clock-time strong {
    color: #a9efff !important;
    font-size: 18px !important;
  }

  #cardRealtime .world-clock-grid > .world-clock-time time,
  #cardRealtime .world-clock-param span {
    color: #dceaf5 !important;
  }

  #cardRealtime .world-clock-param {
    border-top-color: rgba(123, 194, 220, .22) !important;
  }

  /* Keep the lower legend compact and visually consistent with the live card. */
  .left-bottom {
    background: rgba(5, 17, 30, .96) !important;
    color: #e5eff8 !important;
    border: 1px solid rgba(116, 162, 198, .32) !important;
    border-radius: 14px !important;
    box-shadow: 0 12px 30px rgba(0,0,0,.34) !important;
  }

  .left-bottom .disc,
  .left-bottom .leg-row,
  .left-bottom .leg-lab,
  .left-bottom .brand-clock {
    color: #b8cada !important;
  }

  .left-bottom .disc b,
  .left-bottom .leg-h {
    color: #f2f7ff !important;
  }

  /* Force the desktop shell back to the deep navy monitoring palette.
     The quake-status element keeps its inline state colors (red/amber/green)
     so missing tsunami metadata is never presented as an official all-clear. */
  #cardRealtime.glass-panel,
  #rightPanel.right-panel.glass-panel,
  .left-bottom.glass-panel {
    background: rgba(5, 16, 29, .97) !important;
    color: #eaf2fb !important;
    border-color: rgba(119, 164, 199, .34) !important;
    box-shadow: 0 14px 38px rgba(0,0,0,.42), inset 0 1px rgba(255,255,255,.045) !important;
    -webkit-backdrop-filter: blur(18px) saturate(1.15) !important;
    backdrop-filter: blur(18px) saturate(1.15) !important;
  }

  #rightPanel .rp-sheet-handle {
    display: none !important;
  }

  #rightPanel .rp-mode {
    color: #bcecff !important;
    background: linear-gradient(90deg, #0c3855, #082a43) !important;
    border-bottom: 1px solid rgba(99, 187, 222, .16) !important;
  }

  #rightPanel .rp-mini-map {
    background: #081827 !important;
    border-bottom-color: rgba(113, 156, 189, .2) !important;
  }

  #rightPanel .rp-stats {
    background: #0a1b2b !important;
    border-bottom-color: rgba(113, 156, 189, .2) !important;
  }

  #rightPanel .rp-stats > div {
    border-right-color: rgba(113, 156, 189, .2) !important;
  }

  #rightPanel .rp-stats small {
    color: #9fb5c9 !important;
  }

  #rightPanel .rp-stats b {
    color: #f0f6fd !important;
  }

  #rightPanel .rp-desc {
    color: #d9e6f2 !important;
    background: #0b1b2b !important;
    border-bottom-color: rgba(113, 156, 189, .16) !important;
  }

  #rightPanel .rp-shakemap {
    background: #071523 !important;
    border-color: rgba(113, 156, 189, .3) !important;
    border-radius: 12px !important;
    overflow: hidden !important;
  }

  #rightPanel .rp-shakemap-h {
    color: #c5d8e8 !important;
    background: #10283c !important;
  }

  #rightPanel .rp-shakemap img {
    background: #071523 !important;
  }

  #rightPanel .btn-detail-standalone {
    min-height: 42px !important;
    margin-top: 7px !important;
    border: 1px solid rgba(100, 205, 239, .25) !important;
    background: linear-gradient(100deg, #08769c, #075b84) !important;
    box-shadow: 0 6px 16px rgba(0, 113, 160, .2) !important;
  }

  #rightPanel .rp-pot {
    font-size: 12px !important;
    line-height: 1.55 !important;
    font-weight: 750 !important;
    letter-spacing: .005em !important;
    border-radius: 11px !important;
    padding: 11px 12px !important;
    box-shadow: 0 5px 16px rgba(0,0,0,.18) !important;
    overflow-wrap: anywhere !important;
  }

  #rightPanel .rp-instr {
    color: #f4dca6 !important;
    background: linear-gradient(145deg, #2c2415, #1d1b16) !important;
    border-color: rgba(220, 173, 85, .28) !important;
    border-radius: 11px !important;
    font-size: 11px !important;
    line-height: 1.55 !important;
  }

  #rightPanel .rp-instr b {
    color: #ffcf72 !important;
  }

  #rightPanel .rp-links a {
    color: #a8e7ff !important;
    background: #102b40 !important;
    border-color: rgba(95, 174, 210, .25) !important;
  }

  #rightPanel .rp-quick .qbtn {
    min-height: 54px !important;
    color: #eaf4fc !important;
    background: #10263a !important;
    border: 1px solid rgba(116, 165, 199, .22) !important;
    border-radius: 11px !important;
  }

  #rightPanel .rp-quick .qbtn:hover {
    background: #16364e !important;
    border-color: rgba(105, 203, 235, .42) !important;
  }

  #rightPanel .rp-quick-opts,
  #rightPanel .rp-quick-status,
  #rightPanel .rp-live {
    color: #aec2d4 !important;
  }

  #rightPanel .rp-foot {
    color: #93a9bd !important;
    background: rgba(2, 10, 19, .7) !important;
    border-top-color: rgba(113, 156, 189, .18) !important;
  }

  .v-toolbar .tb-btn {
    color: #d9efff !important;
    background: rgba(5, 20, 34, .94) !important;
    border: 1px solid rgba(112, 167, 201, .38) !important;
    box-shadow: 0 6px 18px rgba(0,0,0,.3) !important;
  }

  .v-toolbar .tb-btn:hover,
  .v-toolbar .tb-btn:focus-visible {
    color: #a6efff !important;
    background: #12334b !important;
    border-color: rgba(105, 213, 245, .56) !important;
  }

  .wrs-health {
    color: #eaf5fd !important;
    background: rgba(5, 19, 32, .94) !important;
    border-color: rgba(105, 189, 220, .28) !important;
    box-shadow: 0 8px 24px rgba(0,0,0,.32) !important;
  }

  .wrs-health time {
    color: #a9c1d3 !important;
  }

  /* Explicitly neutralize light-theme card rules only on wide desktop. */
  html[data-wrs-theme="light"] #cardRealtime.glass-panel,
  html[data-wrs-theme="light"] #rightPanel.right-panel.glass-panel,
  html[data-wrs-theme="light"] .left-bottom.glass-panel {
    background: rgba(5, 16, 29, .97) !important;
    color: #eaf2fb !important;
    border-color: rgba(119, 164, 199, .34) !important;
  }

  html[data-wrs-theme="light"] #cardRealtime .panel-header-title,
  html[data-wrs-theme="light"] #cardRealtime #rtDate,
  html[data-wrs-theme="light"] #cardRealtime #rtPlace,
  html[data-wrs-theme="light"] #rightPanel .rp-mag-info span,
  html[data-wrs-theme="light"] #rightPanel .rp-stats b,
  html[data-wrs-theme="light"] #rightPanel .rp-desc,
  html[data-wrs-theme="light"] #rightPanel .rp-instr span {
    color: #eaf2fb !important;
  }

  html[data-wrs-theme="light"] #cardRealtime .panel-sub,
  html[data-wrs-theme="light"] #cardRealtime #rtFilter,
  html[data-wrs-theme="light"] #cardRealtime #rtAgo,
  html[data-wrs-theme="light"] #cardRealtime #rtCoord,
  html[data-wrs-theme="light"] #cardRealtime #rtDist,
  html[data-wrs-theme="light"] #cardRealtime #rtSrc,
  html[data-wrs-theme="light"] #rightPanel .rp-stats small,
  html[data-wrs-theme="light"] #rightPanel .rp-foot {
    color: #b8cada !important;
  }
}


/* Hard override for the old light-theme clock card. This nested selector
   deliberately outranks wrs-desktop-readability.css on wide desktop only. */
@media screen and (min-width: 1201px) {
  html[data-wrs-theme="light"] #cardRealtime #worldClockPanel.world-clock-panel {
    color: #edf6ff !important;
    background: linear-gradient(145deg, #0b2940, #071a2b) !important;
    border: 1px solid rgba(77, 190, 224, .32) !important;
    box-shadow: inset 0 1px rgba(255,255,255,.045), 0 8px 20px rgba(0,0,0,.22) !important;
  }

  html[data-wrs-theme="light"] #cardRealtime #worldClockPanel.world-clock-panel #worldClockContent,
  html[data-wrs-theme="light"] #cardRealtime #worldClockPanel.world-clock-panel .world-clock-grid,
  html[data-wrs-theme="light"] #cardRealtime #worldClockPanel.world-clock-panel .world-clock-time,
  html[data-wrs-theme="light"] #cardRealtime #worldClockPanel.world-clock-panel .world-clock-param {
    color: #edf6ff !important;
    background: transparent !important;
    border-color: rgba(123, 194, 220, .22) !important;
  }

  html[data-wrs-theme="light"] #cardRealtime #worldClockPanel.world-clock-panel .world-clock-head {
    color: #8de8f7 !important;
  }

  html[data-wrs-theme="light"] #cardRealtime #worldClockPanel.world-clock-panel .world-clock-time small,
  html[data-wrs-theme="light"] #cardRealtime #worldClockPanel.world-clock-panel .world-clock-param small {
    color: #a9c6da !important;
  }

  html[data-wrs-theme="light"] #cardRealtime #worldClockPanel.world-clock-panel .world-clock-time strong {
    color: #a9efff !important;
  }

  html[data-wrs-theme="light"] #cardRealtime #worldClockPanel.world-clock-panel .world-clock-time time,
  html[data-wrs-theme="light"] #cardRealtime #worldClockPanel.world-clock-panel .world-clock-param span {
    color: #dceaf5 !important;
  }
}


/* TECTONIQ ShakeMap states: never expose an empty/broken image element. */
#mobilePageDetail.active:not(#mobilePageMap) #rightPanel #shakemapBox:not(.hidden) #shakemapImg.wrs-shakemap-unavailable,
#rightPanel #shakemapBox #shakemapImg.wrs-shakemap-unavailable,
#modalDetail #modalShakemapBox #modalShakemapImg.wrs-shakemap-unavailable {
  display: none !important;
  min-height: 0 !important;
}

#rightPanel #shakemapBox.wrs-map-loading {
  position: relative !important;
  min-height: 174px !important;
  overflow: hidden !important;
  border-radius: 12px !important;
  background: linear-gradient(110deg, #0d1b2a 20%, #1b354c 36%, #0d1b2a 52%);
  background-size: 220% 100%;
  animation: tectoniqShakeMapSkeleton 1.25s ease-in-out infinite;
}

#rightPanel #shakemapBox.wrs-map-loading .rp-shakemap-h {
  position: relative !important;
  z-index: 1 !important;
}

#rightPanel #shakemapBox.wrs-map-loading #shakemapImg,
#modalDetail #modalShakemapBox.wrs-map-loading #modalShakemapImg {
  opacity: 0 !important;
}

#rightPanel #shakemapBox.wrs-map-loading .wrs-shakemap-empty,
#modalDetail #modalShakemapBox.wrs-map-loading .wrs-shakemap-empty {
  display: none !important;
}

#rightPanel #shakemapBox.wrs-map-loading::after {
  content: "Memuat ShakeMap resmi…";
  position: absolute;
  inset: auto 10px 13px;
  z-index: 2;
  display: block;
  color: #a8d9ed;
  text-align: center;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.5;
  text-shadow: 0 1px 3px rgba(0,0,0,.35);
}

#rightPanel #shakemapBox .wrs-shakemap-empty,
#modalDetail #modalShakemapBox .wrs-shakemap-empty {
  display: flex !important;
  align-items: center;
  gap: 11px;
  min-width: 0;
  min-height: 68px;
  margin: 0 !important;
  padding: 14px !important;
  box-sizing: border-box;
  line-height: 1.55 !important;
  overflow-wrap: anywhere;
}

#rightPanel #shakemapBox .wrs-shakemap-empty::before,
#modalDetail #modalShakemapBox .wrs-shakemap-empty::before {
  content: "▧";
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-size: 17px;
  background: rgba(105, 155, 195, .13);
  color: #82b7d9;
}

html[data-wrs-theme="light"] #rightPanel #shakemapBox.wrs-map-loading {
  background: linear-gradient(110deg, #edf2f7 20%, #ffffff 36%, #edf2f7 52%);
  background-size: 220% 100%;
}

html[data-wrs-theme="light"] #rightPanel #shakemapBox.wrs-map-loading::after {
  color: #52677d;
  text-shadow: none;
}

html[data-wrs-theme="light"] #rightPanel #shakemapBox .wrs-shakemap-empty,
html[data-wrs-theme="light"] #modalDetail #modalShakemapBox .wrs-shakemap-empty {
  background: #f8fafc !important;
  color: #526174 !important;
  border-top: 1px solid #e1e7ef !important;
}

html[data-wrs-theme="dark"] #rightPanel #shakemapBox .wrs-shakemap-empty,
html[data-wrs-theme="dark"] #modalDetail #modalShakemapBox .wrs-shakemap-empty {
  background: #101925 !important;
  color: #aebdce !important;
  border-top: 1px solid rgba(188,201,218,.14) !important;
}

@keyframes tectoniqShakeMapSkeleton {
  to { background-position-x: -220%; }
}

@media (prefers-reduced-motion: reduce) {
  #rightPanel #shakemapBox.wrs-map-loading {
    animation: none;
    background: #122236;
  }
  html[data-wrs-theme="light"] #rightPanel #shakemapBox.wrs-map-loading {
    background: #edf2f7;
  }
}

/* ========================================================================
   TECTONIQ BROWSER-ONLY BROCHURE REFINEMENT
   Guarded by .tectoniq-browser-web, which is never set inside the Android APK.
   Do not remove this guard or broaden these selectors to html[data-tectoniq-ui].
   ======================================================================== */

html.tectoniq-browser-web {
  color-scheme: dark !important;
  --tq-desktop-right-width: clamp(320px, 23vw, 372px);
}

/* Browser layout: keep WIB/UTC side by side and restore the latest BMKG/InaTEWS
   parameter block as a full-width row beneath them. Android APK is excluded by
   the tectoniq-browser-web guard above. */
html.tectoniq-browser-web #cardRealtime .world-clock-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}
html.tectoniq-browser-web #cardRealtime .world-clock-param {
  display: flex !important;
  flex-direction: column !important;
  grid-column: 1 / -1 !important;
  min-width: 0 !important;
  margin: 7px 0 0 !important;
  padding: 8px 0 1px !important;
  border-top: 1px solid rgba(123, 194, 220, .25) !important;
  border-left: 0 !important;
  overflow-wrap: anywhere !important;
}
html.tectoniq-browser-web #cardRealtime .world-clock-param small {
  display: block !important;
  margin: 0 0 3px !important;
  color: #a9c6da !important;
  font-size: 7px !important;
  font-weight: 900 !important;
  letter-spacing: .08em !important;
}
html.tectoniq-browser-web #cardRealtime .world-clock-param strong {
  display: block !important;
  margin: 1px 0 3px !important;
  color: #a9efff !important;
  font-size: 17px !important;
  line-height: 1.15 !important;
  font-variant-numeric: tabular-nums !important;
}
html.tectoniq-browser-web #cardRealtime .world-clock-param span {
  display: block !important;
  min-width: 0 !important;
  color: #dceaf5 !important;
  font-size: 9px !important;
  line-height: 1.4 !important;
  overflow-wrap: anywhere !important;
}
html.tectoniq-browser-web #cardRealtime .world-clock-param .rt-param-revision {
  margin-top: 3px !important;
  color: #91dff2 !important;
}

/* A single deep-navy surface for every brochure section. Status colours on
   #offPot remain state-driven so official/unknown tsunami states stay distinct. */
html.tectoniq-browser-web #rightPanel.right-panel {
  color-scheme: dark !important;
  color: #e7f0fa !important;
  background: #071523 !important;
  border: 1px solid rgba(104, 160, 195, .28) !important;
  box-shadow: 0 16px 42px rgba(0,0,0,.42) !important;
  scrollbar-color: #29465d #081827;
}
html.tectoniq-browser-web #rightPanel .rp-sheet-handle {
  background: #071523 !important;
}
html.tectoniq-browser-web #rightPanel .rp-handle-bar {
  background: #668399 !important;
}
html.tectoniq-browser-web #rightPanel .rp-mag-bar {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  min-height: 82px !important;
  padding: 11px 13px !important;
  box-sizing: border-box !important;
  background: linear-gradient(105deg, #3a1420, #211522 72%, #101c2b) !important;
  border-bottom: 1px solid rgba(236, 85, 103, .22) !important;
  overflow: visible !important;
}
html.tectoniq-browser-web #rightPanel .rp-mag {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 0 0 82px !important;
  min-width: 82px !important;
  line-height: 1 !important;
  font-size: clamp(34px, 3vw, 46px) !important;
  color: #fff !important;
}
html.tectoniq-browser-web #rightPanel .rp-mag-info {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 3px !important;
  overflow-wrap: anywhere !important;
}
html.tectoniq-browser-web #rightPanel .rp-mag-info b {
  color: #e5edf6 !important;
  font-size: 10px !important;
  letter-spacing: .07em !important;
  line-height: 1.35 !important;
}
html.tectoniq-browser-web #rightPanel .rp-mag-info span {
  color: #fff !important;
  font-size: 13px !important;
  line-height: 1.35 !important;
}
html.tectoniq-browser-web #rightPanel .rp-mag-info small {
  color: #a9bdce !important;
  font-size: 10px !important;
  line-height: 1.35 !important;
}
html.tectoniq-browser-web #rightPanel .rp-mode {
  min-height: 34px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 7px 12px !important;
  color: #b9d7e9 !important;
  background: #0b2134 !important;
  border-bottom: 1px solid rgba(111, 159, 190, .16) !important;
  font-size: 10px !important;
  line-height: 1.4 !important;
  letter-spacing: .08em !important;
  text-align: center !important;
}
html.tectoniq-browser-web #rightPanel .rp-mini-map {
  flex: 0 0 126px !important;
  width: 100% !important;
  height: 126px !important;
  min-height: 126px !important;
  background: #071523 !important;
  border-bottom: 1px solid rgba(111, 159, 190, .18) !important;
  overflow: hidden !important;
}
html.tectoniq-browser-web #rightPanel #miniFocus.leaflet-container {
  width: 100% !important;
  height: 126px !important;
  min-height: 126px !important;
  background: #0a1b2b !important;
}
html.tectoniq-browser-web #rightPanel .rp-stats {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 0 !important;
  padding: 9px 5px !important;
  background: #0a1b2b !important;
  border-bottom: 1px solid rgba(111, 159, 190, .18) !important;
}
html.tectoniq-browser-web #rightPanel .rp-stats > div {
  min-width: 0 !important;
  padding: 3px 6px !important;
  border-right: 1px solid rgba(111, 159, 190, .18) !important;
}
html.tectoniq-browser-web #rightPanel .rp-stats > div:last-child {
  border-right: 0 !important;
}
html.tectoniq-browser-web #rightPanel .rp-stats small {
  display: block !important;
  color: #91a9bd !important;
  font-size: 9px !important;
  line-height: 1.35 !important;
  text-align: center !important;
}
html.tectoniq-browser-web #rightPanel .rp-stats b {
  display: block !important;
  color: #eef5fc !important;
  font-size: 10.5px !important;
  line-height: 1.45 !important;
  text-align: center !important;
  overflow-wrap: anywhere !important;
}
html.tectoniq-browser-web #rightPanel .rp-desc {
  padding: 11px 13px !important;
  color: #c5d5e3 !important;
  background: #0a1a29 !important;
  border-bottom: 1px solid rgba(111, 159, 190, .15) !important;
  font-size: 11px !important;
  line-height: 1.5 !important;
  overflow-wrap: anywhere !important;
}
html.tectoniq-browser-web #rightPanel .rp-shakemap {
  display: block !important;
  width: calc(100% - 20px) !important;
  margin: 10px !important;
  padding: 0 !important;
  background: #081827 !important;
  border: 1px solid rgba(111, 159, 190, .24) !important;
  border-radius: 11px !important;
  overflow: hidden !important;
}
html.tectoniq-browser-web #rightPanel .rp-shakemap-h {
  padding: 8px 10px !important;
  color: #bcd3e5 !important;
  background: #10263a !important;
  font-size: 9px !important;
  line-height: 1.4 !important;
}
html.tectoniq-browser-web #rightPanel .rp-shakemap img {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  max-height: 220px !important;
  margin: 0 auto !important;
  object-fit: contain !important;
  background: #071523 !important;
}
html.tectoniq-browser-web #rightPanel .btn-detail-standalone {
  display: block !important;
  width: calc(100% - 24px) !important;
  min-height: 42px !important;
  margin: 7px 12px 9px !important;
  border: 1px solid rgba(78, 190, 226, .28) !important;
  border-radius: 9px !important;
  background: linear-gradient(100deg, #08769c, #075b84) !important;
  color: #f1fbff !important;
}
html.tectoniq-browser-web #rightPanel .rp-pot {
  margin: 8px 12px !important;
  padding: 10px 11px !important;
  border-radius: 10px !important;
  font-size: 11px !important;
  line-height: 1.5 !important;
  font-weight: 750 !important;
  overflow-wrap: anywhere !important;
}
html.tectoniq-browser-web #rightPanel .rp-instr {
  margin: 8px 12px !important;
  padding: 10px 11px !important;
  color: #ead9ad !important;
  background: #211e17 !important;
  border: 1px solid rgba(205, 164, 82, .24) !important;
  border-radius: 10px !important;
  font-size: 10.5px !important;
  line-height: 1.5 !important;
}
html.tectoniq-browser-web #rightPanel .rp-instr b {
  display: block !important;
  margin-bottom: 3px !important;
  color: #f2cc7b !important;
}
html.tectoniq-browser-web #rightPanel .rp-links {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 5px !important;
  padding: 8px 12px !important;
  background: #071523 !important;
}
html.tectoniq-browser-web #rightPanel .rp-links a {
  color: #b5e8f8 !important;
  background: #102b40 !important;
  border: 1px solid rgba(95, 174, 210, .22) !important;
  border-radius: 7px !important;
  padding: 6px 8px !important;
  font-size: 9px !important;
}
html.tectoniq-browser-web #rightPanel .rp-quick {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 7px !important;
  padding: 9px 12px 5px !important;
  background: #071523 !important;
}
html.tectoniq-browser-web #rightPanel .rp-quick .qbtn {
  min-width: 0 !important;
  min-height: 52px !important;
  color: #e5f1fb !important;
  background: #10263a !important;
  border: 1px solid rgba(116, 165, 199, .22) !important;
  border-radius: 9px !important;
}
html.tectoniq-browser-web #rightPanel .rp-quick .qbtn span:last-child {
  color: #bdd0e0 !important;
  font-size: 10px !important;
}
html.tectoniq-browser-web #rightPanel .rp-quick-opts,
html.tectoniq-browser-web #rightPanel .rp-quick-status,
html.tectoniq-browser-web #rightPanel .rp-live {
  color: #a9bfd0 !important;
  background: #081827 !important;
}
html.tectoniq-browser-web #rightPanel .rp-quick-opts {
  padding: 6px 13px !important;
  font-size: 10px !important;
}
html.tectoniq-browser-web #rightPanel .rp-quick-status {
  padding: 4px 13px !important;
  font-size: 10px !important;
  line-height: 1.4 !important;
}
html.tectoniq-browser-web #rightPanel .rp-live {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 5px !important;
  padding: 8px 13px !important;
  font-size: 9px !important;
}
html.tectoniq-browser-web #rightPanel .rp-foot {
  padding: 9px 13px !important;
  color: #8fa9bd !important;
  background: #06111d !important;
  border-top: 1px solid rgba(111, 159, 190, .16) !important;
  font-size: 9px !important;
  line-height: 1.45 !important;
}

/* Desktop browser: keep the full brochure inside the viewport at 100% zoom. */
@media screen and (min-width: 1201px) {
  html.tectoniq-browser-web #rightPanel.right-panel {
    position: fixed !important;
    top: 12px !important;
    right: 12px !important;
    bottom: 12px !important;
    left: auto !important;
    width: var(--tq-desktop-right-width) !important;
    max-width: min(372px, calc(100vw - 700px)) !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: calc(100dvh - 24px) !important;
    display: flex !important;
    flex-direction: column !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    scroll-behavior: smooth;
    z-index: 760 !important;
  }
  html.tectoniq-browser-web #rightPanel .rp-sheet-handle {
    display: none !important;
  }
  html.tectoniq-browser-web #rightPanel .rp-mag-bar {
    position: sticky !important;
    top: 0 !important;
    z-index: 8 !important;
    flex: 0 0 auto !important;
  }
  html.tectoniq-browser-web #rightPanel .rp-mini-map {
    flex-basis: 116px !important;
    height: 116px !important;
    min-height: 116px !important;
  }
  html.tectoniq-browser-web #rightPanel #miniFocus.leaflet-container {
    height: 116px !important;
    min-height: 116px !important;
  }
  html.tectoniq-browser-web #rightPanel .rp-shakemap img {
    max-height: 190px !important;
  }
  html.tectoniq-browser-web #wrsAiDock {
    right: calc(var(--tq-desktop-right-width) + 24px) !important;
    bottom: 16px !important;
    z-index: 650 !important;
  }
  html.tectoniq-browser-web #wrsAiPanel.wrs-ai-panel {
    right: calc(var(--tq-desktop-right-width) + 24px) !important;
    bottom: 58px !important;
    z-index: 651 !important;
  }
}

/* Tablet browser: use a compact side brochure instead of a half-width collision. */
@media screen and (min-width: 901px) and (max-width: 1200px) {
  html.tectoniq-browser-web #rightPanel.right-panel {
    position: fixed !important;
    top: 12px !important;
    right: 12px !important;
    bottom: 12px !important;
    left: auto !important;
    width: min(370px, 42vw) !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: calc(100dvh - 24px) !important;
    display: flex !important;
    flex-direction: column !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    border-radius: 16px !important;
    z-index: 760 !important;
  }
  html.tectoniq-browser-web #rightPanel .rp-sheet-handle {
    display: none !important;
  }
  html.tectoniq-browser-web #rightPanel .rp-mag-bar {
    position: sticky !important;
    top: 0 !important;
    z-index: 8 !important;
  }
  html.tectoniq-browser-web #wrsAiDock {
    right: calc(min(370px, 42vw) + 22px) !important;
    bottom: 16px !important;
  }
}

/* Mobile browser: a true dark, scrollable bottom sheet with a stable header. */
@media screen and (max-width: 900px) {
  html.tectoniq-browser-web #rightPanel.right-panel {
    position: fixed !important;
    top: auto !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: min(66dvh, 650px) !important;
    min-height: 230px !important;
    max-height: 86dvh !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 0 0 calc(8px + env(safe-area-inset-bottom, 0px)) !important;
    border-radius: 19px 19px 0 0 !important;
    border-bottom: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain !important;
    z-index: 760 !important;
    box-shadow: 0 -14px 38px rgba(0,0,0,.52) !important;
  }
  html.tectoniq-browser-web #rightPanel.right-panel.sheet-collapsed {
    height: 106px !important;
    min-height: 106px !important;
    max-height: 106px !important;
    overflow: hidden !important;
  }
  html.tectoniq-browser-web #rightPanel .rp-sheet-handle {
    position: sticky !important;
    top: 0 !important;
    z-index: 12 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 25px !important;
    width: 100% !important;
    height: 25px !important;
    min-height: 25px !important;
    padding: 6px 0 !important;
    background: #071523 !important;
  }
  html.tectoniq-browser-web #rightPanel .rp-mag-bar {
    position: sticky !important;
    top: 25px !important;
    z-index: 11 !important;
    flex: 0 0 auto !important;
    min-height: 78px !important;
  }
  html.tectoniq-browser-web #rightPanel .rp-mag {
    flex-basis: 76px !important;
    min-width: 76px !important;
    font-size: 36px !important;
  }
  html.tectoniq-browser-web #rightPanel .rp-mode {
    min-height: 32px !important;
    font-size: 9px !important;
  }
  html.tectoniq-browser-web #rightPanel .rp-mini-map {
    flex-basis: 120px !important;
    height: 120px !important;
    min-height: 120px !important;
  }
  html.tectoniq-browser-web #rightPanel #miniFocus.leaflet-container {
    height: 120px !important;
    min-height: 120px !important;
  }
  html.tectoniq-browser-web #rightPanel .rp-stats {
    padding: 8px 3px !important;
  }
  html.tectoniq-browser-web #rightPanel .rp-stats > div {
    padding: 3px 4px !important;
  }
  html.tectoniq-browser-web #rightPanel .rp-stats small {
    font-size: 8.5px !important;
  }
  html.tectoniq-browser-web #rightPanel .rp-stats b {
    font-size: 10px !important;
  }
  html.tectoniq-browser-web #rightPanel .rp-shakemap img {
    max-height: 180px !important;
  }
  html.tectoniq-browser-web .left-bottom {
    position: fixed !important;
    left: 10px !important;
    right: auto !important;
    bottom: calc(116px + env(safe-area-inset-bottom, 0px)) !important;
    width: min(270px, calc(100vw - 20px)) !important;
    max-width: calc(100vw - 20px) !important;
    max-height: 16dvh !important;
    overflow: auto !important;
    z-index: 650 !important;
    pointer-events: auto !important;
    background: rgba(5, 16, 29, .97) !important;
    color: #eaf2fb !important;
    border: 1px solid rgba(119, 164, 199, .34) !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 22px rgba(0,0,0,.35) !important;
  }
  html.tectoniq-browser-web body:not(.sheet-collapsed) .left-bottom {
    display: none !important;
  }
  html.tectoniq-browser-web #wrsAiDock {
    right: 9px !important;
    bottom: calc(116px + env(safe-area-inset-bottom, 0px)) !important;
    z-index: 650 !important;
  }
  html.tectoniq-browser-web body:not(.sheet-collapsed) #wrsAiDock {
    bottom: calc(66dvh + 10px) !important;
  }
  html.tectoniq-browser-web #wrsAiPanel.wrs-ai-panel {
    z-index: 1201 !important;
  }
}

