/* --------------------------------------------------
   Base
-------------------------------------------------- */

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  font-family: "Open Sans", sans-serif;
  background: #f4f6f8;
  color: #1f2933;
}

input[hidden],
select[hidden] {
  display: none !important;
}


/* --------------------------------------------------
   Shared site shell
-------------------------------------------------- */

#topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: #243B53;
  border-bottom: 1px solid #d9e2ec;
  box-sizing: border-box;
}

.topbar-left {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
}

.app-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.topbar-nav-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 12px;
  border: 1px solid #EB6C25;
  border-radius: 999px;
  background: #FAD7C2;
  color: #243B53;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.topbar-nav-pill:hover {
  background: #f8fafc;
}

.topbar-nav-pill:focus-visible {
  outline: none;
  background: #243B53;
  color: #ffffff;
  border-color: #102a43;
}

.topbar-nav-pill.is-active {
  background: #EB6C25;
  color: #ffffff;
  border-color: #EB6C25;
}

.topbar-nav-pill.is-active:hover {
  background: #102a4353;
  color: #ffffff;
}

.logo-strip-logos a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.logo-strip-logos a:hover {
  opacity: 0.75;
}

.dashboard-footer {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 6px 18px;
  background: #ffffff;
}

.footer-text {
  font-size: 10px;
  line-height: 1.25;
  color: #243b53;
}

.logo-strip-logos {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
}

.logo-strip-logos img {
  max-height: 25px;
  max-width: 120px;
  object-fit: contain;
}

.dashboard-footer a {
  color: inherit;
  text-decoration: none;
  font-weight: 700;
}

.dashboard-footer a:hover {
  text-decoration: none;
  opacity: 0.75;
}


/* --------------------------------------------------
   Shared controls, legends, modals and map helpers
-------------------------------------------------- */

#statsPanel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  align-self: stretch;
}

.stat-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8px 12px;
  min-height: 0;
  height: 100%;
  border: 1px solid #d9e2ec;
  border-radius: 12px;
  background: #f8fafc;
  box-sizing: border-box;
}

.stat-label {
  font-size: 12px;
  font-weight: 700;
  color: #486581;
  margin-bottom: 3px;
}

.stat-value {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.05;
  color: #102a43;
}

.stat-subvalue {
  font-size: 10px;
  color: #7b8794;
  margin-top: 2px;
  min-height: 10px;
}

.map-legend-pill {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2500;
  pointer-events: auto;
}

.map-legend-button {
  height: 36px;
  padding: 0 14px;
  border: 1px solid #bcccdc;
  border-radius: 999px;
  background: #ffffff;
  color: #102a43;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(16, 42, 67, 0.12);
}

.map-legend-button:hover {
  background: #f8fafc;
}

.map-legend-popup {
  position: absolute;
  top: 44px;
  left: 0;
  width: 500px;
  max-width: min(500px, calc(100vw - 32px));
  z-index: 2501;
}

.map-legend-popup .legend {
  max-height: calc(100vh - 120px);
  margin: 0;
  padding: 10px 12px;
  overflow-y: auto;
  border: 1px solid #d9e2ec;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 20px rgba(16, 42, 67, 0.16);
}

#map {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.control-group {
  margin-bottom: 10px;
}

label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 13px;
  color: #243b53;
}

select {
  width: 100%;
  padding: 8px 10px;
  font-size: 13px;
  box-sizing: border-box;
  border: 1px solid #bcccdc;
  border-radius: 8px;
  background: #ffffff;
  color: #102a43;
}

select:focus {
  outline: none;
  border-color: #486581;
}

.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill-btn {
  padding: 7px 13px;
  font-size: 13px;
}

.label-with-info {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.label-with-info label {
  margin-bottom: 0;
}

.info-inline {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.inline-info-button {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid #bcccdc;
  border-radius: 999px;
  background: #ffffff;
  color: #486581;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.inline-info-button:hover {
  background: #f8fafc;
}

.inline-info-tooltip {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  width: 300px;
  padding: 6px 8px;
  border: 1px solid #d9e2ec;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(16, 42, 67, 0.16);
  color: #243b53;
  font-size: 12px;
  line-height: 1.35;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
  z-index: 20;
  pointer-events: none;
}

.inline-info-tooltip p {
  margin: 0 0 4px;
}

.inline-info-tooltip p:last-child {
  margin-bottom: 0;
}

.info-inline:hover .inline-info-tooltip,
.info-inline:focus-within .inline-info-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.legend {
  margin-top: 0;
  padding: 10px;
  border: 1px solid #d9e2ec;
  border-radius: 10px;
  background: #f8fafc;
  box-sizing: border-box;
}

.legend-title {
  margin-bottom: 5px;
  font-weight: 700;
  font-size: 12px;
  color: #102a43;
}

.legend-item {
  display: flex;
  align-items: center;
  margin-bottom: 3px;
  font-size: 12px;
  line-height: 1.25;
  color: #243b53;
}

.legend-swatch {
  width: 20px;
  height: 9px;
  margin-right: 8px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  flex: 0 0 auto;
}

.legend-line-swatch {
  width: 22px;
  height: 4px;
  margin-right: 8px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.legend-boundary-line {
  width: 22px;
  height: 0;
  margin-right: 8px;
  border-top: 2px dashed #102a43;
  flex: 0 0 auto;
}

.legend-size-row {
  display: grid;
  grid-template-columns: repeat(5, max-content);
  align-items: end;
  justify-content: space-between;
  column-gap: 12px;
  margin-top: 4px;
}

.legend-size-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: max-content;
  font-size: 12px;
  color: #243b53;
}

.legend-size-item > span:last-child {
  white-space: nowrap;
}

.legend-size-circle {
  display: inline-block;
  border-radius: 50%;
  background: rgba(59, 82, 139, 0.18);
  border: 1px solid rgba(16, 42, 67, 0.35);
  box-sizing: border-box;
}

.legend-size-12 {
  width: 18px;
  height: 18px;
}

.legend-size-16 {
  width: 24px;
  height: 24px;
}

.legend-size-20 {
  width: 30px;
  height: 30px;
}

.legend-size-24 {
  width: 36px;
  height: 36px;
}

.legend-size-28 {
  width: 42px;
  height: 42px;
}

.muted {
  color: #7b8794;
}

.leaflet-popup-content {
  font-size: 13px;
  line-height: 1.5;
}

.telraam-pie-icon {
  background: transparent;
  border: none;
}

.telraam-pie-icon svg {
  display: block;
  overflow: visible;
}

.hourly-pattern-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.hourly-pattern-header h2 {
  margin: 0;
  font-size: 15px;
  color: #102a43;
}

.hourly-pattern-wrap {
  height: 220px;
  min-height: 220px;
  position: relative;
}

.help-modal {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: none;
}

.help-modal.is-open {
  display: block;
}

.help-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 42, 67, 0.45);
}

.help-modal-card {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 90%;
  transform: translate(-50%, -50%);
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(16, 42, 67, 0.25);
  overflow: hidden;
}

.help-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid #d9e2ec;
}

.help-modal-header h2 {
  margin: 0;
  width: 100%;
  text-align: center;
  padding: 0 42px;
  font-size: 18px;
  color: #102a43;
}

.help-close-button {
  border: none;
  background: transparent;
  font-size: 26px;
  line-height: 1;
  color: #486581;
  cursor: pointer;
}

.help-modal-body {
  padding: 18px;
  line-height: 1.2;
  color: #243b53;
}

.help-modal-body p {
  margin: 0 0 5px;
}

.help-modal-body p:last-child {
  margin-bottom: 0;
}

.chart-title-main {
  font-size: 15px;
  line-height: 1.05;
  font-weight: 700;
  color: #102a43;
}

.chart-title-meta {
  font-size: 12px;
  font-weight: 400;
  color: #486581;
}

.leaflet-interactive:focus {
  outline: none;
}

.enclod-direction-arrow {
  background: transparent;
  border: none;
}

.enclod-direction-arrow svg {
  display: block;
  overflow: visible;
  filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.7));
}

.sensor-priority-panel,
.sensor-secondary-panel {
  min-width: 0;
  min-height: 0;
  border: 1px solid #d9e2ec;
  border-radius: 14px;
  background: #ffffff;
  box-sizing: border-box;
}

.sensor-priority-panel {
  box-shadow: 0 8px 20px rgba(16, 42, 67, 0.1);
}

.sensor-secondary-panel {
  box-shadow: 0 5px 14px rgba(16, 42, 67, 0.06);
}

.sensor-section-title-row {
  position: relative;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

#sensorBucketTypePills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

#sensorBucketTypePills .pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 9px;
  border: 1px solid #bcccdc;
  border-radius: 999px;
  background: #ffffff;
  color: #243b53;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

#sensorBucketTypePills .pill-btn:hover {
  background: #f8fafc;
}

#sensorBucketTypePills .pill-btn.is-active {
  background: #EB6C25;
  border-color: #EB6C25;
  color: #ffffff;
}

.mode-pedestrian {
  color: #F2C14E;
  font-weight: 700;
}

.mode-bike {
  color: #1f78b4;
  font-weight: 700;
}

.mode-car {
  color: #B8336A;
  font-weight: 700;
}

.mode-large {
  color: #6D2E1F;
  font-weight: 700;
}

.sensor-about-map-button {
  white-space: nowrap;
}

.sensor-analysis-modal-card {
  width: 90%;
  max-height: min(88vh, 760px);
  display: flex;
  flex-direction: column;
}

.sensor-analysis-modal-body {
  overflow-y: auto;
}

.sensor-analysis-modal-body h3 {
  margin: 0 0 4px;
  font-size: 14px;
  color: #102a43;
}

.sensor-analysis-modal-body p {
  margin: 0 0 5px;
  line-height: 1.45;
  color: #334e68;
}

.sensor-analysis-modal-body p:last-child {
  margin-bottom: 0;
}


/* --------------------------------------------------
   Main dashboard page
-------------------------------------------------- */

#dashboard {
  display: grid;
  grid-template-rows: 64px minmax(0, 1fr) auto;
  height: 100vh;
  width: 100%;
  overflow: hidden;
}

#app {
  display: grid;
  grid-template-columns: 45% 55%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

#mapColumn {
  min-width: 0;
  min-height: 0;
  border-right: 1px solid #d9e2ec;
  background: #ffffff;
  overflow: hidden;
}

#sideColumn {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
  min-height: 0;
  background: #f4f6f8;
  overflow: hidden;
}

