/* Music.hiebel.ai — mobile-first.
   Designed at 375px FIRST: single column, 44x44px minimum touch targets,
   no absolute-positioned overlaps. Larger viewports only widen the column. */

:root {
  --bg: #0f0e0c;
  --surface: #1a1815;
  --surface-2: #232019;
  --ink: #f3ede1;
  --muted: #a59c89;
  --line: #34302a;
  --accent: #c9a24b;          /* editorial brass */
  --matched: #5a9c6b;
  --substituted: #c9913b;
  --missing: #b5564f;
  --radius: 14px;
  --tap: 44px;                 /* minimum touch target */
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 ui-serif, Georgia, "Times New Roman", serif;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
  min-height: 100dvh;
}

/* ---- topbar: stacks on phones, no overlap ---- */
.topbar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 16px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.topbar h1 {
  font-size: 22px;
  letter-spacing: .3px;
  font-weight: 600;
}
.topbar .dot { color: var(--accent); }

main { padding: 16px; display: flex; flex-direction: column; gap: 16px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 16px;
}
.card h2 {
  font-size: 18px;
  margin-bottom: 6px;
  color: var(--accent);
  font-weight: 600;
}
.muted { color: var(--muted); font-size: 14px; }
.lbl { display: block; margin: 14px 0 6px; font-size: 13px; color: var(--muted); }
.hidden { display: none; }

textarea, input[type="text"], input[type="number"] {
  width: 100%;
  background: var(--surface-2);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  font: 16px/1.45 ui-monospace, "SF Mono", Menlo, monospace;
  min-height: var(--tap);
}
textarea { resize: vertical; }

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
.row > * { flex: 1 1 140px; }

/* ---- buttons: every interactive target >= 44x44 ---- */
.btn {
  min-height: var(--tap);
  min-width: var(--tap);
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  font: 600 15px/1 ui-sans-serif, system-ui, sans-serif;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-apple { background: #fff; color: #000; border-color: #fff; }
.btn-primary { background: var(--accent); color: #1a1408; border-color: var(--accent); }
.btn-ghost { background: transparent; }
.file-btn { cursor: pointer; }

.status { margin-top: 12px; font-size: 13px; color: var(--muted); min-height: 18px; }
.status.err { color: var(--missing); }
.status.ok { color: var(--matched); }

/* ---- legend / pills ---- */
.legend { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.pill {
  font: 600 12px/1 ui-sans-serif, system-ui, sans-serif;
  padding: 7px 10px;
  border-radius: 999px;
  text-transform: lowercase;
}
.pill.matched { background: rgba(90,156,107,.18); color: var(--matched); }
.pill.substituted { background: rgba(201,145,59,.18); color: var(--substituted); }
.pill.missing { background: rgba(181,86,79,.18); color: var(--missing); }

/* ---- review list: flow layout, no absolute overlays ---- */
.review-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.rev {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-left: 4px solid var(--line);
  border-radius: 10px;
  padding: 12px;
}
.rev.matched { border-left-color: var(--matched); }
.rev.substituted { border-left-color: var(--substituted); }
.rev.missing { border-left-color: var(--missing); }
.rev .q { font-weight: 600; font-size: 15px; }
.rev .c { font-size: 13px; color: var(--muted); margin-top: 4px; }
.rev .reason { font-size: 12px; color: var(--substituted); margin-top: 6px; }
.rev .ctl {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  align-items: center;
}
.rev label.appr {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: var(--tap);
  font-size: 14px;
  cursor: pointer;
}
.rev input[type="checkbox"] { width: 22px; height: 22px; }
.alts { margin-top: 8px; display: none; flex-direction: column; gap: 6px; }
.alts.show { display: flex; }
.alt {
  font-size: 12px;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  min-height: var(--tap);
  text-align: left;
  cursor: pointer;
}
.alt.sel { border-color: var(--accent); color: var(--ink); }
.linkbtn {
  background: none;
  border: none;
  color: var(--accent);
  font: 600 13px/1 ui-sans-serif, system-ui, sans-serif;
  min-height: var(--tap);
  padding: 0 4px;
  cursor: pointer;
}

/* ---- sticky import bar: in flow, full width, no overlap ---- */
.sticky-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 0 6px;
  background: linear-gradient(180deg, transparent, var(--surface) 28%);
  margin-top: 16px;
}
.sticky-actions .btn { width: 100%; }

.foot { padding: 18px 16px 28px; border-top: 1px solid var(--line); }

/* ---- progressive widening only; phone layout is the baseline ---- */
@media (min-width: 640px) {
  main { max-width: 680px; margin: 0 auto; }
  .topbar { flex-direction: row; align-items: center; justify-content: space-between; }
  .sticky-actions { flex-direction: row; }
  .sticky-actions .btn { width: auto; flex: 1; }
}
