/* Compact strip / hstrip v3: container for pitch clamp */
body.weather-v2-lab .wx-stack:has(.wx-hstrip-v3) {
  container-type: inline-size;
  min-width: 0;
  max-width: 100%;
}

/* —— hstrip v3 (lab city card → product, mirror) —— */
body.weather-v2-lab .wx-hstrip-v3 {
  --hstrip-ink: var(--wx-ink, #183d52);
  --hstrip-muted: var(--wx-muted, #5a7584);
  --hstrip-cool: var(--wx-tone-cool, #3a8db8);
  --hstrip-warm: #b04068;
  --wind-moderate: #fff4d4; /* same as htable-lab */
  --wind-strong: #ffe8d6;
  --wind-very_strong: #ffe0e0;
  /* Desktop fit: scale pitch between min…max to use available stack width (padding 16+16). */
  --hstrip-pitch-min: 52px; /* desktop ≥992; tablet/phone override below */
  --hstrip-pitch-max: 86px;
  --hstrip-chart-min-w: calc(var(--hstrip-slots, 8) * var(--hstrip-pitch-min));
  --hstrip-chart-max-w: calc(var(--hstrip-slots, 8) * var(--hstrip-pitch-max));
  /* card pad 32 + card border ~2 + white board pad 28 + board border 2 + slack */
  --hstrip-inner-w: clamp(
    var(--hstrip-chart-min-w),
    100cqw - 64px,
    var(--hstrip-chart-max-w)
  );
  --hstrip-grow: clamp(
    0,
    (var(--hstrip-inner-w) - var(--hstrip-chart-min-w))
      / (var(--hstrip-chart-max-w) - var(--hstrip-chart-min-w)),
    1
  );
  --hstrip-pitch: calc(
    var(--hstrip-pitch-min)
    + var(--hstrip-grow) * (var(--hstrip-pitch-max) - var(--hstrip-pitch-min))
  );
  position: relative;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  /* Match now-strip / htable-v3 grey shell inset (16px sides) */
  padding: 16px 16px 14px;
  /* Darker grey shell — home page body (#eef4f7); white board stays inside */
  background: #eef4f7;
  /* Do not set overflow-x here: with overflow-x:auto browsers force overflow-y:auto
     and a vertical scrollbar appears even when only horizontal scroll is needed. */
  overflow: visible;
}

/* White inner board — hug strip width (not stretch to grey card) */
body.weather-v2-lab .wx-hstrip-v3__visual {
  position: relative;
  width: max-content;
  max-width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(213, 230, 236, 0.95);
  border-radius: 12px;
  background: #fff;
  padding: 14px 14px 12px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin; /* Firefox: one thin bar; no vertical track when oy=hidden */
}

/* Chromium/WebKit: never paint a vertical scrollbar gutter on the strip */
body.weather-v2-lab .wx-hstrip-v3__visual::-webkit-scrollbar {
  width: 0;
  height: 8px;
}
body.weather-v2-lab .wx-hstrip-v3__visual::-webkit-scrollbar-thumb {
  background: rgba(24, 61, 82, 0.25);
  border-radius: 4px;
}

body.weather-v2-lab .wx-hstrip-v3__title-row {
  margin: 0 0 14px;
  color: var(--hstrip-ink);
}

body.weather-v2-lab .wx-hstrip-v3__title {
  margin: 0;
  font: 700 17px/1.2 Manrope, system-ui, sans-serif;
  color: inherit;
}

body.weather-v2-lab .wx-hstrip-v3__title-sep {
  color: var(--hstrip-muted);
  font-weight: 600;
}

body.weather-v2-lab .wx-hstrip-v3__title-feel {
  font-weight: 600;
  color: var(--hstrip-muted);
}

body.weather-v2-lab .wx-hstrip-v3__title-feel--mild_cooler { color: #3a7a9a; }
body.weather-v2-lab .wx-hstrip-v3__title-feel--cooler,
body.weather-v2-lab .wx-hstrip-v3__title-feel--much_cooler { color: #1f5f8a; }
body.weather-v2-lab .wx-hstrip-v3__title-feel--near { color: #1f6f78; }
body.weather-v2-lab .wx-hstrip-v3__title-feel--mild_warmer { color: #b8683a; }
body.weather-v2-lab .wx-hstrip-v3__title-feel--warmer,
body.weather-v2-lab .wx-hstrip-v3__title-feel--much_warmer { color: #a33a2b; }

body.weather-v2-lab .wx-hstrip-v3__strip {
  position: relative;
  width: calc(var(--hstrip-slots) * var(--hstrip-pitch));
  /* Clip abspos metric heads / collapsed chart so they cannot inflate visual scrollWidth. */
  overflow-x: clip;
}

/* Vertical column separators — full board height, same weight as metric-dash. */
body.weather-v2-lab .wx-hstrip-v3__col-breaks {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
}

body.weather-v2-lab .wx-hstrip-v3__col-break {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 0;
  /* Match .wx-hstrip-v3__metric-dash: 1px dashed */
  border-left: 1px dashed rgba(24, 61, 82, 0.22);
  /* visual pad-left 14px + slot boundary */
  left: calc(14px + var(--col-break-i) * var(--hstrip-pitch));
}

body.weather-v2-lab .wx-hstrip-v3__col-break.is-day {
  border-left-width: 2px;
}

body.weather-v2-lab .wx-hstrip-v3__days {
  display: flex;
  margin-bottom: 6px;
}

body.weather-v2-lab .wx-hstrip-v3__days .wx-hstrip-v3__day-cap {
  font: 700 12px/1.2 Manrope, system-ui, sans-serif;
  color: var(--hstrip-ink);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}

/* One-column day: hide label on screen (keeps width). Row is aria-hidden — flat text unchanged. */
body.weather-v2-lab .wx-hstrip-v3__days .wx-hstrip-v3__day-cap.is-solo {
  color: transparent;
  font-size: 0;
  line-height: 0;
  overflow: hidden;
}

body.weather-v2-lab .wx-hstrip-v3__bands {
  display: flex;
  gap: 2px; /* was margin-left on bands — margins added outside N×pitch and forced H-scroll */
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 2px;
}

body.weather-v2-lab .wx-hstrip-v3__band {
  height: 6px;
  border-radius: 3px;
  min-width: 0;
}

body.weather-v2-lab .wx-hstrip-v3__band--night { background: var(--wx-daypart-night); }
body.weather-v2-lab .wx-hstrip-v3__band--morning { background: var(--wx-daypart-morning); }
body.weather-v2-lab .wx-hstrip-v3__band--day { background: var(--wx-daypart-day); }
body.weather-v2-lab .wx-hstrip-v3__band--evening { background: var(--wx-daypart-evening); }

/* Columns: one article = one hour (htable principle). */
body.weather-v2-lab .wx-hstrip-v3__cols {
  display: flex;
  position: relative;
  width: calc(var(--hstrip-slots) * var(--hstrip-pitch));
}

body.weather-v2-lab .wx-hstrip-v3__col {
  flex: 0 0 var(--hstrip-pitch);
  width: var(--hstrip-pitch);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
}

body.weather-v2-lab .wx-hstrip-v3__cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

body.weather-v2-lab .wx-hstrip-v3__cell--daypart {
  margin: 4px 0 6px;
  font: 700 12px/1 Manrope, system-ui, sans-serif;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  color: rgba(96, 125, 140, 0.85);
  text-align: center;
}

body.weather-v2-lab .wx-hstrip-v3__cell--time {
  margin-bottom: 8px;
}

body.weather-v2-lab .wx-hstrip-v3__cell--time time {
  font: 500 14px/1 var(--wx-mono, "IBM Plex Mono", ui-monospace, monospace);
  font-variant-numeric: tabular-nums;
  color: var(--hstrip-ink);
}

body.weather-v2-lab .wx-hstrip-v3__cell--wx {
  gap: 6px;
  margin-bottom: 4px;
  min-height: 68px;
}

body.weather-v2-lab .wx-hstrip-v3__ico {
  width: 38px;
  height: 38px;
  display: block;
}

body.weather-v2-lab .wx-hstrip-v3__t {
  font: 700 22px/1 var(--wx-mono, "IBM Plex Mono", ui-monospace, monospace);
  font-variant-numeric: tabular-nums;
}

body.weather-v2-lab .wx-hstrip-v3__t.is-temp-pos { color: var(--hstrip-warm); }
body.weather-v2-lab .wx-hstrip-v3__t.is-temp-neg { color: var(--hstrip-cool); }
body.weather-v2-lab .wx-hstrip-v3__t.is-temp-zero { color: #8aa3b0; }

body.weather-v2-lab .wx-hstrip-v3__past {
  font: 700 22px/1 var(--wx-mono, "IBM Plex Mono", ui-monospace, monospace);
  color: #8aa3b0;
  padding-top: 22px;
}

body.weather-v2-lab .wx-hstrip-v3__head-slot {
  position: relative;
  width: 100%;
  height: 26px;
  margin-top: 10px;
  margin-bottom: 4px;
}

body.weather-v2-lab .wx-hstrip-v3__span-head {
  position: absolute;
  left: 0;
  top: 0;
  width: calc(var(--hstrip-slots) * var(--hstrip-pitch));
  z-index: 1;
}

body.weather-v2-lab .wx-hstrip-v3__metric-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 18px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Full-strip titles live in column 0; must ignore metric-head max-width:100%. */
body.weather-v2-lab .wx-hstrip-v3__metric-head.wx-hstrip-v3__span-head {
  width: calc(var(--hstrip-slots) * var(--hstrip-pitch));
  max-width: none;
}

body.weather-v2-lab .wx-hstrip-v3__metric-title {
  flex: 0 0 auto;
  color: var(--hstrip-muted);
  font: 600 12px/1.2 Manrope, system-ui, sans-serif;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

body.weather-v2-lab .wx-hstrip-v3__metric-dash {
  flex: 1 1 auto;
  min-width: 24px;
  height: 0;
  border-top: 1px dashed rgba(24, 61, 82, 0.22);
}

body.weather-v2-lab .wx-hstrip-v3__cell--norm {
  position: relative;
  height: calc(var(--hstrip-step-half) * 2 + 18px);
  padding: 9px 0;
  margin-bottom: 2px;
}

body.weather-v2-lab .wx-hstrip-v3__cell--norm::before {
  content: "";
  position: absolute;
  left: 0;
  width: calc(var(--hstrip-slots) * var(--hstrip-pitch));
  top: calc(9px + var(--hstrip-step-half));
  border-top: 1.5px solid rgba(24, 61, 82, 0.32);
  pointer-events: none;
  opacity: 0;
}
body.weather-v2-lab .wx-hstrip-v3__col:first-child .wx-hstrip-v3__cell--norm::before {
  opacity: 1;
}

body.weather-v2-lab .wx-hstrip-v3__step-col {
  width: 100%;
  height: calc(var(--hstrip-step-half) * 2);
  display: flex;
  flex-direction: column;
  align-items: center;
}

body.weather-v2-lab .wx-hstrip-v3__step-zone {
  width: 100%;
  height: var(--hstrip-step-half);
  display: flex;
  flex-direction: column;
  align-items: center;
}

body.weather-v2-lab .wx-hstrip-v3__step-zone--up { justify-content: flex-end; }
body.weather-v2-lab .wx-hstrip-v3__step-zone--down { justify-content: flex-start; }

body.weather-v2-lab .wx-hstrip-v3__step-bar {
  width: 27px;
  border-radius: 2px;
}

body.weather-v2-lab .wx-hstrip-v3__step-bar--up { border-radius: 2px 2px 1px 1px; }
body.weather-v2-lab .wx-hstrip-v3__step-bar--down { border-radius: 1px 1px 2px 2px; }

body.weather-v2-lab .wx-hstrip-v3__step-num {
  font: 600 13px/1 var(--wx-mono, "IBM Plex Mono", ui-monospace, monospace);
  font-variant-numeric: tabular-nums;
  margin: 3px 0;
  color: var(--hstrip-muted);
}

body.weather-v2-lab .wx-hstrip-v3__chart-slot {
  position: relative;
  width: 100%;
  height: var(--hstrip-chart-h, 48px);
  margin: 0 0 6px;
}

body.weather-v2-lab .wx-hstrip-v3__pres-chart {
  position: absolute;
  left: 0;
  top: 0;
  width: calc(var(--hstrip-slots) * var(--hstrip-pitch));
}

body.weather-v2-lab .wx-hstrip-v3__pres-chart svg {
  display: block;
  width: 100%;
  height: var(--hstrip-chart-h, 48px);
  overflow: visible;
}

body.weather-v2-lab .wx-hstrip-v3__pres-area {
  fill: rgba(58, 141, 184, 0.10);
}

body.weather-v2-lab .wx-hstrip-v3__pres-line {
  fill: none;
  stroke: #2f6f8f;
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body.weather-v2-lab .wx-hstrip-v3__pres-dot {
  fill: #fff;
  stroke: #2f6f8f;
  stroke-width: 2;
}

body.weather-v2-lab .wx-hstrip-v3__cell--pres {
  margin-bottom: 12px;
}

body.weather-v2-lab .wx-hstrip-v3__pres-cell {
  font: 650 15px/1 var(--wx-mono, "IBM Plex Mono", ui-monospace, monospace);
  font-variant-numeric: tabular-nums;
  color: var(--hstrip-ink);
}

body.weather-v2-lab .wx-hstrip-v3__pres-cell.is-low { color: #3a8db8; }
body.weather-v2-lab .wx-hstrip-v3__pres-cell.is-high { color: #b04068; }

body.weather-v2-lab .wx-hstrip-v3__cell--wind {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: max-content;
  max-width: 100%;
  white-space: nowrap;
  margin-bottom: 2px;
}

body.weather-v2-lab .wx-hstrip-v3__wind-box {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  min-width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid rgba(154, 176, 188, .45);
  border-radius: 4px;
  background: #fff;
  font: 700 13px/1 var(--wx-mono, "IBM Plex Mono", ui-monospace, monospace);
  font-variant-numeric: tabular-nums;
  color: var(--hstrip-ink);
}

body.weather-v2-lab .wx-hstrip-v3__wind-box.is-empty {
  color: #9aafb8;
  border-color: rgba(154, 176, 188, .35);
}

body.weather-v2-lab .wx-hstrip-v3__wind-box.is-weak {
  background: #fff;
  border-width: 2px;
  border-color: rgba(120, 148, 162, .7);
}

body.weather-v2-lab .wx-hstrip-v3__wind-box.is-moderate {
  background: var(--wind-moderate);
  border-color: color-mix(in srgb, #e6c84a 35%, rgba(154, 176, 188, .35));
}

body.weather-v2-lab .wx-hstrip-v3__wind-box.is-strong {
  background: var(--wind-strong);
  border-color: color-mix(in srgb, #e09050 40%, rgba(154, 176, 188, .3));
}

body.weather-v2-lab .wx-hstrip-v3__wind-box.is-very_strong {
  background: var(--wind-very_strong);
  border-color: color-mix(in srgb, #e07070 40%, rgba(154, 176, 188, .3));
}

body.weather-v2-lab .wx-hstrip-v3__wind-code {
  font: 700 12px/1 Manrope, system-ui, sans-serif;
  min-width: 1.6em;
  color: var(--hstrip-ink);
}

body.weather-v2-lab .wx-hstrip-v3__wind-code.is-n { color: #3a8db8; }
body.weather-v2-lab .wx-hstrip-v3__wind-code.is-s { color: #b04068; }

/* Collapsed: decorative chrome off; P/wind values stay in a11y tree without H-scroll. */
body.weather-v2-lab .wx-hstrip-v3:not(.is-extra-open) .wx-hstrip-v3__extra-bit.wx-hstrip-v3__head-slot,
body.weather-v2-lab .wx-hstrip-v3:not(.is-extra-open) .wx-hstrip-v3__extra-bit.wx-hstrip-v3__chart-slot {
  display: none;
}

body.weather-v2-lab .wx-hstrip-v3:not(.is-extra-open) .wx-hstrip-v3__extra-bit {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

body.weather-v2-lab .wx-hstrip-v3__more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 12px 0 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--wx-ink, var(--hstrip-ink));
  font: 700 13px/1.3 Manrope, system-ui, sans-serif;
  cursor: pointer;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: color 0.15s ease;
}

body.weather-v2-lab .wx-hstrip-v3__more:hover,
body.weather-v2-lab .wx-hstrip-v3__more:focus-visible {
  color: var(--wx-blue);
  text-decoration: none;
}

body.weather-v2-lab .wx-hstrip-v3__more:focus-visible {
  outline: 2px solid rgba(42, 143, 154, 0.45);
  outline-offset: 3px;
  border-radius: 4px;
}

body.weather-v2-lab .wx-hstrip-v3__more-chevron {
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  transition: transform 0.15s ease;
}

body.weather-v2-lab .wx-hstrip-v3__more[aria-expanded="true"] .wx-hstrip-v3__more-chevron {
  transform: rotate(180deg);
}

/* Tablet + phone: slightly higher floor before H-scroll (icons/wind stay readable). */
/* Tablet + phone: half side inset on grey shells (16 → 8) */
@media (max-width: 991.98px) {
  body.weather-v2-lab .wx-hstrip-v3 {
    --hstrip-pitch-min: 58px;
    padding-left: 8px;
    padding-right: 8px;
    /* card pad 16 (was 32) → inner gain +16 vs desktop 64 */
    --hstrip-inner-w: clamp(
      var(--hstrip-chart-min-w),
      100cqw - 48px,
      var(--hstrip-chart-max-w)
    );
  }
}

/* Phone: stop shrinking — keep max pitch and scroll inside the card (like legacy hstrip). */
@media (max-width: 660.98px) {
  body.weather-v2-lab .wx-hstrip-v3 {
    --hstrip-pitch: var(--hstrip-pitch-max);
    --hstrip-grow: 1;
    --hstrip-inner-w: var(--hstrip-chart-max-w);
  }

  body.weather-v2-lab .wx-hstrip-v3__strip {
    width: calc(var(--hstrip-slots) * var(--hstrip-pitch-max));
  }
}
