/* ==========================================================================
   mod-analise.css — Descobrir (tom, BPM, acordes) e AfinadorLab.
   Escopo: body.page-descobrir* e body.page-afinadorlab. Não afeta outras páginas.
   ========================================================================== */

:root {
  --an-amber: #fbbf24;
  --an-amber-2: #f59e0b;
  --an-cyan: #22d3ee;
  --an-coral: #ff7a45;
  --an-violet: #a78bfa;
  --an-green: #34d399;
  --an-bg: #060a13;
  --an-bg-2: #0b121c;
  --an-card: rgba(11, 18, 28, 0.78);
  --an-line: rgba(238, 246, 255, 0.1);
  --an-line-2: rgba(238, 246, 255, 0.16);
  --an-muted: #8fa3bc;
}

/* ---------- Descobrir · hero ---------- */
body.page-descobrir .dsc-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  align-items: center;
  gap: clamp(1.25rem, 3vw, 2.75rem);
  justify-items: stretch;
}
body.page-descobrir .dsc-hero-copy {
  display: grid;
  justify-items: start;
  gap: 0.85rem;
  min-width: 0;
}
body.page-descobrir .dsc-hero-copy > * { margin: 0; }
body.page-descobrir .dsc-hero h1 {
  font-family: var(--display, "Source Serif 4", Georgia, serif);
  font-size: clamp(2.1rem, 4.6vw, 3.6rem);
  line-height: 1.04;
  letter-spacing: -0.025em;
  color: #eef6ff;
  background: none;
  -webkit-text-fill-color: currentColor;
}
body.page-descobrir .dsc-hero h1 em {
  font-style: italic;
  padding-right: 0.08em;
  color: var(--an-amber);
  -webkit-text-fill-color: currentColor;
}
body.page-descobrir .dsc-hero h1 em:nth-of-type(2) { color: #fcd34d; }
body.page-descobrir .dsc-hero h1 em:nth-of-type(3) { color: var(--an-coral); }

/* Atalhos de origem */
.dsc-sources {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  width: 100%;
  max-width: 40rem;
}
.dsc-source {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
  padding: 0.7rem 0.75rem;
  border-radius: 14px;
  border: 1px solid var(--an-line);
  background: linear-gradient(160deg, rgba(251, 191, 36, 0.06), rgba(11, 18, 28, 0.6) 55%);
  color: #eef6ff;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}
.dsc-source:hover,
.dsc-source:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(251, 191, 36, 0.5);
}
.dsc-source:focus-visible { outline: 2px solid var(--an-amber); outline-offset: 2px; }
.dsc-source-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 10px;
  color: var(--an-amber);
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.25);
}
.dsc-source-text { display: grid; min-width: 0; line-height: 1.2; }
.dsc-source-text strong { font-size: 0.92rem; font-weight: 650; }
.dsc-source-text em {
  font-style: normal;
  font-size: 0.74rem;
  color: var(--an-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Leitura animada */
.dsc-readout {
  position: relative;
  margin: 0;
  display: grid;
  gap: 0.9rem;
  padding: clamp(1rem, 2.2vw, 1.4rem);
  border-radius: 22px;
  border: 1px solid rgba(251, 191, 36, 0.22);
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(251, 191, 36, 0.14), transparent 55%),
    radial-gradient(90% 70% at 0% 100%, rgba(34, 211, 238, 0.08), transparent 60%),
    linear-gradient(180deg, #0d1522, #070b14);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  overflow: hidden;
  min-width: 0;
}
.dsc-readout-head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fde68a;
}
.dsc-readout-head em {
  font-style: normal;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--an-muted);
}
.dsc-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--an-amber);
  box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.6);
}
.dsc-readout.is-running .dsc-live-dot { animation: dscPulse 1.6s ease-out infinite; }
.dsc-readout-eq {
  margin-left: auto;
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
}
.dsc-readout-eq i {
  width: 3px;
  height: 100%;
  border-radius: 2px;
  background: var(--an-amber);
  opacity: 0.8;
  transform-origin: bottom;
  transform: scaleY(0.35);
}
.dsc-readout.is-running .dsc-readout-eq i { animation: dscEq 0.9s ease-in-out infinite alternate; }
.dsc-readout-eq i:nth-child(2) { animation-delay: -0.3s !important; }
.dsc-readout-eq i:nth-child(3) { animation-delay: -0.6s !important; }
.dsc-readout-eq i:nth-child(4) { animation-delay: -0.15s !important; }
.dsc-readout-eq i:nth-child(5) { animation-delay: -0.45s !important; }

