/* ==============================================================================
   Jäätutka - Google Material 3 (M3) Light Ice Design System
   material_style.css - Tuotantovalmis M3-teematyylitiedosto
   ============================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,300;0,400;0,500;0,700;1,400&family=Roboto+Mono:wght@400;500;700&display=swap');

/* ==============================================================================
   1. M3 DESIGN TOKENS (LIGHT ICE SYSTEM)
   ============================================================================== */
:root {
  color-scheme: light;
  /* M3 Light Ice Core Surface Tokens */
  --md-sys-color-surface: #F6FAFD;
  --md-sys-color-surface-dim: #E6EEF4;
  --md-sys-color-surface-bright: #FFFFFF;
  --md-sys-color-surface-container-lowest: #FFFFFF;
  --md-sys-color-surface-container-low: #F0F5F9;
  --md-sys-color-surface-container: #EAF0F5;
  --md-sys-color-surface-container-high: #E4EBF1;
  --md-sys-color-surface-container-highest: #DCE5ED;

  /* Typography & On-Surface Tokens */
  --md-sys-color-on-surface: #0B1C2C;
  --md-sys-color-on-surface-variant: #3F4F5E;
  --md-sys-color-outline: #6B7B89;
  --md-sys-color-outline-variant: #C3CFDA;

  /* Primary Palette (Jäänhohto syaaninsininen) */
  --md-sys-color-primary: #0B2545;
  --md-sys-color-on-primary: #FFFFFF;
  --md-sys-color-primary-container: #D2E6FF;
  --md-sys-color-on-primary-container: #0B2545;

  /* Secondary Palette (Harmaansininen jääsumu) */
  --md-sys-color-secondary: #00638F;
  --md-sys-color-on-secondary: #FFFFFF;
  --md-sys-color-secondary-container: #C9E7FF;
  --md-sys-color-on-secondary-container: #003B57;

  /* Tertiary Palette (Syvänsininen vesi) */
  --md-sys-color-tertiary: #B33F10;
  --md-sys-color-on-tertiary: #FFFFFF;
  --md-sys-color-tertiary-container: #FFDBCF;
  --md-sys-color-on-tertiary-container: #5A1C00;

  /* Error Palette (M3 Standard Error Tokens) */
  --md-sys-color-error: #BA1A1A;
  --md-sys-color-on-error: #FFFFFF;
  --md-sys-color-error-container: #FFDAD6;
  --md-sys-color-on-error-container: #410002;

  /* Semanttiset Jäänpaksuusvärit & Indikaattorit */
  --ice-safe: #1B7F46;               /* Kantava teräsjää >= 10 cm (M3 Green 80) */
  --ice-safe-container: rgba(27, 127, 70, 0.12);
  --ice-safe-on-container: #0F4D2A;
  --ice-safe-border: rgba(27, 127, 70, 0.4);

  --ice-mid: #00638F;                /* Varoen luisteltava 5–10 cm (M3 Cyan 80) */
  --ice-mid-container: rgba(0, 99, 143, 0.12);
  --ice-mid-on-container: #003B57;
  --ice-mid-border: rgba(0, 99, 143, 0.4);

  --ice-thin: #C2410C;               /* Ohut jää < 5 cm (M3 Soft Coral 80) */
  --ice-thin-container: rgba(194, 65, 12, 0.12);
  --ice-thin-on-container: #7A2706;
  --ice-thin-border: rgba(194, 65, 12, 0.4);

  --ice-hazard: #C62828;             /* Vaaranpaikka / virtapaikka / sula (M3 Bright Red 70) */
  --ice-hazard-container: rgba(198, 40, 40, 0.12);
  --ice-hazard-on-container: #7F1414;
  --ice-hazard-border: rgba(198, 40, 40, 0.5);

  /* M3 Shape Tokens */
  --md-shape-corner-none: 0px;
  --md-shape-corner-extra-small: 4px;
  --md-shape-corner-small: 8px;
  --md-shape-corner-medium: 12px;
  --md-shape-corner-large: 16px;
  --md-shape-corner-extra-large: 28px;
  --md-shape-corner-full: 9999px;

  /* Glassmorphism & Elevation */
  --glass-bg: rgba(255, 255, 255, 0.88);
  --glass-bg-high: rgba(255, 255, 255, 0.94);
  --glass-bg-low: rgba(255, 255, 255, 0.8);
  --glass-border: 1px solid rgba(11, 37, 69, 0.14);
  --glass-border-subtle: 1px solid rgba(11, 37, 69, 0.08);
  --glass-blur: blur(14px);
  --glass-blur-sm: blur(8px);

  /* M3 Unified Map Overlay Translucent Glass Tokens (72% surface-container-low + 8px blur) */
  --m3-map-glass-bg-fallback: rgba(240, 245, 249, 0.72);
  --m3-map-glass-bg: color-mix(in srgb, var(--md-sys-color-surface-container-low) 72%, transparent);
  --m3-map-glass-bg-elevated-fallback: rgba(240, 245, 249, 0.82);
  --m3-map-glass-bg-elevated: color-mix(in srgb, var(--md-sys-color-surface-container-low) 82%, transparent);
  --m3-map-glass-border-fallback: rgba(11, 37, 69, 0.14);
  --m3-map-glass-border: color-mix(in srgb, var(--md-sys-color-outline-variant) 68%, transparent);
  --m3-map-glass-backdrop: var(--glass-blur-sm) saturate(1.12);
  --m3-map-glass-shadow: var(--md-sys-elevation-level2);

  /* M3 State Layer Opacities */
  --md-sys-state-hover-opacity: 0.08;
  --md-sys-state-focus-opacity: 0.12;
  --md-sys-state-pressed-opacity: 0.12;
  --md-sys-state-dragged-opacity: 0.16;

  /* M3 Tonal Elevations */
  --md-elevation-1: 0 1px 3px 1px rgba(11, 37, 69, 0.10), 0 1px 2px 0 rgba(11, 37, 69, 0.14);
  --md-elevation-2: 0 2px 6px 2px rgba(11, 37, 69, 0.10), 0 1px 2px 0 rgba(11, 37, 69, 0.16);
  --md-elevation-3: 0 4px 14px 3px rgba(11, 37, 69, 0.12), 0 1px 3px 0 rgba(11, 37, 69, 0.16);
  --md-elevation-4: 0 6px 20px 4px rgba(11, 37, 69, 0.14), 0 2px 4px 0 rgba(11, 37, 69, 0.18);
  --md-sys-elevation-level0: none;
  --md-sys-elevation-level1: var(--md-elevation-1);
  --md-sys-elevation-level2: var(--md-elevation-2);
  --md-sys-elevation-level3: var(--md-elevation-3);
  --md-sys-elevation-level4: var(--md-elevation-4);
  --md-sys-elevation-level5: 0 8px 24px 6px rgba(11, 37, 69, 0.16), 0 4px 8px 0 rgba(11, 37, 69, 0.2);

  /* M3 Motion & Transitions */
  --md-sys-motion-easing-standard: cubic-bezier(0.2, 0.0, 0, 1.0);
  --md-sys-motion-easing-emphasized: cubic-bezier(0.05, 0.7, 0.1, 1.0);
  --md-sys-motion-duration-short: 150ms;
  --md-sys-motion-duration-medium: 250ms;
  --md-sys-motion-duration-long: 350ms;

  /* Safe Area & Layout */
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  --m3-nav-height: 80px;
  --m3-header-height: 0px;
  --font-family: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono: 'Roboto Mono', monospace;
}

/* ==============================================================================
   2. GLOBAL RESET & BASE RULES
   ============================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--md-sys-color-surface);
  color: var(--md-sys-color-on-surface);
  font-family: var(--font-family);
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: 0.15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Kosketusalueiden perussääntö (vähintään 48x48px esteettömyysstandardi) */
button, input, select, a, [role="button"]:not(.material-symbols-outlined) {
  font-family: inherit;
  touch-action: manipulation;
}

.material-symbols-outlined,
[role="button"].material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  touch-action: manipulation;
}

:focus-visible {
  outline: 2px solid var(--md-sys-color-primary);
  outline-offset: 2px;
}

/* ==============================================================================
   2.5 M3 SPLASH SCREEN (Cold Start / Warmup Experience - M3 Light Ice)
   ============================================================================== */
.m3-splash-screen {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: radial-gradient(circle at 50% 34%, #FFFFFF 0%, #EAF4FF 52%, #F6FAFD 100%);
  color: var(--md-sys-color-on-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  opacity: 1;
  visibility: visible;
  transition:
    opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0.55s;
  user-select: none;
}

.m3-splash-screen.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(1.015);
}

.m3-splash-backdrop-hex {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='98' viewBox='0 0 56 98'%3E%3Cg fill='none' stroke='%2300638F' stroke-width='1' stroke-opacity='0.07'%3E%3Cpath d='M28 66L0 50L0 16L28 0L56 16L56 50L28 66L28 100'/%3E%3Cpath d='M0 50L28 66L56 50L56 84L28 100L0 84Z'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 56px 98px;
  -webkit-mask-image: radial-gradient(circle at 50% 42%, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.35) 48%, transparent 78%);
  mask-image: radial-gradient(circle at 50% 42%, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.35) 48%, transparent 78%);
}

.m3-splash-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 28px 24px;
  max-width: 440px;
  width: 100%;
  animation: m3SplashPop 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.m3-splash-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  border: 1px solid rgba(0, 99, 143, 0.16);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.65px;
  text-transform: uppercase;
  padding: 5px 13px;
  border-radius: 999px;
  margin-bottom: 20px;
}

.m3-splash-radar-stage {
  position: relative;
  width: 148px;
  height: 148px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.m3-splash-ring {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.m3-splash-ring-outer {
  width: 144px;
  height: 144px;
  border: 1px dashed rgba(0, 99, 143, 0.26);
  animation: m3HexPulse 3.2s ease-in-out infinite;
}

.m3-splash-ring-mid {
  width: 116px;
  height: 116px;
  border: 1.5px solid rgba(0, 166, 251, 0.25);
  box-shadow: 0 0 26px rgba(128, 227, 255, 0.38);
  animation: m3HexPulse 3.2s ease-in-out infinite 0.9s;
}

.m3-splash-radar-sweep {
  position: absolute;
  width: 136px;
  height: 136px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    rgba(0, 166, 251, 0) 0deg,
    rgba(0, 166, 251, 0.03) 230deg,
    rgba(0, 166, 251, 0.22) 340deg,
    rgba(128, 227, 255, 0.42) 360deg
  );
  -webkit-mask-image: radial-gradient(circle, transparent 35%, #000 37%, #000 69%, transparent 71%);
  mask-image: radial-gradient(circle, transparent 35%, #000 37%, #000 69%, transparent 71%);
  animation: m3RadarSweep 3.4s linear infinite;
}

.m3-splash-logo-container {
  position: relative;
  z-index: 2;
  width: 92px;
  height: 92px;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(11, 37, 69, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 12px 30px rgba(11, 37, 69, 0.10),
    0 2px 6px rgba(0, 99, 143, 0.08);
}

.m3-splash-logo {
  width: 68px;
  height: 68px;
  object-fit: contain;
}

.m3-splash-title {
  margin: 0 0 6px 0;
  font-size: 32px;
  font-weight: 900;
  color: var(--md-sys-color-primary);
  letter-spacing: -0.6px;
  line-height: 1.12;
}

.m3-splash-lead {
  margin: 0 0 5px 0;
  font-size: 16.5px;
  font-weight: 700;
  color: var(--md-sys-color-on-surface);
  letter-spacing: -0.15px;
  line-height: 1.32;
}

.m3-splash-subtitle {
  margin: 0 0 18px 0;
  font-size: 13.5px;
  color: var(--md-sys-color-on-surface-variant);
  line-height: 1.45;
  max-width: 340px;
}

.m3-splash-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
  margin: 0 0 24px 0;
}

.m3-splash-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  border-radius: 999px;
  background: #FFFFFF;
  border: 1px solid var(--md-sys-color-outline-variant);
  color: var(--md-sys-color-primary);
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(11, 37, 69, 0.04);
}

.m3-splash-pill.is-safe {
  background: #E6F4EA;
  border-color: rgba(27, 127, 70, 0.32);
  color: var(--ice-safe-on-container);
}

.m3-splash-loader {
  width: 100%;
  max-width: 250px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
}

.m3-splash-progress-track {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: var(--md-sys-color-surface-container-highest);
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 1px 2px rgba(11, 37, 69, 0.08);
}

.m3-splash-progress-bar {
  height: 100%;
  width: 18%;
  border-radius: 999px;
  background: linear-gradient(90deg, #00A6FB 0%, #00638F 48%, #0B2545 80%, #1B7F46 100%);
  transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.m3-splash-status {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--md-sys-color-on-surface-variant);
  letter-spacing: 0.1px;
}

@keyframes m3SplashPop {
  0% { transform: translateY(8px) scale(0.96); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes m3RadarSweep {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes m3HexPulse {
  0%, 100% { transform: scale(0.97); opacity: 0.65; }
  50% { transform: scale(1.04); opacity: 1; }
}

@keyframes m3Spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .m3-splash-radar-sweep,
  .m3-splash-ring-outer,
  .m3-splash-ring-mid,
  .m3-splash-content {
    animation: none !important;
  }
}

/* ==============================================================================
   3. NÄKYMÄT JA PERUSRUNKO (.m3-desktop-header, .m3-view, #viewMap, #map)
   ============================================================================== */
.m3-desktop-header {
  display: none;
}

@media (min-width: 769px) {
  :root {
    --m3-header-height: 58px;
  }

  .m3-desktop-header {
    display: block;
    position: sticky;
    top: 0;
    z-index: 1100;
    height: var(--m3-header-height);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
  }

  .m3-desktop-header-bar {
    max-width: 1080px;
    height: 100%;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .m3-desktop-brand-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--md-sys-color-primary);
    text-decoration: none;
    font-weight: 800;
    font-size: 19px;
    line-height: 1;
  }

  .m3-desktop-brand-link img {
    width: 34px;
    height: 34px;
    display: block;
  }

  .m3-desktop-nav-links {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 14px;
  }

  .m3-desktop-esittely-link {
    color: var(--md-sys-color-secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 14.5px;
    transition: color 0.15s ease;
  }

  .m3-desktop-esittely-link:hover,
  .m3-desktop-esittely-link:focus-visible {
    color: var(--md-sys-color-primary);
    text-decoration: underline;
  }
}

.m3-view {
  position: relative;
  width: 100%;
  height: calc(100vh - var(--m3-nav-height) - var(--m3-header-height, 0px));
  height: calc(100dvh - var(--m3-nav-height) - var(--m3-header-height, 0px));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background-color: var(--md-sys-color-surface);
  contain: layout style paint;
}

#viewMap,
.m3-view-map {
  position: relative;
  width: 100%;
  height: calc(100vh - var(--m3-nav-height) - var(--m3-header-height, 0px));
  height: calc(100dvh - var(--m3-nav-height) - var(--m3-header-height, 0px));
  overflow: hidden;
  background-color: var(--md-sys-color-surface-dim);
  contain: strict;
}

#viewStats {
  position: relative;
  width: 100%;
  height: calc(100vh - var(--m3-nav-height) - var(--m3-header-height, 0px));
  height: calc(100dvh - var(--m3-nav-height) - var(--m3-header-height, 0px));
  overflow: hidden;
  background-color: var(--md-sys-color-surface-dim);
  contain: style;
}

.m3-view-scroll-content {
  padding: 16px 16px calc(var(--m3-nav-height) + 36px) 16px;
  max-width: 920px;
  margin: 0 auto;
  min-height: 100%;
}

#map {
  width: 100%;
  height: 100%;
  z-index: 1;
  background-color: #E6EEF4;
  transform: translateZ(0);
  will-change: transform;
}

/* Leaflet Karttapohjan Dark Ice -mukautukset & GPU-kompositointi */
.leaflet-container {
  background: #E6EEF4 !important;
  font-family: var(--font-family) !important;
  transform: translateZ(0);
}

.leaflet-pane,
.leaflet-map-pane,
.leaflet-tile-pane,
.leaflet-overlay-pane,
.leaflet-canvas-container,
.leaflet-zoom-animated {
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* Ulkoisen näytön / ChromeOS:n murtolukuskaalauksen (esim. DPR 0.8, 0.9, 1.2, 1.25, 1.5)
   tiilisaumojen ja Leaflet 1.9.4 plus-lighter -valkoisen ruudukon poisto.
   Kokonaisluku-DPR:llä (esim. 1.0 tai 2.0 Chromebookin omalla näytöllä) sääntö ei ole aktiivinen. */
html.is-fractional-dpr .leaflet-container img.leaflet-tile {
  mix-blend-mode: normal !important;
  width: calc(256px + var(--m3-tile-overlap-px, 1px)) !important;
  height: calc(256px + var(--m3-tile-overlap-px, 1px)) !important;
}

.leaflet-overlay-pane svg path.leaflet-interactive {
  shape-rendering: crispEdges;
}

@media (display-mode: standalone) {
  html, body, #viewMap, #map, #viewStats, #statsMapCanvas {
    overscroll-behavior: none;
  }
}

.leaflet-bar {
  border: 1px solid var(--m3-map-glass-border-fallback) !important;
  border-color: var(--m3-map-glass-border) !important;
  border-radius: var(--md-shape-corner-medium) !important;
  overflow: hidden;
  box-shadow: var(--m3-map-glass-shadow) !important;
  background: var(--m3-map-glass-bg-fallback) !important;
  background: var(--m3-map-glass-bg) !important;
  backdrop-filter: var(--m3-map-glass-backdrop);
  -webkit-backdrop-filter: var(--m3-map-glass-backdrop);
}

.leaflet-bar a {
  background-color: transparent !important;
  color: var(--md-sys-color-primary) !important;
  border-bottom: 1px solid rgba(11, 37, 69, 0.08) !important;
  width: 44px !important;
  height: 44px !important;
  line-height: 44px !important;
  font-size: 18px !important;
  transition: background-color var(--md-sys-motion-duration-short) ease;
}

.leaflet-bar a:hover {
  background-color: rgba(0, 99, 143, 0.10) !important;
  color: var(--md-sys-color-on-surface) !important;
}

#viewMap .leaflet-control-attribution,
#viewStats .leaflet-control-attribution {
  background: var(--m3-map-glass-bg-fallback) !important;
  background: var(--m3-map-glass-bg) !important;
  backdrop-filter: var(--m3-map-glass-backdrop);
  -webkit-backdrop-filter: var(--m3-map-glass-backdrop);
  border-top: 1px solid var(--m3-map-glass-border-fallback);
  border-left: 1px solid var(--m3-map-glass-border-fallback);
  border-color: var(--m3-map-glass-border);
  border-radius: 8px 0 0 0;
  padding: 2px 7px;
  font-size: 10px;
  color: var(--md-sys-color-on-surface-variant);
}

/* Leaflet Popupit M3 Light Ice -lasikorttina */
.leaflet-popup-content-wrapper {
  background: var(--m3-map-glass-bg-fallback) !important;
  background: var(--m3-map-glass-bg) !important;
  backdrop-filter: var(--m3-map-glass-backdrop) !important;
  -webkit-backdrop-filter: var(--m3-map-glass-backdrop) !important;
  border: 1px solid var(--m3-map-glass-border-fallback) !important;
  border-color: var(--m3-map-glass-border) !important;
  border-radius: var(--md-shape-corner-large) !important;
  color: var(--md-sys-color-on-surface) !important;
  box-shadow: var(--m3-map-glass-shadow) !important;
  padding: 4px;
}

.leaflet-popup-tip {
  background: var(--m3-map-glass-bg-fallback) !important;
  background: var(--m3-map-glass-bg) !important;
}

.leaflet-popup-content {
  margin: 12px 14px !important;
  font-size: 13px !important;
  line-height: 1.4 !important;
}

/* Leaflet Solu-Tooltip / Karttaklikkauskortti (.hex-tooltip) */
.hex-tooltip,
.leaflet-tooltip.hex-tooltip {
  width: max-content !important;
  min-width: 260px !important;
  max-width: min(360px, calc(100vw - 24px)) !important;
  white-space: normal !important;
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
  font-size: 13px !important;
  line-height: 1.5 !important;
  padding: 10px 14px !important;
  border-radius: 12px !important;
  box-shadow: var(--m3-map-glass-shadow) !important;
  background: var(--m3-map-glass-bg-fallback) !important;
  background: var(--m3-map-glass-bg) !important;
  backdrop-filter: var(--m3-map-glass-backdrop) !important;
  -webkit-backdrop-filter: var(--m3-map-glass-backdrop) !important;
  color: #0B1C2C !important;
  border: 1px solid var(--m3-map-glass-border-fallback) !important;
  border-color: var(--m3-map-glass-border) !important;
  pointer-events: auto !important;
}

@media (min-width: 500px) {
  .hex-tooltip,
  .leaflet-tooltip.hex-tooltip {
    max-width: 400px !important;
    font-size: 13.5px !important;
    padding: 12px 16px !important;
  }
}

.hex-tooltip-content {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.hex-tooltip-title {
  font-weight: 700;
  font-size: 13.5px;
  color: #0B2545;
  margin-bottom: 3px;
  padding-bottom: 3px;
  border-bottom: 1px solid rgba(11, 37, 69, 0.08);
}

.hex-tooltip-hazard {
  color: #C62828;
  font-weight: 600;
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px dashed rgba(198, 40, 40, 0.25);
  line-height: 1.4;
}

/* ==============================================================================
   4. KELLUVAT LÄPIKUULTAVAT LASIMAISET KOMPONENTIT
   ============================================================================== */

/* 4.0 KARTTAKERROKSET - PÄÄLLEKKÄISYYDEN ESTÄVÄT FLEX-PINOT */
.m3-map-top-overlay {
  position: absolute;
  top: 12px;
  left: 0;
  right: 0;
  margin-left: auto;
  margin-right: auto;
  width: calc(100% - 24px);
  max-width: 520px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 1000;
  pointer-events: none;
}

.m3-map-bottom-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 1000;
  pointer-events: none;
}

/* 4.0b ALAPALKKIIN SULAUTUVA TELAKKA (.m3-map-bottom-dock) */
.m3-map-bottom-dock {
  width: 100%;
  display: flex;
  flex-direction: column;
  pointer-events: auto;
  background: var(--m3-map-glass-bg-fallback);
  background: var(--m3-map-glass-bg);
  backdrop-filter: var(--m3-map-glass-backdrop);
  -webkit-backdrop-filter: var(--m3-map-glass-backdrop);
  border-top: 1px solid var(--m3-map-glass-border-fallback);
  border-top-color: var(--m3-map-glass-border);
  box-shadow: 0 -2px 10px rgba(11, 37, 69, 0.08);
  user-select: none;
  transform: translateZ(0);
  will-change: transform;
  contain: layout style;
}

/* 4.0c VASEMMAN LAIDAN KIINTEÄKORKUINEN KERROSPROFIILIPALKKI (#mapCellProfileBar) */
.m3-cell-profile-bar {
  position: absolute;
  left: 12px;
  top: 118px;
  width: 168px;
  height: 264px;
  min-height: 264px;
  max-height: 264px;
  z-index: 950;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px;
  overflow: hidden;
  background: var(--m3-map-glass-bg-fallback);
  background: var(--m3-map-glass-bg);
  backdrop-filter: var(--glass-blur-sm) saturate(1.12);
  -webkit-backdrop-filter: var(--glass-blur-sm) saturate(1.12);
  border: 1px solid var(--m3-map-glass-border-fallback);
  border-color: var(--m3-map-glass-border);
  border-radius: 14px;
  box-shadow: var(--m3-map-glass-shadow);
  pointer-events: auto;
  user-select: none;
  touch-action: none;
  cursor: grab;
  outline: none;
  contain: strict;
  transition:
    width var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-standard),
    padding var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-standard),
    background-color var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-standard),
    border-color var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-standard),
    box-shadow var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard);
}

