/* WEFAX 氣象傳真頁框（add-web-wefax）。只在 body.mode-wefax 出現；版面同 FreeDV／DARA 頁框（桌機／平板在右欄）。 */
body:not(.mode-wefax) #wefax-panel { display: none !important; }
body.mode-wefax #qso-bar { display: none; } /* FT8 的通聯控制列在 WEFAX（只收）沒有意義 */
body.mode-wefax #tx-panel, body.mode-wefax #strip-tx { display: none; } /* 只收不發：沒有發射區塊與發射鍵 */

.wefax { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.lists > .wefax { overflow-y: auto; }
.wfx-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.wfx-back-row { display: none; } /* 返回鈕列只在手機「呼叫」分頁顯示 */
.wfx-status { flex: 1; min-width: 0; margin: 0; font-weight: 600; min-height: 1.3em; }
.wfx-level { font-variant-numeric: tabular-nums; color: var(--muted); }
.wfx-hint { margin: 0; }
.wfx-ctl label { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }

/* 調整滑桿：標題、滑桿、目前值同一行；窄螢幕換行 */
.wfx-adj { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 4px 16px; align-items: center; }
.wfx-adj label { display: grid; grid-template-columns: 8em 1fr 4.5em; align-items: center; gap: 6px; }
.wfx-adj output { font-variant-numeric: tabular-nums; color: var(--muted); text-align: right; }
.wfx-adj input[type="range"] { width: 100%; min-width: 0; }
.wfx-adj button { justify-self: start; }

/* 影像：畫布寬度塞滿，高度照比例；超過可視高度時在框內捲動（即時收圖自動捲到最新一行） */
.wfx-viewer { overflow-y: auto; height: 60vh; min-height: 220px; flex: none; /* 固定高度：設定在上、圖在下，接收時版面不會跟著動 */ border: 1px solid var(--border); border-radius: 6px; }
.wfx-viewer:focus-visible { outline: 2px solid var(--focus, #4a90e2); outline-offset: 1px; }
#wefax-canvas { display: block; width: 100%; height: auto; }
.wfx-frame { overflow: hidden; background: #000; height: 0; } /* 高度由 ui.mjs 依已畫的行數設定 */
.wfx-empty-note { margin: 0; }
.wfx-adjust { border: 1px solid var(--border); border-radius: 6px; padding: 4px 8px; }
.wfx-adjust summary { cursor: pointer; padding: 2px 0; }
.wfx-adjust[open] summary { margin-bottom: 6px; }
.wfx-empty { margin: 8px; }
.wfx-viewer .wfx-empty { margin: 0; padding: 24px 12px; text-align: center; }
.wfx-viewer .wfx-empty[hidden] { display: none; }

.wfx-diag { margin: 0; }
.wfx-diag[data-state="gaps"], .wfx-diag[data-state="drift"] { color: var(--warn-text, #6b4a00); font-weight: 600; }

.wfx-h { margin: 4px 0 0; font-size: 1em; }
.wfx-history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; font-variant-numeric: tabular-nums; }
.wfx-history li { display: flex; gap: 6px; align-items: center; padding: 2px 4px; border-radius: 4px; flex-wrap: wrap; }
.wfx-history li:nth-child(odd) { background: var(--row-alt); }
.wfx-history li.on { outline: 2px solid var(--qsl-green); }
.wfx-item-text { flex: 1; min-width: 12em; }
.wfx-item-btn { padding: 2px 8px; }
#wefax-pause[aria-pressed="true"] { outline: 2px solid var(--qsl-green); }

@media (prefers-reduced-motion: reduce) {
  .wfx-viewer { scroll-behavior: auto; }
}

@media (max-width: 599px) { /* 同 phone.css */
  body.mode-wefax[data-ptab="call"] .wfx-back-row { display: flex; }
  body.mode-wefax[data-ptab="call"] #spectrum-panel,
  body.mode-wefax[data-ptab="decode"] #spectrum-panel { order: 2; flex: none; height: 150px; } /* 頁框在上、瀑布圖在下 */
  body.mode-wefax[data-ptab="call"] #wefax-panel,
  body.mode-wefax[data-ptab="decode"] #wefax-panel { flex: 1; min-height: 0; overflow-y: auto; margin: 0; border: 0; border-radius: 0; padding: 6px 8px 4px; }
  #wefax-back { width: 32px; height: 32px; }
  #wefax-back svg { width: 20px; height: 20px; }
  .wfx-adj label { grid-template-columns: 6.5em 1fr 4.5em; }
  .wfx-viewer { height: 45vh; min-height: 180px; }
}
