:root {
	--bg-dark: #121212;
	--bg-panel: #1e1e1e;
	--bg-header: #2c2c2c;
	--text-main: #e0e0e0;
	--text-muted: #888888;
	--accent: #3a86ff;
	--accent-hover: #5396ff;
	--border: #333333;
	--btn-bg: #2a2a2a;
	--btn-hover: #3a3a3a;
}

* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

[v-cloak] {
	display: none;
}

body {
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
	background-color: var(--bg-dark);
	color: var(--text-main);
	overflow: hidden;
	height: 100vh;
	display: flex;
}

#app {
	display: flex;
	flex-direction: column;
	width: 100%;
	height: 100%;
}

.top-bar {
	display: flex;
	align-items: center;
	height: 50px;
	background-color: var(--bg-header);
	border-bottom: 1px solid var(--border);
	padding: 0 16px;
	flex-shrink: 0;
}

.brand {
	font-weight: 600;
	font-size: 16px;
	margin-right: 32px;
	color: #fff;
}

.vfo-displays {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-right: auto;
	overflow-x: auto;
	flex-shrink: 1;
	min-width: 0;
}

.vfo-display {
	display: flex;
	align-items: baseline;
	background: #000;
	padding: 4px 12px;
	border-radius: 4px;
	border: 2px solid #444;
	cursor: pointer;
	transition: border-color 0.15s;
}

.vfo-display.vfo-active {
	border-color: #aaa;
}

.vfo-label {
	font-size: 11px;
	font-weight: 600;
	margin-right: 6px;
	padding: 1px 5px;
	border-radius: 3px;
	align-self: center;
	color: #fff;
}

.vfo-dot {
	display: inline-block;
	width: 8px;
	height: 8px;
	border-radius: 50%;
}

.vfo-remove-btn {
	background: transparent;
	border: 1px solid #555;
	color: #aaa;
	width: 18px;
	height: 18px;
	border-radius: 3px;
	cursor: pointer;
	font-size: 14px;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	transition: all 0.15s;
}
.vfo-remove-btn:hover {
	background: #ff4444;
	border-color: #ff4444;
	color: #fff;
}

.vfo-freq-input {
	font-family: 'Roboto Mono', monospace;
	font-size: 20px;
	font-weight: bold;
	color: #e0e0e0;
	letter-spacing: 2px;
	background: transparent;
	border: none;
	outline: none;
	text-align: right;
	width: 140px;
}
.vfo-freq-input:focus {
	color: #00ffea;
}

.vfo-unit {
	margin-left: 8px;
	font-size: 14px;
	color: #aaa;
}

.icon-btn {
	background: transparent;
	border: 1px solid transparent;
	color: var(--text-main);
	cursor: pointer;
	padding: 4px;
	border-radius: 4px;
	display: flex;
	align-items: center;
	justify-content: center;
}
.icon-btn:hover:not(:disabled) {
	background: var(--btn-hover);
}
.icon-btn.active {
	color: #ff3a3a;
}
.icon-btn:disabled {
	opacity: 0.3;
	cursor: not-allowed;
}
.github-link {
	text-decoration: none;
	margin-right: 6px;
	color: var(--text-dim);
}
.github-link:hover {
	color: var(--text-main);
}

.top-controls {
	display: flex;
	align-items: center;
	gap: 4px;
}

.main-layout {
	display: flex;
	flex: 1;
	overflow: hidden;
}

.sidebar {
	width: 260px;
	background-color: var(--bg-panel);
	border-right: 1px solid var(--border);
	display: flex;
	flex-direction: column;
	overflow-y: auto;
}

.panel {
	border-bottom: 1px solid var(--border);
}
.panel.disabled {
	opacity: 0.5;
	pointer-events: none;
}

.panel-header {
	background-color: #252525;
	padding: 6px 12px;
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	color: #aaa;
	border-bottom: 1px solid var(--border);
}

.panel-body {
	padding: 12px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}
.panel-condensed {
	gap: 8px;
	padding: 8px 12px;
}

.form-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
}
.form-row.info-row {
	justify-content: flex-start;
	color: var(--text-muted);
}
.form-row label {
	font-size: 13px;
	flex: 1;
}

.input-group {
	display: flex;
	align-items: center;
	background: #000;
	border: 1px solid var(--border);
	border-radius: 4px;
	padding: 0 8px;
	width: 140px;
	box-sizing: border-box;
}
.input-group input {
	flex: 1;
	width: 100%;
	background: transparent;
	border: none;
	color: var(--text-main);
	font-family: 'Roboto Mono', monospace;
	font-size: 13px;
	padding: 6px 0;
	outline: none;
	text-align: right;
}
.input-group span {
	font-size: 11px;
	color: var(--text-muted);
	margin-left: 6px;
}