.m3-cell-profile-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--md-sys-color-primary);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--md-sys-motion-duration-short) ease;
}

.m3-cell-profile-bar:hover:not(.is-dragging)::after {
  opacity: 0.035;
}

.m3-cell-profile-bar:focus-visible {
  box-shadow: 0 0 0 2px var(--md-sys-color-primary), var(--md-sys-elevation-level3);
}

.m3-cell-profile-bar.is-dragging {
  cursor: grabbing;
  transition: none !important;
  box-shadow: var(--md-sys-elevation-level4);
  border-color: rgba(11, 37, 69, 0.34);
  border-color: color-mix(in srgb, var(--md-sys-color-primary) 34%, transparent);
}

.m3-cell-profile-bar.is-dragging::after {
  opacity: 0.08;
}

.m3-cell-profile-header {
  flex: 0 0 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(11, 37, 69, 0.09);
  box-sizing: border-box;
}

.m3-cell-profile-date {
  font-size: 10.5px;
  font-weight: 700;
  color: #0B2545;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.m3-cell-profile-bearing {
  font-size: 9px;
  font-weight: 700;
  line-height: 1.2;
  padding: 1.5px 5px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
  background: #e0f2fe;
  color: #0369a1;
}

.m3-cell-profile-bearing.is-safe,
.m3-cell-profile-bearing.is-strong {
  background: #d1fae5;
  color: #065f46;
}

.m3-cell-profile-bearing.is-walk,
.m3-cell-profile-bearing.is-walkable {
  background: #dbeafe;
  color: #1e40af;
}

.m3-cell-profile-bearing.is-weak {
  background: #fef3c7;
  color: #92400e;
}

.m3-cell-profile-bearing.is-open,
.m3-cell-profile-bearing.is-open-water {
  background: #e0f2fe;
  color: #0369a1;
}

.m3-cell-profile-body {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  align-items: stretch;
  gap: 8px;
}

/* Poikkileikkausputki: 28% Ilma + 37% Lumi&Jää + 35% Vesi = 100% */
.m3-cell-profile-column {
  flex: 0 0 28px;
  width: 28px;
  height: 100%;
  border-radius: 9px;
  border: 1px solid rgba(11, 37, 69, 0.22);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  background: rgba(240, 249, 255, 0.74);
  box-shadow: inset 0 1px 3px rgba(11, 37, 69, 0.10);
  box-sizing: border-box;
}

.m3-cell-zone-air {
  flex: 0 0 28%;
  height: 28%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px dashed rgba(14, 116, 144, 0.24);
  background: linear-gradient(180deg, #bae6fd 0%, #e0f2fe 100%);
  color: #0369a1;
  box-sizing: border-box;
}

.m3-cell-zone-air.is-severe-cold {
  background: linear-gradient(180deg, #93c5fd 0%, #dbeafe 100%);
  color: #1d4ed8;
}

.m3-cell-zone-air.is-thaw,
.m3-cell-zone-air.is-above-zero {
  background: linear-gradient(180deg, #fde68a 0%, #f1f5f9 100%);
  color: #b45309;
}

.m3-cell-weather-glyph {
  font-size: 18px;
  line-height: 1;
}

.m3-cell-zone-surface {
  flex: 0 0 37%;
  height: 37%;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: linear-gradient(180deg, rgba(240, 249, 255, 0.62) 0%, rgba(248, 250, 252, 0.70) 100%);
  overflow: hidden;
  box-sizing: border-box;
}

.m3-cell-surface-stack {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.m3-cell-bar-snow {
  width: 100%;
  background: #ffffff;
  box-shadow: inset 0 1px 0 #cbd5e1, inset 0 -1px 0 #e2e8f0;
  transition: height 0.18s ease;
  flex-shrink: 0;
}

.m3-cell-bar-snowice {
  width: 100%;
  background: repeating-linear-gradient(
    -45deg,
    #93c5fd 0px,
    #93c5fd 2.5px,
    #e0f2fe 2.5px,
    #e0f2fe 5px
  );
  box-shadow: inset 0 -1px 0 rgba(2, 132, 199, 0.30);
  transition: height 0.18s ease;
  flex-shrink: 0;
}

.m3-cell-bar-steel {
  width: 100%;
  background: linear-gradient(180deg, #38bdf8 0%, #0284c7 45%, #0369a1 100%);
  transition: height 0.18s ease;
  flex-shrink: 0;
}

.m3-cell-profile-waterline {
  position: relative;
  height: 0;
  width: 100%;
  border-top: 1.5px solid rgba(12, 74, 110, 0.65);
  z-index: 3;
}

.m3-cell-profile-waterline span {
  position: absolute;
  left: 50%;
  top: -6px;
  transform: translateX(-50%);
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  color: #0c4a6e;
  background: rgba(240, 249, 255, 0.92);
  padding: 0 2px;
  border-radius: 3px;
}

.m3-cell-zone-water {
  flex: 0 0 35%;
  height: 35%;
  display: flex;
  flex-direction: column;
  width: 100%;
  overflow: hidden;
  position: relative;
  box-sizing: border-box;
}

.m3-cell-bar-water {
  width: 100%;
  background: linear-gradient(180deg, #075985 0%, #0c4a6e 60%, #082f49 100%);
  transition: height 0.18s ease;
  position: relative;
  flex-shrink: 0;
}

.m3-cell-bar-water.is-hazard {
  background-image:
    repeating-linear-gradient(
      -30deg,
      rgba(239, 68, 68, 0.48) 0px,
      rgba(239, 68, 68, 0.48) 3px,
      transparent 3px,
      transparent 6px
    ),
    linear-gradient(180deg, #075985 0%, #082f49 100%);
  box-shadow: inset 0 0 0 1.5px rgba(239, 68, 68, 0.85);
}

.m3-cell-bar-bed {
  width: 100%;
  background: linear-gradient(180deg, #64748b 0%, #475569 100%);
  border-top: 1.5px solid #94a3b8;
  transition: height 0.18s ease;
  flex-shrink: 0;
  box-sizing: border-box;
}

/* Lukuarvosarake: samat 28% / 37% / 35% osuudet */
.m3-cell-profile-readouts {
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.m3-cell-readout-group {
  min-width: 0;
  box-sizing: border-box;
}

.m3-readout-air {
  flex: 0 0 28%;
  height: 28%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.5px;
  border-bottom: 1px dashed rgba(11, 37, 69, 0.09);
}

.m3-readout-surface {
  flex: 0 0 37%;
  height: 37%;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  border-bottom: 1px solid rgba(12, 74, 110, 0.16);
}

.m3-readout-water {
  flex: 0 0 35%;
  height: 35%;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
}

.m3-cell-air-temp-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.m3-cell-val-temp {
  font-size: 13px;
  font-weight: 800;
  color: #0369a1;
  line-height: 1.1;
  white-space: nowrap;
}

.m3-cell-val-temp.is-thaw,
.m3-cell-val-temp.is-above-zero {
  color: #b45309;
}

.m3-cell-air-subrow {
  display: flex;
  align-items: center;
  min-height: 13px;
}

.m3-cell-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 600;
  color: #475569;
  line-height: 1.1;
  white-space: nowrap;
}

.m3-cell-profile-bar .material-symbols-outlined {
  width: 1em;
  height: 1em;
  overflow: hidden;
  flex-shrink: 0;
}

.m3-cell-meta-chip .material-symbols-outlined {
  font-size: 12px;
  color: #0284c7;
}

.m3-cell-meta-chip.is-precip {
  color: #0369a1;
}

.m3-cell-layer-row {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  line-height: 1.15;
  white-space: nowrap;
}

.m3-cell-layer-row.is-zero {
  opacity: 0.48;
}

.m3-layer-dot {
  width: 6px;
  height: 6px;
  border-radius: 2px;
  flex-shrink: 0;
}

.m3-layer-dot.dot-snow {
  background: #ffffff;
  border: 1px solid #94a3b8;
  box-sizing: border-box;
}

.m3-layer-dot.dot-snowice {
  background: #93c5fd;
  border: 1px solid #38bdf8;
  box-sizing: border-box;
}

.m3-layer-dot.dot-steel {
  background: #0284c7;
}

.m3-layer-dot.dot-water {
  background: #0c4a6e;
}

.m3-layer-lbl {
  color: #475569;
  font-weight: 500;
}

.m3-layer-val {
  margin-left: auto;
  font-weight: 700;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}

.m3-layer-val.is-primary {
  color: #0369a1;
}

.m3-cell-hazard-slot {
  min-height: 18px;
  display: flex;
  align-items: center;
  min-width: 0;
}

.m3-cell-hazard-badge {
  display: inline-flex;
  align-items: flex-start;
  gap: 3px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 2px 5px;
  border-radius: 5px;
  background: rgba(220, 38, 38, 0.12);
  border: 1px solid rgba(220, 38, 38, 0.28);
  color: #b91c1c;
  font-size: 9.5px;
  font-weight: 700;
  line-height: 1.2;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.m3-cell-hazard-badge .material-symbols-outlined {
  font-size: 12px;
  flex-shrink: 0;
  margin-top: 0.5px;
}

#cellProfileHazardText {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* M3 kavennettu läpikuultotila (.m3-cell-profile-bar.is-compact) */
.m3-cell-profile-bar.is-compact {
  width: 108px;
  padding: 8px 6px;
  background: rgba(240, 245, 249, 0.72);
  background: color-mix(in srgb, var(--md-sys-color-surface-container-low) 72%, transparent);
  backdrop-filter: var(--glass-blur-sm) saturate(1.12);
  -webkit-backdrop-filter: var(--glass-blur-sm) saturate(1.12);
  border-color: rgba(11, 37, 69, 0.14);
  border-color: color-mix(in srgb, var(--md-sys-color-outline-variant) 68%, transparent);
  box-shadow: var(--md-sys-elevation-level2);
}

.m3-cell-profile-bar.is-compact .m3-cell-profile-body {
  gap: 5px;
}

.m3-cell-profile-bar.is-compact .m3-cell-profile-column {
  flex: 0 0 24px;
  width: 24px;
  background: rgba(240, 249, 255, 0.74);
}

.m3-cell-profile-bar.is-compact .m3-cell-zone-surface {
  background: linear-gradient(180deg, rgba(240, 249, 255, 0.62) 0%, rgba(248, 250, 252, 0.70) 100%);
}

.m3-cell-profile-bar.is-compact .m3-layer-lbl,
.m3-cell-profile-bar.is-compact #cellProfileHazardText {
  display: none;
}

.m3-cell-profile-bar.is-compact .m3-cell-profile-bearing {
  width: 8px;
  height: 8px;
  padding: 0;
  font-size: 0;
  color: transparent;
  overflow: hidden;
  background: #0284c7;
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.85);
}

.m3-cell-profile-bar.is-compact .m3-cell-profile-bearing.is-safe,
.m3-cell-profile-bar.is-compact .m3-cell-profile-bearing.is-strong {
  background: var(--ice-safe);
}

.m3-cell-profile-bar.is-compact .m3-cell-profile-bearing.is-walk,
.m3-cell-profile-bar.is-compact .m3-cell-profile-bearing.is-walkable {
  background: var(--ice-mid);
}

.m3-cell-profile-bar.is-compact .m3-cell-profile-bearing.is-weak {
  background: var(--ice-thin);
}

.m3-cell-profile-bar.is-compact .m3-cell-profile-bearing.is-open,
.m3-cell-profile-bar.is-compact .m3-cell-profile-bearing.is-open-water {
  background: #0284c7;
}

.m3-cell-profile-bar.is-compact .m3-cell-val-temp {
  font-size: 11.5px;
}

.m3-cell-profile-bar.is-compact .m3-cell-meta-chip {
  font-size: 9.5px;
  gap: 2px;
  color: #1e293b;
}

.m3-cell-profile-bar.is-compact .m3-cell-meta-chip .material-symbols-outlined {
  font-size: 11px;
}

.m3-cell-profile-bar.is-compact .m3-cell-layer-row {
  font-size: 10px;
  gap: 3px;
}

.m3-cell-profile-bar.is-compact .m3-cell-hazard-badge {
  width: auto;
  padding: 2px 4px;
}

/* M3 kolmas tila: Erittäin tiivis, taustaton ja reunakiinnitteinen (.m3-cell-profile-bar.is-minimal) */
.m3-cell-profile-bar.is-minimal {
  left: 2px;
  width: 66px;
  padding: 4px 2px;
  gap: 3px;
  overflow: visible;
  contain: layout style;
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: none !important;
  border-color: transparent !important;
  border-radius: 0;
  box-shadow: none !important;
}

.m3-cell-profile-bar.is-minimal::after {
  display: none !important;
}

.m3-cell-profile-bar.is-minimal .m3-cell-profile-header {
  flex: 0 0 16px;
  height: 16px;
  padding-bottom: 2px;
  gap: 2px;
  border-bottom-color: rgba(11, 37, 69, 0.12);
}

.m3-cell-profile-bar.is-minimal .m3-cell-profile-date {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: -0.2px;
}

.m3-cell-profile-bar.is-minimal .m3-cell-profile-bearing {
  width: 6px;
  height: 6px;
  box-shadow: none;
}

.m3-cell-profile-bar.is-minimal .m3-cell-profile-body {
  gap: 3px;
}

.m3-cell-profile-bar.is-minimal .m3-cell-profile-column {
  flex: 0 0 10px;
  width: 10px;
  border-radius: 5px;
}

.m3-cell-profile-bar.is-minimal .m3-cell-weather-glyph,
.m3-cell-profile-bar.is-minimal .m3-cell-profile-waterline span,
.m3-cell-profile-bar.is-minimal .m3-layer-dot,
.m3-cell-profile-bar.is-minimal .m3-layer-lbl,
.m3-cell-profile-bar.is-minimal .m3-cell-meta-chip .material-symbols-outlined,
.m3-cell-profile-bar.is-minimal #cellProfileHazardText {
  display: none !important;
}

.m3-cell-profile-bar.is-minimal .m3-cell-val-temp {
  font-size: 9.5px;
  letter-spacing: -0.2px;
  white-space: nowrap;
  overflow: visible;
}

.m3-cell-profile-bar.is-minimal .m3-cell-meta-chip {
  font-size: 8.5px;
  gap: 1px;
  letter-spacing: -0.2px;
  white-space: nowrap;
  overflow: visible;
}

.m3-cell-profile-bar.is-minimal .m3-cell-layer-row {
  font-size: 9px;
  gap: 1px;
  letter-spacing: -0.2px;
  white-space: nowrap;
  overflow: visible;
}

.m3-cell-profile-bar.is-minimal .m3-layer-val {
  margin-left: 0;
  white-space: nowrap;
}

.m3-cell-profile-bar.is-minimal .m3-cell-hazard-badge,
.m3-cell-profile-bar.is-minimal .m3-cell-skate-badge {
  width: auto;
  padding: 1px 3px;
  font-size: 8.5px;
  gap: 1.5px;
}

/* Kartan klikatun tarkastelupisteen kohdistinrengas */
.m3-cell-inspect-pin-wrap {
  background: transparent !important;
  border: none !important;
  pointer-events: none !important;
}

.m3-cell-inspect-pin {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2.5px solid #ffffff;
  background: rgba(2, 132, 199, 0.85);
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.55), 0 2px 6px rgba(15, 23, 42, 0.35);
  box-sizing: border-box;
  pointer-events: none;
}

.m3-cell-inspect-pin.is-hazard {
  background: rgba(220, 38, 38, 0.90);
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.55), 0 2px 6px rgba(15, 23, 42, 0.35);
}

@media (max-width: 480px) {
  .m3-cell-profile-bar {
    left: 8px;
    top: 114px;
    width: 152px;
    height: 228px;
    min-height: 228px;
    max-height: 228px;
    padding: 7px 8px;
    gap: 5px;
  }

  .m3-cell-profile-bar.is-compact {
    width: 100px;
    padding: 7px 5px;
  }

  .m3-cell-profile-bar.is-minimal {
    left: 2px;
    width: 60px;
    padding: 3px 1px;
    gap: 2px;
  }

  .m3-cell-profile-bar.is-minimal .m3-cell-profile-column {
    flex: 0 0 9px;
    width: 9px;
  }

  .m3-cell-profile-bar.is-minimal .m3-cell-val-temp {
    font-size: 9px;
  }

  .m3-cell-profile-bar.is-minimal .m3-cell-layer-row {
    font-size: 8.5px;
  }

  .m3-cell-profile-bar.is-minimal .m3-cell-meta-chip {
    font-size: 8px;
  }

  .m3-cell-profile-body {
    gap: 6px;
  }

  .m3-cell-profile-bar.is-compact .m3-cell-profile-body {
    gap: 4px;
  }

  .m3-cell-profile-column {
    flex: 0 0 24px;
    width: 24px;
  }

  .m3-cell-profile-bar.is-compact .m3-cell-profile-column {
    flex: 0 0 21px;
    width: 21px;
  }

  .m3-cell-weather-glyph {
    font-size: 16px;
  }

  .m3-cell-val-temp {
    font-size: 12px;
  }

  .m3-cell-profile-bar.is-compact .m3-cell-val-temp {
    font-size: 11px;
  }

  .m3-cell-layer-row {
    font-size: 10px;
    gap: 3px;
  }

  .m3-cell-profile-bar.is-compact .m3-cell-layer-row {
    font-size: 9.5px;
    gap: 2.5px;
  }

  .m3-cell-meta-chip {
    font-size: 9.5px;
  }

  .m3-cell-profile-bar.is-compact .m3-cell-meta-chip {
    font-size: 9px;
  }
}

/* 4.1 TOP FLOATING SEARCH BAR (.m3-search-bar) */
.m3-search-bar {
  position: relative;
  width: 100%;
  max-width: 520px;
  height: 56px;
  z-index: 1000;
  background: var(--m3-map-glass-bg-fallback);
  background: var(--m3-map-glass-bg);
  backdrop-filter: var(--m3-map-glass-backdrop);
  -webkit-backdrop-filter: var(--m3-map-glass-backdrop);
  border: 1px solid var(--m3-map-glass-border-fallback);
  border-color: var(--m3-map-glass-border);
  border-radius: var(--md-shape-corner-extra-large);
  display: flex;
  align-items: center;
  padding: 0 16px;
  box-shadow: var(--m3-map-glass-shadow);
  pointer-events: auto;
  transition: border-color var(--md-sys-motion-duration-medium) ease,
              box-shadow var(--md-sys-motion-duration-medium) ease,
              background-color var(--md-sys-motion-duration-medium) ease;
}

.m3-search-bar:focus-within {
  border-color: var(--md-sys-color-primary);
  background: var(--m3-map-glass-bg-elevated-fallback);
  background: var(--m3-map-glass-bg-elevated);
  box-shadow: var(--md-sys-elevation-level3), 0 0 12px rgba(0, 99, 143, 0.22);
}

.m3-brand-vision-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  margin-left: -4px;
  margin-right: 6px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color var(--md-sys-motion-duration-short) ease,
              border-color var(--md-sys-motion-duration-short) ease,
              transform var(--md-sys-motion-duration-short) ease;
}

.m3-brand-vision-btn:hover,
.m3-brand-vision-btn:focus-visible {
  background-color: rgba(0, 99, 143, 0.12);
  border-color: rgba(0, 99, 143, 0.28);
  outline: none;
}

.m3-brand-vision-btn:active {
  transform: scale(0.95);
}

.m3-brand-vision-btn .m3-brand-logo {
  margin-right: 0;
}

.m3-brand-info-dot {
  position: absolute;
  right: 0;
  bottom: 1px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--md-sys-color-secondary);
  color: #FFFFFF;
  font-size: 9.5px;
  font-weight: 800;
  font-style: italic;
  font-family: Georgia, serif;
  line-height: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #FFFFFF;
  box-shadow: 0 1px 3px rgba(11, 37, 69, 0.25);
  pointer-events: none;
}

.m3-search-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--md-sys-color-primary);
  margin-right: 12px;
  flex-shrink: 0;
  user-select: none;
}

.m3-search-icon[role="button"] {
  font-family: 'Material Symbols Outlined';
  cursor: pointer;
  width: 32px;
  height: 32px;
  margin-left: -4px;
  margin-right: 8px;
  border-radius: var(--md-shape-corner-full);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.m3-search-icon[role="button"]:hover {
  background: rgba(0, 99, 143, 0.10);
}

.m3-search-icon[role="button"]:active {
  background: rgba(0, 99, 143, 0.18);
}

.m3-search-input {
  flex: 1;
  height: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--md-sys-color-on-surface);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0.1px;
}

.m3-search-input::placeholder {
  color: var(--md-sys-color-on-surface-variant);
  opacity: 0.8;
}

.m3-search-clear,
.m3-search-layers {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  background: transparent;
  border: none;
  color: var(--md-sys-color-on-surface-variant);
  font-size: 18px;
  border-radius: 50%;
  cursor: pointer;
  margin-right: -4px;
  position: relative;
  transition: color var(--md-sys-motion-duration-short) ease,
              background-color var(--md-sys-motion-duration-short) ease;
}

.m3-search-clear:hover,
.m3-search-layers:hover {
  color: var(--md-sys-color-on-surface);
  background: rgba(11, 37, 69, var(--md-sys-state-hover-opacity));
}

.m3-search-clear:active,
.m3-search-layers:active {
  background: rgba(11, 37, 69, var(--md-sys-state-pressed-opacity));
}

/* Hakutulosten kelluva pudotusvalikko */
.m3-search-dropdown,
.m3-autocomplete-results,
.m3-search-results-dropdown {
  position: absolute;
  top: 62px;
  left: 0;
  right: 0;
  max-height: 380px;
  overflow-y: auto;
  background: var(--m3-map-glass-bg-fallback);
  background: var(--m3-map-glass-bg);
  backdrop-filter: var(--m3-map-glass-backdrop);
  -webkit-backdrop-filter: var(--m3-map-glass-backdrop);
  border: 1px solid var(--m3-map-glass-border-fallback);
  border-color: var(--m3-map-glass-border);
  border-radius: var(--md-shape-corner-large);
  box-shadow: var(--m3-map-glass-shadow);
  padding: 6px;
  display: none;
  z-index: 1005;
}

.m3-search-dropdown.active,
.m3-autocomplete-results.active,
.m3-search-results-dropdown.active {
  display: block;
  animation: m3FadeDown 0.2s var(--md-sys-motion-easing-emphasized);
}

.m3-search-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  min-height: 48px;
  border-radius: var(--md-shape-corner-medium);
  color: var(--md-sys-color-on-surface);
  cursor: pointer;
  transition: background-color var(--md-sys-motion-duration-short) ease;
}

.m3-search-item:hover,
.m3-search-item:focus {
  background: rgba(0, 99, 143, 0.12);
  color: var(--md-sys-color-on-surface);
}

