:root {
  color-scheme: dark;
  --bg: #07111c;
  --panel: #0d1b2a;
  --panel-2: #102235;
  --line: rgba(168, 190, 214, 0.14);
  --text: #edf4fb;
  --muted: #93a6ba;
  --green: #2bd97f;
  --cyan: #24d0b5;
  --yellow: #e5c21a;
  --amber: #f2a20c;
  --orange: #ff7831;
  --red: #ff4e4e;
  --purple: #b847ff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 50% -10%, #18344f 0, #07111c 34rem);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

.topbar {
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 14, 23, 0.86);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.pulse-icon {
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(148, 180, 211, 0.2);
  border-radius: 50%;
  background: #0b1826;
  color: #f4f8fc;
  box-shadow: 0 0 24px rgba(35, 208, 181, 0.08);
}

.pulse-icon svg {
  width: 38px;
  height: 38px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  text-transform: uppercase;
  font-size: clamp(22px, 3vw, 30px);
  line-height: 1;
}

h2 {
  text-transform: uppercase;
  font-size: 15px;
  letter-spacing: 0.04em;
}

.brand p {
  margin-top: 7px;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 13px;
}

.live-dot {
  width: 10px;
  height: 10px;
  display: inline-block;
  margin-right: 8px;
  border-radius: 50%;
  background: #49df36;
  box-shadow: 0 0 14px rgba(73, 223, 54, 0.85);
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 12px;
}

.status-card {
  min-height: 60px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(17, 34, 52, 0.72);
}

.status-card span {
  display: block;
  font-weight: 800;
}

.status-card small {
  color: var(--muted);
}

.rangebar {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 17, 28, 0.82);
}

.source-presets,
.range-presets,
.custom-range {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.source-button,
.range-button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(19, 38, 58, 0.78);
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  cursor: pointer;
}

.source-button.active,
.range-button.active {
  border-color: rgba(36, 208, 181, 0.46);
  background: rgba(36, 208, 181, 0.14);
  color: var(--text);
}

.custom-range label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.custom-range input {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #0b1927;
  color: var(--text);
  padding: 0 8px;
}

body:not(.custom-range-open) .custom-range {
  display: none;
}

.status-card .ok {
  color: var(--green);
}

.status-card .bad {
  color: var(--red);
}

.shell {
  display: grid;
  grid-template-columns: minmax(290px, 390px) minmax(420px, 1fr) minmax(260px, 340px);
  gap: 10px;
  padding: 10px;
  height: calc(100vh - 188px);
  min-height: 560px;
}

.sidebar,
.map-panel,
.detail-panel,
.footer {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(11, 25, 39, 0.9);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
  overflow: hidden;
}

.panel-head,
.map-head {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(14, 29, 46, 0.72);
}

.auto-label {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.panel-toggle {
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid rgba(36, 208, 181, 0.34);
  border-radius: 4px;
  background: rgba(36, 208, 181, 0.1);
  color: var(--green);
  font: inherit;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  cursor: pointer;
}

.list-collapsed .sidebar .quake-list,
.detail-collapsed .detail-panel #detailContent {
  display: none;
}

.quake-list {
  height: calc(100% - 66px);
  overflow: auto;
  padding: 10px;
  scrollbar-color: rgba(147, 166, 186, 0.46) rgba(8, 20, 32, 0.38);
  scrollbar-width: thin;
}

.quake-list::-webkit-scrollbar,
#detailContent::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.quake-list::-webkit-scrollbar-track,
#detailContent::-webkit-scrollbar-track {
  background: rgba(8, 20, 32, 0.38);
}

.quake-list::-webkit-scrollbar-thumb,
#detailContent::-webkit-scrollbar-thumb {
  border: 2px solid rgba(8, 20, 32, 0.38);
  border-radius: 999px;
  background: rgba(147, 166, 186, 0.58);
}

.quake-item {
  width: 100%;
  display: grid;
  grid-template-columns: 66px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(16, 34, 53, 0.58);
  color: inherit;
  text-align: left;
  animation: slideIn 420ms ease both;
  animation-delay: var(--delay, 0ms);
}

.normal-mode .quake-item {
  cursor: pointer;
}

.quake-item + .quake-item {
  margin-top: 8px;
}

.quake-item.active {
  border-color: rgba(45, 208, 181, 0.5);
  background: rgba(30, 59, 86, 0.82);
  box-shadow: inset 4px 0 0 var(--cyan);
}

.mag-badge {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 3px solid currentColor;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  font-size: 22px;
  font-weight: 900;
}

.mag-badge.large {
  width: 70px;
  height: 70px;
  font-size: 26px;
}

.quake-main strong {
  display: block;
  margin-bottom: 5px;
  text-transform: uppercase;
  font-size: 13px;
}

.quake-main span,
.quake-meta {
  color: var(--muted);
  font-size: 13px;
}

.quake-meta {
  display: grid;
  justify-items: end;
  gap: 5px;
}

.new-badge {
  display: inline-block;
  padding: 3px 6px;
  border-radius: 4px;
  background: rgba(255, 78, 78, 0.18);
  color: #ff6b6b;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.source-badge {
  display: inline-block;
  margin-right: 6px;
  padding: 2px 5px;
  border: 1px solid rgba(36, 208, 181, 0.34);
  border-radius: 4px;
  background: rgba(36, 208, 181, 0.12);
  color: var(--green);
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.map-panel {
  position: relative;
}

.map-head {
  position: relative;
  z-index: 5;
}

.legend {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
}

.legend b {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  box-shadow: 0 0 12px currentColor;
}

.m1 { color: var(--cyan); background: var(--cyan); }
.m2 { color: var(--green); background: var(--green); }
.m3 { color: var(--yellow); background: var(--yellow); }
.m4 { color: var(--orange); background: var(--orange); }
.m5 { color: var(--red); background: var(--red); }
.m6 { color: var(--purple); background: var(--purple); }

#map {
  height: calc(100% - 66px);
  min-height: 480px;
  background: #0a1622;
}

