:root {
  --font-ui: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --app-max-width: 860px;
  --bg-page: #0f1115;
  --text-primary: #e7e9ee;
  --text-secondary: #aab0bd;
  --text-tertiary: #8f97a6;
  --text-heading-muted: #c3cada;
  --text-strong: #cfd5e2;
  --panel-bg: #171a21;
  --panel-border: #252a33;
  --panel-radius: 12px;
  --card-bg: #12151c;
  --input-bg: #0f1115;
  --input-border: #2a2f3a;
  --btn-primary: #2b6fff;
  --btn-primary-active: #1f4fb8;
  --btn-ptt-active: #00b894;
  --btn-secondary: #3a3f4b;
  --btn-secondary-hover: #4a4f5b;
  --accent: #2b6fff;
  --accent-strong: rgba(43, 111, 255, 0.65);
  --accent-soft: rgba(43, 111, 255, 0.1);
  --accent-border: rgba(43, 111, 255, 0.3);
  --activity-fill: linear-gradient(90deg, #2b6fff, #00b894);
  --meter-track: #252a33;
  --meter-fill: linear-gradient(90deg, #00b894 0%, #f39c12 72%, #ff4d6d 100%);
  --meter-arc: #4d5564;
  --meter-tick: #798295;
  --meter-mark: #aeb6c7;
  --meter-needle: #ff5c5c;
  --meter-pivot: #d4dced;
  --dial-shell: #2b313f;
  --dial-shell-border: #5f6a80;
  --dial-core: #3b4254;
  --dial-core-border: #6f7890;
  --dial-marker: #f0bf5f;
  --danger: #ff4d6d;
  --danger-soft: rgba(255, 77, 109, 0.15);
  --danger-border: rgba(255, 77, 109, 0.35);
  --danger-soft-strong: rgba(255, 77, 109, 0.3);
  --danger-text-soft: #ff6b81;
  --danger-border-strong: rgba(255, 77, 109, 0.45);
  --warning: #f39c12;
  --warning-soft: rgba(243, 156, 18, 0.15);
  --warning-border: rgba(243, 156, 18, 0.35);
  --tx-overlay-text: #dcfff7;
  --tx-overlay-bg: rgba(0, 184, 148, 0.18);
  --tx-overlay-border: rgba(0, 184, 148, 0.55);
}

body[data-skin="longhaul"] {
  --font-ui: "Trebuchet MS", "Lucida Sans Unicode", "Lucida Grande", sans-serif;
  --bg-page: #1b1814;
  --panel-bg: #27211a;
  --panel-border: #4a3d2f;
  --card-bg: #1f1a15;
  --input-bg: #1a1511;
  --input-border: #584938;
  --text-primary: #f1e3c8;
  --text-secondary: #ccb58f;
  --text-tertiary: #b79f7a;
  --text-heading-muted: #dbc3a0;
  --text-strong: #ffe0ad;
  --btn-primary: #cc6e2b;
  --btn-primary-active: #ad581b;
  --btn-ptt-active: #3fbc86;
  --btn-secondary: #5a4a3a;
  --btn-secondary-hover: #6a5846;
  --accent: #cc6e2b;
  --accent-strong: rgba(204, 110, 43, 0.65);
  --accent-soft: rgba(204, 110, 43, 0.15);
  --accent-border: rgba(204, 110, 43, 0.35);
  --activity-fill: linear-gradient(90deg, #cc6e2b, #f6b44f);
  --meter-fill: linear-gradient(90deg, #47c28f 0%, #e5ac3b 70%, #df5b3e 100%);
  --meter-arc: #8f7758;
  --meter-tick: #c4aa84;
  --meter-mark: #f3dcb9;
  --meter-needle: #f4573b;
  --meter-pivot: #f8e9cc;
  --dial-shell: #584838;
  --dial-shell-border: #8b7254;
  --dial-core: #6a563f;
  --dial-core-border: #a38563;
  --dial-marker: #ffd48d;
}

body[data-skin="handheld"] {
  --font-ui: "Tahoma", "Verdana", "Segoe UI", sans-serif;
  --app-max-width: 560px;
  --bg-page: #0b1310;
  --panel-bg: #102119;
  --panel-border: #2c4d3b;
  --panel-radius: 10px;
  --card-bg: #0d1b15;
  --input-bg: #0e1712;
  --input-border: #2c4d3b;
  --text-primary: #d9f2df;
  --text-secondary: #9cc6a7;
  --text-tertiary: #7fa688;
  --text-heading-muted: #bde0c5;
  --text-strong: #d5ffc4;
  --btn-primary: #2f8f5f;
  --btn-primary-active: #25724b;
  --btn-ptt-active: #4ab64f;
  --btn-secondary: #345447;
  --btn-secondary-hover: #3d6253;
  --accent: #3ca16d;
  --accent-strong: rgba(60, 161, 109, 0.65);
  --accent-soft: rgba(60, 161, 109, 0.15);
  --accent-border: rgba(60, 161, 109, 0.35);
  --activity-fill: linear-gradient(90deg, #3ca16d, #88d468);
  --meter-fill: linear-gradient(90deg, #63d28e 0%, #cae267 75%, #f2a34f 100%);
  --meter-arc: #3f6553;
  --meter-tick: #73a08a;
  --meter-mark: #a5ccb5;
  --meter-needle: #d9f06b;
  --meter-pivot: #dbf5e4;
  --dial-shell: #2a4a3e;
  --dial-shell-border: #3f6e5c;
  --dial-core: #355949;
  --dial-core-border: #4d7f68;
  --dial-marker: #d7f26f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-ui);
  background: var(--bg-page);
  color: var(--text-primary);
  padding-top: env(safe-area-inset-top);
  padding-left: max(env(safe-area-inset-left), 0px);
  padding-right: max(env(safe-area-inset-right), 0px);
  padding-bottom: env(safe-area-inset-bottom);
}

.hidden {
  display: none !important;
}

.app {
  max-width: var(--app-max-width);
  margin: 32px auto;
  padding: 0 20px 40px; box-sizing: border-box; width: 100%;
}

body[data-skin="handheld"] .app {
  margin: 20px auto;
  padding: 0 12px 24px; box-sizing: border-box; width: 100%;
}

body[data-skin="handheld"] #pttButton {
  min-height: 64px;
  font-size: 18px;
}

header h1 {
  margin: 0 0 8px;
  font-size: 28px;
}

header p {
  margin: 0 0 24px;
  color: var(--text-secondary);
}

.panel {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--panel-radius);
  padding: 16px 18px;
  margin-bottom: 16px;
}

.panel h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

.panel h3 {
  margin: 8px 0 10px;
  font-size: 14px;
  color: var(--text-heading-muted);
}

.row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
}

.presence-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.presence-item {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: var(--card-bg);
  font-size: 12px;
}

.presence-name {
  color: var(--text-primary);
}

.presence-meta {
  color: var(--text-tertiary);
}

.presence-item.presence-active {
  border-color: rgba(0, 184, 148, 0.5);
}

.channel-activity-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.activity-row {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 6px 8px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: var(--card-bg);
  font-size: 12px;
}

.activity-row.active-scan {
  border-color: var(--accent-strong);
}

.activity-label {
  color: var(--text-primary);
  font-family: var(--font-mono);
}

.activity-meter {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: var(--meter-track);
  overflow: hidden;
}

.activity-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: var(--activity-fill);
}

.activity-lastheard {
  color: var(--text-tertiary);
  min-width: 66px;
  text-align: right;
}

.label {
  color: var(--text-tertiary);
}

#audioDebug {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
  text-align: right;
  max-width: 72%;
  overflow-wrap: anywhere;
}

#bandCondition {
  font-weight: 600;
  color: var(--text-strong);
}

