/**
 * STYLESHEET: qso-mode.css
 * Workspace 3: 擬真電台 CW QSO 通聯工作台、VFO 頻率刻度、類比 S-Meter 與雙向電傳終端
 * (100% Zero-Emoji, Material Design Icons, Eurorack Chassis Aesthetic)
 */

/* ==========================================================================
   1. Workspace Stage & Submode Nav
   ========================================================================== */
.qso-workspace-stage {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  gap: 12px;
  padding: 10px 14px 140px 14px;
  box-sizing: border-box;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.qso-workspace-stage::-webkit-scrollbar {
  width: 6px;
}
.qso-workspace-stage::-webkit-scrollbar-track {
  background: transparent;
}
.qso-workspace-stage::-webkit-scrollbar-thumb {
  background: #232b3b;
  border-radius: 3px;
}

.qso-mode-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  background: #12141c;
  padding: 6px;
  border-radius: 10px;
  border: 1px solid #232838;
}

.qso-mode-pill {
  flex: 1;
  min-width: 130px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #181b24;
  border: 1px solid #293042;
  color: #9aa5b8;
  padding: 8px 12px;
  border-radius: 7px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.qso-mode-pill:hover {
  background: #202636;
  color: #fff;
  border-color: #3b4560;
}

.qso-mode-pill.active {
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.15), rgba(0, 229, 255, 0.05));
  border-color: var(--neon-blue);
  color: #fff;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.2);
}

.qso-mode-pill.active i {
  color: var(--neon-blue);
}

/* ==========================================================================
   2. Eurorack Chassis Cockpit Card
   ========================================================================== */
.qso-cockpit-card {
  position: relative;
  background: linear-gradient(180deg, #131620 0%, #0f1118 100%);
  border: 1.5px solid #242b3b;
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-sizing: border-box;
}

/* Corner Screw Rivets */
.qso-cockpit-card::before,
.qso-cockpit-card::after {
  content: '';
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #3a4254;
  box-shadow: inset 0 1px 1px #000, 0 0 1px #111;
  pointer-events: none;
}
.qso-cockpit-card::before { top: 7px; left: 7px; }
.qso-cockpit-card::after { top: 7px; right: 7px; }

.qso-deck-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #7b8ba5;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* ==========================================================================
   3. SDR VFO Bar & S-Meter Deck
   ========================================================================== */
.qso-sdr-deck {
  display: grid;
  grid-template-columns: 240px 1fr 240px;
  gap: 12px;
  background: #0d0f16;
  border: 1px solid #1e2433;
  border-radius: 10px;
  padding: 12px;
  align-items: stretch;
}

/* Left: VFO Tuner */
.qso-vfo-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: center;
  border-right: 1px solid #1c2230;
  padding-right: 12px;
}

.qso-band-buttons {
  display: flex;
  gap: 6px;
}

.qso-band-btn {
  flex: 1;
  background: #161a24;
  border: 1px solid #2a3347;
  color: #8c9bb0;
  padding: 5px 0;
  border-radius: 5px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.qso-band-btn:hover {
  border-color: var(--neon-blue);
  color: #fff;
}

.qso-band-btn.active {
  background: #1a293a;
  border-color: var(--neon-blue);
  color: var(--neon-blue);
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.3);
}

.qso-freq-display {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  background: #090b10;
  border: 1px solid #19202c;
  border-radius: 6px;
  padding: 6px 10px;
}

.qso-freq-val {
  font-family: 'SF Mono', Consolas, monospace;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
}

.qso-freq-unit {
  font-size: 0.72rem;
  color: #6e7d94;
  font-weight: 600;
}

/* Center: Analog S-Meter Dial */
.qso-smeter-panel {
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: center;
  align-items: center;
}

.qso-smeter-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 4px;
}

.qso-smeter-val {
  font-family: 'SF Mono', Consolas, monospace;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--neon-blue);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  text-shadow: 0 0 6px rgba(0, 229, 255, 0.4);
  min-width: 90px;
  text-align: right;
  display: inline-flex;
  justify-content: flex-end;
  align-items: center;
  gap: 2px;
}