.leaflet-container {
  background: #0a1622;
  font: inherit;
}

.leaflet-control-zoom a {
  background: #13263a;
  border-color: var(--line);
  color: var(--text);
}

.leaflet-control-attribution {
  padding: 1px 5px;
  border-radius: 5px 0 0 0;
  background: rgba(245, 248, 250, 0.72);
  color: rgba(8, 20, 32, 0.78);
  font-size: 10px;
  line-height: 1.2;
}

.leaflet-control-attribution a {
  color: rgba(0, 98, 145, 0.82);
}

.quake-callout {
  position: relative;
  width: 1px;
  height: 58px;
  pointer-events: auto;
  cursor: pointer;
  color: var(--marker-color);
}

.quake-dot {
  position: absolute;
  left: 0;
  bottom: 7px;
  width: 14px;
  height: 14px;
  border: 2px solid #08131f;
  border-radius: 50%;
  background: var(--marker-color);
  box-shadow: 0 0 0 var(--halo-size, 8px) color-mix(in srgb, var(--marker-color) 20%, transparent), 0 0 calc(var(--halo-size, 8px) * 1.8) var(--marker-color);
}

.quake-line {
  position: absolute;
  left: 14px;
  bottom: 13px;
  width: var(--line-width, 48px);
  height: 2px;
  border-radius: 999px;
  background: var(--marker-color);
  box-shadow: 0 0 7px color-mix(in srgb, var(--marker-color) 58%, transparent);
  transform: rotate(var(--line-angle, -28deg));
  transform-origin: left center;
}

.quake-label {
  position: absolute;
  left: var(--label-left, 52px);
  bottom: var(--label-bottom, 24px);
  min-width: 86px;
  width: 176px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  border: 1px solid rgba(168, 190, 214, 0.2);
  border-left: 3px solid var(--marker-color);
  border-radius: 5px;
  background: rgba(8, 19, 31, 0.88);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(8px);
}

.quake-callout.compact .quake-line,
.quake-callout.compact .quake-label {
  display: none;
}

.quake-callout.compact .quake-dot {
  width: 11px;
  height: 11px;
  opacity: 0.92;
}

.quake-label b {
  color: var(--marker-color);
  font-size: 15px;
  line-height: 1;
}