#propagationMeta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
  text-align: right;
  max-width: 72%;
  overflow-wrap: anywhere;
}

#channelMeta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
  text-align: right;
  max-width: 72%;
  overflow-wrap: anywhere;
}

.smeter-row {
  padding-bottom: 4px;
}

#sMeterValue {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-strong);
}

.smeter-track {
  height: 8px;
  border-radius: 999px;
  background: var(--meter-track);
  overflow: hidden;
  margin-bottom: 6px;
}

.smeter-bar {
  height: 100%;
  width: 0%;
  background: var(--meter-fill);
  transition: width 90ms linear;
}

.smeter-analog {
  display: none;
  margin-bottom: 6px;
}

.smeter-analog svg {
  width: 100%;
  height: 86px;
  display: block;
}

.smeter-arc {
  fill: none;
  stroke: var(--meter-arc);
  stroke-width: 2.2;
}

.smeter-ticks line {
  stroke: var(--meter-tick);
  stroke-width: 2;
}

.smeter-marks text {
  fill: var(--meter-mark);
  font-family: var(--font-mono);
  font-size: 9px;
}

.smeter-needle {
  stroke: var(--meter-needle);
  stroke-width: 2.6;
  stroke-linecap: round;
}

.smeter-pep-hold {
  stroke: #e74c3c;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-dasharray: 4 3;
  transition: opacity 0.3s ease;
}

.smeter-pivot {
  fill: var(--meter-pivot);
}

.smeter-power-row span:last-child {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.02em;
}

body[data-skin="longhaul"] .smeter-track {
  display: none;
}

body[data-skin="longhaul"] .smeter-analog {
  display: block;
}

body[data-skin="handheld"] .smeter-track {
  height: 10px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.station-grid {
  margin-bottom: 8px;
}

.station-readout {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.illegal-badge {
  background: var(--danger-soft);
  color: var(--danger-text-soft);
  border: 1px solid var(--danger-border-strong);
  border-radius: 999px;
  padding: 2px 8px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}

input {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text-primary);
}

select {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text-primary);
}

.inline-select {
  max-width: 170px;
  padding: 5px 8px;
  font-size: 12px;
}

.channel-dial-panel {
  margin: 2px 0 12px;
}

.channel-dial-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.channel-step-btn {
  min-width: 34px;
  padding: 8px 10px;
}

.channel-dial {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: 1px solid var(--dial-shell-border);
  background: radial-gradient(circle at 28% 28%, var(--dial-core), var(--dial-shell));
  display: grid;
  place-items: center;
  cursor: ns-resize;
  user-select: none;
  touch-action: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 5px 14px rgba(0, 0, 0, 0.28);
}

.channel-dial:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.channel-dial__knob {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--dial-core-border);
  background: radial-gradient(circle at 30% 30%, var(--dial-core), var(--dial-shell));
  position: relative;
  transition: transform 80ms ease-out;
}

.channel-dial__knob::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 50%;
  width: 3px;
  height: 13px;
  border-radius: 2px;
  transform: translateX(-50%);
  background: var(--dial-marker);
  box-shadow: 0 0 6px rgba(255, 228, 166, 0.35);
}

.channel-dial-value {
  min-width: 64px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-strong);
}

.channel-dial--custom .channel-dial__knob::after {
  opacity: 0.5;
}

.radio-knob-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin: 2px 0 14px;
}

.radio-knob-control {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 8px 6px;
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  background: var(--card-bg);
}

.radio-knob {
  width: 58px;
  height: 58px;
}

.radio-knob .channel-dial__knob {
  width: 38px;
  height: 38px;
}

.radio-knob .channel-dial__knob::after {
  top: 3px;
  height: 10px;
}

body[data-skin="handheld"] .radio-knob-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.inline-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.inline-controls input {
  min-width: 0;
  flex: 1;
}

.ptt-tools {
  align-items: center;
  gap: 12px;
}

#micStatus {
  color: var(--text-tertiary);
  font-size: 12px;
}

button {
  padding: 10px 16px;
  border-radius: 8px;
  border: none;
  background: var(--btn-primary);
  color: white;
  font-weight: 600;
  cursor: pointer;
}

button:active {
  transform: translateY(1px);
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

#scanToggle.active {
  background: var(--btn-primary-active);
}

#pttButton.active {
  background: var(--btn-ptt-active);
}

#pttStatus {
  margin-top: 10px;
  color: var(--text-secondary);
}

.mic-level {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.mic-level__track {
  flex: 1;
  height: 10px;
  background: var(--meter-track);
  border-radius: 999px;
  overflow: hidden;
}

.mic-level__fill {
  height: 100%;
  width: 0%;
  transition: width 80ms linear;
  background: var(--meter-fill);
}

#micLevelText {
  min-width: 62px;
  text-align: right;
  color: var(--text-secondary);
  font-size: 12px;
}

.collision {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid var(--danger-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.overflow-badge {
  background: var(--danger-soft-strong);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: bold;
}

.qrm-indicator {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--warning-soft);
  border: 1px solid var(--warning-border);
  display: flex;
  gap: 8px;
  align-items: center;
}

.qrm-indicator .label {
  color: var(--warning);
  font-weight: 500;
}

#qrmLevel {
  color: var(--warning);
  font-weight: bold;
}

.qrm-bars {
  font-family: monospace;
  letter-spacing: 2px;
}

.hidden {
  display: none !important;
}

