/* WRS GEMPA 1.13.4 — unified mobile navigation, archive cards and history contrast */
@media (max-width:1200px) {
  .mobile-bottom-nav {
    grid-template-columns:repeat(5,minmax(0,1fr))!important;
    gap:5px!important;
  }
  .mobile-bottom-nav button>span:last-child {
    font-size:clamp(8px,2.25vw,9px)!important;
    letter-spacing:-.015em!important;
  }
  .mobile-bottom-nav button.active {
    background:linear-gradient(155deg,#fff5f6,#ffe9ed)!important;
    border-color:#f0c3cc!important;
    box-shadow:0 4px 11px rgba(156,35,57,.10),inset 0 1px 0 rgba(255,255,255,.95)!important;
  }
  html[data-wrs-theme="dark"] .mobile-bottom-nav button.active {
    background:linear-gradient(155deg,rgba(105,23,42,.34),rgba(63,18,33,.56))!important;
    border-color:rgba(238,103,128,.30)!important;
    box-shadow:0 4px 14px rgba(0,0,0,.22),inset 0 1px 0 rgba(255,255,255,.06)!important;
  }

  #mobilePageArchive .wrs-archive-overview {
    display:flex!important;
    align-items:center!important;
    gap:11px!important;
    margin:12px 0 14px!important;
    padding:13px 14px!important;
    border:1px solid #dce5ef!important;
    border-radius:17px!important;
    background:linear-gradient(145deg,#fff,#f2f6fb)!important;
    box-shadow:0 9px 22px rgba(24,48,74,.09),inset 0 1px 0 #fff!important;
    color:#20364d!important;
  }
  #mobilePageArchive .wrs-archive-overview-icon {
    display:grid;place-items:center;flex:0 0 40px;width:40px;height:40px;
    border-radius:13px;background:linear-gradient(145deg,#e33c54,#9b1f36);
    color:#fff;font-size:23px;font-weight:900;
    box-shadow:0 6px 15px rgba(184,32,57,.22),inset 0 1px 0 rgba(255,255,255,.32);
  }
  #mobilePageArchive .wrs-archive-overview>div:nth-child(2) { min-width:0;flex:1; }
  #mobilePageArchive .wrs-archive-overview b {
    display:block;color:#243b53;font-size:10px;font-weight:950;letter-spacing:.09em;
  }
  #mobilePageArchive .wrs-archive-overview p {
    margin:4px 0 0;color:#63778c;font-size:10px;line-height:1.45;
  }
  #mobilePageArchive .wrs-archive-r2 {
    flex:0 0 auto;padding:5px 7px;border:1px solid #cfe4dc;border-radius:8px;
    background:#e9f8f1;color:#16734f;font-size:9px;font-weight:950;letter-spacing:.06em;
  }
  #mobilePageArchive .wrs-archive-page-grid {
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:11px!important;
    align-items:stretch!important;
    padding-bottom:10px!important;
  }
  #mobilePageArchive .wrs-archive-card {
    display:flex!important;flex-direction:column!important;align-items:stretch!important;
    min-width:0!important;overflow:hidden!important;padding:0!important;
    border:1px solid #dce4ed!important;border-radius:16px!important;
    background:linear-gradient(155deg,#fff 0%,#f5f8fc 100%)!important;
    color:#233b53!important;text-align:left!important;white-space:normal!important;
    box-shadow:0 8px 19px rgba(24,48,74,.10),inset 0 1px 0 #fff!important;
    transition:transform .16s ease,box-shadow .16s ease!important;
  }
  #mobilePageArchive .wrs-archive-card:active {
    transform:translateY(1px) scale(.985)!important;
    box-shadow:0 4px 10px rgba(24,48,74,.12)!important;
  }
  #mobilePageArchive .wrs-archive-card-media {
    position:relative;display:grid;place-items:center;overflow:hidden;
    width:100%;aspect-ratio:1.18/1;
    padding:6px;box-sizing:border-box;
    background:linear-gradient(145deg,#eef3f8,#e2eaf2);
    border-bottom:1px solid #dce5ee;
  }
  #mobilePageArchive .wrs-archive-card-media img {
    display:block;width:100%;height:100%;object-fit:contain;border-radius:8px;
  }
  #mobilePageArchive .wrs-archive-card-media.is-unavailable {
    color:#667b90;font-size:10px;text-align:center;line-height:1.5;
  }
  #mobilePageArchive .wrs-archive-card-copy {
    display:flex;flex-direction:column;gap:5px;min-width:0;
    padding:10px 10px 7px;
  }
  #mobilePageArchive .wrs-archive-card-copy b {
    display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;
    overflow:hidden;color:#20364d;font-size:11px;font-weight:900;line-height:1.35;
  }
  #mobilePageArchive .wrs-archive-card-copy small {
    color:#687c90;font-size:9px;line-height:1.4;
  }
  #mobilePageArchive .wrs-archive-product {
    align-self:flex-start;padding:4px 6px;border:1px solid #dce5ee;border-radius:7px;
    background:#edf3f8;color:#526b82;font-size:8px;font-weight:950;letter-spacing:.06em;
  }
  #mobilePageArchive .wrs-archive-open {
    display:block;margin:0 10px 10px;padding:8px 9px;border-radius:9px;
    background:linear-gradient(100deg,#a91e36,#d93650);color:#fff;
    font-size:9px;font-weight:900;text-align:center;
    box-shadow:0 4px 10px rgba(161,25,49,.18);
  }
  #mobilePageArchive .wrs-archive-load-more {
    display:block;width:100%;margin:7px 0 16px;padding:12px 14px;
    border:1px solid #d4dee9;border-radius:12px;
    background:linear-gradient(145deg,#fff,#f0f4f9);color:#344e67;
    font-size:11px;font-weight:900;
    box-shadow:0 6px 15px rgba(24,48,74,.08);
  }
  #mobilePageArchive .wrs-archive-load-more[hidden] { display:none!important; }

  #mobilePageInfo .wrs-catalog-kind-switch {
    display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:6px!important;
  }
  #mobilePageInfo .wrs-catalog-kind-switch button {
    min-width:0!important;padding:9px 5px!important;border-radius:11px!important;
    font-size:9px!important;font-weight:900!important;line-height:1.2!important;
    white-space:normal!important;
  }
  #mobilePageInfo .wrs-felt-event-card {
    border:1px solid #dbe4ed!important;border-radius:15px!important;
    background:linear-gradient(145deg,#fff 0%,#f5f8fc 100%)!important;
    box-shadow:0 7px 17px rgba(24,48,74,.08),inset 0 1px 0 #fff!important;
  }
  #mobilePageInfo .wrs-felt-event-mag {
    box-shadow:0 5px 12px rgba(172,40,57,.15),inset 0 1px 0 rgba(255,255,255,.45)!important;
  }
  #mobilePageInfo .wrs-felt-map-state {
    display:inline-flex;align-items:center;gap:4px;
    margin-top:5px;padding:4px 7px;border:1px solid #e2e8ef;border-radius:7px;
    background:#f1f5f9;color:#65778a;font-size:9px;font-weight:750;line-height:1.35;
  }
  #mobilePageInfo .wrs-felt-map-state.is-ready {
    border-color:#bfe6d3;background:#ecfaf2;color:#16734e;
  }
}