.smeter-s-tag {
  width: 24px;
  text-align: left;
  flex-shrink: 0;
}

.smeter-s-db {
  width: 62px;
  text-align: left;
  flex-shrink: 0;
}

.qso-smeter-bezel {
  width: 100%;
  max-width: 320px;
  background: #080a0f;
  border: 1.5px solid #1f2736;
  border-radius: 8px;
  padding: 4px 8px 6px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.8);
}

.qso-smeter-svg {
  width: 100%;
  height: 68px;
  display: block;
}

.qso-meter-text {
  font-family: 'SF Mono', Consolas, monospace;
  font-size: 9px;
  font-weight: 700;
  fill: #8292a8;
  text-anchor: middle;
  dominant-baseline: central;
}

.qso-meter-text.red {
  fill: #ff5252;
}

#qso-smeter-needle-group {
  transform-box: view-box;
  transform-origin: 50% 100%;
  transition: transform 0.15s cubic-bezier(0.2, 0.8, 0.3, 1);
}

/* 11-Segment Dynamic S-Meter LED Ladder */
.qso-smeter-led-ladder {
  display: flex;
  gap: 3px;
  width: 90%;
  margin-top: 2px;
}

.smeter-led {
  flex: 1;
  height: 4px;
  background: #161b24;
  border-radius: 1px;
  transition: background 0.08s ease, box-shadow 0.08s ease;
}

.smeter-led.active {
  background: #00e676;
  box-shadow: 0 0 5px rgba(0, 230, 118, 0.6);
}

.smeter-led.red.active {
  background: #ff3d00;
  box-shadow: 0 0 6px rgba(255, 61, 0, 0.8);
}

/* Right: RF Atmosphere Panel */
.qso-rf-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: center;
  border-left: 1px solid #1c2230;
  padding-left: 12px;
}

.qso-carrier-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #090b10;
  border: 1px solid #19202c;
  border-radius: 6px;
  padding: 6px 10px;
}

.qso-carrier-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2b3548;
  box-shadow: inset 0 1px 1px #000;
  transition: all 0.1s ease;
}

.qso-carrier-dot.active-rx {
  background: #00e676;
  box-shadow: 0 0 8px #00e676;
}

.qso-carrier-dot.active-tx {
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold);
}

.qso-carrier-text {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: #6e7d94;
  text-transform: uppercase;
}

.qso-rf-controls {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.qso-rf-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.qso-rf-label {
  font-size: 0.72rem;
  color: #92a1b8;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

.qso-checkbox {
  cursor: pointer;
  accent-color: var(--neon-blue);
}

.qso-select {
  background: #151822;
  border: 1px solid #283142;
  color: #ddd;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.72rem;
  outline: none;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* ==========================================================================
   4. Step Guidance Banner
   ========================================================================== */
.qso-stage-guide {
  background: #11141c;
  border: 1px solid #202736;
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.qso-guide-steps-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.qso-step-badge {
  flex: 1;
  text-align: center;
  white-space: nowrap;
  padding: 4px 8px;
  border-radius: 4px;
  background: #161a24;
  border: 1px solid #242c3d;
  color: #728299;
  font-size: 0.72rem;
  font-weight: 700;
  transition: all 0.2s ease;
}

.qso-step-badge.active {
  background: rgba(255, 215, 0, 0.12);
  border-color: var(--gold);
  color: var(--gold);
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.25);
}

.qso-step-badge.completed {
  background: rgba(0, 230, 118, 0.08);
  border-color: #00e676;
  color: #00e676;
}

.qso-guide-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.qso-guide-instruction {
  font-size: 0.82rem;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  gap: 6px;
}

.qso-guide-instruction i {
  color: var(--neon-blue);
}

.qso-guide-hint-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #090b10;
  border: 1px dashed #2d374a;
  border-radius: 5px;
  padding: 4px 8px;
}

.qso-hint-title {
  font-size: 0.7rem;
  color: #8a99b0;
  font-weight: 600;
}

.qso-hint-code {
  font-family: 'SF Mono', Consolas, monospace;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--neon-blue);
  letter-spacing: 0.5px;
}

.btn-xs-util {
  background: #1b202c;
  border: 1px solid #2f394d;
  color: #cbd5e1;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.btn-xs-util:hover {
  background: #252d3d;
  color: #fff;
  border-color: var(--neon-blue);
}

/* ==========================================================================
   5. Two-way Teletype Terminal
   ========================================================================== */
.qso-terminal {
  display: flex;
  flex-direction: column;
  background: #080a0e;
  border: 1.5px solid #1a212e;
  border-radius: 8px;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.8);
  overflow: hidden;
}

