:root {
	color-scheme: light;
	--bg: #0b0f1a;
	--card: #151a26;
	--text: #e8ecf3;
	--muted: #9aa3b2;
	--accent: #6aa5ff;
	--accent-2: #5bd9a4;
	--danger: #ff6b6b;
	--border: #242b3a;
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
	background: radial-gradient(circle at top, #141a2a, var(--bg));
	color: var(--text);
}

.app {
	max-width: 980px;
	margin: 40px auto 64px;
	padding: 0 20px;
	display: grid;
	gap: 18px;
}

.app-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
}

.app-header h1 {
	margin: 0 0 4px;
	font-size: 28px;
}

.app-header p {
	margin: 0;
	color: var(--muted);
}

.status {
	padding: 8px 14px;
	border-radius: 999px;
	background: rgba(106, 165, 255, 0.15);
	color: var(--accent);
	font-weight: 600;
	font-size: 13px;
	border: 1px solid rgba(106, 165, 255, 0.35);
}

.status.error {
	background: rgba(255, 107, 107, 0.2);
	color: var(--danger);
	border-color: rgba(255, 107, 107, 0.4);
}

.status.ok {
	background: rgba(91, 217, 164, 0.2);
	color: var(--accent-2);
	border-color: rgba(91, 217, 164, 0.35);
}

.card {
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: 16px;
	padding: 18px;
	box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}

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

.row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
}

label {
	font-weight: 600;
	color: var(--muted);
}

select,
input[type="text"],
input[type="file"] {
	background: #0f1421;
	color: var(--text);
	border: 1px solid var(--border);
	border-radius: 10px;
	padding: 10px 12px;
	font-size: 14px;
	flex: 1 1 auto;
	min-width: 180px;
}

input[type="file"] {
	padding: 8px 12px;
}

button {
	border: none;
	border-radius: 10px;
	padding: 10px 16px;
	font-weight: 600;
	background: var(--accent);
	color: #0b0f1a;
	cursor: pointer;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
	box-shadow: 0 6px 16px rgba(106, 165, 255, 0.35);
}

button:hover {
	transform: translateY(-1px);
}

button:disabled {
	opacity: 0.5;
	cursor: not-allowed;
	box-shadow: none;
}

.hint {
	margin: 10px 0 0;
	color: var(--muted);
	font-size: 13px;
}

.viz-wrapper {
	margin-top: 14px;
}

.file-info {
	margin-top: 8px;
	font-size: 13px;
	color: var(--muted);
}

.toggle {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-top: 10px;
	font-size: 13px;
	color: var(--muted);
}

.toggle input {
	width: 16px;
	height: 16px;
}

.progress-container {
	margin-top: 12px;
}

.progress {
	height: 8px;
	border-radius: 999px;
	background: #0f1421;
	border: 1px solid var(--border);
	overflow: hidden;
}

.progress-bar {
	height: 100%;
	width: 0%;
	background: linear-gradient(90deg, var(--accent), var(--accent-2));
	transition: width 0.15s ease;
}

.progress-info {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-top: 6px;
	font-size: 12px;
	color: var(--muted);
	min-height: 18px;
}

.progress-info:empty {
	display: none;
}

.progress-info .time-left {
	font-weight: 600;
	color: var(--accent);
}

.progress-info .data-info {
	color: var(--muted);
}

.received {
	display: grid;
	gap: 12px;
}

.message {
	padding: 12px;
	border-radius: 12px;
	background: #0f1421;
	border: 1px solid var(--border);
}

.message h3 {
	margin: 0 0 6px;
	font-size: 14px;
	color: var(--muted);
}

.message img,
.message video {
	max-width: 100%;
	border-radius: 10px;
	display: block;
}

.message audio {
	width: 100%;
}

#waveform {
	width: 100%;
	height: 120px;
	background: #0f1421;
	border: 1px dashed var(--border);
	border-radius: 12px;
	opacity: 0.5;
}

/* Error Correction Section */
.ec-card {
	background: linear-gradient(135deg, var(--card) 0%, rgba(106, 165, 255, 0.05) 100%);
}

.ec-stats {
	margin: 12px 0 10px;
	padding: 10px 14px;
	background: #0f1421;
	border: 1px solid var(--border);
	border-radius: 10px;
	font-family: "Consolas", "Monaco", monospace;
	font-size: 12px;
	color: var(--accent);
}

.btn-small {
	padding: 6px 12px;
	font-size: 12px;
	background: rgba(106, 165, 255, 0.2);
	color: var(--accent);
	border: 1px solid rgba(106, 165, 255, 0.3);
}

.btn-small:hover {
	background: rgba(106, 165, 255, 0.3);
}

.ec-card .row {
	gap: 20px;
}

.ec-card .toggle {
	margin-top: 0;
}