/* Keep light-theme tsunami/history text readable even in nested list rows. */
html[data-wrs-theme="light"] #modalHistory .hist-timeline,
html[data-wrs-theme="light"] #modalHistory #histTimeline,
html[data-wrs-theme="light"] #modalHistory #histBody,
html[data-wrs-theme="light"] #modalHistory .hist-table {
  color:#20364d!important;
  opacity:1!important;
  text-shadow:none!important;
}
html[data-wrs-theme="light"] #modalHistory .hist-timeline :is(b,strong,span,p,small,time,td,th,label),
html[data-wrs-theme="light"] #modalHistory #histTimeline :is(b,strong,span,p,small,time,td,th,label),
html[data-wrs-theme="light"] #modalHistory #histBody :is(b,strong,span,p,small,time,td,th,label),
html[data-wrs-theme="light"] #modalHistory .hist-table :is(td,th,span,small,b,strong) {
  color:#354d65!important;
  opacity:1!important;
  text-shadow:none!important;
}
html[data-wrs-theme="light"] #modalHistory .hist-table th {
  color:#243b52!important;background:#edf2f7!important;
}
html[data-wrs-theme="light"] #modalHistory .hist-table td {
  border-color:#e0e7ef!important;background:#fff!important;
}
html[data-wrs-theme="light"] #modalHistory .hist-timeline :is(.tsunami-status,.ts-status,.status-badge,.pd-badge),
html[data-wrs-theme="light"] #modalHistory #histTimeline :is(.tsunami-status,.ts-status,.status-badge,.pd-badge) {
  font-weight:850!important;
}