/* 4.1b KARTTAPOHJIEN JA TASOJEN KELLUVA VALIKKO (.m3-layer-picker-menu) */
.m3-layer-picker-menu {
  position: absolute;
  top: 62px;
  right: 8px;
  min-width: 240px;
  max-width: calc(100vw - 32px);
  background: var(--m3-map-glass-bg-fallback);
  background: var(--m3-map-glass-bg);
  backdrop-filter: var(--m3-map-glass-backdrop);
  -webkit-backdrop-filter: var(--m3-map-glass-backdrop);
  border: 1px solid var(--m3-map-glass-border-fallback);
  border-color: var(--m3-map-glass-border);
  border-radius: var(--md-shape-corner-medium);
  box-shadow: var(--m3-map-glass-shadow), 0 8px 24px rgba(11, 37, 69, 0.14);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 2500;
  pointer-events: auto;
  user-select: none;
  animation: m3FadeDown 0.2s var(--md-sys-motion-easing-emphasized);
}

.m3-menu-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--md-sys-color-primary);
  padding: 8px 12px 4px;
}

.m3-menu-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: transparent;
  color: var(--md-sys-color-on-surface);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--md-shape-corner-small);
  cursor: pointer;
  text-align: left;
  position: relative;
  transition: background-color var(--md-sys-motion-duration-short) ease,
              color var(--md-sys-motion-duration-short) ease;
}

.m3-menu-item .material-symbols-outlined {
  font-size: 20px;
  color: var(--md-sys-color-on-surface-variant);
  flex-shrink: 0;
}

.m3-menu-item:hover,
.m3-menu-item:focus-visible {
  background: rgba(0, 99, 143, 0.08);
  outline: none;
}

.m3-menu-item.active {
  background: rgba(201, 231, 255, 0.62);
  background: color-mix(in srgb, var(--md-sys-color-secondary-container) 62%, transparent);
  color: var(--md-sys-color-on-secondary-container);
  font-weight: 600;
}

.m3-menu-item.active .material-symbols-outlined {
  color: var(--md-sys-color-primary);
}

.m3-menu-item .m3-menu-check {
  margin-left: auto;
  font-size: 18px;
  color: var(--md-sys-color-primary);
  display: none;
}

.m3-menu-item.active .m3-menu-check {
  display: inline-block;
}

.m3-divider {
  border: none;
  border-top: 1px solid var(--md-sys-color-outline-variant);
  margin: 6px 4px;
  opacity: 0.7;
}

/* 4.2 TOIMINTOPALKKI (.m3-map-action-bar: Valittu allas, Suosikki ja Laske/Ennuste) */
.m3-map-action-bar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  max-width: 100%;
  gap: 6px;
  pointer-events: auto;
  user-select: none;
  margin-top: 2px;
  animation: m3FadeDown 0.2s var(--md-sys-motion-easing-emphasized);
}

/* Valitun osa-altaan yksirivinen kontekstipilleri (nimi, päivän tähdet & valinnan poisto) */
.m3-map-selected-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  min-height: 36px;
  min-width: 0;
  max-width: 280px;
  padding: 0 6px 0 12px;
  border-radius: 18px;
  background: var(--m3-map-glass-bg-fallback);
  background: var(--m3-map-glass-bg);
  backdrop-filter: var(--m3-map-glass-backdrop);
  -webkit-backdrop-filter: var(--m3-map-glass-backdrop);
  border: 1px solid var(--m3-map-glass-border-fallback);
  border-color: var(--m3-map-glass-border);
  color: var(--md-sys-color-on-surface);
  box-shadow: var(--m3-map-glass-shadow);
  box-sizing: border-box;
}

.m3-map-selected-stars {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: #64748b;
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  line-height: 1;
  white-space: nowrap;
  flex-shrink: 0;
}

.m3-map-selected-stars.is-skatable {
  background: var(--ice-safe);
}

.m3-map-selected-stars.is-marginal {
  background: #2e7d32;
}

.m3-map-selected-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--md-sys-color-on-surface);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.m3-map-selected-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  padding: 0;
  border-radius: 50%;
  border: none;
  background: rgba(11, 37, 69, 0.07);
  color: var(--md-sys-color-on-surface-variant);
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.12s ease;
}

.m3-map-selected-clear:hover {
  background: rgba(198, 40, 40, 0.16);
  color: var(--ice-hazard);
}

.m3-map-selected-clear:active {
  transform: scale(0.93);
}

.m3-map-selected-clear .material-symbols-outlined {
  font-size: 15px;
}

/* Kompakti Tyhjennä-nollauspainike */
.m3-btn-compact-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 18px;
  background: var(--m3-map-glass-bg-fallback);
  background: var(--m3-map-glass-bg);
  backdrop-filter: var(--m3-map-glass-backdrop);
  -webkit-backdrop-filter: var(--m3-map-glass-backdrop);
  border: 1px solid var(--m3-map-glass-border-fallback);
  border-color: var(--m3-map-glass-border);
  color: var(--md-sys-color-on-surface);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.2px;
  box-shadow: var(--m3-map-glass-shadow);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.m3-btn-compact-clear:hover {
  background: var(--m3-map-glass-bg-elevated-fallback);
  background: var(--m3-map-glass-bg-elevated);
  border-color: var(--md-sys-color-primary);
  box-shadow: var(--md-sys-elevation-level3);
  transform: translateY(-1px);
}

.m3-btn-compact-clear:active {
  transform: scale(0.97);
}

.m3-btn-compact-clear .material-symbols-outlined {
  font-size: 18px;
  color: var(--md-sys-color-primary);
}

/* Kompakti Suosikiksi-painike kartan toimintopalkissa */
.m3-btn-compact-favorite {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 18px;
  background: var(--m3-map-glass-bg-fallback);
  background: var(--m3-map-glass-bg);
  backdrop-filter: var(--m3-map-glass-backdrop);
  -webkit-backdrop-filter: var(--m3-map-glass-backdrop);
  border: 1px solid var(--m3-map-glass-border-fallback);
  border-color: var(--m3-map-glass-border);
  color: var(--md-sys-color-on-surface);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.2px;
  box-shadow: var(--m3-map-glass-shadow);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
}

.m3-btn-compact-favorite:hover {
  background: rgba(254, 243, 199, 0.78);
  background: color-mix(in srgb, #fef3c7 78%, transparent);
  border-color: rgba(245, 158, 11, 0.65);
  color: #92400e;
  box-shadow: var(--md-sys-elevation-level3);
  transform: translateY(-1px);
}

.m3-btn-compact-favorite:active {
  transform: scale(0.97);
}

.m3-btn-compact-favorite .material-symbols-outlined {
  font-size: 18px;
  color: #d97706;
}

.m3-btn-compact-favorite.is-favorite {
  background: rgba(254, 243, 199, 0.76);
  background: color-mix(in srgb, #fef3c7 76%, transparent);
  border-color: rgba(245, 158, 11, 0.65);
  color: #92400e;
}

.m3-btn-compact-favorite.is-favorite .material-symbols-outlined {
  font-variation-settings: 'FILL' 1;
  color: #d97706;
}

/* Kompakti Laske-painike chip-rivin oikeassa reunassa */
.m3-btn-compact-analyze {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 18px;
  background: rgba(11, 37, 69, 0.78);
  background: color-mix(in srgb, var(--md-sys-color-primary) 78%, transparent);
  backdrop-filter: var(--m3-map-glass-backdrop);
  -webkit-backdrop-filter: var(--m3-map-glass-backdrop);
  color: var(--md-sys-color-on-primary);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.2px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: var(--m3-map-glass-shadow);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  user-select: none;
  transition: transform 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.m3-btn-compact-analyze:hover {
  background: rgba(22, 57, 107, 0.86);
  background: color-mix(in srgb, #16396B 86%, transparent);
  box-shadow: var(--md-sys-elevation-level3);
  transform: translateY(-1px);
}

.m3-btn-compact-analyze:active {
  transform: scale(0.97);
}

.m3-btn-compact-analyze:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.m3-btn-compact-analyze .material-symbols-outlined {
  font-size: 18px;
}

/* Kompakti Ennuste-siirtymäpainike kartan yläpalkissa */
.m3-btn-compact-forecast {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 36px;
  min-height: 36px;
  padding: 0 13px;
  border-radius: 18px;
  background: rgba(210, 230, 255, 0.74);
  background: color-mix(in srgb, var(--md-sys-color-primary-container) 74%, transparent);
  backdrop-filter: var(--m3-map-glass-backdrop);
  -webkit-backdrop-filter: var(--m3-map-glass-backdrop);
  color: var(--md-sys-color-on-primary-container);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.15px;
  border: 1px solid rgba(11, 37, 69, 0.20);
  border-color: color-mix(in srgb, var(--md-sys-color-primary) 22%, transparent);
  box-shadow: var(--m3-map-glass-shadow);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  user-select: none;
  transition: transform 0.15s ease, background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.m3-btn-compact-forecast:hover {
  background: rgba(11, 37, 69, 0.82);
  background: color-mix(in srgb, var(--md-sys-color-primary) 82%, transparent);
  color: var(--md-sys-color-on-primary);
  box-shadow: var(--md-sys-elevation-level3);
  transform: translateY(-1px);
}

.m3-btn-compact-forecast:active {
  transform: scale(0.97);
}

.m3-btn-compact-forecast .material-symbols-outlined {
  font-size: 17px;
}

@media (max-width: 480px) {
  .m3-map-action-bar {
    gap: 5px;
  }

  .m3-map-selected-chip {
    max-width: 210px;
    padding: 0 5px 0 10px;
    gap: 5px;
  }

  .m3-map-selected-name {
    font-size: 12.5px;
  }

  .m3-btn-compact-favorite {
    width: 36px;
    min-width: 36px;
    padding: 0;
    flex-shrink: 0;
  }

  .m3-btn-compact-favorite .m3-btn-label {
    display: none;
  }

  .m3-btn-compact-analyze,
  .m3-btn-compact-forecast {
    padding: 0 11px;
    font-size: 12.5px;
  }
}

/* Yksittäinen M3 Input Chip */
.m3-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  height: 32px;
  min-height: 32px;
  border-radius: var(--md-shape-corner-small);
  background: var(--m3-map-glass-bg-fallback);
  background: var(--m3-map-glass-bg);
  border: 1px solid var(--m3-map-glass-border-fallback);
  border-color: var(--m3-map-glass-border);
  color: var(--md-sys-color-on-surface);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.1px;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  backdrop-filter: var(--m3-map-glass-backdrop);
  -webkit-backdrop-filter: var(--m3-map-glass-backdrop);
  box-shadow: var(--md-sys-elevation-level1);
  transition: all var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard);
  flex-shrink: 0;
}

.m3-chip:hover {
  background: var(--m3-map-glass-bg-elevated-fallback);
  background: var(--m3-map-glass-bg-elevated);
  border-color: var(--md-sys-color-primary);
  box-shadow: var(--md-sys-elevation-level2);
}

.m3-chip:active {
  transform: scale(0.98);
}

.m3-chip.active,
.m3-chip.selected {
  background: rgba(210, 230, 255, 0.74);
  background: color-mix(in srgb, var(--md-sys-color-primary-container) 74%, transparent);
  border-color: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary-container);
  box-shadow: 0 0 10px rgba(0, 99, 143, 0.25);
}

.m3-chip-icon {
  font-size: 16px;
  line-height: 1;
}

.m3-chip-close,
.m3-chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: transparent;
  color: var(--md-sys-color-on-surface-variant);
  border: none;
  cursor: pointer;
  margin-left: 2px;
  font-size: 14px;
  transition: background-color var(--md-sys-motion-duration-short) ease, color var(--md-sys-motion-duration-short) ease;
}

/* Esteetön 48x48px kosketusalue sulkunapille */
.m3-chip-close::before,
.m3-chip-remove::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 48px;
  height: 48px;
  transform: translate(-50%, -50%);
}

.m3-chip-close:hover,
.m3-chip-remove:hover {
  background: rgba(198, 40, 40, 0.2);
  color: var(--ice-hazard);
}

/* 4.3 EXTENDED FLOATING ACTION BUTTON (.m3-fab-extended & .m3-fab) */
.m3-fab-extended,
.m3-fab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 56px;
  min-height: 56px;
  padding: 0 20px;
  border-radius: var(--md-shape-corner-large);
  background: rgba(210, 230, 255, 0.74);
  background: color-mix(in srgb, var(--md-sys-color-primary-container) 74%, transparent);
  backdrop-filter: var(--m3-map-glass-backdrop);
  -webkit-backdrop-filter: var(--m3-map-glass-backdrop);
  color: var(--md-sys-color-on-primary-container);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.1px;
  border: 1px solid rgba(0, 99, 143, 0.28);
  box-shadow: var(--m3-map-glass-shadow);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  user-select: none;
  transition: transform var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard),
              box-shadow var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard),
              background-color var(--md-sys-motion-duration-short) ease;
}

.m3-fab-extended:hover,
.m3-fab:hover {
  transform: translateY(-2px);
  box-shadow: var(--md-sys-elevation-level4);
  background: #16396B;
  color: #ffffff;
}

.m3-fab-extended:active,
.m3-fab:active {
  transform: scale(0.98);
  box-shadow: var(--md-sys-elevation-level2);
}

.m3-fab-extended .material-symbols-outlined,
.m3-fab .material-symbols-outlined {
  font-size: 24px;
}

.m3-fab-extended.loading .material-symbols-outlined,
.m3-fab.loading .material-symbols-outlined,
.m3-calc-spinner {
  animation: m3Spin 1.2s linear infinite;
}

/* 4.4 ALAPALKKIIN SULAUTUVA AIKAJANAPALKKI (.m3-time-pill - M3 Bottom Dock Day-Strip Scrubber) */
.m3-time-pill {
  position: relative;
  width: 100%;
  height: 50px;
  z-index: 1000;
  pointer-events: auto;
  background: transparent;
  border: none;
  border-radius: 0;
  display: flex;
  align-items: center;
  padding: 0 10px;
  gap: 8px;
  box-shadow: none;
  user-select: none;
}

/* Toistopainike aikajanalla */
.m3-time-play,
.m3-play-btn,
.m3-time-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  border-radius: 50%;
  background: rgba(0, 99, 143, 0.12);
  color: var(--md-sys-color-primary);
  border: 1px solid rgba(0, 99, 143, 0.22);
  font-size: 20px;
  cursor: pointer;
  position: relative;
  transition: transform var(--md-sys-motion-duration-short) ease,
              background-color var(--md-sys-motion-duration-short) ease;
  flex-shrink: 0;
}

.m3-time-play::before,
.m3-play-btn::before,
.m3-time-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 42px;
  height: 42px;
  transform: translate(-50%, -50%);
}

.m3-time-play,
.m3-play-btn {
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  box-shadow: var(--md-sys-elevation-level1);
}

.m3-time-play:hover,
.m3-play-btn:hover {
  transform: scale(1.06);
  background: #1C3F6E;
}

.m3-time-btn:hover {
  background: rgba(0, 99, 143, 0.20);
  color: var(--md-sys-color-primary);
}

.m3-time-play:active,
.m3-play-btn:active,
.m3-time-btn:active {
  transform: scale(0.92);
}

/* M3 Päivälohkonauha (.m3-slider / .m3-time-strip-viewport) */
.m3-slider-wrapper,
.m3-time-strip-wrapper {
  --time-active-offset: 4px;
  flex: 1;
  min-width: 0;
  height: 44px;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.m3-time-center-indicator {
  position: absolute;
  top: 50%;
  left: var(--time-active-offset);
  width: 50px;
  height: 38px;
  transform: translateY(-50%);
  border-radius: 8px;
  border: 1.5px solid var(--md-sys-color-primary);
  background: rgba(0, 99, 143, 0.06);
  box-shadow: 0 1px 4px rgba(0, 99, 143, 0.14);
  pointer-events: none;
  z-index: 2;
  box-sizing: border-box;
}

.m3-slider,
.m3-time-strip-viewport {
  width: 100%;
  height: 100%;
  flex: 1;
  display: flex;
  align-items: center;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-padding-left: var(--time-active-offset);
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  cursor: grab;
  outline: none;
  mask-image: linear-gradient(to right, transparent 0px, black 4px, black 92%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0px, black 4px, black 92%, transparent 100%);
}

.m3-time-strip-viewport::-webkit-scrollbar {
  display: none;
}

.m3-time-strip-viewport.is-dragging {
  scroll-snap-type: none;
  cursor: grabbing;
}

.m3-slider:focus-visible {
  outline: 2px solid var(--md-sys-color-primary);
  outline-offset: 2px;
  border-radius: 8px;
}

.m3-time-strip-track {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-left: var(--time-active-offset);
  padding-right: calc(100% - 50px - var(--time-active-offset));
  height: 100%;
  box-sizing: content-box;
}

.m3-time-day-cell {
  width: 50px;
  min-width: 50px;
  max-width: 50px;
  flex: 0 0 50px;
  height: 38px;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3px 2px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.30);
  border: 1px solid rgba(11, 37, 69, 0.10);
  cursor: pointer;
  user-select: none;
  transition: background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease;
  box-sizing: border-box;
}

.m3-time-day-cell:hover {
  background: rgba(0, 99, 143, 0.10);
  border-color: rgba(0, 99, 143, 0.28);
}

.m3-time-day-cell.is-active {
  background: rgba(0, 99, 143, 0.16);
  border-color: transparent;
}

.m3-time-day-cell .m3-fday-wd {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: var(--md-sys-color-on-surface-variant);
  line-height: 1.15;
  letter-spacing: 0.1px;
}

.m3-time-day-cell .m3-fday-dm {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: var(--md-sys-color-on-surface-variant);
  opacity: 0.88;
  line-height: 1.15;
  margin-top: 1px;
}

.m3-time-day-cell.is-active .m3-fday-wd,
.m3-time-day-cell.is-active .m3-fday-dm {
  color: var(--md-sys-color-primary);
  font-weight: 800;
  opacity: 1;
}

.m3-time-ice-val {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--md-sys-color-on-surface);
  white-space: nowrap;
  flex-shrink: 0;
}

/* 4.5 NON-BLOCKING TOAST-PILLERI (.m3-info-pill) */
.m3-info-pill {
  position: relative;
  z-index: 1000;
  background: var(--m3-map-glass-bg-fallback);
  background: var(--m3-map-glass-bg);
  backdrop-filter: var(--m3-map-glass-backdrop);
  -webkit-backdrop-filter: var(--m3-map-glass-backdrop);
  border: 1px solid rgba(11, 37, 69, 0.28);
  border-color: color-mix(in srgb, var(--md-sys-color-primary) 34%, transparent);
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--md-sys-color-on-surface);
  pointer-events: auto;
  box-shadow: var(--m3-map-glass-shadow);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: opacity var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-standard),
              transform var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-standard);
  animation: m3ToastPop 0.3s var(--md-sys-motion-easing-emphasized);
}

.m3-info-pill.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Kelluva taustalaskennan tilapalkki */
.m3-calc-banner {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 998;
  height: 40px;
  padding: 0 14px;
  border-radius: 20px;
  background: var(--m3-map-glass-bg-fallback);
  background: var(--m3-map-glass-bg);
  backdrop-filter: var(--m3-map-glass-backdrop);
  -webkit-backdrop-filter: var(--m3-map-glass-backdrop);
  border: 1px solid var(--m3-map-glass-border-fallback);
  border-color: var(--m3-map-glass-border);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--md-sys-color-on-surface);
  box-shadow: var(--m3-map-glass-shadow);
}

/* 4.6 ALAPALKKIIN SULAUTUVA KARTTASELITE (.m3-map-legend - M3 Bottom Dock Legend) */
.m3-map-legend {
  position: relative;
  z-index: 999;
  width: 100%;
  height: 26px;
  background: transparent;
  border: none;
  border-radius: 0;
  border-bottom: 1px solid rgba(11, 37, 69, 0.06);
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 2px 12px;
  user-select: none;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}

.m3-map-legend::-webkit-scrollbar {
  display: none;
}

.m3-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: var(--md-sys-color-on-surface);
}

.m3-lbl-compact {
  display: none;
}

.m3-lbl-full {
  display: inline;
}

.m3-legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
  flex-shrink: 0;
  border: 1px solid rgba(148, 163, 184, 0.4);
}

.m3-swatch-open {
  background: rgba(255, 255, 255, 0.52);
  border-color: rgba(100, 116, 139, 0.55);
}

.m3-swatch-thin {
  background: #38bdf8;
  border-color: #7dd3fc;
}

.m3-swatch-steel {
  background: #2563eb;
  border-color: #1D4ED8;
}

.m3-swatch-safe {
  background: #10b981;
  border-color: #34d399;
}

.m3-swatch-hazard {
  background: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9'%3E%3Cpath d='M 0,4.5 Q 3.5,1.5 7,4.5 T 14,4.5' fill='none' stroke='%23ff5449' stroke-width='1.8'/%3E%3C/svg%3E");
  background-repeat: repeat;
  border-color: rgba(198, 40, 40, 0.5);
}

/* ==============================================================================
   5. M3 BOTTOM NAVIGATION BAR (.m3-bottom-nav & .m3-nav-bar)
   ============================================================================== */
.m3-bottom-nav,
.m3-nav-bar {
  height: 80px;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: var(--md-sys-color-surface-container);
  border-top: 1px solid rgba(11, 37, 69, 0.08);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 1100;
  padding-bottom: var(--safe-bottom);
  user-select: none;
  box-shadow: 0 -4px 16px rgba(11, 37, 69, 0.14);
}

.m3-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: transparent;
  border: none;
  color: var(--md-sys-color-secondary);
  cursor: pointer;
  padding: 8px 0;
  min-height: 48px;
  min-width: 48px;
  position: relative;
  text-decoration: none;
  transition: color var(--md-sys-motion-duration-short) ease;
}

.m3-nav-item:focus-visible {
  outline: none;
}

.m3-nav-item:focus-visible .m3-nav-indicator {
  outline: 2px solid var(--md-sys-color-primary);
  outline-offset: 2px;
}

.m3-nav-item:hover {
  color: var(--md-sys-color-on-surface);
}

.m3-nav-item.active {
  color: var(--md-sys-color-primary);
}

/* Aktiivisen tabin soikiomainen pilleri-indikaattori (M3: 64x32px) */
.m3-nav-indicator {
  width: 64px;
  height: 32px;
  border-radius: 16px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-standard),
              width var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-standard);
}

.m3-nav-item.active .m3-nav-indicator {
  background: rgba(0, 99, 143, 0.22);
  color: var(--md-sys-color-primary);
}

.m3-nav-item.active .material-symbols-outlined {
  font-variation-settings: 'FILL' 1;
}

.m3-nav-icon {
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.m3-nav-label {
  font-size: 12px;
  font-weight: 600;
  line-height: 14px;
  letter-spacing: 0.2px;
  transition: font-weight 0.15s ease;
}

.m3-nav-item.active .m3-nav-label {
  font-weight: 700;
}

/* ==============================================================================
   6. RAPORTIT & KORTIT -NÄKYMÄN TYYLIT (.m3-reports-container jne.)
   ============================================================================== */
.m3-reports-container {
  padding: 16px;
  max-width: 800px;
  margin: 0 auto;
  height: calc(100vh - 80px - var(--m3-header-height, 0px));
  height: calc(100dvh - 80px - var(--m3-header-height, 0px));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

/* M3 Kortti (.m3-card) */
.m3-card {
  background: var(--md-sys-color-surface-container);
  border: 1px solid rgba(11, 37, 69, 0.08);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(11, 37, 69, 0.12);
  transition: border-color var(--md-sys-motion-duration-medium) ease,
              box-shadow var(--md-sys-motion-duration-medium) ease,
              transform var(--md-sys-motion-duration-medium) ease;
}

.m3-card:hover {
  border-color: rgba(0, 99, 143, 0.25);
  box-shadow: 0 4px 16px rgba(11, 37, 69, 0.15);
}

.m3-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 8px;
}

.m3-card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--md-sys-color-on-surface);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.1px;
}

