:root {
  color-scheme: light;
  --night: #071f3b;
  --navy: #0a3155;
  --navy-2: #145d87;
  --ice: #68d3e8;
  --ice-light: #d9f5fb;
  --snow: #eff8fc;
  --ink: #102c43;
  --muted: #587083;
  --line: #bcd6e2;
  --highway: #0a8d92;
  --general: #2d6fa8;
  --panel: rgba(249, 253, 255, 0.95);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background: var(--snow);
}

body {
  overflow-x: hidden;
  background:
    radial-gradient(circle at 7% 13%, rgba(110, 213, 236, 0.17), transparent 23rem),
    linear-gradient(180deg, #f5fbfe 0%, #e7f3f9 100%);
}

button,
input {
  font: inherit;
}

button,
a,
label {
  -webkit-tap-highlight-color: transparent;
}

.topbar {
  position: relative;
  z-index: 10;
  min-height: 44px;
  padding: 3px clamp(8px, 1.2vw, 18px);
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 78% -80%, rgba(130, 229, 246, 0.42), transparent 42%),
    linear-gradient(112deg, #071f3b 0%, #0b3b64 48%, #19729a 100%);
  border-bottom: 2px solid #61d2e7;
  box-shadow: 0 4px 14px rgba(5, 34, 58, 0.22);
}

.topbar::before,
.topbar::after {
  position: absolute;
  content: "";
  pointer-events: none;
}

.topbar::before {
  inset: 0;
  opacity: 0.34;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.68) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(199, 242, 250, 0.45) 0 1px, transparent 1.5px);
  background-position: 0 0, 20px 17px;
  background-size: 44px 44px, 58px 58px;
  mask-image: linear-gradient(90deg, transparent 22%, #000 55%, #000 100%);
}

.topbar::after {
  right: 12%;
  bottom: -40px;
  width: 330px;
  height: 100px;
  border: 1px solid rgba(182, 239, 249, 0.16);
  border-radius: 50%;
  transform: rotate(-5deg);
}

.topbar-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1800px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.header-identity {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-home {
  min-width: 174px;
  min-height: 36px;
  padding: 2px 8px 2px 3px;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(193, 235, 248, 0.44);
  border-radius: 6px;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07), 0 4px 14px rgba(2, 20, 37, 0.16);
  text-decoration: none;
}

.brand-home:hover,
.brand-home:focus-visible {
  border-color: #bdeefa;
  background: rgba(255, 255, 255, 0.16);
}

.brand-home:focus-visible,
.sns-link:focus-visible,
.footer-brand:focus-visible,
.footer-links a:focus-visible {
  outline: 3px solid rgba(141, 229, 246, 0.52);
  outline-offset: 2px;
}

.brand-logo {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: block;
  border-radius: 5px;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(2, 24, 43, 0.25);
}

.brand-home-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-home-copy strong {
  font-size: 12px;
  letter-spacing: 0.015em;
  white-space: nowrap;
}

.brand-home-copy small {
  margin-top: 1px;
  color: #c8ecf5;
  font-size: 8px;
  font-weight: 700;
}

.title-row {
  min-width: 0;
  padding-left: 12px;
  border-left: 1px solid rgba(185, 231, 243, 0.36);
}

.title-row p,
.title-row h1 {
  margin: 0;
}

.product-kicker {
  margin-bottom: 0 !important;
  color: #8fe6f3;
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0.18em;
}

.tool-title-line {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tool-title-line h1 {
  color: #fff;
  font-size: clamp(20px, 1.55vw, 24px);
  line-height: 1;
  letter-spacing: 0.025em;
  text-shadow: 0 2px 8px rgba(1, 24, 43, 0.34);
  white-space: nowrap;
}

.tool-subtitle {
  display: none;
}

.header-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
}

.sns-link {
  min-height: 34px;
  padding: 3px 8px 3px 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid rgba(198, 235, 246, 0.5);
  border-radius: 8px;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
}

.sns-link:hover,
.sns-link:focus-visible {
  border-color: #bdeefa;
  background: rgba(255, 255, 255, 0.18);
}

