.mbwc-weather-block {
  --mbwc-text: #14324a;
  --mbwc-muted: #5f7a8f;
  --mbwc-column: linear-gradient(180deg, #f6fbff 0%, #ebf4fb 100%);
  --mbwc-rain: linear-gradient(180deg, #8ed0ff 0%, #2d86d5 100%);
  color: var(--mbwc-text);
}

.mbwc-weather-block__charts {
  display: grid;
  gap: 22px;
}

.mbwc-chart {
  background: linear-gradient(180deg, #fbfdff 0%, #eef7ff 100%);
  border: 1px solid rgba(217, 230, 242, 0.95);
  border-radius: 20px;
  padding: 18px;
}

.mbwc-chart__head {
  margin-bottom: 14px;
}

.mbwc-chart__title {
  margin: 0 0 4px;
  font-size: 20px;
  line-height: 1.2;
}

.mbwc-chart__meta {
  margin: 0;
  color: var(--mbwc-muted);
  font-size: 13px;
}

.mbwc-chart__hint {
  margin: 8px 0 0;
  color: #2f79b7;
  font-size: 12px;
  font-weight: 700;
}

.mbwc-chart__source {
  display: block;
  margin: 0;
  padding: 0;
  color: #6f8293;
  font-size: 12px;
  line-height: 1.45;
  letter-spacing: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.mbwc-chart__viewport {
  max-width: 100%;
}

.mbwc-temp-grid,
.mbwc-precip-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 10px;
}

.mbwc-month {
  min-width: 0;
}

.mbwc-month__plot {
  position: relative;
  height: 248px;
  display: flex;
  align-items: stretch;
  overflow: hidden;
}

.mbwc-month__band {
  position: absolute;
  inset: 0;
  background: var(--mbwc-column);
  border: 1px solid rgba(214, 227, 240, 0.92);
  border-radius: 18px;
  pointer-events: none;
}

.mbwc-month--temp .mbwc-month__plot {
  padding: 14px 0 18px;
}

.mbwc-range-pill {
  position: absolute;
  left: 50%;
  top: var(--mbwc-top);
  z-index: 1;
  width: calc(100% - 10px);
  height: var(--mbwc-height);
  min-height: 62px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, color-mix(in srgb, var(--mbwc-pill) 78%, white 22%) 0%, var(--mbwc-pill) 100%);
  border-radius: 999px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 12px 6px;
  box-shadow: 0 8px 18px rgba(33, 53, 74, 0.14);
}

.mbwc-range-pill__track {
  width: 16px;
  height: 1px;
  background: rgba(255, 255, 255, 0.95);
}

.mbwc-range-pill__label {
  display: block;
  color: #0b1218;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  -webkit-text-stroke: 0;
  text-shadow: 0 1px 1px rgba(11, 18, 24, 0.12);
}

.mbwc-month__footer {
  margin: 0;
  padding: 0;
  text-align: center;
}

.mbwc-month__label {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  color: var(--mbwc-text);
  line-height: 1;
}

.mbwc-month--precip {
  display: flex;
  flex-direction: column;
}

.mbwc-chart-precip .mbwc-chart__head {
  margin-bottom: 8px;
}

.mbwc-chart-precip .mbwc-chart__viewport {
  padding-bottom: 2px;
}

.mbwc-month--precip .mbwc-month__plot {
  align-items: flex-end;
  background: var(--mbwc-column);
  border: 1px solid rgba(214, 227, 240, 0.92);
  border-radius: 18px;
  height: 176px;
  padding: 4px 6px 6px;
}

.mbwc-month__value {
  min-height: 18px;
  margin-bottom: 1px;
  color: #2b5f89;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
}

.mbwc-precip-bar {
  position: relative;
  z-index: 1;
  width: 100%;
  height: max(10px, var(--mbwc-bar));
  background: var(--mbwc-rain);
  border-radius: 14px 14px 10px 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

@media (max-width: 900px) {
  .mbwc-temp-grid,
  .mbwc-precip-grid {
    gap: 8px;
  }

  .mbwc-month__plot {
    height: 214px;
  }

  .mbwc-range-pill__label,
  .mbwc-month__value,
  .mbwc-month__label {
    font-size: 10px;
  }

  .mbwc-month--precip .mbwc-month__plot {
    height: 156px;
    padding: 4px 5px 5px;
  }
}

@media (max-width: 640px) {
  .mbwc-chart {
    padding: 16px 12px 14px;
    overflow: hidden;
  }

  .mbwc-chart__viewport {
    position: relative;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    padding: 0 18px 6px 0;
    scrollbar-width: thin;
  }

  .mbwc-chart__viewport::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 42px;
    height: calc(100% - 6px);
    background: linear-gradient(to right, rgba(238, 247, 255, 0) 0%, rgba(238, 247, 255, 0.82) 38%, rgba(238, 247, 255, 0.98) 76%, rgba(238, 247, 255, 1) 100%);
    opacity: 0;
    transition: opacity .2s ease;
    z-index: 3;
    pointer-events: none;
  }

  .mbwc-chart__viewport::before {
    content: "›";
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: #4e84b3;
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 3px 10px rgba(20, 50, 74, 0.12);
    opacity: 0;
    transition: opacity .2s ease;
    z-index: 4;
    pointer-events: none;
  }

  .mbwc-chart__viewport.is-peekable::before,
  .mbwc-chart__viewport.is-peekable::after {
    opacity: 1;
  }

  .mbwc-temp-grid,
  .mbwc-precip-grid {
    width: max-content;
    min-width: 100%;
    gap: 6px;
    grid-template-columns: repeat(12, 44px);
  }

  .mbwc-month__plot {
    height: 196px;
  }

  .mbwc-month--temp .mbwc-month__plot {
    padding: 12px 0 16px;
  }

  .mbwc-chart-precip {
    padding-top: 14px;
    padding-bottom: 10px;
  }

  .mbwc-chart-precip .mbwc-chart__head {
    margin-bottom: 6px;
  }

  .mbwc-month--precip .mbwc-month__plot {
    height: 142px;
    padding: 3px 4px 4px;
  }

  .mbwc-month__value {
    min-height: 16px;
    margin-bottom: 0;
    font-size: 12px;
    line-height: 1;
  }

  .mbwc-month--precip .mbwc-month__footer {
    margin: 0;
  }

  .mbwc-month__label {
    font-size: 12px;
  }

  .mbwc-range-pill {
    min-height: 56px;
    padding: 10px 5px;
  }

  .mbwc-range-pill__label {
    font-size: 11.5px;
    font-weight: 850;
  }

  .mbwc-chart__hint {
    display: block;
  }
}

@media (min-width: 641px) {
  .mbwc-chart__hint {
    display: none;
  }
}