.quake-label em {
  color: var(--text);
  font-size: 10px;
  font-style: normal;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quake-label em small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.map-new {
  grid-column: 1 / -1;
  width: max-content;
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(255, 78, 78, 0.24);
  color: #ff6b6b;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.map-source {
  grid-column: 1 / -1;
  width: max-content;
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(36, 208, 181, 0.16);
  color: var(--green);
  font-size: 8px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.quake-callout.selected .quake-dot {
  width: 22px;
  height: 22px;
  border: 3px solid #ffffff;
  box-shadow: 0 0 0 calc(var(--halo-size, 8px) + 4px) color-mix(in srgb, var(--marker-color) 32%, transparent), 0 0 34px var(--marker-color);
  animation: markerPulse 1.8s ease-in-out infinite;
}

.quake-callout.selected .quake-line {
  height: 3px;
  box-shadow: 0 0 12px var(--marker-color);
}

.quake-callout.selected .quake-label {
  border-color: color-mix(in srgb, var(--marker-color) 70%, #ffffff);
  border-left-width: 5px;
  background: rgba(4, 13, 22, 0.98);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--marker-color) 35%, transparent), 0 18px 34px rgba(0, 0, 0, 0.42);
}

.today-card {
  position: absolute;
  right: 16px;
  bottom: 18px;
  z-index: 500;
  width: 230px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(13, 27, 42, 0.92);
}

.today-card small,
.today-card span {
  display: block;
  color: var(--muted);
}

.today-card strong {
  display: block;
  font-size: 40px;
  line-height: 1;
}

.today-card canvas {
  width: 100%;
  height: 48px;
  margin-top: 6px;
}

.detail-panel {
  display: flex;
  flex-direction: column;
}

.connection {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.connection.ok {
  color: var(--green);
}

.connection.bad {
  color: var(--red);
}

#detailContent {
  padding: 18px;
  overflow: auto;
  scrollbar-color: rgba(147, 166, 186, 0.46) rgba(8, 20, 32, 0.38);
  scrollbar-width: thin;
}

.detail-empty {
  color: var(--muted);
}

.detail-title {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 18px;
}

.broadcast-highlight {
  display: grid;
  grid-template-columns: 78px 1fr;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.broadcast-highlight small {
  color: var(--muted);
  text-transform: uppercase;
  font-size: 10px;
}

.broadcast-highlight h3 {
  margin: 4px 0 6px;
  font-size: 18px;
  line-height: 1.18;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.broadcast-highlight p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.detail-new {
  margin-right: 7px;
}

.detail-title h3 {
  margin: 0 0 5px;
  font-size: 18px;
}

.detail-grid {
  display: grid;
  gap: 8px;
}

.intensity-panel {
  margin: 0 0 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(5, 14, 23, 0.34);
}

.intensity-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.intensity-panel h4 {
  margin: 0;
  color: var(--text);
  font-size: 12px;
  text-transform: uppercase;
}

.intensity-toggle {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid rgba(36, 208, 181, 0.36);
  border-radius: 4px;
  background: rgba(36, 208, 181, 0.12);
  color: var(--text);
  font: inherit;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  cursor: pointer;
}

.intensity-panel.expanded .intensity-toggle {
  border-color: rgba(255, 78, 78, 0.34);
  background: rgba(255, 78, 78, 0.12);
}

.intensity-list {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.intensity-item {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 7px 8px;
  border: 1px solid rgba(168, 190, 214, 0.12);
  border-left: 4px solid var(--intensity-color);
  border-radius: 5px;
  background: rgba(16, 34, 53, 0.46);
}

.mercalli-badge {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--intensity-color);
  color: #07111c;
  font-size: 13px;
  font-weight: 900;
}

.intensity-item b,
.intensity-item strong {
  color: var(--text);
  font-size: 13px;
}

.intensity-item small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.intensity-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.city-intensity-pin {
  position: relative;
  display: grid;
  justify-items: center;
  width: 30px;
  height: 42px;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.36));
}

.city-intensity-pin::after {
  content: "";
  position: absolute;
  left: 14px;
  top: 22px;
  width: 3px;
  height: 18px;
  background: var(--city-intensity-color);
  border-radius: 999px;
}

.city-intensity-pin::before {
  content: "";
  position: absolute;
  left: 10px;
  bottom: 0;
  width: 11px;
  height: 11px;
  border: 2px solid rgba(7, 17, 28, 0.92);
  border-radius: 50%;
  background: var(--city-intensity-color);
}

.city-intensity-pin span {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 28px;
  height: 24px;
  border: 2px solid rgba(7, 17, 28, 0.92);
  border-radius: 999px;
  background: var(--city-intensity-color);
  color: #07111c;
  font-size: 12px;
  font-weight: 900;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.detail-row b {
  color: var(--text);
  text-align: right;
}

.footer {
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 10px 10px;
  padding: 0 18px;
  color: var(--muted);
  font-size: 13px;
}

@keyframes markerPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.12);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1180px) {
  .shell {
    grid-template-columns: 330px 1fr;
    grid-template-rows: minmax(540px, 1fr) 320px;
    height: auto;
  }

  .map-panel {
    grid-column: 2;
  }

  .detail-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 980px) {
  body {
    background:
      radial-gradient(circle at 50% 0, rgba(36, 208, 181, 0.16), transparent 18rem),
      radial-gradient(circle at 85% 8rem, rgba(63, 129, 210, 0.16), transparent 16rem),
      #06111c;
  }

  .topbar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 18px 20px 10px;
    border-bottom: 0;
    background: rgba(5, 14, 23, 0.72);
  }

  .brand {
    justify-content: center;
  }

  .pulse-icon {
    width: 66px;
    height: 66px;
  }

  h1 {
    font-size: 28px;
  }

  .status-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .range-button {
    font-size: 13px;
  }

  .status-card {
    min-height: 74px;
    padding: 14px 16px;
  }

  .rangebar {
    margin: 8px 20px 0;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(8, 20, 32, 0.88);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.28);
  }

  .range-presets,
  .custom-range {
    width: 100%;
    justify-content: center;
  }

  .custom-range input {
    width: 132px;
  }

  .shell {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: minmax(560px, 68vh) minmax(460px, auto);
    gap: 0;
    height: auto;
    min-height: 0;
    padding: 18px 18px 8px;
  }

  .map-panel {
    order: 1;
    grid-column: 1 / -1;
    min-height: 560px;
    border-radius: 10px 10px 0 0;
  }

  .map-head {
    position: absolute;
    left: 50%;
    top: 64px;
    z-index: 550;
    width: max-content;
    max-width: calc(100% - 40px);
    min-height: 52px;
    transform: translateX(-50%);
    border: 1px solid var(--line);
    border-radius: 7px;
    background: rgba(8, 20, 32, 0.9);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.32);
  }

  .map-head h2 {
    display: none;
  }

  .legend {
    justify-content: center;
    font-size: 14px;
  }

  #map {
    height: 100%;
    min-height: 560px;
  }

  .today-card {
    right: 26px;
    bottom: 26px;
    width: 236px;
    border-radius: 8px;
    background: rgba(8, 20, 32, 0.92);
  }

  .sidebar,
  .detail-panel {
    position: relative;
    z-index: 600;
    margin-top: -24px;
    border-radius: 10px;
    background: rgba(7, 17, 28, 0.96);
  }

  .sidebar {
    order: 2;
    grid-column: 1;
    height: 520px;
    border-right: 0;
  }

  .detail-panel {
    order: 3;
    grid-column: 2;
    height: 520px;
  }

  .panel-head {
    min-height: 64px;
  }

  .quake-list {
    height: calc(100% - 64px);
  }

  .quake-item {
    grid-template-columns: 64px 1fr auto;
    min-height: 82px;
  }

  #detailContent {
    padding: 16px;
  }

  .footer {
    margin: 0 18px 10px;
  }
}