.m3-card-subtitle {
  font-size: 13px;
  color: var(--md-sys-color-on-surface-variant);
  margin-top: 2px;
}

.m3-card-body {
  font-size: 14px;
  line-height: 1.5;
  color: var(--md-sys-color-on-surface);
}

.m3-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid rgba(11, 37, 69, 0.06);
}

/* 6.1 SEGMENTOITU ALLASTABIPURSOTUS (.m3-segmented-tabs) */
.m3-segmented-tabs-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 16px;
  padding-bottom: 4px;
}

.m3-segmented-tabs {
  display: inline-flex;
  min-width: 100%;
  background: var(--md-sys-color-surface-container-high);
  border-radius: 24px;
  padding: 4px;
  gap: 6px;
  border: 1px solid rgba(0, 99, 143, 0.2);
  user-select: none;
}

.m3-tab-item,
.m3-tab-btn,
.m3-segmented-btn {
  flex: 1 0 auto;
  min-height: 44px;
  border-radius: 20px;
  border: none;
  background: transparent;
  color: var(--md-sys-color-on-surface-variant);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.m3-tab-item:hover,
.m3-tab-btn:hover,
.m3-segmented-btn:hover {
  color: var(--md-sys-color-on-surface);
  background: rgba(0, 99, 143, 0.08);
}

.m3-tab-item.active,
.m3-tab-btn.active,
.m3-segmented-btn.active {
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  box-shadow: 0 2px 8px rgba(11, 37, 69, 0.14);
  font-weight: 700;
}

/* 6.1b KOLMITASOINEN RAPORTTISUODATUS (.m3-report-filters-card) */
.m3-report-filters-card {
  background: var(--md-sys-color-surface-container-low);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: 20px;
  padding: 14px 16px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.m3-filter-level {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.m3-filter-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--md-sys-color-on-surface-variant);
  user-select: none;
}

.m3-filter-label .filter-icon {
  font-size: 15px;
  color: var(--md-sys-color-primary);
}

/* 6.1c OPASTAVA INFOLAATIKKO RAPORTEISSA (.m3-reports-guide-banner) */
.m3-reports-guide-banner {
  background: linear-gradient(135deg, rgba(240, 248, 255, 0.95), rgba(225, 240, 255, 0.7));
  border: 1px solid rgba(0, 99, 143, 0.2);
  border-radius: 16px;
  padding: 12px 16px;
  margin-bottom: 12px;
  box-shadow: 0 2px 6px rgba(11, 37, 69, 0.05);
}

.m3-guide-banner-content {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.m3-guide-banner-icon {
  font-size: 22px;
  color: var(--md-sys-color-primary);
  flex-shrink: 0;
  margin-top: 1px;
}

.m3-guide-banner-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.m3-guide-banner-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--md-sys-color-on-surface);
}

.m3-guide-banner-desc {
  font-size: 12px;
  color: var(--md-sys-color-on-surface-variant);
  margin: 0;
  line-height: 1.4;
}

.m3-guide-banner-tip {
  font-size: 11px;
  color: var(--md-sys-color-primary);
  margin: 2px 0 0 0;
  line-height: 1.4;
}

/* 6.1b RAPORTTIEN HAKU JA SUOSIKKISUODATIN */
.m3-reports-search-container {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-bottom: 8px;
}

.m3-reports-search-bar {
  flex: 1;
  display: flex;
  align-items: center;
  height: 42px;
  background: var(--md-sys-color-surface-container-high);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: 21px;
  padding: 0 12px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.m3-reports-search-bar:focus-within {
  background: var(--md-sys-color-surface-container-lowest);
  border-color: var(--md-sys-color-primary);
  box-shadow: 0 0 0 2px rgba(0, 99, 143, 0.15);
}

.m3-reports-search-bar .m3-search-icon {
  font-size: 18px;
  color: var(--md-sys-color-primary);
  margin-right: 8px;
  flex-shrink: 0;
}

.m3-reports-search-bar .m3-search-input {
  flex: 1;
  height: 100%;
  background: transparent;
  border: none;
  outline: none;
  font-size: 14px;
  color: var(--md-sys-color-on-surface);
  font-family: inherit;
}

.m3-reports-search-bar .m3-search-clear {
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  font-size: 16px;
  background: transparent;
  border: none;
  color: var(--md-sys-color-on-surface-variant);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.m3-fav-filter-chip {
  height: 42px;
  min-height: 42px;
  border-radius: 21px;
  padding: 0 14px;
}

.m3-fav-filter-chip.active {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #b45309;
}

.m3-fav-filter-chip.active .material-symbols-outlined {
  color: #f59e0b;
  font-variation-settings: 'FILL' 1;
}

/* Monirivinen joustava sirusäiliö suodattimille (poistaa vaakavierityksen ja rivittää monelle riville) */
.m3-filter-chips-wrap,
.m3-filter-chips-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  max-height: 160px;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 4px 2px 8px 2px;
  scrollbar-width: thin;
}

.m3-filter-chips-wrap::-webkit-scrollbar,
.m3-filter-chips-row::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

.m3-filter-chips-wrap::-webkit-scrollbar-thumb,
.m3-filter-chips-row::-webkit-scrollbar-thumb {
  background: rgba(0, 99, 143, 0.25);
  border-radius: 4px;
}

.m3-filter-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--md-sys-color-outline-variant);
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.1px;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.m3-filter-chip:hover {
  background: var(--md-sys-color-surface-container-highest);
  border-color: var(--md-sys-color-primary);
}

.m3-filter-chip:active {
  transform: scale(0.97);
}

.m3-filter-chip.active {
  background: var(--md-sys-color-primary-container);
  border-color: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary-container);
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(11, 37, 69, 0.10);
}

.m3-filter-chip .chip-count {
  font-size: 11px;
  opacity: 0.75;
  background: rgba(11, 37, 69, 0.12);
  padding: 1px 6px;
  border-radius: 8px;
}

.m3-filter-chip.active .chip-count {
  background: rgba(11, 37, 69, 0.12);
}

/* 6.2 AKTIIVISEN LASKETUN ALTAAN OTSIKKOKORTTI (.m3-active-basin-card) – Kompakti & Sticky */
.m3-active-basin-card {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  margin-bottom: 12px;
  background: var(--md-sys-color-surface-container-low);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-shape-corner-medium);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
  user-select: none;
  touch-action: pan-y;
}

.m3-active-basin-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.m3-active-basin-title-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1 1 auto;
}

.m3-reports-target-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px 8px;
  margin-bottom: 0;
  background: var(--md-sys-color-surface-container);
  border: 1px solid rgba(11, 37, 69, 0.08);
  border-bottom: 1px solid rgba(11, 37, 69, 0.06);
  border-radius: 16px 16px 0 0;
}

.m3-reports-target-header + .m3-forecast-chart-card,
.m3-reports-target-header + .m3-forecast-chart-card + .m3-table-card {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  border-top: none;
}

.m3-active-basin-title {
  font-size: 15.5px;
  font-weight: 800;
  color: var(--md-sys-color-on-surface);
  margin: 0;
  line-height: 1.28;
  letter-spacing: 0.1px;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  word-break: break-word;
}

.m3-active-basin-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* Suosikkipainike ja Kartalla-painike kompaktissa aktiivisen altaan yläpalkissa */
.m3-favorite-toggle-btn {
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--md-sys-color-outline-variant);
  color: var(--md-sys-color-on-surface-variant);
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
}

.m3-favorite-toggle-btn .material-symbols-outlined {
  font-size: 18px;
}

.m3-favorite-toggle-btn:hover {
  background: rgba(245, 158, 11, 0.12);
  border-color: #f59e0b;
  color: #f59e0b;
}

.m3-favorite-toggle-btn.is-favorite {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #d97706;
}

.m3-favorite-toggle-btn.is-favorite .material-symbols-outlined {
  font-variation-settings: 'FILL' 1;
  color: #d97706;
}

.m3-btn-basin-map {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 30px;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.m3-btn-basin-map .material-symbols-outlined {
  font-size: 16px;
}

.m3-filter-chip .chip-fav-star {
  font-size: 15px;
  color: #f59e0b;
  font-variation-settings: 'FILL' 1;
  margin-right: -2px;
}

/* 6.3 KPI-TILASTOLAATIKOT (.m3-kpi-grid & .m3-kpi-card) */
.m3-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.m3-kpi-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  background: var(--md-sys-color-surface-container);
  border: 1px solid rgba(11, 37, 69, 0.08);
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(11, 37, 69, 0.08);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.m3-kpi-card:hover {
  border-color: rgba(0, 99, 143, 0.3);
  transform: translateY(-2px);
}

.m3-kpi-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.m3-kpi-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.m3-bearing-chip {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(11, 37, 69, 0.08);
  color: var(--md-sys-color-on-surface-variant);
}

.m3-bearing-chip.safe {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid rgba(5, 150, 105, 0.3);
}

.m3-bearing-chip.warning {
  background: #fef3c7;
  color: #d97706;
  border: 1px solid rgba(217, 119, 6, 0.3);
}

.m3-bearing-chip.danger {
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid rgba(220, 38, 38, 0.3);
}

.m3-ice-main-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

/* Jäätyyppien erittely: Teräsjää, Kohvajää, Lumipeite */
.m3-ice-types-breakdown {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 4px;
}

.m3-ice-type-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 6px 4px;
  background: rgba(0, 99, 143, 0.06);
  border: 1px solid rgba(0, 99, 143, 0.12);
  border-radius: 10px;
  gap: 2px;
}

.m3-ice-type-name {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--md-sys-color-on-surface-variant);
  font-weight: 600;
}

.m3-ice-type-val {
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--md-sys-color-on-surface);
}

.m3-kpi-icon {
  font-size: 24px;
}

.m3-kpi-icon.color-temp {
  color: #C2410C;
}

.m3-kpi-icon.color-ice {
  color: #00638F;
}

.m3-kpi-icon.color-condition {
  color: #1B7F46;
}

.m3-display-small {
  font-size: 26px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--md-sys-color-on-surface);
  letter-spacing: 0.2px;
}

/* 6.3b VAARANPAIKAT JA HUOMIOT (.m3-hazards-card) */
.m3-hazards-card {
  background: linear-gradient(135deg, rgba(254, 243, 199, 0.55), rgba(255, 237, 213, 0.35));
  border: 1px solid rgba(217, 119, 6, 0.3);
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.08);
}

.m3-hazards-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.m3-hazards-icon {
  font-size: 22px;
  color: #d97706;
}

.m3-hazards-card-header .m3-title-medium {
  font-size: 16px;
  font-weight: 700;
  color: #92400e;
  margin: 0;
}

.m3-hazards-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.m3-hazard-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 10px;
  border-left: 3px solid #d97706;
  box-shadow: 0 1px 3px rgba(11, 37, 69, 0.04);
}

.m3-hazard-item.m3-hazard-model {
  border-left-color: #ef4444;
}

.m3-hazard-item.m3-hazard-clear {
  border-left-color: #10b981;
  background: rgba(240, 253, 244, 0.85);
}

.m3-hazard-icon-warn {
  font-size: 18px;
  color: #d97706;
  flex-shrink: 0;
  margin-top: 1px;
}

.m3-hazard-item.m3-hazard-model .m3-hazard-icon-warn {
  color: #ef4444;
}

.m3-hazard-icon-safe {
  font-size: 18px;
  color: #10b981;
  flex-shrink: 0;
  margin-top: 1px;
}

.m3-hazard-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.m3-hazard-tag {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: #b45309;
}

.m3-hazard-item.m3-hazard-model .m3-hazard-tag {
  color: #b91c1c;
}

.m3-hazard-item.m3-hazard-clear .m3-hazard-tag {
  color: #047857;
}

.m3-hazard-desc {
  font-size: 13px;
  color: var(--md-sys-color-on-surface);
  line-height: 1.35;
}

/* 6.4 TILANNEKORTIT JA KUVAT (.m3-image-card) */
.m3-image-card {
  background: var(--md-sys-color-surface-container);
  border: 1px solid rgba(11, 37, 69, 0.08);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(11, 37, 69, 0.10);
}

.m3-card-media-wrapper {
  position: relative;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(11, 37, 69, 0.06);
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.m3-card-media {
  width: 100%;
  height: auto;
  max-height: 520px;
  object-fit: contain;
  display: block;
}

.m3-media-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 36px 16px;
  color: var(--md-sys-color-on-surface-variant);
  text-align: center;
  font-size: 13px;
}

.m3-media-placeholder .placeholder-icon {
  font-size: 44px;
  color: var(--md-sys-color-primary);
  opacity: 0.6;
}

/* 6.5 SKELETON LOADING SHIMMER (.m3-skeleton) */
.m3-skeleton {
  background: linear-gradient(
    90deg,
    var(--md-sys-color-surface-container-high) 25%,
    var(--md-sys-color-surface-container-highest) 37%,
    var(--md-sys-color-surface-container-high) 63%
  );
  background-size: 400% 100%;
  animation: m3Shimmer 1.5s ease infinite;
  border-radius: var(--md-shape-corner-small);
}

@keyframes m3Shimmer {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0 50%;
  }
}

/* 6.6 ENNUSTETAULUKKO (.m3-table-card, .m3-data-table) */
.m3-table-card {
  background: var(--md-sys-color-surface-container);
  border: 1px solid rgba(11, 37, 69, 0.08);
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(11, 37, 69, 0.10);
}

.m3-table-responsive-container,
.m3-table-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 10px;
  border-radius: 12px;
  border: 1px solid rgba(11, 37, 69, 0.06);
}

.m3-data-table,
.m3-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

.m3-data-table th,
.m3-table th {
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-primary);
  padding: 8px 6px;
  font-weight: 700;
  border-bottom: 1px solid rgba(11, 37, 69, 0.1);
  white-space: nowrap;
  font-size: 13px;
}

.m3-data-table td,
.m3-table td {
  padding: 6px 6px;
  border-bottom: 1px solid rgba(11, 37, 69, 0.05);
  color: var(--md-sys-color-on-surface);
}

.m3-data-table th.col-date,
.m3-data-table td.col-date {
  width: 22%;
  text-align: left;
}

.m3-data-table th.col-weather,
.m3-data-table td.col-weather {
  width: 26%;
  text-align: center;
}

.m3-data-table th.col-ice,
.m3-data-table td.col-ice {
  width: 28%;
  text-align: center;
}

.m3-data-table th.col-skating,
.m3-data-table td.col-skating {
  width: 24%;
  text-align: center;
}

