/* Ionoview: scoped styles. Everything lives under .ionoview so the theme is untouched. */
.ionoview {
  --iv-sky: #0b1222;
  --iv-panel: #111a2e;
  --iv-line: #22304d;
  --iv-text: #e9eef8;
  --iv-text-2: #a3b0c9;
  --iv-text-3: #7584a2;
  --iv-near: #e76624;   /* straight up (foF2) */
  --iv-far: #338ced;    /* long hop (MUF 3000 km) */
  --iv-es: #00a888;     /* sporadic E */
  --iv-closed: #5d6b86;
  --iv-good: #0aac23;
  --iv-warn: #fbb315;
  --iv-bad: #dc3c3d;
  --iv-font: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --iv-font-c: "Barlow Condensed", "Barlow", system-ui, sans-serif;

  box-sizing: border-box;
  max-width: 1100px;
  margin: 2rem auto;
  padding: clamp(18px, 3vw, 32px);
  background: var(--iv-sky);
  color: var(--iv-text);
  font-family: var(--iv-font);
  font-size: 16px;
  line-height: 1.5;
  border-radius: 14px;
  font-variant-numeric: tabular-nums;
  color-scheme: dark;
}
.ionoview *, .ionoview *::before, .ionoview *::after { box-sizing: border-box; }
.ionoview p { margin: 0; }
.ionoview a { color: #8cc0f7; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.ionoview a:focus-visible, .ionoview summary:focus-visible, .ionoview button:focus-visible {
  outline: 2px solid #8cc0f7; outline-offset: 2px; border-radius: 4px;
}

/* Header */
.iv-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 24px; }
.iv-title {
  font-family: var(--iv-font-c);
  font-weight: 600;
  font-size: clamp(40px, 6vw, 64px);
  line-height: 0.95;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--iv-text);
}
.iv-where { color: var(--iv-text-2); font-size: 15px; margin-top: 10px; }
.iv-status {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; color: var(--iv-text-2);
  padding: 6px 12px; border: 1px solid var(--iv-line); border-radius: 999px;
}
.iv-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--iv-good); flex: none; }
.iv-status[data-state="stale"] .iv-dot { background: var(--iv-warn); }
.iv-status[data-state="offline"] .iv-dot { background: var(--iv-bad); }
@media (prefers-reduced-motion: no-preference) {
  .iv-status[data-state="live"] .iv-dot { animation: iv-pulse 2.4s ease-in-out infinite; }
}
@keyframes iv-pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(10,172,35,.55); } 60% { box-shadow: 0 0 0 7px rgba(10,172,35,0); } }