#topPanel {
  display: grid;
  grid-template-columns: minmax(0, 420px) minmax(0, 1fr);
  gap: 14px;
  padding: 3px 14px 10px 14px;
  background: #ffffff;
  border-bottom: 1px solid #d9e2ec;
  box-sizing: border-box;
  align-items: stretch;
  min-width: 0;
  max-width: 100%;
  overflow: visible;
  position: relative;
  z-index: 3000;
}

#sidebar {
  min-width: 0;
  padding: 0;
  background: transparent;
  border: none;
  box-sizing: border-box;
  justify-self: end;
  width: 100%;
  max-width: 420px;
}

#bucketTypePills {
  justify-content: flex-end;
}

#sidebar h1 {
  margin: 0 0 10px 0;
  font-size: 16px;
  color: #102a43;
}

#mapWrap {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
}

#chartPanel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  padding: 10px 10px 6px 10px;
  background: #ffffff;
  min-width: 0;
  min-height: 0;
  box-sizing: border-box;
  overflow: hidden;
  position: relative;
  z-index: 2;
}

#variationBlock {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 0 1 260px;
  min-width: 0;
  min-height: 230px;
  max-height: 285px;
  overflow: hidden;
}

#variationHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 34px;
  flex: 0 0 auto;
  margin: 0;
}

#flowVariationWrap {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  height: auto;
  overflow: hidden;
}

.year-switch {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}

.year-btn,
.pill-btn {
  border: 1px solid #bcccdc;
  border-radius: 999px;
  background: #ffffff;
  color: #243b53;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.year-btn {
  padding: 6px 12px;
  font-size: 13px;
}

.year-btn:hover,
.pill-btn:hover {
  background: #f8fafc;
}

.year-btn.is-active,
.pill-btn.is-active {
  background: #102a43;
  color: #ffffff;
  border-color: #102a43;
}

.year-btn:disabled,
.pill-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.map-controls {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  pointer-events: none;
}

.map-help-button,
.map-layers-button,
.map-home-button {
  height: 36px;
  border: 1px solid #bcccdc;
  border-radius: 999px;
  background: #ffffff;
  color: #102a43;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(16, 42, 67, 0.12);
  pointer-events: auto;
}

.map-help-button {
  width: 36px;
  font-size: 18px;
}

.map-layers-button,
.map-home-button {
  padding: 0 12px;
  font-size: 14px;
}

.map-help-button:hover,
.map-layers-button:hover,
.map-home-button:hover {
  background: #f8fafc;
}

.layers-control {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  pointer-events: auto;
}

.layers-panel {
  position: absolute;
  top: 42px;
  left: 0;
  min-width: 140px;
  padding: 10px 12px;
  border: 1px solid #d9e2ec;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(16, 42, 67, 0.16);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
  pointer-events: none;
}

.layers-control:hover .layers-panel,
.layers-control:focus-within .layers-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-weight: 400;
  color: #243b53;
  cursor: pointer;
}

.checkbox-row+.checkbox-row {
  margin-top: 8px;
}

.checkbox-row input[type="checkbox"] {
  margin: 0;
}

#dashboard #hourlyPatternPanel {
  display: flex !important;
  flex-direction: column;
  flex: 0 0 215px !important;
  min-width: 0;
  min-height: 215px;
  max-height: 215px;
  width: 100% !important;
  margin-top: 0 !important;
  padding: 6px 10px 4px 10px !important;
  background: #ffffff;
  border-top: 1px solid #d9e2ec;
  box-sizing: border-box;
  overflow: hidden !important;
}

#dashboard .hourly-pattern-wrap {
  flex: 1 1 auto;
  position: relative;
  height: auto !important;
  min-height: 120px !important;
  max-height: 135px !important;
  min-width: 0;
  overflow: hidden;
}

#dashboard .hourly-pattern-header {
  flex: 0 0 auto;
  margin-bottom: 4px;
}

#dashboard .hourly-pattern-header h2 {
  font-size: 14px;
  line-height: 1.1;
}

#dashboard #hourlyPatternSubtitle {
  font-size: 11px;
  line-height: 1.1;
}

#dashboard #hourlyPatternChart {
  display: block;
  width: 100% !important;
  height: 100% !important;
}


.variation-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 16px;
  border: 1px dashed #d9e2ec;
  border-radius: 10px;
  background: #f8fafc;
  color: #7b8794;
  text-align: center;
  box-sizing: border-box;
}

.variation-scale {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: #486581;
}

.variation-scale-label {
  font-size: 11px;
  color: #486581;
}

.variation-scale-swatch {
  width: 12px;
  height: 8px;
  display: inline-block;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 3px;
}

.variation-grid {
  --label-width: 38px;
  --week-count: 53;
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 5px;
  height: 100%;
  min-width: 0;
  min-height: 0;
}

.variation-month-row,
.variation-week-row,
.variation-body {
  display: grid;
  grid-template-columns: var(--label-width) 1fr;
  gap: 6px;
  min-width: 0;
}

.variation-axis-spacer {
  width: var(--label-width);
}

.variation-month-grid {
  display: grid;
  grid-template-columns: repeat(var(--week-count), minmax(10px, 1fr));
  min-width: 0;
  grid-auto-flow: row;
}

.variation-month-grid-pills {
  gap: 2px;
  align-items: center;
  grid-auto-rows: 22px;
}

.variation-month-pill {
  min-height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border: 1px solid #d9e2ec;
  border-radius: 999px;
  background: #ffffff;
  color: #243b53;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  box-sizing: border-box;
}

.variation-week-grid {
  display: grid;
  grid-template-columns: repeat(var(--week-count), minmax(10px, 1fr));
  gap: 2px;
  min-width: 0;
}

.variation-week-cell {
  min-height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px 1px;
  border: 1px solid #edf2f7;
  border-radius: 5px;
  background: #fafbfc;
  color: #243b53;
  box-sizing: border-box;
}

.variation-week-label {
  line-height: 1;
  font-size: 12px;
  font-weight: 700;
}

.variation-weekday-col {
  display: grid;
  grid-template-rows: repeat(7, 18px);
  gap: 2px;
  width: var(--label-width);
}

.variation-weekday-label {
  min-height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #edf2f7;
  border-radius: 5px;
  background: #fafbfc;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  box-sizing: border-box;
}

.variation-day-grid {
  display: grid;
  grid-template-columns: repeat(var(--week-count), minmax(10px, 1fr));
  grid-template-rows: repeat(7, 18px);
  gap: 2px;
}

.variation-day-cell {
  min-width: 0;
  min-height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.variation-day-cell.outside-year {
  opacity: 0;
}

.variation-day-cell.no-data::after {
  content: "";
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #d9e2ec;
}

.variation-day-dot {
  display: inline-block;
  border-radius: 50%;
  border: 1px solid rgba(16, 42, 67, 0.18);
  box-sizing: border-box;
}

#chartTitle {
  display: flex;
  margin: 0;
  align-items: baseline;
  gap: 10px;
  flex-wrap: nowrap;
  min-width: 0;
  overflow: hidden;
}

#chartTitle .chart-title-main,
#chartTitle .chart-title-meta {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#sideColumn,
#topPanel,
#sidebar,
#statsPanel,
#chartPanel,
#variationBlock,
#flowVariationWrap,
#hourlyPatternPanel {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.dashboard-about-map-modal-panel {
  width: 90%;
}

.dashboard-about-map-body {
  display: grid;
  gap: 10px;
}

.dashboard-about-kpi-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 4px 0 6px;
}

.dashboard-about-kpi-box {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid #d9e2ec;
  border-radius: 14px;
  background: #f8fafc;
}

.dashboard-about-kpi-icon {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #fff3e8;
  color: #EB6C25;
  display: grid;
  place-items: center;
}

.dashboard-about-kpi-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dashboard-about-kpi-label {
  font-size: 9.5px;
  line-height: 1.1;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #627d98;
}

.dashboard-about-kpi-value {
  font-size: 14px;
  font-weight: 700;
  color: #102a43;
  line-height: 1.25;
}

.dashboard-about-section {
  padding-top: 0px;
}

.dashboard-about-section h3 {
  margin: 0 0 4px;
  font-size: 14px;
  color: #102a43;
}

.dashboard-about-section p {
  margin: 0 0 5px;
  line-height: 1.25;
  color: #334e68;
}

.dashboard-about-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.dashboard-about-image {
  margin: 0;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #d9e2ec;
  background: #f8fafc;
}

.dashboard-about-image img {
  display: block;
  width: 100%;
  height: 160px;
  object-fit: cover;
}

.dashboard-about-image figcaption {
  padding: 9px 11px;
  font-size: 12px;
  line-height: 1.4;
  color: #52606d;
}

.help-modal-card.dashboard-about-map-modal-panel {
  width: 90%;
  max-height: min(88vh, 760px);
  display: flex;
  flex-direction: column;
}

.dashboard-about-map-modal-panel .help-modal-body {
  overflow-y: auto;
}


/* --------------------------------------------------
   Time comparison page
-------------------------------------------------- */

.time-comparison-dashboard {
  display: grid;
  grid-template-rows: 64px minmax(0, 1fr) auto;
  height: 100vh;
  width: 100%;
  overflow: hidden;
}

#comparisonApp {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

#comparisonMapWrap {
  --swipe-percent: 50%;
  position: relative;
  z-index: 30;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: visible;
  background: #ffffff;
}

.comparison-map,
#mapRightClip {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#mapRightClip {
  z-index: 20;
  pointer-events: none;
}

#mapRight {
  pointer-events: auto;
}

#mapLeft {
  z-index: 10;
}

#comparisonSwipeHandle {
  position: absolute;
  top: 0;
  left: var(--swipe-percent);
  width: 44px;
  height: 100%;
  transform: translateX(-22px);
  z-index: 700;
  cursor: ew-resize;
  display: flex;
  align-items: center;
  justify-content: center;
}

.comparison-swipe-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 3px;
  transform: translateX(-50%);
  background: #102a43;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.75);
}

.comparison-swipe-grip {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: #ffffff;
  border: 2px solid #102a43;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #102a43;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(16, 42, 67, 0.25);
  user-select: none;
}

.is-comparison-dragging {
  user-select: none;
  cursor: ew-resize;
}

.compare-filter-panel {
  position: absolute;
  top: 62px;
  width: 300px;
  max-width: calc(50% - 44px);
  padding: 12px;
  border: 1px solid #d9e2ec;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 20px rgba(16, 42, 67, 0.16);
  z-index: 650;
  box-sizing: border-box;
}

