/* Base styles */
html {
  scroll-behavior: smooth;
}

body {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  margin: 0;
  padding: 0;
}

/* Layout components */
.app-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

.app-header {
  background-color: #2c3e50;
  padding: 1rem;
  color: white;
  width: 100%;
  position: relative;
  z-index: 100;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  position: relative;
}

.title-container {
  display: flex;
  align-items: center;
  gap: 0;
}

.title-icon {
  height: 2rem;
  width: auto;
  margin: 0;
}

.app-title {
  margin: 0;
  font-size: 1.5rem;
  padding-left: 0.25rem;
}

.footer-link {
  color: #ffd700;
  text-decoration: underline;
  transition: color 0.3s ease;
}

.footer-link:hover {
  color: #ffed4e;
}

/* Hamburger menu button - hidden on desktop */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 1001;
  position: relative;
}

.hamburger-icon {
  width: 28px;
  height: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hamburger-icon span {
  display: block;
  width: 100%;
  height: 3px;
  background-color: white;
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* Navigation */
.nav-container {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.nav-link {
  color: white;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  transition: background-color 0.3s;
  white-space: nowrap;
}

.nav-link:hover {
  background-color: #34495e;
}


/* Ko-fi Button */
.kofi-button {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, #ff5e5b 0%, #ff4747 100%);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(255, 71, 71, 0.3);
  white-space: nowrap;
}

.kofi-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 71, 71, 0.4);
  background: linear-gradient(135deg, #ff4747 0%, #ff3333 100%);
}

.kofi-icon {
  font-size: 1.1rem;
  line-height: 1;
}

.kofi-text {
  line-height: 1;
}

/* Promotional Banner */
.promo-banner {
  background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
  width: 100%;
  padding: 0.5rem 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  position: relative;
  z-index: 90;
}

.promo-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.promo-icon {
  font-size: 1.3rem;
  line-height: 1;
}

.promo-text-container {
  text-align: center;
}

.promo-heading {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
}

.promo-link {
  color: white;
  text-decoration: none;
  transition: all 0.3s ease;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.promo-link:hover {
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Main content area */
.main-content {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  overflow-x: hidden;
  position: relative;
  z-index: 1;
}

/* Map container styles */
.map-container {
  width: 100%;
  position: relative;
  overflow: hidden;
  height: 50vh !important;
  min-height: 400px;
  margin: 0 auto !important;
}

/* Table responsive wrapper */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
}

.dash-table-container {
  width: 100% !important;
  overflow-x: auto;
}

/* SNOTEL column styling - blue, no underline, clickable appearance */
.dash-table-container .dash-cell[data-dash-column="SNOTEL"],
.dash-table-container td[data-dash-column="SNOTEL"] {
  color: #1f77b4;
  cursor: pointer;
}

.dash-table-container .dash-cell[data-dash-column="SNOTEL"]:hover,
.dash-table-container td[data-dash-column="SNOTEL"]:hover {
  color: #0d5aa7;
}

/* Align 7 Day Forecast column to the right */
.dash-table-container .dash-cell[data-dash-column="7 Day Forecast"],
.dash-table-container td[data-dash-column="7 Day Forecast"],
.dash-table-container .dash-header[data-dash-column="7 Day Forecast"],
.dash-table-container th[data-dash-column="7 Day Forecast"] {
  text-align: right;
}

/* Reset paragraph styling ONLY in 7 Day Forecast column */
.dash-table-container .dash-cell[data-dash-column="7 Day Forecast"] .cell-markdown p,
.dash-table-container td[data-dash-column="7 Day Forecast"] .cell-markdown p {
  margin: 0;
  padding: 0;
  font-size: 14px;
  font-family: inherit;
  line-height: inherit;
  font-weight: inherit;
  text-align: right;
}

/* Forecast link styling - blue to indicate link, no underline by default */
.dash-table-container .dash-cell[data-dash-column="7 Day Forecast"] a,
.dash-table-container td[data-dash-column="7 Day Forecast"] a {
  color: #1f77b4;
  text-decoration: none;
  font-weight: normal;
  font-size: 14px;
  font-family: inherit;
  line-height: inherit;
  transition: color 0.2s ease;
  cursor: pointer;
}

.dash-table-container .dash-cell[data-dash-column="7 Day Forecast"] a:hover,
.dash-table-container td[data-dash-column="7 Day Forecast"] a:hover {
  color: #0d5aa7;
  text-decoration: underline;
}

/* Footer styles */
.app-footer {
  background-color: #2c3e50;
  color: white;
  padding: 1rem;
  margin-top: auto;
  width: 100%;
  position: relative;
  z-index: 1;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
  width: 100%;
}

.footer-text {
  margin: 0.5rem 0;
  font-size: 0.9rem;
}

.header-spacer {
  display: block;
}

/* ========================================================================== */
/* FORECAST PAGE SPECIFIC STYLES */
/* ========================================================================== */

/* Forecast page base */
.forecast-main-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Forecast dropdown */
.forecast-location-select {
  font-size: 1.1em !important;
  padding: 10px 12px !important;
  border-radius: 8px;
  border: 2px solid #cbd5e0 !important;
  margin-bottom: 20px;
}

/* Snow summary box */
.snow-summary {
  background: linear-gradient(135deg, #ffffff 0%, #ebf8ff 100%);
  border-radius: 12px;
  padding: 20px 25px;
  margin-bottom: 20px;
  border: 2px solid #4299e1;
  box-shadow: 0 4px 12px rgba(66,153,225,0.2);
}

.snow-summary h2 {
  color: #2c5282;
  margin: 0 0 15px 0;
  font-size: 1.5em;
  text-align: center;
}

.snow-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  max-width: 650px;
  margin: 0 auto;
}

.snow-stat {
  text-align: center;
  padding: 10px 12px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.snow-stat-value {
  font-size: 1.8em;
  font-weight: 700;
  color: #2c5282;
  margin: 0;
  line-height: 1.1;
}

.snow-stat-label {
  font-size: 0.8em;
  color: #718096;
  margin-top: 3px;
  font-weight: 500;
}

.no-snow {
  text-align: center;
  padding: 15px;
  color: #718096;
}

/* Forecast cards */
.forecast-cards-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.forecast-card {
  background: linear-gradient(135deg, #f6f8fb 0%, #ffffff 100%);
  border-radius: 10px;
  padding: 15px;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
  border: 1px solid #e2e8f0;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  cursor: pointer;
  min-height: 85px;
  position: relative;
}

.forecast-card::after {
  content: '▼';
  position: absolute;
  right: 15px;
  bottom: 10px;
  font-size: 0.8em;
  color: #a0aec0;
  transition: color 0.2s ease;
}

.forecast-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  transform: translateX(4px);
}

.forecast-card:hover::after {
  color: #667eea;
}

.forecast-card:active {
  background: linear-gradient(135deg, #e2e8f0 0%, #edf2f7 100%);
}

.forecast-card-snow {
  background: linear-gradient(135deg, #ebf8ff 0%, #bee3f8 100%);
  border-left: 5px solid #4299e1;
}

/* Card internals */
.card-icon {
  flex-shrink: 0;
  width: 70px;
  height: 70px;
}

.card-main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.card-day-name {
  font-size: 1.3em;
  font-weight: 700;
  color: #2d3748;
  margin: 0;
}

.card-short-forecast {
  font-size: 0.95em;
  color: #4a5568;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}

.card-temps {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
  min-width: 60px;
}

.temp-high {
  font-size: 1.3em;
  font-weight: 700;
  color: #e53e3e;
}

.temp-low {
  font-size: 1.3em;
  font-weight: 600;
  color: #4299e1;
}

.temp-label {
  font-size: 0.75em;
  color: #718096;
  font-weight: 500;
}

.snow-badge {
  background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
  color: white;
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 0.85em;
  font-weight: 600;
  display: inline-block;
  margin-top: 2px;
  box-shadow: 0 2px 4px rgba(66,153,225,0.3);
}

/* Mobile styles */
@media screen and (max-width: 768px) {
  html, body {
    overflow-x: hidden !important;
  }
  
  .app-header {
    padding: 1rem 0.5rem;
  }
  
  .header-content {
    display: flex;
    justify-content: space-between;
    align-items: left;
    padding: 0 0.5rem;
    width: 100%;
  }
  
  .app-title {
    font-size: 1.2rem;
    margin: 0;
  }
  
  /* Hide spacer on mobile */
  .header-spacer {
    display: none;
  }
  
  /* Show hamburger menu on mobile */
  .menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    min-width: 44px;
    min-height: 44px;
    margin-right: 0.5rem;
  }
  
  .hamburger-icon {
    width: 28px;
    height: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }
  
  .hamburger-icon span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: white;
    border-radius: 2px;
  }
  
  /* Mobile navigation container */
  .nav-container {
    position: fixed;
    top: 65px;
    left: 0;
    right: 0;
    background-color: #2c3e50;
    flex-direction: column;
    gap: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    width: 100%;
  }
  
  .nav-container.active {
    max-height: 500px;
  }
  
  /* Mobile navigation */
  .nav-links {
    position: static;
    flex-direction: column;
    gap: 0;
    width: 100%;
    box-shadow: none;
  }
  
  .nav-links.active {
    max-height: none;
  }
  
  .nav-link {
    width: 100%;
    padding: 1rem 1.5rem;
    border-radius: 0;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: block;
    box-sizing: border-box;
  }
  
  .nav-link:last-child {
    border-bottom: none;
  }
  
  /* Ko-fi button on mobile */
  .kofi-button {
    width: calc(100% - 3rem);
    margin: 1rem 1.5rem;
    justify-content: center;
    box-sizing: border-box;
  }
  
  /* Promo banner mobile styles */
  .promo-banner {
    padding: 0.4rem 0.5rem;
  }
  
  .promo-content {
    padding: 0 0.5rem;
  }
  
  .promo-icon {
    display: none;
  }
  
  .promo-heading {
    font-size: 0.85rem;
    line-height: 1.4;
  }
  
  .promo-link {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
  }
  
  /* Mobile page content - Title and Set Home button */
  .main-content h2 {
    font-size: 1.3rem;
    margin: 0;
    flex: 1;
    min-width: 0;
  }
  
  /* Adjust the flexbox container for title + button on mobile */
  .main-content > div > div:first-child {
    flex-wrap: nowrap;
    gap: 0.5rem;
    margin-bottom: 15px !important;
  }
  
  /* Make Set Home button more compact on mobile */
  #set-home-button {
    font-size: 0.8rem !important;
    padding: 6px 10px !important;
    white-space: nowrap;
    flex-shrink: 0;
  }
  
  .map-container {
    width: 100% !important;
    height: 50vh !important;
    min-height: 350px !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  
  /* Table scrolling - FIXED */
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
  }
  
  .dash-table-container {
    width: 100% !important;
    overflow-x: auto;
  }
  
  /* Don't break table structure on mobile */
  table {
    width: 100% !important;
    table-layout: auto;
  }
  
  /* Remove hyperlink styling from SNOTEL column on mobile only */
  .dash-table-container .dash-cell[data-dash-column="SNOTEL"],
  .dash-table-container td[data-dash-column="SNOTEL"],
  .dash-table-container .dash-header[data-dash-column="SNOTEL"],
  .dash-table-container th[data-dash-column="SNOTEL"] {
    color: inherit !important;
    cursor: default !important;
  }
  
  /* Keep 7 Day Forecast links working on mobile with right alignment */
  .dash-table-container .dash-cell[data-dash-column="7 Day Forecast"],
  .dash-table-container td[data-dash-column="7 Day Forecast"],
  .dash-table-container .dash-header[data-dash-column="7 Day Forecast"],
  .dash-table-container th[data-dash-column="7 Day Forecast"] {
    text-align: right !important;
  }
  
  .dash-table-container .dash-cell[data-dash-column="7 Day Forecast"] .cell-markdown p,
  .dash-table-container td[data-dash-column="7 Day Forecast"] .cell-markdown p {
    margin: 0;
    padding: 0;
    font-size: 14px;
    font-family: inherit;
    line-height: inherit;
    font-weight: inherit;
    text-align: right;
  }
  
  .dash-table-container .dash-cell[data-dash-column="7 Day Forecast"] a,
  .dash-table-container td[data-dash-column="7 Day Forecast"] a {
    color: #1f77b4 !important;
    text-decoration: none !important;
    cursor: pointer !important;
    font-weight: normal;
    font-size: 14px;
    font-family: inherit;
    line-height: inherit;
  }
  
  .dash-table-container .dash-cell[data-dash-column="7 Day Forecast"] a:hover,
  .dash-table-container td[data-dash-column="7 Day Forecast"] a:hover {
    color: #0d5aa7 !important;
    text-decoration: underline !important;
  }
  
  .footer-text {
    font-size: 0.8rem;
  }
  
  /* Forecast page mobile styles */
  .forecast-main-container {
    padding: 0;
  }
  
  .forecast-card {
    flex-wrap: wrap;
    gap: 10px;
  }
  
  .forecast-card::after {
    font-size: 0.9em;
    right: 10px;
  }
  
  .card-icon {
    width: 60px;
    height: 60px;
  }
  
  .card-day-name {
    font-size: 1.1em;
  }
  
  .card-short-forecast {
    font-size: 0.9em;
  }
  
  .card-temps {
    min-width: 55px;
  }
  
  .snow-summary-grid {
    max-width: 100%;
  }
  
  .snow-stat {
    padding: 10px;
  }
  
  .snow-stat-value {
    font-size: 1.6em;
  }
  /* Force collapsed state for forecast cards */
  .forecast-cards-row .collapse:not(.show) {
  display: none !important;
}
  /* Forecast detail panel */
  .forecast-detail {
    padding: 15px;
    background: white;
    border-radius: 0 0 10px 10px;
    margin-top: -10px;
    margin-bottom: 12px;
    border: 1px solid #e2e8f0;
    border-top: none;
    font-size: 0.95em;
    color: #4a5568;
  }
}

/* Extra small mobile devices */
@media screen and (max-width: 480px) {
  .promo-heading {
    font-size: 0.8rem;
  }
  
  .main-content h2 {
    font-size: 1.1rem;
  }
  
  #set-home-button {
    font-size: 0.75rem !important;
    padding: 5px 8px !important;
  }
}
/* Settings gear link next to the page title */
.settings-gear { display: inline-block; box-sizing: content-box; width: 26px; height: 26px; padding: 4px 8px; text-decoration: none; color: inherit; line-height: 1;
  background: currentColor; background-clip: content-box;   /* the gear is drawn by this mask, so it takes the text color */
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58a.49.49 0 0 0 .12-.61l-1.92-3.32a.488.488 0 0 0-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54a.484.484 0 0 0-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58a.49.49 0 0 0-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z'/%3E%3C/svg%3E") center / 26px 26px no-repeat content-box;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58a.49.49 0 0 0 .12-.61l-1.92-3.32a.488.488 0 0 0-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54a.484.484 0 0 0-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58a.49.49 0 0 0-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z'/%3E%3C/svg%3E") center / 26px 26px no-repeat content-box; }
.settings-gear:hover { opacity: 0.7; }

/* Forecast scorecard (AI_Wx vs NWS) */
.score-card { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; white-space: nowrap; }
.score-val { opacity: 0.75; }
.score-win { font-weight: bold; opacity: 1; }
.score-bar { position: relative; width: 110px; height: 10px; background: #d9dde2; border-radius: 5px; overflow: hidden; }
.score-fill { position: absolute; top: 0; bottom: 0; }
.score-fill-ai { background: #2ca02c; }
.score-fill-nws { background: #1f77b4; }
.score-mid { position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #6c757d; }
.score-provisional .score-bar { opacity: 0.6; }
.score-note { font-size: 0.75rem; opacity: 0.7; }
@media (max-width: 768px) {
  .score-card { font-size: 0.7rem; gap: 5px; }
  .score-bar { width: 76px; }
}

/* Title row: keep "Snow Depth" on one line. On phones the scorecard shares that line when it fits (the unit and the
   n/7d note are dropped there; both are in the hover text) and wraps to its own row only when it does not. */
.title-row h2 { white-space: nowrap; }
@media (max-width: 768px) {
  .title-row { flex-wrap: wrap; gap: 6px !important; margin-bottom: 8px !important; }
  .title-row h2 { order: 1; flex: 0 0 auto !important; }
  .title-row #score-card { order: 2; flex: 1 1 auto; min-width: 0; }
  .title-row .settings-gear { order: 4; }
  .title-row .score-card { justify-content: flex-end; font-size: 0.7rem; gap: 4px; }
  .title-row .score-bar { width: 52px; }
  .title-row .score-unit, .title-row .score-days { display: none; }
}
@media (max-width: 520px) {
  /* narrow phones: tighten the scorecard and the radar label so "Snow Depth", scorecard, "Snow radar" and the gear share one line;
     where a phone is too narrow for that, the radar checkbox and gear wrap together onto the right of a second line */
  .title-row #score-card { flex: 0 1 auto; margin-left: auto; }
  .title-row .score-card { font-size: 0.65rem; gap: 3px; }
  .title-row .score-bar { width: 26px; }
  .title-row .settings-gear { padding: 4px 2px; width: 24px; height: 24px; -webkit-mask-size: 24px 24px; mask-size: 24px 24px; }
}

/* Days slider row: the slider on the left, the Snow radar checkbox in its own column on the right */
.days-row { display: flex; align-items: flex-start; gap: 28px; margin-bottom: 10px; }
.days-row .dash-range-slider-input { display: none !important; }   /* newer Dash adds a number box beside the slider; the handle's own tooltip already shows the value */
.days-row .days-col { flex: 1 1 auto; min-width: 0; }
.days-row #radar-toggle { flex: 0 0 auto; white-space: nowrap; box-sizing: border-box; padding: 6px 12px; margin-top: -2px; border-radius: 10px;
  background: #fde9f2; border: 1px solid #f2b5d2; color: #8a1c57; font-weight: 600; transition: background .15s, border-color .15s; }
.days-row #radar-toggle:hover { background: #fbdbea; }
.days-row #radar-toggle:has(input:checked) { background: #f9c6de; border-color: #e0559a; }
.days-row #radar-toggle label { cursor: pointer; display: flex !important; align-items: center !important; gap: 6px; line-height: 1 !important; }   /* !important: Dash 2.x puts display:block on the label inline, which left the text on the checkbox's baseline, a little low */
.days-row #radar-toggle input { accent-color: #d6247f; margin: 0 !important; }
@media (max-width: 520px) {
  .days-row { gap: 10px; }
  .days-row .days-label { font-size: 0.78rem; white-space: nowrap; display: block; }
  .days-row #radar-toggle { white-space: nowrap; width: auto; padding: 5px 7px; }
  .days-row #radar-toggle label { font-size: 0.72rem; gap: 4px; }
  .days-row #radar-toggle input { margin: 0 !important; flex: 0 0 auto; }
}

/* Settings page: units/home on the left, a plain-language map legend on the right; one column on a phone */
.settings-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 22px; align-items: start; margin-bottom: 14px; }
.settings-card { background: #f6f8fa; border: 1px solid #e1e4e8; border-radius: 8px; padding: 12px 14px; }
.settings-legend { background: #f6f8fa; border: 1px solid #e1e4e8; border-radius: 8px; padding: 12px 14px; font-size: .88rem; line-height: 1.4; }
.legend-item { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 10px; }
.legend-item:last-child { margin-bottom: 0; }
.legend-sw { flex: 0 0 44px; margin-top: 3px; display: flex; justify-content: center; }
.legend-sw > .legend-bar { width: 100%; }
.legend-bar { height: 12px; border-radius: 6px; }
.legend-map { position: relative; width: 44px; height: 44px; border-radius: 6px; background: #b9c7a8; overflow: hidden; }
.legend-map::before { content: ''; position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: rgb(80,130,210); z-index: 1; }
.legend-pulse { position: absolute; left: 3px; top: 3px; width: 38px; height: 38px; border-radius: 50%; background: rgb(240,250,255); opacity: 0; animation: legend-ripple 3.6s infinite; }
@keyframes legend-ripple { 0% { transform: scale(.21); opacity: .85; } 80% { transform: scale(1); opacity: 0; } 100% { transform: scale(1); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .legend-pulse { animation: none; transform: scale(.6); opacity: .6; } }
.legend-popup-box { margin: 4px 0 4px 54px; }
.legend-popup { position: relative; display: block; width: fit-content; margin-top: 6px; padding: 5px 7px; border-radius: 2px; background: #6e7788; color: #fff; font: 11px/1.25 "Open Sans", verdana, arial, sans-serif; }
.legend-ico { width: 28px; height: 28px; margin: 0; vertical-align: top; }
.legend-sw:has(.legend-ico) { margin-top: 0; }
@media (max-width: 700px) { .settings-grid { grid-template-columns: 1fr; gap: 14px; } }
.score-link, .score-link:hover { color: inherit; text-decoration: none; cursor: pointer; }
.score-link:hover .score-card { text-decoration: underline; text-decoration-color: rgba(108,117,125,0.5); }

/* Forecast scoring page (pages/scoring.py) */
.sc-page { max-width: 860px; margin: 10px auto 40px; padding: 0 16px; line-height: 1.5; }
.sc-lead { font-size: 1.02rem; }
.sc-h3 { margin: 28px 0 6px; font-size: 1.2rem; }
.sc-note { font-size: 0.85rem; color: #6c757d; margin: 0 0 6px; }
.sc-chart { width: 100%; }
.sc-headline { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 4px; }
.sc-box { border: 1px solid #dee2e6; border-radius: 8px; padding: 10px 14px; background: #fff; min-width: 150px; }
.sc-box-wide { flex: 1 1 260px; }
.sc-k { font-size: 0.8rem; color: #6c757d; }
.sc-v { font-size: 1.6rem; font-weight: 700; }
.sc-ai { color: #2ca02c; }
.sc-nws { color: #1f77b4; }
.sc-verdict { font-size: 0.95rem; margin-top: 4px; }
.sc-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin: 30px 0 10px; }
.sc-card { background: #f4f6f8; border: 1px solid #e3e7eb; border-radius: 8px; padding: 12px 14px; font-size: 0.85rem; line-height: 1.45; }
.sc-card h4 { font-size: 0.95rem; margin: 0 0 6px; }
.sc-card p, .sc-card ul { margin: 0; }
.sc-card ul { padding-left: 18px; }
.sc-card li { margin-bottom: 4px; }
.sc-takeaways { font-size: 0.92rem; margin: 4px 0 10px; padding-left: 20px; }
.sc-tables-row { display: flex; flex-direction: column; gap: 14px; }
.sc-tbl-wrap { overflow-x: auto; max-width: 640px; }
.sc-tbl-wrap h4 { font-size: 0.95rem; margin: 6px 0; }
.sc-table { border-collapse: collapse; font-size: 0.82rem; width: 100%; }
.sc-table th, .sc-table td { padding: 4px 8px; border-bottom: 1px solid #e5e7eb; text-align: right; white-space: nowrap; }
.sc-table th:first-child, .sc-table td:first-child { text-align: left; }
.sc-table thead th { background: #f4f6f8; font-weight: 600; text-align: center; }
.sc-table td.sc-win { font-weight: 700; }