select {
	background: #000;
	border: 1px solid var(--border);
	color: var(--text-main);
	padding: 4px 8px;
	border-radius: 4px;
	width: 140px;
	font-size: 13px;
	outline: none;
}

.slider-group {
	display: flex;
	align-items: center;
	width: 140px;
	gap: 8px;
}
.slider-group input[type=range] {
	flex: 1;
	width: 100%;
}
.slider-group .val {
	font-size: 12px;
	font-family: 'Roboto Mono', monospace;
	width: 38px;
	text-align: right;
	color: var(--text-muted);
}

.checkbox {
	display: flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
}

.btn {
	background-color: var(--btn-bg);
	border: 1px solid var(--border);
	color: var(--text-main);
	padding: 6px 12px;
	font-size: 13px;
	border-radius: 4px;
	cursor: pointer;
	flex: 1;
	text-align: center;
	transition: background 0.2s;
}
.btn:hover:not(:disabled) {
	background-color: var(--btn-hover);
}
.btn-primary {
	background-color: var(--accent);
	border-color: var(--accent);
	color: #fff;
}
.btn-primary:hover:not(:disabled) {
	background-color: var(--accent-hover);
}

/* SDR++ Custom Controls */
.mode-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 6px;
	margin-bottom: 4px;
}
.mode-radio {
	display: flex;
	align-items: center;
	gap: 4px;
	cursor: pointer;
}
.mode-radio input[type="radio"] {
	display: none;
}
.mode-btn {
	font-size: 11px;
	font-weight: 600;
	color: var(--text-main);
	display: flex;
	align-items: center;
}
.mode-btn::before {
	content: '';
	display: inline-block;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background-color: #2a2a2a;
	margin-right: 4px;
	border: 1px solid #1a1a1a;
	box-shadow: inset 0 1px 3px rgba(0,0,0,0.5);
}
.mode-radio input[type="radio"]:checked + .mode-btn::before {
	background-color: var(--accent);
	box-shadow: inset 0 1px 2px rgba(0,0,0,0.3);
	border-color: var(--accent-hover);
}

.spin-group {
	display: flex;
	background: #1e1e1e;
	border: 1px solid var(--border);
	border-radius: 2px;
	height: 24px;
	width: 130px;
	margin-left: auto;
}
.spin-group input {
	flex: 1;
	background: transparent;
	border: none;
	color: var(--text-main);
	font-family: 'Roboto Mono', monospace;
	font-size: 13px;
	padding: 0 4px;
	text-align: right;
	outline: none;
	width: 0; /* Let flex handle width */
}
.spin-group input::-webkit-outer-spin-button,
.spin-group input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}
.spin-group button {
	background: #2a2a2a;
	border: none;
	border-left: 1px solid var(--border);
	color: var(--text-muted);
	width: 20px;
	cursor: pointer;
	font-weight: bold;
	display: flex;
	align-items: center;
	justify-content: center;
}
.spin-group button:hover {
	background: #3a3a3a;
	color: var(--text-main);
}
.spin-group button:active {
	background: #1a1a1a;
}