.qso-terminal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  background: #11141c;
  padding: 6px 12px;
  border-bottom: 1px solid #1c2230;
}

.qso-remote-meta,
.qso-my-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
}

.meta-label {
  color: #6e7d94;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
}

.meta-val {
  color: #cbd5e1;
  font-family: 'SF Mono', Consolas, monospace;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.meta-val.highlight {
  color: var(--gold);
  font-weight: 800;
}

.qso-terminal-actions {
  display: flex;
  gap: 6px;
}

.qso-terminal-feed {
  height: 230px;
  overflow-y: auto;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: 'SF Mono', Consolas, 'Fira Code', monospace;
  font-size: 0.85rem;
  line-height: 1.5;
  scroll-behavior: smooth;
  box-sizing: border-box;
}

.qso-terminal-feed::-webkit-scrollbar {
  width: 6px;
}
.qso-terminal-feed::-webkit-scrollbar-track {
  background: transparent;
}
.qso-terminal-feed::-webkit-scrollbar-thumb {
  background: #232b3b;
  border-radius: 3px;
}
.qso-terminal-feed::-webkit-scrollbar-thumb:hover {
  background: #333e54;
}

/* Terminal Feed Rows */
.qso-feed-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  word-break: break-all;
}

.qso-feed-line.live {
  background: rgba(0, 229, 255, 0.06);
  border-left: 2px solid var(--neon-blue);
  padding: 2px 6px;
  border-radius: 4px;
}

.qso-cursor {
  display: inline-block;
  width: 8px;
  height: 13px;
  background: var(--gold);
  margin-left: 3px;
  vertical-align: -1px;
  animation: qsoCursorBlink 0.8s infinite;
}

@keyframes qsoCursorBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.qso-feed-time {
  font-size: 0.72rem;
  color: #556277;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.qso-feed-tag {
  font-size: 0.74rem;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 3px;
  flex-shrink: 0;
}

.qso-feed-tag.rx {
  background: rgba(0, 230, 118, 0.15);
  color: #00e676;
  border: 1px solid rgba(0, 230, 118, 0.4);
}

.qso-feed-tag.tx {
  background: rgba(255, 215, 0, 0.15);
  color: var(--gold);
  border: 1px solid rgba(255, 215, 0, 0.4);
}

.qso-feed-tag.sys {
  background: rgba(0, 229, 255, 0.1);
  color: var(--neon-blue);
  border: 1px solid rgba(0, 229, 255, 0.3);
}

.qso-feed-text {
  letter-spacing: 1px;
}

.qso-feed-text.rx {
  color: #ffd700;
  text-shadow: 0 0 4px rgba(255, 215, 0, 0.4);
}

/* Adaptive CRT Presets for Terminal Feed */
[data-theme="green-phosphor"] .qso-feed-text.rx {
  color: #00e676;
  text-shadow: 0 0 5px rgba(0, 230, 118, 0.5);
}

[data-theme="classic-amber"] .qso-feed-text.rx {
  color: #ffb300;
  text-shadow: 0 0 5px rgba(255, 179, 0, 0.5);
}

.qso-feed-text.tx {
  color: #00e5ff;
  text-shadow: 0 0 4px rgba(0, 229, 255, 0.4);
}

.qso-feed-text.sys {
  color: #8c9bb0;
  font-size: 0.78rem;
  font-style: italic;
}

.qso-feed-line.rx-live {
  border-left-color: #00e676;
  background: rgba(0, 230, 118, 0.06);
}

.qso-cursor.rx-cursor {
  background: #00e676;
}

.qso-blind-masked {
  letter-spacing: 2px;
  color: #7b889d;
  font-weight: 700;
}