.compare-filter-panel h2 {
  margin: 0 0 10px 0;
  font-size: 15px;
  color: #102a43;
}

.compare-filter-left {
  left: 12px;
}

.compare-filter-right {
  right: 12px;
}

.compare-filter-right .sensor-info-tooltip {
  right: 0;
  left: auto;
}

.comparison-map-controls {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 650;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

#comparisonLegendPill {
  top: 12px;
  left: 12px;
}

#comparisonStatsPanel {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(4, minmax(140px, 1fr));
  gap: 10px;
  padding: 12px 14px;
  background: #ffffff;
  border-top: 1px solid #d9e2ec;
  box-sizing: border-box;
}

.comparison-selected-feature,
.comparison-stat-card {
  padding: 10px 12px;
  border: 1px solid #d9e2ec;
  border-radius: 12px;
  background: #f8fafc;
  box-sizing: border-box;
}

.comparison-feature-name {
  font-size: 15px;
  font-weight: 700;
  color: #102a43;
  line-height: 1.25;
}

.comparison-stat-value {
  font-size: 18px;
  font-weight: 700;
  color: #102a43;
  line-height: 1.2;
}

#mapLeft,
#mapRight,
#mapRightClip {
  height: 100%;
  min-height: 0;
}

.comparison-action-button {
  height: 36px;
  border: 1px solid #bcccdc;
  border-radius: 999px;
  background: #ffffff;
  color: #102a43;
  font-size: 13px;
  font-weight: 700;
  padding: 0 14px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(16, 42, 67, 0.12);
}

.comparison-action-button:hover {
  background: #f8fafc;
}

.comparison-about-map-button {
  white-space: nowrap;
}

.help-modal-card.comparison-about-map-modal-panel {
  width: 80%;
  max-height: min(88vh, 760px);
  display: flex;
  flex-direction: column;
}

.comparison-about-map-modal-panel .help-modal-body {
  overflow-y: auto;
}

.comparison-about-map-body {
  display: grid;
  gap: 8px;
}

.comparison-about-kpi-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 4px 0 6px;
}

.comparison-about-kpi-box {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid #d9e2ec;
  border-radius: 14px;
  background: #f8fafc;
}

.comparison-about-kpi-icon {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #fff3e8;
  color: #EB6C25;
  display: grid;
  place-items: center;
}

.comparison-about-kpi-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.comparison-about-kpi-label {
  font-size: 9.5px;
  line-height: 1.1;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #627d98;
}

.comparison-about-kpi-value {
  font-size: 14px;
  font-weight: 700;
  color: #102a43;
  line-height: 1.25;
}

.comparison-about-section {
  padding-top: 0;
}

.comparison-about-section h3 {
  margin: 0 0 4px;
  font-size: 15px;
  color: #102a43;
}

.comparison-about-section p {
  margin: 0 0 5px;
  line-height: 1.25;
  color: #334e68;
}

.comparison-about-section p:last-child {
  margin-bottom: 0;
}


/* --------------------------------------------------
   Sensor comparison page
-------------------------------------------------- */

#sensorComparisonDashboard.sensor-comparison-dashboard {
  display: grid;
  grid-template-rows: 64px minmax(0, 1fr) auto;
  height: 100vh;
  width: 100%;
  overflow: hidden;
}

#sensorComparisonApp {
  display: grid;
  grid-template-columns: minmax(370px, 410px) minmax(0, 1fr);
  grid-template-rows: minmax(0, 65%) minmax(0, 35%);
  grid-template-areas: "controls map"
    "controls chart";
  gap: 8px;
  height: 100%;
  min-height: 0;
  padding: 8px;
  overflow: hidden;
  background: #f4f6f8;
  box-sizing: border-box;
}

#sensorControlColumn {
  grid-area: controls;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-content: stretch;
  gap: 8px;
  min-width: 0;
  min-height: 0;
  overflow: visible;
  position: relative;
  z-index: 50;
}

#sensorMapFilters,
#sensorMapPanel,
#sensorChartStagePanel,
#sensorFindingsPanel {
  padding: 10px;
}

#sensorMapFilters {
  position: relative;
  overflow: visible;
  z-index: 3000;
}

.sensor-section-title-row h2,
#sensorChartStagePanel h2,
#sensorFindingsPanel h2 {
  margin: 0;
  color: #102a43;
  font-size: 15px;
  line-height: 1.15;
}

#sensorMapFilters .control-group {
  margin: 8px 0 0 0;
}

#sensorMapFilters label {
  display: block;
  margin: 0 0 5px 0;
  color: #102a43;
  font-size: 12px;
  font-weight: 700;
}

#sensorMapFilters select,
#sensorMapFilters input,
#sensorChartSelect {
  width: 100%;
  padding: 7px 9px;
  border: 1px solid #bcccdc;
  border-radius: 9px;
  background: #ffffff;
  color: #102a43;
  font-size: 12px;
  box-sizing: border-box;
}

#sensorMapFilters select:focus,
#sensorMapFilters input:focus,
#sensorChartSelect:focus {
  outline: none;
  border-color: #486581;
}

#sensorComparisonApp .label-with-info {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 5px;
}

#sensorComparisonApp .label-with-info label {
  margin-bottom: 0;
}

#sensorMapPanel {
  grid-area: map;
  display: grid;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

#sensorMapWrap {
  position: relative;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid #d9e2ec;
  border-radius: 14px;
  background: #eef2f7;
  box-sizing: border-box;
}

#sensorComparisonApp #sensorMap {
  width: 100%;
  height: 100%;
  min-height: 0;
  border-radius: 14px;
  overflow: hidden;
  background: #eef2f7;
}

.sensor-map-action-bar {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 850;
  display: flex;
  align-items: flex-start;
  gap: 7px;
}

.sensor-filter-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #bcccdc;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: #102a43;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(16, 42, 67, 0.12);
}

.sensor-filter-action-button:hover,
.sensor-filter-action-button:focus {
  background: #ffffff;
  color: #102a43;
}

.sensor-map-info-button {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(16, 42, 67, 0.12);
}

#sensorLegendPanel.sensor-legend-panel {
  position: absolute;
  top: 10px;
  right: 10px;
  bottom: auto;
  z-index: 850;
  width: min(235px, calc(100% - 20px));
  max-height: calc(100% - 20px);
  overflow-y: auto;
  padding: 9px 11px;
  border: 1px solid #d9e2ec;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 22px rgba(16, 42, 67, 0.16);
  box-sizing: border-box;
}

#sensorLegendPanel .legend {
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
}

#sensorLegendPanel .legend-title {
  margin-bottom: 6px;
  color: #102a43;
  font-size: 11px;
  font-weight: 700;
}

#sensorLegendPanel .legend-item {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 4px 0;
  color: #243b53;
  font-size: 11px;
  line-height: 1.22;
}

#sensorLegendPanel .legend-line-swatch,
#sensorLegendPanel .legend-boundary-line {
  margin-right: 0;
}

#sensorChartStagePanel {
  grid-area: chart;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 6px;
  min-width: 0;
  min-height: 0;
  overflow: visible;
  position: relative;
  z-index: 2;
}

.sensor-chart-stage-header {
  position: relative;
  z-index: 1200;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 430px);
  gap: 10px;
  align-items: center;
  min-width: 0;
  min-height: 0;
}

.sensor-chart-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.sensor-chart-title-row h2 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sensor-chart-switcher {
  min-width: 0;
}

#sensorChartStage {
  position: relative;
  min-width: 0;
  min-height: 0;
  padding: 8px;
  border: 1px solid #d9e2ec;
  border-radius: 13px;
  background: #f8fafc;
  box-sizing: border-box;
  overflow: hidden;
}

.sensor-chart-panel {
  display: none;
  width: 100%;
  height: 100%;
}

.sensor-chart-panel.is-active {
  display: block;
}

.sensor-chart-panel canvas {
  width: 100% !important;
  height: 100% !important;
}

#sensorFindingsPanel {
  position: relative;
  z-index: 2500;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-self: stretch;
  width: 100%;
  height: 100%;
  gap: 6px;
  min-width: 0;
  min-height: 0;
  background: #ffffff;
  overflow: visible;
}

#sensorQuestionCards {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: repeat(4, minmax(max-content, 1fr));
  align-content: stretch;
  gap: 6px;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding-right: 3px;
  overflow-x: hidden;
  overflow-y: auto;
  box-sizing: border-box;
}

.sensor-question-card {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 6px;
  row-gap: 4px;
  width: 100%;
  height: auto;
  min-width: 0;
  min-height: max-content;
  padding: 7px;
  border: 1px solid #d9e2ec;
  border-radius: 12px;
  background: #ffffff;
  box-sizing: border-box;
  overflow: visible;
}

.sensor-question-card .stat-label {
  grid-column: 2;
  align-self: center;
  margin: 0;
  color: #102a43;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
}

.sensor-question-rows {
  grid-column: 1 / -1;
  display: grid;
  gap: 4px;
}

.sensor-card-icon {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  background: #f8fafc;
}

.sensor-card-icon svg {
  width: 16px;
  height: 16px;
}

.sensor-card-icon path,
.sensor-card-icon rect {
  fill: none;
  stroke: #f28c28;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sensor-question-mini-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 5px;
  row-gap: 1px;
  padding-top: 4px;
  border-top: 1px solid #edf2f7;
}

.sensor-question-mini-row:first-child {
  padding-top: 0;
  border-top: none;
}

.sensor-question-segment {
  grid-row: 1 / span 2;
  align-self: center;
  color: #627d98;
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sensor-question-mini-main {
  min-width: 0;
  color: #102a43;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.12;
}

.sensor-question-mini-text {
  min-width: 0;
  color: #486581;
  font-size: 10px;
  line-height: 1.18;
}

.sensor-info-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

.sensor-info-wrap .inline-info-button {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid #bcccdc;
  border-radius: 999px;
  background: #ffffff;
  color: #486581;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  cursor: help;
}

.sensor-info-wrap .inline-info-button:hover {
  background: #f8fafc;
}

.sensor-info-tooltip {
  position: absolute;
  left: 0;
  top: calc(100% + 7px);
  z-index: 1000000;
  width: 260px;
  padding: 8px 9px;
  border: 1px solid #d9e2ec;
  border-radius: 9px;
  background: #ffffff;
  color: #243b53;
  font-size: 11.5px;
  font-weight: 400;
  line-height: 1.35;
  box-shadow: 0 8px 24px rgba(16, 42, 67, 0.18);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  white-space: normal;
  transform: translateY(-3px);
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
}

.sensor-info-tooltip-wide {
  width: 315px;
}

.sensor-help-info .sensor-info-tooltip {
  max-width: min(315px, calc(100vw - 40px));
}

.sensor-map-info-wrap .sensor-info-tooltip {
  left: 0;
  top: calc(100% + 7px);
}

.sensor-chart-title-row .sensor-info-tooltip {
  left: 0;
  right: auto;
  top: auto;
  bottom: calc(100% + 7px);
}

#sensorFindingsPanel .sensor-info-tooltip {
  right: 0;
  left: auto;
  top: calc(100% + 7px);
  bottom: auto;
}