@media (max-width: 760px) {
  .topbar,
  .rangebar,
  .footer {
    align-items: stretch;
    flex-direction: column;
  }

  .status-grid,
  .shell {
    grid-template-columns: 1fr;
  }

  .shell {
    display: grid;
    grid-template-rows: minmax(430px, 58vh) auto auto;
    gap: 0;
    padding: 12px;
    min-height: 0;
  }

  .map-panel {
    order: 1;
    grid-column: 1;
    min-height: 430px;
  }

  .map-head {
    top: 58px;
    max-width: calc(100% - 24px);
    padding: 10px;
  }

  .sidebar {
    order: 2;
    grid-column: 1;
    height: 430px;
  }

  .detail-panel {
    order: 3;
    grid-column: 1;
    height: auto;
    min-height: 430px;
  }

  #map {
    min-height: 430px;
  }

  .today-card {
    left: auto;
    right: 16px;
    bottom: 16px;
    width: 190px;
    padding: 12px 14px;
  }

  .today-card strong {
    font-size: 32px;
  }

  .quake-label {
    width: 150px;
  }

  .rangebar {
    margin: 8px 12px 0;
  }

  .range-button {
    flex: 1 1 120px;
  }

  .custom-range label {
    flex: 1 1 130px;
  }

  .custom-range input {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .topbar {
    padding: 14px 12px 8px;
  }

  .brand {
    justify-content: flex-start;
  }

  .pulse-icon {
    width: 52px;
    height: 52px;
  }

  .pulse-icon svg {
    width: 32px;
    height: 32px;
  }

  h1 {
    font-size: 22px;
  }

  .brand p {
    font-size: 11px;
  }

  .status-grid {
    gap: 8px;
  }

  .status-card,
  .status-card span {
    font-size: 14px;
  }

  .status-card small {
    font-size: 11px;
  }

  .range-button {
    font-size: 11px;
  }

  .legend {
    gap: 6px;
    font-size: 11px;
  }

  .legend b {
    width: 10px;
    height: 10px;
  }

  .quake-item {
    grid-template-columns: 54px 1fr auto;
    gap: 8px;
    padding: 10px 8px;
  }

  .mag-badge {
    width: 48px;
    height: 48px;
    font-size: 18px;
  }

  .quake-main strong {
    font-size: 12px;
  }

  .quake-main span,
  .quake-meta {
    font-size: 11px;
  }

  .broadcast-highlight {
    grid-template-columns: 60px 1fr;
  }

  .mag-badge.large {
    width: 58px;
    height: 58px;
    font-size: 22px;
  }

  .broadcast-highlight h3 {
    font-size: 16px;
  }

  .detail-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .detail-row b {
    text-align: left;
  }
}

@media (max-width: 980px) {
  html,
  body {
    min-height: 100%;
    overflow-x: hidden;
  }

  body {
    background: #06111c;
  }

  .topbar {
    position: fixed;
    left: 16px;
    right: 16px;
    top: 14px;
    z-index: 900;
    min-height: 92px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 18px;
    border: 1px solid rgba(168, 190, 214, 0.18);
    border-radius: 28px;
    background: rgba(5, 14, 23, 0.94);
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.38);
  }

  .topbar::before,
  .topbar::after {
    position: absolute;
    top: 22px;
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(168, 190, 214, 0.22);
    border-radius: 10px;
    color: var(--text);
    background: rgba(10, 23, 36, 0.82);
    font-size: 30px;
    line-height: 1;
  }

  .topbar::before {
    content: "\2630";
    left: 18px;
  }

  .topbar::after {
    content: "\25CB";
    right: 18px;
    font-size: 28px;
  }

  .brand {
    gap: 14px;
    justify-content: center;
  }

  .brand h1 {
    font-size: 28px;
  }

  .brand p {
    font-size: 14px;
  }

  .pulse-icon {
    width: 64px;
    height: 64px;
  }

  .status-grid {
    position: fixed;
    left: 16px;
    right: 16px;
    top: 112px;
    z-index: 890;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    pointer-events: none;
  }

  .status-card {
    min-height: 54px;
    padding: 9px 12px;
    border-radius: 7px;
    background: rgba(8, 20, 32, 0.82);
    backdrop-filter: blur(12px);
  }

  .status-card span {
    font-size: 14px;
  }

  .status-card small {
    font-size: 11px;
  }

  .rangebar {
    position: fixed;
    left: 7vw;
    right: 7vw;
    top: 178px;
    z-index: 880;
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    pointer-events: none;
  }

  .range-presets,
  .custom-range {
    width: max-content;
    max-width: 100%;
    justify-content: center;
    justify-self: center;
    padding: 8px;
    border: 1px solid rgba(168, 190, 214, 0.18);
    border-radius: 9px;
    background: rgba(8, 20, 32, 0.93);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.34);
    pointer-events: auto;
  }

  .range-button {
    min-height: 42px;
    padding: 0 16px;
    border-radius: 7px;
    font-size: 13px;
  }

  .range-button.active {
    background: rgba(36, 208, 181, 0.24);
    box-shadow: inset 0 0 0 1px rgba(36, 208, 181, 0.45);
  }

  .custom-range {
    gap: 10px;
  }

  .custom-range label {
    gap: 8px;
    font-size: 12px;
  }

  .custom-range input {
    width: 142px;
    min-height: 38px;
    border-radius: 7px;
    font-weight: 800;
  }

  .shell {
    position: relative;
    display: block;
    width: 100%;
    height: 100dvh;
    min-height: 920px;
    padding: 0;
    overflow: hidden;
  }

  .map-panel {
    position: absolute;
    inset: 0;
    min-height: 100%;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  #map {
    height: 100%;
    min-height: 100%;
  }

  .map-head {
    position: fixed;
    left: 50%;
    top: 300px;
    z-index: 870;
    width: max-content;
    max-width: calc(100vw - 44px);
    min-height: 54px;
    padding: 12px 16px;
    transform: translateX(-50%);
    border-radius: 9px;
    background: rgba(8, 20, 32, 0.93);
  }

  .legend {
    gap: 10px;
    font-size: 15px;
  }

  .legend b {
    width: 14px;
    height: 14px;
  }

  .today-card {
    right: 24px;
    bottom: 280px;
    z-index: 650;
    width: 220px;
    border-radius: 8px;
  }

  .sidebar,
  .detail-panel {
    position: fixed;
    z-index: 800;
    bottom: 16px;
    width: calc(50vw - 24px);
    max-height: 42dvh;
    margin: 0;
    border-radius: 18px;
    background: rgba(5, 14, 23, 0.95);
    backdrop-filter: blur(16px);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.42);
  }

  .sidebar {
    left: 16px;
    height: 42dvh;
    border-right: 1px solid var(--line);
  }

  .detail-panel {
    right: 16px;
    height: 42dvh;
    min-height: 0;
  }

  .list-collapsed .sidebar,
  .detail-collapsed .detail-panel {
    height: 66px;
    max-height: 66px;
  }

  .panel-head {
    min-height: 66px;
    padding: 14px 18px;
  }

  .panel-head h2 {
    font-size: 14px;
  }

  .panel-toggle {
    min-width: 78px;
  }

  .quake-list {
    height: calc(42dvh - 66px);
    padding: 10px;
  }

  .quake-item {
    grid-template-columns: 58px 1fr auto;
    min-height: 76px;
  }

  .quake-main strong {
    font-size: 12px;
  }

  .quake-main span,
  .quake-meta {
    font-size: 12px;
  }

  #detailContent {
    max-height: calc(42dvh - 66px);
    padding: 16px;
  }

  .footer {
    display: none;
  }
}