.dsc-readout-stats {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 0.6rem;
}
.dsc-readout-stat {
  display: grid;
  gap: 0.15rem;
  padding: 0.8rem 0.9rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--an-line);
  min-width: 0;
}
.dsc-readout-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--an-muted);
}
.dsc-readout-key {
  font-family: var(--display, "Source Serif 4", Georgia, serif);
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  line-height: 1.1;
  color: #fff7e0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dsc-readout-sub {
  font-style: normal;
  font-size: 0.8rem;
  color: #fde68a;
  font-variant-numeric: tabular-nums;
}
.dsc-readout.is-swap .dsc-readout-key,
.dsc-readout.is-swap .dsc-readout-sub { animation: dscSwap 0.5s ease both; }

/* Contador de BPM tipo odômetro */
.dsc-odo {
  display: inline-flex;
  height: 1.1em;
  font-size: clamp(1.7rem, 3vw, 2.25rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--an-amber);
  font-variant-numeric: tabular-nums;
  overflow: hidden;
}
.dsc-odo-col {
  display: block;
  width: 0.62em;
  height: 1.1em;
  overflow: hidden;
  transition: width 0.4s ease, opacity 0.4s ease;
}
.dsc-odo-col.is-blank { width: 0; opacity: 0; }
.dsc-odo-strip {
  display: flex;
  flex-direction: column;
  transition: transform 1.1s cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: transform;
}
.dsc-odo-strip i {
  display: block;
  height: 1.1em;
  font-style: normal;
  text-align: center;
}
.dsc-odo-col:nth-child(2) .dsc-odo-strip { transition-duration: 1.3s; }
.dsc-odo-col:nth-child(3) .dsc-odo-strip { transition-duration: 1.55s; }

.dsc-readout-now {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0 0.15rem;
}
.dsc-readout-now strong {
  font-family: var(--display, "Source Serif 4", Georgia, serif);
  font-size: clamp(2rem, 4vw, 2.8rem);
  line-height: 1;
  color: #fff;
  display: inline-block;
}
.dsc-readout-now strong.is-pop { animation: dscPop 0.35s ease-out; }
.dsc-readout-next {
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--an-muted);
}
.dsc-readout-next b { color: #eef6ff; font-weight: 650; }

.dsc-timeline {
  position: relative;
  padding: 6px 0;
}
.dsc-timeline-track {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 4px;
}
.dsc-tl-block {
  display: grid;
  place-items: center;
  height: 2.4rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 650;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--an-line);
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
  min-width: 0;
  overflow: hidden;
}
.dsc-tl-block.is-past { color: #94a3b8; background: rgba(251, 191, 36, 0.05); }
.dsc-tl-block.is-now {
  color: #1a1203;
  background: linear-gradient(180deg, #fcd34d, var(--an-amber-2));
  border-color: transparent;
  transform: translateY(-2px);
}
.dsc-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 2px;
  border-radius: 2px;
  background: #fff;
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.9);
  opacity: 0;
  pointer-events: none;
}
.dsc-readout.is-running .dsc-playhead { opacity: 1; }
.dsc-timeline-scale {
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
  color: #64748b;
  font-variant-numeric: tabular-nums;
  margin-top: -0.4rem;
}

@keyframes dscPulse {
  0% { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.55); }
  100% { box-shadow: 0 0 0 9px rgba(251, 191, 36, 0); }
}
@keyframes dscEq {
  0% { transform: scaleY(0.25); }
  100% { transform: scaleY(1); }
}
@keyframes dscSwap {
  0% { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: none; }
}
@keyframes dscPop {
  0% { transform: scale(0.86); opacity: 0.4; }
  100% { transform: none; opacity: 1; }
}