.sensor-info-wrap:hover .sensor-info-tooltip,
.sensor-info-wrap:focus-within .sensor-info-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}


/* --------------------------------------------------
   About page and sensor information modal
-------------------------------------------------- */

.about-dashboard {
  display: grid;
  grid-template-rows: 64px minmax(0, 1fr) auto;
  height: 100vh;
  height: 100dvh;
  width: 100%;
  overflow: hidden;
}

#aboutPage {
  height: 100%;
  min-height: 0;
  overflow: hidden;
  box-sizing: border-box;
  background: #f4f6f8;
}

#aboutPage.about-with-map {
  display: grid;
  grid-template-columns: minmax(0, 54%) minmax(380px, 46%);
  gap: 16px;
  align-items: stretch;
  padding: 14px 18px;
}

.about-content-column {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 12px;
}

.about-hero,
.about-card {
  margin: 0;
  padding: 14px 16px;
  border: 1px solid #d9e2ec;
  border-radius: 16px;
  background: #ffffff;
  box-sizing: border-box;
}

.about-hero h2 {
  margin: 0 0 8px 0;
  font-size: 22px;
  line-height: 1.2;
  color: #102a43;
}

.about-hero p,
.about-card p {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: #243b53;
}

.about-card h3 {
  margin: 0 0 8px 0;
  font-size: 16px;
  color: #102a43;
}

.about-card-highlight {
  background: #fff7ed;
  border-color: #EB6C25;
  box-shadow: 0 8px 22px rgba(16, 42, 67, 0.12);
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  min-height: 0;
  overflow: hidden;
}

.about-grid .about-card {
  margin: 0;
}

.download-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.download-list a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border: 1px solid #102a43;
  border-radius: 999px;
  background: #ffffff;
  color: #102a43;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.download-list a:hover {
  background: #102a43;
  color: #ffffff;
}

.about-map-panel {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  row-gap: 12px;
  background: #ffffff;
  border: 1px solid #d9e2ec;
  border-radius: 18px;
  padding: 14px;
  box-shadow: 0 8px 22px rgba(16, 42, 67, 0.12);
  box-sizing: border-box;
  overflow: hidden;
}

.about-map-header h3 {
  margin: 0 0 5px 0;
  font-size: 16px;
  color: #102a43;
}

.about-sensor-legend {
  position: absolute;
  top: 12px;
  right: 12px;
  left: auto;
  width: min(220px, calc(100% - 24px));
  min-width: 0;
  max-width: none;
  z-index: 1000;
  pointer-events: auto;
}

.about-sensor-legend .legend {
  margin: 0;
}

.about-sensor-legend .sensor-legend {
  display: grid;
  gap: 5px;
  margin: 0;
}

.about-map-panel #sensorMap {
  width: 100%;
  height: 100%;
  min-height: 0;
  border-radius: 14px;
  overflow: hidden;
  background: #eef2f7;
}

.about-map-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 360px;
  overflow: hidden;
  border-radius: 14px;
}

.about-map-wrap #sensorMap {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 360px;
  border-radius: 14px;
  overflow: hidden;
  background: #eef2f7;
}

#sensorModal .sensor-modal-card {
  width: min(980px, calc(100vw - 32px));
  max-height: min(88vh, 820px);
  display: flex;
  flex-direction: column;
}


.sensor-modal-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.sensor-modal-image {
  margin: 0;
}

.sensor-modal-image img {
  display: block;
  width: 50%;
  margin: 0 auto;
  max-height: 200px;
  object-fit: cover;
  border: 1px solid #d9e2ec;
  border-radius: 12px;
}

.sensor-modal-image img.sensor-modal-image-square {
  width: min(200px, 50%);
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.sensor-modal-image figcaption {
  margin-top: 5px;
  font-size: 11px;
  line-height: 1.35;
  color: #486581;
  text-align: center;
}

.about-map-info-box {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1000;
  width: 230px;
  max-width: calc(100% - 190px);
  padding: 10px 12px;
  border: 1px solid #d9e2ec;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 20px rgba(16, 42, 67, 0.16);
  color: #243b53;
  font-size: 12px;
  line-height: 1.4;
  pointer-events: auto;
}

.about-map-info-box div+div {
  margin-top: 5px;
}

.about-map-info-action {
  margin-top: 8px;
  font-size: 10.5px;
}

.about-map-info-link {
  display: inline;
  padding: 0;
  border: none;
  background: transparent;
  color: #000000;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.about-map-info-link:hover {
  color: #000000;
  text-decoration: none;
}

.sensor-point-swatch {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  margin-right: 7px;
}

.about-map-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.about-map-title-row h3 {
  margin: 0;
}

.about-map-info-inline {
  flex: 0 0 auto;
}

.about-map-header-tooltip {
  width: 300px;
  z-index: 3000;
}

.about-map-wrap .leaflet-container {
  cursor: grab;
}

.about-map-wrap .leaflet-container:active {
  cursor: grabbing;
}

.about-map-wrap .leaflet-container.is-hovering-sensor,
.about-map-wrap .leaflet-container.is-hovering-sensor * {
  cursor: pointer !important;
}

.about-map-info-box p {
  margin: 0;
}

.about-map-info-box p+p {
  margin-top: 3px;
}

.about-map-info-image {
  margin: 8px 0 0 0;
}

.about-map-info-image img {
  display: block;
  width: 100%;
  max-height: 130px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #d9e2ec;
}

.sensor-modal-kpi-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 4px 0 6px;
}

.sensor-modal-kpi-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid #d9e2ec;
  border-radius: 14px;
  background: #f8fafc;
}

.sensor-modal-kpi-icon {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #fff3e8;
  color: #EB6C25;
}

.sensor-modal-kpi-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sensor-modal-kpi-label {
  font-size: 9.5px;
  line-height: 1.1;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #627d98;
}

.sensor-modal-kpi-value {
  margin-top: 2px;
  font-size: 14px;
  line-height: 1.25;
  font-weight: 700;
  color: #102a43;
}

.sensor-modal-links {
  margin: 10px 0 14px 0;
}

.sensor-modal-links a {
  display: inline-block;
  color: #000000;
  font-weight: 700;
  text-decoration: none;
  font-size: 12px;
}

.sensor-modal-links a:hover {
  color: #000000;
  text-decoration: none;
}

#sensorModal .sensor-modal-body {
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.35;
}

#sensorModal .sensor-modal-section {
  margin: 0 0 10px;
}

#sensorModal .sensor-modal-section h3 {
  margin: 0 0 4px;
  font-size: 14px;
  line-height: 1.2;
  font-weight: 700;
  color: #102a43;
}

#sensorModal .sensor-modal-section p {
  margin: 0 0 5px;
  line-height: 1.25;
  color: #334e68;
}

#sensorModal .sensor-modal-section p:last-child {
  margin-bottom: 0;
}

#sensorModal .sensor-modal-card .help-modal-header {
  position: relative;
  justify-content: center;
}

#sensorModal .sensor-modal-card .help-modal-header h2 {
  width: 100%;
  margin: 0;
  text-align: center;
  padding: 0 42px;
}

#sensorModal .sensor-modal-card .help-close-button {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
}

.sensor-analysis-modal-body .sensor-modal-section {
  margin: 0 0 10px;
}

.sensor-analysis-modal-body .sensor-modal-section p {
  line-height: 1.35;
}

.sensor-analysis-modal-body .sensor-modal-section:last-child {
  margin-bottom: 0;
}

.legend-aoi-swatch {
  display: inline-block;
  width: 14px;
  height: 0;
  border-top: 2px dashed #102a43;
  margin-right: 6px;
}

.legend-buildings-swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  background: #d3d2d2;
  border: 1px solid #d0d0d0;
  margin-right: 6px;
  box-sizing: border-box;
}

.about-map-pill {
  width: auto;
  padding: 0 14px;
  font-size: 13px;
  white-space: nowrap;
}


/* --------------------------------------------------
   Responsive adjustments
-------------------------------------------------- */

@media (max-width: 1100px) {
  #topPanel {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px;
  }

  #statsPanel {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 1200px) {
  #topbar {
    height: auto;
    min-height: 64px;
    padding: 10px 18px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 8px;
  }

  .topbar-left {
    width: 100%;
  }

  .topbar-right,
  .topbar-nav {
    width: 100%;
  }

  .topbar-nav {
    justify-content: flex-start;
    gap: 8px;
  }

  .topbar-nav-pill {
    padding: 6px 11px;
    font-size: 13px;
  }

  #dashboard,
  .time-comparison-dashboard,
  #sensorComparisonDashboard.sens {
    grid-template-rows: auto minmax(0, 1fr) auto;
  }

  .about-dashboard {
    grid-template-rows: auto minmax(0, 1fr) auto;
  }
}

@media (max-width: 900px) {

  html,
  body {
    overflow: auto;
  }

  #dashboard {
    height: auto;
    min-height: 100vh;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: visible;
  }

  #topbar {
    padding: 12px 14px;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .topbar-left {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  #app {
    grid-template-columns: 1fr;
    grid-template-rows: 45vh auto;
    height: auto;
    overflow: visible;
  }

  #mapColumn {
    position: relative;
    z-index: 30;
    min-height: 0;
    overflow: visible;
    border-right: none;
    border-bottom: 1px solid #d9e2ec;
  }

  #sideColumn {
    position: relative;
    z-index: 1;
    grid-template-rows: auto auto;
  }

  #topPanel,
#chartPanel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: visible;
  }

  #variationBlock {
    flex: 0 0 auto;
    min-height: 290px;
    max-height: none;
  }


  #chartPanel {
    display: grid;
    grid-template-rows: auto auto;
    gap: 12px;
    overflow: visible;
  }
#flowVariationWrap {
    height: 235px;
    min-height: 235px;
  }