/* ---------- RX Metadata badge ---------- */
.rx-metadata {
  padding: 4px 10px;
  margin: 4px 0;
  border-radius: 6px;
  font-family: "JetBrains Mono", "Fira Code", monospace;
  font-size: 0.82rem;
  letter-spacing: 0.5px;
  text-align: center;
  font-weight: 600;
}
.rx-metadata-near {
  background: rgba(46, 204, 113, 0.18);
  color: #2ecc71;
  border: 1px solid rgba(46, 204, 113, 0.35);
}
.rx-metadata-mid {
  background: rgba(241, 196, 15, 0.18);
  color: #f1c40f;
  border: 1px solid rgba(241, 196, 15, 0.35);
}
.rx-metadata-far {
  background: rgba(230, 126, 34, 0.18);
  color: #e67e22;
  border: 1px solid rgba(230, 126, 34, 0.35);
}
.rx-metadata-skip {
  background: rgba(155, 89, 182, 0.18);
  color: #9b59b6;
  border: 1px solid rgba(155, 89, 182, 0.35);
}

/* ---------- SKIP Lamp indicator ---------- */
.skip-lamp {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  margin: 4px 0;
  border-radius: 8px;
  background: rgba(155, 89, 182, 0.22);
  border: 1.5px solid rgba(155, 89, 182, 0.55);
  font-family: "JetBrains Mono", "Fira Code", monospace;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-align: center;
  justify-content: center;
  color: #c084fc;
  text-shadow: 0 0 8px rgba(192, 132, 252, 0.6);
  animation: skip-lamp-glow 2s ease-in-out infinite;
}
.skip-lamp-fade {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.5px;
  opacity: 0.75;
}
@keyframes skip-lamp-glow {
  0%, 100% { box-shadow: 0 0 6px rgba(155, 89, 182, 0.3); }
  50%      { box-shadow: 0 0 16px rgba(155, 89, 182, 0.6); }
}
.skip-lamp-flutter {
  animation: skip-lamp-flutter 0.6s ease-in-out infinite;
}
@keyframes skip-lamp-flutter {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.45; }
}
.skip-lamp-bursty {
  animation: skip-lamp-bursty 1.5s steps(1) infinite;
}
@keyframes skip-lamp-bursty {
  0%   { opacity: 1; }
  40%  { opacity: 0.2; }
  60%  { opacity: 1; }
  80%  { opacity: 0.15; }
  100% { opacity: 1; }
}

/* ---------- Presence SKIP badge ---------- */
.presence-skip-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  background: rgba(155, 89, 182, 0.28);
  color: #c084fc;
  border: 1px solid rgba(155, 89, 182, 0.45);
  vertical-align: middle;
}

.tx-overlay {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 30;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--tx-overlay-border);
  background: var(--tx-overlay-bg);
  color: var(--tx-overlay-text);
  font-weight: 700;
  letter-spacing: 0.2px;
}

pre {
  margin: 0;
  white-space: pre-wrap;
  font-size: 12px;
  color: var(--text-secondary);
}

/* Location section */
.location-section {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 12px;
}

.location-section label {
  flex: 1;
}

.location-section select {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text-primary);
  width: 100%;
}

.btn-secondary {
  background: var(--btn-secondary);
  padding: 8px 12px;
  font-size: 13px;
  white-space: nowrap;
}

.btn-secondary:hover {
  background: var(--btn-secondary-hover);
}

#useGpsButton {
  margin-bottom: 8px;
}

#useGpsButton.gps-active {
  background: #1b7a3a;
  color: #fff;
}

#useGpsButton.gps-pending {
  background: #8a6d1b;
  color: #fff;
  animation: gps-pulse 1.2s ease-in-out infinite;
}

@keyframes gps-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.location-display {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: 8px;
  margin-bottom: 12px;
}

.location-source {
  background: var(--accent);
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.location-value {
  font-family: monospace;
  font-size: 14px;
  color: var(--text-primary);
}

#customTileInputs.hidden-inputs {
  display: none;
}

/* Moderation panel (shown only with mod_key) */
.mod-panel {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 360px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
  overflow: auto;
  z-index: 20;

  background: rgba(23, 26, 33, 0.96);
  border: 1px solid #252a33;
  border-radius: 12px;
  padding: 12px 12px 10px;
  backdrop-filter: blur(10px);
}

.mod-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.mod-panel__title {
  font-weight: 700;
  font-size: 13px;
  color: #cfd5e2;
}

.mod-panel details {
  border-top: 1px solid #252a33;
  padding-top: 8px;
  margin-top: 8px;
}

.mod-panel details:first-of-type {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

.mod-panel summary {
  cursor: pointer;
  color: #9aa2b1;
  font-size: 12px;
  user-select: none;
}

.mod-panel__body {
  margin-top: 10px;
  display: grid;
  gap: 10px;
}

.mod-panel__grid {
  margin-bottom: 0;
}

.mod-panel__preset-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.mod-panel__preset-label {
  font-size: 11px;
  color: #8f97a6;
  margin-right: 4px;
}

.mod-duration-preset {
  padding: 6px 8px;
  font-size: 11px;
}

.mod-panel__summary {
  font-size: 12px;
  color: #cfd5e2;
  line-height: 1.35;
}

.mod-panel__status-list {
  margin: 0;
  padding-left: 16px;
  font-size: 11px;
  color: #9aa2b1;
}

.mod-panel select,
.mod-panel textarea {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #2a2f3a;
  background: #0f1115;
  color: #e7e9ee;
}

/* === 7-segment LED channel display === */
.led-channel-display {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 6px 14px;
  background: #0a0a0a;
  border: 1px solid #333;
  border-radius: 6px;
  box-shadow: inset 0 1px 6px rgba(0,0,0,0.6);
  width: fit-content;
}

.led-display__label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #555;
}

.led-display__digits {
  font-family: var(--font-mono);
  font-size: 32px;
  font-weight: 700;
  color: #ff3c2e;
  text-shadow: 0 0 8px rgba(255, 60, 46, 0.6), 0 0 20px rgba(255, 60, 46, 0.25);
  letter-spacing: 0.08em;
  min-width: 2.2ch;
  text-align: right;
  line-height: 1;
}

body[data-skin="longhaul"] .led-display__digits {
  color: #ffb347;
  text-shadow: 0 0 8px rgba(255, 179, 71, 0.6), 0 0 20px rgba(255, 179, 71, 0.25);
}

body[data-skin="handheld"] .led-display__digits {
  color: #7fff7f;
  text-shadow: 0 0 8px rgba(127, 255, 127, 0.5), 0 0 20px rgba(127, 255, 127, 0.2);
  font-size: 26px;
}

body[data-skin="handheld"] .led-channel-display {
  padding: 4px 10px;
}

