/* fox.css — the two fixed windows and the fox-specific bits. This repo only. */
/* SPDX-License-Identifier: GPL-2.0-only */

.windows { display: grid; grid-template-columns: 3fr 2fr; gap: 8px; }
@media (max-width: 1100px) { .windows { grid-template-columns: 1fr; } }
.window { min-width: 0; }
.window-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font-size: .9rem; color: var(--ink-2); }
.window-head h2 { margin: 0; font-size: .9rem; font-weight: 700; color: var(--ink); }
.window-head .hint { margin: 0 0 0 auto; }
.window .chart-wrap canvas { width: 100%; height: clamp(260px, 44vh, 520px); display: block; touch-action: none; }
#scanCanvas { cursor: pointer; }
#rssiCanvas { cursor: default; }

/* frequency presets as pills */
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pills .btn { padding: 3px 10px; font-size: .85rem; font-family: var(--mono); }

/* the module dropdown gets a warning ring while the band is unset */
select.needs-attention { border-color: var(--warn); box-shadow: 0 0 0 2px color-mix(in srgb, var(--warn) 45%, transparent); }

/* live readout in the Receiver section */
.readout { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0 4px; }
.readout .tile { background: var(--screen); border: 1px solid var(--edge); border-radius: var(--radius); padding: 8px 10px; }
.readout .lbl { font-size: .78rem; color: var(--ink-3); }
.readout .big { font-family: var(--mono); font-size: 1.6rem; font-variant-numeric: tabular-nums; color: var(--trace); line-height: 1.1; }
.readout .big.dim { color: var(--ink-3); }

/* footer firmware line */
footer .fw { display: block; margin-top: 4px; }

