:root {
  --bg: #f8f4f2;
  --surface: #ffffff;
  --ink: #2a2220;
  --muted: #6a5f5a;
  --line: #e4d8d2;
  --accent: #8b4a62;
  --accent-soft: #f5e8ee;
  --warn: #8a5b2c;
  --bad: #8b3a3a;
  --ok: #2f6b4f;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(42, 34, 32, 0.08);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}
html {
  overscroll-behavior-x: none;
}


* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top, #f0e4ea 0%, transparent 55%),
    var(--bg);
  min-height: 100vh;
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

header {
  text-align: center;
  margin-bottom: 1.25rem;
}

.eyebrow {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.brand {
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0.2rem 0 0;
}

.beta-tag {
  display: inline-block;
  margin-left: 0.25rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  vertical-align: 0.15em;
}

.tagline {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.98rem;
}

.disclaimer {
  margin: 1rem 0 0;
  padding: 0.85rem 1rem;
  background: var(--accent-soft);
  border: 1px solid #e8cfd9;
  border-radius: var(--radius);
  color: #5a3344;
  font-size: 0.86rem;
  line-height: 1.45;
  text-align: left;
}

.tabs {
  display: flex;
  gap: 0.5rem;
  margin: 1.25rem 0 0.75rem;
}

.tab {
  flex: 1;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 0.55rem 0.75rem;
  font-size: 0.92rem;
  cursor: pointer;
  color: var(--muted);
}

.tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem 1.2rem;
  box-shadow: var(--shadow);
}

.lookup-form label {
  display: block;
  margin: 0.65rem 0 0.25rem;
  font-size: 0.86rem;
  font-weight: 600;
}

.lookup-form input,
.lookup-form textarea,
.lookup-form select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.55rem 0.65rem;
  font: inherit;
  color: var(--ink);
  background: #fff;
}

.lookup-form button,
.shelf-add button {
  margin-top: 0.85rem;
  border: none;
  border-radius: 10px;
  padding: 0.6rem 1rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
}

.lookup-form button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.status {
  min-height: 1.25rem;
  margin: 0.75rem 0 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.result {
  margin-top: 0.75rem;
  font-size: 0.92rem;
  line-height: 1.5;
}

.result h2 {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  margin-right: 0.35rem;
}

.badge.ok {
  background: #e4f3ea;
  color: var(--ok);
}

.badge.warn {
  background: #f8efe4;
  color: var(--warn);
}

.badge.bad {
  background: #f8e8e8;
  color: var(--bad);
}

.theme-list {
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
}

.theme-list li {
  padding: 0.45rem 0;
  border-top: 1px solid var(--line);
}

.theme-list li:first-child {
  border-top: none;
}

.scan-summary {
  font-size: 0.95rem;
  line-height: 1.5;
}

.lyrics-expand {
  font-family: system-ui, "Segoe UI", sans-serif;
  font-size: 0.86rem;
  color: var(--muted);
  margin: 0.85rem 0 0;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(139, 74, 98, 0.04);
}

.lyrics-expand summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  user-select: none;
}

.lyrics-expand summary::-webkit-details-marker {
  display: none;
}

.lyrics-expand summary::marker {
  content: "";
}

.lyrics-expand-title {
  flex: 1 1 auto;
  min-width: 0;
}

.lyrics-expand-title strong {
  font-weight: 600;
  color: var(--ink);
}

.lyrics-expand-toggle {
  flex: 0 0 2.35rem;
  text-align: right;
  font-size: 0.78rem;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.lyrics-expand-toggle::after {
  content: "More";
}

.lyrics-expand[open] .lyrics-expand-toggle::after {
  content: "Less";
}

.lyrics-expand-body {
  margin-top: 0.55rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--line);
}

.lyrics-text {
  margin: 0;
  font-family: inherit;
  font-size: 0.88rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--ink);
}

.lyrics-source {
  margin: 0.55rem 0 0;
}

.muted {
  color: var(--muted);
  font-size: 0.88rem;
}

.scan-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0.75rem 0 0.35rem;
}

.scan-pulse {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  animation: scan-pulse 1.1s ease-in-out infinite;
}

.scan-summary.scanning:empty::after {
  content: "…";
  animation: scan-pulse 1.1s ease-in-out infinite;
}

@keyframes scan-pulse {
  0%,
  100% {
    opacity: 0.35;
    transform: scale(0.92);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

.shelf-list {
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
}

.shelf-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0;
  border-top: 1px solid var(--line);
}

.shelf-list button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 0.25rem 0.5rem;
  font-size: 0.78rem;
  cursor: pointer;
}

.rec-list {
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
}

.rec-list li {
  padding: 0.75rem 0;
  border-top: 1px solid var(--line);
}

.rec-list li:first-child {
  border-top: none;
}

.rec-meta {
  margin: 0.25rem 0 0;
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.4;
}

.rec-themes {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.rec-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.55rem;
}

.rec-actions a,
.rec-actions button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 0.3rem 0.55rem;
  font-size: 0.78rem;
  cursor: pointer;
  color: var(--ink);
  text-decoration: none;
  font-family: inherit;
}

.rec-actions a:hover,
.rec-actions button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.prefs-box {
  margin-top: 1.35rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.prefs-heading {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}

.check-row {
  display: flex !important;
  align-items: center;
  gap: 0.45rem;
  margin: 0.65rem 0 0 !important;
  font-weight: 500 !important;
  font-size: 0.9rem !important;
}

.check-row input {
  width: auto !important;
}

.prefs-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.85rem;
}

.prefs-actions button {
  margin-top: 0 !important;
}

.btn-secondary {
  background: #fff !important;
  color: var(--ink) !important;
  border: 1px solid var(--line) !important;
}

.lookup-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.55rem 0.65rem;
  font: inherit;
  color: var(--ink);
  background: #fff;
  resize: vertical;
  min-height: 2.8rem;
}

.foot {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.88rem;
}

.foot a {
  color: var(--accent);
}
