:root {
  --bg: #0f1419;
  --surface: #1a2332;
  --surface2: #243044;
  --border: #2f3f57;
  --text: #e8eef7;
  --muted: #93a4bd;
  --accent: #14b8a6;
  --accent2: #2dd4bf;
  --green: #5ba46b;
  --amber: #d4a017;
  --red: #c75b5b;
  --radius: 10px;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, system-ui, sans-serif; background: var(--bg); color: var(--text); }
.page { max-width: 1000px; margin: 0 auto; padding: 24px 16px 64px; }
.back { color: var(--accent2); text-decoration: none; font-size: 0.85rem; }
.brand { display: flex; gap: 14px; align-items: center; margin-top: 12px; }
.logo {
  width: 48px; height: 48px; border-radius: 10px;
  background: linear-gradient(135deg, #14b8a6, #0e7490);
  color: #fff; display: grid; place-items: center; font-weight: 800;
}
.brand h1 { margin: 0; font-size: 1.5rem; }
.brand p { margin: 0; color: var(--muted); font-size: 0.9rem; }

.view-toggle {
  display: flex; margin-top: 16px; background: var(--surface2);
  border: 1px solid var(--border); border-radius: 10px; padding: 4px; width: fit-content;
}
.view-btn {
  padding: 10px 20px; border: none; border-radius: 8px; font: inherit; cursor: pointer;
  font-weight: 600; font-size: 0.9rem; background: transparent; color: var(--muted);
}
.view-btn.active { background: var(--accent); color: #04201d; }

.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; margin-top: 16px;
}
.panel h3 { margin: 0 0 6px; font-size: 1rem; }
.panel-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; justify-content: space-between; }
.controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.control { display: flex; flex-direction: column; }
.control.grow { flex: 1; min-width: 220px; }
label { font-size: 0.75rem; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
input, select {
  padding: 10px 12px; background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font: inherit;
}
.btn {
  padding: 11px 20px; border: none; border-radius: 8px; font: inherit; cursor: pointer;
  background: var(--accent); color: #04201d; font-weight: 700;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.ghost { background: var(--surface2); color: var(--accent2); border: 1px solid var(--border); white-space: nowrap; }
.tag-add { display: flex; gap: 8px; }
.tag-add input { flex: 1; }
.single-tag-actions {
  display: flex; flex-direction: column; align-items: flex-start;
  gap: 12px; margin-top: 16px;
}
.single-tag-actions .chip-row { margin-top: 0; width: 100%; }
.single-tag-actions .chip-row:empty { display: none; }
.single-tag-actions .btn { flex-shrink: 0; }
.mode-banner {
  margin: 0 0 14px; padding: 11px 14px; border-radius: 8px; font-size: 0.86rem; line-height: 1.5;
  background: rgba(20,184,166,0.1); border: 1px solid rgba(20,184,166,0.3); color: var(--text);
}
td.best { background: rgba(91,164,107,0.18); font-weight: 700; }
.verdict { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 0.76rem; font-weight: 700; white-space: nowrap; }
.verdict.good { background: rgba(91,164,107,0.2); color: var(--green); border: 1px solid rgba(91,164,107,0.4); }
.verdict.mid { background: rgba(212,160,23,0.15); color: var(--amber); border: 1px solid rgba(212,160,23,0.35); }
.verdict.bad { background: rgba(199,91,91,0.15); color: var(--red); border: 1px solid rgba(199,91,91,0.35); }
#compareResult table { font-size: 0.8rem; }
#compareResult th, #compareResult td { padding: 8px 9px; }
.hint { margin: 10px 0 0; color: var(--muted); font-size: 0.83rem; line-height: 1.5; }
.section-title { margin: 22px 0 4px; font-size: 1.2rem; }
.loading { text-align: center; padding: 28px; color: var(--muted); }
.loading.small { padding: 14px; font-size: 0.85rem; }
.hidden { display: none !important; }
.empty-state { color: var(--muted); text-align: center; padding: 28px; }

.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px; margin-top: 12px;
}
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
}
.stat-card .num { font-size: 1.5rem; font-weight: 800; color: #fff; }
.stat-card .lbl { font-size: 0.76rem; color: var(--muted); margin-top: 4px; line-height: 1.4; }
.stat-card.accent { border-color: rgba(20,184,166,0.5); background: rgba(20,184,166,0.08); }

.bars { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.bar-row { display: flex; align-items: center; gap: 10px; font-size: 0.85rem; }
.bar-label { width: 96px; color: var(--muted); flex-shrink: 0; }
.bar-track { flex: 1; background: var(--surface2); border-radius: 6px; overflow: hidden; height: 22px; }
.bar-fill {
  height: 100%; background: linear-gradient(90deg, #0e7490, #2dd4bf);
  display: flex; align-items: center; justify-content: flex-end; padding-right: 8px;
  color: #04201d; font-weight: 700; font-size: 0.75rem; min-width: 2px;
}
.bar-val { width: 64px; text-align: right; color: var(--text); flex-shrink: 0; font-variant-numeric: tabular-nums; }

.table-wrap { overflow-x: auto; margin-top: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: 0.74rem; text-transform: uppercase; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr:hover td { background: rgba(20,184,166,0.06); }
.pos { color: var(--green); }
.neg { color: var(--red); }
.mid { color: var(--amber); }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 0.82rem;
  padding: 5px 12px; border-radius: 999px; background: rgba(20,184,166,0.15);
  color: var(--accent2); border: 1px solid rgba(20,184,166,0.3);
}
.chip button { background: none; border: none; color: inherit; cursor: pointer; font-size: 1rem; line-height: 1; padding: 0; }
.chip.genre { background: var(--surface2); color: var(--text); border-color: var(--border); }
