@font-face {
  font-family: "Ice Rubik";
  src: url("/static/fonts/rubik-cyr.woff2") format("woff2");
  font-weight: 700 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Ice Rubik";
  src: url("/static/fonts/rubik-lat.woff2") format("woff2");
  font-weight: 700 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+2000-206F, U+2191, U+2193, U+2212;
}

:root {
  --page: #eaf3f7;
  --paper: #fafdff;
  --ink: #143144;
  --sub: #446173;
  --line: #cbdfe8;
  --blue: #145e83;
  --blue-deep: #124e6e;
  --tint: #e1f1f8;
  --field: #e8f3f8;
  --soft: #f0f7fa;
  --header: #0c2a3c;
  --header-text: #f2faff;
  --header-muted: #c0d8e5;
  --focus: #1d7da7;
  --frame-water: #d7ecf4;
  --ice-halo: #d0eaf4;
  --panel-shine: #fff;
  --glass-line: #f8fdff;
  --surface-shadow: 0 10px 24px #20546b0b;
  --glass-shadow: 0 5px 16px #0e3c552e;
  --primary-text: #fafdff;
  --primary-light: #267c9d;
  --primary-base: #125576;
  --primary-hover: #104c6a;
  --dock-glass: #f4fbfbed;
  --display-font: "Ice Rubik", Onest, "Segoe UI", sans-serif;
  --surface-radius: 23px;
}

body {
  min-height: 100dvh;
  background: radial-gradient(ellipse at 88% 2%, var(--ice-halo), transparent 65%),
              var(--page);
}

:focus-visible { outline-color: var(--focus); }

.mast {
  background: linear-gradient(105deg, #0b2333, var(--header) 65%, #10364b);
  border-bottom-color: #b0d7e629;
}

.mast-inner {
  min-height: 72px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content minmax(0, 1fr);
  gap: var(--space-4);
}

.brand { justify-self: start; }

.mast-inner .brand img {
  display: block;
  width: 104px;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 3px 14px #06152145;
  filter: none;
}

.tabs { gap: var(--space-2); }

.tabs a {
  color: var(--header-muted);
  border: 1px solid transparent;
  border-radius: 30px;
}

.tabs a:hover { background: #d5f4ff14; }

.tabs a[aria-current="page"] {
  color: var(--header-text);
  border-color: #c8efff40;
  background: linear-gradient(170deg, #a4dce83b, #5ca3c527);
  box-shadow: inset 0 1px 0 #e7f8ff21;
}

.location {
  justify-self: end;
  max-width: 100%;
  color: var(--header-muted);
}

.location:hover { color: var(--header-text); }
.mast :focus-visible, .page-heading :focus-visible { outline-color: #a4def7; }

.page-heading {
  min-height: 107px;
  margin: 20px 0;
  padding: 18px clamp(18px, 3.5vw, 36px);
  color: var(--header-text);
  background:
    linear-gradient(100deg, #0b2637 7%, #0b2637ea 35%, #0b26376b 77%, #0b263731),
    linear-gradient(0deg, #0929397a, transparent),
    url("/static/brand/ice-cover.webp") center 56% / cover no-repeat,
    var(--header);
  border: 1px solid #5a91a8;
  border-radius: var(--surface-radius);
  box-shadow: inset 0 1px 0 #ebfaff2f, var(--surface-shadow);
}

.page-heading h1, .lake-head h2, .section-title h2, .preview-head h2,
.dialog-shell .dialog-head h2, .metric-value, #preview-ice:not(.no-value) {
  font-family: var(--display-font);
}

.page-heading h1 {
  color: inherit;
  font-size: clamp(2.05rem, 4vw, 3rem);
  line-height: 1.05;
  letter-spacing: -.04em;
  font-weight: 850;
  text-wrap: balance;
}

.date-control { color: inherit; }

.date-control :is(.picker-trigger, select:not(.picker-source)) {
  padding: 0 12px;
  border: 1px solid #d5eeff55;
  border-radius: 28px;
  background: #0d2f43d9;
  color: inherit;
  box-shadow: inset 0 1px 0 #e6f9ff24;
}

.date-control :is(.picker-trigger, select:not(.picker-source)):hover { background: #1a4762; }

.lake-head h2 {
  font-size: clamp(1.52rem, 2.6vw, 2.15rem);
  font-weight: 760;
  letter-spacing: -.039em;
}

.section-title h2 { font-weight: 740; }
.dialog-shell .dialog-head h2 { font-weight: 720; }

.panel, .list-group, .map-layout {
  border-radius: var(--surface-radius);
  box-shadow: var(--surface-shadow);
}

.report {
  background: linear-gradient(157deg, var(--panel-shine), var(--paper) 66%);
  box-shadow: inset 0 1px 0 var(--glass-line), var(--surface-shadow);
}

#save-lake {
  flex: none;
  background: var(--field);
  box-shadow: inset 0 0 0 1px var(--line);
}

#save-lake:hover { background: var(--tint); }

.searchbox {
  border-radius: 15px;
  box-shadow: inset 0 1px 0 var(--glass-line);
}

.searchbox input::placeholder { color: var(--sub); opacity: 1; }

.segments {
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--field);
}

.segments button { border-radius: 11px; }

.segments button[aria-pressed="true"] {
  box-shadow: inset 0 1px 0 var(--glass-line), 0 1px 4px #0d3a5123;
}

.water-symbol { border-radius: 12px; }
.primary, .secondary, .more { border-radius: 14px; }

.primary {
  color: var(--primary-text);
  background: linear-gradient(168deg, var(--primary-light), var(--primary-base));
  box-shadow: inset 0 1px 0 #f1fbff42, 0 2px 6px #13526e22;
}

.primary:hover { background: var(--primary-hover); }
.secondary:hover, .more:hover { background: var(--tint); }

.map-layout, #map { background: var(--frame-water); }

.map-color-filters { position:absolute; width:0; height:0; overflow:hidden; pointer-events:none; }
#map .ice-basemap .leaflet-tile { filter:url("#ice-tiles-day"); }

.map-tool, #map-add, #map .leaflet-control-zoom a {
  background: var(--paper);
  color: var(--blue);
  border: 1px solid var(--line);
  border-radius: 13px;
  box-shadow: inset 0 1px 0 var(--glass-line), var(--glass-shadow);
}

.map-tool:hover, #map-add:hover, #map .leaflet-control-zoom a:not(.leaflet-disabled):hover { background: var(--field); }

#map-tools [aria-pressed="true"] {
  color: var(--primary-text);
  background: var(--primary-base);
  outline-color: var(--paper);
}

#map .leaflet-control-zoom {
  display:grid;
  gap:var(--map-tool-gap);
  margin:0 var(--map-tool-inset) var(--map-tool-inset) 0;
  background:transparent;
  border:0;
  box-shadow:none;
}

#map .leaflet-control-zoom a {
  display:grid;
  place-items:center;
  width:var(--map-tool-size);
  height:var(--map-tool-size);
  line-height:1;
  text-indent:0;
}
#map .leaflet-control-zoom svg { width:21px; height:21px; }
#map .leaflet-control-zoom a:focus-visible { outline:3px solid var(--focus); outline-offset:2px; }
#map .leaflet-control-zoom a:not(.leaflet-disabled):active { transform:translateY(1px); }
#map .leaflet-control-zoom .leaflet-disabled { background:var(--soft); color:var(--sub); cursor:default; }
#map .leaflet-control-zoom .leaflet-disabled svg { opacity:.5; }
#map .leaflet-control-attribution { background:var(--paper); color:var(--sub); }
#map .leaflet-control-attribution a { color:var(--blue-deep); }

