/* CVAS Radio Observatory dashboard. Everything is scoped under .cvas-ra so the
   WordPress theme cannot restyle it and it cannot restyle the theme. */
.cvas-ra {
  --bg: #090d15; --panel: #0d1320; --panel2: #101829; --line: #1c2840; --line2: #26375a;
  --text: #dbe6f5; --dim: #7f8ea8; --faint: #4c5a73;
  --cyan: #5ce1ff; --yellow: #f7c948; --green: #5ef08a; --red: #ff5d6c; --violet: #9d8bff; --pink: #ff6fb5;
  --glow: 0 0 18px rgba(92, 225, 255, .25);
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --disp: "Chakra Petch", "Rajdhani", "Segoe UI", system-ui, sans-serif;
  --sans: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg); color: var(--text); font: 14px/1.45 var(--sans);
  border-radius: 14px; padding: 22px 22px 26px; box-sizing: border-box;
  /* break out of the theme's narrow content column, centred on the page */
  width: min(1600px, calc(100vw - 32px)); max-width: none !important;
  position: relative; left: 50%; transform: translateX(-50%);
  margin-top: 1.5em; margin-bottom: 1.5em; overflow: hidden;
  container-type: inline-size; container-name: cvasra;
  -webkit-font-smoothing: antialiased;
}
.cvas-ra *, .cvas-ra *::before, .cvas-ra *::after { box-sizing: border-box; }
.cvas-ra button, .cvas-ra input, .cvas-ra select { font: inherit; color: inherit; }
.cvas-ra.night {
  --bg: #0a0000; --panel: #120202; --panel2: #160303; --line: #3a0a0a; --line2: #521010;
  --text: #ff6b6b; --dim: #b34040; --faint: #6e2020;
  --cyan: #ff5050; --yellow: #ff7a5a; --green: #ff4040; --violet: #ff6060; --pink: #ff5050; --glow: none;
}
/* the sky map has fixed colours, so night mode tints it; the charts redraw themselves in reds */

/* header */
.cvas-ra .hdr { display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: center; padding-bottom: 16px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.cvas-ra .brand h2 { margin: 0; font: 700 26px/1 var(--disp); letter-spacing: .08em; text-transform: uppercase; color: #fff; }
.cvas-ra.night .brand h2 { color: var(--text); }
.cvas-ra .brand p { margin: 7px 0 0; font: 500 12px var(--disp); letter-spacing: .2em; text-transform: uppercase; color: var(--dim); }
.cvas-ra .hdr .mid { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.cvas-ra .pill { border: 1px solid var(--line2); background: transparent; border-radius: 999px; padding: 6px 14px; font: 600 11px var(--disp); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); cursor: pointer; }
.cvas-ra .pill:hover { color: var(--text); border-color: var(--dim); }
.cvas-ra .pill.on { background: var(--cyan); color: #04121a; border-color: var(--cyan); box-shadow: var(--glow); }
.cvas-ra .live { display: inline-flex; gap: 8px; align-items: center; border: 1px solid var(--line2); border-radius: 999px; padding: 6px 14px; font: 700 13px var(--disp); letter-spacing: .12em; }
.cvas-ra .live .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); }
.cvas-ra .live.ok { color: var(--green); } .cvas-ra .live.ok .dot { background: var(--green); box-shadow: 0 0 10px var(--green); animation: cvas-pulse 2s infinite; }
.cvas-ra .live.stale { color: var(--yellow); } .cvas-ra .live.stale .dot { background: var(--yellow); }
.cvas-ra .live.off { color: var(--red); } .cvas-ra .live.off .dot { background: var(--red); }
.cvas-ra .live small { font: 400 11px var(--mono); color: var(--dim); letter-spacing: 0; }
@keyframes cvas-pulse { 50% { opacity: .35; } }
.cvas-ra .clocks { margin-left: auto; display: flex; gap: 26px; }
.cvas-ra .clock b { display: block; font: 600 24px/1 var(--mono); color: var(--cyan); text-shadow: var(--glow); letter-spacing: .02em; }
.cvas-ra .clock span { display: block; margin-top: 6px; font: 500 10px var(--disp); letter-spacing: .22em; color: var(--dim); text-transform: uppercase; }

/* layout */
.cvas-ra .grid { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 18px; }
.cvas-ra .side { display: flex; flex-direction: column; gap: 10px; }
.cvas-ra .main { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.cvas-ra .card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 11px 14px 12px; }
.cvas-ra .card h4 { margin: 0 0 5px; font: 600 10.5px var(--disp); letter-spacing: .2em; text-transform: uppercase; color: var(--dim); }
.cvas-ra .card .big { font: 600 22px/1.15 var(--mono); color: var(--text); }
.cvas-ra .card .big small { font-size: 12px; color: var(--dim); font-weight: 400; }
.cvas-ra .card .sub { font-size: 12.5px; color: var(--dim); margin-top: 3px; }
.cvas-ra .c-cyan { color: var(--cyan) !important; text-shadow: var(--glow); }
.cvas-ra .c-yellow { color: var(--yellow) !important; }
.cvas-ra .c-green { color: var(--green) !important; }
.cvas-ra .c-red { color: var(--red) !important; }
.cvas-ra .chan { position: relative; padding-left: 18px; }
.cvas-ra .chan::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 4px; border-radius: 2px; background: var(--c, var(--cyan)); box-shadow: 0 0 10px var(--c, var(--cyan)); }
.cvas-ra .chan .row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.cvas-ra .chan .spark { display: block; width: 100%; height: 26px; margin-top: 6px; }
.cvas-ra .chan.off { opacity: .4; }
.cvas-ra .badges { display: flex; flex-wrap: wrap; gap: 6px; }
.cvas-ra .badge { border: 1px solid var(--line2); border-radius: 999px; padding: 2px 10px; font: 500 11px var(--mono); color: var(--dim); }
.cvas-ra .badge.g { color: var(--green); border-color: rgba(94, 240, 138, .45); }
.cvas-ra .badge.y { color: var(--yellow); border-color: rgba(247, 201, 72, .45); }

