/* The storm frame (frontend-v4 §2.1 item 4; F8 #192; #661, the storm card of the design-prototypes
   prototype, direction.css, 4eb3433). An opaque card above the sky: the level band (the only level
   colour, always edged and always with its number and name), the hook, the card's name, the range with
   the ends' odds on one line, the moments, "Open the storm". Kept short so the sky and the temperature
   stay on the first phone screen. On a laptop a strip: the band at the left, the call in the middle,
   "Open the storm" at the right, the opened part under it. Tokens only. */
.slot-storm { container-type: inline-size; display: grid; gap: var(--space-3); }
.storm {
  display: grid; gap: var(--space-3); padding: 6px 6px 0; border-radius: var(--radius-xl);
  background: var(--surface); color: var(--text); border: 1px solid var(--card-edge); box-shadow: var(--shadow-float);
}
.storm > :not(.st-band) { margin-inline: var(--space-3); }
.st-stale { margin: 0; font-size: var(--t-sub); font-weight: var(--weight-semibold); }

.lvl-0 { --lvl: var(--level-0); --lvl-label: var(--text); }
.lvl-1 { --lvl: var(--level-1); --lvl-label: var(--level-1-label); }
.lvl-2 { --lvl: var(--level-2); --lvl-label: var(--level-2-label); }
.lvl-3 { --lvl: var(--level-3); --lvl-label: var(--level-3-label); }
.lvl-4 { --lvl: var(--level-4); --lvl-label: var(--level-4-label); }
.st-band {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2);
  min-height: 56px; padding: 6px 6px 6px var(--space-4); border-radius: 18px;
  background: var(--lvl); color: var(--lvl-label); border: 1px solid var(--level-edge);
}
.st-lvl { min-width: 0; overflow-wrap: anywhere; font-size: var(--text-level); font-weight: var(--weight-heavy); letter-spacing: -0.015em; line-height: 1.1; }
.st-info {
  min-height: var(--tap); padding: 0 var(--space-3); border: 0; border-radius: var(--radius-pill);
  background: var(--sky-pill-bg); color: var(--sky-pill-text); font-size: var(--t-sub); max-width: 100%; text-align: left; overflow-wrap: anywhere;
}
.st-levels { flex: 1 1 100%; margin: 0 0 4px; padding: var(--space-3); border-radius: 14px; background: var(--surface); color: var(--text); font-size: var(--t-sub); }
.st-levels ol { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.st-levels li.is-this { font-weight: var(--weight-heavy); }
.st-levels p { margin: var(--space-2) 0 0; color: var(--text-muted); }
.st-levels-link { display: inline-flex; align-items: center; min-height: var(--tap); font-weight: var(--weight-heavy); color: var(--action); }

.st-hook { margin: var(--space-1) var(--space-3) 0; font-size: var(--text-h3); font-weight: var(--weight-heavy); letter-spacing: normal; text-transform: none; color: var(--text); line-height: var(--leading-tight); text-wrap: balance; }
.st-call { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-1) var(--space-3); }
.st-call p { margin: 0; max-width: none; }
.st-name { flex: 0 0 100%; min-width: 0; overflow-wrap: anywhere; font-size: var(--t-small); font-weight: var(--weight-bold); letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); }
.st-range b { font-size: var(--text-number); font-weight: var(--weight-heavy); line-height: 1; }
.st-range small, .st-mid small { color: var(--text-muted); font-weight: var(--weight-semibold); }
.st-ends { font-size: var(--t-sub); font-weight: var(--weight-semibold); }

.st-moments { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); margin: 0; padding: 2px 0 0; list-style: none; }
.st-moments::before { content: ""; position: absolute; left: 12%; right: 12%; top: 9px; height: 2px; border-radius: 1px; background: var(--line-strong); }
.st-moments li { position: relative; display: grid; justify-items: center; gap: 1px; text-align: center; font-size: var(--t-sub); font-weight: var(--weight-semibold); color: var(--text-muted); }
.st-moments b { color: var(--text); font-size: 1rem; font-weight: var(--weight-heavy); }
.m-dot { width: 16px; height: 16px; margin-bottom: 4px; border-radius: 50%; background: var(--surface); border: 2px solid var(--text); }
.st-moments .peak .m-dot { background: var(--text); box-shadow: 0 0 0 4px var(--surface-2); }