/* ---------- Descobrir · suas análises ---------- */
body.page-descobrir #dscAnalyze .sep-lib-head h2,
body.page-descobrir .dsc-features-head h2 {
  font-family: var(--display, "Source Serif 4", Georgia, serif);
  font-size: 1.45rem;
  letter-spacing: -0.01em;
}
body.page-descobrir #dscAnalyze .sep-lib-count {
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(251, 191, 36, 0.3);
  color: #fde68a;
  font-size: 0.78rem;
  font-weight: 600;
}
body.page-descobrir #dscAnalyze .sep-drop-hint { color: var(--an-muted); margin: 0 0 0.6rem; }
body.page-descobrir #dscAnalyze .sep-table th { font-size: 0.7rem; letter-spacing: 0.1em; }
body.page-descobrir #dscAnalyze .sep-row { transition: background-color 0.18s ease; }
body.page-descobrir #dscAnalyze .sep-row:hover { background: rgba(251, 191, 36, 0.04); }
body.page-descobrir #dscAnalyze .sep-title-link:hover { color: var(--an-amber); }
.dsc-pill {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  border: 1px solid var(--an-line-2);
  background: rgba(255, 255, 255, 0.04);
}
.dsc-pill-key { color: #fde68a; border-color: rgba(251, 191, 36, 0.35); background: rgba(251, 191, 36, 0.08); }
.dsc-pill-bpm { color: #a5f3fc; border-color: rgba(34, 211, 238, 0.3); background: rgba(34, 211, 238, 0.07); }
.dsc-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
}
.dsc-status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #64748b;
}
.dsc-status.is-done::before { background: var(--an-green); }
.dsc-status.is-active::before { background: var(--an-amber); animation: dscPulse 1.6s ease-out infinite; }
.dsc-status.is-error::before { background: #ff5c7a; }
body.page-descobrir #dscAnalyze .sep-empty td {
  padding: 2rem 1rem;
}
.dsc-empty {
  display: grid;
  justify-items: center;
  gap: 0.5rem;
  color: var(--an-muted);
}
.dsc-empty-icon {
  display: grid;
  place-items: center;
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 14px;
  color: var(--an-amber);
  background: rgba(251, 191, 36, 0.1);
  border: 1px dashed rgba(251, 191, 36, 0.4);
}
body.page-descobrir #dscAnalyze .sep-row-action {
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--an-line-2);
  background: transparent;
  color: #eef6ff;
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}
body.page-descobrir #dscAnalyze .sep-row-action:hover { border-color: var(--an-amber); color: var(--an-amber); }

/* ---------- Descobrir · recursos ---------- */
.dsc-features-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.4rem 1rem;
}
.dsc-features-head h2 { margin: 0; }
.dsc-features-head p { margin: 0; color: var(--an-muted); font-size: 0.92rem; }
.dsc-feature-grid {
  list-style: none;
  margin: 0.4rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
}
.dsc-feature {
  display: grid;
  align-content: start;
  gap: 0.35rem;
  padding: 1rem;
  border-radius: 16px;
  border: 1px solid var(--an-line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.dsc-feature:hover { transform: translateY(-2px); border-color: rgba(251, 191, 36, 0.3); }
.dsc-feature strong { font-size: 0.98rem; color: #eef6ff; }
.dsc-feature > span:last-child { font-size: 0.86rem; color: var(--an-muted); line-height: 1.45; }
.dsc-feature-icon {
  display: grid;
  place-items: center;
  width: 2.3rem;
  height: 2.3rem;
  margin-bottom: 0.25rem;
  border-radius: 11px;
  color: var(--an-amber);
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.22);
}
.dsc-feature.is-accent {
  border-color: rgba(251, 191, 36, 0.35);
  background: linear-gradient(160deg, rgba(251, 191, 36, 0.12), rgba(255, 122, 69, 0.05) 70%);
}

/* ---------- Descobrir · click alinhado ---------- */
.dsc-click h2 {
  margin: 0 0 0.35rem;
  font-family: var(--display, "Source Serif 4", Georgia, serif);
  font-size: 1.35rem;
}
.dsc-click-lead,
.dsc-click-empty,
.dsc-click-note {
  margin: 0 0 0.85rem;
  color: var(--an-muted, var(--muted));
  font-size: 0.92rem;
  line-height: 1.45;
}
.dsc-click-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.75rem;
}
.dsc-click-bpm {
  min-width: 4.5ch;
  font-size: 2rem;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: #fde68a;
  text-align: center;
}
.dsc-click-unit {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--an-muted, var(--muted));
}
.dsc-click-seg button,
.dsc-click-accent button {
  border: 1px solid var(--an-line, rgba(148, 163, 184, 0.25));
  background: transparent;
  color: inherit;
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  font: inherit;
  cursor: pointer;
}
.dsc-click-seg button[aria-pressed="true"],
.dsc-click-accent button[aria-pressed="true"] {
  color: #1a1203;
  background: #fde68a;
  border-color: #fde68a;
}
.dsc-click-accent {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}
.dsc-click-accent span {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--an-muted, var(--muted));
}
.dsc-click-accent button {
  min-width: 2.2rem;
  padding-inline: 0.55rem;
}
.dsc-click-map {
  list-style: none;
  margin: 0 0 0.85rem;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}