/* panels */
.cvas-ra .panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px 14px; position: relative; }
.cvas-ra .panel::before { content: ""; position: absolute; left: 18px; right: 18px; top: -1px; height: 1px; background: linear-gradient(90deg, transparent, var(--cyan), transparent); opacity: .5; }
.cvas-ra .phead { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 10px; }
.cvas-ra .phead h3 { margin: 0; font: 600 13px var(--disp); letter-spacing: .24em; text-transform: uppercase; color: var(--cyan); }
.cvas-ra .phead .tools { margin-left: auto; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cvas-ra .tag { border: 1px solid var(--line2); border-radius: 999px; padding: 3px 10px; font: 500 10.5px var(--disp); letter-spacing: .16em; color: var(--dim); text-transform: uppercase; }
.cvas-ra .btn { background: var(--panel2); border: 1px solid var(--line2); border-radius: 8px; padding: 5px 11px; font: 500 12px var(--disp); letter-spacing: .06em; color: var(--dim); cursor: pointer; text-decoration: none; }
.cvas-ra .btn:hover { color: var(--text); border-color: var(--dim); }
.cvas-ra .btn.on { background: var(--cyan); border-color: var(--cyan); color: #04121a; }
.cvas-ra input[type=date] { background: var(--panel2); border: 1px solid var(--line2); border-radius: 8px; padding: 4px 8px; color-scheme: dark; }
.cvas-ra .chartbox { position: relative; width: 100%; }
.cvas-ra .chartbox canvas { display: block; width: 100%; }
.cvas-ra .legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font-size: 12px; color: var(--dim); }
.cvas-ra .legend button { background: none; border: 0; padding: 0; cursor: pointer; display: inline-flex; gap: 7px; align-items: center; color: var(--text); font-size: 12.5px; }
.cvas-ra .legend button.off { color: var(--faint); text-decoration: line-through; }
.cvas-ra .legend i { width: 18px; height: 3px; border-radius: 2px; display: inline-block; }
.cvas-ra .legend .k { display: inline-flex; gap: 7px; align-items: center; }
.cvas-ra .foot { font-size: 12.5px; color: var(--dim); margin-top: 6px; }
.cvas-ra .tip { position: absolute; pointer-events: none; background: rgba(6, 10, 18, .94); border: 1px solid var(--line2); border-radius: 8px; padding: 7px 10px; font: 12px var(--mono); color: var(--text); white-space: nowrap; z-index: 5; display: none; box-shadow: 0 8px 24px rgba(0,0,0,.45); }
.cvas-ra .tip b { color: var(--cyan); font-weight: 600; }
.cvas-ra .empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; color: var(--dim); font-size: 13px; padding: 20px; pointer-events: none; }

