@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");

:root {
--bg: #f5f6fa;
--surface: #ffffff;
--surface-alt: #f0f2f8;
--border: #e2e6f0;
--fg: #1a1d2e;
--muted: #6b7280;
--accent: #4f46e5;
--accent-light: #ede9fe;
--color-primary-dark: #0f172a;
--color-secondary-dark: #1e293b;
--color-secondary-dark2: #133458;
--ok: #16a34a;
--warn: #d97706;
--progress-bg: #e5e7eb;
--progress-fill: #4f46e5;
--shadow: 0 1px 4px rgba(0, 0, 0, 0.07), 0 4px 16px rgba(0, 0, 0, 0.06);
}

* {
  box-sizing: border-box;
  }

body {
margin: 0;
font-family:
"Inter",
system-ui,
-apple-system,
Segoe UI,
sans-serif;
color: var(--fg);
background: var(--bg);
min-height: 100vh;
}

/* ===== UPLOAD HERO (shown always) ===== */
.upload-hero {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
min-height: 100vh;
padding: 24px;
text-align: center;
transition: min-height 0.4s ease;
}

.upload-hero.compact {
min-height: unset;
padding: 28px 24px 12px;
border-bottom: 1px solid var(--border);
background: var(--surface);
}

.upload-hero h1 {
margin: 0 0 6px;
font-size: 26px;
font-weight: 700;
letter-spacing: -0.3px;
color: var(--fg);
}

.upload-hero p.lead {
margin: 0 0 28px;
color: var(--muted);
font-size: 14px;
}

/* Drop zone */
.drop-zone {
display: flex;
flex-direction: column;
align-items: center;
gap: 12px;
border: 2px dashed var(--border);
border-radius: 16px;
padding: 40px 48px;
background: var(--surface);
transition:
border-color 0.2s,
background 0.2s;
cursor: pointer;
max-width: 420px;
width: 100%;
}

.drop-zone:hover,
.drop-zone.drag-over {
border-color: var(--color-secondary-dark);
background: var(--color-secondary-dark2);
color: #e2e6f0;
}

.drop-zone .icon {
font-size: 36px;
line-height: 1;
}

.drop-zone .hint {
font-size: 13px;
color: var(--muted);
}

/* Compact row (after upload) */
.upload-row {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 10px;
max-width: 1100px;
margin: 0 auto;
padding: 4px 0;
}

/* ===== BUTTONS ===== */
.btn {
display: inline-flex;
align-items: center;
gap: 6px;
background: var(--surface);
color: var(--fg);
border: 1px solid var(--border);
border-radius: 8px;
padding: 8px 14px;
font-size: 13px;
font-weight: 500;
font-family: inherit;
cursor: pointer;
transition:
background 0.15s,
border-color 0.15s,
transform 0.05s;
white-space: nowrap;
}

label.btn,
button.btn {
display: inline-flex;
align-items: center;
gap: 6px;
background: var(--surface);
color: var(--fg);
border: 1px solid var(--border);
border-radius: 8px;
padding: 8px 14px;
font-size: 13px;
font-weight: 500;
font-family: inherit;
cursor: pointer;
transition:
background 0.15s,
border-color 0.15s,
transform 0.05s;
white-space: nowrap;
}

button.btn:hover,
label.btn:hover {
background: var(--surface-alt);
border-color: #c7cde0;
}

button.btn:active {
transform: translateY(1px);
}

button.btn:disabled {
opacity: 0.45;
cursor: not-allowed;
}

/* Primary CTA */
.btn-primary {
background: var(--accent);
color: #fff;
border-color: var(--accent);
}

.btn-primary:hover {
background: #133458 !important; 
border-color: #133458 !important;
color: #f0f2f8;
}

/* File input hidden */
input[type="file"] {
display: none;
}

/* ===== STATUS ===== */
.status {
min-height: 22px;
color: var(--muted);
font-size: 13px;
}

/* ===== MAIN CONTENT ===== */
#appContent {
display: none;
max-width: 1100px;
margin: 0 auto 56px;
padding: 20px 16px;
display: none;
grid-template-columns: 1fr;
gap: 16px;
}

#appContent.visible {
display: grid;
}

/* ===== CARDS ===== */
.card {
background: var(--surface);
border: 1px solid var(--border);
border-radius: 14px;
padding: 18px 20px;
box-shadow: var(--shadow);
}

/* ===== CONTROLS GRID ===== */
.controls {
display: grid;
grid-template-columns: repeat(6, minmax(0, 1fr));
gap: 8px;
margin-top: 14px;
}

.ctrl {
background: var(--surface-alt);
border: 1px solid var(--border);
border-radius: 10px;
padding: 10px;
display: grid;
gap: 5px;
}

.ctrl label {
font-size: 11px;
font-weight: 500;
color: var(--muted);
text-transform: uppercase;
letter-spacing: 0.05em;
}

.ctrl input[type="number"] {
width: 100%;
background: var(--surface);
color: var(--fg);
border: 1px solid var(--border);
border-radius: 6px;
padding: 5px 8px;
font-size: 13px;
font-family: inherit;
}

.ctrl input[type="checkbox"] {
transform: translateY(1px);
accent-color: var(--accent);
}

/* ===== METRICS ===== */
.metrics {
display: grid;
grid-template-columns: repeat(5, minmax(0, 1fr));
gap: 10px;
margin-top: 14px;
}

.metric {
background: var(--surface-alt);
border: 1px solid var(--border);
border-radius: 10px;
padding: 12px 14px;
}

.metric .label {
color: var(--muted);
font-size: 11px;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.07em;
}

.metric .value {
font-size: 22px;
font-weight: 700;
margin-top: 5px;
color: var(--color-primary-dark);
}

.metric .sub {
font-size: 11px;
color: var(--muted);
margin-top: 2px;
}

/* ===== CANVAS ===== */
canvas {
width: 100%;
height: 150px;
background: var(--surface-alt);
border: 1px solid var(--border);
border-radius: 8px;
}

/* ===== SMALL TEXT ===== */
.small {
font-size: 12px;
color: var(--muted);
margin-top: 6px;
}

/* ===== RESULTS TABLE ===== */
.results-header {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
margin-bottom: 10px;
}

.progress {
width: 100%;
height: 8px;
background: var(--progress-bg);
border-radius: 8px;
overflow: hidden;
}

.progress .fill {
height: 100%;
width: 0%;
background: linear-gradient(90deg, var(--progress-fill), #7c3aed);
transition: width 220ms linear;
}

table.results {
width: 100%;
border-collapse: collapse;
margin-top: 8px;
font-size: 13px;
}

table.results thead th {
text-align: left;
padding: 8px 12px;
font-size: 11px;
font-weight: 600;
color: var(--muted);
text-transform: uppercase;
letter-spacing: 0.05em;
border-bottom: 1px solid var(--border);
}

table.results tbody td {
padding: 10px 12px;
border-bottom: 1px solid var(--surface-alt);
color: var(--fg);
}

table.results tbody tr:last-child td {
border-bottom: none;
}

table.results tbody tr:hover td {
background: var(--surface-alt);
}

/* ===== FOOTER ===== */
footer {
text-align: center;
color: var(--muted);
padding: 20px;
font-size: 12px;
}

/* ===== AUDIO PLAYER ===== */
audio {
width: 100%;
border-radius: 8px;
background: var(--surface-alt);
border: 1px solid var(--border);
accent-color: var(--accent);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
.controls {
grid-template-columns: repeat(3, minmax(0, 1fr));
}
.metrics {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
}