@media (max-width: 720px) {
  .topbar {
    left: 10px;
    right: 10px;
    top: 10px;
    min-height: 82px;
    border-radius: 22px;
  }

  .topbar::before,
  .topbar::after {
    top: 18px;
    width: 42px;
    height: 42px;
  }

  .brand h1 {
    font-size: 22px;
  }

  .brand p {
    font-size: 12px;
  }

  .pulse-icon {
    width: 54px;
    height: 54px;
  }

  .status-grid {
    top: 98px;
    left: 10px;
    right: 10px;
  }

  .rangebar {
    left: 10px;
    right: 10px;
    top: 160px;
  }

  .range-presets,
  .custom-range {
    width: 100%;
  }

  .range-button {
    flex: 1 1 30%;
    padding: 0 8px;
    font-size: 11px;
  }

  .custom-range label {
    flex: 1 1 120px;
  }

  .custom-range input {
    width: 100%;
  }

  .map-head {
    top: 282px;
    padding: 10px 12px;
  }

  .legend {
    gap: 7px;
    font-size: 12px;
  }

  .today-card {
    display: none;
  }

  .sidebar,
  .detail-panel {
    bottom: 10px;
    width: calc(50vw - 15px);
    max-height: 38dvh;
    border-radius: 14px;
  }

  .sidebar {
    left: 10px;
    height: 38dvh;
  }

  .detail-panel {
    right: 10px;
    height: 38dvh;
  }

  .quake-list,
  #detailContent {
    max-height: calc(38dvh - 58px);
    height: calc(38dvh - 58px);
    padding: 8px;
  }

  .panel-head {
    min-height: 58px;
    padding: 12px;
  }

  .panel-head h2 {
    font-size: 12px;
  }

  .panel-toggle {
    min-width: 0;
    padding: 0 7px;
    font-size: 10px;
  }

  .quake-item {
    grid-template-columns: 46px 1fr;
    min-height: 66px;
    gap: 8px;
    padding: 8px;
  }

  .quake-meta {
    display: none;
  }

  .mag-badge {
    width: 42px;
    height: 42px;
    font-size: 16px;
    border-width: 2px;
  }

  .broadcast-highlight {
    grid-template-columns: 50px 1fr;
    gap: 10px;
  }

  .mag-badge.large {
    width: 48px;
    height: 48px;
    font-size: 18px;
  }

  .broadcast-highlight h3 {
    font-size: 14px;
  }

  .detail-grid,
  .intensity-panel {
    font-size: 12px;
  }
}