.m3-cell-2row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.m3-cell-primary {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.m3-cell-sub {
  font-size: 11px;
  color: var(--md-sys-color-on-surface-variant);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.m3-table-stars {
  font-size: 13px;
  letter-spacing: -1.2px;
}

.m3-bearing-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}

.m3-bearing-dot.safe { background-color: #10b981; }
.m3-bearing-dot.warning { background-color: #f59e0b; }
.m3-bearing-dot.danger { background-color: #ef4444; }
.m3-bearing-dot.open { background-color: #3b82f6; }

.m3-data-table tr:hover td,
.m3-table tr:hover td {
  background: rgba(0, 99, 143, 0.06);
}

/* Semanttiset jäämerkit taulukossa ja korteissa */
.m3-ice-badge,
.m3-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: var(--md-shape-corner-small);
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: 0.1px;
  white-space: nowrap;
}

.m3-ice-badge.safe,
.m3-badge-safe {
  background: var(--ice-safe-container);
  color: var(--ice-safe);
  border: 1px solid var(--ice-safe-border);
}

.m3-ice-badge.mid,
.m3-badge-mid {
  background: var(--ice-mid-container);
  color: var(--ice-mid);
  border: 1px solid var(--ice-mid-border);
}

.m3-ice-badge.thin,
.m3-badge-thin {
  background: var(--ice-thin-container);
  color: var(--ice-thin);
  border: 1px solid var(--ice-thin-border);
}

.m3-ice-badge.hazard,
.m3-badge-hazard {
  background: var(--ice-hazard-container);
  color: var(--ice-hazard);
  border: 1px solid var(--ice-hazard-border);
}

/* Luisteltavuuden tähtiluokitus ennustetaulukossa */
.m3-table-stars {
  color: #A16207;
  font-size: 13px;
  letter-spacing: 1.2px;
  white-space: nowrap;
  font-weight: 600;
}

/* Kaksiriviset ennustetaulukon solut (PNG-vastaavuus) */
.m3-cell-2row {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.25;
}

.m3-cell-primary {
  font-weight: 600;
  font-size: 13px;
  color: var(--md-sys-color-on-surface);
  white-space: nowrap;
}

.m3-cell-sub {
  font-size: 11px;
  color: var(--md-sys-color-on-surface-variant);
  font-weight: 400;
  margin-top: 2px;
  white-space: nowrap;
}

.m3-temp-freeze {
  color: #1D4ED8;
}

.m3-temp-thaw {
  color: #C62828;
}

.m3-bearing-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: middle;
}

.m3-bearing-dot.safe { background-color: #10b981; }
.m3-bearing-dot.warning { background-color: #EAB308; }
.m3-bearing-dot.danger { background-color: #ef4444; }
.m3-bearing-dot.open { background-color: #94a3b8; }

/* 6.6 TOIMINTOPAINIKKEET JA LIGHTBOX (.m3-action-buttons-row, .m3-lightbox-modal) */
.m3-action-buttons-row {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
  margin-bottom: 24px;
}

/* M3 Yhtenäinen painikejärjestelmä (Filled, Filled Tonal, Outlined) */
.m3-btn,
.m3-btn-filled,
.m3-btn-primary,
.m3-btn-tonal,
.m3-btn-outlined {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 18px;
  border-radius: var(--md-shape-corner-full);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.1px;
  cursor: pointer;
  user-select: none;
  text-decoration: none;
  transition: background-color var(--md-sys-motion-duration-short) ease,
              border-color var(--md-sys-motion-duration-short) ease,
              color var(--md-sys-motion-duration-short) ease,
              box-shadow var(--md-sys-motion-duration-short) ease,
              transform 0.12s ease,
              opacity var(--md-sys-motion-duration-short) ease;
}

.m3-btn .material-symbols-outlined,
.m3-btn-filled .material-symbols-outlined,
.m3-btn-primary .material-symbols-outlined,
.m3-btn-tonal .material-symbols-outlined,
.m3-btn-outlined .material-symbols-outlined {
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
}

.m3-btn:active:not(:disabled),
.m3-btn-filled:active:not(:disabled),
.m3-btn-primary:active:not(:disabled),
.m3-btn-tonal:active:not(:disabled),
.m3-btn-outlined:active:not(:disabled) {
  transform: scale(0.98);
}

.m3-btn:disabled,
.m3-btn-filled:disabled,
.m3-btn-primary:disabled,
.m3-btn-tonal:disabled,
.m3-btn-outlined:disabled {
  opacity: 0.55;
  cursor: default;
  box-shadow: none;
}

/* 1. M3 Filled Button (High emphasis) */
.m3-btn-filled,
.m3-btn-primary {
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  border: 1px solid transparent;
  box-shadow: 0 1px 3px rgba(11, 37, 69, 0.14);
}

.m3-btn-filled:hover:not(:disabled),
.m3-btn-primary:hover:not(:disabled) {
  background: #16396B;
  box-shadow: 0 3px 10px rgba(11, 37, 69, 0.22);
}

/* 2. M3 Filled Tonal Button (Medium emphasis) */
.m3-btn-tonal {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  border: 1px solid rgba(0, 99, 143, 0.18);
  box-shadow: none;
}

.m3-btn-tonal:hover:not(:disabled) {
  background: #B6D8F0;
  border-color: rgba(0, 99, 143, 0.32);
  box-shadow: 0 1px 4px rgba(0, 99, 143, 0.14);
}

/* 3. M3 Outlined Button (Low/Medium emphasis) */
.m3-btn-outlined {
  background: var(--md-sys-color-surface-container-lowest);
  color: var(--md-sys-color-primary);
  border: 1px solid var(--md-sys-color-outline-variant);
  box-shadow: none;
}

.m3-btn-outlined:hover:not(:disabled) {
  background: rgba(0, 99, 143, 0.08);
  border-color: var(--md-sys-color-primary);
}

.m3-lightbox-modal {
  position: fixed;
  inset: 0;
  z-index: 2500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.m3-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 28, 44, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.m3-lightbox-dialog-card {
  position: relative;
  z-index: 1;
  max-width: 95vw;
  max-height: 90vh;
  background: var(--md-sys-color-surface-container);
  border: 1px solid rgba(0, 99, 143, 0.25);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(11, 37, 69, 0.28);
}

.m3-lightbox-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid rgba(11, 37, 69, 0.08);
  background: var(--md-sys-color-surface-container-high);
}

.m3-lightbox-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.m3-lightbox-body {
  padding: 12px;
  overflow: auto;
  display: flex;
  justify-content: center;
  align-items: center;
}

.m3-lightbox-image {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
  border-radius: 8px;
}

/* WAVY HAZARD PATTERN OVERLAY FOR LEAFLET POLYGONS (BORDERLESS PNG STYLE) */
.hazard-wave-overlay {
  fill: url(#hazardWavePattern) !important;
  stroke: none !important;
  stroke-width: 0 !important;
  pointer-events: auto;
  cursor: pointer;
}

/* ==============================================================================
   7. MOBIILIKÄYTETTÄVYYS & ESTEETTÖMYYS (MIN 48PX KOSKETUSALUEET)
   ============================================================================== */
.m3-touch-target,
.m3-btn-icon,
.m3-icon-btn {
  min-width: 48px;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  color: inherit;
  border-radius: 50%;
  transition: background-color 0.15s ease;
}

.m3-touch-target:hover,
.m3-btn-icon:hover {
  background: rgba(11, 37, 69, 0.08);
}

/* ==============================================================================
   8. ANIMAATIOT & SIIRTYMÄT
   ============================================================================== */
@keyframes m3FadeDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes m3ToastPop {
  0% {
    opacity: 0;
    transform: translate(-50%, 12px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}

/* ==============================================================================
   9. RESPONSIIVISUUS (KÄNNYKÄT & TABLETIT)
   ============================================================================== */
@media (max-width: 600px) {
  :root {
    --m3-nav-height: 72px;
  }

  .m3-map-top-overlay {
    top: 8px;
    width: calc(100% - 16px);
  }

  .m3-map-bottom-overlay {
    bottom: 0;
    width: 100%;
  }

  .m3-search-bar {
    height: 48px;
    padding: 0 12px;
  }

  .m3-time-pill {
    height: 48px;
    padding: 0 8px;
    gap: 6px;
  }

  .m3-map-legend {
    height: 24px;
    padding: 2px 4px;
    gap: 6px;
    justify-content: space-evenly;
  }

  .m3-legend-item {
    font-size: 11px;
    font-weight: 700;
    gap: 3px;
  }

  .m3-lbl-compact {
    display: inline;
  }

  .m3-lbl-full {
    display: none;
  }

  .m3-info-pill {
    font-size: 11px;
    padding: 5px 12px;
    margin-bottom: 8px;
  }

  .m3-bottom-nav,
  .m3-nav-bar {
    height: 72px;
  }

  .m3-reports-container {
    padding: 12px 10px;
    height: calc(100vh - 72px);
    height: calc(100dvh - 72px);
  }

  .m3-view-scroll-content {
    padding: 12px 10px calc(var(--m3-nav-height) + 24px) 10px;
  }

  .m3-card {
    padding: 14px;
    margin-bottom: 12px;
  }

  /* Raportit-näkymän mobiilioptimointi pystynäytölle */
  .m3-active-basin-card {
    padding: 6px 10px;
  }

  .m3-active-basin-title {
    font-size: 13.5px;
  }

  .m3-btn-basin-map {
    padding: 0 7px;
  }

  .m3-btn-basin-map-label {
    display: none;
  }

  .m3-kpi-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .m3-table-card {
    padding: 10px 6px;
  }

  .m3-table-responsive-container {
    margin-top: 8px;
    border-radius: 8px;
  }

  .m3-data-table th,
  .m3-data-table td {
    padding: 6px 3px;
    font-size: 12px;
  }

  .m3-cell-primary {
    font-size: 13px;
    font-weight: 700;
  }

  .m3-cell-sub {
    font-size: 11px;
    color: #475569;
  }

  .m3-table-stars {
    font-size: 13px;
    letter-spacing: -1px;
  }

  .m3-hazards-card {
    padding: 12px;
  }

  .m3-hazard-item {
    padding: 6px 10px;
    gap: 8px;
  }

  .m3-hazard-desc {
    font-size: 12px;
  }
}

@media (min-width: 601px) and (max-width: 1024px) {
  .m3-map-top-overlay {
    max-width: 580px;
  }

  .m3-reports-container {
    max-width: 720px;
  }
}

@media (min-width: 1025px) {
  .m3-map-top-overlay {
    top: 16px;
    max-width: 620px;
  }

  .m3-reports-container {
    max-width: 860px;
    padding: 24px;
  }
}

/* ==============================================================================
   10. TOAST-ILMOITUKSET, ANIMAATIOT JA ERIKOISKOMPONENTIT
   ============================================================================== */
.m3-toast-container {
  position: fixed;
  bottom: 96px;
  left: 0;
  right: 0;
  margin-left: auto;
  margin-right: auto;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  width: calc(100% - 32px);
  max-width: 420px;
}

.m3-toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 99, 143, 0.25);
  color: var(--md-sys-color-on-surface);
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(11, 37, 69, 0.20);
  pointer-events: auto;
  animation: m3ToastPop 0.25s ease-out;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.m3-app-shell:has(#viewMap.active) ~ .m3-toast-container .m3-toast {
  background: var(--m3-map-glass-bg-fallback);
  background: var(--m3-map-glass-bg);
  backdrop-filter: var(--m3-map-glass-backdrop);
  -webkit-backdrop-filter: var(--m3-map-glass-backdrop);
  box-shadow: var(--m3-map-glass-shadow);
}

.m3-toast.fade-out {
  opacity: 0;
  transform: translateY(10px);
}

.m3-toast.success {
  border-color: #1B7F46;
}

.m3-toast.success .m3-toast-icon {
  color: #1B7F46;
}

.m3-toast.warning {
  border-color: #C2410C;
}

.m3-toast.warning .m3-toast-icon {
  color: #C2410C;
}

.m3-toast.danger {
  border-color: #C62828;
}

.m3-toast.danger .m3-toast-icon {
  color: #C62828;
}

.m3-toast.info .m3-toast-icon {
  color: #00638F;
}

.m3-toast-icon {
  font-size: 20px;
}

.m3-toast-text {
  flex: 1;
}

.m3-toast-action {
  background: transparent;
  border: none;
  color: var(--md-sys-color-primary);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  white-space: nowrap;
}

.m3-toast-action:hover {
  background: rgba(0, 99, 143, 0.15);
}

.m3-toast-close {
  background: transparent;
  border: none;
  color: var(--md-sys-color-secondary);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  position: relative;
  transition: color 0.15s ease, background-color 0.15s ease;
  flex-shrink: 0;
}

.m3-toast-close::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 48px;
  height: 48px;
  transform: translate(-50%, -50%);
}

.m3-toast-close:hover {
  color: var(--md-sys-color-on-surface);
  background: rgba(11, 37, 69, 0.1);
}

/* Kartan laskentaindikaattori ja 6-sakarainen vaihelumihiutale */
.m3-calc-indicator {
  background: transparent !important;
  border: none !important;
  display: flex;
  justify-content: center;
  align-items: center;
}

.m3-calc-marker-inner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--m3-map-glass-bg-fallback);
  background: var(--m3-map-glass-bg);
  backdrop-filter: var(--m3-map-glass-backdrop);
  -webkit-backdrop-filter: var(--m3-map-glass-backdrop);
  border: 1px solid rgba(11, 37, 69, 0.34);
  border-color: color-mix(in srgb, var(--md-sys-color-primary) 38%, transparent);
  border-radius: 20px;
  padding: 6px 14px;
  color: var(--md-sys-color-on-surface);
  box-shadow: var(--m3-map-glass-shadow);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.m3-calc-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.m3-calc-basin-title {
  font-weight: 700;
  color: var(--md-sys-color-on-surface);
}

.m3-calc-stage-sep {
  color: #94a3b8;
  font-weight: 400;
}

.m3-calc-stage-text {
  font-weight: 600;
  color: var(--md-sys-color-primary);
}

.m3-calc-marker-inner.queued {
  background: rgba(240, 245, 249, 0.66);
  background: color-mix(in srgb, var(--md-sys-color-surface-container-low) 66%, transparent);
  border: 1px solid var(--m3-map-glass-border-fallback);
  border-color: var(--m3-map-glass-border);
  color: #475569;
}

.m3-calc-marker-inner.queued .m3-calc-stage-text {
  color: #64748b;
}

.m3-snowflake-progress {
  flex-shrink: 0;
  overflow: visible;
}

.m3-snowflake-branch {
  stroke: #cbd5e1;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  opacity: 0.45;
  transition: stroke 0.25s ease, opacity 0.25s ease;
}

.m3-snowflake-branch.is-lit {
  stroke: var(--md-sys-color-primary, #0284c7);
  opacity: 1;
}

.m3-snowflake-branch.is-current {
  animation: m3SnowflakeBranchPulse 0.9s ease-in-out infinite alternate;
}

.m3-snowflake-hub {
  fill: #cbd5e1;
  transition: fill 0.25s ease;
}

.m3-snowflake-hub.is-lit {
  fill: var(--md-sys-color-primary, #0284c7);
}

.m3-snowflake-progress.on-button .m3-snowflake-branch {
  stroke: rgba(255, 255, 255, 0.35);
}

.m3-snowflake-progress.on-button .m3-snowflake-branch.is-lit {
  stroke: #ffffff;
  opacity: 1;
}

.m3-snowflake-progress.on-button .m3-snowflake-hub {
  fill: rgba(255, 255, 255, 0.4);
}

.m3-snowflake-progress.on-button .m3-snowflake-hub.is-lit {
  fill: #ffffff;
}

@keyframes m3SnowflakeBranchPulse {
  from {
    opacity: 0.65;
  }
  to {
    opacity: 1;
    filter: drop-shadow(0 0 2px rgba(2, 132, 199, 0.55));
  }
}

.m3-calc-spinner {
  color: var(--md-sys-color-primary);
  font-size: 18px;
  animation: m3Spin 2s linear infinite;
}

.m3-calc-static {
  color: #64748B;
  font-size: 18px;
  animation: none;
}

@keyframes m3Spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.m3-badge-ice {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 700;
  font-family: var(--font-mono);
  background: rgba(0, 99, 143, 0.16);
  color: var(--md-sys-color-primary);
}

.m3-favorite-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.m3-favorite-card .m3-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

/* --- Linear Progress Indicator (Alapalkin yläreunassa) --- */
.m3-linear-progress {
  position: fixed;
  bottom: var(--m3-nav-height, 80px);
  left: 0;
  width: 100%;
  max-width: none;
  height: 4px;
  background: rgba(0, 99, 143, 0.15);
  border-radius: 0;
  overflow: hidden;
  z-index: 1150;
  transform: none;
}

@media (max-width: 768px) {
  .m3-linear-progress {
    bottom: 72px;
    height: 3px;
  }
}

.m3-linear-progress-indicator.indeterminate {
  width: 100%;
  height: 100%;
  background: var(--md-sys-color-primary, #0B2545);
  animation: m3ProgressIndeterminate 1.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  transform-origin: 0% 50%;
}

@keyframes m3ProgressIndeterminate {
  0% { transform: translateX(-100%) scaleX(0.2); }
  50% { transform: translateX(0%) scaleX(0.7); }
  100% { transform: translateX(100%) scaleX(0.2); }
}

/* --- WCAG 2.1 AA Touch Target (min 48x48px) & Icon Button Accessibility --- */
.m3-touch-target {
  min-width: 48px;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.m3-icon-btn {
  min-width: 48px;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--md-sys-color-on-surface-variant);
  cursor: pointer;
  transition: background-color var(--md-sys-motion-duration-short) ease, color var(--md-sys-motion-duration-short) ease;
}

.m3-icon-btn:hover {
  background: rgba(0, 99, 143, 0.12);
  color: var(--md-sys-color-on-surface);
}

.m3-chip-close.m3-touch-target {
  min-width: 48px;
  min-height: 48px;
}

/* --- M3 Status & Condition Badges --- */
.m3-badges-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.m3-badge-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  background: var(--md-sys-color-surface-container);
  color: var(--md-sys-color-on-surface);
  border: 1px solid var(--md-sys-color-outline-variant);
}

.m3-badge-chip .chip-icon {
  font-size: 18px;
}

.m3-chip-skating {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: #047857;
}

.m3-chip-temp {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.4);
  color: #0369A1;
}

.m3-chip-snow {
  background: rgba(148, 163, 184, 0.15);
  border-color: rgba(148, 163, 184, 0.4);
  color: #475569;
}

.m3-chip-hazards {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #B91C1C;
}

/* ==============================================================================
   7. KAUSITILASTOT & KAUSIKARTTATILA (#viewStats)
   ============================================================================== */

.m3-stats-map-top-overlay {
  max-width: 680px;
  gap: 6px;
}

.m3-stats-lock-banner {
  pointer-events: auto;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
}

.m3-stats-map-top-overlay:has(.m3-stats-toolbar.is-collapsed) .m3-stats-lock-banner {
  display: none !important;
}

.m3-stats-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
  padding: 6px 10px;
  margin: 0;
  background: var(--m3-map-glass-bg-fallback);
  background: var(--m3-map-glass-bg);
  backdrop-filter: var(--m3-map-glass-backdrop);
  -webkit-backdrop-filter: var(--m3-map-glass-backdrop);
  border: 1px solid var(--m3-map-glass-border-fallback);
  border-color: var(--m3-map-glass-border);
  border-radius: 20px;
  box-shadow: var(--m3-map-glass-shadow);
  pointer-events: auto;
}

.m3-stats-toolbar-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}

.m3-stats-toolbar-collapse-btn {
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  color: var(--md-sys-color-on-surface-variant);
}

.m3-stats-toolbar-collapsed-pill {
  display: none;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--m3-map-glass-bg-fallback);
  background: var(--m3-map-glass-bg);
  backdrop-filter: var(--m3-map-glass-backdrop);
  -webkit-backdrop-filter: var(--m3-map-glass-backdrop);
  border: 1px solid var(--m3-map-glass-border-fallback);
  border-color: var(--m3-map-glass-border);
  box-shadow: var(--m3-map-glass-shadow);
  color: var(--md-sys-color-on-surface);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  pointer-events: auto;
}

.m3-stats-toolbar-collapsed-pill .material-symbols-outlined {
  font-size: 17px;
  color: var(--md-sys-color-primary);
}

.m3-stats-toolbar.is-collapsed {
  width: auto;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.m3-stats-toolbar.is-collapsed .m3-stats-toolbar-body {
  display: none;
}

.m3-stats-toolbar.is-collapsed .m3-stats-toolbar-collapsed-pill {
  display: inline-flex;
}

.m3-stats-season-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.m3-stats-level-switch {
  flex-shrink: 0;
}

.m3-stats-search-compact {
  margin: 0;
  flex: 1 1 180px;
  max-width: 280px;
  min-width: 140px;
}

.m3-stats-search-compact .m3-reports-search-bar {
  height: 32px;
  min-height: 32px;
  padding: 0 8px;
  border-radius: 999px;
}

.m3-stats-search-compact .m3-search-input {
  font-size: 12.5px;
}

#statsMapWrapper,
#viewStats .m3-stats-map-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: none;
  border-radius: 0;
  border: none;
  box-shadow: none;
}

#statsMapCanvas,
#viewStats .m3-stats-map-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.m3-stats-map-wrapper.is-season-hexagons-active .m3-stats-map-canvas .leaflet-tile-pane .leaflet-tile {
  filter: grayscale(35%) contrast(102%);
}

.m3-stats-map-zoom-hint {
  position: relative;
  top: auto;
  left: auto;
  z-index: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--md-sys-color-surface-container-lowest, #ffffff);
  color: var(--md-sys-color-on-surface);
  border: 1px solid var(--md-sys-color-outline-variant);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.14);
  font-size: 11.5px;
  font-weight: 600;
  pointer-events: none;
}

.m3-stats-map-zoom-hint.is-hexagon-active {
  display: none;
}

.m3-stats-map-zoom-hint .material-symbols-outlined {
  font-size: 15px;
  color: var(--md-sys-color-primary);
}

.m3-stats-snowflake-marker-container {
  background: transparent;
  border: none;
}

.m3-stats-snowflake-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #0369a1;
  color: #ffffff;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 8px rgba(3, 105, 161, 0.38);
  cursor: pointer;
  transition: transform 0.18s cubic-bezier(0.2, 0, 0, 1), background-color 0.18s ease, box-shadow 0.18s ease;
}

.m3-stats-snowflake-marker .material-symbols-outlined {
  font-size: 19px;
  line-height: 1;
  color: #ffffff;
}

.m3-stats-snowflake-marker:hover {
  transform: scale(1.12);
}

.m3-stats-snowflake-marker.is-selected {
  transform: scale(1.22);
  background: #0c4a6e;
  box-shadow: 0 0 0 3px rgba(3, 105, 161, 0.35), 0 4px 12px rgba(12, 74, 110, 0.48);
}

.m3-stats-map-card-overlay {
  max-width: 560px;
  z-index: 660;
}

.m3-stats-summary-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  border-radius: var(--md-shape-corner-medium);
  background: var(--md-sys-color-surface-container-lowest, #ffffff);
  color: var(--md-sys-color-on-surface);
  border: 1.5px solid var(--md-sys-color-primary);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.24), 0 2px 8px rgba(15, 23, 42, 0.14);
  cursor: pointer;
}

.m3-stats-summary-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-right: 30px;
}

.m3-stats-summary-overline-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.m3-stats-summary-overline {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--md-sys-color-primary);
}

.m3-stats-summary-subtitle {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--md-sys-color-on-surface-variant);
}

.m3-stats-summary-title {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.22;
  color: var(--md-sys-color-on-surface);
  margin: 0;
}

.m3-stats-summary-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.m3-stats-summary-kpi-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 6px 8px;
  border-radius: 10px;
  background: var(--md-sys-color-surface-container-low);
  border: 1px solid var(--md-sys-color-outline-variant);
  min-width: 0;
}

.m3-stats-summary-kpi-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.25px;
  color: var(--md-sys-color-on-surface-variant);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.m3-stats-summary-kpi-value {
  font-size: 14.5px;
  font-weight: 800;
  line-height: 1.2;
  color: var(--md-sys-color-on-surface);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.m3-stats-summary-kpi-sub {
  font-size: 10px;
  font-weight: 500;
  color: var(--md-sys-color-on-surface-variant);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.m3-stats-summary-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.m3-stats-summary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--md-sys-color-primary);
  background: var(--md-sys-color-surface-container-low);
  color: var(--md-sys-color-primary);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.m3-stats-summary-btn.primary {
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary, #ffffff);
}

.m3-stats-summary-btn .material-symbols-outlined {
  font-size: 16px;
}

.m3-stats-map-bottom-overlay > * {
  pointer-events: auto;
}

#viewStats #seasonEmptyState {
  position: absolute;
  inset: 96px 16px 24px 16px;
  z-index: 900;
  margin: auto;
  max-width: 460px;
  max-height: 260px;
}

@media (max-width: 480px) {
  .m3-stats-toolbar {
    padding: 6px 8px;
    gap: 6px;
  }
  .m3-stats-search-compact {
    max-width: none;
    flex: 1 1 100%;
  }
  .m3-stats-summary-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.m3-star-badge-marker {
  min-width: 38px;
  width: auto;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 2px 6px rgba(11, 37, 69, 0.32));
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.2, 0, 0, 1);
  background: transparent;
  border: none;
}

.m3-star-badge-marker:hover {
  transform: scale(1.2);
}

/* Tilastot-näkymän korttiruudukko ja tiivis järvikortti */
.m3-season-lakes-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.m3-season-card {
  background: var(--md-sys-color-surface-container);
  border: 1px solid rgba(11, 37, 69, 0.08);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 0;
  box-shadow: 0 2px 6px rgba(11, 37, 69, 0.08);
  transition: transform 0.2s ease, border-color 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.m3-season-card:hover {
  border-color: rgba(0, 99, 143, 0.3);
}

.m3-season-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.m3-season-card-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.m3-season-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.m3-season-level-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(0, 99, 143, 0.10);
  color: var(--md-sys-color-primary);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  flex-shrink: 0;
}

.m3-season-level-pill .material-symbols-outlined {
  font-size: 13px;
}

.m3-season-card-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--md-sys-color-on-surface);
  margin: 0;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.m3-season-card-meta {
  font-size: 13px;
  font-weight: 500;
  color: var(--md-sys-color-on-surface-variant);
  line-height: 1.3;
}

.m3-season-card-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.m3-season-card-header .btn-toggle-season-fullscreen,
.m3-season-card-header .btn-view-season-map {
  height: 34px;
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
  border-radius: 17px;
  gap: 5px;
  flex-shrink: 0;
}

.m3-season-card-header .btn-toggle-season-fullscreen {
  background: rgba(11, 37, 69, 0.06);
  color: var(--md-sys-color-on-surface);
  border: 1px solid rgba(11, 37, 69, 0.14);
}

.m3-season-card-header .btn-toggle-season-fullscreen:hover {
  background: rgba(11, 37, 69, 0.11);
}

.m3-season-card-header .btn-toggle-season-fullscreen[aria-expanded="true"] {
  background: #0F172A;
  color: #FFFFFF;
  border-color: #0F172A;
}

.m3-season-card-header .btn-toggle-season-fullscreen .material-symbols-outlined,
.m3-season-card-header .btn-view-season-map .material-symbols-outlined {
  font-size: 17px;
}

body.has-season-fullscreen {
  overflow: hidden;
}

.m3-season-card.is-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 2500;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  margin: 0;
  border-radius: 0;
  padding: 20px 24px;
  overflow-y: auto;
  background: var(--md-sys-color-surface, #F8FAFC);
  box-sizing: border-box;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.m3-season-card.is-fullscreen .m3-season-unified-time-panel {
  flex: 1 0 auto;
  justify-content: center;
  padding: 18px 20px;
}

/* Yhden ruudun (100dvh) joustava asettelu kausitilaston koko näytön graafille */
.m3-season-card:not(.m3-forecast-chart-card).is-fullscreen {
  padding: 14px 20px;
  gap: 10px;
  overflow-y: auto;
}

@media (min-height: 540px) {
  .m3-season-card:not(.m3-forecast-chart-card).is-fullscreen {
    overflow: hidden;
  }
}

.m3-season-card:not(.m3-forecast-chart-card).is-fullscreen > .m3-season-card-header {
  flex-shrink: 0;
  width: 100%;
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

.m3-season-unified-time-panel.has-season-profile-bar {
  position: relative;
  min-height: 288px;
  box-sizing: border-box;
}

.m3-season-card:not(.m3-forecast-chart-card).is-fullscreen .m3-season-unified-time-panel.has-season-profile-bar {
  position: relative;
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  box-sizing: border-box;
}

@media (min-width: 841px) {
  #viewReports .m3-view-scroll-content {
    max-width: 1120px;
  }

  .m3-season-unified-time-panel.has-season-profile-bar,
  .m3-season-card:not(.m3-forecast-chart-card).is-fullscreen .m3-season-unified-time-panel.has-season-profile-bar {
    padding-left: 188px;
  }

  .m3-season-unified-time-panel.has-season-profile-bar.is-profile-compact,
  .m3-season-card:not(.m3-forecast-chart-card).is-fullscreen .m3-season-unified-time-panel.has-season-profile-bar.is-profile-compact {
    padding-left: 124px;
  }

  .m3-season-unified-time-panel.has-season-profile-bar.is-profile-minimal,
  .m3-season-card:not(.m3-forecast-chart-card).is-fullscreen .m3-season-unified-time-panel.has-season-profile-bar.is-profile-minimal {
    padding-left: 70px;
  }
}

.m3-season-card:not(.m3-forecast-chart-card).is-fullscreen .m3-season-unified-time-panel .m3-season-chart-section {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.m3-season-card:not(.m3-forecast-chart-card).is-fullscreen .m3-season-unified-time-panel .m3-season-timeline-section {
  flex-shrink: 0;
  padding-top: 8px;
  gap: 6px;
}

/* Kausitilastojen osiot: Yhtenäinen aikajanakokonaisuus (Jään ja sään kehitys + Kausi-aikajana) */
.m3-season-dashboard-card {
  padding: 16px;
  gap: 14px;
}

.m3-season-unified-time-panel {
  background: rgba(11, 37, 69, 0.025);
  border: 1px solid rgba(11, 37, 69, 0.08);
  border-radius: 14px;
  padding: 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.m3-season-unified-time-panel.has-season-profile-bar.is-profile-minimal,
.m3-season-card:not(.m3-forecast-chart-card).is-fullscreen .m3-season-unified-time-panel.has-season-profile-bar.is-profile-minimal {
  padding-left: 68px;
}

.m3-season-section {
  background: rgba(11, 37, 69, 0.025);
  border: 1px solid rgba(11, 37, 69, 0.07);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.m3-season-unified-time-panel .m3-season-section {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  gap: 8px;
}

.m3-season-unified-time-panel .m3-season-timeline-section {
  padding-top: 12px;
  border-top: 1px dashed rgba(11, 37, 69, 0.12);
}

.m3-season-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.m3-season-chart-header-track {
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}

.m3-season-section-title {
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--md-sys-color-on-surface);
}

/* KAUSI-AIKAJANA (jaettu aikajana-akseli kehityskaavion alapuolella) */
.m3-season-timeline-axis-track {
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-sizing: border-box;
}

.m3-season-timeline-bar {
  position: relative;
  display: flex;
  align-items: stretch;
  width: 100%;
  height: 36px;
  border-radius: 8px;
  overflow: hidden;
  gap: 1.5px;
  background: rgba(11, 37, 69, 0.06);
  cursor: ew-resize;
}

.m3-tl-seg {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  min-width: 0;
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.m3-tl-seg-narrow {
  padding: 0;
}

.m3-tl-seg-narrow .m3-tl-seg-text {
  display: none;
}

.m3-tl-seg-text {
  overflow: hidden;
  text-overflow: ellipsis;
}

.m3-tl-seg-open {
  background: #DCE8F2;
  color: #1E3A52;
}

.m3-tl-seg-first {
  background: #B3E5FC;
  color: #01476B;
}

.m3-tl-seg-safe {
  background: linear-gradient(90deg, #0077A8 0%, #00897B 100%);
  color: #FFFFFF;
}

.m3-tl-seg-melt {
  background: #FFE0B2;
  color: #6D3B00;
}

.m3-tl-hover-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2.5px;
  background: #0F172A;
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.9);
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 3;
}

.m3-season-timeline-milestones {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 2px 0 0 0;
  width: 100%;
  box-sizing: border-box;
}

.m3-tl-milestone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 58px;
}

.m3-tl-ms-icon {
  font-size: 15px;
  line-height: 1.1;
}

.m3-tl-ms-date {
  font-size: 13.5px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--md-sys-color-on-surface);
}

.m3-tl-ms-caption {
  font-size: 12px;
  font-weight: 600;
  color: var(--md-sys-color-on-surface-variant);
}

.m3-tl-skate-track {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 150px;
}

.m3-tl-skate-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  color: #00695C;
  letter-spacing: 1px;
}