#dashboard #hourlyPatternPanel {
    flex: 0 0 auto;
    min-height: 260px;
  }
#dashboard .hourly-pattern-wrap {
    height: 200px !important;
    min-height: 200px !important;
  }

  .map-controls {
    flex-wrap: wrap;
    max-width: calc(100% - 24px);
  }

  #mapLegendPill .map-legend-popup,
  #comparisonLegendPill .map-legend-popup {
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
  }

  .legend-size-row {
    grid-template-columns: repeat(3, max-content);
    justify-content: start;
    column-gap: 18px;
    row-gap: 10px;
  }

  #mapWrap {
    overflow: visible;
  }

}

@media (max-width: 1100px) {
  #comparisonStatsPanel {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }

  .comparison-selected-feature {
    grid-column: 1 / -1;
  }

  .compare-filter-panel {
    width: 260px;
  }
}

@media (min-width: 901px) and (max-width: 1200px) {
  #sensorComparisonDashboard.sensor-comparison-dashboard {
    grid-template-rows: auto minmax(0, 1fr) auto;
  }

  #sensorComparisonApp {
    grid-template-columns: minmax(340px, 370px) minmax(0, 1fr);
  }

  #sensorLegendPanel.sensor-legend-panel {
    width: min(220px, calc(100% - 20px));
  }
}

@media (max-width: 900px) {
  #sensorComparisonDashboard.sensor-comparison-dashboard {
     display: grid;
    grid-template-rows: auto auto auto;
    width: 100%;
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  #sensorComparisonApp {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(430px, 58vh) 360px;
    grid-template-areas: "controls"
      "map"
      "chart";
    height: auto;
    min-height: 0;
    overflow: visible;
    padding: 10px;
  }

  #sensorControlColumn {
    grid-template-rows: auto auto;
    align-content: start;
    overflow: visible;
  }

  #sensorMapPanel {
    min-height: 0;
  }

  #sensorMapWrap,
  #sensorComparisonApp #sensorMap {
    width: 100%;
    height: 100%;
    min-height: 0;
  }

  #sensorChartStagePanel {
    min-height: 360px;
  }

  .sensor-chart-stage-header {
    grid-template-columns: 1fr;
  }

  .sensor-chart-title-row h2 {
    white-space: normal;
  }

  #sensorFindingsPanel {
    align-self: auto;
    height: auto;
    grid-template-rows: auto auto;
    overflow: visible;
  }

  #sensorQuestionCards {
    height: auto;
    grid-template-rows: repeat(4, auto);
    align-content: start;
    overflow: visible;
  }

  .sensor-question-card {
    height: auto;
  }

  .sensor-chart-title-row .sensor-info-tooltip,
  #sensorFindingsPanel .sensor-info-tooltip {
    right: auto;
    left: 0;
    top: calc(100% + 7px);
    bottom: auto;
  }
}

@media (max-width: 560px) {

  #sensorMapFilters,
  #sensorMapPanel,
  #sensorChartStagePanel,
  #sensorFindingsPanel {
    padding: 10px;
    border-radius: 12px;
  }

  #sensorLegendPanel.sensor-legend-panel {
    top: 48px;
    right: 10px;
    width: min(220px, calc(100% - 20px));
  }

  .sensor-info-tooltip,
  .sensor-info-tooltip-wide {
    width: min(285px, calc(100vw - 42px));
  }
}

@media (max-width: 1100px) {

  html,
  body {
    height: auto;
    min-height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .about-dashboard {
    height: auto;
    min-height: 100vh;
    overflow: visible;
    grid-template-rows: auto auto;
  }

  #aboutPage {
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  #aboutPage.about-with-map {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    align-items: start;
  }

  .about-content-column {
    overflow: visible;
  }

  .about-grid {
    grid-template-columns: 1fr 1fr;
    overflow: visible;
  }

  .about-map-panel {
    min-height: 560px;
  }

  .about-map-wrap {
    min-height: 500px;
  }
}

@media (max-width: 900px) {

  html,
  body {
    overflow: auto;
  }

  .about-dashboard {
    height: auto;
    min-height: 100vh;
    overflow: visible;
    grid-template-rows: auto auto;
  }

  #aboutPage {
    overflow: visible;
  }

  #aboutPage.about-with-map {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .about-content-column {
    overflow: visible;
  }

  .about-grid {
    grid-template-columns: 1fr;
  }

  .about-hero h2 {
    font-size: 22px;
  }

}

@media (max-width: 900px) {

  html,
  body {
    height: auto;
    min-height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .time-comparison-dashboard {
    height: auto !important;
    min-height: 100vh;
    overflow: visible !important;
    grid-template-rows: auto auto auto;
  }

  #comparisonApp {
    height: auto !important;
    min-height: 0;
    overflow: visible !important;
    display: grid;
    grid-template-rows: 58vh auto;
  }

  #comparisonMapWrap {
    position: relative;
    z-index: 30;
    height: 58vh;
    min-height: 360px;
    overflow: visible;
  }

  .comparison-map,
  #mapRightClip {
    height: 100%;
    min-height: 0;
  }

  #comparisonSwipeHandle {
    display: flex;
  }

  .compare-filter-panel {
    top: 52px;
    width: 220px;
    max-width: calc(50% - 26px);
    padding: 10px;
  }

  .compare-filter-panel h2 {
    font-size: 13px;
    margin-bottom: 8px;
  }

  .compare-filter-panel label {
    font-size: 12px;
  }

  .compare-filter-panel .pill-group {
    gap: 5px;
  }

  .compare-filter-panel .pill-btn {
    padding: 5px 8px;
    font-size: 11px;
  }

  .compare-filter-panel select,
  .compare-filter-panel input[type="date"] {
    padding: 7px 8px;
    font-size: 12px;
  }

  #comparisonStatsPanel {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 12px;
    background: #ffffff;
    border-top: 1px solid #d9e2ec;
    box-sizing: border-box;
  }

  #comparisonLegendPill {
    z-index: 2600;
  }

  .comparison-selected-feature {
    grid-column: 1 / -1;
  }

  .comparison-selected-feature,
  .comparison-stat-card {
    padding: 6px 10px;
    min-width: 0;
  }

  .comparison-feature-name {
    font-size: 14px;
  }

  .comparison-stat-value {
    font-size: 17px;
  }

  .stat-label {
    font-size: 11px;
  }

  .stat-subvalue {
    font-size: 10px;
  }
}

@media (max-width: 1200px) {
  .dashboard-footer {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 8px 14px;
    text-align: center;
  }

  .logo-strip-logos {
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
  }

  .footer-text {
    font-size: 9.5px;
    line-height: 1.3;
  }

  .logo-strip-logos img {
    max-height: 24px;
    max-width: 105px;
  }
}

@media (max-width: 700px) {
  .dashboard-footer {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 8px 12px;
    text-align: center;
  }

  .footer-text {
    font-size: 9px;
    line-height: 1.25;
  }

  .logo-strip-logos {
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
  }

  .logo-strip-logos img {
    max-height: 22px;
    max-width: 95px;
  }
}

@media (max-width: 700px) {
  .sensor-modal-kpi-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .dashboard-about-kpi-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .comparison-about-kpi-row {
    grid-template-columns: 1fr;
  }
}
/* --------------------------------------------------
   Viewport-fitting desktop enhancements
   Keeps the existing normal desktop styling, while
   allowing panels to use the full visible window.
-------------------------------------------------- */

@media (min-width: 901px) {
  html,
  body {
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  #dashboard,
  .time-comparison-dashboard,
  #sensorComparisonDashboard.sensor-comparison-dashboard,
  .about-dashboard {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }

  #app,
  #comparisonApp,
  #sensorComparisonApp,
  #aboutPage {
    min-height: 0;
  }

  /* Main dashboard: let the annual view absorb all spare height. */
  #chartPanel {
    min-height: 0;
  }

  #variationBlock {
    flex: 1 1 auto;
    width: 100%;
    height: 100%;
    min-height: 0;
    max-height: none;
  }

  #flowVariationWrap {
    flex: 1 1 auto;
    min-height: 0;
  }

  #dashboard #hourlyPatternPanel {
    flex: 0 0 clamp(170px, 25dvh, 215px) !important;
    height: auto !important;
    min-height: 0;
    max-height: none;
  }

  #dashboard .hourly-pattern-wrap {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
  }

  /* Keep Time Comparison statistics in one compact desktop row. */
  #comparisonStatsPanel {
    grid-template-columns: minmax(170px, 1.4fr) repeat(4, minmax(100px, 1fr));
  }

  .comparison-selected-feature {
    grid-column: auto;
  }

  /* Undo the narrow-desktop About-page stacking introduced earlier. */
  .about-dashboard {
    grid-template-rows: auto minmax(0, 1fr) auto;
  }

  #aboutPage {
    height: 100%;
    overflow: hidden;
  }

  #aboutPage.about-with-map {
    grid-template-rows: minmax(0, 1fr);
    align-items: stretch;
  }

  .about-content-column,
  .about-grid,
  .about-map-panel {
    min-height: 0;
    overflow: hidden;
  }

  .about-map-panel,
  .about-map-wrap,
  .about-map-wrap #sensorMap {
    min-height: 0;
  }
}

/* Narrow desktop and landscape-tablet layout: retain one-screen dashboards. */
@media (min-width: 901px) and (max-width: 1200px) {
  #app {
    grid-template-columns: minmax(330px, 40%) minmax(0, 60%);
  }

  #topPanel {
    grid-template-columns: minmax(230px, 43%) minmax(0, 1fr);
    gap: 10px;
    padding: 8px 10px;
  }

  #sidebar {
    max-width: none;
  }

  #statsPanel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #comparisonStatsPanel {
    gap: 7px;
    padding: 8px 10px;
  }

  .comparison-selected-feature,
  .comparison-stat-card {
    padding: 8px 9px;
  }

  .compare-filter-panel {
    width: 240px;
  }

  #aboutPage.about-with-map {
    grid-template-columns: minmax(0, 1.7fr) minmax(340px, 1fr);
    gap: 10px;
    padding: 10px 12px;
  }

  .about-content-column {
    gap: 8px;
  }

  .about-hero,
  .about-card {
    padding: 10px 12px;
    border-radius: 13px;
  }

  .about-hero h2 {
    margin-bottom: 5px;
    font-size: 18px;
    line-height: 1.15;
  }

  .about-hero p,
  .about-card p {
    font-size: 11.5px;
    line-height: 1.3;
  }

  .about-card h3 {
    margin-bottom: 5px;
    font-size: 14px;
  }

  .about-grid {
    gap: 8px;
  }

  .download-list {
    gap: 6px;
    margin-top: 7px;
  }

  .download-list a {
    padding: 6px 9px;
    font-size: 10.5px;
  }

  .about-map-panel {
    padding: 10px;
    row-gap: 8px;
    border-radius: 14px;
  }

  .about-map-header h3 {
    font-size: 14px;
  }
}