.dsc-click-map li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.4rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--an-line, rgba(148, 163, 184, 0.25));
  font-variant-numeric: tabular-nums;
}
.dsc-click-map span { color: var(--an-muted, var(--muted)); }
.dsc-click-map strong { color: #fde68a; }
#dscClickDownload { margin-top: 0.2rem; }
#dscClickDownload:disabled { opacity: 0.55; }

/* ---------- Descobrir · resultado ---------- */
body.page-descobrir-result .dsc-result h1 {
  font-family: var(--display, "Source Serif 4", Georgia, serif);
  letter-spacing: -0.02em;
}
body.page-descobrir-result .dsc-stats { gap: 0.6rem; }
body.page-descobrir-result .dsc-stat {
  position: relative;
  padding: 0.95rem 1rem;
  border-radius: 16px;
  border: 1px solid var(--an-line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01));
  overflow: hidden;
}
body.page-descobrir-result .dsc-stat:nth-child(-n+2) {
  border-color: rgba(251, 191, 36, 0.3);
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(251, 191, 36, 0.14), transparent 60%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01));
}
body.page-descobrir-result .dsc-stat-value {
  display: block;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-variant-numeric: tabular-nums;
}
body.page-descobrir-result .dsc-stat:nth-child(-n+2) .dsc-stat-value { color: #fde68a; }
body.page-descobrir-result .dsc-stats:not([hidden]) .dsc-stat { animation: dscSwap 0.45s ease both; }
body.page-descobrir-result .dsc-stats .dsc-stat:nth-child(2) { animation-delay: 0.06s; }
body.page-descobrir-result .dsc-stats .dsc-stat:nth-child(3) { animation-delay: 0.12s; }
body.page-descobrir-result .dsc-stats .dsc-stat:nth-child(4) { animation-delay: 0.18s; }

/* Agora + diagrama */
body.page-descobrir-result .dsc-now-chord {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0.9rem 0 0.2rem;
  padding: 0.85rem 1rem;
  border-radius: 18px;
  border: 1px solid rgba(251, 191, 36, 0.3);
  background: linear-gradient(120deg, rgba(251, 191, 36, 0.12), rgba(11, 18, 28, 0.6) 60%);
}
body.page-descobrir-result .dsc-now-chord > span:first-child {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fde68a;
}
body.page-descobrir-result .dsc-now-chord strong#dscNowChordName {
  font-family: var(--display, "Source Serif 4", Georgia, serif);
  font-size: clamp(2.2rem, 5vw, 3rem);
  line-height: 1;
  color: #fff;
  min-width: 3ch;
}
body.page-descobrir-result .dsc-now-chord strong.is-pop { animation: dscPop 0.3s ease-out; }
.dsc-now-next {
  display: grid;
  gap: 0.1rem;
  font-size: 0.78rem;
  color: var(--an-muted);
}
.dsc-now-next b { font-size: 1.05rem; color: #eef6ff; font-weight: 650; }
.dsc-now-diag { margin-left: auto; color: #eef6ff; }
.dsc-now-diag .cifra-diag { margin: 0; }
.dsc-now-diag .cifra-diag-name { display: none; }
.dsc-now-diag svg { width: 64px; height: auto; }

/* Linha do tempo de acordes */
.dsc-tl {
  position: relative;
  margin: 0.2rem 0 1rem;
  padding: 0.5rem 0 0;
}
.dsc-tl-scroll {
  position: relative;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  padding-bottom: 0.35rem;
}
.dsc-tl-lane {
  position: relative;
  height: 3rem;
  min-width: 100%;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--an-line);
}
.dsc-tl-seg {
  position: absolute;
  top: 4px;
  bottom: 4px;
  display: flex;
  align-items: center;
  padding: 0 0.4rem;
  border-radius: 8px;
  border: 1px solid rgba(251, 191, 36, 0.2);
  background: rgba(251, 191, 36, 0.07);
  color: #e2e8f0;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 650;
  overflow: hidden;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.dsc-tl-seg:hover { background: rgba(251, 191, 36, 0.16); }
.dsc-tl-seg.is-now {
  background: linear-gradient(180deg, #fcd34d, var(--an-amber-2));
  color: #1a1203;
  border-color: transparent;
}
.dsc-tl-head {
  position: absolute;
  top: -4px;
  bottom: -4px;
  left: 0;
  width: 2px;
  background: #fff;
  border-radius: 2px;
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.9);
  pointer-events: none;
  will-change: transform;
}
.dsc-tl-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 0.3rem;
  font-size: 0.72rem;
  color: #64748b;
  font-variant-numeric: tabular-nums;
}

body.page-descobrir-result .dsc-chord {
  border-radius: 10px;
  padding: 0.4rem 0.7rem;
  transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}
body.page-descobrir-result .dsc-chord:hover { border-color: rgba(251, 191, 36, 0.45); transform: translateY(-1px); }
body.page-descobrir-result .dsc-chord.is-now {
  background: linear-gradient(180deg, #fcd34d, var(--an-amber-2));
  border-color: transparent;
  color: #1a1203;
}
body.page-descobrir-result .dsc-chord.is-now em { color: rgba(26, 18, 3, 0.7); }

.dsc-chords-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.dsc-tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--an-line-2);
  background: rgba(255, 255, 255, 0.03);
  color: #eef6ff;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.18s ease, color 0.18s ease;
}
.dsc-tool-btn:hover { border-color: var(--an-amber); color: #fde68a; }
.dsc-tool-btn.is-ok { border-color: var(--an-green); color: var(--an-green); }

.dsc-diags {
  margin-top: 1.1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--an-line);
}
.dsc-diags h3 {
  margin: 0 0 0.6rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--an-muted);
}
.dsc-diags .cifra-diag-strip { gap: 0.5rem; flex-wrap: wrap; }
.dsc-diags .cifra-diag {
  padding: 0.45rem 0.4rem 0.2rem;
  border-radius: 12px;
  border: 1px solid var(--an-line);
  background: rgba(255, 255, 255, 0.025);
  color: #eef6ff;
}