html[data-wrs-theme="dark"] #mobilePageArchive .wrs-archive-overview {
  color:#e8f1fa!important;background:linear-gradient(145deg,#16283b,#101c2b)!important;
  border-color:rgba(141,174,203,.20)!important;
  box-shadow:0 9px 24px rgba(0,0,0,.24),inset 0 1px 0 rgba(255,255,255,.05)!important;
}
html[data-wrs-theme="dark"] #mobilePageArchive .wrs-archive-overview b { color:#eff6fd!important; }
html[data-wrs-theme="dark"] #mobilePageArchive .wrs-archive-overview p { color:#a1b4c7!important; }
html[data-wrs-theme="dark"] #mobilePageArchive .wrs-archive-r2 {
  color:#8de0b9!important;background:rgba(19,103,72,.18)!important;border-color:rgba(95,210,160,.22)!important;
}
html[data-wrs-theme="dark"] #mobilePageArchive .wrs-archive-card {
  background:linear-gradient(155deg,#17283a,#101b29)!important;
  border-color:rgba(139,171,199,.18)!important;color:#e7f0f8!important;
  box-shadow:0 9px 23px rgba(0,0,0,.24),inset 0 1px 0 rgba(255,255,255,.045)!important;
}
html[data-wrs-theme="dark"] #mobilePageArchive .wrs-archive-card-media {
  background:linear-gradient(145deg,#1d3044,#142437)!important;border-bottom-color:rgba(139,171,199,.16)!important;
}
html[data-wrs-theme="dark"] #mobilePageArchive .wrs-archive-card-copy b { color:#edf5fc!important; }
html[data-wrs-theme="dark"] #mobilePageArchive .wrs-archive-card-copy small { color:#a1b4c7!important; }
html[data-wrs-theme="dark"] #mobilePageArchive .wrs-archive-product {
  background:#1b3043!important;color:#b6c9db!important;border-color:#344b60!important;
}
html[data-wrs-theme="dark"] #mobilePageArchive .wrs-archive-load-more {
  background:linear-gradient(145deg,#1a2b3e,#122132)!important;color:#e5eef7!important;
  border-color:rgba(139,171,199,.2)!important;
}
html[data-wrs-theme="dark"] #mobilePageInfo .wrs-felt-event-card {
  background:linear-gradient(145deg,#18293a,#111e2d)!important;
  border-color:rgba(139,171,199,.18)!important;
  box-shadow:0 8px 19px rgba(0,0,0,.21),inset 0 1px 0 rgba(255,255,255,.04)!important;
}
html[data-wrs-theme="dark"] #mobilePageInfo .wrs-felt-map-state {
  background:#1b2b3c!important;color:#b3c3d3!important;border-color:#35495d!important;
}
html[data-wrs-theme="dark"] #mobilePageInfo .wrs-felt-map-state.is-ready {
  background:rgba(19,103,72,.20)!important;color:#8ce0b5!important;border-color:rgba(95,210,160,.24)!important;
}
@media (max-width:380px) {
  #mobilePageArchive .wrs-archive-card-copy { padding:8px 8px 6px!important; }
  #mobilePageArchive .wrs-archive-card-copy b { font-size:10px!important; }
  #mobilePageArchive .wrs-archive-open { margin:0 8px 8px!important; }
}