.btn-qso-reveal {
  margin-left: 8px;
  padding: 1px 6px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--neon-blue);
  background: rgba(0, 229, 255, 0.1);
  border: 1px solid rgba(0, 229, 255, 0.3);
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.2s ease;
  vertical-align: middle;
}

.btn-qso-reveal:hover {
  background: rgba(0, 229, 255, 0.2);
  border-color: var(--neon-blue);
  box-shadow: 0 0 6px rgba(0, 229, 255, 0.4);
}

.qso-revealed-tag {
  margin-left: 8px;
  font-size: 0.68rem;
  color: #00e676;
  font-weight: 700;
  padding: 1px 4px;
  background: rgba(0, 230, 118, 0.1);
  border-radius: 3px;
  vertical-align: middle;
}

.settings-row-text {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.8rem;
}

.settings-row-text label {
  color: #bbb;
  display: flex;
  flex-direction: column;
}

.settings-row-text label span {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.console-text-input {
  background: #090a0f;
  border: 1px solid #283142;
  border-radius: 4px;
  color: #00e5ff;
  font-family: 'SF Mono', Consolas, monospace;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 8px;
  outline: none;
  transition: all 0.2s ease;
}

.console-text-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 6px rgba(255, 215, 0, 0.3);
}

/* ==========================================================================
   6. Macro Buttons Deck
   ========================================================================== */
.qso-macro-deck {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.qso-macro-btn {
  background: #141822;
  border: 1.5px solid #263044;
  border-radius: 7px;
  padding: 6px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.qso-macro-btn:hover {
  background: #1d2332;
  border-color: var(--neon-blue);
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.2);
}

.qso-macro-btn:active {
  transform: translateY(1px);
  background: #252d3f;
}

.macro-badge {
  font-family: 'SF Mono', Consolas, monospace;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--gold);
}

.macro-label {
  font-size: 0.68rem;
  color: #8d9cb0;
  white-space: nowrap;
}

/* ==========================================================================
   7. Live Keying Telemetry & Streaming Assistance Deck
   ========================================================================== */
.qso-telemetry-deck {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr 1.6fr auto;
  gap: 8px;
  background: #0a0c12;
  border: 1.5px solid #1c2434;
  border-radius: 8px;
  padding: 8px 12px;
  align-items: center;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6);
}

.qso-telem-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.qso-telem-label {
  font-size: 0.65rem;
  color: #6e7d94;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.qso-telem-val {
  font-family: 'SF Mono', Consolas, monospace;
  font-size: 0.95rem;
  font-weight: bold;
  color: #cbd5e1;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.qso-telem-val.highlight-gold {
  color: var(--gold);
}

.qso-telem-val.highlight-cyan {
  color: var(--neon-blue);
}

.qso-gap-track {
  width: 100%;
  height: 5px;
  background: #141a26;
  border-radius: 2px;
  overflow: hidden;
  margin-top: 4px;
}

.qso-gap-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #00e5ff, #ffd700);
  transition: width 0.05s linear;
}

.qso-telem-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.btn-qso-over {
  background: #152233;
  border: 1px solid #233b58;
  color: var(--neon-blue);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-qso-over:hover {
  background: #1a2f4a;
  border-color: var(--neon-blue);
  color: #fff;
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.3);
}

.btn-qso-clear-feed {
  background: transparent;
  border: 1px solid #283142;
  color: #728299;
  font-size: 0.72rem;
  padding: 6px 8px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-qso-clear-feed:hover {
  border-color: #ff5252;
  color: #ff5252;
}

.qso-tx-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  color: #6e7e96;
  padding: 0 4px;
}

.qso-ack-text {
  color: var(--gold);
  font-weight: 700;
}

/* ==========================================================================
   8. Station Logbook View
   ========================================================================== */
.qso-logbook-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid #202736;
  padding-bottom: 10px;
}

.qso-logbook-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.qso-logbook-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.btn-qso-action {
  background: #181d28;
  border: 1px solid #2e384c;
  color: #cbd5e1;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.btn-qso-action:hover {
  background: #222938;
  border-color: var(--neon-blue);
  color: #fff;
}

