:root {
  --bg: #0e1116;
  --panel: #161b23;
  --panel-2: #1c2330;
  --border: #2a3342;
  --text: #e6e9ef;
  --muted: #8a93a6;
  --accent: #f5a623;      /* karaoke fill */
  --accent-2: #4da3ff;
  --done: #6f7a8f;
  --err: #ff6b6b;
  --ok: #43d17a;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "Inter", "Noto Sans", "Noto Sans Devanagari", system-ui, sans-serif;
  min-height: 100vh; display: flex; flex-direction: column;
}
header {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 18px 28px 10px;
}
h1 { font-size: 18px; font-weight: 600; margin: 0; letter-spacing: .2px; }
.accent { color: var(--accent); }
.health { font-size: 12px; color: var(--muted); }
.health.ok { color: var(--ok); }
.health.err { color: var(--err); }

main { flex: 1; padding: 8px 28px 24px; max-width: 1100px; width: 100%; margin: 0 auto; }
.panel {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 10px; padding: 16px 18px; margin-bottom: 16px;
}
.row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.row:last-child { margin-bottom: 0; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 180px; }
.field.grow { flex: 1; }
label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
.hint { font-size: 11px; color: var(--muted); text-transform: none; letter-spacing: 0; }

select, textarea, button {
  font: inherit; color: var(--text); background: var(--panel-2);
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px;
}
textarea { resize: vertical; line-height: 1.6; font-size: 15px; }
select:focus, textarea:focus { outline: 1px solid var(--accent-2); }

.drop {
  position: relative; border: 1.5px dashed var(--border); border-radius: 8px;
  padding: 18px 12px; text-align: center; color: var(--muted);
  background: var(--panel-2); transition: border-color .15s, color .15s;
}
.drop.armed { border-color: var(--accent-2); color: var(--text); }
.drop.has-file { border-style: solid; border-color: var(--ok); color: var(--text); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.actions { align-items: center; }
#alignBtn {
  background: var(--accent-2); border: none; color: #08111f;
  font-weight: 700; padding: 10px 26px; border-radius: 8px; cursor: pointer;
}
#alignBtn:disabled { opacity: .35; cursor: not-allowed; }
button.ghost {
  background: transparent; color: var(--muted); border: 1px solid var(--border);
  padding: 4px 12px; font-size: 12px; cursor: pointer; border-radius: 6px;
}
button.ghost:hover { color: var(--text); border-color: var(--accent-2); }

.status { font-size: 13px; color: var(--muted); }
.status.err { color: var(--err); }
.status.busy::before {
  content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 8px;
  border: 2px solid var(--accent-2); border-top-color: transparent; border-radius: 50%;
  animation: spin .8s linear infinite; vertical-align: -1px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.player audio { width: 100%; }
.meta { margin-top: 8px; font-size: 12px; color: var(--muted); }

.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.panel-head h2 { font-size: 13px; margin: 0; color: var(--muted); text-transform: uppercase; letter-spacing: .8px; }
.panel-tools { display: flex; gap: 8px; }

.karaoke {
  font-size: 30px; line-height: 2.1; font-weight: 500;
  max-height: 46vh; overflow-y: auto; padding: 6px 2px;
  scroll-behavior: smooth;
}
.karaoke .w {
  display: inline-block; margin-right: .45em; cursor: pointer;
  color: var(--muted); transition: color .12s;
  border-radius: 6px; padding: 0 2px;
}
.karaoke .w:hover { color: var(--accent-2); }
.karaoke .w.done { color: var(--done); }
.karaoke .w.current {
  color: transparent;
  background-image: linear-gradient(90deg,
    var(--accent) calc(var(--p) * 100%), var(--muted) calc(var(--p) * 100%));
  -webkit-background-clip: text; background-clip: text;
  transform: scale(1.06); transform-origin: bottom left;
}

.table-wrap { max-height: 40vh; overflow-y: auto; margin-top: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 5px 10px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 500; position: sticky; top: 0; background: var(--panel); }
tbody tr { cursor: pointer; }
tbody tr:hover { background: var(--panel-2); }
tbody tr.current { background: rgba(245, 166, 35, .12); }
td.num { font-variant-numeric: tabular-nums; }

footer { padding: 10px 28px 18px; font-size: 11px; color: var(--muted); }