/* The in-page tsunami catalogue uses stronger text contrast in light mode. */
html[data-wrs-theme="light"] #mobilePageInfo .wrs-catalog-tsunami-event {
  color:#20364d!important;background:linear-gradient(145deg,#fff,#f5f8fb)!important;
  border:1px solid #d7e1eb!important;box-shadow:0 7px 17px rgba(24,48,74,.08)!important;
}
html[data-wrs-theme="light"] #mobilePageInfo .wrs-catalog-tsunami-detail strong {
  color:#1b3047!important;opacity:1!important;
}
html[data-wrs-theme="light"] #mobilePageInfo .wrs-catalog-tsunami-detail>span {
  color:#354e66!important;opacity:1!important;
}
html[data-wrs-theme="light"] #mobilePageInfo .wrs-catalog-tsunami-detail small {
  color:#536b82!important;opacity:1!important;
}
html[data-wrs-theme="light"] #mobilePageInfo .wrs-catalog-tsunami-stage {
  color:#fff!important;opacity:1!important;
  background:linear-gradient(145deg,#c72e47,#9d1e36)!important;
  box-shadow:0 4px 10px rgba(155,29,53,.18)!important;
}
html[data-wrs-theme="light"] #mobilePageInfo .wrs-catalog-tsunami-status {
  opacity:1!important;font-weight:900!important;
}
html[data-wrs-theme="light"] #mobilePageInfo .wrs-catalog-tsunami-status.is-ended {
  color:#116847!important;background:#e9f8f0!important;border-color:#bde7d1!important;
}
html[data-wrs-theme="light"] #mobilePageInfo .wrs-catalog-tsunami-status.is-check {
  color:#88510d!important;background:#fff6df!important;border-color:#f3dda8!important;
}
html[data-wrs-theme="light"] #mobilePageInfo .wrs-catalog-tsunami-open {
  color:#fff!important;background:linear-gradient(100deg,#a91e36,#d93650)!important;
  box-shadow:0 4px 9px rgba(161,25,49,.16)!important;
}
html[data-wrs-theme="dark"] #mobilePageInfo .wrs-catalog-tsunami-event {
  color:#e8f0f8!important;background:linear-gradient(145deg,#192b3d,#111f2e)!important;
  border:1px solid rgba(139,171,199,.18)!important;box-shadow:0 8px 18px rgba(0,0,0,.2)!important;
}
html[data-wrs-theme="dark"] #mobilePageInfo .wrs-catalog-tsunami-detail strong { color:#eff6fc!important; }
html[data-wrs-theme="dark"] #mobilePageInfo .wrs-catalog-tsunami-detail>span { color:#c0cedb!important; }
html[data-wrs-theme="dark"] #mobilePageInfo .wrs-catalog-tsunami-detail small { color:#9fb2c6!important; }
html[data-wrs-theme="dark"] #mobilePageInfo .wrs-catalog-tsunami-status.is-ended {
  color:#91e1b9!important;background:rgba(22,128,83,.19)!important;border-color:rgba(91,207,153,.22)!important;
}
html[data-wrs-theme="dark"] #mobilePageInfo .wrs-catalog-tsunami-status.is-check {
  color:#f6d68c!important;background:rgba(145,92,20,.20)!important;border-color:rgba(232,174,71,.22)!important;
}

/* The archive is a real sibling page, not an overlay within the map page.
   Give it the same stacking and safe-area layout as the other full-screen pages. */
