.wx-card {
  --wx-bg: #101923; --wx-surface: #192530; --wx-line: #30404f; --wx-text: #edf4fa; --wx-muted: #b6c5d2; --wx-accent: #8fc9ff;
  color: var(--wx-text); background: var(--wx-bg); border: 1px solid var(--wx-line); border-radius: 24px;
  padding: 0; width: min(680px, calc(100% - 32px)); max-width: none; max-height: calc(100dvh - 32px);
  font: 1rem/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color-scheme: dark; box-shadow: 0 20px 80px #0009;
}
.wx-card[open] { display: flex; flex-direction: column; }
.wx-card::backdrop { background: #06111c99; backdrop-filter: blur(3px); }
.wx-card, .wx-card * { box-sizing: border-box; min-width: 0; }
.wx-card h1, .wx-card h2, .wx-card h3, .wx-card h4, .wx-card p, .wx-card dl { margin: 0; }
.wx-card h1 { font-size: 1.75em; line-height: 1.15; letter-spacing: .04em; overflow-wrap: anywhere; }
.wx-card h2 { font-size: 1.15em; }
.wx-card h3 { font-size: 1em; margin: 16px 0 4px; }
.wx-card h4 { font-size: .95em; margin: 12px 0 4px; }
.wx-card p { margin: 8px 0; }
.wx-card button, .wx-card input, .wx-card summary { font: inherit; }
.wx-card button { min-height: 44px; min-width: 44px; padding: 8px 12px; border: 1px solid var(--wx-line); border-radius: 12px; background: var(--wx-surface); color: var(--wx-accent); cursor: pointer; touch-action: manipulation; }
.wx-card button:hover { background: #263c50; }
.wx-card :focus-visible { outline: 3px solid #8fc9ff; outline-offset: 2px; }
.wx-handle { width: 36px; height: 4px; border-radius: 4px; background: #607687; margin: 10px auto 0; flex-shrink: 0; }
.wx-header { display: flex; gap: 8px; align-items: center; justify-content: space-between; padding: 10px 20px; flex-shrink: 0; }
.wx-eyebrow { display: block; color: var(--wx-muted); font-size: .75em; margin-bottom: 4px; }
.wx-actions { display: flex; gap: 4px; flex-wrap: wrap; justify-content: end; }
.wx-actions button[data-action=close] { font-size: 1.5em; line-height: 1; }
.wx-search { display: flex; gap: 8px; margin: 0 20px 10px; flex-shrink: 0; }
.wx-search input { width: 100%; background: #0b141d; color: var(--wx-text); border: 1px solid var(--wx-line); border-radius: 12px; min-height: 44px; padding: 8px 12px; text-transform: uppercase; font-size: 1rem; }
.wx-search button { flex-shrink: 0; }
.wx-status { font-size: .8em; padding: 8px 20px; color: var(--wx-muted); background: #152634; flex-shrink: 0; overflow-wrap: anywhere; }
.wx-status small { display: block; font-size: .9em; margin-top: 3px; }
.wx-status.wx-saved { background: #332b19; color: #f2d9a0; }
.wx-tabs { display: flex; gap: 4px; padding: 10px 20px; flex-shrink: 0; }
.wx-tabs button { flex: 1; border-color: transparent; color: var(--wx-muted); }
.wx-tabs button[aria-selected=true] { background: #294a66; color: #fff; border-color: #6599bf; }
.wx-scroll { overflow-y: auto; overscroll-behavior: contain; padding: 0 20px max(24px, env(safe-area-inset-bottom)); min-height: 90px; overflow-wrap: anywhere; }
.wx-card details > summary { padding: 10px 0; min-height: 44px; cursor: pointer; color: var(--wx-accent); }
.wx-raw { background: #0a141e; border: 1px solid var(--wx-line); border-radius: 12px; padding: 0 12px; margin: 6px 0 16px; }
.wx-card pre, .wx-card code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; }
.wx-card pre { font-size: .85em; line-height: 1.65; margin: 0 0 12px; user-select: text; }
.wx-report-heading { display: flex; align-items: center; gap: 8px; justify-content: space-between; flex-wrap: wrap; }
.wx-badge { display: inline-block; border: 1px solid #466481; color: #c6e5ff; border-radius: 8px; padding: 3px 7px; font-size: .75em; line-height: 1.5; }
.wx-partial { border-color: #8d7746; color: #efd092; }
.wx-age { color: #c4def4; }
.wx-times { color: var(--wx-muted); font-size: .8em; }
.wx-times > div { display: grid; grid-template-columns: minmax(95px, 1fr) 2fr; gap: 8px; margin: 5px 0; }
.wx-times dd, .wx-fields dd { margin: 0; }
.wx-section { margin: 12px 0; }
.wx-fields { background: var(--wx-surface); border: 1px solid var(--wx-line); border-radius: 14px; padding: 0 12px; }
.wx-field { padding: 12px 0; border-bottom: 1px solid var(--wx-line); }
.wx-field:last-child { border-bottom: 0; }
.wx-field dt { font-size: .8em; color: var(--wx-muted); margin-bottom: 4px; }
.wx-field dd { font-weight: 500; }
.wx-field small { display: block; color: var(--wx-muted); font-size: .8em; font-weight: 400; margin-top: 4px; }
.wx-code { font-size: .8em; font-weight: 400; }
.wx-code > summary { padding: 6px 0 !important; display: flex; align-items: center; }
.wx-code > summary::before { content: "›"; margin-right: 6px; }
.wx-code[open] > summary::before { content: "⌄"; }
.wx-reasons { background: #332b19; border-radius: 12px; padding: 0 12px; margin: 10px 0; }
.wx-reasons code { display: block; color: #d5c29d; font-size: .75em; }
.wx-reasons ul { padding: 0 0 12px 18px; margin: 0; }
.wx-reasons li { margin-bottom: 10px; }
.wx-notice { background: #332b19; color: #f2d9a0; padding: 12px; border-radius: 12px; }
.wx-notice code { display: block; margin-top: 6px; }
.wx-note, .wx-map-note { color: var(--wx-muted); font-size: .8em; }
.wx-map-note { border-top: 1px solid var(--wx-line); padding-top: 14px; margin-top: 20px !important; }
.wx-source { color: var(--wx-muted); font-size: .8em; }
.wx-empty { padding: 24px 0; color: var(--wx-muted); }
.wx-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (min-width: 540px) {
  .wx-fields .wx-field { display: grid; grid-template-columns: 1fr 2fr; gap: 18px; }
}
@media (max-width: 539px) {
  .wx-card { margin: auto 0 0; width: 100%; max-height: calc(100dvh - env(safe-area-inset-top) - 8px); border-radius: 22px 22px 0 0; border-bottom: 0; }
  .wx-header { padding: 8px 16px; } .wx-search { margin: 0 16px 8px; }
  .wx-tabs { padding: 8px 16px; } .wx-status { padding: 8px 16px; }
  .wx-scroll { padding-left: 16px; padding-right: 16px; }
  .wx-card h1 { font-size: 1.5em; } .wx-actions button { padding: 6px 8px; }
}
@media (max-height: 560px) {
  .wx-card { max-height: 100dvh; }
  .wx-status small { display: none; }
  .wx-header, .wx-tabs { padding-top: 4px; padding-bottom: 4px; }
}

/* UI001: keep the card entry reachable outside the wide map-layer toolbar. */
.topright #metar-taf-open {
  position: fixed;
  left: 12px;
  right: auto;
  top: 216px;
  min-height: 44px;
  white-space: nowrap;
  z-index: 5;
  border: 1px solid #5079a6;
  background: #163f6c;
  color: #fff;
}
@media (max-height: 480px) and (min-width: 540px) {
  .topright #metar-taf-open { left: auto; right: 12px; top: 82px; }
}
@media (max-width: 539px) {
  /* The timeline must not enlarge the layout viewport behind the modal. */
  #controls.panel { flex-wrap: wrap; gap: 8px; }
  #controls #slider { flex: 1 1 80px; min-width: 0; }
  #controls #tlabel { flex: 1 1 120px; min-width: 0; }
}