/* Short desktop/laptop screens: compact spacing before allowing any scroll. */
@media (min-width: 901px) and (max-height: 800px) {
  #topbar {
    min-height: 54px;
    padding-top: 6px;
    padding-bottom: 6px;
    gap: 5px;
  }

  .app-title {
    font-size: 19px;
  }

  .topbar-nav {
    gap: 6px;
  }

  .topbar-nav-pill {
    padding: 5px 9px;
    font-size: 12px;
  }

  .dashboard-footer {
    gap: 5px;
    padding: 4px 10px;
  }

  .footer-text {
    font-size: 8.5px;
    line-height: 1.2;
  }

  .logo-strip-logos {
    gap: 8px;
  }

  .logo-strip-logos img {
    max-height: 19px;
    max-width: 86px;
  }

  /* Main dashboard */
  #topPanel {
    gap: 8px;
    padding-top: 5px;
    padding-bottom: 6px;
  }

  #topPanel .control-group {
    margin-bottom: 6px;
  }

  #topPanel label {
    margin-bottom: 4px;
    font-size: 12px;
  }

  #topPanel select {
    padding: 6px 8px;
    font-size: 12px;
  }

  #topPanel .pill-group {
    gap: 5px;
  }

  #topPanel .pill-btn {
    padding: 5px 9px;
    font-size: 11px;
  }

  #statsPanel {
    grid-template-rows: repeat(2, minmax(48px, 58px));
    gap: 6px;
  }

  .stat-card {
    min-height: 48px;
    padding: 6px 9px;
  }

  .stat-label {
    font-size: 11px;
  }

  .stat-value {
    font-size: 17px;
  }

  #chartPanel {
    gap: 5px;
    padding: 6px 8px 4px;
  }

  #variationBlock {
    gap: 4px;
  }

  #variationHeader {
    min-height: 29px;
    gap: 7px;
  }

  #chartTitle,
  .chart-title-main {
    font-size: 13px;
  }

  .variation-scale,
  .variation-scale-label {
    font-size: 9.5px;
  }

  .variation-scale-swatch {
    width: 10px;
    height: 7px;
  }

  .year-switch {
    gap: 5px;
  }

  .year-btn {
    padding: 4px 9px;
    font-size: 11px;
  }

  #dashboard #hourlyPatternPanel {
    flex-basis: clamp(140px, 23dvh, 180px) !important;
    padding: 4px 7px 3px !important;
  }

  #dashboard .hourly-pattern-header {
    margin-bottom: 2px;
  }

  #dashboard .hourly-pattern-header h2 {
    font-size: 12px;
  }

  #dashboard #hourlyPatternSubtitle {
    font-size: 9.5px;
  }

  .variation-grid {
    gap: 3px;
  }

  .variation-month-grid-pills {
    grid-auto-rows: 18px;
  }

  .variation-month-pill {
    min-height: 17px;
    padding: 0 4px;
    font-size: 10px;
  }

  .variation-week-cell {
    min-height: 19px;
  }

  .variation-week-label,
  .variation-weekday-label {
    font-size: 10px;
  }

  .variation-weekday-col,
  .variation-day-grid {
    grid-template-rows: repeat(7, 14px);
    gap: 1px;
  }

  .variation-weekday-label,
  .variation-day-cell {
    min-height: 14px;
  }

  /* Time Comparison */
  #comparisonStatsPanel {
    gap: 6px;
    padding: 7px 9px;
  }

  .comparison-selected-feature,
  .comparison-stat-card {
    padding: 6px 8px;
  }

  .comparison-feature-name {
    font-size: 13px;
  }

  .comparison-stat-value {
    font-size: 16px;
  }

  .compare-filter-panel {
    top: 54px;
    padding: 9px;
  }

  .compare-filter-panel h2 {
    margin-bottom: 7px;
    font-size: 13px;
  }

  .compare-filter-panel .control-group {
    margin-bottom: 7px;
  }

  .compare-filter-panel label {
    margin-bottom: 4px;
    font-size: 11px;
  }

  .compare-filter-panel .pill-group {
    gap: 5px;
  }

  .compare-filter-panel .pill-btn {
    padding: 5px 8px;
    font-size: 11px;
  }

  .compare-filter-panel select,
  .compare-filter-panel input[type="date"] {
    padding: 6px 7px;
    font-size: 11px;
  }

  /* Sensor Comparison */
  #sensorComparisonApp {
    grid-template-rows: minmax(0, 60%) minmax(0, 40%);
    gap: 6px;
    padding: 6px;
  }

  #sensorControlColumn {
    gap: 6px;
  }

  #sensorMapFilters,
  #sensorMapPanel,
  #sensorChartStagePanel,
  #sensorFindingsPanel {
    padding: 7px;
  }

  #sensorMapFilters .control-group {
    margin-top: 5px;
  }

  #sensorMapFilters label {
    margin-bottom: 3px;
    font-size: 11px;
  }

  #sensorMapFilters select,
  #sensorMapFilters input,
  #sensorChartSelect {
    padding: 5px 7px;
    font-size: 11px;
  }

  #sensorBucketTypePills {
    gap: 4px;
  }

  #sensorBucketTypePills .pill-btn {
    padding: 4px 7px;
    font-size: 10px;
  }

  .sensor-section-title-row h2,
  #sensorChartStagePanel h2,
  #sensorFindingsPanel h2 {
    font-size: 13px;
  }

  #sensorQuestionCards {
    gap: 4px;
  }

.sensor-question-card {
  grid-template-columns: 20px minmax(0, 1fr);
  column-gap: 5px;
  row-gap: 3px;
  padding: 6px 7px;
}

.sensor-card-icon {
  width: 20px;
  height: 20px;
  border-radius: 7px;
}

.sensor-card-icon svg {
  width: 13px;
  height: 13px;
}

  .sensor-question-card .stat-label {
    font-size: 9.5px;
  }

  .sensor-question-rows {
    gap: 2px;
  }

  .sensor-question-mini-row {
    grid-template-columns: 34px minmax(0, 1fr);
    column-gap: 4px;
    padding-top: 2px;
    row-gap: 0;
  padding-top: 2px;
  }

  .sensor-question-segment {
    font-size: 8.5px;
  }

  .sensor-question-mini-main {
    font-size: 10.5px;
  }

  .sensor-question-mini-text {
    font-size: 9px;
    line-height: 1.12;
  }

  .sensor-chart-stage-header {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 400px);
    gap: 7px;
  }

  #sensorChartStage {
    padding: 5px;
  }

  /* About page */
  #aboutPage.about-with-map {
    grid-template-columns: minmax(0, 1.75fr) minmax(340px, 1fr);
    gap: 8px;
    padding: 8px 10px;
  }

  .about-content-column {
    gap: 6px;
  }

  .about-hero,
  .about-card {
    padding: 8px 10px;
    border-radius: 12px;
  }

  .about-hero h2 {
    margin-bottom: 4px;
    font-size: 17px;
  }

  .about-hero p,
  .about-card p {
    font-size: 10.8px;
    line-height: 1.24;
  }

  .about-card h3 {
    margin-bottom: 4px;
    font-size: 13px;
  }

  .about-grid {
    gap: 6px;
  }

  .download-list {
    gap: 5px;
    margin-top: 5px;
  }

  .download-list a {
    padding: 5px 8px;
    font-size: 10px;
  }

  .about-map-panel {
    padding: 8px;
    row-gap: 6px;
  }

  .about-map-header h3 {
    font-size: 13px;
  }
}

/* Very short desktop windows: an additional compact pass. */
@media (min-width: 901px) and (max-height: 640px) {
  #topbar {
    min-height: 48px;
    padding-top: 4px;
    padding-bottom: 4px;
  }

  .app-title {
    font-size: 17px;
  }

  .topbar-nav-pill {
    padding: 4px 8px;
    font-size: 11px;
  }

  .dashboard-footer {
    padding-top: 3px;
    padding-bottom: 3px;
  }

  .footer-text {
    font-size: 8px;
  }

  .logo-strip-logos img {
    max-height: 16px;
    max-width: 75px;
  }

  #dashboard #hourlyPatternPanel {
    flex-basis: 125px !important;
  }

  .variation-weekday-col,
  .variation-day-grid {
    grid-template-rows: repeat(7, 12px);
  }

  .variation-weekday-label,
  .variation-day-cell {
    min-height: 12px;
  }

  #sensorComparisonApp {
    grid-template-rows: minmax(0, 56%) minmax(0, 44%);
  }

  .about-hero p,
  .about-card p {
    font-size: 10px;
    line-height: 1.18;
  }
}

/* Large/tall desktops: use the extra space without stretching text awkwardly. */
@media (min-width: 1400px) and (min-height: 950px) {
  .about-grid .about-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

}

/* Emergency fallback only for exceptionally small desktop viewports. */
@media (min-width: 901px) and (max-height: 680px) {
  html,
  body {
    height: auto;
    min-height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
  }

  #dashboard,
  .time-comparison-dashboard,
  #sensorComparisonDashboard.sensor-comparison-dashboard,
  .about-dashboard {
    height: 740px;
    min-height: 740px;
    overflow: hidden;
  }
}

/* Final desktop refinements for the About page. */
@media (min-width: 901px) {
  .about-dashboard {
    grid-template-rows: minmax(64px, auto) minmax(0, 1fr) auto;
  }

  .about-grid .about-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
}

@media (min-width: 901px) and (max-width: 1000px) {
  #aboutPage.about-with-map {
    grid-template-columns: minmax(0, 1.9fr) minmax(300px, 1fr);
  }

  .about-grid .about-card {
    padding: 6px 8px;
  }

  .about-grid .about-card p {
    font-size: 10.2px;
    line-height: 1.16;
  }

  .about-grid .download-list {
    margin-top: 4px;
  }

  .about-grid .download-list a {
    padding: 4px 7px;
    font-size: 9.5px;
  }
}

