/*
 * calculators.css: styles for calculators.html only. Loaded AFTER styles.css, so it reuses its tokens (--ink, --muted, --rule,
 * --paper, --accent, --link, --mono) and follows the visitor's light/dark setting with no JavaScript. No inline styles anywhere
 * (the page CSP allows only our own stylesheet); the diagram's shapes are SVG elements styled by the classes below.
 */
.calcpage .tool .intro { max-width: 760px; }

/* a row of fields: wraps by itself, four across on a desktop */
.cgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 12px; align-items: end; }
.cgrid label { display: grid; gap: 4px; font: 12px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.cgrid input, .cgrid select { width: 100%; font: 16px var(--sans); padding: 9px 10px; color: var(--ink); background: var(--bg);
  border: 1px solid var(--rule); border-radius: 2px; text-transform: none; letter-spacing: 0; }
.cgrid input[aria-invalid="true"] { border-color: var(--accent); outline: 1px solid var(--accent); }
.cgrid .cbtn { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.cgrid .quick { grid-column: span 3; }

/* in-page jump links (the same look as the reference page) */
.jump { display: flex; flex-wrap: wrap; gap: 8px 10px; margin: 6px 0 14px; }
.jump a { font: 600 12px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--link);
  border: 1px solid var(--rule); border-radius: 3px; padding: 6px 10px; text-decoration: none; background: var(--paper); }
.jump a:hover, .jump a:focus-visible { border-color: var(--ink); }

/* the answer box: big readable numbers, one fact per line */
.result { margin: 6px 0 10px; padding: 12px 14px; border: 1px solid var(--rule); background: var(--bg); min-height: 3.2em; max-width: 760px; overflow-x: auto; }
.result .big { font: 700 26px var(--mono); color: var(--ink); display: block; margin: 0 0 4px; }
.result .line { margin: 2px 0; }
.result .bad { color: var(--accent); }
.result .note { color: var(--muted); font-size: 14px; }
.result table { margin: 6px 0 0; width: auto; }
.result th, .result td { padding: 4px 14px 4px 0; white-space: nowrap; }

/* radio horizon diagram: SVG shapes take their look from classes */
.diagram { display: block; width: 100%; max-width: 760px; height: auto; margin: 8px 0 2px; border: 1px solid var(--rule); background: var(--bg); }
.diagram .ground { fill: none; stroke: var(--ink); stroke-width: 3; }
.diagram .mast { stroke: var(--accent); stroke-width: 4; stroke-linecap: round; }
.diagram .top { fill: var(--accent); }
.diagram .tangent { fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 3 5; }
.diagram .horizon { fill: var(--accent); }
.diagram .wave { fill: none; stroke: var(--link); stroke-width: 3; stroke-dasharray: 8 8; stroke-linejoin: round; animation: wave-move 1s linear infinite; }
.diagram .lbl { fill: var(--ink); font: 13px var(--mono); }
.diagram .lbl.dim { fill: var(--muted); }
@keyframes wave-move { to { stroke-dashoffset: -16; } }
@media (prefers-reduced-motion: reduce) { .diagram .wave { animation: none; } }

@media (max-width: 640px) {
  .cgrid { grid-template-columns: 1fr 1fr; }
  .cgrid .quick { grid-column: span 2; }
}