/* Botões de compartilhar */
body.page-descobrir-result .dsc-share-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}
body.page-descobrir-result .dsc-share-row .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}
body.page-descobrir-result .dsc-share-row .btn svg { flex: 0 0 auto; }
body.page-descobrir-result .dsc-share-hint { color: var(--an-muted); font-size: 0.85rem; }

/* Link expirado */
.dsc-expired {
  display: grid;
  justify-items: start;
  gap: 0.6rem;
}
.dsc-expired-icon {
  display: grid;
  place-items: center;
  width: 3.2rem;
  height: 3.2rem;
  border-radius: 16px;
  color: var(--an-amber);
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.3);
}

/* ---------- Responsivo ---------- */
@media (max-width: 960px) {
  body.page-descobrir .dsc-hero { grid-template-columns: minmax(0, 1fr); }
  .dsc-feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .dsc-sources { gap: 0.45rem; }
  .dsc-source {
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 0.65rem 0.4rem;
    text-align: center;
  }
  .dsc-source-text { justify-items: center; }
  .dsc-source-text strong { font-size: 0.82rem; }
  .dsc-source-text em { display: none; }
  .dsc-readout-stats { grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr); }
  .dsc-feature-grid { grid-template-columns: minmax(0, 1fr); }
  .dsc-tl-block { font-size: 0.72rem; height: 2.1rem; }
  .dsc-timeline-track { gap: 3px; }

  /* Tabela vira lista de cards */
  body.page-descobrir #dscAnalyze .sep-table thead { display: none; }
  body.page-descobrir #dscAnalyze .sep-table,
  body.page-descobrir #dscAnalyze .sep-table tbody { display: block; }
  body.page-descobrir #dscAnalyze .sep-row {
    display: grid;
    grid-template-columns: auto auto 1fr;
    align-items: center;
    gap: 0.35rem 0.5rem;
    padding: 0.8rem 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  }
  body.page-descobrir #dscAnalyze .sep-row td { padding: 0; border: 0; }
  body.page-descobrir #dscAnalyze .sep-row td:first-child { grid-column: 1 / -1; }
  body.page-descobrir #dscAnalyze .sep-row td:nth-child(2) { display: none; }
  body.page-descobrir #dscAnalyze .sep-row td:nth-child(5) { justify-self: end; grid-column: 3; }
  body.page-descobrir #dscAnalyze .sep-row td.sep-actions { grid-column: 1 / -1; }
  body.page-descobrir #dscAnalyze .sep-row td.sep-actions:empty { display: none; }
  body.page-descobrir #dscAnalyze .sep-empty { display: block; }
  body.page-descobrir #dscAnalyze .sep-empty td { display: block; }

  body.page-descobrir-result .dsc-now-chord { gap: 0.75rem; }
  .dsc-now-diag svg { width: 52px; }
}