/* sky */
.cvas-ra .sky { display: grid; grid-template-columns: minmax(240px, 340px) minmax(0, 1fr); gap: 18px; align-items: start; }
.cvas-ra .sky > * { min-width: 0; }
.cvas-ra table.src { width: 100%; border-collapse: collapse; font-size: 13px; }
.cvas-ra table.src th { text-align: left; font: 600 10px var(--disp); letter-spacing: .18em; text-transform: uppercase; color: var(--dim); padding: 6px 8px; border-bottom: 1px solid var(--line2); }
.cvas-ra table.src td { padding: 7px 8px; border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 12.5px; white-space: nowrap; }
.cvas-ra table.src td:first-child { font-family: var(--sans); white-space: normal; }
.cvas-ra table.src td small { display: block; color: var(--dim); font-size: 11px; }
.cvas-ra table.src.wrap td { white-space: normal; overflow-wrap: anywhere; }
.cvas-ra table.src.wrap td:nth-child(3) { white-space: nowrap; }
.cvas-ra table.src tr.down td { color: var(--faint); }
.cvas-ra table.src tr.inbeam td { background: rgba(92, 225, 255, .08); }
.cvas-ra .tablewrap { overflow-x: auto; }
.cvas-ra .calc { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 14px; }
.cvas-ra .calc .card { background: var(--panel2); }

@container cvasra (max-width: 980px) {
  .cvas-ra .grid { grid-template-columns: 1fr; }
  .cvas-ra .side { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
  .cvas-ra .sky { grid-template-columns: 1fr; }
  .cvas-ra .clocks { margin-left: 0; }
}
@container cvasra (max-width: 560px) {
  .cvas-ra .brand h2 { font-size: 20px; }
  .cvas-ra .clocks { gap: 16px; }
  .cvas-ra .clock b { font-size: 18px; }
}

/* sensor and space-weather chart grids */
.cvas-ra .sens { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }
.cvas-ra .sens > * { min-width: 0; }
.cvas-ra a.pill { text-decoration: none; display: inline-block; }
.cvas-ra .tablewrap { margin-top: 10px; }
.cvas-ra img.csc { display: block; max-width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--line); }

/* forecast grid */
.cvas-ra .fcwrap { overflow-x: auto; padding-bottom: 6px; }
.cvas-ra table.fc { border-collapse: separate; border-spacing: 1px; font: 10.5px var(--mono); }
.cvas-ra table.fc th, .cvas-ra table.fc td { padding: 0; text-align: center; }
.cvas-ra table.fc td { width: 15px; min-width: 15px; height: 19px; border-radius: 2px; color: #061019; font-size: 9px; font-weight: 600; }
.cvas-ra table.fc td.na { background: repeating-linear-gradient(45deg, transparent 0 3px, rgba(127,142,168,.18) 3px 5px); }
.cvas-ra table.fc td.mid, .cvas-ra table.fc th.mid { box-shadow: inset 2px 0 0 var(--yellow); }
.cvas-ra table.fc th.day { font: 600 10.5px var(--disp); letter-spacing: .12em; color: var(--cyan); text-align: left; padding: 2px 4px; border-left: 2px solid var(--yellow); white-space: nowrap; }
.cvas-ra table.fc th.hr { color: var(--dim); font-weight: 400; font-size: 9.5px; }
.cvas-ra table.fc th.rl { position: sticky; left: 0; z-index: 2; background: var(--panel); text-align: left; padding: 0 10px 0 0; font: 500 12px var(--sans); color: var(--text); white-space: nowrap; }
.cvas-ra table.fc th.rl small { display: block; font: 9.5px var(--mono); color: var(--faint); }
.cvas-ra.night table.fc td { filter: grayscale(1) sepia(1) hue-rotate(-50deg) saturate(6) brightness(.75); }

/* a container query cannot restyle the container itself, so the outer padding uses the window width */
@media (max-width: 560px) { .cvas-ra { padding: 14px 12px 18px; border-radius: 0; width: 100vw; } }

/* Night mode: every chart, swatch, heat-map cell and picture is mapped to red by luminance,
   so nothing blue, white or yellow reaches the observer's eyes. */
.cvas-ra.night .grid canvas, .cvas-ra.night .grid img, .cvas-ra.night .legend i,
.cvas-ra.night .fcwrap table { filter: grayscale(1) sepia(1) hue-rotate(-50deg) saturate(8) brightness(.8); }
/* wide tables scroll sideways inside their panel on a phone instead of squeezing to one word per line */
.cvas-ra .tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
@container cvasra (max-width: 760px) { .cvas-ra table.src.wrap { min-width: 680px; } }