.m3-tl-skate-dots .dot {
  color: #00897B;
  font-weight: 900;
}

.m3-tl-skate-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(0, 137, 123, 0.14);
  color: #004D40;
  font-size: 12.5px;
  font-weight: 700;
}

.m3-tl-skate-bullet {
  color: #00897B;
  font-size: 11px;
}

.m3-season-timeline-months {
  position: relative;
  height: 20px;
  width: 100%;
  border-top: 1px solid rgba(11, 37, 69, 0.09);
  padding-top: 3px;
}

.m3-tl-month-label {
  position: absolute;
  transform: translateX(-50%);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--md-sys-color-on-surface-variant);
  white-space: nowrap;
}

/* JÄÄN JA SÄÄN KEHITYS (SVG-graafi + kelluva poikkileikkauspalkki / Onhover-tietolaatikko) */
.m3-season-chart-wrap {
  position: relative;
  width: 100%;
}

.m3-season-card:not(.m3-forecast-chart-card).is-fullscreen .m3-season-chart-wrap {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.m3-season-chart-svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: none;
  touch-action: pan-y;
}

.m3-season-card:not(.m3-forecast-chart-card).is-fullscreen .m3-season-chart-svg {
  max-height: calc(100dvh - 280px);
}

/* Kausigraafin vasemman reunan siirrettävä päivän poikkileikkauspalkki (.m3-season-profile-bar) */
.m3-season-profile-bar {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 25;
}

.m3-season-profile-bar.is-pinned {
  border-color: #0284c7;
  box-shadow: 0 0 0 1.5px rgba(2, 132, 199, 0.38), var(--md-sys-elevation-level2);
}

.m3-season-profile-bar.is-minimal {
  left: 0;
  top: 6px;
  border: none !important;
  box-shadow: none !important;
}

.m3-cell-skate-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  max-width: 100%;
  padding: 1.5px 6px;
  border-radius: 5px;
  background: rgba(0, 137, 123, 0.14);
  border: 1px solid rgba(0, 137, 123, 0.30);
  color: #004d40;
  font-size: 9.5px;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.m3-cell-profile-bar.is-compact .m3-cell-skate-badge {
  padding: 1.5px 4px;
  font-size: 9px;
}

@media (max-width: 480px) {
  .m3-season-unified-time-panel.has-season-profile-bar {
    min-height: 244px;
  }

  .m3-season-unified-time-panel.has-season-profile-bar.is-profile-minimal,
  .m3-season-card:not(.m3-forecast-chart-card).is-fullscreen .m3-season-unified-time-panel.has-season-profile-bar.is-profile-minimal {
    padding: 8px 6px 8px 62px;
  }

  .m3-season-profile-bar {
    left: 8px;
    top: 8px;
  }

  .m3-season-profile-bar.is-minimal {
    left: 0;
    top: 4px;
  }
}

.m3-chart-hover-capture {
  cursor: crosshair;
}

.m3-chart-hover-line {
  stroke: #0F172A;
  stroke-width: 1.5;
  stroke-dasharray: 3, 3;
  opacity: 0.75;
}

.m3-chart-hover-dot-ice {
  fill: #00638F;
  stroke: #FFFFFF;
  stroke-width: 2.2;
}

.m3-chart-hover-dot-ice.is-skatable {
  fill: #10B981;
}

.m3-chart-hover-dot-snow {
  fill: #E0F2FE;
  stroke: #0284C7;
  stroke-width: 2;
}

.m3-chart-hover-dot-fdd {
  fill: #5C6BC0;
  stroke: #FFFFFF;
  stroke-width: 2;
}

.m3-chart-hover-tooltip {
  position: static;
  width: 100%;
  height: 58px;
  min-height: 58px;
  max-height: 58px;
  box-sizing: border-box;
  border-radius: 9px;
  padding: 5px 12px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 4px;
  font-size: 12.5px;
  line-height: 1.25;
  overflow: hidden;
  font-variant-numeric: tabular-nums;
  transition: background-color 0.12s ease, border-color 0.12s ease;
}

.m3-chart-hover-tooltip.is-idle {
  background: rgba(11, 37, 69, 0.045);
  border: 1px dashed rgba(11, 37, 69, 0.16);
  color: var(--md-sys-color-on-surface-variant);
}

.m3-hover-idle-title {
  font-family: var(--font-sans, inherit) !important;
  font-size: 12.5px !important;
  font-weight: 700 !important;
  color: var(--md-sys-color-on-surface) !important;
}

.m3-hover-status-idle {
  background: rgba(11, 37, 69, 0.08);
  color: var(--md-sys-color-on-surface-variant);
}

.m3-hover-idle-text {
  font-size: 12px;
  font-weight: 500;
  color: var(--md-sys-color-on-surface-variant);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.m3-chart-hover-tooltip.is-active {
  background: rgba(15, 23, 42, 0.94);
  color: #F8FAFC;
  border: 1px solid rgba(15, 23, 42, 0.96);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
}

.m3-chart-hover-tooltip.is-pinned {
  border-color: #38BDF8;
  box-shadow: 0 0 0 1.5px rgba(56, 189, 248, 0.4), 0 2px 8px rgba(15, 23, 42, 0.15);
}

.m3-chart-hover-tooltip[hidden] {
  display: none !important;
}

.m3-hover-tt-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: nowrap;
  white-space: nowrap;
  height: 22px;
  min-height: 22px;
  max-height: 22px;
  overflow: hidden;
}

.m3-hover-tt-top-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
}

.m3-hover-pin-slot {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.m3-hover-tt-date {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 800;
  color: #FFFFFF;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.m3-chart-hover-tooltip.is-active .m3-hover-tt-date {
  min-width: 84px;
}

.m3-hover-status {
  display: inline-flex;
  align-items: center;
  padding: 1.5px 7px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

.m3-hover-status-skate {
  background: rgba(16, 185, 129, 0.25);
  color: #6EE7B7;
}

.m3-hover-status-safe {
  background: rgba(56, 189, 248, 0.22);
  color: #7DD3FC;
}

.m3-hover-status-first {
  background: rgba(186, 230, 253, 0.2);
  color: #BAE6FD;
}

.m3-hover-status-open {
  background: rgba(148, 163, 184, 0.22);
  color: #CBD5E1;
}

.m3-hover-tt-metrics {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
  width: 100%;
  flex-wrap: nowrap;
  white-space: nowrap;
  height: 22px;
  min-height: 22px;
  max-height: 22px;
  overflow: hidden;
  font-variant-numeric: tabular-nums;
}

.m3-chart-hover-tooltip.is-active .m3-hover-tt-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 25%));
  align-items: center;
  width: 100%;
}

.m3-hover-tt-metric {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #E2E8F0;
  font-size: 12.5px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding-right: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.m3-hover-tt-metric-sub {
  color: #CBD5E1;
  font-size: 12px;
  padding-left: 8px;
  border-left: 1px solid rgba(255, 255, 255, 0.16);
}

.m3-hover-tt-metric strong {
  font-family: var(--font-mono);
  font-weight: 800;
  color: #FFFFFF;
  font-variant-numeric: tabular-nums;
}

.m3-hover-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.m3-hover-dot-ice-ind {
  background: #38BDF8;
}

.m3-hover-dot-ice-ind.is-skatable {
  background: #10B981;
}

.m3-hover-dot-steel-ind {
  background: #0284C7;
}

.m3-hover-dot-snow-ind {
  background: #E0F2FE;
  box-shadow: inset 0 0 0 1.5px #38BDF8;
}

.m3-hover-dot-fdd-ind {
  background: #818CF8;
}

.m3-hover-unpin-btn {
  appearance: none;
  background: rgba(255, 255, 255, 0.14);
  color: #F8FAFC;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  width: 22px;
  height: 22px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.12s ease;
}

.m3-hover-unpin-btn:hover {
  background: rgba(255, 255, 255, 0.28);
}

.m3-chart-grid-line {
  stroke: rgba(11, 37, 69, 0.1);
  stroke-width: 1;
}

.m3-chart-safe-threshold-line {
  stroke: #00897B;
  stroke-width: 1.5;
  stroke-dasharray: 6, 5;
  opacity: 0.9;
}

.m3-chart-threshold-label {
  fill: #00695C;
  font-size: 12px;
  font-weight: 700;
}

.m3-chart-area-snow {
  pointer-events: none;
}

.m3-chart-line-snow {
  stroke: #0284C7;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.85;
}

.m3-chart-line-ice {
  stroke: #00638F;
  stroke-width: 2.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.m3-chart-line-skate {
  stroke: #10B981;
  stroke-width: 4.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.m3-chart-dot-skate {
  fill: #10B981;
  stroke: #FFFFFF;
  stroke-width: 1.5;
}

.m3-chart-line-fdd {
  stroke: #5C6BC0;
  stroke-width: 2.2;
  stroke-dasharray: 6, 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.m3-chart-dot-peak {
  fill: #00638F;
  stroke: #FFFFFF;
  stroke-width: 2;
}

.m3-chart-peak-stem {
  stroke: rgba(0, 99, 143, 0.4);
  stroke-width: 1.3;
  stroke-dasharray: 2, 2;
}

.m3-chart-peak-title {
  fill: var(--md-sys-color-on-surface-variant);
  font-size: 11.5px;
  font-weight: 700;
}

.m3-chart-peak-value {
  fill: var(--md-sys-color-on-surface);
  font-size: 13.5px;
  font-weight: 800;
}

.m3-chart-dot-fdd {
  fill: #5C6BC0;
  stroke: #FFFFFF;
  stroke-width: 1.5;
}

.m3-chart-fdd-end-label {
  fill: #3949AB;
  font-size: 12.5px;
  font-weight: 800;
}

.m3-chart-axis-text {
  font-size: 12.5px;
  font-weight: 700;
  fill: var(--md-sys-color-on-surface-variant);
}

.m3-chart-unit-label {
  font-size: 12.5px;
  font-weight: 800;
  fill: var(--md-sys-color-on-surface);
}

.m3-chart-month-text {
  font-size: 12.5px;
  font-weight: 700;
  fill: var(--md-sys-color-on-surface-variant);
}

.m3-season-chart-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  padding-top: 2px;
}

.m3-chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
  color: var(--md-sys-color-on-surface);
}

.m3-chart-legend-line {
  display: inline-block;
  width: 22px;
  height: 0;
}

.m3-chart-legend-box {
  display: inline-block;
  width: 18px;
  height: 9px;
  border-radius: 3px;
  box-sizing: border-box;
}

.m3-legend-box-snow {
  background: linear-gradient(180deg, rgba(125, 211, 252, 0.78) 0%, rgba(224, 242, 254, 0.58) 100%);
  border: 1.5px solid #0284C7;
}

.m3-legend-line-ice {
  border-top: 3px solid #00638F;
}

.m3-legend-line-skate {
  border-top: 4px solid #10B981;
}

.m3-legend-line-safe-threshold {
  border-top: 2px dashed #00897B;
}

.m3-legend-line-fdd {
  border-top: 2.5px dashed #5C6BC0;
}

.m3-season-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(11, 37, 69, 0.05);
}

@media (max-width: 600px) {
  #viewStats .m3-view-header {
    margin-bottom: 8px;
  }
  #viewStats .m3-view-header .m3-headline-large {
    font-size: 20px;
    margin-bottom: 2px;
  }
  #viewStats .m3-view-header .m3-body-medium {
    font-size: 13px;
    line-height: 1.35;
  }
  #viewStats .m3-segmented-tabs-container {
    margin-bottom: 8px;
  }
  #viewStats .m3-tab-item {
    min-height: 36px;
    font-size: 13.5px;
    padding: 0 12px;
  }
  #viewStats .m3-report-filters-card {
    padding: 10px 12px;
    margin-bottom: 10px;
    gap: 8px;
    border-radius: 14px;
  }
  #viewStats .m3-filter-chips-wrap,
  #viewStats .m3-filter-chips-row {
    gap: 6px;
    padding: 2px 0 4px 0;
    max-height: 118px;
  }
  #viewStats .m3-filter-chip {
    height: 32px;
    min-height: 32px;
    padding: 0 11px;
    font-size: 13px;
  }
  .m3-season-lakes-grid {
    gap: 10px;
  }
  .m3-season-card,
  .m3-season-dashboard-card {
    padding: 12px 12px;
    gap: 12px;
    border-radius: 12px;
  }
  .m3-season-card.is-fullscreen {
    border-radius: 0;
    padding: 14px 12px;
  }
  .m3-season-card:not(.m3-forecast-chart-card).is-fullscreen {
    border-radius: 0;
    padding: 10px 10px;
    gap: 8px;
  }
  .m3-season-card:not(.m3-forecast-chart-card).is-fullscreen .m3-season-unified-time-panel.has-season-profile-bar {
    padding: 10px 10px;
    gap: 8px;
  }
  .m3-season-card:not(.m3-forecast-chart-card).is-fullscreen .m3-season-chart-svg {
    max-height: calc(100dvh - 290px);
  }
  .m3-season-card:not(.m3-forecast-chart-card).is-fullscreen .m3-season-unified-time-panel .m3-season-timeline-section {
    padding-top: 6px;
    gap: 4px;
  }
  .m3-season-card:not(.m3-forecast-chart-card).is-fullscreen .m3-season-timeline-bar {
    height: 28px;
  }
  .m3-season-card:not(.m3-forecast-chart-card).is-fullscreen .m3-season-timeline-milestones {
    gap: 6px;
  }
  .m3-season-card:not(.m3-forecast-chart-card).is-fullscreen .m3-season-chart-legend {
    gap: 10px;
  }
  .m3-season-unified-time-panel {
    padding: 11px 10px;
    gap: 12px;
  }
  .m3-season-unified-time-panel.has-season-profile-bar.is-profile-minimal,
  .m3-season-card:not(.m3-forecast-chart-card).is-fullscreen .m3-season-unified-time-panel.has-season-profile-bar.is-profile-minimal {
    padding: 10px 8px 10px 66px;
  }
  .m3-season-section {
    padding: 10px 10px;
    gap: 8px;
  }
  .m3-season-card-title {
    font-size: 16px;
  }
  .m3-season-card-meta {
    font-size: 12.5px;
  }
  .m3-season-section-title {
    font-size: 12px;
  }
  .m3-chart-hover-tooltip {
    padding: 5px 8px;
  }
  .m3-hover-tt-metric,
  .m3-hover-tt-metric-sub {
    font-size: 11px;
    gap: 3.5px;
    padding-left: 5px;
    padding-right: 2px;
  }
  .m3-hover-tt-metrics > .m3-hover-tt-metric:first-child {
    padding-left: 0;
  }
  .m3-season-timeline-bar {
    height: 32px;
  }
  .m3-tl-seg {
    font-size: 11.5px;
    padding: 0 4px;
  }
  .m3-tl-ms-date {
    font-size: 13px;
  }
  .m3-tl-ms-caption {
    font-size: 11.5px;
  }
  .m3-tl-skate-pill {
    font-size: 12px;
    padding: 4px 10px;
  }
  .m3-tl-month-label {
    font-size: 12px;
  }
  .m3-chart-legend-item {
    font-size: 12.5px;
  }
}

@media (max-width: 480px) {
  .m3-season-unified-time-panel.has-season-profile-bar.is-profile-minimal,
  .m3-season-card:not(.m3-forecast-chart-card).is-fullscreen .m3-season-unified-time-panel.has-season-profile-bar.is-profile-minimal {
    padding: 8px 6px 8px 62px;
  }
}

/* Mobiilisovitus alapalkille 4 tabin kanssa */
@media (max-width: 400px) {
  .m3-nav-indicator {
    width: 52px;
    height: 28px;
  }
  .m3-nav-label {
    font-size: 11px;
  }
}


/* Jäätutka-brändilogo hakupalkin alussa */
.m3-brand-logo {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  margin-right: 4px;
  object-fit: contain;
}

/* ==============================================================================
   Jäätutka: kirjautuminen, tasomerkki, paywall ja lukitut näkymät
   ============================================================================== */
.m3-auth-signin {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 36px;
  padding: 0 12px;
  border: none;
  border-radius: var(--md-shape-corner-full);
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 0.15s ease;
}
.m3-auth-signin:hover { background: #1C3F6E; }
.m3-auth-signin .material-symbols-outlined { font-size: 20px; }

.m3-user-button-mount {
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: 2px;
}

.m3-tier-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 26px;
  padding: 0 10px;
  border-radius: var(--md-shape-corner-full);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  border: 1px solid rgba(0, 99, 143, 0.2);
  flex-shrink: 0;
  white-space: nowrap;
}
.m3-tier-badge.tier-pro {
  background: rgba(16, 185, 129, 0.14);
  color: #047857;
  border-color: rgba(16, 185, 129, 0.3);
}
.m3-tier-badge.tier-admin {
  background: var(--md-sys-color-tertiary-container);
  color: var(--md-sys-color-on-tertiary-container);
  border-color: rgba(179, 63, 16, 0.28);
}

@media (max-width: 420px) {
  .m3-auth-signin-label { display: none; }
  .m3-auth-signin { padding: 0 8px; }
}

#viewMap .m3-auth-signin {
  background: rgba(11, 37, 69, 0.78);
  background: color-mix(in srgb, var(--md-sys-color-primary) 78%, transparent);
  backdrop-filter: var(--m3-map-glass-backdrop);
  -webkit-backdrop-filter: var(--m3-map-glass-backdrop);
  border: 1px solid rgba(255, 255, 255, 0.18);
}
#viewMap .m3-auth-signin:hover {
  background: rgba(28, 63, 110, 0.86);
  background: color-mix(in srgb, #1C3F6E 86%, transparent);
}

/* Karttanäkymän lukituskehote */
.m3-map-lock-banner {
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: var(--md-shape-corner-large);
  background: var(--glass-bg-high);
  border: var(--glass-border);
  box-shadow: var(--md-elevation-1);
  color: var(--md-sys-color-on-surface);
  font-size: 13px;
  pointer-events: auto;
}
#viewMap .m3-map-lock-banner,
#viewStats .m3-map-lock-banner {
  background: var(--m3-map-glass-bg-fallback);
  background: var(--m3-map-glass-bg);
  backdrop-filter: var(--m3-map-glass-backdrop);
  -webkit-backdrop-filter: var(--m3-map-glass-backdrop);
  border: 1px solid var(--m3-map-glass-border-fallback);
  border-color: var(--m3-map-glass-border);
  box-shadow: var(--m3-map-glass-shadow);
}
.m3-map-lock-banner .material-symbols-outlined { font-size: 18px; color: var(--md-sys-color-tertiary); }
.m3-map-lock-btn {
  margin-left: auto;
  border: none;
  background: transparent;
  color: var(--md-sys-color-secondary);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
}
.m3-map-lock-banner.m3-pulse { animation: m3LockPulse 0.6s ease 2; }
@keyframes m3LockPulse {
  50% { box-shadow: 0 0 0 4px rgba(179, 63, 16, 0.25); }
}

/* Lukitut päänäkymät: vain paywall-kortti näkyy */
.m3-view.is-locked > :not(#paywallCard) { display: none !important; }

.m3-paywall-card {
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 420px;
  margin: 48px auto;
  padding: 28px 24px;
  border-radius: var(--md-shape-corner-extra-large);
  background: var(--md-sys-color-surface-container-lowest);
  border: var(--glass-border);
  box-shadow: var(--md-elevation-2);
  text-align: center;
  color: var(--md-sys-color-on-surface);
}
.m3-paywall-title { font-size: 20px; font-weight: 700; color: var(--md-sys-color-primary); }
.m3-paywall-lead { font-size: 14px; color: var(--md-sys-color-on-surface-variant); line-height: 1.5; }
.m3-paywall-list {
  list-style: none;
  text-align: left;
  font-size: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.m3-paywall-list li::before { content: "✓"; color: var(--ice-safe); font-weight: 700; margin-right: 8px; }
.m3-paywall-btn { width: 100%; justify-content: center; min-height: 44px; }
.m3-paywall-ended { font-size: 14px; font-weight: 600; color: var(--md-sys-color-tertiary); }
.m3-paywall-legal { font-size: 12px; color: var(--md-sys-color-on-surface-variant); }
.m3-paywall-legal a { color: var(--md-sys-color-secondary); }

/* Kirjautumisikkuna (Clerk SignIn), ei estä muuta käyttöä */
.m3-auth-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(11, 28, 44, 0.55);
}
.m3-auth-modal-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-height: 92vh;
  overflow-y: auto;
  padding: 24px 16px 16px;
  border-radius: var(--md-shape-corner-extra-large);
  background: var(--md-sys-color-surface-container-lowest);
  box-shadow: var(--md-sys-elevation-level5);
}
.m3-auth-modal-close { position: absolute; top: 8px; right: 8px; }
.m3-auth-modal-mount { width: 100%; min-width: 280px; max-width: 340px; display: flex; flex-direction: column; }

/* Stripe Embedded Checkout -modal */
.m3-checkout-modal-card {
  width: 100%;
  max-width: 580px;
  max-height: 94vh;
  padding: 24px 20px 20px;
}
.m3-checkout-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  width: 100%;
}
.m3-checkout-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--md-sys-color-primary);
  margin: 4px 0 0;
}
.m3-checkout-subtitle {
  font-size: 13px;
  color: var(--md-sys-color-on-surface-variant);
  margin: 0 0 8px;
}
.m3-checkout-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 36px 16px;
  color: var(--md-sys-color-on-surface-variant);
  font-size: 14px;
}
.m3-checkout-loading .m3-calc-spinner {
  font-size: 32px;
}
.m3-stripe-checkout-mount {
  width: 100%;
  min-height: 380px;
}

