:root {
  --bg: #0f1115;
  --surface: #171a21;
  --surface-2: #1f232c;
  --text: #f0f2f7;
  --muted: #8a92a6;
  --accent: #6ee7b7;
  --yes: #22c55e;
  --maybe: #f59e0b;
  --no: #ef4444;
  --danger: #ef4444;
  --border: #262b36;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.hidden { display: none !important; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(15,17,21,0.92);
  backdrop-filter: blur(6px);
  z-index: 10;
}

.brand {
  font-weight: 600;
  letter-spacing: 0.02em;
  font-size: 14px;
  color: var(--muted);
}

.nav { display: flex; gap: 8px; }

.nav-btn {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
}

.nav-btn:hover { color: var(--text); }

#app {
  max-width: 760px;
  margin: 0 auto;
  padding: 18px 16px 80px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 16px;
}

h1 {
  font-size: 22px;
  margin: 0 0 6px;
}

h3 {
  font-size: 14px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 8px 0 10px;
}

.muted { color: var(--muted); font-size: 14px; }
.small { font-size: 12.5px; }
code {
  background: var(--surface-2);
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 12px;
}
.checkbox-label {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.row.secondary { margin-top: 8px; justify-content: space-between; }

.btn {
  font-family: inherit;
  font-size: 15px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.05s ease, background 0.15s ease;
}
.btn:hover { background: #262b36; }
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--accent); color: #0a1410; border-color: transparent; font-weight: 600; }
.btn.primary:hover { background: #57d4a4; }
.btn.big { padding: 18px; font-size: 18px; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); border-color: rgba(239,68,68,0.4); }

.btn.yes { background: var(--yes); color: #052010; border-color: transparent; font-weight: 700; }
.btn.maybe { background: var(--maybe); color: #2a1700; border-color: transparent; font-weight: 700; }
.btn.no { background: var(--no); color: #2b0606; border-color: transparent; font-weight: 700; }

.file-input {
  display: inline-block;
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  text-align: center;
  cursor: pointer;
  background: var(--surface-2);
  font-size: 15px;
}
.file-input input { display: none; }
.file-input.small { padding: 10px 12px; font-size: 13px; }

.counters {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  font-size: 13px;
  background: var(--surface-2);
  padding: 12px;
  border-radius: 12px;
}
.counters .cell { display: flex; flex-direction: column; align-items: center; }
.counters .cell .v { font-size: 20px; font-weight: 600; }
.counters .cell .l { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; }

.review-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: stretch;
}

.review-header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.pill {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  letter-spacing: 0.04em;
}

.anon-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 0;
}
.anon-id {
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.05em;
}
.anon-label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-top: 2px;
}

.player-wrap {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

audio { display: none; }

.audio-loading {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  min-height: 14px;
}

.player-main {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 14px;
}

.play-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #0a1410;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: transform 0.06s ease, background 0.15s ease;
}
.play-btn:hover { background: #57d4a4; }
.play-btn:active { transform: scale(0.95); }
.play-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.play-btn svg { width: 28px; height: 28px; fill: currentColor; }
.play-btn .icon-pause { display: none; }
.play-btn.playing .icon-play { display: none; }
.play-btn.playing .icon-pause { display: block; }

.player-progress {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.progress-bar {
  position: relative;
  height: 28px;
  display: flex;
  align-items: center;
  cursor: pointer;
  touch-action: none;
}
.progress-bar::before {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
}
.progress-fill {
  position: absolute;
  left: 0;
  height: 6px;
  background: var(--accent);
  border-radius: 999px;
  width: 0;
  pointer-events: none;
}
.progress-thumb {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #0a1410;
  box-shadow: 0 0 0 1px var(--accent);
  transform: translateX(-50%);
  left: 0;
  pointer-events: none;
  transition: transform 0.08s ease;
}
.progress-bar:active .progress-thumb { transform: translateX(-50%) scale(1.2); }

.time-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  letter-spacing: 0.04em;
}
.time-row .t.muted { color: var(--muted); }

.timer-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}

.seek-btn {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  min-width: 60px;
}
.seek-btn:active { transform: scale(0.97); }
.seek-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.timer {
  text-align: center;
  font-size: 32px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.timer.warn { color: var(--maybe); }
.timer.over { color: var(--no); }

.sample-note {
  text-align: center;
  min-height: 1.2em;
  font-size: 13px;
  color: var(--muted);
}

.sample-switch {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}
.sample-switch .pill-btn {
  padding: 8px 14px;
  font-size: 13px;
  border-radius: 999px;
  background: var(--surface-2);
}
.sample-switch .pill-btn.active {
  background: var(--accent);
  color: #0a1410;
  border-color: transparent;
  font-weight: 600;
}

.verdict {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}
.verdict .btn {
  padding: 18px 12px;
  font-size: 18px;
}

.empty {
  text-align: center;
  padding: 30px 10px;
  color: var(--muted);
}

.totals {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 12px 0;
  color: var(--muted);
  font-size: 13px;
}
.totals span b { color: var(--text); }

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 600px;
}
th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
th {
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 11px;
}
td a { color: var(--accent); text-decoration: none; }
td a:hover { text-decoration: underline; }

.tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.tag.yes { background: rgba(34,197,94,0.18); color: #4ade80; }
.tag.maybe { background: rgba(245,158,11,0.18); color: #fbbf24; }
.tag.no { background: rgba(239,68,68,0.18); color: #f87171; }
.tag.pending { background: var(--surface-2); color: var(--muted); }

select {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  font-family: inherit;
}

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

details.advanced summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  padding: 6px 0;
}

/* ---------- Finalists ---------- */

.finalists-filters .btn {
  font-size: 13px;
  padding: 10px 14px;
}
.finalists-filters .btn.active {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

#finalists-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.finalist-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.fc-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.fc-name {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
  line-height: 1.25;
  flex: 1;
}

.fc-contact {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  color: var(--text);
}
.fc-contact a { color: var(--accent); text-decoration: none; word-break: break-all; }
.fc-contact a:hover { text-decoration: underline; }
.fc-contact .label {
  color: var(--muted);
  margin-right: 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.fc-section {
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.fc-section h4 {
  margin: 0 0 6px;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}
.fc-section .body {
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
}

details.fc-expand summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
  padding: 6px 0;
  list-style: none;
}
details.fc-expand summary::before {
  content: '▸ ';
  display: inline-block;
  transition: transform 0.15s ease;
  transform: rotate(0deg);
}
details.fc-expand[open] summary::before { transform: rotate(90deg); }
details.fc-expand summary::-webkit-details-marker { display: none; }
details.fc-expand .body {
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.fc-player {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fc-sample-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.fc-sample-tabs .tab {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
}
.fc-sample-tabs .tab.active {
  background: var(--accent);
  color: #0a1410;
  border-color: transparent;
  font-weight: 600;
}

.fc-sample-note {
  font-size: 12px;
  color: var(--muted);
  min-height: 14px;
}

.fc-player-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
}

.fc-play-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #0a1410;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  flex-shrink: 0;
}
.fc-play-btn svg { width: 22px; height: 22px; fill: currentColor; }
.fc-play-btn .icon-pause { display: none; }
.fc-play-btn.playing .icon-play { display: none; }
.fc-play-btn.playing .icon-pause { display: block; }

.fc-progress {
  position: relative;
  height: 24px;
  display: flex;
  align-items: center;
  cursor: pointer;
  touch-action: none;
}
.fc-progress::before {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 5px;
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
}
.fc-fill {
  position: absolute;
  left: 0;
  height: 5px;
  background: var(--accent);
  border-radius: 999px;
  width: 0;
  pointer-events: none;
}
.fc-thumb {
  position: absolute;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #0a1410;
  transform: translateX(-50%);
  left: 0;
  pointer-events: none;
}

.fc-time-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.fc-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.fc-controls .seek-btn { font-size: 12px; padding: 8px 12px; min-width: 0; }
.fc-controls .pdf-btn { flex: 1; min-width: 100px; }

.fc-history {
  border-top: 1px solid var(--border);
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}
.fc-history .h-row { display: flex; gap: 8px; align-items: center; }
.fc-history .h-row .tag { font-size: 10px; padding: 2px 6px; }

@media (max-width: 520px) {
  #app { padding: 12px 12px 60px; }
  .card { padding: 16px; }
  .review-card { gap: 14px; }
  .counters { grid-template-columns: repeat(2, 1fr); }
  .timer { font-size: 28px; }
  h1 { font-size: 20px; }
  .verdict .btn { padding: 18px 4px; font-size: 17px; }
  .seek-btn { padding: 9px 10px; min-width: 52px; font-size: 12px; }
  .anon-id { font-size: 24px; }
  .player-wrap { padding: 14px 12px; gap: 12px; }
  .play-btn { width: 56px; height: 56px; }
  .play-btn svg { width: 24px; height: 24px; }
  .row.secondary .btn { flex: 1; }
  .finalist-card { padding: 14px; }
  .fc-name { font-size: 16px; }
  .fc-player { padding: 12px; }
}