@media (max-width: 720px) {
  .topbar {
    left: 8px;
    right: 8px;
    top: 8px;
    min-height: 58px;
    padding: 8px 12px;
    border-radius: 18px;
  }

  .topbar::before,
  .topbar::after {
    display: none;
  }

  .brand {
    gap: 9px;
    width: 100%;
    justify-content: center;
  }

  .pulse-icon {
    width: 42px;
    height: 42px;
  }

  .pulse-icon svg {
    width: 27px;
    height: 27px;
  }

  .brand h1 {
    font-size: 19px;
    line-height: 1;
    white-space: nowrap;
  }

  .brand p {
    margin-top: 4px;
    font-size: 10px;
    white-space: nowrap;
  }

  .live-dot {
    width: 8px;
    height: 8px;
    margin-right: 5px;
  }

  .status-grid {
    left: 8px;
    right: 8px;
    top: 74px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }

  .status-card {
    min-height: 40px;
    padding: 7px 8px;
    border-radius: 7px;
    overflow: hidden;
  }

  .status-card span {
    overflow: hidden;
    font-size: 12px;
    line-height: 1.05;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .status-card small {
    display: block;
    margin-top: 2px;
    overflow: hidden;
    font-size: 9px;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #connectionState {
    color: var(--green);
  }

  .rangebar {
    left: 8px;
    right: 8px;
    top: 122px;
    gap: 5px;
  }

  .range-presets,
  .custom-range {
    padding: 5px;
    border-radius: 8px;
  }

  .range-presets {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }

  .range-button {
    min-height: 31px;
    padding: 0 5px;
    border-radius: 6px;
    font-size: 9px;
    line-height: 1.05;
  }

  .custom-range {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
  }

  .custom-range label {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 5px;
    font-size: 9px;
  }

  .custom-range input {
    min-height: 31px;
    width: 100%;
    padding: 0 5px;
    font-size: 11px;
  }

  #customRangeBtn {
    grid-column: 1 / -1;
  }

  .map-head {
    top: 250px;
    width: calc(100vw - 16px);
    max-width: none;
    min-height: 34px;
    padding: 7px 8px;
    border-radius: 8px;
  }

  .legend {
    display: grid;
    grid-template-columns: auto 10px auto 10px auto 10px auto 10px auto 10px auto;
    justify-content: center;
    gap: 5px;
    width: 100%;
    font-size: 9px;
    white-space: nowrap;
  }

  .legend b {
    width: 9px;
    height: 9px;
  }

  .shell {
    min-height: 100dvh;
  }

  .quake-label {
    width: 132px;
    padding: 5px 7px;
  }

  .quake-line {
    width: var(--line-width, 48px);
  }

  .sidebar,
  .detail-panel {
    bottom: 8px;
    width: calc(50vw - 12px);
    max-height: 31dvh;
    border-radius: 10px;
  }

  .sidebar {
    left: 8px;
    height: 31dvh;
  }

  .detail-panel {
    right: 8px;
    height: 31dvh;
  }

  .list-collapsed .sidebar,
  .detail-collapsed .detail-panel {
    height: 48px;
    max-height: 48px;
  }

  .panel-head {
    min-height: 46px;
    padding: 8px;
    gap: 6px;
  }

  .panel-head h2 {
    font-size: 10px;
    line-height: 1.05;
  }

  .panel-toggle {
    min-height: 28px;
    padding: 0 5px;
    font-size: 8px;
  }

  .quake-list,
  #detailContent {
    height: calc(31dvh - 46px);
    max-height: calc(31dvh - 46px);
    padding: 6px;
  }

  .quake-item {
    grid-template-columns: 36px 1fr;
    min-height: 52px;
    padding: 6px;
    border-radius: 6px;
  }

  .quake-main strong {
    margin-bottom: 3px;
    font-size: 9px;
    line-height: 1.15;
  }

  .quake-main span {
    font-size: 9px;
    line-height: 1.2;
  }

  .mag-badge {
    width: 32px;
    height: 32px;
    font-size: 13px;
  }

  .broadcast-highlight {
    grid-template-columns: 36px 1fr;
    margin-bottom: 8px;
    padding-bottom: 8px;
  }

  .mag-badge.large {
    width: 34px;
    height: 34px;
    font-size: 13px;
  }

  .broadcast-highlight small,
  .broadcast-highlight p {
    display: none;
  }

  .broadcast-highlight h3 {
    margin: 0;
    font-size: 11px;
    line-height: 1.18;
  }

  .detail-grid {
    gap: 0;
  }

  .detail-row {
    padding: 7px 0;
    gap: 2px;
  }

  .detail-row span,
  .detail-row b {
    font-size: 10px;
    line-height: 1.2;
  }

  .intensity-panel {
    display: block;
    margin: 0 0 8px;
    padding: 8px;
    border-radius: 6px;
  }

  .intensity-head {
    gap: 6px;
  }

  .intensity-panel h4 {
    font-size: 8px;
    line-height: 1.15;
  }

  .intensity-toggle {
    min-height: 24px;
    padding: 0 5px;
    font-size: 7px;
  }

  .intensity-list {
    gap: 5px;
    margin-top: 7px;
  }

  .intensity-item {
    grid-template-columns: 28px 1fr auto;
    gap: 5px;
    min-height: 36px;
    padding: 5px;
  }

  .mercalli-badge {
    width: 24px;
    height: 24px;
    font-size: 10px;
  }

  .intensity-item b,
  .intensity-item strong {
    font-size: 8px;
  }

  .intensity-item small {
    font-size: 7px;
  }
}

@media (max-width: 720px) {
  .topbar {
    left: 8px;
    right: 136px;
    top: 8px;
    width: auto;
    min-height: 46px;
    padding: 7px 9px;
    border-radius: 12px;
  }

  .brand {
    justify-content: flex-start;
    gap: 7px;
  }

  .pulse-icon {
    width: 34px;
    height: 34px;
  }

  .pulse-icon svg {
    width: 22px;
    height: 22px;
  }

  .brand h1 {
    font-size: 14px;
  }

  .brand p {
    font-size: 8px;
  }

  .status-grid {
    left: auto;
    right: 8px;
    top: 8px;
    width: 120px;
    min-height: 46px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    padding: 6px;
    border: 1px solid rgba(168, 190, 214, 0.18);
    border-radius: 10px;
    background: rgba(5, 14, 23, 0.88);
    backdrop-filter: blur(12px);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28);
  }

  .status-card {
    min-height: 0;
    padding: 3px 4px;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .status-card span {
    font-size: 9px;
    line-height: 1.05;
  }

  .status-card small {
    margin-top: 1px;
    font-size: 7px;
    line-height: 1;
  }

  .status-card .live-dot,
  #connectionState .live-dot {
    width: 5px;
    height: 5px;
    margin-right: 2px;
  }

  .screen-count canvas {
    display: none;
  }

  .rangebar {
    top: 60px;
    left: 8px;
    right: 8px;
  }

  .range-presets {
    width: calc(100vw - 16px);
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 4px;
  }

  .range-button {
    min-height: 28px;
    padding: 0 3px;
    font-size: 8px;
  }

  .custom-range {
    width: calc(100vw - 16px);
    grid-template-columns: 1fr 1fr auto auto;
    align-items: center;
    padding: 5px;
  }

  body:not(.custom-range-open) .custom-range {
    display: none;
  }

  body.custom-range-open .custom-range {
    display: grid;
  }

  .custom-range label {
    grid-template-columns: 1fr;
    gap: 2px;
    font-size: 7px;
  }

  .custom-range input {
    min-height: 27px;
    font-size: 9px;
  }

  #customRangeBtn,
  #hideCustomRangeBtn {
    grid-column: auto;
    min-width: 44px;
  }

  .map-head {
    top: 104px;
    width: calc(100vw - 16px);
    min-height: 30px;
    padding: 5px 6px;
  }

  body.custom-range-open .map-head {
    top: 142px;
  }

  .legend {
    grid-template-columns: auto 8px auto 8px auto 8px auto 8px auto 8px auto 8px auto;
    gap: 4px;
    font-size: 7px;
  }

  .legend b {
    width: 8px;
    height: 8px;
  }
}