@media (max-width:1200px) {
  #mobilePageArchive { z-index:40!important; }
  #mobilePageArchive.active {
    padding:env(safe-area-inset-top,0px) 12px calc(70px + env(safe-area-inset-bottom,0px))!important;
  }
  #mobilePageArchive.active>.mobile-page-title { flex-shrink:0!important; }
  #mobilePageArchive .wrs-page-scroll-content {
    display:block!important;flex:1 1 auto!important;min-width:0!important;min-height:0!important;
    height:auto!important;max-height:none!important;overflow-x:hidden!important;overflow-y:auto!important;
    padding:0 0 12px!important;box-sizing:border-box!important;
    -webkit-overflow-scrolling:touch!important;overscroll-behavior-y:contain!important;touch-action:pan-y!important;
  }
}


/* Ringkasan categories are mutually exclusive on every mobile WebView.
   Keep the selected category isolated even if an older stylesheet applies
   display rules that override the HTML hidden attribute. */
@media (max-width:1200px) {
  #mobilePageInfo .wrs-catalog-search[data-active-kind="felt"] .wrs-catalog-filters,
  #mobilePageInfo .wrs-catalog-search[data-active-kind="felt"] .wrs-catalog-results-header,
  #mobilePageInfo .wrs-catalog-search[data-active-kind="felt"] .wrs-catalog-map-note,
  #mobilePageInfo .wrs-catalog-search[data-active-kind="felt"] #wrsCatalogResults,
  #mobilePageInfo .wrs-catalog-search[data-active-kind="felt"] .wrs-catalog-footer {
    display:none!important;
  }
  #mobilePageInfo .wrs-catalog-search[data-active-kind="quake"] #wrsCatalogStatsPanel,
  #mobilePageInfo .wrs-catalog-search[data-active-kind="tsunami"] #wrsCatalogStatsPanel {
    display:none!important;
  }
  #mobilePageInfo .wrs-catalog-search[data-active-kind="felt"] #wrsCatalogStatsPanel:not([hidden]) {
    display:grid!important;
  }
}


/* One clearly readable red pulse ring with a soft, fading outer edge. */
.eq-epicenter-halo-wrap {
  background:transparent!important;
  border:0!important;
  overflow:visible!important;
}
.eq-epicenter-halo {
  display:block!important;
  width:100%!important;
  height:100%!important;
  border:0!important;
  border-radius:50%!important;
  /* A narrow, stronger red core keeps the single ring legible;
     the outer gradient feathers away instead of forming a hard outline. */
  background:radial-gradient(circle,
    transparent 0 44%,
    rgba(255,35,58,0) 46%,
    rgba(255,35,58,.22) 49%,
    rgba(255,35,58,.72) 52.5%,
    rgba(255,35,58,.52) 55.5%,
    rgba(255,35,58,.24) 59%,
    rgba(255,35,58,.08) 63%,
    rgba(255,35,58,0) 68%)!important;
  filter:blur(1.15px)!important;
  transform-origin:center center!important;
  animation:wrsEpicenterSoftFade 2.5s cubic-bezier(.16,.62,.34,1) infinite!important;
  pointer-events:none!important;
  will-change:transform,opacity;
}
@keyframes wrsEpicenterSoftFade {
  0% { transform:scale(.22);opacity:.98; }
  66% { transform:scale(.86);opacity:.68; }
  100% { transform:scale(1.08);opacity:0; }
}

/* Keep the newest-event star red; its dark keyline separates it from satellite tiles.
   The small dot underneath is intentionally pale grey with a black edge. */
.eq-star {
  color:#ff354f!important;
  -webkit-text-stroke:1px #111827!important;
  paint-order:stroke fill;
  text-shadow:0 0 5px rgba(255,45,65,.82),0 1px 3px rgba(0,0,0,.92)!important;
}
@media(prefers-reduced-motion:reduce) {
  .eq-epicenter-halo { animation:none!important;opacity:.42!important;transform:scale(.78)!important; }
}