#map-preview {
  background: linear-gradient(150deg, var(--panel-shine), var(--paper) 68%);
  border-radius: 19px;
  box-shadow: inset 0 1px 0 var(--glass-line), var(--glass-shadow);
}

.preview-head h2 { font-weight: 750; }
#preview-ice { font-variant-numeric: proportional-nums; }

dialog, .picker-panel { box-shadow: 0 14px 42px #082c4752; }
dialog::backdrop { background: #0a233665; }

@media (prefers-color-scheme: dark) {
  #map .ice-basemap .leaflet-tile { filter:url("#ice-tiles-night"); }
  :root {
    --page: #0f2330;
    --paper: #172f3e;
    --ink: #edf8fc;
    --sub: #b2cbd8;
    --line: #37576a;
    --blue: #94d6ef;
    --blue-deep: #b7e6f7;
    --tint: #23465a;
    --field: #203d4e;
    --soft: #1b3646;
    --focus: #8dd3f2;
    --frame-water: #224b62;
    --ice-halo: #15384b;
    --panel-shine: #1d3a4b;
    --glass-line: #50768b;
    --surface-shadow: 0 8px 24px #050f1940;
    --primary-text: #102431;
    --primary-light: #c0eefb;
    --primary-base: #92cee7;
    --primary-hover: #b1e6f8;
    --dock-glass: #122b3ae8;
  }
}

@media (max-width: 750px) {
  :root { --surface-radius: 18px; }

  .mast-inner { display: flex; min-height: 58px; }
  .mast-inner .brand img { width: 88px; border-radius: 7px; }

  .tabs {
    gap: var(--space-2);
    box-shadow: 0 -4px 18px #13384d18;
  }

  .tabs a { color: var(--sub); border-radius: 14px; }
  .tabs a:hover { background: var(--field); }

  .tabs a[aria-current="page"] {
    color: var(--blue-deep);
    border-color: var(--line);
    background: var(--tint);
    box-shadow: inset 0 1px 0 var(--glass-line);
  }

  .tabs :focus-visible { outline-color: var(--focus); }

  @supports (backdrop-filter: blur(14px)) or (-webkit-backdrop-filter: blur(14px)) {
    .tabs {
      background: var(--dock-glass);
      -webkit-backdrop-filter: blur(14px);
      backdrop-filter: blur(14px);
    }
  }

  .page-heading {
    min-height: 84px;
    padding: 14px 17px;
    margin: 14px 0;
  }

  .page-heading h1 { font-size: clamp(1.7rem, 6vw, 2.15rem); }

  .date-control :is(.picker-trigger, select:not(.picker-source)) {
    padding: 0 10px;
    font-size: .79rem;
  }

  #map-preview { border-radius: 15px; }
}

@media (forced-colors: active) {
  .mast, .page-heading { background: Canvas; color: CanvasText; }
  .page-heading :focus-visible, .mast :focus-visible { outline-color: Highlight; }
}