@media (max-width: 980px) {
  .source-presets {
    width: max-content;
    max-width: 100%;
    justify-content: center;
    justify-self: center;
    padding: 8px;
    border: 1px solid rgba(168, 190, 214, 0.18);
    border-radius: 9px;
    background: rgba(8, 20, 32, 0.93);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.34);
    pointer-events: auto;
  }

  .source-button {
    min-height: 42px;
    padding: 0 16px;
    border-radius: 7px;
    font-size: 13px;
  }
}

@media (max-width: 720px) {
  .source-presets {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
    width: calc(100vw - 16px);
    padding: 4px;
    border-radius: 8px;
  }

  .source-button,
  .range-button {
    min-height: 28px;
    padding: 0 3px;
    border-radius: 6px;
    font-size: 8px;
    line-height: 1.05;
  }

  .source-badge {
    margin-right: 4px;
    padding: 2px 4px;
    font-size: 7px;
  }

  .map-source {
    font-size: 7px;
  }
}

@media (max-width: 720px) {
  html,
  body {
    width: 100%;
    min-height: 100%;
    overflow: hidden;
    background: #06111c;
  }

  body {
    --mobile-gap: 6px;
    --mobile-edge: max(8px, env(safe-area-inset-left));
    --mobile-right: max(4px, env(safe-area-inset-right));
    --mobile-top: max(4px, env(safe-area-inset-top));
    --mobile-bottom: max(8px, env(safe-area-inset-bottom));
  }

  .topbar {
    position: fixed;
    left: var(--mobile-edge);
    right: calc(var(--mobile-right) + 116px);
    top: var(--mobile-top);
    z-index: 950;
    width: auto;
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 7px 9px;
    border: 1px solid rgba(168, 190, 214, 0.18);
    border-radius: 12px;
    background: rgba(5, 14, 23, 0.94);
    backdrop-filter: blur(14px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.32);
  }

  .topbar::before,
  .topbar::after {
    display: none;
  }

  .brand {
    width: 100%;
    min-width: 0;
    gap: 7px;
    justify-content: flex-start;
  }

  .pulse-icon {
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
  }

  .pulse-icon svg {
    width: 22px;
    height: 22px;
  }

  .brand h1 {
    overflow: hidden;
    font-size: 14px;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .brand p {
    margin-top: 3px;
    overflow: hidden;
    font-size: 8px;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .live-dot {
    width: 7px;
    height: 7px;
    margin-right: 4px;
  }

  .status-grid {
    position: fixed;
    left: auto;
    right: calc(-116px - var(--mobile-right));
    top: calc(-1 * var(--mobile-top));
    z-index: 950;
    width: 108px;
    min-height: 42px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    padding: 5px;
    border: 1px solid rgba(168, 190, 214, 0.18);
    border-radius: 0 0 0 10px;
    background: rgba(5, 14, 23, 0.9);
    backdrop-filter: blur(14px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.32);
    pointer-events: none;
  }

  .status-card {
    min-height: 0;
    padding: 2px 3px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: hidden;
  }

  .status-card span {
    overflow: hidden;
    font-size: 8px;
    line-height: 1.05;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .status-card small {
    display: block;
    margin-top: 1px;
    overflow: hidden;
    font-size: 6.5px;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .status-card .live-dot,
  #connectionState .live-dot {
    width: 5px;
    height: 5px;
    margin-right: 2px;
  }

  .screen-count canvas {
    display: none;
  }

  .rangebar {
    position: fixed;
    left: var(--mobile-edge);
    right: var(--mobile-right);
    top: calc(var(--mobile-top) + 52px);
    z-index: 930;
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--mobile-gap);
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    pointer-events: none;
  }

  .source-presets,
  .range-presets,
  .custom-range {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 4px;
    border: 1px solid rgba(168, 190, 214, 0.18);
    border-radius: 8px;
    background: rgba(8, 20, 32, 0.93);
    backdrop-filter: blur(12px);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28);
    pointer-events: auto;
  }

  .source-presets {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
  }

  .range-presets {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
  }

  .source-button,
  .range-button {
    min-width: 0;
    min-height: 27px;
    padding: 0 3px;
    border-radius: 6px;
    font-size: 8px;
    line-height: 1.05;
    white-space: normal;
  }

  body:not(.custom-range-open) .custom-range {
    display: none;
  }

  body.custom-range-open .custom-range {
    display: grid;
    grid-template-columns: 1fr 1fr auto auto;
    align-items: end;
    gap: 4px;
  }

  .custom-range label {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2px;
    min-width: 0;
    font-size: 7px;
  }

  .custom-range input {
    width: 100%;
    min-height: 27px;
    padding: 0 5px;
    font-size: 9px;
  }

  #customRangeBtn,
  #hideCustomRangeBtn {
    grid-column: auto;
    min-width: 42px;
  }

  .shell {
    position: relative;
    display: block;
    width: 100%;
    height: 100dvh;
    min-height: 100dvh;
    padding: 0;
    overflow: hidden;
  }

  .map-panel {
    position: absolute;
    inset: 0;
    min-height: 100%;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  #map {
    height: 100%;
    min-height: 100%;
  }

  .map-head {
    position: fixed;
    left: calc(var(--mobile-edge) + 10px);
    top: calc(var(--mobile-top) + 132px);
    right: auto;
    z-index: 930;
    width: 38px;
    max-width: none;
    min-height: 28px;
    display: block;
    padding: 8px 6px;
    border: 1px solid rgba(168, 190, 214, 0.18);
    border-radius: 999px;
    background: rgba(8, 20, 32, 0.93);
    backdrop-filter: blur(12px);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28);
  }

  body.custom-range-open .map-head {
    top: calc(var(--mobile-top) + 170px);
  }

  .map-head h2 {
    display: none;
  }

  .legend {
    width: 100%;
    display: grid;
    grid-template-columns: 9px 1fr;
    grid-auto-rows: 18px;
    align-items: center;
    justify-content: start;
    gap: 5px 4px;
    font-size: 0;
    white-space: nowrap;
  }

  .legend span:first-child {
    display: none;
  }

  .legend span::after {
    content: attr(data-short);
    font-size: 8px;
    font-weight: 800;
  }

  .legend b {
    width: 9px;
    height: 9px;
  }

  .leaflet-top.leaflet-right {
    top: calc(var(--mobile-top) + 164px);
    right: var(--mobile-right);
    z-index: 910;
  }

  body.custom-range-open .leaflet-top.leaflet-right {
    top: calc(var(--mobile-top) + 202px);
  }

  .leaflet-control-zoom a {
    width: 34px;
    height: 34px;
    line-height: 32px;
  }

  .sidebar,
  .detail-panel {
    position: fixed;
    z-index: 900;
    bottom: var(--mobile-bottom);
    width: calc(50vw - 11px);
    height: 32dvh;
    max-height: 32dvh;
    min-height: 0;
    margin: 0;
    border-radius: 10px;
    background: rgba(5, 14, 23, 0.95);
    backdrop-filter: blur(16px);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.4);
  }

  .sidebar {
    left: var(--mobile-edge);
  }

  .detail-panel {
    right: var(--mobile-right);
  }

  .list-collapsed .sidebar,
  .detail-collapsed .detail-panel {
    height: 46px;
    max-height: 46px;
  }

  .panel-head {
    min-height: 46px;
    padding: 8px;
    gap: 6px;
  }

  .panel-head h2 {
    font-size: 10px;
    line-height: 1.05;
  }

  .panel-toggle {
    min-height: 27px;
    padding: 0 5px;
    border-radius: 5px;
    font-size: 8px;
  }

  .quake-list,
  #detailContent {
    height: calc(32dvh - 46px);
    max-height: calc(32dvh - 46px);
    padding: 6px;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .quake-list::-webkit-scrollbar,
  #detailContent::-webkit-scrollbar {
    width: 0;
    height: 0;
  }

  .quake-item {
    grid-template-columns: 34px 1fr;
    min-height: 50px;
    padding: 6px;
    border-radius: 6px;
  }

  .quake-main strong,
  .detail-main h3 {
    font-size: 9px;
    line-height: 1.15;
  }

  .quake-main span,
  .quake-meta,
  .detail-main p,
  .detail-grid,
  .detail-row,
  .intensity-note {
    font-size: 8px;
    line-height: 1.2;
  }

  .mag-badge {
    width: 30px;
    height: 30px;
    font-size: 12px;
  }

  .mag-badge.large {
    width: 42px;
    height: 42px;
    font-size: 15px;
  }

  .detail-hero {
    gap: 7px;
    padding-bottom: 8px;
  }

  .detail-grid {
    gap: 6px;
  }

  .detail-row {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .detail-row b {
    text-align: left;
  }

  .source-badge {
    margin-right: 4px;
    padding: 2px 4px;
    font-size: 7px;
  }

  .intensity-panel {
    display: block;
    margin: 0 0 8px;
    padding: 8px;
    border-radius: 6px;
  }

  .intensity-head {
    gap: 6px;
  }

  .intensity-panel h4 {
    font-size: 8px;
    line-height: 1.15;
  }

  .intensity-toggle {
    min-height: 24px;
    padding: 0 5px;
    font-size: 7px;
  }

  .intensity-list {
    gap: 5px;
    margin-top: 7px;
  }

  .intensity-item {
    grid-template-columns: 28px 1fr auto;
    gap: 5px;
    min-height: 36px;
    padding: 5px;
  }

  .mercalli-badge {
    width: 24px;
    height: 24px;
    font-size: 10px;
  }

  .intensity-item b,
  .intensity-item strong {
    font-size: 8px;
  }

  .intensity-item small {
    font-size: 7px;
  }

  .footer {
    display: none;
  }

  .leaflet-bottom.leaflet-right {
    right: var(--mobile-right);
    bottom: calc(var(--mobile-bottom) + 32dvh + 8px);
    z-index: 850;
  }

  .leaflet-control-attribution {
    max-width: 118px;
    padding: 1px 4px;
    overflow: hidden;
    font-size: 8px;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
    opacity: 0.72;
  }
}

@media (max-width: 390px) {
  .source-button,
  .range-button {
    font-size: 7px;
  }

  .legend {
    gap: 3px;
  }

  .legend span::after {
    font-size: 7px;
  }

  .panel-head h2 {
    font-size: 9px;
  }
}