.x-mark {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  color: #fff;
  background: #050505;
  border: 1px solid rgba(255, 255, 255, 0.64);
  font-size: 15px;
  font-weight: 700;
}

main {
  padding: 0;
}

.tool-layout {
  height: calc(100svh - 46px);
  min-height: 620px;
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  overflow: hidden;
  background: #d9ebf3;
}

.map-column {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
}

.map-shell {
  position: relative;
  min-height: 0;
  overflow: hidden;
  background: #d9ebf3;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.map-shell::before {
  position: absolute;
  z-index: 4;
  top: 0;
  right: 0;
  left: 0;
  height: 18px;
  content: "";
  pointer-events: none;
  background: linear-gradient(180deg, rgba(224, 249, 255, 0.3), transparent);
}

#map {
  position: absolute;
  inset: 0;
}

.control-panel {
  position: relative;
  z-index: 6;
  min-height: 0;
  padding: 13px 12px 14px;
  overflow: auto;
  background:
    radial-gradient(circle at 0 0, rgba(112, 215, 237, 0.14), transparent 16rem),
    linear-gradient(180deg, #f6fbfd, #e7f3f8);
  border-right: 1px solid #abcbd8;
  box-shadow: 5px 0 18px rgba(7, 45, 72, 0.13);
  scrollbar-width: thin;
}

.control-panel::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  content: "";
  background: linear-gradient(90deg, #0a79ad, #59d4e8);
}

.road-details {
  position: absolute;
  z-index: 5;
  overflow: hidden;
  border: 1px solid rgba(54, 121, 151, 0.34);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 12px 32px rgba(7, 45, 72, 0.24);
  backdrop-filter: blur(12px);
}

.road-details::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 4px;
  content: "";
  background: linear-gradient(90deg, #0a79ad, #59d4e8);
}

.control-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 3px 9px;
}

.control-heading h2,
.control-heading p {
  margin: 0;
}

.control-heading h2 {
  color: #0b3855;
  font-size: 19px;
  line-height: 1.15;
}

.eyebrow {
  color: #087da2;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.16em;
}

#panelToggle {
  display: none;
}

.panel-section {
  margin-top: 9px;
  padding: 12px 12px 11px;
  border: 1px solid #bdd6e1;
  border-top: 3px solid #1688b4;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 3px 11px rgba(12, 60, 88, 0.06);
}

.road-section {
  border-top-color: #258b82;
}