.slot-storm .drop-ic .ic { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.st-open { border-top: var(--rule) solid var(--line); padding-top: var(--space-1); }
.st-open > .dropdown > .drop-panel { display: grid; gap: var(--space-4); padding-bottom: var(--space-2); }
.st-open > .dropdown > .drop-panel[hidden] { display: none; }
.st-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 6rem), 1fr)); gap: 6px; }
.st-tile { display: grid; gap: 4px; align-content: start; justify-items: center; padding: 12px 10px; border-radius: 16px; background: var(--surface-2); text-align: center; }
.st-tile b { font-size: 1.0625rem; font-weight: var(--weight-heavy); line-height: 1.2; }
.st-mid { background: var(--surface); box-shadow: inset 0 0 0 2px var(--text); }
.st-mid b { font-size: 1.375rem; }
.st-sec h3 { margin: 0 0 var(--space-1); font-size: var(--t-sub); font-weight: var(--weight-heavy); }
.st-sec ul, .st-sec ol { display: grid; gap: 2px; margin: 0; padding-left: 18px; font-size: var(--t-sub); }
.st-more .drop-panel { display: grid; gap: var(--space-3); }
.st-more .drop-panel[hidden] { display: none; }
.st-when { color: var(--text-muted); font-weight: var(--weight-semibold); }
.st-acts { display: flex; justify-content: flex-start; border-top: var(--rule) solid var(--line); }
.st-close { min-height: var(--tap); padding: 0; border: 0; background: none; color: var(--action); }

/* "+N more": a third card and beyond, each its own card, under one drop-down. */
.st-rest > .dropdown > .drop-panel { display: grid; gap: var(--space-3); }
.st-rest > .dropdown > .drop-panel[hidden] { display: none; }
/* Child combinators only: the cards under it keep their own drop-downs and icon circles. */
.st-rest > .dropdown > .drop { grid-template-columns: minmax(0, 1fr); min-height: var(--tap); padding: 0 var(--space-3); }
.st-rest > .dropdown > .drop > .drop-ic { display: none; }

/* Signal and called off: one line each, no level, no colour. */
.storm-line { padding: var(--space-3) var(--space-4); border-radius: var(--radius-l); background: var(--surface); color: var(--text); border: 1px solid var(--card-edge); }
.storm-line p { margin: 0; max-width: none; font-weight: var(--weight-bold); }

/* The signal's opened view (F8b #312): one small chart per model. Dot = main run, bar = middle half
   of the ensemble, hollow when the dot lies outside the bar. Tokens only. */
.st-runs { margin-top: var(--space-2); }
.st-runs > .dropdown > .drop-panel { display: grid; gap: var(--space-3); padding-bottom: var(--space-2); }
.st-runs > .dropdown > .drop-panel[hidden] { display: none; }
.st-run { margin: 0; }
.st-run figcaption { font-size: var(--t-sub); font-weight: var(--weight-heavy); }
.rn-chart { display: block; width: 100%; height: auto; }
.rn-axis { stroke: var(--line-strong); stroke-width: 1; }
.rn-band { stroke: var(--line-strong); stroke-width: 8; stroke-linecap: round; }
.rn-dot { fill: var(--text); stroke: var(--text); stroke-width: 2; }
.rn-dot.rn-out { fill: var(--surface); }
.rn-tick { fill: var(--text-muted); font-size: 10px; }
.st-runs-axis { margin: 0; max-width: none; font-size: var(--t-small); color: var(--text-muted); }
.st-runs-note { margin: 0; max-width: none; font-size: var(--t-small); color: var(--text-muted); }

@media (min-width: 1024px) {
  /* laptop (the prototype's storm strip): the band on the left the height of the card, the hook, the
     call and the moments in the middle, "Open the storm" at the right; the opened part is a row under
     them. The drop-down's wrappers drop out of the box tree so its button and its panel are grid items. */
  .layout .storm { grid-template-columns: minmax(0, 236px) minmax(0, 1fr) minmax(0, 250px); grid-template-areas: "band hook foot" "band call foot" "band when foot" "open open open"; column-gap: 0; padding: 6px; }
  .layout .storm > :not(.st-band) { margin-inline: var(--space-5); }
  .layout .st-band { grid-area: band; flex-direction: column; align-items: flex-start; justify-content: center; align-self: stretch; gap: var(--space-3); padding: var(--space-4) var(--space-4) var(--space-4) 18px; }
  .layout .st-lvl { font-size: 1.625rem; }
  .layout .st-levels { flex: none; align-self: stretch; }
  .layout .st-hook { grid-area: hook; margin-top: var(--space-3); }
  .layout .st-call { grid-area: call; margin-top: 10px; }
  .layout .st-range b { font-size: var(--text-number-wide); }
  .layout .st-moments { grid-area: when; max-width: 40rem; margin-block: var(--space-3); }
  .layout .st-open, .layout .st-open > .dropdown { display: contents; }
  .layout .st-open > .dropdown > .drop { grid-area: foot; align-self: stretch; width: auto; padding: 0 var(--space-4) 0 18px; border-left: var(--rule) solid var(--line); }
  .layout .st-open > .dropdown > .drop-panel { grid-area: open; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; gap: var(--space-4) 28px; margin: 6px 0 0; padding: 20px 18px 0; border-top: var(--rule) solid var(--line); }
  .layout .st-acts { grid-column: 1 / -1; }
}

@container (max-width: 18rem) {
  .st-moments { grid-auto-flow: row; gap: var(--space-1); }
  .st-moments::before { display: none; }
  .st-moments li { grid-template-columns: auto auto 1fr; justify-items: start; align-items: center; column-gap: 10px; text-align: left; }
  .m-dot { margin: 0; }
}