/* Firebase Auth -lomake ja painikkeet */
.m3-auth-form { width: 100%; display: flex; flex-direction: column; gap: 12px; }
.m3-auth-title { font-size: 18px; font-weight: 600; color: var(--md-sys-color-on-surface); text-align: center; margin: 0 0 4px; }
.m3-auth-pass-info {
  background: var(--md-sys-color-surface-container-low);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--md-sys-color-on-surface-variant);
  text-align: center;
}
.m3-auth-pass-info strong {
  color: var(--md-sys-color-on-surface);
  font-weight: 600;
}
.m3-auth-google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 8px 16px;
  border-radius: 9999px;
  border: 1px solid var(--md-sys-color-outline-variant);
  background: var(--md-sys-color-surface-container-low);
  color: var(--md-sys-color-on-surface);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
.m3-auth-google-btn:hover {
  background: var(--md-sys-color-surface-container-high);
  box-shadow: var(--md-sys-elevation-level1);
}
.m3-auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--md-sys-color-outline);
  font-size: 12px;
  margin: 6px 0;
}
.m3-auth-divider::before,
.m3-auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}
.m3-auth-divider span { padding: 0 10px; }
.m3-auth-input-group { display: flex; flex-direction: column; gap: 4px; text-align: left; }
.m3-auth-input-group label { font-size: 12px; font-weight: 500; color: var(--md-sys-color-on-surface-variant); }
.m3-auth-input-group input {
  height: 42px;
  padding: 0 12px;
  border-radius: var(--md-shape-corner-small);
  border: 1px solid var(--md-sys-color-outline-variant);
  background: var(--md-sys-color-surface);
  color: var(--md-sys-color-on-surface);
  font-family: inherit;
  font-size: 14px;
  box-sizing: border-box;
}
.m3-auth-input-group input:focus {
  outline: none;
  border-color: var(--md-sys-color-primary);
  box-shadow: 0 0 0 2px rgba(2, 136, 209, 0.2);
}
.m3-auth-error {
  padding: 8px 12px;
  border-radius: var(--md-shape-corner-small);
  background: #FFEBEE;
  color: #C62828;
  font-size: 13px;
  line-height: 1.4;
  text-align: left;
}
.m3-auth-success {
  padding: 8px 12px;
  border-radius: var(--md-shape-corner-small);
  background: #E8F5E9;
  color: #2E7D32;
  font-size: 13px;
  line-height: 1.4;
  text-align: left;
}
.m3-auth-submit-btn { width: 100%; min-height: 44px; justify-content: center; margin-top: 4px; }
.m3-auth-toggle-link {
  background: none;
  border: none;
  color: var(--md-sys-color-primary);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  padding: 4px;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.m3-auth-toggle-link:hover { opacity: 0.85; }

/* Käyttäjäprofiilipainike ja valikko yläpalkissa */
.m3-user-avatar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
  flex-shrink: 0;
}
.m3-user-avatar-btn:hover {
  background: rgba(0, 99, 143, 0.08);
  border-color: var(--md-sys-color-primary);
  transform: scale(1.05);
}
.m3-user-avatar-btn:active {
  transform: scale(0.95);
}
.m3-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 2px 10px 2px 2px;
  border-radius: 9999px;
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface);
  border: 1px solid var(--md-sys-color-outline-variant);
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
}
.m3-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
}
.m3-user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.m3-user-dropdown {
  position: absolute;
  top: 48px;
  right: 12px;
  z-index: 2500;
  min-width: 240px;
  padding: 12px;
  border-radius: var(--md-shape-corner-medium);
  background: var(--md-sys-color-surface-container-lowest);
  box-shadow: var(--md-sys-elevation-level3);
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}
.m3-user-dropdown-name { font-size: 14px; font-weight: 700; color: var(--md-sys-color-on-surface); word-break: break-word; }
.m3-user-dropdown-email { font-size: 12px; font-weight: 500; color: var(--md-sys-color-on-surface-variant); word-break: break-all; }
.m3-user-dropdown-status { font-size: 12px; color: var(--md-sys-color-on-surface-variant); }
.m3-user-dropdown-divider { height: 1px; background: var(--md-sys-color-outline-variant); margin: 4px 0; }
.m3-user-dropdown-btn {
  width: 100%;
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}

/* Käyttäjätili-kortti Asetukset-näkymässä (#settingsAccountCard) */
.m3-settings-user-mount {
  width: 100%;
  margin-left: 0;
}
.m3-settings-account-box {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--md-shape-corner-medium);
  background: var(--md-sys-color-surface-container-lowest);
  border: 1px solid var(--md-sys-color-outline-variant);
}
.m3-settings-account-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.m3-settings-user-avatar {
  width: 44px;
  height: 44px;
  font-size: 16px;
  flex-shrink: 0;
}
.m3-settings-account-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.m3-settings-account-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(11, 37, 69, 0.08);
}
.m3-settings-signout-btn {
  color: var(--md-sys-color-error);
  border-color: rgba(186, 26, 26, 0.35);
}
.m3-settings-signout-btn:hover:not(:disabled) {
  background: rgba(186, 26, 26, 0.08);
  border-color: var(--md-sys-color-error);
  color: var(--md-sys-color-error);
}
.m3-settings-account-anon {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--md-shape-corner-medium);
  background: var(--md-sys-color-surface-container-lowest);
  border: 1px solid var(--md-sys-color-outline-variant);
}

/* Datatasojen ohjaimet piiloon, kun käyttäjällä ei ole Pro-oikeutta */
body.data-locked #btnAnalyze,
body.data-locked #btnToggleHexLayer { display: none !important; }

/* Lukkoikoni navigaatiossa lukituille näkymille */
body.data-locked .m3-nav-item[data-view="reports"] .m3-nav-label::after,
body.data-locked .m3-nav-item[data-view="favorites"] .m3-nav-label::after,
body.data-locked .m3-nav-item[data-view="stats"] .m3-nav-label::after {
  content: "lock";
  font-family: 'Material Symbols Outlined';
  font-size: 11px;
  margin-left: 2px;
  vertical-align: -1px;
}

/* ==============================================================================
   10. PWA PÄIVITYSBANNERI (.m3-update-banner)
   ============================================================================== */
.m3-update-banner {
  position: fixed;
  bottom: 88px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 24px);
  max-width: 520px;
  background: var(--md-sys-color-inverse-surface, #1e293b);
  color: var(--md-sys-color-inverse-on-surface, #f8fafc);
  border-radius: 16px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 8px 24px rgba(11, 37, 69, 0.28), 0 2px 8px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.12);
  z-index: 10000;
  animation: m3BannerSlideUp 0.3s cubic-bezier(0, 0, 0.2, 1);
}

@keyframes m3BannerSlideUp {
  from {
    opacity: 0;
    transform: translate(-50%, 20px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

.m3-update-banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.m3-update-icon {
  font-size: 24px;
  color: #fbbf24;
  flex-shrink: 0;
}

.m3-update-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.m3-update-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.m3-update-subtitle {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.m3-update-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.m3-btn-update {
  height: 36px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 700;
  background: var(--md-sys-color-primary, #00638f);
  color: #fff;
  border: none;
  border-radius: 18px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

.m3-btn-update:hover {
  background: #007bb0;
}

.m3-btn-update:active {
  transform: scale(0.96);
}

.m3-update-actions .m3-icon-btn {
  color: rgba(255, 255, 255, 0.7);
  width: 32px;
  height: 32px;
}

.m3-update-actions .m3-icon-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

@media (max-width: 480px) {
  .m3-update-banner {
    bottom: 80px;
    padding: 10px 12px;
    gap: 8px;
  }
  .m3-update-subtitle {
    display: none;
  }
}

/* ==============================================================================
   19. PÄIVÄKOOSTE (Daily Digest View, Accordion & Compact Cards)
   ============================================================================== */
.m3-digest-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  margin-bottom: 12px;
  background: var(--md-sys-color-surface-container-low);
  border-radius: var(--md-shape-corner-medium);
  border: 1px solid var(--md-sys-color-outline-variant);
}

.m3-digest-toolbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.m3-digest-toolbar .m3-icon-btn {
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
  padding: 0;
}

.m3-digest-toolbar .m3-icon-btn .material-symbols-outlined {
  font-size: 18px;
}

.m3-digest-status-line {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  color: var(--md-sys-color-on-surface-variant);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.m3-digest-status-line .status-icon {
  font-size: 14px;
}

.m3-digest-distance-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(2, 132, 199, 0.12);
  color: #0369a1;
  border: 1px solid rgba(2, 132, 199, 0.25);
  white-space: nowrap;
}

/* Kartan paikannus- ja seurantapainikkeen tilat */
.m3-search-locate.is-tracking {
  color: #0284c7;
  background: rgba(2, 132, 199, 0.12);
}

.m3-search-locate.is-following {
  color: #ffffff;
  background: #0284c7;
  box-shadow: 0 1px 4px rgba(2, 132, 199, 0.35);
}

@media (max-width: 420px) {
  .m3-digest-status-line #digestStatusText {
    display: none;
  }
}

/* Järvikohtaiset haitariryhmät (Accordion) – vain yksi auki kerrallaan, avoin otsikko kiinnittyy ylälaitaan */
.m3-digest-lake-section {
  position: relative;
  margin-bottom: 14px;
}

.m3-digest-lake-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-shape-corner-medium);
  font-family: inherit;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  margin-bottom: 10px;
}

/* Avoinna olevan järven valitsin kiinnittyy ruudun ylälaitaan (sticky) */
.m3-digest-lake-section:not(.collapsed) > .m3-digest-lake-header {
  position: sticky;
  top: 0;
  z-index: 25;
  background: var(--md-sys-color-surface-container-high);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-color: var(--md-sys-color-primary);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

/* Suljetun järven valitsin ei ole kiinnitetty, vaan saa rullautua ulos ruudusta */
.m3-digest-lake-section.collapsed > .m3-digest-lake-header {
  position: static;
  z-index: auto;
  box-shadow: none;
  margin-bottom: 0;
}

.m3-digest-lake-header:hover {
  background: var(--md-sys-color-surface-container-high);
  border-color: var(--md-sys-color-primary);
}

.m3-digest-lake-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.m3-digest-lake-title-wrap .lake-icon {
  font-size: 20px;
  color: var(--md-sys-color-primary);
}

.m3-digest-lake-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--md-sys-color-on-surface);
}

.m3-digest-lake-count {
  font-size: 11px;
  background: rgba(2, 132, 199, 0.12);
  color: #0284c7;
  padding: 1px 7px;
  border-radius: 9999px;
  font-weight: 600;
}

.m3-digest-lake-chevron {
  font-size: 22px;
  color: var(--md-sys-color-on-surface-variant);
  transition: transform 0.2s ease;
}

.m3-digest-lake-section.collapsed .m3-digest-lake-chevron {
  transform: rotate(-90deg);
}

.m3-digest-lake-body {
  transition: max-height 0.25s ease, opacity 0.2s ease;
}

.m3-digest-lake-section.collapsed .m3-digest-lake-body {
  display: none;
}

.m3-digest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

/* Tiivis koostekortti visuaalisella minigraafilla (nykyisen kortin kokoinen) */
.m3-digest-card {
  display: flex;
  flex-direction: column;
  background: var(--md-sys-color-surface-container-low);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-shape-corner-medium);
  padding: 11px 13px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  user-select: none;
  position: relative;
  overflow: hidden;
}

.m3-digest-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--md-sys-elevation-level2);
  border-color: var(--md-sys-color-primary);
}

.m3-digest-card:active {
  transform: scale(0.99);
}

.m3-digest-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 9px;
}

.m3-digest-card-title-col {
  min-width: 0;
  flex: 1 1 auto;
}

.m3-digest-basin-name {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--md-sys-color-on-surface);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.m3-digest-basin-sub {
  font-size: 11.5px;
  color: var(--md-sys-color-on-surface-variant);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.m3-digest-card-badges {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.m3-digest-star {
  color: #f59e0b;
  font-size: 18px;
  flex-shrink: 0;
}

.m3-digest-fav-btn {
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  flex-shrink: 0;
}

.m3-digest-fav-btn .material-symbols-outlined {
  font-size: 17px;
}

.m3-digest-badge-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.m3-skating-badge,
.m3-digest-skating-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 9999px;
  font-size: 11.5px;
  font-weight: 600;
  color: #fff;
  line-height: 1.2;
}

.m3-skating-badge .stars,
.m3-digest-skating-badge .stars {
  letter-spacing: 0.4px;
  font-size: 11px;
  font-weight: 700;
}

.m3-skating-badge .skating-label {
  font-weight: 600;
}

.m3-digest-bearing-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2.5px 7px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
}

.m3-digest-bearing-badge.safe {
  background: rgba(46, 125, 50, 0.12);
  color: #2e7d32;
}

.m3-digest-bearing-badge.warning {
  background: rgba(230, 81, 0, 0.12);
  color: #e65100;
}

.m3-digest-bearing-badge.danger {
  background: rgba(198, 40, 40, 0.12);
  color: #c62828;
}

.m3-digest-bearing-badge.unknown {
  background: rgba(100, 116, 139, 0.12);
  color: #64748b;
}

/* Kuluvan päivän runko kortin sisällä (vain TÄNÄÄN-tiedot ja kantavuuspalkki) */
.m3-digest-visual-body {
  display: block;
  background: var(--md-sys-color-surface-container);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: var(--md-shape-corner-small);
  padding: 7px 10px;
}

.m3-digest-today-focus {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.m3-digest-today-top-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.m3-digest-today-header-row {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
}

.m3-digest-today-pill {
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 1.5px 5.5px;
  border-radius: 4px;
  background: #0284c7;
  color: #ffffff;
  line-height: 1.2;
}

.m3-digest-weather-chip {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  line-height: 1.2;
}

.m3-digest-weather-chip.is-freezing {
  background: rgba(2, 132, 199, 0.14);
  color: #0369a1;
}

.m3-digest-weather-chip.is-thaw {
  background: rgba(234, 88, 12, 0.14);
  color: #c2410c;
}

.m3-digest-weather-chip.is-neutral {
  background: rgba(100, 116, 139, 0.12);
  color: #64748b;
}

.m3-digest-snow-chip {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--md-sys-color-on-surface-variant);
  white-space: nowrap;
}

.m3-digest-today-ice-main {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}

.m3-digest-today-ice-val {
  font-size: 19px;
  font-weight: 800;
  color: var(--md-sys-color-on-surface);
  line-height: 1.05;
  letter-spacing: -0.3px;
  flex-shrink: 0;
}

.m3-digest-today-ice-val small {
  font-size: 11px;
  font-weight: 700;
  margin-left: 1.5px;
  color: var(--md-sys-color-on-surface-variant);
}

.m3-digest-today-ice-meta {
  font-size: 10px;
  color: var(--md-sys-color-on-surface-variant);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Kuluvan päivän jääkerros- ja kantavuuspalkki (0..15+ cm) */
.m3-digest-ice-bar-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.m3-digest-ice-bar-track {
  position: relative;
  height: 7px;
  width: 100%;
  background: rgba(148, 163, 184, 0.22);
  border-radius: 999px;
  display: flex;
  overflow: visible;
}

.m3-digest-ice-bar-steel {
  height: 100%;
  background: linear-gradient(90deg, #0369a1 0%, #0284c7 100%);
  border-radius: 999px 0 0 999px;
  transition: width 0.25s ease;
}

.m3-digest-ice-bar-snowice {
  height: 100%;
  background: #38bdf8;
  border-radius: 0 999px 999px 0;
  transition: width 0.25s ease;
}

.m3-digest-bar-tick {
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 1.5px;
  pointer-events: none;
}

.m3-digest-bar-tick.tick-4 {
  background: #f59e0b;
}

.m3-digest-bar-tick.tick-10 {
  background: #10b981;
}

.m3-digest-ice-bar-scale {
  display: flex;
  justify-content: space-between;
  font-size: 8.5px;
  font-weight: 600;
  color: var(--md-sys-color-on-surface-variant);
  line-height: 1;
}

.m3-digest-ice-bar-scale .scale-4 {
  color: #d97706;
}

.m3-digest-ice-bar-scale .scale-10 {
  color: #059669;
}

/* Oikeanpuoleinen SVG-minigraafi */
.m3-digest-mini-svg-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: 60px;
}

.m3-digest-mini-svg {
  width: 100%;
  height: 60px;
  display: block;
  overflow: visible;
}

.m3-digest-svg-today-pillar {
  fill: rgba(2, 132, 199, 0.11);
  stroke: rgba(2, 132, 199, 0.26);
  stroke-width: 0.8;
}

.m3-digest-svg-today-lbl {
  font-size: 7.5px;
  font-weight: 800;
  fill: #0284c7;
  letter-spacing: 0.3px;
}

.m3-digest-svg-trend-lbl {
  font-size: 8px;
  font-weight: 700;
  fill: #475569;
}

.m3-digest-svg-Hint {
  font-size: 8.5px;
  font-weight: 600;
  fill: #94a3b8;
}

.m3-digest-demo-suggestions {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--md-sys-color-outline-variant);
}

/* Pelkistetty monochrome-koostekartta ja kelluva koostekortti (#digestMapWrapper) */
.m3-digest-map-wrapper:not(.m3-stats-map-wrapper) {
  position: relative;
  width: 100%;
  height: calc(100dvh - 186px - var(--m3-header-height, 0px));
  min-height: 420px;
  max-height: 760px;
  border-radius: var(--md-shape-corner-medium);
  border: 1px solid var(--md-sys-color-outline-variant);
  overflow: hidden;
  background: #e2e8f0;
  box-shadow: var(--md-sys-elevation-level1);
}

.m3-digest-map-canvas {
  width: 100%;
  height: 100%;
  background: #e2e8f0;
}

/* Pelkistetty monochrome-suodatin vain OSM-pohjakartan tiilille – tähdet ja kortti säilyttävät värinsä */
.m3-digest-map-canvas .leaflet-tile-pane .leaflet-tile {
  filter: grayscale(75%) contrast(105%);
}

.m3-digest-map-canvas .leaflet-marker-pane,
.m3-digest-map-canvas .m3-star-badge-container,
.m3-digest-map-canvas .m3-digest-star-marker {
  filter: none;
}

.m3-star-badge-container,
.m3-digest-star-marker-container {
  background: transparent;
  border: none;
}

.m3-digest-star-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.2, 0, 0, 1);
}

.m3-digest-star-marker.is-selected .m3-star-badge-marker {
  transform: scale(1.22);
  filter: drop-shadow(0 2px 8px rgba(11, 37, 69, 0.45));
}

.m3-digest-map-card-overlay {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  max-width: 520px;
  margin: 0 auto;
  z-index: 650;
  animation: m3DigestCardPopUp 0.18s cubic-bezier(0.2, 0, 0, 1);
}

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

.m3-digest-map-card-overlay .m3-digest-card {
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.24), 0 2px 8px rgba(15, 23, 42, 0.14);
  border-color: var(--md-sys-color-primary);
  background: var(--md-sys-color-surface-container-lowest, #ffffff);
  padding-right: 38px;
}

.m3-digest-map-card-close {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 5;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--md-sys-color-outline-variant);
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface-variant);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s ease, color 0.15s ease;
}

.m3-digest-map-card-close:hover {
  background: var(--md-sys-color-surface-container-highest, #cbd5e1);
  color: var(--md-sys-color-on-surface);
}

.m3-digest-map-card-close .material-symbols-outlined {
  font-size: 16px;
}

@media (max-width: 480px) {
  .m3-digest-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .m3-digest-card {
    padding: 10px 12px;
  }
  .m3-digest-visual-body {
    padding: 6px 8px;
  }
  .m3-digest-map-wrapper:not(.m3-stats-map-wrapper) {
    height: calc(100dvh - 172px);
    min-height: 360px;
  }
  .m3-digest-map-card-overlay {
    left: 8px;
    right: 8px;
    bottom: 8px;
  }
}

/* ==============================================================================
   22. SETTINGS & GUIDE VIEW (#viewSettings)
   ============================================================================== */
#viewSettings .m3-view-header {
  max-width: 820px;
  margin: 0 auto 16px auto;
}

.m3-settings-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 820px;
  margin: 0 auto 24px auto;
}

.m3-settings-card {
  padding: 20px;
  border-radius: var(--md-shape-corner-large);
  background: var(--md-sys-color-surface-container-low);
  border: 1px solid var(--md-sys-color-outline-variant);
  box-shadow: 0 1px 4px rgba(11, 37, 69, 0.06);
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 0;
}

.m3-settings-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.m3-settings-title-wrap {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 1;
  min-width: 220px;
}

.m3-settings-icon {
  font-size: 24px;
  color: var(--md-sys-color-on-primary-container);
  background: var(--md-sys-color-primary-container);
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.m3-pwa-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 26px;
  padding: 0 10px;
  border-radius: var(--md-shape-corner-full);
  font-size: 12px;
  font-weight: 600;
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface-variant);
  border: 1px solid var(--md-sys-color-outline-variant);
  white-space: nowrap;
  flex-shrink: 0;
}

.m3-pwa-status-badge.installed {
  background: rgba(16, 185, 129, 0.14);
  color: #047857;
  border-color: rgba(16, 185, 129, 0.3);
}

.m3-pwa-install-banner {
  padding: 14px 16px;
  border-radius: var(--md-shape-corner-medium);
  background: var(--md-sys-color-surface-container-lowest);
  border: 1px solid var(--md-sys-color-outline-variant);
}

.m3-pwa-install-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.m3-pwa-install-btn {
  min-height: 40px;
  padding: 8px 18px;
  border-radius: var(--md-shape-corner-full);
  font-weight: 600;
  font-size: 13.5px;
}

.m3-ios-guide-box {
  padding: 14px 16px;
  border-radius: var(--md-shape-corner-medium);
  background: var(--md-sys-color-surface-container-lowest);
  border: 1px solid var(--md-sys-color-outline-variant);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.m3-ios-guide-box.is-highlighted {
  border-color: var(--md-sys-color-primary);
  box-shadow: 0 0 0 2px rgba(0, 99, 143, 0.16);
}

.m3-ios-guide-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.m3-ios-icon,
.m3-gpu-icon,
.m3-link-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(0, 99, 143, 0.10);
  color: var(--md-sys-color-primary);
  font-size: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.m3-ios-steps-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.m3-ios-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--md-shape-corner-small);
  background: var(--md-sys-color-surface-container-low);
  border: 1px solid rgba(11, 37, 69, 0.06);
}

.m3-step-number {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary, #ffffff);
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.m3-step-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--md-sys-color-on-surface);
}

.m3-step-body strong {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
}

.m3-step-body .inline-icon {
  font-size: 17px;
  color: var(--md-sys-color-primary);
  vertical-align: middle;
}

.m3-guide-steps-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.m3-guide-step-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--md-shape-corner-medium);
  background: var(--md-sys-color-surface-container-lowest);
  border: 1px solid var(--md-sys-color-outline-variant);
}

.m3-guide-step-icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(0, 99, 143, 0.10);
  color: var(--md-sys-color-primary);
  flex-shrink: 0;
  margin-top: 1px;
}

.m3-guide-step-icon {
  font-size: 20px;
  color: var(--md-sys-color-primary);
  flex-shrink: 0;
}

.m3-guide-step-content {
  flex: 1;
  min-width: 0;
}

.m3-guide-step-content h3 {
  margin: 0 0 8px 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--md-sys-color-on-surface);
}

.m3-guide-step-content p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--md-sys-color-on-surface-variant);
}

.m3-guide-bullet-list {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--md-sys-color-on-surface-variant);
}

.m3-guide-bullet-list li {
  padding-left: 2px;
}

