:root {
  --bg-0: #000000;
  --bg-1: #060606;
  --panel: rgba(8, 8, 8, 0.95);
  --panel-2: rgba(16, 16, 16, 0.96);
  --line: rgba(255, 255, 255, 0.12);
  --text: #f5f7fa;
  --muted: #8c9bab;
  --accent: #00e5ff;
  --accent-2: #7c4dff;
  --danger: #ff4d6d;
  --warning: #ffb703;
}

* {
  box-sizing: border-box;
  font-family: 'Bebas Neue', Arial, sans-serif !important;
  font-weight: 700 !important;
}

html, body,
#map,
#nws-alerts-list,
#nws-alerts-list h2,
.nws-alert-item,
.nws-alert-event,
.nws-alert-expires,
.nws-alert-color-box {
  letter-spacing: 1px;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at top left, #151515 0%, var(--bg-0) 45%, #020202 100%);
  color: var(--text);
  overflow: hidden;
}

#app {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  background: linear-gradient(140deg, #000000 0%, #040404 50%, #090909 100%);
}

#map,
#map-dual {
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  transition: opacity 180ms ease, transform 180ms ease;
}

#app.split > #map,
#app.split > #map-dual {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

*::-webkit-scrollbar {
  width: 8px;
}

*::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.03);
}

*::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.16);
  border-radius: 999px;
}

#nws-alerts-list {
  position: absolute;
  top: 41px;
  left: 16px;
  width: 290px;
  max-height: 74vh;
  overflow-y: auto;
  padding: 14px;
  z-index: 10;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(6, 6, 6, 0.97), rgba(18, 18, 18, 0.96));
  color: var(--text);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.72), inset 0 1px 0 rgba(255,255,255,0.05);
}

#nws-alerts-list h2 {
  margin: 0 0 10px;
  font-size: 16px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  text-shadow: 0 0 12px rgba(0, 229, 255, 0.35);
}

.nws-alert-item {
  margin-bottom: 10px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.07);
  background: linear-gradient(135deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.nws-alert-item:hover {
  transform: translateX(3px);
  background: rgba(0, 229, 255, 0.08);
  border-color: rgba(0, 229, 255, 0.25);
}

.nws-alert-event {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
}

.nws-alert-expires {
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
}

.nws-alert-color-box {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 8px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.25);
  vertical-align: middle;
}

#changeAlertColorsBtn {
  position: absolute;
  top: 8px;
  left: 14px;
  z-index: 2000;
  padding: 8px 95px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.16);
  color: #ffffff;
  font-size: 12px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
  background: linear-gradient(135deg, #121212 0%, #222222 100%);
  border-color: rgba(124, 77, 255, 0.35);
}

#changeAlertColorsBtn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.55);
}

#menu,
#alertColorMenu,
#mrms-panel,
.eye-watch-panel,
#alertSummaryPanel,
#reportSummaryPanel,
#top-right-square,
#editDescriptionModal .modal-content {
  background: linear-gradient(145deg, var(--panel) 0%, var(--panel-2) 100%);
  border: 1px solid var(--line);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.75), inset 0 1px 0 rgba(255,255,255,0.05);
  backdrop-filter: blur(18px);
}

#menu {
  display: none;
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 2000;
  width: min(320px, calc(100vw - 32px));
  max-height: 78vh;
  overflow-y: auto;
  padding: 16px;
  border-radius: 18px;
  color: var(--text);
}

#menu h3 {
  margin: 10px 0 8px;
  font-size: 15px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

#menu button,
.mrms-buttons button,
#top-right-square .copy-btn,
#top-right-square .cancel-btn,
#alertColorMenu .alert-reset-btn,
#alertColorMenu .alert-preview-btn,
.eye-watch-footer span {
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  background: linear-gradient(135deg, #111111 0%, #181818 100%);
  color: #ffffff;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

#menu button:hover,
.mrms-buttons button:hover,
#top-right-square .copy-btn:hover,
#top-right-square .cancel-btn:hover,
#alertColorMenu .alert-reset-btn:hover,
#alertColorMenu .alert-preview-btn:hover,
.eye-watch-footer span:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 229, 255, 0.35);
  background: linear-gradient(135deg, #171717 0%, #212121 100%);
}

#menu select,
#editDescriptionModal textarea {
  width: 100%;
  border: 1px solid rgba(255,255,255,0.13);
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  color: var(--text);
  padding: 8px 10px;
}

#alertDescriptionOverlay {
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(4, 8, 16, 0.9);
  backdrop-filter: blur(14px);
  padding: 24px;
  opacity: 0;
  transition: opacity 260ms ease;
}

.alert-description-card {
  width: min(620px, 100%);
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 28px;
  border: 1px solid rgba(255,255,255,0.14);
  background: linear-gradient(180deg, rgba(14, 18, 32, 0.98), rgba(4, 8, 16, 0.96));
  box-shadow: 0 38px 90px rgba(0, 0, 0, 0.7), inset 0 2px 0 rgba(255,255,255,0.05);
}