@media (prefers-reduced-motion: reduce) {
  .dsc-odo-strip,
  .dsc-odo-col,
  .dsc-source,
  .dsc-feature,
  .dsc-tl-block,
  .dsc-tl-seg { transition: none !important; }
  .dsc-readout *,
  body.page-descobrir-result .dsc-stat,
  body.page-descobrir-result .dsc-now-chord strong,
  .dsc-status::before { animation: none !important; }
}

/* Ajustes finos do resultado */
body.page-descobrir-result .dsc-now-chord .dsc-now-next {
  display: grid;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--an-muted);
}
body.page-descobrir-result .dsc-now-chord .dsc-now-next[hidden] { display: none; }
body.page-descobrir-result .dsc-now-chord .dsc-now-next b {
  font-size: 1.1rem;
  letter-spacing: 0;
  text-transform: none;
  color: #eef6ff;
}
body.page-descobrir-result .dsc-now-chord .dsc-now-diag {
  margin-left: auto;
  font-size: inherit;
  letter-spacing: 0;
  text-transform: none;
  color: #eef6ff;
}
body.page-descobrir-result .dsc-now-diag svg { width: 76px; }
body.page-descobrir-result .dsc-chords-panel .dsc-chords {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
body.page-descobrir-result .dsc-chords-head {
  font-family: var(--display, "Source Serif 4", Georgia, serif);
  font-size: 1.45rem;
  margin: 0;
}
body.page-descobrir-result .dsc-chords-head-row { flex-wrap: wrap; gap: 0.5rem 1rem; margin-bottom: 0.4rem; }
body.page-descobrir-result .dsc-chords-hint { margin: 0; }
@media (max-width: 640px) {
  body.page-descobrir-result .dsc-now-diag svg { width: 58px; }
}

/* ==========================================================================
   AfinadorLab
   ========================================================================== */
body.page-afinadorlab .afl-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(1.25rem, 3vw, 2.5rem);
  justify-items: stretch;
}
body.page-afinadorlab .afl-hero-copy {
  display: grid;
  justify-items: start;
  gap: 0.75rem;
  min-width: 0;
}
body.page-afinadorlab .afl-hero-copy > * { margin: 0; }
body.page-afinadorlab .afl-hero h1 {
  font-family: var(--display, "Source Serif 4", Georgia, serif);
  letter-spacing: -0.02em;
}