/* Final fit adjustments for the narrowest non-scrolling desktop size. */
@media (min-width: 901px) and (max-width: 1100px) and (min-height: 681px) and (max-height: 720px) {
  .sensor-question-card {
    padding: 4px;
    row-gap: 1px;
  }

  .sensor-question-mini-row {
    padding-top: 1px;
  }

  .sensor-question-mini-text {
    font-size: 8.5px;
    line-height: 1.08;
  }
}

@media (min-width: 901px) and (max-width: 1100px) and (min-height: 681px) and (max-height: 720px) {
  #dashboard #hourlyPatternPanel {
    flex-basis: 136px !important;
  }

  .variation-month-grid-pills {
    grid-auto-rows: 17px;
  }

  .variation-month-pill {
    min-height: 16px;
  }

  .variation-week-cell {
    min-height: 18px;
  }

  .variation-weekday-col,
  .variation-day-grid {
    grid-template-rows: repeat(7, 13px);
  }

  .variation-weekday-label,
  .variation-day-cell {
    min-height: 13px;
  }
}

/* --------------------------------------------------
   Definitive layout corrections
   - hourly chart is a sibling of the annual variation block
   - About sections share the content column equally on larger desktops
   - Time Comparison summary uses a stronger share of larger screens
-------------------------------------------------- */

/* Main dashboard desktop: the space below the filters is fixed and split 50/50. */
@media (min-width: 901px) {
  #sideColumn {
    grid-template-rows: auto minmax(0, 1fr);
  }

  #chartPanel {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
  }

  #variationBlock {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    gap: 5px;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    max-height: none;
    overflow: hidden;
    align-self: stretch;
    flex: none;
  }

  #variationHeader {
    grid-row: 1;
    min-width: 0;
  }

  #flowVariationWrap {
    grid-row: 2;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
  }

  #flowVariationWrap > *,
  #flowVariationWrap .variation-grid,
  #flowVariationWrap .variation-placeholder {
    width: 100%;
    height: 100%;
    min-height: 0;
    box-sizing: border-box;
  }

  #dashboard #hourlyPatternPanel {
    display: flex !important;
    flex-direction: column;
    align-self: stretch;
    width: 100% !important;
    height: 100% !important;
    min-width: 0;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    flex: none !important;
    overflow: hidden !important;
  }

  #dashboard .hourly-pattern-wrap {
    flex: 1 1 auto;
    width: 100%;
    height: auto !important;
    min-width: 0;
    min-height: 0 !important;
    max-height: none !important;
    overflow: hidden;
  }

  #dashboard #hourlyPatternChart {
    display: block;
    width: 100% !important;
    height: 100% !important;
  }
}

/* Compact desktop/laptop: retain the exact half-and-half split; only reduce the gap. */
@media (min-width: 901px) and (max-height: 800px) {
  #chartPanel {
    gap: 5px;
  }
}

@media (min-width: 901px) and (max-width: 1100px) and (max-height: 720px) {
  #chartPanel {
    gap: 4px;
  }
}

/* Phones and narrow tablets: stack the two chart panels with page scrolling. */
@media (max-width: 900px) {
  #chartPanel {
    display: grid;
    grid-template-rows: auto auto;
    gap: 12px;
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  #variationBlock {
    display: grid;
    grid-template-rows: auto 235px;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    width: 100%;
    height: auto;
    min-height: 0;
    max-height: none;
    overflow: visible;
    flex: none;
  }

  #variationHeader {
    grid-row: 1;
  }

  #flowVariationWrap {
    grid-row: 2;
    width: 100%;
    height: 235px;
    min-height: 235px;
    overflow: hidden;
  }

  #dashboard #hourlyPatternPanel {
    display: flex !important;
    width: 100% !important;
    height: 260px !important;
    min-height: 260px !important;
    max-height: none !important;
    margin: 0 !important;
    flex: none !important;
    overflow: hidden !important;
  }
}

/* Larger desktops: three equal visual sections on the About page. */
@media (min-width: 1201px) and (min-height: 720px) {
  .about-content-column {
    display: grid;
    grid-template-rows: repeat(3, minmax(0, 1fr)) !important;
    align-content: stretch;
    align-items: stretch;
  }

  .about-content-column > .about-hero,
  .about-content-column > .about-card,
  .about-content-column > .about-grid {
    width: 100%;
    height: auto;
    min-height: 0;
    align-self: stretch;
    box-sizing: border-box;
  }

  .about-hero,
  .about-card {
    padding: 10px 14px;
  }

  .about-hero h2,
  .about-card h3 {
    margin-bottom: 6px;
  }

  .about-hero p,
  .about-card p {
    line-height: 1.35;
  }

  .about-grid {
    align-items: stretch;
  }

  .about-grid > .about-card {
    height: 100%;
    min-height: 0;
  }

  /* Time Comparison: reserve roughly one quarter of the middle area for stats. */
  #comparisonApp {
    grid-template-rows: minmax(0, 1fr) clamp(180px, 24dvh, 250px) !important;
  }

  #comparisonStatsPanel {
    height: 100%;
    min-height: 0;
    align-items: stretch;
    gap: clamp(10px, 1vw, 18px);
    padding: clamp(14px, 1.15vw, 22px);
  }

  .comparison-selected-feature,
  .comparison-stat-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
    min-height: 0;
  }
}


/* --------------------------------------------------
   Dashboard fit correction
-------------------------------------------------- */

#statsPanel > .stat-card {
  width: 100%;
  height: 100%;
  min-height: 0;
  align-self: stretch;
}

@media (min-width: 901px) {
  #topPanel {
    align-items: stretch;
  }

  #statsPanel {
    grid-template-rows: repeat(2, minmax(0, 1fr)) !important;
    align-content: stretch;
  }

  #variationHeader .chart-title-with-info,
  #dashboard .hourly-title-with-info {
    margin-bottom: 0;
  }

  #variationHeader h2,
  #chartTitle {
    margin-top: 0;
    margin-bottom: 0;
  }
}

/* At compact desktop heights, reduce only header overhead; retain the 50/50 panels. */
@media (min-width: 901px) and (max-height: 760px) {
  #variationHeader {
    min-height: 26px;
    gap: 6px;
  }

  #variationHeader .label-with-info {
    gap: 5px;
  }

  #variationHeader .variation-scale {
    gap: 3px;
  }

  #variationHeader .year-switch {
    gap: 5px;
  }

  #variationHeader .year-btn {
    padding: 4px 9px;
    font-size: 11px;
  }

  #variationHeader .variation-scale-label {
    font-size: 10px;
  }

  #variationHeader .variation-scale-swatch {
    width: 10px;
    height: 7px;
  }

  #variationBlock {
    gap: 3px;
  }

  #flowVariationWrap .variation-grid {
    gap: 3px;
  }

  #flowVariationWrap .variation-month-row,
  #flowVariationWrap .variation-week-row,
  #flowVariationWrap .variation-body {
    gap: 4px;
  }
}

/* The narrowest desktop width needs the top controls beside the KPIs, not stacked,
   otherwise there is not enough remaining height for two equal chart rows. */
@media (min-width: 901px) and (max-width: 1100px) {
  #app {
    grid-template-columns: 40% 60%;
  }

  #topPanel {
    grid-template-columns: minmax(250px, 1fr) minmax(230px, 1fr);
    gap: 8px;
    padding: 5px 10px 8px;
  }

  #sidebar {
    max-width: none;
    justify-self: stretch;
  }

  #sidebar h2 {
    margin: 0 0 6px;
    font-size: 14px;
    line-height: 1.1;
  }

  #topPanel .control-group {
    margin-bottom: 6px;
  }

  #topPanel label {
    margin-bottom: 3px;
    font-size: 11px;
  }

  #topPanel select {
    padding: 5px 7px;
    font-size: 11px;
  }

  #topPanel .pill-group {
    gap: 4px;
  }

  #topPanel .pill-btn {
    padding: 4px 7px;
    font-size: 10px;
  }

  #statsPanel {
    gap: 6px;
  }

  #statsPanel .stat-card {
    padding: 6px 8px;
  }

  #statsPanel .stat-label {
    font-size: 10px;
  }

  #statsPanel .stat-value {
    font-size: 16px;
  }

  #statsPanel .stat-subvalue {
    font-size: 9px;
    min-height: 8px;
  }
}

/* --------------------------------------------------
   Time Comparison: clearer KPI sub-values
-------------------------------------------------- */

#comparisonStatsPanel .stat-subvalue {
  font-size: clamp(12px, 0.8vw, 15px);
  line-height: 1.25;
  min-height: 1.25em;
  margin-top: 4px;
  font-weight: 500;
  color: #627d98;
}

/* --------------------------------------------------
   Help page
-------------------------------------------------- */

#helpPage {
  min-height: 0;
  padding: 14px 18px 28px;
  overflow-x: hidden;
  overflow-y: auto;
  background: #f4f6f8;
  box-sizing: border-box;
  scroll-behavior: smooth;
}

.help-content {
  display: grid;
  gap: 16px;
  width: min(1180px, 100%);
  margin: 0 auto;
}

.help-hero .download-list {
  margin-top: 14px;
}

.help-quick-links a {
  border-color: #EB6C25;
}

.tutorial-list {
  display: grid;
  gap: 16px;
}

.tutorial-card {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 20px;
  align-items: center;
  scroll-margin-top: 16px;
}

.tutorial-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid #d9e2ec;
  border-radius: 14px;
  background: #102a43;
}

.tutorial-video iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.tutorial-copy {
  min-width: 0;
}

.tutorial-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  margin-bottom: 10px;
  padding: 0 9px;
  border-radius: 999px;
  background: #fff3e8;
  color: #c94f0b;
  font-size: 13px;
  font-weight: 800;
  box-sizing: border-box;
}

.tutorial-copy ul {
  margin: 10px 0 0;
  padding-left: 20px;
  color: #243b53;
  font-size: 13px;
  line-height: 1.45;
}

.tutorial-copy li + li {
  margin-top: 4px;
}

.tutorial-link {
  margin-top: 14px;
}

.help-faq-section {
  scroll-margin-top: 16px;
}

.help-faq-intro {
  margin-bottom: 12px !important;
  color: #52606d !important;
}

.help-faq {
  border-top: 1px solid #d9e2ec;
}

.help-faq details {
  border-bottom: 1px solid #d9e2ec;
}

.help-faq summary {
  position: relative;
  padding: 16px 46px 16px 2px;
  color: #102a43;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  cursor: pointer;
  list-style: none;
}

.help-faq summary::-webkit-details-marker {
  display: none;
}