#alertDescriptionHeader {
  position: relative;
  padding: 26px 26px 18px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #f7fbff;
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.14), rgba(124, 77, 255, 0.1));
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

#alertDescriptionHeader::after {
  content: '';
  position: absolute;
  left: 26px;
  right: 26px;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 229, 255, 0.45), transparent);
}

#alertDescriptionText {
  flex: 1 1 auto;
  overflow-y: auto;
  color: rgba(245, 247, 250, 0.92);
  padding: 20px 26px 18px;
  font-size: 14px;
  line-height: 1.75;
  background: radial-gradient(circle at top right, rgba(0, 229, 255, 0.06), transparent 40%);
}

.alert-description-footer {
  padding: 16px 26px 22px;
  background: rgba(255,255,255,0.02);
  border-top: 1px solid rgba(255,255,255,0.08);
  text-align: right;
}

#closeAlertDescriptionBtn {
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 999px;
  padding: 10px 24px;
  background: linear-gradient(135deg, rgba(0, 190, 255, 0.18), rgba(42, 60, 255, 0.16));
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

#closeAlertDescriptionBtn:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 229, 255, 0.35);
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.28), rgba(22, 39, 80, 0.24));
}

#alertColorMenu input[type="color"] {
  width: 80px !important;
  height: 28px !important;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.05);
  padding: 0 !important;
  cursor: pointer;
  appearance: none;
}

#alertColorMenu input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

#alertColorMenu input[type="color"]::-webkit-color-swatch {
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.18);
}

#menu select {
  margin: 4px 0 10px;
  font-size: 14px;
}

#menu label,
#alertColorMenu label,
#mrms-panel,
#status-text,
#valid-time,
#frame-label {
  color: var(--muted);
}

#mrms-panel {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 1200;
  width: min(320px, calc(100vw - 32px));
  padding: 12px;
  border-radius: 18px;
}

.mrms-panel-title {
  margin-bottom: 6px;
  font-size: 16px;
  color: var(--accent);
  text-transform: uppercase;
}

.mrms-row,
.mrms-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 6px 0;
  font-size: 12px;
}

#mrms-panel input[type="range"] {
  width: 100%;
  margin: 4px 0 8px;
}

.mrms-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0;
}

.player-controls {
  margin-top: 4px;
}

#legend-bar {
  height: 12px;
  border-radius: 999px;
  margin-top: 8px;
  border: 1px solid rgba(255,255,255,0.08);
  background: linear-gradient(90deg, #111111 0%, #1d1d1d 100%);
}

.eye-watch-panel {
  position: fixed;
  top: 90px;
  right: 24px;
  z-index: 3000;
  width: 280px;
  display: none;
  border-radius: 18px;
  color: var(--text);
}

.eye-watch-header {
  padding: 12px;
  border-radius: 18px 18px 0 0;
  background: linear-gradient(135deg, var(--accent) 0%, #1f6dff 100%);
  color: #000000;
  font-size: 20px;
}

.eye-watch-content {
  padding: 10px;
}

.eye-watch-row {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.eye-watch-row:nth-child(even) {
  background: rgba(0, 229, 255, 0.08);
  color: #ffffff;
}

.eye-watch-footer {
  display: flex;
  justify-content: space-between;
  padding: 10px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

#top-right-square {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(95vw, 680px);
  max-height: 80vh;
  z-index: 5000;
  padding: 18px;
  border-radius: 20px;
  color: #dbe8ff;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}

#top-right-square.expanded {
  display: flex;
}

#top-right-square .geojson-header {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

#copy-feedback {
  display: none;
  color: var(--accent);
  font-size: 12px;
  align-self: flex-end;
}

#top-right-square pre {
  margin: 0;
  padding: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: 'Bebas Neue', Arial, sans-serif !important;
  font-weight: 700 !important;
  font-size: 12px;
  color: #dfefff;
  max-height: 220px;
  overflow: auto;
}

#alertSummaryPanel,
#reportSummaryPanel {
  position: fixed !important;
  top: 34px !important;
  left: 310px !important;
  z-index: 7000 !important;
  width: 320px;
  max-width: 38vw;
  padding: 0;
  border-radius: 18px;
  overflow: hidden;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
  transform: scale(var(--summary-panel-scale, 1)) translate(var(--summary-panel-pan-x, 0px), var(--summary-panel-pan-y, 0px));
  transform-origin: top right;
}

#alertSummaryTitle,
#reportSummaryTitle {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1.2px;
}

.lsr-gradient {
  background: linear-gradient(135deg, var(--lsr-color, var(--accent)) 0%, rgba(0,0,0,0.85) 100%);
  color: white;
  padding: 14px 15px;
  font-size: 18px;
  font-weight: 700;
  text-align: left;
}