.btn-qso-action.danger:hover {
  border-color: #ff5252;
  color: #ff5252;
}

.qso-logbook-table-wrapper {
  max-height: 480px;
  overflow-y: auto;
  overflow-x: auto;
  border: 1px solid #1a212e;
  border-radius: 8px;
  background: #080a0f;
}

.qso-logbook-table-wrapper::-webkit-scrollbar,
.qsl-modal::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.qso-logbook-table-wrapper::-webkit-scrollbar-track,
.qsl-modal::-webkit-scrollbar-track {
  background: transparent;
}
.qso-logbook-table-wrapper::-webkit-scrollbar-thumb,
.qsl-modal::-webkit-scrollbar-thumb {
  background: #232b3b;
  border-radius: 3px;
}
.qso-logbook-table-wrapper::-webkit-scrollbar-thumb:hover,
.qsl-modal::-webkit-scrollbar-thumb:hover {
  background: #333e54;
}

.qso-logbook-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  text-align: left;
}

.qso-logbook-table th,
.qso-logbook-table td {
  white-space: nowrap;
}

.qso-logbook-table th {
  background: #11151e;
  color: #8c9bb0;
  padding: 8px 10px;
  border-bottom: 1.5px solid #222a3a;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  position: sticky;
  top: 0;
  z-index: 2;
}

.qso-logbook-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #141a24;
  color: #cbd5e1;
  font-family: 'SF Mono', Consolas, monospace;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.qso-logbook-table tr:hover td {
  background: #131822;
}

.qso-logbook-empty {
  text-align: center;
  padding: 40px 10px;
  color: #6a788e;
  font-size: 0.85rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.qso-logbook-empty i {
  font-size: 2rem;
  color: #3b465a;
}

/* ==========================================================================
   9. Responsive Adaptation
   ========================================================================== */
@media (max-width: 900px) {
  .qso-sdr-deck {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .qso-vfo-panel,
  .qso-rf-panel {
    border: none;
    padding: 0;
  }

  .qso-macro-deck {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 600px) {
  .qso-macro-deck {
    grid-template-columns: repeat(2, 1fr);
  }

  .qso-terminal-feed {
    height: 180px;
  }

  .qso-terminal-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .qso-telemetry-deck {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }
  .qso-telem-card.telem-gap-card {
    grid-column: span 2;
  }
  .qso-telem-actions {
    grid-column: span 2;
    justify-content: flex-end;
  }
}

/* ==========================================================================
   10. QSL Card Modal Preview & Actions
   ========================================================================== */
.qsl-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 1000;
}

.qsl-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 920px;
  max-height: 90vh;
  overflow-y: auto;
  background: #11141c;
  border: 1.5px solid var(--gold);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8), 0 0 25px rgba(255, 215, 0, 0.2);
  z-index: 1001;
  display: flex;
  flex-direction: column;
}

.qsl-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #161a25;
  border-bottom: 1px solid #252e40;
}

.qsl-modal-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 8px;
}

.qsl-modal-body {
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.qsl-theme-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.qsl-bar-label {
  font-size: 0.75rem;
  color: #8c9cb0;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.qsl-theme-pill {
  background: #171b26;
  border: 1px solid #293245;
  color: #9aa8bc;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.qsl-theme-pill:hover {
  border-color: var(--neon-blue);
  color: #fff;
}

.qsl-theme-pill.active {
  background: rgba(0, 229, 255, 0.15);
  border-color: var(--neon-blue);
  color: var(--neon-blue);
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.25);
}

.qsl-canvas-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #090a0f;
  border: 1px solid #1c2230;
  border-radius: 8px;
  padding: 10px;
  box-sizing: border-box;
}

#qsl-card-canvas {
  width: 100%;
  max-width: 840px;
  height: auto;
  aspect-ratio: 3 / 2;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7);
  display: block;
}

.qsl-modal-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 4px;
}

.qsl-meta-hint {
  font-size: 0.74rem;
  color: #6e7e96;
  display: flex;
  align-items: center;
  gap: 5px;
}

.qsl-action-buttons {
  display: flex;
  gap: 8px;
}

