:root {
  --dark: #063A33;
  --dark-2: #0D4A41;
  --bg: #FAFBF6;
  --bg-2: #EDF2E8;
  --card: #FFFFFF;
  --ink: #0B2E29;
  --ink-2: #3E5550;
  --muted: #6B7F7A;
  --line: #D9E3DC;
  --brand: #00554A;
  --accent: #4CC38A;
  --accent-ink: #0F6E8C;
  --grad: linear-gradient(120deg, #7CCB6B 0%, #3AA0D8 100%);
  --err: #B3261E;
  --radius: 16px;
  --display: 'Libre Baskerville', Georgia, serif;
  --sans: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 var(--sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: 0 16px 48px; }
a { color: var(--accent-ink); }
h1, h2, h3 { font-family: var(--display); font-weight: 700; color: var(--brand); margin: 0; line-height: 1.15; }
h1 { font-size: clamp(30px, 7vw, 44px); letter-spacing: -0.5px; }
h2 { font-size: clamp(24px, 5.5vw, 32px); margin-bottom: 8px; }
h3 { font-size: 19px; margin: 24px 0 8px; }
em { font-style: normal; color: var(--muted); font-weight: 400; }
[hidden] { display: none !important; }

/* ---------- Cabecera y pestañas ---------- */
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px;
  background: rgba(250, 251, 246, 0.92);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.top { flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--brand); font-family: var(--display); font-weight: 700; font-size: 28px; line-height: 1; }
.brand img { width: 64px; height: auto; }
.tabs { display: flex; gap: 4px; background: var(--bg-2); padding: 4px; border-radius: 999px; }
.tabs a { text-decoration: none; color: var(--ink-2); font-weight: 500; font-size: 14px; padding: 7px 14px; border-radius: 999px; white-space: nowrap; text-align: center; }
@media (max-width: 559px) {
  .top { justify-content: center; }
  .tabs { width: 100%; }
  .tabs a { flex: 1; }
}
@media (min-width: 720px) {
  .brand { font-size: 32px; }
  .brand img { width: 80px; }
}
.tabs a.on { background: var(--dark); color: #fff; }

/* ---------- Portada del EP ---------- */
.hero { display: flex; gap: 18px; align-items: center; padding: 28px 0 8px; }
.cover { width: 112px; height: 112px; border-radius: 14px; object-fit: cover; flex-shrink: 0; box-shadow: 0 8px 24px rgba(6, 58, 51, 0.18); }
.eyebrow { margin: 0 0 4px; font-size: 12px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--accent-ink); }
.artist { margin: 6px 0 0; color: var(--ink-2); }

/* ---------- Pasos ---------- */
.steps { display: flex; list-style: none; padding: 0; margin: 20px 0 8px; gap: 6px; counter-reset: st; }
.steps li { flex: 1; font-size: 12px; color: var(--muted); padding-top: 8px; border-top: 4px solid var(--line); counter-increment: st; }
.steps li::before { content: counter(st) ". "; }
.steps li.on { color: var(--brand); border-color: var(--accent); font-weight: 700; }
.steps li.done { border-color: var(--brand); }
.steps.off { visibility: hidden; height: 0; margin: 0; }

/* ---------- Paneles ---------- */
.panel { padding: 16px 0; }
.lead { font-size: 18px; color: var(--ink-2); margin: 8px 0 16px; }
.hint { color: var(--ink-2); margin: 4px 0 16px; }
.small { font-size: 14px; }
.note { font-size: 14px; color: var(--muted); }
.how { padding-left: 20px; margin: 0 0 12px; }
.how li { margin-bottom: 6px; }
.err { color: var(--err); font-weight: 500; margin: 12px 0 0; }

fieldset { border: 0; padding: 0; margin: 0 0 22px; min-width: 0; }
legend { font-weight: 700; margin-bottom: 10px; padding: 0; color: var(--ink); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button {
  font: inherit; font-size: 15px;
  padding: 9px 14px; min-height: 42px;
  border: 1.5px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 999px; cursor: pointer;
  transition: background .12s, border-color .12s;
}
.chips button:hover { border-color: var(--accent); }
.chips button.on { background: var(--dark); border-color: var(--dark); color: #fff; }
.chips.big button { padding: 12px 18px; font-weight: 500; }

.field { display: block; margin: 0 0 20px; }
.field > span { display: block; font-weight: 700; margin-bottom: 8px; }
input, select, textarea {
  font: inherit; width: 100%;
  padding: 11px 12px; border-radius: 12px;
  border: 1.5px solid var(--line); background: var(--card); color: var(--ink);
}
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 3px solid rgba(76, 195, 138, .45); outline-offset: 1px; }
.row2 { display: grid; grid-template-columns: 1fr; gap: 0 12px; }
@media (min-width: 560px) { .row2 { grid-template-columns: 1fr 1fr; } }

.check { display: flex; gap: 10px; align-items: flex-start; margin: 16px 0; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; flex-shrink: 0; accent-color: var(--brand); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 700; text-decoration: none;
  padding: 13px 22px; min-height: 48px; border-radius: 999px; border: 0; cursor: pointer;
}
.btn.primary { background: var(--dark); color: #fff; }
.btn.primary:hover { background: var(--dark-2); }
.btn.ghost { background: transparent; color: var(--brand); border: 1.5px solid var(--line); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 8px; }
.linkbtn { background: none; border: 0; padding: 12px 0; font: inherit; font-size: 14px; color: var(--muted); text-decoration: underline; cursor: pointer; }

/* ---------- Temas ---------- */
.tracks { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 10px; }
.track { background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.track.playing { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(76, 195, 138, .18); }
.track-main { display: flex; align-items: center; gap: 12px; }
.play {
  width: 48px; height: 48px; flex-shrink: 0; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--grad); color: var(--dark); display: grid; place-items: center;
}
.play svg { width: 20px; height: 20px; fill: currentColor; }
.track-info { flex: 1; min-width: 0; }
.track-title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-meta { font-size: 13px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; }
.track-meta .ok { color: var(--brand); font-weight: 700; }
.bar { position: relative; height: 22px; margin-top: 4px; cursor: pointer; touch-action: none; }
.bar::before { content: ""; position: absolute; left: 0; right: 0; top: 9px; height: 4px; border-radius: 4px; background: var(--bg-2); }
.bar i { position: absolute; left: 0; top: 9px; height: 4px; border-radius: 4px; background: var(--accent); width: 0; }
.bar b { position: absolute; top: 4px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--dark); left: 0; display: none; }
.track.playing .bar b { display: block; }
.loading .play { animation: pulse 1s infinite ease-in-out; }
@keyframes pulse { 50% { opacity: .55; } }

.rate { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.rate-q { font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.stars { display: flex; gap: 4px; margin-bottom: 10px; }
.stars button { background: none; border: 0; padding: 2px; cursor: pointer; color: var(--line); }
.stars button svg { width: 32px; height: 32px; fill: currentColor; }
.stars button.on { color: #E8B931; }
.yn { display: flex; flex-wrap: wrap; gap: 6px; }
.yn button { font: inherit; font-size: 14px; padding: 7px 12px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; }
.yn button.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.yn.neg { margin-top: 6px; }
.yn.neg button.on { background: var(--ink-2); border-color: var(--ink-2); }
.locked { font-size: 13px; color: var(--muted); margin-top: 6px; }

.sticky-actions {
  position: sticky; bottom: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 0 -16px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: rgba(250, 251, 246, 0.96); border-top: 1px solid var(--line);
}
.heard-count { font-size: 14px; color: var(--ink-2); }

/* ---------- Ordenar ---------- */
.ranklist { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 8px; }
.ranklist button {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: left;
  font: inherit; padding: 12px 14px; min-height: 56px; border-radius: var(--radius);
  border: 1.5px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer;
}
.ranklist .pos { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; font-weight: 700; border: 1.5px dashed var(--line); color: var(--muted); font-size: 14px; }
.ranklist button.on { border-color: var(--brand); }
.ranklist button.on .pos { background: var(--dark); border: 0; color: #fff; }
.ranklist button:disabled { opacity: .45; cursor: default; }
.ranklist small { display: block; color: var(--muted); font-size: 13px; }

/* ---------- Final ---------- */
.optin { background: var(--bg-2); border-radius: var(--radius); padding: 16px; margin-bottom: 8px; }
.optin .field { margin-bottom: 8px; }
.optin .field > span { font-weight: 500; }
.thanks .share { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0 24px; }

/* ---------- Bloomio ---------- */
.slides { display: grid; gap: 14px; padding-top: 24px; }
.slide { border-radius: 22px; padding: 28px 22px; }
.slide h2 { font-size: clamp(24px, 6vw, 34px); margin: 0 0 16px; }
.slide .body { font-size: 17px; margin: 0 0 8px; }
.s-dark { background: var(--dark); color: #EAF2EE; }
.s-dark h2 { color: #fff; }
.s-dark .eyebrow { color: var(--accent); }
.s-light { background: var(--card); border: 1.5px solid var(--line); }
.s-accent { background: var(--grad); color: #062A24; }
.s-accent h2, .s-accent .eyebrow { color: #062A24; }
.s-wide h2 { font-size: clamp(28px, 7.5vw, 42px); line-height: 1.12; }
.facts { margin: 0; display: grid; gap: 16px; }
.facts dt { font-family: var(--display); font-size: 26px; font-weight: 700; color: var(--accent); }
.facts dd { margin: 2px 0 0; color: #C3D6CF; }
.points { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.points li { display: flex; gap: 12px; font-size: 17px; align-items: baseline; }
.points p { margin: 0; }
.points span { flex-shrink: 0; font-family: var(--display); font-weight: 700; color: var(--accent-ink); }
.contact { margin-top: 16px; }
.contact .chips { margin-bottom: 10px; }
.contact .inline { display: flex; gap: 8px; }
.contact .inline input { flex: 1; min-width: 0; }
.foot-note { font-size: 13px; color: var(--muted); text-align: center; margin-top: 16px; }

/* ---------- Privacidad ---------- */
.legal { padding-top: 24px; }
.legal li { margin-bottom: 6px; }

.foot { display: flex; justify-content: space-between; padding: 16px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); max-width: 760px; width: 100%; margin: 0 auto; }

@media (min-width: 720px) {
  .cover { width: 148px; height: 148px; }
  .slides { grid-template-columns: 1fr 1fr; }
  .slide { padding: 32px 28px; }
  .s-wide { grid-column: 1 / -1; padding: 44px 36px; }
  .s-wide h2 { font-size: 42px; max-width: 18em; }
}
@media (max-width: 380px) {
  .tabs a { padding: 7px 10px; }
}