/* === TX/RX LED indicators === */
.txrx-led-strip {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 8px;
}

.txrx-led {
  display: flex;
  align-items: center;
  gap: 6px;
}

.txrx-led__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #333;
  border: 1px solid #555;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.txrx-led__label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #666;
  transition: color 0.15s ease;
}

.txrx-led--tx.active .txrx-led__dot {
  background: #ff4444;
  border-color: #ff6666;
  box-shadow: 0 0 8px rgba(255, 68, 68, 0.7), 0 0 16px rgba(255, 68, 68, 0.3);
}

.txrx-led--tx.active .txrx-led__label {
  color: #ff6666;
}

.txrx-led--rx.active .txrx-led__dot {
  background: #44dd44;
  border-color: #66ff66;
  box-shadow: 0 0 8px rgba(68, 221, 68, 0.7), 0 0 16px rgba(68, 221, 68, 0.3);
}

.txrx-led--rx.active .txrx-led__label {
  color: #66ff66;
}

body[data-skin="longhaul"] .txrx-led--tx.active .txrx-led__dot {
  background: #f4573b;
  box-shadow: 0 0 8px rgba(244, 87, 59, 0.7), 0 0 16px rgba(244, 87, 59, 0.3);
}

body[data-skin="longhaul"] .txrx-led--rx.active .txrx-led__dot {
  background: #47c28f;
  box-shadow: 0 0 8px rgba(71, 194, 143, 0.7), 0 0 16px rgba(71, 194, 143, 0.3);
}

.mod-panel textarea {
  resize: vertical;
}

.mod-panel__actions {
  display: flex;
  gap: 10px;
}

.btn-danger {
  background: #ff4d6d;
}

.btn-danger:hover {
  background: #ff3b5f;
}

.mod-panel__hint {
  font-size: 11px;
  color: #8f97a6;
  line-height: 1.3;
}

.mod-panel__hint code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color: #cfd5e2;
}
/* ============================================
   CB FACEPLATE - RESPONSIVE DESIGN
   Desktop: CB Radio faceplate (landscape)
   Mobile: Walkie-talkie style (portrait)
   ============================================ */

/* ============================================
   CB FACEPLATE CONTAINER 
   ============================================ */

.cb-faceplate {
  position: relative;
  max-width: 900px;
  margin: 20px auto;
  padding: 24px;
  background: linear-gradient(145deg, #1e252f 0%, #151a23 100%);
  border: 3px solid #2a3442;
  border-radius: 16px;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.6),
    inset 0 2px 4px rgba(255, 255, 255, 0.05),
    inset 0 -2px 6px rgba(0, 0, 0, 0.4);
  display: grid;
  grid-template-areas:
    "brand lamps"
    "channel channel"
    "meter meter"
    "knobs knobs"
    "ptt ptt"
    "ticker ticker"
    "settings settings"
    "grille grille";
  grid-template-columns: auto 1fr;
  gap: 16px;
  position: relative;
}

/* Decorative screws in corners */
.cb-faceplate::before,
.cb-faceplate::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  background: radial-gradient(circle at 30% 30%, #4a5568, #1a1f2e);
  border: 1px solid #2d3748;
  border-radius: 50%;
  box-shadow: 
    inset -1px -1px 2px rgba(255, 255, 255, 0.1),
    inset 1px 1px 2px rgba(0, 0, 0, 0.5),
    0 2px 4px rgba(0, 0, 0, 0.3);
  z-index: 10;
}