.snow-section { border-top-color: #479bc5; }
.snow-section h3 { margin: 0; font-size: 14px; color: #123b59; }
.snow-section h3 small { font-size: 10px; color: #426a82; white-space: nowrap; }
.snow-intro, .snow-note { margin: 5px 0 8px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.snow-options { display: grid; gap: 6px; padding: 4px 0; font-size: 12px; }
.snow-options input[type="checkbox"] { width: 18px; height: 18px; vertical-align: middle; accent-color: #2578aa; }
.snow-options input[type="range"] { width: 100%; accent-color: #2578aa; }
.snow-options output { float: right; }
.snow-options button { justify-self: start; min-height: 34px; padding: 5px 10px; border: 1px solid #7d9daf; border-radius: 5px; background: #fff; color: #153d58; font: inherit; font-weight: 700; cursor: pointer; }
.snow-options button[aria-pressed="true"] { border-color: #1b5d80; background: #1b5d80; color: #fff; }
.snow-options button:focus-visible { outline: 3px solid #ffbd42; outline-offset: 2px; }
.snow-depth-scale { height: 10px; margin-top: 5px; border: 1px solid #6d8291; background: linear-gradient(90deg, #fff 0%, #000 100%); }
.snow-depth-scale-label { display: flex; justify-content: space-between; margin: 3px 0 8px; font-size: 10px; color: #456077; }
.snow-contour-caption { margin: 0 0 4px; font-size: 11px; font-weight: 700; color: #244c69; }
.snow-contour-legend { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; font-size: 10px; color: #274b67; }
.snow-contour-legend span { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.snow-contour-legend span[hidden] { display: none; }
.snow-contour-legend i { display: inline-block; width: 20px; height: 0; border-top: 1px solid; }
.snow-line-0 { border-color: #202020; }
.snow-line-1, .snow-line-5, .snow-line-10, .snow-line-20, .snow-line-50 { border-color: #353535; }
.snow-line-100 { border-color: #fff; filter: drop-shadow(0 0 1px #222); }
.snow-section #retrySnow { min-height: 32px; border: 1px solid #8eb6c8; border-radius: 5px; background: #fff; color: #153d58; cursor: pointer; }

.road-temperature-legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 8px;
  padding-top: 9px;
  border-top: 1px solid #d8e7ed;
  font-size: 11px;
}

.road-temperature-legend span { display: flex; align-items: center; gap: 6px; }
.road-temperature-legend i { width: 24px; height: 5px; border-radius: 2px; box-shadow: 0 0 0 1px #586b78; }
.road-red { background: #da3434; }
.road-orange { background: #f08020; }
.road-yellow { background: #e8bd20; }
.road-missing { background: #75838c; }
.road-temperature-note { margin: 7px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
#roadTemperatureStatus[data-state="error"] { color: #a82e29; }

.section-title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 10px;
}

.section-title > span {
  min-width: 30px;
  padding: 4px 5px;
  border-radius: 6px;
  color: #0d5477;
  background: #e6f3f8;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-align: center;
}

.section-title h3 {
  margin: 0;
  color: #173b53;
  font-size: 15px;
}

#resetView:hover,
#resetView:focus-visible {
  border-color: #168baa;
  outline: 3px solid rgba(27, 164, 191, 0.18);
}

.road-title-row {
  margin-bottom: 5px;
}

.road-title-row #resetView {
  margin-left: auto;
}

#resetView {
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid #82adbf;
  border-radius: 7px;
  color: #0a4266;
  background: linear-gradient(180deg, #fff, #eaf6fa);
  box-shadow: 0 2px 7px rgba(22, 73, 99, 0.08);
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.layer-toggle {
  min-height: 48px;
  padding: 7px 4px;
  display: grid;
  grid-template-columns: 22px 44px 1fr;
  align-items: center;
  gap: 9px;
  border-top: 1px solid #d8e7ed;
  cursor: pointer;
}

.layer-toggle:hover {
  background: rgba(219, 244, 250, 0.55);
}

.layer-toggle input {
  width: 18px;
  height: 18px;
  accent-color: #087e9e;
}

.layer-toggle strong,
.layer-toggle small {
  display: block;
}

.layer-toggle strong {
  color: #133c56;
  font-size: 14px;
}

.layer-toggle small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.legend-line {
  display: block;
  height: 7px;
  border-radius: 999px;
  box-shadow: 0 0 0 2px #fff, 0 0 0 3px #7893a3;
}

.highway-line {
  background: var(--highway);
}

.general-line {
  height: 5px;
  background: var(--general);
}

.map-status {
  margin: 10px 4px 0;
  padding-top: 10px;
  border-top: 1px solid #d8e7ed;
  color: var(--muted);
  font-size: 12px;
}

.map-status[data-state="ready"]::before,
.map-status[data-state="error"]::before {
  width: 8px;
  height: 8px;
  margin-right: 6px;
  display: inline-block;
  border-radius: 50%;
  content: "";
}

.map-status[data-state="ready"]::before {
  background: #0a9591;
  box-shadow: 0 0 0 3px rgba(10, 149, 145, 0.13);
}

.map-status[data-state="error"]::before {
  background: #c8443e;
}

.road-details {
  right: 16px;
  bottom: 34px;
  width: min(290px, calc(100% - 32px));
  padding: 17px 44px 15px 16px;
}

.road-details h2,
.road-details p {
  margin: 0;
}

.road-details h2 {
  margin-top: 3px;
  font-size: 18px;
}

.road-details #roadNote {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

#closeDetails {
  position: absolute;
  top: 9px;
  right: 8px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  color: #0c4567;
  background: #e4f3f8;
  font-size: 22px;
  cursor: pointer;
}

.scope-note {
  min-height: 45px;
  padding: 8px clamp(12px, 2vw, 25px);
  display: flex;
  gap: 11px;
  align-items: flex-start;
  color: #153d58;
  background: linear-gradient(90deg, #d6f1f7 0%, #eaf8fb 52%, #d8eef7 100%);
  border: 0;
  border-top: 1px solid #9ecbd9;
  border-radius: 0;
  box-shadow: none;
  font-size: 10px;
  line-height: 1.45;
}

.scope-icon {
  width: 21px;
  height: 21px;
  flex: 0 0 21px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #0d7197;
  font-family: Georgia, serif;
  font-size: 13px;
  font-weight: 800;
}

.scope-note strong {
  margin-right: 7px;
}

.scope-note div > span {
  color: #446276;
}

.site-footer {
  position: relative;
  margin-top: 0;
  overflow: hidden;
  color: #c6dce8;
  background:
    radial-gradient(circle at 88% -25%, rgba(70, 194, 223, 0.28), transparent 36%),
    radial-gradient(circle at 12% 120%, rgba(46, 131, 175, 0.24), transparent 30%),
    linear-gradient(125deg, #061b33 0%, #0a2f50 55%, #104f72 100%);
  border-top: 4px solid #55c9e0;
  box-shadow: 0 -4px 18px rgba(6, 37, 61, 0.13);
}

.site-footer::before {
  position: absolute;
  inset: 0;
  opacity: 0.18;
  content: "";
  pointer-events: none;
  background-image: radial-gradient(circle, #fff 0 1px, transparent 1.3px);
  background-position: 0 0;
  background-size: 38px 38px;
  mask-image: linear-gradient(90deg, transparent, #000 50%, #000);
}

.footer-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1500px;
  margin: 0 auto;
  padding: 22px clamp(18px, 3vw, 42px) 18px;
}

.footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  text-decoration: none;
}

.footer-logo {
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  display: block;
  border: 2px solid rgba(207, 243, 251, 0.54);
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 5px 15px rgba(0, 14, 28, 0.32);
}

.footer-brand > span {
  display: flex;
  flex-direction: column;
}

.footer-brand strong {
  font-size: 17px;
  letter-spacing: 0.025em;
}

.footer-brand small {
  margin-top: 3px;
  color: #8edcea;
  font-size: 12px;
  font-weight: 700;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-links a {
  min-height: 42px;
  padding: 8px 13px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(186, 226, 239, 0.42);
  border-radius: 8px;
  color: #f2fbfd;
  background: rgba(255, 255, 255, 0.08);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.footer-links a:hover,
.footer-links a:focus-visible {
  border-color: #9be7f4;
  background: rgba(255, 255, 255, 0.14);
}

.footer-x {
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  color: #fff;
  background: #050505;
  font-size: 11px;
}

.footer-copy {
  margin-top: 18px;
  padding-top: 15px;
  border-top: 1px solid rgba(180, 224, 238, 0.24);
  font-size: 11px;
  line-height: 1.65;
}

.footer-copy p {
  margin: 0 0 4px;
}

.footer-copy a {
  color: #8ee1ef;
  text-underline-offset: 3px;
}

.privacy-note {
  margin-top: 9px !important;
  color: #adc8d6;
}

.footer-copyright {
  margin: 14px 0 0;
  color: #7ea5b8;
  font-size: 10px;
  letter-spacing: 0.08em;
}

.maplibregl-ctrl-top-right {
  top: 7px;
  right: 7px;
}

.maplibregl-ctrl-group {
  overflow: hidden;
  border: 1px solid rgba(46, 103, 130, 0.3);
  border-radius: 8px !important;
  box-shadow: 0 4px 12px rgba(7, 48, 74, 0.17) !important;
}

.maplibregl-ctrl-attrib {
  font-size: 10px;
}

.maplibregl-canvas:focus-visible {
  outline: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.temperature-controls { margin: 12px 0; padding: 12px 4px; border-block: 1px solid #abcbd8; }
.temperature-controls h3 { margin: 0; font-size: 15px; color: #113b59; }
.temperature-controls h3 span { font-size: 10px; padding: 2px 5px; background: #e0edf5; border-radius: 3px; }
.baseline-label { margin: 5px 0 12px; color: #456077; font-size: 11px; }
.temperature-mode-row { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; color: #38586d; font-size: 12px; }
.temperature-mode-row select { min-width: 0; padding: 4px 8px; font: inherit; font-weight: 700; }
.date-row, .date-selects, .play-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.date-selects { justify-content: center; font-size: 14px; }
.temperature-controls button, .temperature-controls select { min-height: 40px; border: 1px solid #88abbf; border-radius: 5px; background: #fff; color: #153d58; cursor: pointer; }
.date-row > button { min-width: 40px; font-size: 25px; }
.date-selects select { min-width: 57px; padding: 3px; font-size: 18px; font-weight: 700; }
#dateSlider { width: 100%; height: 28px; accent-color: #146a98; }
.month-ticks, .legend-ticks { display: flex; justify-content: space-between; font-size: 11px; color: #36566b; }
.month-ticks { margin-bottom: 12px; }
.play-row button { flex: 1; font-size: 13px; font-weight: 700; }
.play-row select { width: 112px; font-size: 12px; }
.temperature-status, .temperature-point { font-size: 11px; line-height: 1.5; color: #38586d; margin: 8px 0; }
.temperature-status[data-state="error"] { color: #a12524; font-weight: 700; }
.temperature-legend { margin-top: 12px; }
.legend-gradient { display: block; width: 100%; height: 18px; border: 1px solid #789aaa; }
.temperature-legend small { display: block; margin-top: 4px; font-size: 10px; color: #466175; }
.temperature-options { display: grid; gap: 6px; font-size: 12px; padding: 5px; }
.temperature-options input[type="range"] { width: 100%; }
.temperature-options input[type="checkbox"] { width: 18px; height: 18px; vertical-align: middle; accent-color: #146a98; }
.temperature-options output { float: right; }
.mesh-tooltip-option { display: flex; align-items: center; gap: 7px; margin: 8px 0 2px; font-size: 12px; font-weight: 700; color: #173b53; cursor: pointer; }
.mesh-tooltip-option input { width: 18px; height: 18px; margin: 0; accent-color: #146a98; }
.mesh-tooltip { position: absolute; z-index: 7; display: grid; gap: 3px; width: max-content; max-width: min(250px, calc(100% - 16px)); padding: 9px 11px; border: 1px solid #7396a8; border-radius: 7px; background: rgba(255,255,255,.97); box-shadow: 0 5px 18px rgba(7,45,72,.22); color: #173b53; font-size: 12px; line-height: 1.4; pointer-events: none; }
.mesh-tooltip[hidden] { display: none; }
.mesh-tooltip strong { font-size: 13px; }
.mesh-tooltip small { color: #48677a; font-size: 10px; }
.map-temperature-label { position: absolute; left: 10px; top: 8px; z-index: 4; margin: 0; padding: 7px 9px; max-width: calc(100% - 66px); background: rgba(255,255,255,.92); color: #173b53; font-size: 12px; font-weight: 700; border: 1px solid #b8ccd7; border-radius: 4px; pointer-events: none; }
.temperature-controls button:focus-visible, .temperature-controls select:focus-visible, input:focus-visible { outline: 3px solid #087da2; outline-offset: 2px; }
.temperature-controls button:disabled, .temperature-controls select:disabled { opacity: .5; cursor: wait; }

@media (max-width: 760px) {
  .topbar {
    min-height: 44px;
    padding: 3px 5px;
  }

  .topbar-inner {
    gap: 7px;
  }

  .header-identity {
    gap: 8px;
  }

  .brand-home {
    min-width: 0;
    min-height: 36px;
    padding: 3px;
    border-radius: 6px;
  }

  .brand-logo {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
  }

  .brand-home-copy,
  .product-kicker,
  .tool-subtitle {
    display: none;
  }

  .title-row {
    padding-left: 8px;
  }

  .tool-title-line h1 {
    font-size: 15px;
  }

  .sns-link {
    min-height: 34px;
    padding: 3px;
  }

  .x-mark {
    width: 24px;
    height: 24px;
  }

  .sns-label {
    display: none;
  }

  main {
    padding: 0;
  }

  .tool-layout {
    position: relative;
    height: calc(100svh - 44px);
    min-height: 570px;
    display: block;
    overflow: hidden;
  }

  .map-column {
    height: 100%;
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .map-shell {
    min-height: 0;
    border-radius: 0;
  }

  .control-panel {
    position: absolute;
    right: 8px;
    bottom: calc(52px + env(safe-area-inset-bottom));
    left: 8px;
    z-index: 8;
    width: auto;
    max-height: min(58svh, 510px);
    padding: 10px 10px 11px;
    border: 1px solid rgba(54, 121, 151, 0.36);
    border-radius: 13px;
    background: rgba(245, 251, 253, 0.95);
    box-shadow: 0 12px 32px rgba(7, 45, 72, 0.27);
    backdrop-filter: blur(12px);
  }

  #panelToggle {
    min-height: 30px;
    padding: 3px 8px;
    display: block;
    border: 1px solid #8eb6c8;
    border-radius: 7px;
    color: #0b4d70;
    background: #eef8fb;
    font-size: 10px;
    font-weight: 800;
  }

  .control-panel.is-collapsed .panel-collapsible,
  .control-panel.is-collapsed .map-status {
    display: none;
  }

  .control-panel.is-collapsed {
    max-height: none;
  }

  .control-heading {
    margin-bottom: 7px;
  }

  .control-heading h2 {
    font-size: 17px;
  }

  .panel-section {
    margin-top: 7px;
    padding: 10px;
  }

  .layer-toggle {
    min-height: 50px;
    padding: 6px 4px;
    grid-template-columns: 22px 36px 1fr;
  }

  .layer-toggle small {
    font-size: 10px;
  }

  .map-status {
    margin-top: 6px;
    padding-top: 7px;
  }

  .road-details {
    right: 9px;
    bottom: 250px;
    width: calc(100% - 18px);
  }

  .scope-note {
    min-height: 48px;
    padding: 7px 9px;
    font-size: 9px;
  }

  .scope-note strong,
  .scope-note div > span {
    display: block;
  }

  .footer-inner {
    padding: 18px 14px 15px;
  }

  .footer-top {
    align-items: flex-start;
  }

  .footer-links {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .footer-links a {
    min-height: 38px;
    padding: 6px 9px;
    font-size: 11px;
  }
}

@media (max-width: 480px) {
  .footer-top {
    display: block;
  }

  .footer-logo {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
  }

  .footer-links {
    margin-top: 14px;
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .tool-layout { height: auto; min-height: 0; display: flex; flex-direction: column; overflow: visible; }
  .control-panel { position: relative; inset: auto; width: 100%; max-height: none; border-radius: 0; padding: 8px 10px; box-shadow: none; overflow: visible; }
  .control-heading { margin: 0; }
  .control-heading h2 { font-size: 14px; }
  .control-heading .eyebrow { display: none; }
  .temperature-controls { margin: 6px 0 0; padding: 6px 0 0; display: grid; grid-template-columns: 1fr 1fr; column-gap: 12px; border-bottom: 0; }
  .temperature-controls h3, .baseline-label, .temperature-status, .temperature-point, #retryTemperature { grid-column: 1 / -1; }
  .temperature-controls h3 { font-size: 13px; }
  .baseline-label { margin: 3px 0 5px; font-size: 10px; }
  .date-row { grid-row: 3; grid-column: 1; gap: 2px; }
  .date-row > button { min-width: 32px; }
  .date-selects { gap: 2px; font-size: 11px; }
  .date-selects select { min-width: 38px; font-size: 15px; }
  .play-row { grid-row: 3; grid-column: 2; gap: 3px; }
  .play-row button { font-size: 11px; }
  .play-row select { width: 82px; font-size: 10px; }
  #dateSlider { grid-column: 1 / -1; height: 25px; margin: 0; }
  .month-ticks { grid-column: 1 / -1; margin-bottom: 2px; font-size: 9px; }
  .temperature-legend { grid-column: 1 / -1; margin-top: 3px; }
  .legend-gradient { height: 12px; }
  .temperature-legend small { font-size: 9px; margin-top: 1px; }
  .temperature-status { margin: 3px 0; font-size: 10px; }
  .temperature-point { margin: 4px 0; font-size: 10px; }
  #clearTemperaturePoint { grid-column: 1 / -1; min-height: 32px; }
  .control-panel .panel-collapsible { max-height: 220px; overflow-y: auto; }
  .map-column { height: auto; }
  .map-shell { height: max(340px, calc(100svh - 390px)); min-height: 340px; }
  .road-details { bottom: 35px; }
  .map-temperature-label { font-size: 10px; }
}

@media (max-width: 360px) {
  .topbar {
    padding-right: 5px;
    padding-left: 5px;
  }

  .topbar-inner,
  .header-identity {
    gap: 5px;
  }

  .brand-logo {
    width: 26px;
    height: 26px;
    flex-basis: 26px;
  }

  .brand-home {
    min-height: 34px;
  }

  .title-row {
    padding-left: 7px;
  }

  .tool-title-line h1 {
    font-size: 14px;
  }

  .sns-link {
    min-height: 32px;
  }

  .x-mark {
    width: 22px;
    height: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Parallel climate and live-data controls. */
[hidden] { display: none !important; }
.display-mode-buttons, .live-time-buttons { display: flex; gap: 8px; margin: 10px 0; }
.display-mode-buttons { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.display-mode-buttons button { min-width: 0; min-height: 44px; padding: 8px 4px; font-size: 12px; }
.display-mode-buttons button[aria-pressed="true"] { background: #155c72; color: white; border-color: #155c72; }
#liveControls > label { display: block; font-weight: 700; margin: 10px 0 5px; }
#liveControls > select { width: 100%; max-width: 100%; min-height: 44px; }
.live-time-buttons button { flex: 1; min-height: 44px; }
.live-meta { font-size: 12px; line-height: 1.6; margin: 7px 0; color: #526673; }
.live-notice { font-size: 13px; line-height: 1.6; padding: 8px; background: #fff1cc; color: #694500; border-radius: 6px; }
.live-warm { background: #b8dfd0; }

.live-data-details summary { min-height: 40px; padding: 10px 0; font-size: 12px; cursor: pointer; }
.live-view-controls { display:flex; align-items:center; gap:8px; margin:8px 0; font-size:12px; font-weight:700; }
.live-view-controls select { flex:1; min-width:0; min-height:44px; border:1px solid #88abbf; border-radius:5px; background:white; color:#153d58; padding:6px; }
.dynamic-controls { display:block; }
.dynamic-controls > label { display:block; font-size:12px; font-weight:700; margin:7px 0 4px; }
.dynamic-controls > select, .dynamic-controls > input[type="range"] { width:100%; min-width:0; }
.dynamic-controls > select { font-size:12px; min-height:44px; }
.dynamic-controls > input[type="range"] { margin-left:0; margin-right:0; }
.dynamic-controls > button { min-height:44px; }
.weather-legend, .live-snow-legend { display:flex; flex-wrap:wrap; gap:7px 10px; font-size:11px; margin:10px 0; }
.weather-legend span { display:flex; align-items:center; gap:3px; }
.weather-legend i { width:15px; height:15px; border:1px solid #59717c; }
.weather-sun { background:#ffaa00; } .weather-cloud { background:#aaaaaa; } .weather-rain { background:#0041ff; } .weather-mix { background:#a0d2ff; } .weather-snow { background:#f2f2ff; }
.live-snow-toggles { display:flex; flex-wrap:wrap; gap:10px; margin:8px 0; font-size:12px; }
.live-snow-toggles label { display:flex; align-items:center; gap:4px; min-height:44px; }
.live-snow-scale { height:15px; background:linear-gradient(to right,#fafbff,#a3acc5,#182a52); border:1px solid #67839b; }
.maplibregl-popup-content { color:#153d58; font-size:12px; line-height:1.6; }
.maplibregl-popup-content p { margin:5px 0; }
@media (max-width: 760px) {
  #liveControls { display: block; max-height: 260px; overflow-y: auto; overscroll-behavior: contain; }
  .dynamic-controls { max-height:260px; overflow-y:auto; overscroll-behavior:contain; }
  #liveControls > label { margin: 4px 0; font-size: 12px; }
  .display-mode-buttons { margin: 6px 0; }
}