.help-faq summary::after {
  content: "+";
  position: absolute;
  top: 50%;
  right: 6px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  transform: translateY(-50%);
  border-radius: 999px;
  background: #fff3e8;
  color: #c94f0b;
  font-size: 20px;
  font-weight: 500;
  line-height: 1;
}

.help-faq details[open] summary::after {
  content: "−";
}

.faq-answer {
  padding: 0 46px 16px 2px;
  color: #243b53;
  font-size: 13px;
  line-height: 1.45;
}

.faq-answer p {
  margin: 0 0 8px;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
}

.faq-answer p:last-child {
  margin-bottom: 0;
}

.faq-answer ul {
  margin: 6px 0 10px;
  padding-left: 22px;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
}

.faq-answer li {
  margin: 0;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
}

.faq-answer li + li {
  margin-top: 4px;
}

.faq-answer br {
  display: block;
  content: "";
  margin-top: 5px;
}

@media (max-width: 900px) {
  #helpPage {
    padding: 16px;
    overflow: visible;
  }

  .tutorial-card {
    grid-template-columns: 1fr;
  }

  .tutorial-copy {
    order: -1;
  }
}

@media (max-width: 560px) {
  #helpPage {
    padding: 12px;
  }
}

/* --------------------------------------------------
   Analysis page
-------------------------------------------------- */

.analysis-dashboard {
  display: grid;
  grid-template-rows: 64px minmax(0, 1fr) auto;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #f4f6f8;
}

#analysisPage {
  min-width: 0;
  min-height: 0;
  padding: 10px 18px;
  overflow: hidden;
  box-sizing: border-box;
}

.analysis-content {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  width: min(1180px, 100%);
  height: 100%;
  min-width: 0;
  min-height: 0;
  margin: 0 auto;
}

.analysis-hero {
  padding: 10px 14px;
}

.analysis-hero-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 18px;
  min-width: 0;
}

.analysis-hero-copy {
  min-width: 0;
}

.analysis-hero h2 {
  margin-bottom: 5px;
  font-size: 19px;
}

.analysis-hero p {
  font-size: 12.5px;
  line-height: 1.38;
}

.analysis-hero p + p {
  margin-top: 4px;
}

.analysis-hero-note {
  color: #52606d;
}

.analysis-about-button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.analysis-tabs {
  gap: 7px;
  margin-top: 9px;
}

.analysis-tabs a {
  padding: 6px 10px;
  border-color: #EB6C25;
  font-size: 11px;
  cursor: pointer;
}

.analysis-tabs a.is-active {
  background: #EB6C25;
  color: #ffffff;
}

.analysis-stage {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.analysis-panel {
  display: none;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
}

.analysis-panel.is-active {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 390px);
  gap: 12px;
}

.analysis-chart-card,
.analysis-context-card {
  height: 100%;
  min-width: 0;
  min-height: 0;
  margin: 0;
  box-sizing: border-box;
}

.analysis-chart-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 6px;
  padding: 12px 14px;
  overflow: visible;
}

.analysis-chart-header {
  min-width: 0;
}

.analysis-chart-title-row {
  align-items: flex-start;
  justify-content: flex-start;
  margin: 0;
}

.analysis-chart-title-row > div:first-child {
  min-width: 0;
}

.analysis-chart-title-row h3 {
  margin: 0;
  color: #102a43;
  font-size: 15px;
  line-height: 1.2;
}

.analysis-chart-title-row p {
  margin: 3px 0 0;
  color: #52606d;
  font-size: 12px;
  line-height: 1.35;
}

.analysis-chart-info {
  margin-top: 1px;
}

.analysis-chart-info .inline-info-tooltip {
  right: 0;
  left: auto;
  width: 300px;
}

.analysis-chart-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
}

.analysis-chart-wrap canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.analysis-chart-instruction {
  margin: 0;
  color: #627d98;
  font-size: 10.5px;
  line-height: 1.25;
}

.analysis-context-card {
  display: flex;
  flex-direction: column;
  padding: 13px 15px;
  overflow: hidden;
}

.analysis-section-number {
  min-width: 29px;
  height: 29px;
  margin-bottom: 7px;
  padding: 0 8px;
  align-self: flex-start;
  font-size: 11px;
}

.analysis-context-card h3 {
  margin: 0 0 7px;
  color: #102a43;
  font-size: 16px;
  line-height: 1.2;
}

.analysis-context-card p {
  margin: 0 0 7px;
  color: #334e68;
  font-size: 12.5px;
  line-height: 1.4;
}

.analysis-highlight {
  margin-bottom: 8px;
  padding: 8px 10px;
  border-left: 4px solid #EB6C25;
  border-radius: 9px;
  background: #fff7ed;
  color: #243b53;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.35;
}

.analysis-fact-list {
  display: grid;
  gap: 5px;
  margin-top: auto;
}

.analysis-fact-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border: 1px solid #edf2f7;
  border-radius: 9px;
  background: #f8fafc;
  color: #486581;
  font-size: 11px;
  line-height: 1.25;
}

.analysis-fact-row strong {
  color: #102a43;
  font-size: 11px;
  text-align: right;
}

.analysis-small-note {
  margin-top: 7px !important;
  color: #627d98 !important;
  font-size: 10.5px !important;
  line-height: 1.3 !important;
}

.analysis-overlap {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  margin-top: 7px;
}

.analysis-overlap div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid #edf2f7;
  border-radius: 9px;
  background: #ffffff;
  color: #486581;
  font-size: 10px;
  line-height: 1.2;
}

.analysis-overlap strong {
  color: #102a43;
  font-size: 12px;
}



.analysis-about-modal-body {
  overflow-y: auto;
}

@media (max-width: 1200px) {
  .analysis-dashboard {
    grid-template-rows: auto minmax(0, 1fr) auto;
  }

  .analysis-panel.is-active {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 350px);
  }

  .analysis-hero h2 {
    font-size: 18px;
  }

  .analysis-hero p,
  .analysis-context-card p,
  .analysis-highlight {
    font-size: 11.5px;
  }

  .analysis-context-card h3 {
    font-size: 15px;
  }
}

@media (min-width: 901px) and (max-height: 760px) {
  #analysisPage {
    padding-top: 7px;
    padding-bottom: 7px;
  }

  .analysis-content {
    gap: 7px;
  }

  .analysis-hero {
    padding: 8px 12px;
  }

  .analysis-hero h2 {
    font-size: 17px;
  }

  .analysis-hero p {
    font-size: 11px;
    line-height: 1.3;
  }

  .analysis-tabs {
    margin-top: 6px;
  }

  .analysis-tabs a {
    padding: 5px 8px;
    font-size: 10px;
  }

  .analysis-chart-card,
  .analysis-context-card {
    padding: 9px 11px;
  }

  .analysis-chart-title-row h3 {
    font-size: 13px;
  }

  .analysis-chart-title-row p,
  .analysis-context-card p,
  .analysis-highlight {
    font-size: 11.5px;
  }

  .analysis-context-card h3 {
    margin-bottom: 5px;
    font-size: 14.5px;
  }

  .analysis-section-number {
    min-width: 25px;
    height: 25px;
    margin-bottom: 5px;
    font-size: 10px;
  }

  .analysis-fact-row {
    padding: 4px 6px;
    font-size: 10.5px;
  }

  .analysis-fact-row strong {
    font-size: 10.5px;
  }

  .analysis-small-note,
  .analysis-chart-instruction {
    font-size: 9.8px !important;
  }
}

@media (max-width: 900px) {
  html,
  body {
    height: auto;
    min-height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .analysis-dashboard {
    grid-template-rows: auto auto auto;
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  #analysisPage {
    padding: 12px;
    overflow: visible;
  }

  .analysis-content {
    display: block;
    height: auto;
  }

  .analysis-hero-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .analysis-about-button {
    justify-self: start;
  }

  .analysis-tabs {
    flex-wrap: wrap;
  }

  .analysis-tabs a {
    flex: 1 1 calc(50% - 7px);
    box-sizing: border-box;
  }

  .analysis-stage {
    margin-top: 10px;
    overflow: visible;
  }

  .analysis-panel,
  .analysis-panel.is-active {
    height: auto;
    overflow: visible;
  }

  .analysis-panel.is-active {
    grid-template-columns: 1fr;
  }

  .analysis-chart-card {
    min-height: 430px;
  }

  .analysis-chart-wrap {
    min-height: 320px;
  }

  .analysis-context-card {
    overflow: visible;
  }

  .analysis-fact-list {
    margin-top: 8px;
  }
}

@media (max-width: 560px) {
  .analysis-tabs a {
    flex-basis: 100%;
  }

  .analysis-overlap {
    grid-template-columns: 1fr;
  }

  .analysis-chart-info .inline-info-tooltip {
    width: min(285px, calc(100vw - 42px));
  }
}

@media (min-width: 901px) and (max-width: 1000px) and (max-height: 720px) {
  .analysis-panel.is-active {
    grid-template-columns: minmax(0, 1fr) minmax(335px, 370px);
  }

  .analysis-context-card p {
    margin-bottom: 5px;
    line-height: 1.32;
  }

  .analysis-highlight {
    margin-bottom: 6px;
    padding-top: 6px;
    padding-bottom: 6px;
  }

  .analysis-fact-list {
    gap: 4px;
  }

  .analysis-overlap {
    gap: 4px;
    margin-top: 5px;
  }
}

.analysis-chart-info .inline-info-tooltip {
  right: 0;
  left: auto;
  width: min(285px, calc(100vw - 42px));
}

/* Mobile About-page legend pill */
.about-mobile-legend {
  display: none !important;
  position: absolute;
  top: 12px;
  right: 12px;
  left: auto;
  z-index: 2500;
  pointer-events: auto;
}

.about-mobile-legend .map-legend-popup {
  position: absolute;
  top: 44px;
  right: 0;
  left: auto;
  width: 220px;
  max-width: calc(100vw - 48px);
}

.about-mobile-legend .sensor-legend {
  display: grid;
  gap: 5px;
  margin: 0;
}

.about-map-wrap {
  position: relative;
}

@media screen and (max-width: 900px) {
  .about-sensor-legend {
    display: none !important;
  }

  .about-mobile-legend {
    display: block !important;
  }
}

@media screen and (min-width: 901px) {
  .about-sensor-legend {
    display: block !important;
  }

  .about-mobile-legend {
    display: none !important;
  }
}

/* Period B tooltip opens towards the left */
.period-b-info-inline {
  position: relative;
}

.period-b-tooltip {
  left: auto;
  right: 0;
  transform: none;
  max-width: min(320px, calc(100vw - 32px));
}