/* the Audio window spans both columns; its three views share one chart-wrap */
.window.wide { grid-column: 1 / -1; }
.window.wide .chart-wrap canvas#audioCanvas { height: clamp(220px, 32vh, 360px); }
.chart-wrap[data-view="cw"] canvas#audioCanvas, .chart-wrap[data-view="sstv"] canvas#audioCanvas { display: none; }
.cw-text { padding: 14px 18px; min-height: 220px; font-family: var(--mono); }
.cw-elements { color: var(--ink-3); font-size: .9rem; letter-spacing: .15em; white-space: nowrap; overflow: hidden; text-overflow: clip; direction: rtl; text-align: left; height: 1.4em; }
.cw-decoded { color: var(--trace); font-size: 1.6rem; line-height: 1.5; white-space: pre-wrap; word-break: break-word; min-height: 3em; }
.sstv-view { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px; }
.sstv-view canvas { width: min(100%, 640px); image-rendering: pixelated; border: 1px solid var(--edge); background: #000; }
.badge.tx { border-color: var(--err); color: var(--err); font-weight: 700; animation: pulse .8s ease-in-out infinite; }
#keyBtn[aria-pressed="true"] { background: var(--err); border-color: var(--err); color: #fff; font-weight: 700; }

/* v0.4: replay state, location badge */
.badge.warn { animation: none; }
.kv dd.err { color: var(--err); }
body.replaying .window-head h2::after { content: ' · replay'; color: var(--warn); font-weight: 400; }

/* v0.5: hunt layout */
body.hunt .sidebar, body.hunt .sidebar-handle, body.hunt .plot-area, body.hunt .console, body.hunt .firmware { display: none !important; }
body.hunt .app { grid-template-columns: 1fr; }
.hunt { max-width: 760px; width: 100%; margin: 0 auto; padding: 10px 12px 24px; display: flex; flex-direction: column; gap: 10px; }
.hunt-top { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hunt-tile { background: var(--screen); border: 1px solid var(--edge); border-radius: var(--radius); padding: 10px 14px; min-height: 110px; }
.hunt-tile .lbl { font-size: .8rem; color: var(--ink-3); }
.hunt-tile .huge { font-family: var(--mono); font-size: clamp(2.6rem, 11vw, 4.2rem); line-height: 1.05; font-variant-numeric: tabular-nums; color: var(--trace); }
.hunt-tile .huge.dim { color: var(--ink-3); }
.hunt-tile .huge.soon { color: var(--warn); }
.hunt-tile .huge.now { color: var(--maxhold); }
.hunt-tile .sub { font-size: .85rem; color: var(--ink-2); margin-top: 4px; min-height: 1.2em; }
.hunt-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.hunt-actions .btn { padding: 10px 14px; font-size: 1rem; }
.hunt-actions select { padding: 8px; }
.hunt .chart-wrap canvas { width: 100%; height: clamp(180px, 28vh, 300px); display: block; }
.hunt-board h2 { font-size: .95rem; margin: 0; }
.hunt-board .cw-decoded.small { font-size: 1.1rem; min-height: 1.4em; color: var(--ink-2); margin-top: 6px; }
table.board td:first-child { font-family: var(--mono); }
table.board canvas.spark { width: 72px; height: 18px; display: block; }
table.board td.id { color: var(--maxhold); font-weight: 700; font-family: var(--mono); }
table.board tr.on td { background: color-mix(in srgb, var(--maxhold) 12%, transparent); }
.mode-tabs { border: 1px solid var(--edge); border-radius: var(--radius); padding: 2px; gap: 2px; }
.mode-tabs .btn { border: none; }
.mode-tabs .btn[aria-pressed="true"] { background: var(--accent); color: #fff; }
@media (max-width: 520px) { .topbar nav { display: none; } .hunt-top { grid-template-columns: 1fr; } .hunt-tile { min-height: 0; } }

/* v0.6: bearing */
.hunt-bearing h2 { font-size: .95rem; margin: 0; }
.hunt-bearing .chart-wrap canvas { height: clamp(240px, 60vw, 360px); }
table.bearings td:nth-child(3) { font-family: var(--mono); font-weight: 700; color: var(--maxhold); }
#captureBtn[aria-pressed="true"], #hCaptureBtn[aria-pressed="true"] { background: var(--maxhold); border-color: var(--maxhold); color: #1a1a1a; }

/* v0.7: scrolling on phones — a finger on a plot still scrolls the page; the hold buttons keep the touch */
.window .chart-wrap canvas, .hunt .chart-wrap canvas { touch-action: pan-y; }
#keyBtn, #captureBtn, #hCaptureBtn { touch-action: none; }

/* firmware section under the console, led-iv-lab style */
.firmware { padding: 14px 16px 18px; border-top: 1px solid var(--edge); }
.firmware h2 { font-size: .95rem; margin: 0 0 6px; }
.fw-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 700px) { .fw-grid { grid-template-columns: 1fr; } }
.fw-progress { margin-top: 8px; display: flex; align-items: center; gap: 10px; }
.fw-progress .bar { flex: 1; height: 8px; background: var(--grid); border-radius: 4px; overflow: hidden; }
.fw-progress .fill { height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.fw-steps { margin-top: 10px; color: var(--ink-2); font-size: .88rem; }
.fw-steps summary { cursor: pointer; color: var(--ink); }
.fw-steps ol { padding-left: 20px; }

/* the SQ wire's carrier light */
.sq-dot { display:inline-block; width:10px; height:10px; border-radius:50%; background:var(--edge); vertical-align:middle; margin-left:4px; }
.sq-dot.carrier { background:var(--ok); box-shadow:0 0 6px var(--ok); }
.sq-dot.quiet { background:var(--held); }

/* the Setup page: set once, then forgotten */
body.setup .sidebar, body.setup .sidebar-handle, body.setup .plot-area, body.setup .console { display: none !important; }
body.setup .app { grid-template-columns: 1fr; }
.setup { max-width: 1100px; width: 100%; margin: 0 auto; padding: 10px 12px 24px; display: flex; flex-direction: column; gap: 10px; }
.setup-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; align-items: start; }
.setup-card { background: var(--panel); border: 1px solid var(--edge); border-radius: var(--radius); padding: 12px 14px; }
.setup-card h2 { font-size: 1rem; margin: 0 0 8px; }
table.chans td:nth-child(2) { font-family: var(--mono); }
table.chans input { width: 100%; }
table.chans td.hint { white-space: normal; text-align: left; font-family: var(--font); }
table.chans th:first-child, table.chans td:first-child { text-align: left; }

/* the hunt page's "what now" line */
.hunt-guide { display: flex; align-items: center; gap: 10px; background: color-mix(in srgb, var(--accent) 12%, var(--panel)); border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--edge)); border-radius: var(--radius); padding: 8px 10px; font-size: .95rem; }
.hunt-guide .step { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; }
.hunt-guide.on { background: color-mix(in srgb, var(--maxhold) 14%, var(--panel)); border-color: color-mix(in srgb, var(--maxhold) 50%, var(--edge)); }
.hunt-guide.on .step { background: var(--maxhold); color: #000; }
.hunt-guide #hGuideText { flex: 1; }
.hunt-help { background: var(--panel); border: 1px solid var(--edge); border-radius: var(--radius); padding: 6px 12px 6px 28px; font-size: .9rem; color: var(--ink-2); }
.hunt-help li { margin: 6px 0; line-height: 1.45; }

/* the top bar on a phone: five things in two rows, the Module label dropped */
@media (max-width: 480px) { .topbar label .suffix { display: none; } .topbar #bandSel { max-width: 46vw; } }
.cw-log { font-family: var(--mono); font-size: .8rem; color: var(--ink-2); max-height: 140px; overflow: auto; margin-top: 6px; }
.cw-log div b { color: var(--maxhold); font-weight: 700; }

/* the Transmit tab */
body.tx .sidebar, body.tx .sidebar-handle, body.tx .firmware { display: none !important; }
body.tx .app { grid-template-columns: 1fr; }
body.tx .plot-area .window:not(:first-child) { display: none; }   /* only Signal strength while transmitting */
.txpanel { max-width: 1100px; width: 100%; margin: 0 auto; padding: 10px 12px 0; display: flex; flex-direction: column; gap: 10px; }
.tx-strip { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--edge); font-weight: 600; }
.tx-light { width: 14px; height: 14px; border-radius: 50%; background: var(--held); flex: none; }
.tx-light.armed { background: var(--warn); }
.tx-light.on { background: var(--err); box-shadow: 0 0 10px var(--err); animation: txblink 1s steps(2) infinite; }
@keyframes txblink { 50% { opacity: .35; } }
/* the TX tag: a button that looks like the badge, loud when something is on the air */
#txBadge { cursor: pointer; border: 0; font: inherit; }
body.on-air #txBadge { background: var(--err); color: #fff; animation: txblink 1.2s steps(2) infinite; }
/* the hunt page's channel strip and the full board/bearing blocks it absorbed */
.hunt-channels { display: flex; flex-wrap: wrap; gap: 6px; }
.hunt-channels .btn { flex: 1 1 110px; padding: 8px 6px; line-height: 1.15; }
.hunt-channels .btn b { font-family: var(--mono); font-size: 1.05rem; }
.hunt-channels .btn span { font-size: .78rem; color: var(--ink-2); }
.hunt-channels .btn.running span { color: inherit; }
.hunt-bearing h2, .hunt-board h2 { font-size: 1rem; margin: 0 0 6px; }
/* the Board view inside the Channels window */
.window-board { position: absolute; inset: 0; overflow: auto; padding: 6px; }
details.sub { margin: 4px 0; } details.sub summary { cursor: pointer; color: var(--ink-2); font-size: .88rem; }
.cw-decoded .src { color: var(--ink-3); font-size: .8rem; margin-right: 6px; }

/* decoded-on-the-fox text: characters matching the expected ID */
.hit { color: var(--ok, #2a9d4f); font-weight: 700; }
#sqtOut { white-space: pre-wrap; }