/* Antes/depois */
.afl-viz {
  margin: 0;
  display: grid;
  gap: 0.6rem;
  padding: 1rem 1.1rem;
  border-radius: 20px;
  border: 1px solid rgba(52, 211, 153, 0.22);
  background:
    radial-gradient(110% 80% at 100% 0%, rgba(52, 211, 153, 0.12), transparent 60%),
    linear-gradient(180deg, #0d1522, #070b14);
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.4);
  min-width: 0;
}
.afl-viz-head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.afl-viz-head em {
  margin-left: auto;
  font-style: normal;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--an-muted);
}
.afl-viz-tag { padding: 0.15rem 0.55rem; border-radius: 999px; }
.afl-viz-tag.is-before { color: #cbd5e1; background: rgba(238, 246, 255, 0.07); }
.afl-viz-tag.is-after { color: #a7f3d0; background: rgba(52, 211, 153, 0.14); }
.afl-viz-arrow { color: var(--an-muted); }
.afl-viz svg { display: block; width: 100%; height: auto; aspect-ratio: 2 / 1; overflow: visible; }
.afl-viz-grid line { stroke: rgba(238, 246, 255, 0.08); stroke-width: 1; }
.afl-viz-notes text { fill: #64748b; font-size: 9px; font-family: var(--font, sans-serif); }
.afl-viz-before {
  fill: none;
  stroke: rgba(238, 246, 255, 0.5);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 3 4;
}
.afl-viz-after {
  fill: none;
  stroke: url(#aflAfter);
  stroke-width: 4;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.afl-viz-dots circle { fill: #ecfdf5; }
.afl-viz-mask { transform-origin: 0 0; transform: scaleX(1); }
.afl-viz-scan { stroke: #fbbf24; stroke-width: 1.5; opacity: 0; }
.afl-viz.is-live .afl-viz-mask { animation: aflReveal 6s cubic-bezier(0.45, 0, 0.25, 1) infinite; }
.afl-viz.is-live .afl-viz-scan { animation: aflScan 6s cubic-bezier(0.45, 0, 0.25, 1) infinite; }
@keyframes aflReveal {
  0% { transform: scaleX(0); }
  55% { transform: scaleX(1); }
  90% { transform: scaleX(1); }
  100% { transform: scaleX(0); }
}
@keyframes aflScan {
  0% { transform: translateX(0); opacity: 0.9; }
  55% { transform: translateX(360px); opacity: 0.9; }
  60%, 100% { transform: translateX(360px); opacity: 0; }
}
.afl-viz-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  margin: 0;
  font-size: 0.78rem;
  color: var(--an-muted);
}
.afl-viz-legend span { display: inline-flex; align-items: center; gap: 0.4rem; }
.afl-viz-legend span::before { content: ""; width: 16px; height: 0; border-top: 2px dashed rgba(238, 246, 255, 0.5); }
.afl-viz-legend span.is-after::before { border-top: 3px solid var(--an-green); }

/* Etapas */
.afl-stepper {
  list-style: none;
  margin: 0;
  padding: 1rem 1.1rem 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}
.afl-stepper li {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.6rem 0.7rem;
  border-radius: 12px;
  border: 1px solid var(--an-line);
  color: var(--an-muted);
  font-size: 0.85rem;
  min-width: 0;
  transition: border-color 0.25s ease, color 0.25s ease, background-color 0.25s ease;
}
.afl-stepper li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.afl-stepper b {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  font-size: 0.8rem;
  background: rgba(238, 246, 255, 0.06);
  color: #cbd5e1;
}
.afl-stepper li.is-current {
  color: #eef6ff;
  border-color: rgba(52, 211, 153, 0.45);
  background: rgba(52, 211, 153, 0.07);
}
.afl-stepper li.is-current b { background: var(--an-green); color: #04221a; }
.afl-stepper li.is-done { color: #a7f3d0; }
.afl-stepper li.is-done b { background: rgba(52, 211, 153, 0.18); color: var(--an-green); }

/* Gravação */
.afl-record-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) auto minmax(0, 1fr);
  align-items: stretch;
  gap: 1rem;
}
.afl-record-grid > .afl-divider { flex-direction: column; margin: 0; }
.afl-record-grid > .afl-divider::before,
.afl-record-grid > .afl-divider::after { width: 1px; height: auto; flex: 1; }
.afl-rec-card,
.afl-drop {
  display: grid;
  align-content: start;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 16px;
  border: 1px solid var(--an-line);
  background: rgba(255, 255, 255, 0.025);
  min-width: 0;
}
.afl-rec-head { display: flex; align-items: center; gap: 0.5rem; }
.afl-rec-head strong { font-size: 0.95rem; }
.afl-rec-dot { width: 10px; height: 10px; border-radius: 50%; background: #64748b; }
.afl-app.is-recording .afl-rec-dot { background: #ff5c7a; animation: aflRec 1.2s ease-in-out infinite; }
.afl-app.is-recording .afl-rec-card { border-color: rgba(255, 92, 122, 0.45); }
@keyframes aflRec {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.8); }
}
.afl-rec-time {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  font-size: 1.05rem;
  color: #eef6ff;
}
body.page-afinadorlab .afl-mic-row { display: block; }
.afl-meter {
  position: relative;
  display: block;
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: repeating-linear-gradient(90deg, rgba(238, 246, 255, 0.09) 0 6px, transparent 6px 9px);
}
.afl-meter i {
  position: absolute;
  inset: 0;
  transform-origin: left center;
  transform: scaleX(var(--lvl, 0));
  background: linear-gradient(90deg, #34d399 0%, #34d399 60%, #fbbf24 82%, #ff5c7a 100%);
  -webkit-mask: repeating-linear-gradient(90deg, #000 0 6px, transparent 6px 9px);
  mask: repeating-linear-gradient(90deg, #000 0 6px, transparent 6px 9px);
  transition: transform 0.08s linear;
}
body.page-afinadorlab .afl-actions { justify-content: flex-start; margin: 0; }
.afl-rec-btn,
.afl-stop-btn { display: inline-flex; align-items: center; gap: 0.5rem; }
.afl-rec-icon { width: 12px; height: 12px; border-radius: 50%; background: #ff5c7a; box-shadow: 0 0 0 3px rgba(255, 92, 122, 0.25); }
.afl-stop-icon { width: 11px; height: 11px; border-radius: 2px; background: currentColor; }
.afl-tip { margin: 0; font-size: 0.8rem; color: #64748b; }
.afl-drop {
  justify-items: center;
  text-align: center;
  border-style: dashed;
  border-color: rgba(52, 211, 153, 0.3);
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.afl-drop.is-drag { border-color: var(--an-green); background: rgba(52, 211, 153, 0.08); }
body.page-afinadorlab .afl-drop .afl-actions { justify-content: center; }
.afl-drop-icon {
  display: grid;
  place-items: center;
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 14px;
  color: var(--an-green);
  background: rgba(52, 211, 153, 0.1);
}
.afl-drop-sub { font-size: 0.8rem; color: var(--an-muted); }

/* Processando */
.afl-processing:not([hidden]) { display: grid; gap: 0.75rem; justify-items: center; text-align: center; padding: 1rem 0; }
.afl-processing .afl-progress { max-width: 32rem; }
.afl-proc-viz { display: flex; align-items: center; gap: 4px; height: 44px; }
.afl-proc-viz i {
  width: 5px;
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(180deg, #34d399, #22d3ee);
  transform: scaleY(0.25);
  animation: aflProc 1.1s ease-in-out infinite alternate;
}
.afl-proc-viz i:nth-child(3n) { animation-delay: -0.4s; }
.afl-proc-viz i:nth-child(3n + 1) { animation-delay: -0.75s; }
.afl-proc-viz i:nth-child(4n) { animation-delay: -0.2s; }
.afl-step[hidden] .afl-proc-viz i { animation: none; }
@keyframes aflProc {
  0% { transform: scaleY(0.2); }
  100% { transform: scaleY(1); }
}
body.page-afinadorlab .afl-progress i { background: linear-gradient(90deg, #22d3ee, #34d399); }

/* Resultado */
.afl-listen {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.6rem;
}
.afl-listen-item {
  display: grid;
  gap: 0.4rem;
  padding: 0.75rem;
  border-radius: 14px;
  border: 1px solid var(--an-line);
  background: rgba(255, 255, 255, 0.025);
  min-width: 0;
}
.afl-listen-item[hidden] { display: none; }
.afl-listen-item.is-after { border-color: rgba(52, 211, 153, 0.35); }
.afl-listen-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--an-muted);
}
.afl-listen-item.is-after .afl-listen-label { color: #a7f3d0; }
.afl-editor { display: grid; gap: 0.6rem; margin-top: 0.4rem; min-width: 0; }
.afl-editor-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.afl-editor-head h3 { margin: 0; font-size: 1.05rem; }
body.page-afinadorlab .afl-editor .afl-zoom { margin: 0; }
body.page-afinadorlab .afl-hint { margin: 0; font-size: 0.82rem; }
body.page-afinadorlab .afl-chart { border-radius: 14px; }
.afl-final { padding-top: 0.8rem; border-top: 1px solid var(--an-line); }

/* Como funciona */
body.page-afinadorlab .afl-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
}
body.page-afinadorlab .afl-steps li {
  display: grid;
  gap: 0.5rem;
  align-content: start;
  padding: 1rem;
  border-radius: 14px;
  border: 1px solid var(--an-line);
  background: rgba(255, 255, 255, 0.02);
  color: var(--an-muted);
  font-size: 0.9rem;
  line-height: 1.45;
}
body.page-afinadorlab .afl-steps li b {
  display: grid;
  place-items: center;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 50%;
  background: rgba(52, 211, 153, 0.14);
  color: var(--an-green);
}
body.page-afinadorlab .afl-help h2 { font-family: var(--display, "Source Serif 4", Georgia, serif); font-size: 1.4rem; }

@media (max-width: 900px) {
  body.page-afinadorlab .afl-hero { grid-template-columns: minmax(0, 1fr); }
  .afl-record-grid { grid-template-columns: minmax(0, 1fr); }
  .afl-record-grid > .afl-divider { flex-direction: row; }
  .afl-record-grid > .afl-divider::before,
  .afl-record-grid > .afl-divider::after { width: auto; height: 1px; }
  body.page-afinadorlab .afl-steps { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .afl-stepper { gap: 0.35rem; padding: 0.8rem 0.8rem 0; }
  .afl-stepper li { flex-direction: column; text-align: center; padding: 0.5rem 0.3rem; font-size: 0.72rem; gap: 0.3rem; }
  .afl-stepper li span { white-space: normal; }
}
@media (prefers-reduced-motion: reduce) {
  .afl-viz .afl-viz-mask,
  .afl-viz .afl-viz-scan,
  .afl-proc-viz i,
  .afl-app.is-recording .afl-rec-dot { animation: none !important; }
  .afl-proc-viz i { transform: scaleY(0.6); }
  .afl-meter i,
  .afl-stepper li { transition: none; }
}

body.page-afinadorlab .afl-editor .afl-hint { text-align: left; }