.cb-faceplate::before {
  top: 12px;
  left: 12px;
  background-image: 
    linear-gradient(45deg, transparent 40%, rgba(255, 255, 255, 0.1) 40%, rgba(255, 255, 255, 0.1) 50%, transparent 50%),
    radial-gradient(circle at 30% 30%, #4a5568, #1a1f2e);
}

.cb-faceplate::after {
  top: 12px;
  right: 12px;
  background-image: 
    linear-gradient(135deg, transparent 40%, rgba(255, 255, 255, 0.1) 40%, rgba(255, 255, 255, 0.1) 50%, transparent 50%),
    radial-gradient(circle at 30% 30%, #4a5568, #1a1f2e);
}

/* Bottom screws */
.cb-faceplate .cb-speaker-grille::before,
.cb-faceplate .cb-speaker-grille::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  background: radial-gradient(circle at 30% 30%, #4a5568, #1a1f2e);
  border: 1px solid #2d3748;
  border-radius: 50%;
  box-shadow: 
    inset -1px -1px 2px rgba(255, 255, 255, 0.1),
    inset 1px 1px 2px rgba(0, 0, 0, 0.5),
    0 2px 4px rgba(0, 0, 0, 0.3);
  bottom: 12px;
  z-index: 10;
}

.cb-faceplate .cb-speaker-grille::before {
  left: 12px;
  background-image: 
    linear-gradient(-45deg, transparent 40%, rgba(255, 255, 255, 0.1) 40%, rgba(255, 255, 255, 0.1) 50%, transparent 50%),
    radial-gradient(circle at 30% 30%, #4a5568, #1a1f2e);
}

.cb-faceplate .cb-speaker-grille::after {
  right: 12px;
  background-image: 
    linear-gradient(-135deg, transparent 40%, rgba(255, 255, 255, 0.1) 40%, rgba(255, 255, 255, 0.1) 50%, transparent 50%),
    radial-gradient(circle at 30% 30%, #4a5568, #1a1f2e);
}

/* ============================================
   BRAND BADGE
   ============================================ */

.cb-brand {
  grid-area: brand;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-family: var(--font-ui);
  padding: 4px 8px;
}

.cb-brand__name {
  font-size: 18px;
  font-weight: 700;
  color: #f0b429;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  letter-spacing: 0.5px;
}

.cb-brand__model {
  font-size: 11px;
  color: #8f97a6;
  letter-spacing: 1px;
  font-weight: 600;
}

/* ============================================
   STATUS LAMPS ROW
   ============================================ */

.cb-lamps {
  grid-area: lamps;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-end;
  padding: 4px 8px;
}

.cb-lamp {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  opacity: 0.4;
  transition: opacity 0.2s ease;
}

.cb-lamp.active {
  opacity: 1;
}

.cb-lamp__glow {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #2a2f3a;
  border: 1px solid #1a1f2a;
  box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.8);
  transition: all 0.2s ease;
}

.cb-lamp--tx.active .cb-lamp__glow {
  background: #ff4d6d;
  box-shadow: 0 0 12px rgba(255, 77, 109, 0.9), 0 0 24px rgba(255, 77, 109, 0.5), inset 0 0 6px rgba(255, 255, 255, 0.4);
}

.cb-lamp--rx.active .cb-lamp__glow {
  background: #00d084;
  box-shadow: 0 0 12px rgba(0, 208, 132, 0.9), 0 0 24px rgba(0, 208, 132, 0.5), inset 0 0 6px rgba(255, 255, 255, 0.4);
}

.cb-lamp--skip.active .cb-lamp__glow {
  background: #f39c12;
  box-shadow: 0 0 12px rgba(243, 156, 18, 0.9), 0 0 24px rgba(243, 156, 18, 0.5), inset 0 0 6px rgba(255, 255, 255, 0.4);
}

.cb-lamp--scan.active .cb-lamp__glow {
  background: #3498db;
  box-shadow: 0 0 12px rgba(52, 152, 219, 0.9), 0 0 24px rgba(52, 152, 219, 0.5), inset 0 0 6px rgba(255, 255, 255, 0.4);
}

.cb-lamp--dx.active .cb-lamp__glow {
  background: #9b59b6;
  box-shadow: 0 0 12px rgba(155, 89, 182, 0.9), 0 0 24px rgba(155, 89, 182, 0.5), inset 0 0 6px rgba(255, 255, 255, 0.4);
}

.cb-lamp__label {
  font-size: 9px;
  font-weight: 700;
  color: #8f97a6;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.cb-lamp.active .cb-lamp__label {
  color: #e7e9ee;
}

/* ============================================
   CHANNEL SECTION (Presets + Display)
   ============================================ */

.cb-channel-section {
  grid-area: channel;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

/* Channel Presets */
.cb-presets {
  grid-area: presets;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.cb-preset-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 12px;
  background: linear-gradient(145deg, #2a3442, #1e252f);
  border: 2px solid #3a4552;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.05);
  min-width: 60px;
}

.cb-preset-btn:hover {
  background: linear-gradient(145deg, #3a4552, #2e3542);
  border-color: #4a5562;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.08);
}

.cb-preset-btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5), inset 0 1px 4px rgba(0, 0, 0, 0.4);
}

.cb-preset-btn--primary {
  border-color: #2b6fff;
  background: linear-gradient(145deg, #1f4fb8, #1a3f8f);
}

.cb-preset-btn--primary:hover {
  border-color: #4080ff;
  background: linear-gradient(145deg, #2b6fff, #1f4fb8);
}

.cb-preset-btn__ch {
  font-size: 20px;
  font-weight: 700;
  color: #e7e9ee;
  line-height: 1;
}

.cb-preset-btn__label {
  font-size: 9px;
  color: #aab0bd;
  letter-spacing: 0.5px;
  font-weight: 600;
  text-transform: uppercase;
}

.cb-preset-btn__badge {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.cb-preset-btn__badge--hot {
  background: linear-gradient(135deg, #ff9f43, #f39c12);
  color: #000;
  box-shadow: 0 0 8px rgba(243, 156, 18, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.4);
  animation: skipBadgePulse 2s ease-in-out infinite;
}

@keyframes skipBadgePulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px rgba(243, 156, 18, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.4); }
  50% { opacity: 0.8; box-shadow: 0 0 12px rgba(243, 156, 18, 0.9), inset 0 1px 1px rgba(255, 255, 255, 0.6); }
}

/* Channel Display */
.cb-channel-display {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: linear-gradient(135deg, #0a0d12, #12151c);
  padding: 16px; box-sizing: border-box;
  border-radius: 12px;
  border: 2px solid #1e252f;
  box-shadow: inset 0 2px 12px rgba(0, 0, 0, 0.7), 0 2px 8px rgba(0, 0, 0, 0.3);
  width: 100%;
}

.cb-channel-display__controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cb-channel-step {
  background: linear-gradient(145deg, #2a3442, #1e252f);
  border: 2px solid #3a4552;
  color: #e7e9ee;
  padding: 12px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 20px;
  transition: all 0.15s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cb-channel-step:hover {
  background: linear-gradient(145deg, #3a4552, #2e3542);
  border-color: #4a5562;
  transform: scale(1.05);
}

.cb-channel-step:active {
  transform: scale(0.95);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6);
}

.cb-channel-display__main {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  position: relative;
}

.cb-channel-display__label {
  font-size: 16px;
  color: #8f97a6;
  font-weight: 600;
  letter-spacing: 1px;
}

.cb-channel-display__digits {
  font-family: 'Courier New', monospace;
  font-size: 56px;
  font-weight: 700;
  color: #ff5c5c;
  text-shadow: 
    0 0 20px rgba(255, 92, 92, 0.9),
    0 0 40px rgba(255, 92, 92, 0.5),
    0 0 60px rgba(255, 92, 92, 0.3);
  letter-spacing: 4px;
  min-width: 90px;
  text-align: center;
  line-height: 1;
}

.cb-channel-input {
  position: absolute;
  right: 0;
  width: 64px;
  padding: 8px;
  background: #0f1115;
  border: 2px solid #2a3442;
  border-radius: 6px;
  color: #e7e9ee;
  font-size: 18px;
  text-align: center;
  font-family: 'Courier New', monospace;
  transition: all 0.2s ease;
}

.cb-channel-input:focus {
  outline: none;
  border-color: #2b6fff;
  box-shadow: 0 0 0 3px rgba(43, 111, 255, 0.2);
}

.cb-channel-input::placeholder {
  color: #4a5562;
}

.cb-channel-display__info {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: #aab0bd;
  justify-content: center;
}

.cb-channel-display__name {
  font-weight: 600;
  color: #cfd5e2;
}

.cb-channel__rx {
  color: #8f97a6;
  font-size: 12px;
}

/* ============================================
   S-METER
   ============================================ */

.cb-meter-section {
  grid-area: meter;
}

.cb-meter {
  background: linear-gradient(135deg, #0a0d12, #12151c);
  padding: 16px; box-sizing: border-box;
  border-radius: 12px;
  border: 2px solid #1e252f;
  box-shadow: inset 0 2px 12px rgba(0, 0, 0, 0.7), 0 2px 8px rgba(0, 0, 0, 0.3);
}

.cb-meter__svg {
  width: 100%;
  max-width: 400px;
  height: auto;
  display: block;
  margin: 0 auto;
}

.cb-meter__arc {
  fill: none;
  stroke: #2a3442;
  stroke-width: 8;
  stroke-linecap: round;
}

.cb-meter__ticks line {
  stroke: #4a5562;
  stroke-width: 2;
  stroke-linecap: round;
}

.cb-meter__marks text {
  fill: #8f97a6;
  font-size: 11px;
  font-weight: 600;
  text-anchor: middle;
  font-family: var(--font-ui);
}

.cb-meter__scale-labels text {
  fill: #6a7180;
  font-size: 9px;
  font-weight: 600;
  text-anchor: start;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-family: var(--font-ui);
}

.cb-meter__label-right {
  text-anchor: end !important;
}

.cb-meter__needle {
  stroke: #ff5c5c;
  stroke-width: 3;
  stroke-linecap: round;
  filter: drop-shadow(0 0 6px rgba(255, 92, 92, 0.8));
  transform-origin: 110px 98px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cb-meter__pep-hold {
  stroke: #f39c12;
  stroke-width: 2;
  stroke-linecap: round;
  opacity: 0.7;
  transform-origin: 110px 98px;
  transition: opacity 0.5s ease, transform 0.3s ease;
}

.cb-meter__pivot {
  fill: #e7e9ee;
  stroke: #2a3442;
  stroke-width: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.cb-meter__readout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 12px;
  font-family: 'Courier New', monospace;
  font-size: 18px;
  font-weight: 700;
  color: #e7e9ee;
}

.cb-meter__separator {
  color: #4a5562;
}

/* ============================================
   CONTROL KNOBS
   ============================================ */

.cb-controls {
  grid-area: knobs;
  display: flex;
  gap: 24px;
  justify-content: center;
  align-items: center;
  padding: 12px 0;
}

.cb-knob-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.cb-knob-label {
  font-size: 11px;
  font-weight: 700;
  color: #8f97a6;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.cb-knob {
  width: 80px;
  height: 80px;
  cursor: pointer;
  position: relative;
  user-select: none;
  touch-action: none;
}

.cb-knob__shell {
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 30% 30%, #3a4552, #1e252f);
  border-radius: 50%;
  box-shadow: 
    0 6px 20px rgba(0, 0, 0, 0.6),
    inset 0 2px 4px rgba(255, 255, 255, 0.08),
    inset 0 -4px 8px rgba(0, 0, 0, 0.5);
  border: 3px solid #2a3442;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.cb-knob__cap {
  width: 70%;
  height: 70%;
  background: linear-gradient(145deg, #4a5562, #3a4552);
  border-radius: 50%;
  position: relative;
  box-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.5),
    inset 0 1px 2px rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.cb-knob__indicator {
  position: absolute;
  top: 8%;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 25%;
  background: linear-gradient(180deg, #f0b429, #d49a1a);
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(240, 180, 41, 0.8), 0 0 12px rgba(240, 180, 41, 0.4);
}

.cb-knob:hover .cb-knob__shell {
  box-shadow: 
    0 6px 24px rgba(0, 0, 0, 0.7),
    inset 0 2px 4px rgba(255, 255, 255, 0.12),
    inset 0 -4px 8px rgba(0, 0, 0, 0.6);
}

.cb-knob:active .cb-knob__cap {
  transform: scale(0.95);
}

.cb-knob-value {
  font-size: 14px;
  font-weight: 600;
  color: #cfd5e2;
  font-family: 'Courier New', monospace;
}

/* ============================================
   PTT SECTION
   ============================================ */

.cb-ptt-section {
  grid-area: ptt;
  display: flex;
  gap: 16px;
  align-items: center;
}

.cb-ptt-button {
  flex: 1;
  padding: 20px;
  background: linear-gradient(145deg, #2b6fff, #1f4fb8);
  border: 3px solid #4080ff;
  border-radius: 12px;
  color: #ffffff;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 6px 20px rgba(43, 111, 255, 0.4), 0 2px 8px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.cb-ptt-button:hover {
  background: linear-gradient(145deg, #4080ff, #2b6fff);
  box-shadow: 0 8px 24px rgba(43, 111, 255, 0.5), 0 2px 8px rgba(0, 0, 0, 0.4);
  transform: translateY(-2px);
}

.cb-ptt-button:active,
.cb-ptt-button.active {
  background: linear-gradient(145deg, #00b894, #00a078);
  border-color: #00d9a8;
  box-shadow: 
    0 0 20px rgba(0, 184, 148, 0.8),
    0 0 40px rgba(0, 184, 148, 0.4),
    inset 0 2px 8px rgba(0, 0, 0, 0.3);
  transform: translateY(0);
}

.cb-ptt-button__icon {
  font-size: 24px;
}

.cb-ptt-button__hotkey {
  font-size: 12px;
  opacity: 0.7;
  font-weight: 400;
}

.cb-mic-meter {
  width: 140px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}

.cb-mic-meter__track {
  width: 100%;
  height: 12px;
  background: #0f1115;
  border: 2px solid #2a3442;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6);
}

.cb-mic-meter__fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #00d084 0%, #f39c12 70%, #ff4d6d 100%);
  transition: width 0.1s ease;
  box-shadow: 0 0 8px rgba(0, 208, 132, 0.6);
}

.cb-mic-meter__label {
  font-size: 10px;
  font-weight: 700;
  color: #8f97a6;
  letter-spacing: 0.5px;
}

/* ============================================
   STATUS TICKER
   ============================================ */

.cb-ticker {
  grid-area: ticker;
  background: #0a0d12;
  border: 2px solid #1e252f;
  border-radius: 8px;
  padding: 8px 12px;
  overflow: hidden;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6);
}

.cb-ticker__content {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 12px;
  color: #aab0bd;
  animation: tickerScroll 20s linear infinite;
}

.cb-ticker__content:hover {
  animation-play-state: paused;
}

@keyframes tickerScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-20%); }
}

.cb-ticker__item {
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cb-ticker__separator {
  color: #4a5562;
}

/* ============================================
   SETTINGS TOGGLE
   ============================================ */

.cb-settings-toggle {
  grid-area: settings;
  background: linear-gradient(145deg, #2a3442, #1e252f);
  border: 2px solid #3a4552;
  color: #e7e9ee;
  padding: 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.cb-settings-toggle:hover {
  background: linear-gradient(145deg, #3a4552, #2e3542);
  border-color: #4a5562;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.cb-settings-toggle[aria-expanded="true"] {
  background: linear-gradient(145deg, #1f4fb8, #1a3f8f);
  border-color: #2b6fff;
}

.cb-settings-toggle__icon {
  font-size: 18px;
}

/* ============================================
   SPEAKER GRILLE (decorative)
   ============================================ */

.cb-speaker-grille {
  grid-area: grille;
  height: 60px;
  background: linear-gradient(135deg, #0a0d12, #12151c);
  border: 2px solid #1e252f;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.7);
  position: relative;
  margin-top: 8px;
}

.cb-speaker-grille__pattern {
  width: 100%;
  height: 100%;
  background-image: 
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent 6px,
      #1e252f 6px,
      #1e252f 8px
    ),
    repeating-linear-gradient(
      0deg,
      transparent 0,
      transparent 6px,
      #1e252f 6px,
      #1e252f 8px
    );
  opacity: 0.4;
}

/* ============================================
   FOLD-DOWN SETTINGS PANEL
   ============================================ */

.cb-settings-panel {
  max-width: 900px;
  margin: 0 auto 20px;
  background: linear-gradient(145deg, #171a21, #0f1218);
  border: 3px solid #2a3442;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  max-height: 0;
  opacity: 0;
  transform: scaleY(0);
  transform-origin: top;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.cb-settings-panel[aria-hidden="false"] {
  max-height: min(900px, 88vh);
  opacity: 1;
  transform: scaleY(1);
  overflow-y: auto;
}

.cb-settings-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: linear-gradient(135deg, #1e252f, #151a23);
  border-bottom: 2px solid #2a3442;
}

.cb-settings-panel__title {
  font-size: 18px;
  font-weight: 700;
  color: #e7e9ee;
  margin: 0;
}

.cb-settings-panel__close {
  background: transparent;
  border: none;
  color: #aab0bd;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.cb-settings-panel__close:hover {
  background: rgba(255, 77, 109, 0.1);
  color: #ff4d6d;
}

/* Settings Tabs */
.cb-settings-tabs {
  display: flex;
  background: #12151c;
  border-bottom: 2px solid #1e252f;
  overflow-x: auto;
}

.cb-settings-tab {
  flex: 1;
  min-width: 100px;
  padding: 12px 16px;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: #8f97a6;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cb-settings-tab:hover {
  background: rgba(43, 111, 255, 0.05);
  color: #aab0bd;
}

.cb-settings-tab.active {
  color: #2b6fff;
  border-bottom-color: #2b6fff;
  background: rgba(43, 111, 255, 0.08);
}

/* Tab Content */
.cb-settings-content {
  padding: 24px;
}

.cb-settings-tabpanel {
  display: none;
}

.cb-settings-tabpanel.active {
  display: block;
}

.cb-settings-tabpanel h3 {
  font-size: 14px;
  font-weight: 700;
  color: #cfd5e2;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 16px 0 12px;
  border-bottom: 1px solid #1e252f;
  padding-bottom: 8px;
}

.cb-settings-tabpanel h3:first-child {
  margin-top: 0;
}

/* Settings Form Elements */
.cb-settings-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.cb-auth-actions {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
}

.cb-auth-actions .cb-btn {
  flex: 1 1 140px;
}

.cb-auth-profile-grid {
  margin-bottom: 8px;
}

.cb-settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.cb-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #aab0bd;
}

.cb-input,
.cb-select {
  padding: 10px 12px;
  background: #0f1115;
  border: 2px solid #2a3442;
  border-radius: 6px;
  color: #e7e9ee;
  font-size: 14px;
  font-family: var(--font-ui);
  transition: all 0.2s ease;
}

.cb-input:focus,
.cb-select:focus {
  outline: none;
  border-color: #2b6fff;
  box-shadow: 0 0 0 3px rgba(43, 111, 255, 0.2);
}

.cb-input--small {
  padding: 8px 10px;
  font-size: 13px;
}

.cb-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #aab0bd;
  cursor: pointer;
  padding: 8px 0;
}

.cb-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.cb-range {
  width: 100%;
  height: 6px;
  background: #0f1115;
  border-radius: 3px;
  outline: none;
  -webkit-appearance: none;
}

.cb-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: linear-gradient(145deg, #2b6fff, #1f4fb8);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.cb-range::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: linear-gradient(145deg, #2b6fff, #1f4fb8);
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.cb-range-value {
  font-size: 12px;
  color: #cfd5e2;
  font-weight: 600;
  margin-left: 8px;
  font-family: 'Courier New', monospace;
}

/* Buttons */
.cb-btn {
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 2px solid transparent;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cb-btn--primary {
  background: linear-gradient(145deg, #2b6fff, #1f4fb8);
  color: #ffffff;
  border-color: #4080ff;
  box-shadow: 0 4px 12px rgba(43, 111, 255, 0.3);
}

.cb-btn--primary:hover {
  background: linear-gradient(145deg, #4080ff, #2b6fff);
  box-shadow: 0 6px 16px rgba(43, 111, 255, 0.4);
  transform: translateY(-1px);
}

.cb-btn--secondary {
  background: linear-gradient(145deg, #2a3442, #1e252f);
  color: #e7e9ee;
  border-color: #3a4552;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.cb-btn--secondary:hover {
  background: linear-gradient(145deg, #3a4552, #2e3542);
  border-color: #4a5562;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

/* Info Display */
.cb-info-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.cb-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #0a0d12;
  border-radius: 6px;
  font-size: 13px;
}

.cb-info-label {
  color: #8f97a6;
  font-weight: 600;
}

.cb-info-value {
  color: #cfd5e2;
  font-family: 'Courier New', monospace;
}

.cb-location-display {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: #0a0d12;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
}

.cb-location-badge {
  padding: 4px 8px;
  background: rgba(43, 111, 255, 0.2);
  border: 1px solid rgba(43, 111, 255, 0.4);
  border-radius: 4px;
  color: #4080ff;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cb-station-readout {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px;
  background: #0a0d12;
  border-radius: 8px;
  font-size: 12px;
  color: #aab0bd;
  margin-bottom: 16px;
}

.cb-station-readout span {
  font-family: 'Courier New', monospace;
}

.cb-badge {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cb-badge--danger {
  background: rgba(255, 77, 109, 0.2);
  border: 1px solid rgba(255, 77, 109, 0.4);
  color: #ff4d6d;
}

.cb-activity-list,
.cb-presence-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cb-activity-list li,
.cb-presence-list li {
  padding: 8px 12px;
  background: #0a0d12;
  border-radius: 6px;
  font-size: 12px;
  color: #aab0bd;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cb-status-text {
  padding: 8px 12px;
  background: #0a0d12;
  border-radius: 6px;
  font-size: 12px;
  color: #aab0bd;
  margin-top: 8px;
}

.cb-status-text--warning {
  background: rgba(120, 78, 10, 0.22);
  border: 1px solid rgba(255, 180, 65, 0.45);
  color: #ffd89a;
}

.cb-hotkey-controls {
  display: flex;
  gap: 8px;
}

.cb-log {
  background: #0a0d12;
  border: 2px solid #1e252f;
  border-radius: 6px;
  padding: 12px;
  font-size: 11px;
  color: #8f97a6;
  max-height: 200px;
  overflow-y: auto;
  font-family: var(--font-mono);
  white-space: pre-wrap;
  word-wrap: break-word;
}

.cb-rx-metadata {
  padding: 12px;
  background: #0a0d12;
  border-radius: 6px;
  font-size: 12px;
  color: #aab0bd;
  min-height: 40px;
  margin-bottom: 16px;
}

/* ============================================
   OVERLAYS & INDICATORS
   ============================================ */

.cb-tx-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 16px; box-sizing: border-box;
  background: var(--tx-overlay-bg);
  border-bottom: 3px solid var(--tx-overlay-border);
  color: var(--tx-overlay-text);
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(0, 184, 148, 0.3);
}

.cb-collision {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 20px;
  background: var(--danger-soft);
  border: 2px solid var(--danger-border);
  border-radius: 8px;
  color: var(--danger);
  font-size: 14px;
  font-weight: 700;
  z-index: 999;
  box-shadow: 0 4px 16px rgba(255, 77, 109, 0.4);
  display: flex;
  align-items: center;
  gap: 8px;
}

.cb-collision__overflow {
  padding: 2px 6px;
  background: var(--danger);
  color: #ffffff;
  border-radius: 4px;
  font-size: 11px;
}

.cb-qrm {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 12px 16px;
  background: var(--warning-soft);
  border: 2px solid var(--warning-border);
  border-radius: 8px;
  color: var(--warning);
  font-size: 13px;
  font-weight: 600;
  z-index: 999;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(243, 156, 18, 0.4);
}

.cb-qrm__label {
  font-weight: 700;
}

.cb-qrm__bars {
  display: flex;
  gap: 4px;
  align-items: flex-end;
  height: 20px;
}

/* ============================================
   RESPONSIVE - MOBILE/WALKIE-TALKIE MODE
   ============================================ */

/* Compact desktop mode for shorter viewports (fit full faceplate without browser zoom) */
@media (max-height: 980px) and (min-width: 769px) {
  .cb-faceplate {
    margin: 8px auto;
    padding: 16px; box-sizing: border-box;
    gap: 10px;
    max-width: 860px;
  }

  .cb-brand__name {
    font-size: 16px;
  }

  .cb-channel-section {
    gap: 10px;
  }

  .cb-presets {
    gap: 6px;
  }

  .cb-preset-btn {
    min-width: 54px;
    padding: 6px 10px;
  }

  .cb-preset-btn__ch {
    font-size: 18px;
  }

  .cb-channel-display {
    padding: 12px;
  }

  .cb-channel-display__controls {
    gap: 8px;
  }

  .cb-channel-step {
    padding: 9px 12px;
    font-size: 16px;
  }

  .cb-channel-display__digits {
    font-size: 48px;
    min-width: 82px;
    letter-spacing: 3px;
  }

  .cb-channel-input {
    width: 58px;
    font-size: 16px;
    padding: 6px;
  }

  .cb-meter {
    padding: 12px;
  }

  .cb-meter__svg {
    max-width: 340px;
  }

  .cb-meter__readout {
    margin-top: 8px;
    font-size: 16px;
  }

  .cb-controls {
    gap: 16px;
    padding: 8px 0;
  }

  .cb-knob {
    width: 68px;
    height: 68px;
  }

  .cb-knob-value {
    font-size: 12px;
  }

  .cb-ptt-section {
    gap: 10px;
  }

  .cb-ptt-button {
    padding: 14px;
    font-size: 16px;
    gap: 8px;
  }

  .cb-ptt-button__icon {
    font-size: 20px;
  }

  .cb-mic-meter {
    width: 120px;
  }

  .cb-ticker {
    padding: 6px 10px;
  }

  .cb-settings-toggle {
    padding: 10px;
    font-size: 13px;
  }

  .cb-speaker-grille {
    height: 44px;
    margin-top: 4px;
  }
}

@media (max-height: 860px) and (min-width: 769px) {
  .cb-faceplate {
    padding: 12px;
    gap: 8px;
    max-width: 820px;
  }

  .cb-channel-display {
    padding: 10px;
  }

  .cb-channel-display__digits {
    font-size: 42px;
    min-width: 74px;
    letter-spacing: 2px;
  }

  .cb-meter__svg {
    max-width: 300px;
  }

  .cb-controls {
    gap: 12px;
    padding: 6px 0;
  }

  .cb-knob {
    width: 62px;
    height: 62px;
  }

  .cb-ptt-button {
    padding: 12px;
    font-size: 14px;
  }

  .cb-speaker-grille {
    height: 38px;
  }
}

@media (max-width: 768px) {
  .cb-faceplate {
    margin: 0; width: 100%; box-sizing: border-box; border-radius: 0; border-left: none; border-right: none;
    padding: 16px; box-sizing: border-box;
    grid-template-areas:
      "brand"
      "lamps"
      "channel"
      "meter"
      "knobs"
      "ptt"
      "ticker"
      "settings"
      "grille";
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .cb-brand {
    justify-content: center;
    text-align: center;
  }

  .cb-lamps {
    justify-content: center;
  }

  .cb-presets {
    justify-content: center;
  }

  .cb-channel-display__digits {
    font-size: 48px;
  }

  .cb-channel-input {
    position: static;
    width: 100%;
    margin-top: 8px;
  }

  .cb-controls {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-evenly;
    gap: 12px;
  }

  .cb-knob-group {
    flex-direction: column;
    width: auto;
    justify-content: center;
    align-items: center;
  }

  .cb-knob {
    width: 70px;
    height: 70px;
  }

  .cb-ptt-section {
    flex-direction: column;
  }

  .cb-mic-meter {
    width: 100%;
  }

  .cb-settings-tabs {
    flex-wrap: wrap;
  }

  .cb-settings-tab {
    min-width: 80px;
    font-size: 11px;
    padding: 10px 12px;
  }

  .cb-settings-content {
    padding: 16px; box-sizing: border-box;
  }

  .cb-settings-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .cb-faceplate {
    padding: 12px;
    margin: 0; width: 100%; box-sizing: border-box; border-radius: 0; border-left: none; border-right: none;
  }

  .cb-channel-display__digits {
    font-size: 40px;
  }

  .cb-preset-btn {
    min-width: 50px;
    padding: 6px 10px;
  }

  .cb-preset-btn__ch {
    font-size: 18px;
  }

  .cb-knob {
    width: 60px;
    height: 60px;
  }

  .cb-ptt-button {
    padding: 16px; box-sizing: border-box;
    font-size: 16px;
  }
}


html, body { overflow-x: hidden; position: relative; width: 100%; max-width: 100vw; }
