* {
  box-sizing: border-box;
}

.yx-hidden {
  display: none !important;
}

body.yx-page {
  margin: 0;
  min-height: 100vh;
  background: #0b0f14;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  overflow: hidden;
}

.yx-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1200;
  background: rgba(11, 15, 20, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.yx-header-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.55rem 1rem;
  min-height: 52px;
}

.yx-logo {
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 1rem;
  white-space: nowrap;
}

.yx-logo:hover {
  color: #ffdb4d;
}

.yx-tabs {
  display: flex;
  gap: 0.25rem;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
}

.yx-map-controls {
  position: absolute;
  left: 16px;
  top: 16px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  background: rgba(11, 15, 20, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 0.65rem 0.85rem;
  backdrop-filter: blur(6px);
  max-width: min(360px, calc(100% - 32px));
}

.yx-control {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.88);
  cursor: pointer;
  line-height: 1.35;
}

.yx-control input {
  margin-top: 0.15rem;
  accent-color: #ffdb4d;
  flex-shrink: 0;
}

.yx-control-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.yx-control-group {
  margin-top: 0.35rem;
  padding-top: 0.45rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.yx-control-group-title {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 0.35rem;
}

.yx-logout-form {
  margin: 0;
  display: inline;
}

.yx-logout-btn {
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  font: inherit;
}

.yx-popup {
  font-size: 0.85rem;
  line-height: 1.4;
}

.yx-tabs::-webkit-scrollbar {
  display: none;
}

.yx-tab {
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.75);
  padding: 0.45rem 0.9rem;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.yx-tab:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.yx-tab.active {
  background: rgba(255, 219, 77, 0.18);
  color: #ffdb4d;
  font-weight: 600;
}

.yx-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

.yx-link {
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  font-size: 0.8rem;
  white-space: nowrap;
}

.yx-link:hover {
  color: #ffdb4d;
}

.yx-updated {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.4);
  white-space: nowrap;
}

.yx-main {
  position: fixed;
  inset: 52px 0 88px;
}

#yx-map {
  width: 100%;
  height: 100%;
  background: #1a2332;
}

.yx-legend {
  position: absolute;
  right: 16px;
  top: 16px;
  z-index: 1000;
  background: rgba(11, 15, 20, 0.85);
  border-radius: 12px;
  padding: 10px 12px;
  min-width: 48px;
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.yx-legend-title {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 6px;
  text-align: center;
}

.yx-legend-hint {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.45);
  text-align: center;
  max-width: 90px;
  line-height: 1.3;
}

.yx-legend-bar {
  width: 12px;
  height: 140px;
  border-radius: 6px;
  margin: 0 auto;
}

.yx-legend-bar.precip-bar {
  background: linear-gradient(to top, transparent, rgba(80, 90, 110, 0.9), rgba(40, 80, 140, 0.95));
}

.yx-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background: rgba(11, 15, 20, 0.7);
  z-index: 2000;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.8);
}

.yx-loading.hidden {
  display: none;
}

.yx-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: #ffdb4d;
  border-radius: 50%;
  animation: yx-spin 0.8s linear infinite;
}

@keyframes yx-spin {
  to { transform: rotate(360deg); }
}

.yx-timeline-wrap {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1200;
  background: rgba(11, 15, 20, 0.96);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.5rem 0.75rem 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 88px;
}

.yx-now-btn {
  flex-shrink: 0;
  border: 1px solid rgba(255, 219, 77, 0.45);
  background: rgba(255, 219, 77, 0.12);
  color: #ffdb4d;
  border-radius: 10px;
  padding: 0.5rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.yx-now-btn:hover {
  background: rgba(255, 219, 77, 0.22);
}

.yx-timeline-scroll {
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.yx-timeline {
  display: flex;
  align-items: flex-end;
  gap: 0;
  min-width: min-content;
  padding: 0.25rem 0;
}

.yx-day-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0 0.35rem;
}

.yx-day-group:first-child {
  border-left: none;
}

.yx-day-label {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 0.35rem;
  white-space: nowrap;
}

.yx-hours {
  display: flex;
  gap: 2px;
}

.yx-hour {
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.75rem;
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  cursor: pointer;
  min-width: 42px;
  transition: background 0.12s, color 0.12s;
}

.yx-hour:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.yx-hour.active {
  background: #ffdb4d;
  color: #1a1a1a;
  font-weight: 700;
}

.yx-hour.now-marker::after {
  content: '';
  display: block;
  width: 4px;
  height: 4px;
  background: #ffdb4d;
  border-radius: 50%;
  margin: 2px auto 0;
}

.yx-time-label {
  flex-shrink: 0;
  min-width: 120px;
  text-align: right;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
}

.leaflet-control-zoom {
  border: none !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35) !important;
}

.leaflet-control-zoom a {
  background: rgba(11, 15, 20, 0.9) !important;
  color: #fff !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

@media (max-width: 640px) {
  .yx-header-actions .yx-link,
  .yx-updated {
    display: none;
  }

  .yx-time-label {
    display: none;
  }
}