.m3-guide-bullet-list li::marker {
  color: var(--md-sys-color-primary);
}

.m3-guide-bullet-list li strong {
  color: var(--md-sys-color-on-surface);
}

/* Visuaaliset minipainikkeet ohjetekstin sisällä */
.m3-guide-btn-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  margin: 1px 2px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  vertical-align: baseline;
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface);
  border: 1px solid rgba(0, 99, 143, 0.25);
  white-space: nowrap;
}

.m3-guide-btn-chip .material-symbols-outlined {
  font-size: 14px;
  line-height: 1;
  color: var(--md-sys-color-primary);
}

.m3-guide-btn-chip.primary {
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary, #ffffff);
  border-color: var(--md-sys-color-primary);
}

.m3-guide-btn-chip.primary strong,
.m3-guide-btn-chip.primary .material-symbols-outlined {
  color: var(--md-sys-color-on-primary, #ffffff);
}

.m3-guide-btn-chip.star {
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
  border-color: rgba(245, 158, 11, 0.4);
}

.m3-guide-btn-chip.star strong,
.m3-guide-btn-chip.star .material-symbols-outlined {
  color: #d97706;
  font-variation-settings: 'FILL' 1;
}

.m3-guide-btn-chip.subtle {
  background: var(--md-sys-color-surface-container);
  border-color: var(--md-sys-color-outline-variant);
  font-weight: 500;
}

.m3-guide-btn-chip.icon-only {
  padding: 0 5px;
  min-width: 22px;
  justify-content: center;
}

/* Kartan väriseliterivi ohjeessa */
.m3-guide-legend-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--md-sys-color-outline-variant);
}

.m3-guide-legend-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  background: var(--md-sys-color-surface-container);
  color: var(--md-sys-color-on-surface);
  border: 1px solid var(--md-sys-color-outline-variant);
}

/* 0–3 ★ tähtiluokitusruudukko ohjeessa */
.m3-guide-stars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--md-sys-color-outline-variant);
}

.m3-guide-star-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 10px;
  background: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline-variant);
}

.m3-guide-star-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  padding: 3px 6px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.m3-guide-star-card.star-3 .m3-guide-star-badge {
  background: rgba(16, 185, 129, 0.16);
  color: #047857;
}

.m3-guide-star-card.star-2 .m3-guide-star-badge {
  background: rgba(5, 150, 105, 0.12);
  color: #059669;
}

.m3-guide-star-card.star-1 .m3-guide-star-badge {
  background: rgba(245, 158, 11, 0.16);
  color: #b45309;
}

.m3-guide-star-card.star-0 .m3-guide-star-badge {
  background: rgba(100, 116, 139, 0.14);
  color: #475569;
}

.m3-guide-star-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-size: 12px;
  line-height: 1.3;
  color: var(--md-sys-color-on-surface-variant);
}

.m3-guide-star-text strong {
  font-size: 12.5px;
  color: var(--md-sys-color-on-surface);
}

.m3-safety-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--md-shape-corner-medium);
  background: rgba(230, 81, 0, 0.08);
  border: 1px solid rgba(230, 81, 0, 0.28);
  color: var(--md-sys-color-on-surface);
}

.m3-safety-icon {
  color: #e65100;
  font-size: 20px;
  flex-shrink: 0;
  margin-top: 1px;
}

.m3-safety-notice p {
  margin: 0;
  line-height: 1.45;
}

.m3-settings-links-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.m3-settings-link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--md-shape-corner-medium);
  background: var(--md-sys-color-surface-container-lowest);
  border: 1px solid var(--md-sys-color-outline-variant);
  text-decoration: none;
  color: var(--md-sys-color-on-surface);
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.m3-settings-link-row:hover {
  background: var(--md-sys-color-surface-container);
  border-color: var(--md-sys-color-primary);
  box-shadow: 0 2px 6px rgba(11, 37, 69, 0.06);
}

.m3-settings-link-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.m3-link-title {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--md-sys-color-on-surface);
}

.m3-link-subtitle {
  display: block;
  font-size: 12px;
  color: var(--md-sys-color-on-surface-variant);
}

.m3-link-arrow {
  font-size: 18px;
  color: var(--md-sys-color-on-surface-variant);
  flex-shrink: 0;
}

.m3-settings-version-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(11, 37, 69, 0.08);
  flex-wrap: wrap;
}

.m3-btn-small {
  min-height: 36px;
  padding: 6px 14px;
  font-size: 13px;
  gap: 6px;
  border-radius: var(--md-shape-corner-full);
}

/* Näytönohjainkiihdytys (GPU Canvas) -asetuslaatikko ja M3-kytkin */
.m3-gpu-accel-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--md-shape-corner-medium);
  background: var(--md-sys-color-surface-container-lowest);
  border: 1px solid var(--md-sys-color-outline-variant);
}

.m3-gpu-accel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.m3-gpu-accel-title-wrap {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.m3-gpu-accel-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding-top: 8px;
  border-top: 1px solid rgba(11, 37, 69, 0.08);
}

.m3-gpu-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 26px;
  gap: 4px;
  padding: 0 10px;
  border-radius: var(--md-shape-corner-full);
  font-size: 12px;
  font-weight: 600;
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface-variant);
  border: 1px solid var(--md-sys-color-outline-variant);
  white-space: nowrap;
}

.m3-gpu-badge.active {
  background: rgba(16, 185, 129, 0.14);
  color: #047857;
  border-color: rgba(16, 185, 129, 0.3);
}

.m3-bg-fetch-box {
  margin-top: 0;
}

.m3-bg-fetch-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 2px;
}

.m3-bg-fetch-btn {
  min-height: 38px;
  font-size: 13.5px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--md-shape-corner-full);
}

.m3-bg-fetch-btn .material-symbols-outlined {
  font-size: 18px;
}

.m3-switch-label {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  flex-shrink: 0;
}

.m3-switch-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.m3-switch-track {
  width: 50px;
  height: 28px;
  background: var(--md-sys-color-surface-container-highest);
  border: 2px solid var(--md-sys-color-outline);
  border-radius: 999px;
  position: relative;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.m3-switch-thumb {
  position: absolute;
  top: 3px;
  left: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--md-sys-color-outline);
  transition: transform 0.2s cubic-bezier(0.2, 0, 0, 1), background-color 0.2s ease;
}

.m3-switch-input:checked + .m3-switch-track {
  background: var(--md-sys-color-primary);
  border-color: var(--md-sys-color-primary);
}

.m3-switch-input:checked + .m3-switch-track .m3-switch-thumb {
  transform: translateX(21px);
  background: var(--md-sys-color-on-primary, #ffffff);
}

.m3-switch-input:focus-visible + .m3-switch-track {
  outline: 2px solid var(--md-sys-color-primary);
  outline-offset: 2px;
}

@media (max-width: 400px) {
  .m3-bottom-nav .m3-nav-indicator {
    width: 52px;
  }
  .m3-bottom-nav .m3-nav-label {
    font-size: 11px;
  }
  .m3-settings-card {
    padding: 14px;
  }
}

/* ==============================================================================
   23. ENNUSTE-NÄKYMÄN SWIPE-NAVIGOINTI & 14 VRK INTERAKTIIVINEN ENNUSTEGRAAFI
   ============================================================================== */

/* Swipe-navigointipainikkeet kompaktissa aktiivisen altaan yläpalkissa */
.m3-reports-swipe-nav,
.m3-reports-swipe-next-wrap {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 0;
  border: none;
  flex-shrink: 0;
  user-select: none;
}

.m3-swipe-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(0, 99, 143, 0.22);
  background: var(--md-sys-color-surface);
  color: var(--md-sys-color-primary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}

.m3-swipe-nav-btn:hover {
  background: rgba(0, 99, 143, 0.08);
  border-color: var(--md-sys-color-primary);
}

.m3-swipe-nav-btn:active {
  transform: scale(0.95);
}

.m3-swipe-nav-btn .material-symbols-outlined {
  font-size: 18px;
  flex-shrink: 0;
}

.m3-swipe-nav-target-name {
  display: none;
}

.m3-swipe-nav-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 20px;
  font-size: 11px;
  font-weight: 600;
  color: var(--md-sys-color-on-surface-variant);
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(11, 37, 69, 0.06);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Kohteen vaihdon swipe-siirtymäanimaatiot */
@keyframes m3SwipeSlideFromRight {
  0% {
    opacity: 0.35;
    transform: translateX(26px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes m3SwipeSlideFromLeft {
  0% {
    opacity: 0.35;
    transform: translateX(-26px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

.m3-swipe-transition-left {
  animation: m3SwipeSlideFromRight 0.22s cubic-bezier(0.2, 0, 0, 1);
}

.m3-swipe-transition-right {
  animation: m3SwipeSlideFromLeft 0.22s cubic-bezier(0.2, 0, 0, 1);
}

/* 14 vrk Ennustegraafikortin erikoistyylit (perii .m3-season-dashboard-card) */
.m3-forecast-chart-card {
  margin-bottom: 16px;
}

.m3-chart-line-steel {
  stroke: #0369a1;
  stroke-width: 1.6;
  stroke-dasharray: 4 3;
  opacity: 0.85;
}

.m3-chart-line-temp {
  stroke: #7c3aed;
  stroke-width: 2;
  stroke-dasharray: 5 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.m3-chart-dot-temp {
  fill: #7c3aed;
  stroke: #ffffff;
  stroke-width: 1.5;
}

.m3-chart-zero-temp-line {
  stroke: rgba(124, 58, 237, 0.28);
  stroke-width: 1;
  stroke-dasharray: 2 3;
}

.m3-chart-skate-threshold-line {
  stroke: rgba(245, 158, 11, 0.65);
  stroke-width: 1.15;
  stroke-dasharray: 4 3;
}

.m3-chart-threshold-label-warn {
  fill: #b45309;
  font-size: 9.5px;
  font-weight: 700;
}

.m3-legend-line-steel {
  background: repeating-linear-gradient(90deg, #0369a1 0 4px, transparent 4px 7px);
}

.m3-legend-line-temp {
  background: repeating-linear-gradient(90deg, #7c3aed 0 5px, transparent 5px 8px);
}

/* 10 vrk päiväkohtainen luistelu- ja sääraita aikajanan alla */
.m3-forecast-day-strip {
  display: grid;
  grid-template-columns: repeat(var(--forecast-days, 10), minmax(0, 1fr));
  gap: 2px;
  margin-top: 8px;
  user-select: none;
}

.m3-forecast-day-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px 1px;
  border-radius: 6px;
  background: rgba(11, 37, 69, 0.035);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease, transform 0.1s ease;
}

.m3-forecast-day-cell:hover,
.m3-forecast-day-cell.is-active {
  background: rgba(0, 99, 143, 0.12);
  border-color: rgba(0, 99, 143, 0.45);
}

.m3-forecast-day-cell.is-skatable {
  background: rgba(16, 185, 129, 0.10);
  border-color: rgba(16, 185, 129, 0.30);
}

.m3-forecast-day-cell.is-skatable:hover,
.m3-forecast-day-cell.is-skatable.is-active {
  background: rgba(16, 185, 129, 0.22);
  border-color: #059669;
}

.m3-fday-wd {
  font-size: 9.5px;
  font-weight: 700;
  color: var(--md-sys-color-on-surface-variant);
  line-height: 1.1;
}

.m3-fday-dm {
  font-size: 9px;
  color: var(--md-sys-color-on-surface-variant);
  opacity: 0.85;
  line-height: 1.15;
}

.m3-fday-stars {
  font-size: 8.5px;
  font-weight: 700;
  color: #047857;
  letter-spacing: -1px;
  line-height: 1.1;
  margin-top: 2px;
  min-height: 10px;
}

.m3-fday-stars.no-skate {
  color: rgba(100, 116, 139, 0.55);
  font-weight: 500;
}

/* Graafi / Taulukko & Järvi / Etäisyys -segmenttikytkimet (korkeus 30px, sopii 44px yläpalkkiin) */
.m3-reports-view-toggle {
  display: inline-flex;
  align-items: center;
  height: 30px;
  box-sizing: border-box;
  background: var(--md-sys-color-surface-container-low);
  border: 1px solid rgba(0, 99, 143, 0.24);
  border-radius: 999px;
  padding: 2px;
  gap: 2px;
}

.m3-reports-view-toggle-btn {
  display: inline-flex;
  align-items: center;
  height: 24px;
  gap: 4px;
  padding: 0 10px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--md-sys-color-on-surface-variant);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.m3-reports-view-toggle-btn .material-symbols-outlined {
  font-size: 15px;
}

.m3-reports-view-toggle-btn:hover {
  color: var(--md-sys-color-on-surface);
}

.m3-reports-view-toggle-btn.active {
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary, #ffffff);
  box-shadow: 0 1px 4px rgba(0, 99, 143, 0.25);
}

/* Tiivistetty ennustegraafikortin yläpalkki (otsikko + Suurenna-painike ilman tuplaotsikkoa) */
.m3-forecast-chart-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

/* Synkronoitu päiväkorostus 14 vrk taulukossa */
#forecastTableBody tr {
  cursor: pointer;
  transition: background-color 0.12s ease;
}

#forecastTableBody tr.is-hovered-day td {
  background-color: rgba(0, 99, 143, 0.11) !important;
}

#forecastTableBody tr.is-pinned-day td {
  background-color: rgba(0, 99, 143, 0.16) !important;
  box-shadow: inset 0 1px 0 rgba(0, 99, 143, 0.28), inset 0 -1px 0 rgba(0, 99, 143, 0.28);
}

@media (max-width: 600px) {
  .m3-swipe-nav-btn {
    width: 26px;
    height: 26px;
    min-width: 26px;
    min-height: 26px;
  }
  .m3-swipe-nav-indicator {
    font-size: 10.5px;
    padding: 0 6px;
  }
  .m3-reports-view-toggle-btn {
    padding: 0 8px;
    font-size: 11.5px;
  }
  .m3-forecast-day-cell .m3-fday-dm {
    display: none;
  }
}

/* ==============================================================================
   25. ONBOARDING: TERVETULOA-MODAALI & HANDS-ON -PIKAOPASTUS
   ============================================================================== */
.m3-onboarding-modal-card {
  max-width: 520px;
  width: calc(100vw - 24px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  text-align: left;
  padding: 22px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Uudistettu kuvitettu Visio- & Esittelymodaali (.m3-vision-modal-card) */
.m3-onboarding-modal-card.m3-vision-modal-card {
  max-width: 560px;
  width: calc(100vw - 20px);
  max-height: calc(100dvh - 18px);
  padding: 13px 17px 11px;
  gap: 7px;
}

.m3-vision-modal-card .m3-vision-header {
  align-items: flex-start;
  text-align: left;
  gap: 4px;
  padding-right: 34px;
}

.m3-vision-brand-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.m3-vision-modal-card .m3-vision-logo {
  width: 30px;
  height: 30px;
  margin: 0;
  flex-shrink: 0;
}

.m3-vision-modal-card .m3-vision-title {
  font-size: clamp(16px, 2.1vw, 18.5px);
  line-height: 1.22;
  margin: 1px 0 0;
}

.m3-vision-modal-card .m3-vision-lead {
  font-size: 12.75px;
  line-height: 1.38;
}

.m3-vision-kpi-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.m3-vision-kpi-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline-variant);
  color: var(--md-sys-color-on-surface);
  font-size: 11.5px;
  font-weight: 500;
}

.m3-vision-kpi-pill b {
  font-weight: 800;
  color: var(--md-sys-color-primary);
}

.m3-vision-kpi-pill.is-safe {
  background: rgba(27, 127, 70, 0.11);
  border-color: rgba(27, 127, 70, 0.30);
}

.m3-vision-kpi-pill.is-safe b {
  color: var(--ice-safe);
}

/* 4-osainen kuvakaruselli */
.m3-vision-carousel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.m3-vision-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  background: var(--md-sys-color-surface-container-low);
  padding: 4px;
  border-radius: 14px;
  border: 1px solid var(--md-sys-color-outline-variant);
}

.m3-vision-tab {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--md-sys-color-on-surface-variant);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  padding: 7px 6px;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.m3-vision-tab:hover {
  color: var(--md-sys-color-on-surface);
  background: rgba(11, 37, 69, 0.05);
}

.m3-vision-tab.active {
  background: #FFFFFF;
  color: var(--md-sys-color-primary);
  box-shadow: 0 2px 6px rgba(11, 37, 69, 0.12);
}

.m3-vision-stage {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: #FFFFFF;
  border: 1px solid var(--md-sys-color-outline-variant);
}

.m3-vision-slide {
  display: flex;
  flex-direction: column;
  animation: m3VisionFadeIn 0.2s ease;
}

.m3-vision-slide[hidden] {
  display: none !important;
}

@keyframes m3VisionFadeIn {
  from { opacity: 0.45; }
  to { opacity: 1; }
}

.m3-vision-media-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: var(--md-sys-color-surface-container);
  overflow: hidden;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.m3-vision-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.m3-vision-slide-body {
  padding: 9px 13px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: var(--md-sys-color-surface-container-lowest);
}

.m3-vision-slide-body strong {
  font-size: 14px;
  font-weight: 800;
  color: var(--md-sys-color-primary);
  line-height: 1.28;
}

.m3-vision-slide-body p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.44;
  color: var(--md-sys-color-on-surface-variant);
}

.m3-vision-nav-btn {
  position: absolute;
  top: 34%;
  transform: translateY(-50%);
  z-index: 4;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.8);
  background: rgba(11, 37, 69, 0.68);
  color: #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.m3-vision-nav-btn:hover {
  background: rgba(11, 37, 69, 0.88);
}

.m3-vision-nav-btn.is-prev { left: 8px; }
.m3-vision-nav-btn.is-next { right: 8px; }

/* Ilmaiset pikakokeilupillerit modaalissa */
.m3-vision-demo-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 6px 10px;
  border-radius: 12px;
  background: var(--md-sys-color-surface-container-low);
  border: 1px solid var(--md-sys-color-outline-variant);
}

.m3-vision-demo-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--md-sys-color-on-surface-variant);
  white-space: nowrap;
}

.m3-vision-demo-chips {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.m3-vision-demo-chip {
  appearance: none;
  border: 1px solid var(--md-sys-color-outline-variant);
  background: #FFFFFF;
  color: var(--md-sys-color-primary);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 8.5px;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.m3-vision-demo-chip:hover {
  background: var(--md-sys-color-primary-container);
  border-color: var(--md-sys-color-secondary);
}

.m3-vision-modal-card .m3-vision-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 2px;
  width: 100%;
}

.m3-vision-modal-card .m3-onboarding-primary-btn,
.m3-vision-modal-card .m3-onboarding-secondary-btn {
  min-height: 40px;
  font-size: 13.5px;
}

@media (min-width: 540px) {
  .m3-vision-modal-card .m3-vision-actions {
    grid-template-columns: 1.35fr 0.95fr;
  }
}

.m3-vision-footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--md-sys-color-on-surface-variant);
}

.m3-vision-footer-links a {
  color: var(--md-sys-color-secondary);
  text-decoration: none;
  font-weight: 600;
}

.m3-vision-footer-links a:hover {
  text-decoration: underline;
}

@media (max-width: 440px) {
  .m3-onboarding-modal-card.m3-vision-modal-card {
    padding: 13px 13px 12px;
    gap: 8px;
  }
  .m3-vision-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .m3-vision-nav-btn {
    width: 30px;
    height: 30px;
  }
}

.m3-onboarding-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
}

.m3-onboarding-eyebrow {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(0, 99, 143, 0.12);
  color: #004D70;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.m3-onboarding-title {
  font-size: 19px;
  font-weight: 800;
  line-height: 1.25;
  color: var(--md-sys-color-on-surface);
  margin: 2px 0 0;
}

.m3-onboarding-lead {
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--md-sys-color-on-surface-variant);
  margin: 0;
}

.m3-onboarding-value-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.m3-onboarding-value-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 11px 13px;
  border-radius: 14px;
  background: var(--md-sys-color-surface-container-low);
  border: 1px solid var(--md-sys-color-outline-variant);
}

.m3-onboarding-value-icon {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 10px;
  background: rgba(0, 99, 143, 0.12);
  color: var(--md-sys-color-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.m3-onboarding-value-icon .material-symbols-outlined {
  font-size: 20px;
}

.m3-onboarding-value-icon.is-warn {
  background: #fef3c7;
  color: #92400e;
}

.m3-onboarding-value-icon.is-fav {
  background: #ecfdf5;
  color: #065f46;
}

.m3-onboarding-value-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.m3-onboarding-value-body strong {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--md-sys-color-on-surface);
  line-height: 1.25;
}

.m3-onboarding-value-body p {
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--md-sys-color-on-surface-variant);
  margin: 0;
}

.m3-onboarding-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 2px;
}

.m3-onboarding-primary-btn,
.m3-onboarding-secondary-btn {
  width: 100%;
  justify-content: center;
  min-height: 44px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 22px;
}

/* Kelluva 3 askeleen Hands-on -opastuskortti (#onboardingCoachCard) */
.m3-onboarding-coach-card {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 92px;
  max-width: 480px;
  margin: 0 auto;
  z-index: 1350;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 2px solid var(--md-sys-color-primary);
  border-radius: 18px;
  padding: 13px 15px;
  box-shadow: 0 10px 28px rgba(11, 37, 69, 0.24), 0 2px 8px rgba(11, 37, 69, 0.14);
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: m3DigestCardPopUp 0.2s cubic-bezier(0.2, 0, 0, 1);
}

.m3-onboarding-coach-card.is-top-docked {
  bottom: auto;
  top: calc(124px + var(--m3-header-height, 0px));
}

#viewMap.active ~ #onboardingCoachCard,
.m3-app-shell:has(#viewMap.active) ~ #onboardingCoachCard {
  background: var(--m3-map-glass-bg-elevated-fallback);
  background: var(--m3-map-glass-bg-elevated);
  backdrop-filter: var(--m3-map-glass-backdrop);
  -webkit-backdrop-filter: var(--m3-map-glass-backdrop);
}

.m3-coach-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.m3-coach-step-badge {
  display: inline-flex;
  align-items: center;
  padding: 2.5px 9px;
  border-radius: 999px;
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary, #ffffff);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.m3-coach-close-btn {
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  padding: 0;
}

.m3-coach-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--md-sys-color-on-surface);
  margin: 0;
  line-height: 1.25;
}

.m3-coach-desc {
  font-size: 12.5px;
  line-height: 1.42;
  color: var(--md-sys-color-on-surface-variant);
  margin: 0;
}

.m3-coach-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.m3-coach-next-btn {
  width: 100%;
  justify-content: center;
  min-height: 38px;
  font-size: 13.5px;
  font-weight: 700;
  border-radius: 19px;
}

/* --- Piilotetaan kelluva reCAPTCHA-badge näkymistä (tieto näytetään vain Asetukset-sivulla) --- */
.grecaptcha-badge {
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.m3-settings-recaptcha-notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--md-sys-color-outline-variant);
  font-size: 12px;
  line-height: 1.45;
  color: var(--md-sys-color-on-surface-variant);
}

.m3-settings-recaptcha-notice .material-symbols-outlined {
  font-size: 16px;
  color: var(--md-sys-color-primary);
  flex-shrink: 0;
  margin-top: 1px;
}

.m3-settings-recaptcha-notice a {
  color: var(--md-sys-color-primary);
  font-weight: 600;
  text-decoration: underline;
}





