/* PROTOTYPE — overpass/stormlist.css: the storm list, "Jump to a storm" (the direction's §8.6; task B2b), owned with
   overpass/stormlist.js. A popover above the Storms button on a wide screen (placed by the script, inside the
   instrument: z-index 10, the direction's §4 layers); a sheet from the bottom on a phone, over a dim scrim. */

.stormlist { position: absolute; z-index: 10; left: 16px; bottom: 180px; width: min(760px, calc(100% - 32px)); max-height: 70vh; display: flex; flex-direction: column; }
.sl-scrim { display: none; }
.sl-panel { min-height: 0; max-height: 100%; overflow-y: auto; overscroll-behavior: contain; padding: 0 16px 14px; color: var(--pale); background: var(--under-2); border: 1px solid rgba(255, 255, 255, .14); border-radius: var(--r-input); box-shadow: var(--sh-pop); scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .2) transparent; }
.sl-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0 8px; background: var(--under-2); }
.sl-title { font-size: 1.05rem; font-weight: 700; line-height: 1.2; color: #fff; }
.sl-close { display: grid; place-items: center; width: 36px; height: 36px; margin-right: -8px; padding: 0; color: var(--pale); background: none; border: 0; border-radius: var(--r-round); cursor: pointer; }
.sl-close:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.sl-close .ico { width: 18px; height: 18px; }
.sl-wait { padding: 4px 0 6px; font-size: var(--fs-ui); color: var(--pale-2); }
.sl-row { display: grid; grid-template-columns: 5.6em minmax(0, 1fr); gap: 4px 10px; align-items: start; padding: 7px 0; border-top: 1px solid var(--rule-dark); }
.sl-season { padding-top: 6px; font-size: var(--fs-key); line-height: 1.2; color: var(--pale-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sl-pills { display: flex; flex-wrap: wrap; gap: 5px; }
.sl-pill { display: inline-flex; align-items: center; gap: .35em; min-height: 28px; margin: 0; padding: 3px 10px; font-size: 12.5px; line-height: 1.2; color: var(--pale-2); white-space: nowrap; background: rgba(255, 255, 255, .04); border: 1.5px solid rgba(255, 255, 255, .16); border-radius: var(--r-pill); cursor: pointer; transition: border-color var(--t-quick); }
.sl-pill b { font-weight: 650; color: #fff; }
.sl-pill:hover, .sl-pill:focus-visible { border-color: var(--track-lit); }
.sl-pill.on { border-color: var(--track-lit); background: rgba(255, 95, 168, .1); }
@media (pointer: coarse) {
  .sl-pill { min-height: var(--hit); padding: 3px 12px; }
  .sl-close { width: var(--hit); height: var(--hit); }
}

/* a phone: a sheet from the bottom, at most 70svh, scrolling, over a scrim that closes it */
@media (max-width: 760px) {
  .stormlist { position: fixed; inset: 0; z-index: 40; width: auto !important; max-height: none !important; left: 0 !important; bottom: 0 !important; display: block; }
  .sl-scrim { display: block; position: absolute; inset: 0; background: rgba(7, 20, 43, .55); }
  .sl-panel { position: absolute; left: 0; right: 0; bottom: 0; max-height: 70svh; padding: 0 16px calc(16px + env(safe-area-inset-bottom)); border-radius: var(--r-input) var(--r-input) 0 0; border-bottom: 0; }
  .sl-head { padding-top: 14px; }
  .sl-row { grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 9px 0; }
  .sl-season { padding-top: 0; }
}
@media (prefers-reduced-motion: no-preference) and (max-width: 760px) {
  .stormlist:not([hidden]) .sl-panel { animation: sl-up 220ms var(--ease-out) both; }
  @keyframes sl-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
}
