:root {
  --bg: #f6f3ee;
  --panel: #fffdf9;
  --text: #171412;
  --muted: #6d6259;
  --line: #e6d9c9;
  --accent: #9a4f22;
  --accent2: #0f766e;
  --dark: #24150e;
  --shadow: 0 20px 50px rgba(36, 21, 14, .10);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: linear-gradient(180deg, #fff8ef 0, #f6f3ee 42%, #f8fafc 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif;
}
a { color: inherit; }
.wrap { width: min(1180px, calc(100% - 32px)); margin: auto; }
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 253, 249, .92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.bar {
  width: min(1180px, calc(100% - 32px));
  min-height: 72px;
  margin: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand span {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #d97706);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 900;
}
.brand strong { font-size: 20px; }
.bar nav { display: flex; gap: 8px; overflow: auto; }
.bar nav a {
  padding: 9px 12px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 800;
  color: #4d4038;
  white-space: nowrap;
}
.bar nav a:hover { background: #fff1db; color: var(--accent); }
.hero {
  width: min(1180px, calc(100% - 32px));
  margin: 30px auto 20px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  gap: 18px;
  align-items: stretch;
}
.hero-copy, .hero-card, .card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.hero-copy {
  padding: 38px;
  min-height: 360px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.hero-copy:after {
  content: "";
  position: absolute;
  right: -80px;
  top: -80px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(154, 79, 34, .10);
}
.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 900;
}
.hero h1 {
  font-size: clamp(38px, 5vw, 64px);
  line-height: 1.02;
  margin: 0 0 16px;
  max-width: 780px;
}
.hero p, .lead { color: var(--muted); font-size: 17px; line-height: 1.7; max-width: 760px; }
.hero-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: linear-gradient(145deg, #2a1810, #5b2d17);
  color: #fff;
}
.hero-card .label { color: #fbbf24; font-size: 13px; font-weight: 900; text-transform: uppercase; }
.hero-card strong { font-size: 38px; margin: 14px 0; }
.hero-card p { color: #f5dfc8; line-height: 1.6; }
.search { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin-top: 24px; max-width: 720px; }
.search input { height: 50px; border: 1px solid var(--line); border-radius: 10px; padding: 0 14px; font: inherit; }
.search button, .button {
  height: 50px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-weight: 900;
  padding: 0 18px;
  cursor: pointer;
  text-decoration: none;
  display: inline-grid;
  place-items: center;
}
.category-strip { display: flex; gap: 9px; overflow: auto; margin-top: 12px; margin-bottom: 24px; }
.category-strip a {
  white-space: nowrap;
  text-decoration: none;
  border: 1px solid var(--line);
  background: #fffdf9;
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 800;
  color: #51443c;
}
.category-strip a.active, .category-strip a:hover { background: var(--dark); border-color: var(--dark); color: #fff; }
.az-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 28px; }
.az-panel > div { background: #fffdf9; border: 1px solid var(--line); border-radius: 14px; padding: 18px; box-shadow: var(--shadow); }
.az-panel h2 { margin: 0 0 12px; font-size: 20px; }
.letters { display: grid; grid-template-columns: repeat(13, 1fr); gap: 7px; }
.letters a {
  height: 36px;
  border-radius: 9px;
  text-decoration: none;
  display: grid;
  place-items: center;
  background: #fff4e5;
  border: 1px solid #f0d5b4;
  color: #6f3413;
  font-weight: 900;
}
.letters a.active, .letters a:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.letters a.disabled { opacity: .36; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 14px; }
.section-head h2 { font-size: 30px; margin: 0; }
.soft-link { color: var(--accent); font-weight: 900; text-decoration: none; }
.chord-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-bottom: 48px; }
.chord-card { padding: 18px; text-decoration: none; transition: .16s; }
.chord-card:hover, .mini-card:hover, .artist-card:hover { transform: translateY(-2px); box-shadow: 0 18px 36px rgba(36, 21, 14, .14); }
.meta { display: flex; justify-content: space-between; gap: 8px; }
.meta span { font-size: 12px; border-radius: 999px; background: #fff1db; color: #8a3f16; padding: 6px 9px; font-weight: 900; }
.chord-card h3 { font-size: 22px; line-height: 1.2; margin: 16px 0 8px; }
.chord-card p { margin: 0 0 14px; color: var(--muted); }
.source-pill { display: inline-flex; border-radius: 999px; background: #e7f7f4; color: #0f766e; font-weight: 900; padding: 8px 11px; font-size: 13px; }
.artist-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-bottom: 48px; }
.artist-card { padding: 18px; text-decoration: none; transition: .16s; }
.artist-card strong { display: block; font-size: 19px; }
.artist-card span { display: block; margin-top: 6px; color: var(--muted); }
.progression { display: flex; gap: 7px; flex-wrap: wrap; }
.progression b { background: #172033; color: #fff; border-radius: 8px; padding: 7px 10px; font-size: 14px; }
.progression.big b { font-size: 22px; padding: 10px 14px; background: var(--accent); }
.chord-card small { display: block; margin-top: 14px; color: var(--muted); }
.empty { grid-column: 1 / -1; padding: 24px; color: var(--muted); }
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 18px; margin-top: 26px; margin-bottom: 48px; }
.detail-card { padding: 30px; }
.detail-card h1 { font-size: clamp(36px, 5vw, 58px); line-height: 1.04; margin: 0 0 14px; }
.info-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 24px 0; }
.info-grid span { border: 1px solid var(--line); background: #fffaf3; border-radius: 10px; padding: 12px; }
.info-grid b { display: block; font-size: 12px; text-transform: uppercase; color: var(--muted); margin-bottom: 5px; }
.chord-section, .lyrics-section, .metadata-note { margin-top: 24px; }
.chord-section h2, .lyrics-section h2, .tips h2, .metadata-note h2, .related h2 { font-size: 22px; margin: 0 0 10px; }
.chord-section pre { white-space: pre-wrap; background: #171412; color: #fff7ed; border-radius: 12px; padding: 18px; line-height: 1.75; font-size: 17px; overflow: auto; }
.lyrics-section pre { white-space: pre-wrap; background: #fffaf3; border: 1px solid var(--line); border-radius: 12px; padding: 18px; line-height: 1.8; font-size: 17px; overflow: auto; }
.license-note { color: var(--muted); font-size: 14px; line-height: 1.6; }
.metadata-note { background: #fff7ed; border: 1px solid #f4d7b4; border-radius: 12px; padding: 18px; }
.metadata-note p { color: #6d452a; line-height: 1.75; }
.tips { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 18px; }
.tips p { color: var(--muted); line-height: 1.75; }
.related { position: sticky; top: 92px; align-self: start; }
.mini-card { display: block; text-decoration: none; padding: 15px; margin-bottom: 10px; }
.mini-card strong { display: block; }
.mini-card span { display: block; color: var(--muted); margin-top: 6px; }
.not-found { padding: 80px 0; }
.footer { border-top: 1px solid var(--line); background: #fffdf9; color: var(--muted); padding: 24px 0; line-height: 1.6; }
.admin-login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.admin-login-card { width: min(430px, 100%); padding: 26px; }
.admin-brand { margin-bottom: 18px; }
.admin-login-card h1 { margin: 0 0 18px; }
.admin-login-card label, .admin-form label { display: grid; gap: 8px; font-weight: 800; color: #3f342d; }
.admin-login-card input, .admin-form input, .admin-form textarea, .admin-form select, .admin-search input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  font: inherit;
  background: #fff;
}
.admin-error { background: #fee2e2; color: #991b1b; border-radius: 10px; padding: 12px; }
.admin-success { background: #dcfce7; color: #166534; border-radius: 999px; padding: 10px 14px; font-weight: 900; }
.admin-shell { min-height: 100vh; display: grid; grid-template-columns: 260px minmax(0, 1fr); }
.admin-sidebar { background: #21140e; color: #fff; padding: 22px; }
.admin-sidebar .brand { color: #fff; margin-bottom: 24px; }
.admin-sidebar nav { display: grid; gap: 8px; }
.admin-sidebar nav a { text-decoration: none; padding: 12px; border-radius: 10px; color: #f5dfc8; font-weight: 800; }
.admin-sidebar nav a.active, .admin-sidebar nav a:hover { background: rgba(255,255,255,.12); color: #fff; }
.admin-main { padding: 28px; }
.admin-top { display: flex; justify-content: space-between; gap: 16px; align-items: end; margin-bottom: 18px; }
.admin-top h1 { margin: 0; font-size: 34px; }
.admin-search { display: grid; grid-template-columns: minmax(220px, 340px) auto; gap: 8px; }
.admin-search button { border: 0; border-radius: 10px; background: var(--accent); color: #fff; font-weight: 900; padding: 0 16px; }
.admin-table { padding: 0; overflow: auto; }
.admin-table table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { text-align: left; padding: 15px; border-bottom: 1px solid var(--line); vertical-align: top; }
.admin-table small { display: block; margin-top: 5px; color: var(--muted); }
.admin-badge { display: inline-flex; border-radius: 999px; background: #fff1db; color: #8a3f16; padding: 6px 9px; font-weight: 900; font-size: 12px; }
.admin-form { padding: 22px; display: grid; gap: 16px; }
.admin-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.check-row { display: flex !important; grid-template-columns: none !important; align-items: center; gap: 10px; }
.check-row input { width: auto; }
@media (max-width: 900px) {
  .hero, .detail, .az-panel { grid-template-columns: 1fr; }
  .hero-copy { min-height: auto; }
  .info-grid { grid-template-columns: 1fr 1fr; }
  .related { position: static; }
  .bar { align-items: flex-start; flex-direction: column; padding: 12px 0; }
  .search { grid-template-columns: 1fr; }
  .admin-shell { grid-template-columns: 1fr; }
  .admin-sidebar { position: static; }
  .admin-top, .admin-search { grid-template-columns: 1fr; flex-direction: column; align-items: stretch; }
  .admin-form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .wrap, .bar, .hero { width: min(100% - 20px, 1180px); }
  .hero-copy, .detail-card { padding: 22px; }
  .info-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 36px; }
  .hero-card strong { font-size: 30px; }
  .letters { grid-template-columns: repeat(7, 1fr); }
}