.custom-checkbox {
	display: flex;
	align-items: center;
	cursor: pointer;
	font-size: 13px;
	font-weight: 600;
	user-select: none;
}
.custom-checkbox input {
	position: absolute;
	opacity: 0;
	cursor: pointer;
	height: 0;
	width: 0;
}
.checkmark {
	height: 16px;
	width: 16px;
	background-color: #2a2a2a;
	border: 1px solid #1a1a1a;
	border-radius: 2px;
	margin-right: 8px;
	box-shadow: inset 0 1px 3px rgba(0,0,0,0.5);
	position: relative;
}
.custom-checkbox:hover input ~ .checkmark {
	background-color: #333;
}
.custom-checkbox input:checked ~ .checkmark {
	background-color: var(--bg-panel); /* SDR++ uses dark background even when checked */
}
.checkmark:after {
	content: "";
	position: absolute;
	display: none;
}
.custom-checkbox input:checked ~ .checkmark:after {
	display: block;
}
/* The blue checkmark shape (SDR++ style checkmark inside dark box) */
.custom-checkbox .checkmark:after {
	left: 5px;
	top: 1px;
	width: 4px;
	height: 9px;
	border: solid var(--accent);
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

.header-checkbox .checkmark {
	margin-right: 0;
}
.header-checkbox input:disabled ~ .checkmark {
	opacity: 0.5;
	cursor: not-allowed;
}
.header-checkbox input:disabled ~ .checkmark:after {
	border-color: #555;
}

.squelch-row, .full-checkbox-row {
	margin-top: 2px;
}
.full-checkbox-row .custom-checkbox {
	color: #ccc;
}
.compact-slider {
	width: 130px;
}
.compact-slider .val {
	width: 65px;
}


.workspace {
	flex: 1;
	display: flex;
	flex-direction: column;
	position: relative;
	background: #000;
}

.fft-container {
	height: 40%;
	position: relative;
	border-bottom: 1px solid var(--border);
}
.waterfall-container {
	height: 60%;
	position: relative;
}

canvas {
	width: 100%;
	height: 100%;
	display: block;
}

.freq-axis {
	position: absolute;
	bottom: 0;
	left: 0;
	width: 100%;
	height: 20px;
	pointer-events: none;
}
.tick {
	position: absolute;
	bottom: 2px;
	font-size: 11px;
	color: rgba(255,255,255,0.6);
	transform: translateX(-50%);
	font-family: 'Roboto Mono', monospace;
}
.tick:first-child { transform: none; }
.tick:last-child { transform: translateX(-100%); }

.hover-tick {
	position: absolute;
	top: 10px;
	background: rgba(0,0,0,0.8);
	border: 1px solid var(--border);
	padding: 2px 6px;
	border-radius: 4px;
	font-size: 12px;
	font-family: 'Roboto Mono', monospace;
	transform: translateX(-50%);
	pointer-events: none;
	color: #00ffea;
}

.dsp-stats-overlay {
	position: absolute;
	top: 8px;
	right: 8px;
	background: rgba(0, 0, 0, 0.85);
	border: 1px solid var(--border);
	border-radius: 6px;
	padding: 8px 12px;
	font-size: 11px;
	font-family: 'Roboto Mono', monospace;
	color: #ccc;
	line-height: 1.6;
	pointer-events: none;
	z-index: 50;
	white-space: nowrap;
}
.dsp-stats-overlay b {
	color: #00ffea;
}

.snackbar {
	position: fixed;
	bottom: -50px;
	left: 50%;
	transform: translateX(-50%);
	background: #323232;
	color: #fff;
	padding: 12px 24px;
	border-radius: 4px;
	font-size: 14px;
	transition: bottom 0.3s ease;
	z-index: 1000;
	box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}
.snackbar.show {
	bottom: 24px;
}

/* ────── Transcript / Whisper Panel ────── */
.transcript-panel {
	flex-shrink: 0;
	display: flex;
	flex-direction: column;
	height: 200px;
	min-height: 100px;
	border-top: 2px solid var(--accent);
	background: var(--bg-panel);
}

.transcript-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 6px 12px;
	background: #252525;
	border-bottom: 1px solid var(--border);
	flex-shrink: 0;
}

.transcript-title {
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	color: #aaa;
	display: flex;
	align-items: center;
	gap: 6px;
}

.transcript-badge {
	font-size: 10px;
	padding: 1px 6px;
	border-radius: 8px;
	background: #2e7d32;
	color: #fff;
	font-weight: 600;
	text-transform: none;
}
.transcript-badge.loading {
	background: #e65100;
}
.transcript-badge.error {
	background: #c62828;
}
.transcript-badge.recording {
	background: #c62828;
	animation: pulse-rec 1s ease-in-out infinite;
}
.transcript-badge.transcribing {
	background: #1565c0;
	animation: pulse-rec 1.2s ease-in-out infinite;
}

@keyframes pulse-rec {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.5; }
}

.transcript-controls {
	display: flex;
	align-items: center;
	gap: 6px;
}

.transcript-select {
	background: #000;
	border: 1px solid var(--border);
	color: var(--text-main);
	padding: 2px 6px;
	border-radius: 4px;
	font-size: 11px;
	outline: none;
}

.transcript-btn {
	padding: 2px 10px;
	font-size: 11px;
	flex: none;
}

.btn-stop {
	background: #c62828;
	border-color: #c62828;
	color: #fff;
}
.btn-stop:hover:not(:disabled) {
	background: #e53935;
}

.transcript-body {
	flex: 1;
	overflow-y: auto;
	padding: 8px 12px;
	font-family: 'Roboto Mono', monospace;
	font-size: 12px;
	line-height: 1.7;
}

.transcript-empty {
	color: var(--text-muted);
	font-style: italic;
	font-family: 'Inter', sans-serif;
	font-size: 13px;
	padding: 12px 0;
}

.transcript-entry {
	display: flex;
	gap: 8px;
	align-items: baseline;
}

.transcript-time {
	color: var(--text-muted);
	flex-shrink: 0;
}

.transcript-freq {
	color: var(--accent);
	flex-shrink: 0;
	font-size: 11px;
}

.transcript-duration {
	color: var(--text-muted);
	flex-shrink: 0;
	font-size: 11px;
}

.transcript-text {
	color: #e0e0e0;
}