.lsr-grey {
  background: rgba(255,255,255,0.04);
  color: #d8e3ef;
  padding: 12px 15px;
  font-size: 16px;
  text-align: left;
}

#editDescriptionModal {
  display: none;
  position: fixed;
  z-index: 7000;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.78);
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

#editDescriptionModal.active {
  pointer-events: auto;
}

#editDescriptionModal .modal-content {
  width: min(360px, 100%);
  max-height: 85vh;
  overflow: auto;
  border-radius: 18px;
  position: fixed;
  pointer-events: auto;
}

#editDescriptionModal .modal-drag-handle {
  padding: 12px 14px;
  cursor: grab;
  user-select: none;
  font-family: 'Bebas Neue', Arial, sans-serif !important;
  font-weight: 700 !important;
  font-size: 24px;
  color: #000000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, var(--accent) 0%, #1f6dff 100%);
}

#editDescriptionModal .modal-content-inner {
  padding: 14px;
}

#editDescriptionModal h3 {
  margin: 0 0 8px;
  font-size: 18px;
  color: var(--accent);
}

#editDescriptionModal textarea {
  width: 100%;
  height: 320px;
  resize: vertical;
  font-size: 13px;
  line-height: 1.3;
  background: rgba(255,255,255,0.03);
  color: #dbe8ff;
}

#editDescriptionModal .modal-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

#editDescriptionModal button {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.12);
  background: transparent;
  color: #dbe8ff;
  cursor: pointer;
  font-weight: 700;
}

#editDescriptionModal button.primary {
  background: linear-gradient(135deg, var(--accent) 0%, #1f6dff 100%);
  color: #000000;
  border-color: transparent;
}

#alertDescriptionText {
  white-space: pre-wrap;
  text-align: left;
  font-size: 13px;
  line-height: 1.35;
  color: #ffffff;
  background: #000000;
  max-height: 60vh;
  overflow: auto;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
}

#alertColorMenu {
  display: none;
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2000;
  width: min(360px, 92vw);
  max-width: 360px;
  max-height: 74vh;
  overflow-y: auto;
  padding: 16px;
  border-radius: 18px;
  color: var(--text);
  animation: slideDown 0.24s ease-out;
}

#alertColorMenu h3 {
  margin: 6px 0 12px;
  font-size: 15px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1.3px;
}

.alert-color-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
}

.alert-color-item label {
  flex: 1;
  font-size: 12px;
  color: var(--text);
}

.alert-color-item input[type="color"] {
  width: 44px;
  height: 22px;
  padding: 0;
  cursor: pointer;
}

#alertColorMenu > button.close-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 6px 10px;
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 20px;
  cursor: pointer;
  box-shadow: none;
}

.lsr-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.3);
  background: radial-gradient(circle at 60% 40%, #ffd54f 0%, #ffb300 60%, #ff7f00 100%);
  box-shadow: 0 0 10px rgba(255, 183, 3, 0.2);
  cursor: pointer;
}

.lsr-dot:hover {
  transform: scale(1.08);
  box-shadow: 0 0 14px rgba(255, 183, 3, 0.35);
}

.weatherwise-popup {
  display: flex;
  flex-direction: column;
  width: max-content;
  min-width: 260px;
  max-width: 320px;
  background: linear-gradient(145deg, rgba(5, 5, 5, 0.98), rgba(20, 20, 20, 0.96));
  border: 1px solid rgba(0, 229, 255, 0.2);
  border-radius: 16px;
  color: var(--text);
  overflow: hidden;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.72);
}

.weatherwise-row {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  cursor: pointer;
  transition: background 180ms ease;
}

.weatherwise-row:hover {
  background: rgba(0, 229, 255, 0.08);
}

.weatherwise-row .title {
  font-size: 15px;
  color: var(--accent);
}

.weatherwise-row .expires-line {
  font-size: 12px;
  color: var(--muted);
}

.weatherwise-footer {
  padding: 10px 12px;
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.weatherwise-close {
  color: var(--accent);
  cursor: pointer;
}

#app #map .alert-popup,
#app #map-dual .alert-popup,
#app #map .popup,
#app #map-dual .popup,
#app #map .popup-inner,
#app #map-dual .popup-inner {
  font-family: 'Bebas Neue', 'Onest', Arial, sans-serif !important;
}

@keyframes flashBorder {
  0% { border-color: #ffffff; opacity: 1; }
  50% { border-color: #ffffff; opacity: 0.8; }
  100% { border-color: var(--polygon-color, var(--accent)); opacity: 1; }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

#product-header-main,
#product-header-split {
  transform: scale(var(--product-box-scale, 1)) translate(var(--product-box-pan-x, 0px), var(--product-box-pan-y, 0px));
  transform-origin: top right;
}