.iv-summary { font-size: clamp(17px, 2.1vw, 20px); line-height: 1.5; max-width: 66ch; margin: 22px 0 24px; color: var(--iv-text); }
.iv-summary b { font-weight: 600; }
.iv-summary .iv-k-near { color: #f08a55; }
.iv-summary .iv-k-far { color: #6aabf1; }

/* Sky slice */
.iv-sky { position: relative; border-radius: 10px; overflow: hidden; background: #070d1a; }
.iv-sky svg { display: block; width: 100%; height: auto; }
.iv-readouts {
  position: absolute; top: 14px; left: 16px; right: 16px;
  display: flex; flex-wrap: wrap; gap: 10px 34px; pointer-events: none;
}
.iv-readout { line-height: 1; }
.iv-readout-label { display: block; font-size: 14px; color: var(--iv-text-2); margin-bottom: 4px; }
.iv-readout-val { font-family: var(--iv-font-c); font-weight: 600; font-size: clamp(34px, 5.4vw, 54px); letter-spacing: -0.01em; }
.iv-readout-val small { font-family: var(--iv-font); font-size: 15px; font-weight: 500; color: var(--iv-text-2); margin-left: 4px; letter-spacing: 0; }
.iv-readout[data-k="near"] .iv-readout-val { color: #f08a55; }
.iv-readout[data-k="far"] .iv-readout-val { color: #6aabf1; }
.iv-readout-trend { font-size: 13px; color: var(--iv-text-2); display: block; margin-top: 4px; }
.iv-sky-note { position: absolute; right: 60px; top: 20px; font-size: 13px; color: var(--iv-text-2); text-align: right; }

/* Sections */
.iv-section { margin-top: 30px; }
.iv-h {
  font-family: var(--iv-font-c); font-weight: 600; font-size: 26px; line-height: 1.1;
  margin: 0 0 4px; color: var(--iv-text); letter-spacing: 0;
}
.iv-sub { color: var(--iv-text-2); font-size: 15px; max-width: 70ch; margin-bottom: 12px; }

/* Band ruler */
.iv-ruler svg { display: block; width: 100%; height: auto; overflow: visible; }
.iv-legend { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 14px; color: var(--iv-text-2); margin: 6px 0 4px; }
.iv-legend span { display: inline-flex; align-items: center; gap: 7px; }
.iv-swatch { width: 14px; height: 10px; border-radius: 2px; display: inline-block; }
.iv-bands { list-style: none; margin: 10px 0 0; padding: 0; display: none; }
.iv-bands li { display: flex; flex-direction: column; gap: 3px; padding: 11px 0; border-top: 1px solid var(--iv-line); }
.iv-bands li:first-child { border-top: 0; }
.iv-band-name { font-family: var(--iv-font-c); font-weight: 600; font-size: 21px; line-height: 1.2; word-spacing: 0.35em; }
.iv-band-state { font-weight: 600; display: inline-flex; align-items: center; gap: 7px; }
.iv-band-why { color: var(--iv-text-2); font-size: 14px; line-height: 1.4; }
.iv-note { margin: 14px 0 0; font-size: 14px; }
.ionoview.iv-narrow .iv-ruler { display: none; }
.ionoview.iv-narrow .iv-bands { display: block; }

/* Chart */
.iv-chart { position: relative; }
.iv-chart svg { display: block; width: 100%; height: auto; }
.iv-tip {
  position: absolute; pointer-events: none; z-index: 2;
  background: #18233d; border: 1px solid #2d3d61; border-radius: 8px;
  padding: 8px 10px; font-size: 13px; line-height: 1.45; color: var(--iv-text);
  white-space: nowrap; opacity: 0; transition: opacity .12s;
}
.iv-tip.on { opacity: 1; }
.iv-tip-time { color: var(--iv-text-2); margin-bottom: 2px; }
.iv-tip-row { display: flex; align-items: center; gap: 7px; }

/* Facts */
.iv-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0; margin-top: 8px; border-top: 1px solid var(--iv-line); }
.iv-fact { padding: 14px 16px 14px 0; border-bottom: 1px solid var(--iv-line); }
.iv-fact-label { font-size: 14px; color: var(--iv-text-2); }
.iv-fact-val { font-family: var(--iv-font-c); font-weight: 600; font-size: 28px; line-height: 1.15; }
.iv-fact-val small { font-family: var(--iv-font); font-weight: 500; font-size: 14px; color: var(--iv-text-2); margin-left: 3px; }
.iv-fact-note { font-size: 13px; color: var(--iv-text-3); line-height: 1.35; margin-top: 2px; }

/* Explainers */
.iv-explain { margin-top: 8px; }
.iv-explain details { border-top: 1px solid var(--iv-line); }
.iv-explain details:last-child { border-bottom: 1px solid var(--iv-line); }
.iv-explain summary {
  cursor: pointer; list-style: none; padding: 12px 0; font-weight: 600; font-size: 17px;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.iv-explain summary::-webkit-details-marker { display: none; }
.iv-explain summary::after { content: "+"; font-family: var(--iv-font-c); font-size: 24px; color: var(--iv-text-2); line-height: 1; }
.iv-explain details[open] summary::after { content: "\2212"; }
.iv-explain details > div { padding: 0 0 16px; color: var(--iv-text-2); }
.iv-explain details > div p + p { margin-top: 10px; }

.iv-why { margin-top: 30px; padding: 18px 20px; border-left: 3px solid var(--iv-far); background: var(--iv-panel); border-radius: 0 8px 8px 0; }
.iv-why p { color: var(--iv-text-2); }
.iv-why p + p { margin-top: 8px; }
.iv-why strong { color: var(--iv-text); font-weight: 600; }

.iv-foot { margin-top: 26px; font-size: 13px; line-height: 1.5; color: var(--iv-text-3); }
.iv-foot a { color: var(--iv-text-2); }

.iv-banner { margin: 18px 0 0; padding: 10px 14px; border-radius: 8px; background: #2a2210; color: #f4d58a; font-size: 15px; }
.iv-empty { padding: 30px 0; color: var(--iv-text-2); }

@media (max-width: 560px) {
  .ionoview { border-radius: 0; margin-left: -1rem; margin-right: -1rem; }
  .iv-readouts { gap: 8px 22px; }
  .iv-sky-note { display: none; }
}
