/* Melodis: estilos do produto. Mobile first; menu lateral a partir de 900 px.
   Direção "vidro e aurora" do design system "Melodis": cores, raios e sombras só por tokens
   (tokens.css, gerado de docs/design-system/tokens.json); componentes m-* em components.css. */
* { box-sizing: border-box; }
:root { --gutter: 20px; --nav-w: 260px; }

html, body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
body { min-height: 100vh; overflow-x: hidden; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-text); }
button, input, textarea { font-family: inherit; font-size: inherit; }
input::placeholder, textarea::placeholder { color: var(--ink-faint); }
h1, h2, h3 { font-family: var(--font-display); font-weight: 800; letter-spacing: -0.02em; }
h1 { margin: 0; font-size: 28px; line-height: 1.1; }
h2 { margin: 24px 0 8px; font-size: 18px; line-height: 1.25; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Aurora: manchas de luz fixas atrás de tudo (layout.html). */
.app-aurora { position: fixed; z-index: 0; }
.app-aurora-1 { width: 460px; height: 460px; left: -200px; top: -140px; }
.app-aurora-2 { width: 400px; height: 400px; right: -190px; top: -120px; }
.app-aurora-3 { width: 420px; height: 420px; right: -180px; top: 45%; }
.app-aurora-4 { width: 460px; height: 460px; left: -160px; bottom: -240px; }
@media (min-width: 900px) {
  .app-aurora-1 { width: 760px; height: 760px; left: -260px; top: -320px; }
  .app-aurora-2 { width: 680px; height: 680px; right: -200px; top: -260px; }
  .app-aurora-3 { width: 700px; height: 700px; right: auto; left: 40%; top: 50%; }
  .app-aurora-4 { width: 720px; height: 720px; left: -220px; bottom: -400px; }
}
.screen, .topbar, .tabbar, .sidenav, .ready-toast { position: relative; z-index: 1; }

/* Vidro: os cartões flutuam sobre a aurora; sem desfoque, ficam opacos. */
.card, .song-card, .home-list, .review-canvas-wrap, .sidenav, .sheet-body, .action-panel, .ready-toast, .topbar, .tabbar {
  background: linear-gradient(160deg, var(--glass-hi) 0%, var(--glass-lo) 100%);
  border: 1px solid var(--line-glass);
  box-shadow: var(--shadow-glass);
  -webkit-backdrop-filter: blur(var(--blur-glass));
  backdrop-filter: blur(var(--blur-glass));
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .card, .song-card, .home-list, .review-canvas-wrap, .sidenav, .sheet-body, .action-panel, .ready-toast, .topbar, .tabbar, .m-glass { background: var(--ground-raised); }
}
@media (prefers-reduced-transparency: reduce) {
  .card, .song-card, .home-list, .review-canvas-wrap, .sidenav, .sheet-body, .action-panel, .ready-toast, .topbar, .tabbar, .m-glass, .m-popover {
    background: var(--ground-raised); -webkit-backdrop-filter: none; backdrop-filter: none;
  }
}
p { margin: 0; }
.muted { color: var(--ink-muted); }
.small { font-size: 13px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Shell */
.screen {
  max-width: none;
  margin: 0 auto;
  padding: 56px var(--gutter) 120px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.sidenav { display: none; }

@media (min-width: 900px) {
  /* O menu lateral já tem o nome e o "Sair": os Ajustes não repetem o cartão da conta. */
  body.with-nav .settings-account { display: none; }
  body.with-nav { display: flex; min-height: 100vh; }
  body.with-nav .sidenav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: var(--nav-w);
    flex-shrink: 0;
    margin: var(--space-6) 0 var(--space-6) var(--space-6);
    padding: 22px 14px;
    border-radius: 30px;
    position: sticky;
    top: var(--space-6);
    height: calc(100vh - 2 * var(--space-6));
  }
  body.with-nav .screen {
    flex: 1;
    min-width: 0;
    max-width: none;
    padding: 36px 40px 40px;
    gap: 24px;
  }
}
.sidenav-top { display: flex; align-items: center; justify-content: space-between; padding: 0 0 12px; }
.sidenav-brand { display: flex; align-items: center; padding: 4px 8px; }
.sidenav-logo { display: block; height: 44px; width: auto; }
/* O ícone redondo só no menu retraído do desktop; oculto, o leitor de tela lê um só "Melodis". */
.sidenav-icon { display: none; width: 36px; height: 36px; }
.sidenav-toggle { width: 36px; height: 36px; border-radius: 18px; border: 1px solid var(--line-glass); background: transparent; color: var(--ink-muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.sidenav-toggle:hover { color: var(--ink); border-color: var(--ink-muted); }
.sidenav-exit { gap: 6px; }
.sidenav-exit-icon { display: none; }
/* Menu retraído (só no desktop): só os ícones, rótulos acessíveis mas invisíveis. */
@media (min-width: 900px) {
  html[data-nav="collapsed"] body.with-nav .sidenav { width: 84px; padding-left: 12px; padding-right: 12px; }
  html[data-nav="collapsed"] .sidenav-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  html[data-nav="collapsed"] .sidenav-brand { padding: 4px 0; }
  html[data-nav="collapsed"] .sidenav-logo { display: none; }
  html[data-nav="collapsed"] .sidenav-icon { display: block; }
  html[data-nav="collapsed"] .sidenav-top { flex-direction: column; gap: 8px; align-items: center; }
  html[data-nav="collapsed"] .sidenav-toggle svg { transform: rotate(180deg); }
  html[data-nav="collapsed"] .sidenav-link { justify-content: center; padding: 0; gap: 0; }
  html[data-nav="collapsed"] .sidenav-user { justify-content: center; padding: 10px 6px; gap: 6px; flex-direction: column; }
  html[data-nav="collapsed"] .sidenav-exit-icon { display: inline; }
}
/* Celular: barra de cima (logotipo e Ajustes) e abas embaixo; o menu lateral é só do desktop. */
.topbar, .tabbar { display: none; }
@media (max-width: 899px) {
  body.with-nav .topbar {
    display: flex; justify-content: space-between; align-items: center;
    position: sticky; top: 0; z-index: 20;
    padding: 6px calc(var(--gutter) - 8px) 6px var(--gutter);
    border-width: 0 0 1px; border-radius: 0; box-shadow: none;
  }
  .topbar-brand { display: flex; align-items: center; min-height: var(--size-touch); }
  .topbar-brand img { display: block; height: 32px; width: auto; }
  .topbar-btn {
    width: var(--size-touch); height: var(--size-touch); border-radius: 22px;
    display: inline-flex; align-items: center; justify-content: center;
    background: transparent; border: 0; color: var(--ink-muted); cursor: pointer;
  }
  .topbar-btn { border: 1px solid var(--line-glass); background: linear-gradient(160deg, var(--glass-hi), var(--glass-lo)); color: var(--ink); }
  .topbar-btn:hover, .topbar-btn.active { color: var(--accent); border-color: var(--accent-line); }
  /* O fim da página fica livre para a barra de abas flutuante (68 px a 24 px do fundo). */
  body.with-nav .screen { padding-top: 16px; padding-bottom: calc(var(--size-tabbar) + 48px + env(safe-area-inset-bottom)); }
  body.with-nav.immersive .screen { padding-bottom: 40px; }
  /* Pílula de vidro flutuante: Início, Aquecer, +, Músicas e Minha voz. */
  body.with-nav .tabbar {
    display: flex; align-items: center; justify-content: space-between; gap: 2px;
    position: fixed; left: 16px; right: 16px; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 20;
    height: var(--size-tabbar); padding: 0 8px; border-radius: var(--radius-pill);
  }
  body.with-nav:not(.immersive)::after {
    content: ""; position: fixed; left: 0; right: 0; bottom: 0; height: 130px; z-index: 15; pointer-events: none;
    background: linear-gradient(180deg, transparent 0%, color-mix(in srgb, var(--ground) 92%, transparent) 60%);
  }
  .tab {
    flex: 1 1 0; min-width: var(--size-touch); max-width: 88px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    height: 52px; border-radius: var(--radius-pill);
    color: var(--ink-muted); font-size: 11px; font-weight: 600; text-decoration: none; white-space: nowrap;
  }
  .tab svg { width: 20px; height: 20px; }
  .tab:hover { color: var(--ink); }
  .tab.active { background: var(--accent-tint); color: var(--accent); font-weight: 700; }
  .tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
  .tab-add {
    flex: 0 0 52px; width: 52px; border-radius: 50%;
    background: linear-gradient(95deg, var(--accent-hi), var(--accent-deep)); color: var(--on-accent); box-shadow: var(--shadow-cta);
  }
  .tab-add:hover { color: var(--on-accent); filter: brightness(1.06); }
  /* Com as abas, o botão fixo de uma tela fica acima delas. */
  body.with-nav:not(.immersive) .fab-wrap { bottom: calc(var(--size-tabbar) + 24px + env(safe-area-inset-bottom)); }
  body.with-nav:not(.immersive) .submit-wrap { bottom: calc(var(--size-tabbar) + 24px + env(safe-area-inset-bottom)); }
}
.sidenav-add { margin: 14px 0; height: 48px; gap: 8px; font-size: 14px; padding: 0 16px; }
@media (min-width: 900px) {
  html[data-nav="collapsed"] .sidenav-add { padding: 0; gap: 0; width: 48px; align-self: center; border-radius: 50%; }
}
.sidenav-link {
  display: flex; align-items: center; gap: 12px;
  height: var(--size-touch); padding: 0 12px;
  border-radius: var(--radius-chip);
  color: var(--ink-muted); font-size: 15px; font-weight: 600;
}
.sidenav-link { border-radius: 16px; color: var(--ink-soft); font-size: 14px; }
.sidenav-link:hover { background: var(--glass-fill); color: var(--ink); }
.sidenav-link.active { background: var(--accent-tint); color: var(--accent); font-weight: 700; }
.sidenav-spacer { flex: 1; }
.sidenav-user { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 18px; background: var(--glass-fill); border: 1px solid var(--line-soft); }
.sidenav-name { flex: 1; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 32px; height: 32px; border-radius: 16px; object-fit: cover; }

/* Botões */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: var(--size-touch); padding: 0 20px;
  border-radius: var(--radius-pill); border: 1px solid var(--line-glass);
  background: linear-gradient(160deg, var(--glass-hi), var(--glass-lo)); color: var(--ink);
  font-size: 15px; font-weight: 600; cursor: pointer; text-decoration: none;
}
.btn:hover { color: var(--ink); border-color: var(--line-strong); }
.btn-primary {
  background: linear-gradient(95deg, var(--accent-hi) 0%, var(--accent-deep) 100%); color: var(--on-accent);
  border: 0; box-shadow: var(--shadow-cta); height: var(--size-btn);
  font-family: var(--font-display); font-size: 16px; font-weight: 800;
}
.btn-primary:hover { color: var(--on-accent); filter: brightness(1.06); }
.btn-block { width: 100%; }
.btn-danger { color: var(--score-off); border-color: var(--score-off); }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 600; cursor: pointer; min-height: var(--size-touch); display: inline-flex; align-items: center; }
.link-btn:hover { color: var(--accent-text); }

/* Entrada */
/* Entrar e Criar conta: o ícone em vidro com anéis e linhas de voz, o título e o cartão. */
.enter { max-width: 420px; width: 100%; margin: 4vh auto 0; display: flex; flex-direction: column; gap: 22px; text-align: center; }
.enter-brand { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.enter-orb { position: relative; width: 200px; height: 200px; display: flex; align-items: center; justify-content: center; }
.enter-orb::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--accent) 30%, transparent) 0%, color-mix(in srgb, var(--aurora-violet) 26%, transparent) 55%, transparent 72%); }
.enter-ring { position: absolute; border-radius: 50%; border: 1px solid var(--line-glass); }
.enter-ring-1 { inset: 18px; }
.enter-ring-2 { inset: 44px; border-color: var(--line-soft); }
.enter-icon { position: relative; width: 104px; height: 104px; border-radius: 32px; display: flex; align-items: center; justify-content: center; }
.enter-icon img { width: 62px; height: 62px; }
.enter-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.enter-lines path { fill: none; stroke-width: 2; stroke-linecap: round; }
.enter-line-you { stroke: var(--accent); stroke-opacity: .55; }
.enter-line-singer { stroke: var(--singer); stroke-opacity: .45; stroke-dasharray: 2 6; }
.enter-logo { display: block; height: 40px; width: auto; }
.enter-title { font-size: 30px; line-height: 1.12; text-wrap: balance; }
.enter-sub { max-width: 320px; color: var(--ink-muted); font-size: 15px; text-wrap: pretty; }
.enter-card { border-radius: 30px; padding: var(--space-5); display: flex; flex-direction: column; gap: 14px; text-align: left; }
.enter-card .divider, .enter-card .muted { text-align: center; justify-content: center; }
.enter-switch { text-align: center; font-size: 14px; color: var(--ink-muted); }
.enter-switch a { font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.enter > .muted { text-align: center; }
@media (min-width: 900px) { .enter { margin-top: 6vh; } .enter-title { font-size: 34px; } }
.flash { padding: 12px 14px; border-radius: var(--radius-tile); background: var(--ground-raised); }
.flash-error { color: var(--score-off); }

/* Texto corrido */
.prose { max-width: 640px; display: flex; flex-direction: column; gap: 10px; }
.prose p { color: var(--ink-muted); }

/* Cards genéricos */
.card { border-radius: var(--radius-card); padding: var(--space-5); display: flex; flex-direction: column; gap: 14px; }
.card-title { font-family: var(--font-display); font-size: 17px; font-weight: 800; color: var(--ink); letter-spacing: -0.01em; }
.center { text-align: center; align-items: center; }

/* Biblioteca */
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.btn-new-desktop { display: none; }
.library { display: flex; flex-direction: column; gap: 16px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; height: var(--size-touch); padding: 0 16px;
  border-radius: var(--radius-pill); border: 1px solid var(--line-glass); background: linear-gradient(160deg, var(--glass-hi), var(--glass-lo));
  color: var(--ink); font-size: 14px; font-weight: 600;
}
.chip.active { background: var(--light); color: var(--ink-on-light); border-color: var(--light); }
.cards { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.song-card { border-radius: var(--radius-card); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.song-top { display: flex; align-items: flex-start; gap: 4px; }
.song-top .song-main { flex: 1; }
.song-menu { margin: -6px -8px 0 0; }
.song-menu .action-panel { width: min(300px, calc(100vw - 40px)); }
.song-retry { display: flex; justify-content: flex-end; }
.song-group { display: flex; flex-direction: column; gap: 10px; }
.group-title { font-size: 13px; font-weight: 600; color: var(--ink-muted); text-transform: uppercase; letter-spacing: 0.6px; margin: 8px 0 0; }
.phrases-count { color: var(--ink-muted); white-space: nowrap; }
.btn-add { height: var(--size-touch); gap: 6px; }
.song-search input { width: 100%; }
.song-main { display: flex; gap: 14px; align-items: center; color: var(--ink); min-width: 0; }
.song-main:hover { color: var(--ink); }
.cover {
  width: 56px; height: 56px; border-radius: 4px; flex-shrink: 0; /* quadrada, como capa de disco */
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 18px; color: var(--on-accent);
}
.cover-l { width: 72px; height: 72px; font-size: 24px; }
/* A capa cobre as iniciais, que só aparecem sem imagem (ou se ela não carregar). */
.cover.has-image { position: relative; overflow: hidden; }
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.song-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.song-row { display: flex; justify-content: space-between; gap: 8px; }
.song-title { font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.song-tom { font-size: 13px; flex-shrink: 0; }
.song-sub { font-size: 13px; }
.song-card.failed .song-sub { color: var(--score-off); }
.progress { display: flex; align-items: center; gap: 10px; }
.bar { flex: 1; height: 6px; border-radius: 3px; background: var(--glass-fill); overflow: hidden; }
.fill { height: 6px; background: var(--accent); border-radius: 3px; }
.pct { font-size: 13px; font-weight: 600; width: 40px; text-align: right; }
.song-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.confirm summary { list-style: none; cursor: pointer; }
.confirm summary::-webkit-details-marker { display: none; }
.confirm form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.song-remove { align-self: flex-end; }
.song-tools { display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: flex-end; }
.song-tools details[open] { flex: 0 0 100%; }
:is(.song-edit, .song-cover) form { display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
:is(.song-edit, .song-cover) .field-error { margin: 0; }
:is(.song-edit, .song-cover) .btn { align-self: flex-end; }
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; padding: 48px 0; }
.fab-wrap {
  position: fixed; left: 0; right: 0; bottom: 0;
  padding: 16px var(--gutter) 32px;
  background: linear-gradient(180deg, transparent 0%, var(--ground) 40%);
}
.fab-wrap .btn { max-width: 720px; margin: 0 auto; }
.soon { gap: 12px; padding: 32px 20px; }
@media (min-width: 900px) {
  .btn-new-desktop { display: inline-flex; height: var(--size-touch); font-size: 15px; }
  .fab-wrap { display: none; }
  .fab-wrap + * { padding-bottom: 0; }
  .cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
}

/* Nova música */
.back-head { justify-content: flex-start; gap: 4px; }
.icon-btn { width: var(--size-touch); height: var(--size-touch); display: inline-flex; align-items: center; justify-content: center; color: var(--ink); margin-left: -12px; }
/* Uma coluna centralizada com dois passos numerados: a origem e a letra. */
.new-song { display: flex; flex-direction: column; gap: 20px; width: 100%; max-width: 720px; margin: 0 auto; }
.step-title { display: flex; align-items: center; gap: 10px; margin: 0; }
.step-num {
  flex: none; width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-tint); color: var(--accent); font-size: 14px; font-weight: 800;
}
.step-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.step-heading { display: flex; flex-direction: column; gap: 2px; }
.step-heading .muted { padding-left: 38px; }
.lyrics-search[aria-disabled="true"] { opacity: .45; cursor: not-allowed; pointer-events: none; }
.lyrics-search-hint { margin: -6px 0 0; }
.source-picker { position: relative; display: flex; flex-wrap: wrap; gap: 8px; }
.source-option {
  flex: 1 1 auto; display: flex; align-items: center; justify-content: center;
  min-height: var(--size-touch); padding: 0 14px; border-radius: var(--radius-tile);
  border: 1px solid var(--line-glass); color: var(--ink); font-size: 14px; text-align: center; cursor: pointer;
}
.source-picker input[type=radio]:checked + .source-option { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.source-picker input[type=radio]:focus-visible + .source-option { outline: 2px solid var(--accent); outline-offset: 2px; }
.source-picker .source-panel { display: none; flex: 0 0 100%; margin-top: 8px; }
#source-link:checked ~ .source-panel-link,
#source-file:checked ~ .source-panel-file,
#source-search:checked ~ .source-panel-search { display: flex; flex-direction: column; }
.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 96px; padding: 16px; border-radius: var(--radius-tile);
  border: 1px dashed var(--line-strong); color: var(--ink); cursor: pointer; text-align: center;
}
.dropzone svg { color: var(--accent); }
.dropzone:focus-within { border-color: var(--accent); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 14px; color: var(--ink-muted); }
.field input, .field textarea, .field select {
  width: 100%; border-radius: var(--radius-tile); border: 1px solid var(--line-glass);
  background: rgba(7,6,13,.45); color: var(--ink); padding: 0 16px; font-size: 15px; outline: none;
}
.field input, .field select { height: 50px; border-radius: var(--radius-pill); }
.field textarea { padding: 12px 14px; line-height: 1.5; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent-line); box-shadow: var(--shadow-select); }
.submit-wrap { position: sticky; bottom: 0; padding: 16px 0 24px; background: linear-gradient(180deg, transparent 0%, var(--ground) 40%); }
@media (min-width: 900px) {
  .dropzone { min-height: 120px; }
  .submit-wrap { position: static; padding: 0; background: none; }
  .submit-wrap .btn { height: 52px; }
}

/* Progresso */
.song-head { display: flex; gap: 14px; align-items: center; }
.song-head-title { font-size: 18px; font-weight: 700; }
.progress-body { display: flex; flex-direction: column; gap: 16px; }
.overall .pct { width: 44px; }
.fill-ok { background: var(--score-good); transition: width .6s ease; }
.status-card { display: flex; gap: 14px; align-items: flex-start; }
.status-card h2 { margin: 0 0 4px; font-size: 18px; }
.status-card p { margin: 0; }
.status-icon { width: 32px; height: 32px; border-radius: 16px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 18px; background: var(--glass-fill); }
.queue-card .status-icon { background: var(--accent); color: var(--on-accent); }
.queue-position { font-size: 22px; font-weight: 700; color: var(--accent); margin: 2px 0 4px !important; }
.paused-card { border: 1px solid var(--line-strong); }
.paused-card .status-icon { background: var(--score-near); color: var(--on-accent); }
.ring { width: 20px; height: 20px; border-radius: 50%; border: 3px solid var(--line-glass); border-top-color: var(--accent); box-sizing: border-box; animation: spin 1s linear infinite; }
.stepper { list-style: none; margin: 0; padding: 0 4px; display: flex; flex-direction: column; }
.step { display: flex; gap: 14px; align-items: flex-start; min-height: 40px; position: relative; padding-left: 42px; }
.step.agora { min-height: 60px; }
.step .dot {
  position: absolute; left: 0; top: 0;
  width: 28px; height: 28px; border-radius: 14px; box-sizing: border-box;
  border: 2px solid var(--line-glass); background: var(--ground-raised);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: var(--ground);
}
.step::after { content: ""; position: absolute; left: 13px; top: 30px; bottom: 2px; width: 2px; background: var(--line-glass); }
.step:last-child::after { display: none; }
.step.feito .dot { background: var(--score-good); border-color: var(--score-good); }
.step.feito::after { background: var(--score-good); }
.step.agora .dot { border-color: var(--accent); background: var(--ground); animation: pulse 1.6s ease-in-out infinite; }
.step.agora .dot .ring { width: 16px; height: 16px; border-width: 2px; }
.step-text { display: flex; flex-direction: column; gap: 2px; padding-top: 3px; }
.step-label { font-size: 16px; font-weight: 600; }
.step-hint { font-size: 13px; color: var(--ink-muted); }
.step.feito .step-label { color: var(--ink-muted); }
.step.feito .step-hint { display: none; }
.step.depois .step-label { color: var(--ink-faint); font-weight: 500; }
.step.falhou .dot { background: var(--score-off); border-color: var(--score-off); color: var(--ground); }
.step.falhou .step-label { color: var(--score-off); }
.stage-meta { margin: 2px 0 0; font-size: 14px; font-weight: 600; color: var(--accent); }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 var(--accent-line); } 50% { box-shadow: 0 0 0 8px transparent; } }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .ring, .step.agora .dot { animation: none; }
  .fill-ok { transition: none; }
}
.eta-card { gap: 6px; }
.background-card { flex-direction: row; align-items: center; }
.eta { font-size: 15px; font-weight: 600; }
.done-card { gap: 12px; }
.done-mark { width: 56px; height: 56px; border-radius: 28px; background: var(--score-good); color: var(--ground); font-size: 28px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.failed-card h2, .done-card h2 { margin: 0; }
.error-text { color: var(--score-off); }
.song-card .fill-ok { transition: none; }
.song-sub-queue { color: var(--accent); font-weight: 600; }

/* Entrada e cadastro */
.auth-form { display: flex; flex-direction: column; gap: 14px; text-align: left; }
.auth-form .btn-primary { margin-top: 4px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--ink-muted); font-size: 13px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line-glass); }
.field-error { color: var(--score-off); font-size: 13px; }
.field.has-error input { border-color: var(--score-off); }

/* Fone e microfone */
.head-actions { display: flex; align-items: center; gap: 10px; }
.device-state { display: inline-flex; align-items: center; gap: 6px; min-height: var(--size-touch); padding: 0 10px; border-radius: var(--radius-pill); border: 1px solid var(--line-glass); color: var(--ink-muted); font-size: 13px; font-weight: 600; position: relative; }
.device-state::after { content: ""; width: 8px; height: 8px; border-radius: 4px; background: var(--ink-faint); position: absolute; top: 6px; right: 6px; }
.device-state.configured { color: var(--score-good); border-color: var(--score-good); }
.device-state.configured::after { background: var(--score-good); }
.device-state.unset { color: var(--accent); border-color: var(--line-strong); }
.device-state.unset::after { background: var(--accent); }
.device-state-text { display: none; }
.device { display: flex; flex-direction: column; gap: 16px; }
.device-steps { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; }
.device-step { flex: 1; display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ink-faint); padding-bottom: 10px; border-bottom: 3px solid var(--line-glass); }
.device-step-dot { width: 24px; height: 24px; border-radius: 12px; border: 2px solid var(--line-glass); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; color: var(--ink-muted); flex-shrink: 0; }
.device-step.agora { color: var(--ink); border-bottom-color: var(--accent); }
.device-step.agora .device-step-dot { border-color: var(--accent); color: var(--accent); }
.device-step.feito { color: var(--ink-muted); border-bottom-color: var(--score-good); }
.device-step.feito .device-step-dot { background: var(--score-good); border-color: var(--score-good); color: var(--ground); }
.device-panel[hidden] { display: none; }
.device-panel h2 { margin: 0; }
.device-big { font-size: 16px; }
.device-big strong { font-size: 26px; color: var(--score-good); }
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choice { display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 108px; padding: 14px 10px; border-radius: var(--radius-tile); border: 2px solid var(--line-glass); background: var(--ground); color: var(--ink); cursor: pointer; text-align: center; }
.choice-icon { font-size: 28px; }
.choice-label { font-weight: 600; }
.choice[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.device-warning { border: 1px solid var(--score-near); color: var(--ink); }
.countdown { min-height: 96px; display: flex; align-items: center; justify-content: center; font-size: 72px; font-weight: 700; color: var(--accent); letter-spacing: -2px; }
.click-dots { list-style: none; margin: 4px 0; padding: 0; display: flex; gap: 8px; justify-content: center; min-height: 24px; }
.click-dot { width: 20px; height: 20px; border-radius: 10px; border: 2px solid var(--line-glass); background: var(--ground-raised); transition: background .15s ease; }
.click-dot.feito { background: var(--score-good); border-color: var(--score-good); }
.device-status { min-height: 20px; }
.device-skip { align-self: center; }
@media (prefers-reduced-motion: reduce) { .click-dot { transition: none; } }
@media (min-width: 900px) {
  .device-state-text { display: inline; }
  .device-state::after { display: none; }
  .device-state { padding: 0 14px; }
}

/* Sessão de treino */
.trainer { display: flex; flex-direction: column; gap: 16px; }
.trainer-head { display: flex; align-items: center; gap: 8px; }
.trainer-title { flex: 1; min-width: 0; text-align: center; }
.trainer-song { font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trainer-artist { font-weight: 500; }
.trainer-device { padding: 0; width: var(--size-touch); justify-content: center; }
.trainer-device::after { top: 6px; right: 6px; }
.trainer-grid { display: flex; flex-direction: column; gap: 16px; }
.phrase-list { display: none; }
.trainer-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.lyrics-nav { display: flex; align-items: center; gap: 6px; }
.lyrics-nav > .icon-btn { display: none; }
.lyrics { flex: 1; display: flex; flex-direction: column; gap: 6px; text-align: center; min-width: 0; }
.lyric-side { background: none; border: 0; color: var(--ink-faint); font-size: 15px; min-height: 32px; cursor: pointer; padding: 2px 0; }
.lyric-label { color: var(--ink-muted); font-size: 14px; }
.lyric-now { font-size: 24px; font-weight: 700; line-height: 1.25; letter-spacing: -0.2px; }
.chart-card { padding: 12px 10px 8px; gap: 6px; }
.chart { display: block; width: 100%; height: 200px; }
.minimap { display: block; width: 100%; height: 28px; border-radius: 6px; background: var(--glass-fill); cursor: pointer; touch-action: none; }
.trainer:is([data-state="idle"], [data-state="paused"], [data-state="recorded"]) .chart { cursor: pointer; }
.trainer-status { text-align: center; min-height: 22px; }
.trainer[data-mode="livre"] .chart-card, .trainer[data-mode="livre"] .after-take { display: none; }
.trainer[data-state="along"] .ctl-rec { background: var(--ink); }
.after-take { display: flex; gap: 10px; }
.after-take .btn { flex: 1; }
.btn-light { background: var(--light); color: var(--ink-on-light); border-color: var(--light); font-weight: 700; }
.controls { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; justify-items: center; gap: 6px; padding-bottom: 8px; max-width: 420px; width: 100%; margin: 0 auto; }
.ctl { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 0; background: var(--ground-raised); color: var(--ink); cursor: pointer; font-size: 11px; font-weight: 600; font-family: inherit; }
.ctl-big { width: 64px; height: 64px; border-radius: 32px; }
.ctl-small { width: 48px; height: 48px; border-radius: 24px; background: transparent; border: 1px solid var(--line-glass); }
.ctl-rec { width: 88px; height: 88px; border-radius: 44px; background: var(--accent); color: var(--on-accent); font-size: 12px; font-weight: 700; box-shadow: var(--shadow-cta), 0 0 0 6px var(--accent-tint); }
.trainer[data-state="singing"] .ctl-rec { background: var(--ink); box-shadow: 0 0 0 6px var(--accent-line); }
.ctl-disabled { opacity: .45; cursor: default; }
.icon-btn.round { width: var(--size-touch); height: var(--size-touch); border-radius: 22px; border: 1px solid var(--line-glass); background: transparent; color: var(--ink); margin: 0; cursor: pointer; font-size: 20px; }
.phrase-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; overflow: auto; max-height: 70vh; }
.phrase-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: var(--size-touch); padding: 6px 10px; border-radius: var(--radius-chip); border: 0; background: transparent; color: var(--ink); text-align: left; font-size: 14px; cursor: pointer; font-family: inherit; }
.phrase-item.active { background: var(--glass-fill); font-weight: 600; }
.phrase-n { width: 22px; font-size: 12px; flex-shrink: 0; }
.phrase-text { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.phrase-mark { width: 8px; height: 8px; border-radius: 4px; flex-shrink: 0; }
.phrase-mark.recorded { background: var(--score-good); }
.phrase-mark[data-state="tom"] { background: var(--score-good); }
.phrase-mark[data-state="perto"] { background: var(--score-near); }
.phrase-mark[data-state="fora"] { background: var(--score-off); }
.phrase-mark[data-state="sem_voz"] { background: var(--ink-faint); }
.phrase-item.chosen { box-shadow: inset 3px 0 0 var(--accent); }
/* Avaliação da frase */
.evaluation { display: flex; flex-direction: column; gap: 10px; }
.syllables { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.syl { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 52px; height: 56px; padding: 6px 8px 0; border-radius: var(--radius-tile); border: 1px solid var(--glass-fill); background: var(--ground-raised); color: var(--ink); cursor: pointer; font-family: inherit; }
.syl[aria-pressed="true"] { border-color: var(--ink); }
.syl-text { font-size: 15px; font-weight: 600; }
.syl-shape { font-size: 12px; }
.syl-tom .syl-shape { color: var(--score-good); }
.syl-perto .syl-shape { color: var(--score-near); }
.syl-fora .syl-shape { color: var(--score-off); }
.syl-nao_avaliada { opacity: .45; }
.eval-cards { display: flex; gap: 10px; }
.eval-card { flex: 1; background: var(--ground-raised); border-radius: var(--radius-tile); padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.eval-value { font-size: 18px; font-weight: 700; }
/* Folha de ajustes */
.sheet { position: fixed; inset: 0; z-index: 20; }
.sheet-backdrop { position: absolute; inset: 0; background: color-mix(in srgb, var(--ground) 70%, transparent); border: 0; cursor: pointer; }
/* Uma caixa no centro da tela, em qualquer largura: até 560 px, 16 px de margem no celular. */
.sheet-body { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(560px, calc(100% - 32px)); box-sizing: border-box; border-radius: 24px; padding: 20px 24px 24px; display: flex; flex-direction: column; gap: 18px; max-height: 85vh; overflow: auto; }
.sheet-handle { display: none; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; }
.sheet-head h2 { margin: 0; }
.btn-small { height: 36px; padding: 0 14px; font-size: 14px; }
.setting { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.setting-col { flex-direction: column; align-items: stretch; gap: 8px; }
.setting-link { color: var(--ink); text-decoration: none; }
.meter-notice { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; border: 1px solid var(--score-near); color: var(--ink); }
.meter-notice a { color: var(--accent); font-weight: 600; }
.key-notice { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; border: 1px solid var(--accent); color: var(--ink); }
.key-notice-actions { display: flex; gap: 8px; margin-left: auto; }
.key-suggestion .card-row { align-items: center; }
.range-summary { margin: 6px 0 0; padding-left: 18px; }
[data-key-invite] a { color: var(--accent); font-weight: 600; }
.meter-notice .icon-btn { margin-left: auto; background: transparent; border-color: transparent; color: var(--ink-muted); font-size: 20px; }
.setting-name { font-size: 15px; font-weight: 600; }
.stepper-ctl { display: flex; align-items: center; gap: 8px; }
.stepper-value { width: 48px; text-align: center; font-weight: 700; }
.switch { width: 56px; height: 32px; border-radius: 16px; border: 0; background: var(--line-glass); position: relative; cursor: pointer; flex-shrink: 0; }
.switch[aria-checked="true"] { background: var(--accent); }
.switch-knob { position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 13px; background: var(--ink); transition: left .15s ease; }
.switch[aria-checked="true"] .switch-knob { left: 27px; }
.choice-row { display: flex; gap: 8px; }
.mode { flex: 1; height: var(--size-touch); border-radius: var(--radius-tile); border: 1px solid var(--line-glass); background: transparent; color: var(--ink); font-weight: 600; cursor: pointer; font-family: inherit; }
.mode[aria-pressed="true"] { background: var(--light); color: var(--ink-on-light); border-color: var(--light); }
@media (prefers-reduced-motion: reduce) { .switch-knob, .tuner-needle { transition: none; } }
@media (min-width: 900px) {
  .trainer-title { text-align: left; }
  .trainer-song { font-size: 18px; }
  .trainer-grid { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 28px; align-items: start; }
  .phrase-list { display: flex; }
  .lyrics-nav > .icon-btn { display: inline-flex; }
  .lyric-now { font-size: 30px; }
  .chart { height: 280px; }
}

/* Resultado */
.results { display: flex; flex-direction: column; gap: 18px; }
.results-title { text-align: left; }
.results-h1 { font-size: 20px; margin: 0; }
.results-h2 { font-size: 16px; margin: 0; }
.card-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.score-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.score-card { gap: 4px; }
.score-value { font-size: 32px; font-weight: 700; letter-spacing: -0.5px; }
.score-delta { color: var(--score-good); }
.evolution-card { grid-column: 1 / -1; gap: 10px; }
.evolution { display: block; width: 100%; height: 90px; }
.results-grid { display: flex; flex-direction: column; gap: 18px; }
.results-block { display: flex; flex-direction: column; gap: 10px; }
.weak-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.weak-card { gap: 8px; color: var(--ink); padding: 12px 14px; }
.weak-card:hover { color: var(--ink); }
.weak-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar { height: 6px; border-radius: 3px; background: var(--glass-fill); overflow: hidden; display: block; }
.fill { display: block; height: 100%; background: var(--accent); }
.fill-tom { background: var(--score-good); }
.fill-perto { background: var(--score-near); }
.fill-fora { background: var(--score-off); }
.fill-sem_voz { background: var(--ink-faint); }
.state-tom { color: var(--score-good); }
.state-perto { color: var(--score-near); }
.state-fora { color: var(--score-off); }
.state-sem_voz { color: var(--ink-faint); }
.state-none { color: var(--line-strong); }
.legend { display: flex; gap: 12px; flex-wrap: wrap; }
.chart-legend { justify-content: center; }
.scope-row { width: 100%; max-width: 360px; margin: 0 auto; }
.mode-small { height: 36px; font-size: 13px; white-space: nowrap; }
.trainer[data-scope="inteira"] .lyric-side[data-lyric-prev] { display: none; }
.trainer[data-scope="inteira"] .after-take { display: none; }
.chart-card { position: relative; }
.tuner { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; padding: 4px 2px 0; }
.tuner-head { display: flex; align-items: baseline; gap: 8px; }
.tuner-note { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tuner-text { color: var(--ink-muted); }
.tuner-tom .tuner-note, .tuner-tom .tuner-text { color: var(--score-good); }
.tuner-perto .tuner-note, .tuner-perto .tuner-text { color: var(--score-near); }
.tuner-fora .tuner-note, .tuner-fora .tuner-text { color: var(--score-off); }
.tuner-neutro .tuner-note { color: var(--accent); }
.tuner-bar { position: relative; width: 160px; height: 8px; border-radius: 4px; background: var(--glass-fill); margin-top: 4px; }
.tuner-zone { position: absolute; top: 0; bottom: 0; border-radius: 4px; background: var(--score-good); opacity: .35; }
.tuner-needle { position: absolute; top: -3px; width: 3px; height: 14px; margin-left: -1.5px; border-radius: 2px; background: var(--ink); transition: left 80ms linear; }
@media (min-width: 900px) {
  .tuner { flex-direction: row; align-items: center; justify-content: flex-end; gap: 14px; }
  .tuner-bar { width: 220px; margin-top: 0; }
}
.legend-singer { color: var(--singer); }
/* Nota fraca: o mesmo contorno pontilhado do gráfico, sem preenchimento. */
.legend-weak { display: inline-block; width: 1.1em; height: 0.55em; vertical-align: middle;
  border: 1.5px dotted var(--ink-muted); border-radius: 3px; }
.phrase-grid { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.phrase-cell { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; border: 1px solid var(--line-glass); color: var(--ink-muted); }
.phrase-cell.state-tom { background: var(--score-good); color: var(--ground); border-color: var(--score-good); }
.phrase-cell.state-perto { background: var(--score-near); color: var(--ground); border-color: var(--score-near); }
.phrase-cell.state-fora { background: var(--score-off); color: var(--ground); border-color: var(--score-off); }
.phrase-cell.state-sem_voz { background: var(--glass-fill); color: var(--ink); }
.phrase-rows { display: none; list-style: none; margin: 0; padding: 6px 16px; gap: 0; }
.phrase-row { display: flex; align-items: center; gap: 14px; min-height: var(--size-touch); border-bottom: 1px solid var(--glass-fill); color: var(--ink); padding: 4px 0; }
.phrase-row .bar { width: 120px; flex-shrink: 0; }
/* Frase do resultado: tocar abre a avaliação dela, no lugar. */
.phrase-detail > summary { list-style: none; cursor: pointer; }
.phrase-detail > summary::-webkit-details-marker { display: none; }
.phrase-detail[open] > summary { border-bottom-color: transparent; }
.phrase-eval { display: grid; gap: 12px; padding: 12px 0 16px; border-bottom: 1px solid var(--glass-fill); }
.phrase-eval .verdict-title { font-size: 18px; margin: 0; }
.phrase-eval [data-train-phrase] { justify-self: start; }
.grid-eval .phrase-eval { border-bottom: 0; padding-bottom: 0; }
.phrase-cell[aria-pressed="true"] { outline: 2px solid var(--ink); outline-offset: 2px; }
.phrase-pct { width: 64px; text-align: right; flex-shrink: 0; }
.phrase-remaining { padding: 12px 0 8px 42px; }
.actions-card { padding: 4px 16px; gap: 0; }
.action-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 52px; background: transparent; border: 0; border-bottom: 1px solid var(--glass-fill); color: var(--ink); font-size: 15px; font-weight: 600; cursor: pointer; padding: 0; text-align: left; width: 100%; font-family: inherit; }
.action-row:last-child { border-bottom: 0; }
.action-row:hover { color: var(--ink); }
.action-disabled { opacity: .55; cursor: default; }
.results-status { padding: 0 0 10px; }
/* Continuar, ouvir e baixar: logo abaixo do placar, antes das listas de frases. */
.result-actions { padding: 14px 16px 4px; gap: 6px; }
.result-continue { width: 100%; }
.result-action-list { display: flex; flex-direction: column; }
.result-actions .results-status { margin: 0; }
@media (min-width: 900px) {
  .score-cards { grid-template-columns: 1fr 1fr 3fr; }
  .evolution-card { grid-column: auto; }
  .results-grid { display: grid; grid-template-columns: 2fr 3fr; gap: 24px; align-items: start; }
  .phrase-grid { display: none; }
  .phrase-rows { display: flex; flex-direction: column; }
  /* "Continuar" à esquerda; ouvir e baixar em lista ao lado. */
  .result-actions { display: grid; grid-template-columns: minmax(220px, 1fr) 2fr; align-items: center; gap: 4px 28px; padding: 8px 20px; }
  .result-continue { grid-row: 1; }
  .result-action-list .action-row { min-height: 44px; }
  .result-actions .results-status { grid-column: 2; padding: 0 0 6px; }
}

/* Vocalizes */
.center-text { text-align: center; }
.range-grid { grid-template-columns: 1fr 1fr; }
.range-card { gap: 8px; }
.range-name { font-size: 18px; font-weight: 700; }
.range-change summary { list-style: none; }
.range-change summary::-webkit-details-marker { display: none; }
/* Aberto, a grade ocupa a linha inteira e o "Trocar" fica no canto, onde estava. */
.card-row:has(> .range-change) { position: relative; }
.range-change[open] { flex-basis: 100%; }
.range-change[open] > summary { position: absolute; top: 0; right: 0; min-height: auto; }
/* `.confirm form` é flex; aqui a grade precisa vencer para os botões terem a mesma largura. */
.range-change .range-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: stretch; margin-top: 16px; }
.range-grid .choice { justify-content: center; gap: 6px; min-height: 96px; padding: 18px 12px; transition: border-color .15s ease, background-color .15s ease; }
.range-grid .choice-label { font-size: 17px; }
.range-grid .choice:hover { border-color: var(--ink-muted); }
.range-grid .choice.current { border-color: var(--accent); box-shadow: none; background: color-mix(in srgb, var(--accent) 12%, var(--ground)); }
.levels { display: flex; flex-direction: column; gap: 14px; }
.level-card { gap: 10px; }
.vocalize-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.vocalize-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--glass-fill); }
.vocalize-item:last-child { border-bottom: 0; }
.vocalize-text { flex: 1; min-width: 0; }
.vocalize-name { font-weight: 600; }
.done-today { font-weight: 500; font-size: 13px; color: var(--score-good); margin-left: 6px; white-space: nowrap; }
/* Vocalize começado e não terminado hoje: amarelo ("perto") e meio círculo, com a conta na dica. */
.partial-today { font-weight: 500; font-size: 13px; color: var(--score-near); margin-left: 6px; white-space: nowrap; }
.page-sub { margin: 4px 0 0; }
.empty-filter { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
@media (min-width: 900px) {
  .levels { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 16px; }
  .range-grid, .range-change .range-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Descobrir a faixa de voz */
.range-finder { display: flex; flex-direction: column; gap: 16px; max-width: 640px; }
.rf-howto { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.rf-progress { height: 10px; border-radius: 5px; background: var(--glass-fill); overflow: hidden; }
.rf-progress span { display: block; height: 100%; width: 0; background: var(--accent); }
.rf-heard { margin: 0; font-size: 16px; }
.rf-heard strong { font-size: 22px; }
.rf-target { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.rf-target strong { font-size: 56px; line-height: 1; color: var(--accent); }
.rf-keys { display: flex; height: 64px; gap: 1px; padding-bottom: 18px; }
.rf-key { position: relative; flex: 1; min-width: 0; border-radius: 0 0 3px 3px; background: var(--ink-muted); opacity: .35; }
.rf-key-black { background: var(--glass-fill); opacity: 1; }
.rf-key-band { box-shadow: 0 -4px 0 var(--accent) inset; }
.rf-key-sung { opacity: 1; background: var(--score-good); }
.rf-key-black.rf-key-sung { background: color-mix(in srgb, var(--score-good) 60%, var(--ground)); }
.rf-key[data-label]::after { content: attr(data-label); position: absolute; top: 100%; left: 0; font-size: 10px; color: var(--ink-muted); padding-top: 2px; }
.rf-form { display: flex; flex-direction: column; gap: 12px; }
.rf-other .range-grid { margin-top: 12px; }
.range-chooser-help { margin: 0; }

/* Editores de revisão (só no computador) */
.desktop-only { display: none !important; }
.narrow-only { display: flex; }
.trainer-result { color: var(--ink-muted); margin-left: 0; }
.trainer-result:hover { color: var(--ink); }
.device-notice { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; border: 1px solid var(--line-strong); color: var(--ink); }
.device-notice a { color: var(--accent); font-weight: 600; }
.device-notice .link-btn { margin-left: auto; color: var(--ink-muted); }
.review { display: flex; flex-direction: column; gap: 12px; }
.review-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.review-tools, .review-save { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.review-restore summary { list-style: none; }
.review-restore summary::-webkit-details-marker { display: none; }
.confirm-box { display: flex; gap: 10px; align-items: center; margin-top: 8px; }
.review-canvas-wrap { border-radius: var(--radius-card); padding: 8px; overflow: hidden; }
.review-canvas { display: block; width: 100%; outline: none; cursor: crosshair; }
.review-canvas:focus { box-shadow: 0 0 0 2px var(--accent); border-radius: var(--radius-tile); }
.review-help kbd { display: inline-block; padding: 0 5px; border-radius: 4px; border: 1px solid var(--line-glass); background: var(--ground-raised); font-family: inherit; font-size: 12px; }
.action-links { flex-wrap: wrap; }
.action-link-group { display: flex; gap: 8px; }
@media (min-width: 900px) {
  .desktop-only { display: inline-flex !important; }
  .review.desktop-only { display: flex !important; }
  .narrow-only { display: none; }
}
.btn:disabled { opacity: .5; cursor: default; }
.phrases-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; }
.phrase-editor-list { list-style: none; margin: 0; padding: 6px; display: flex; flex-direction: column; gap: 2px; max-height: 60vh; overflow: auto; }
.phrase-editor-row { display: flex; align-items: center; gap: 10px; width: 100%; min-height: var(--size-touch); padding: 6px 10px; border-radius: var(--radius-chip); border: 0; background: transparent; color: var(--ink); text-align: left; cursor: pointer; font-family: inherit; font-size: 14px; }
.phrase-editor-row.active { background: var(--glass-fill); font-weight: 600; }
.phrase-editor-row .phrase-time { font-size: 12px; color: var(--ink-faint); flex-shrink: 0; }
.phrase-editor-main { display: flex; flex-direction: column; gap: 12px; }
.timeline { display: block; width: 100%; height: 220px; outline: none; cursor: crosshair; }
.timeline:focus { box-shadow: 0 0 0 2px var(--accent); border-radius: var(--radius-tile); }

/* Confira o compasso: uma tarefa, botões ao alcance do polegar. */
.meter-page { display: flex; flex-direction: column; gap: 16px; max-width: 560px; margin: 0 auto; padding-bottom: 88px; }
.meter-listen, .meter-fix { display: flex; flex-direction: column; gap: 12px; }
.meter-question { font-size: 18px; font-weight: 600; margin: 0; }
.beat-counter { list-style: none; margin: 0; padding: 0; display: flex; gap: 10px; justify-content: center; }
.beat-dot { width: 40px; height: 40px; border-radius: 20px; display: flex; align-items: center; justify-content: center; border: 2px solid var(--line-glass); color: var(--ink-muted); font-weight: 700; }
.beat-dot.beat-one { border-color: var(--accent); color: var(--accent); }
.beat-dot.now { background: var(--glass-fill); color: var(--ink); }
.beat-dot.beat-one.now { background: var(--accent); color: var(--ground); }
.meter-from { display: flex; flex-direction: column; gap: 4px; }
.meter-from select { min-height: 40px; border-radius: var(--radius-tile); background: var(--ground); color: var(--ink); border: 1px solid var(--line-glass); padding: 0 8px; }
.tap-btn { min-height: 72px; font-size: 18px; }
.meter-actions { position: sticky; bottom: 12px; }

/* Gerenciar vocalizes */
.admin-page { max-width: 720px; display: flex; flex-direction: column; gap: 16px; }
.admin-levels { display: flex; flex-direction: column; gap: 14px; }
.admin-level { gap: 4px; padding-bottom: 6px; scroll-margin-top: 72px; }
.admin-level-head { display: flex; align-items: center; gap: 8px; min-height: var(--size-touch); }
.admin-level-title { flex: 1; min-width: 0; margin: 0; font-size: 17px; font-weight: 700; }
.admin-count { color: var(--ink-muted); font-size: 13px; white-space: nowrap; }
.admin-rows { list-style: none; margin: 0; padding: 0; }
.admin-row { display: flex; align-items: center; border-top: 1px solid var(--glass-fill); scroll-margin-top: 72px; }
.admin-row-link { flex: 1; min-width: 0; min-height: 56px; padding: 8px 0; display: flex; flex-direction: column; justify-content: center; color: var(--ink); text-decoration: none; }
.admin-row-link:hover .admin-row-name { color: var(--accent-text); }
.admin-row-name { display: flex; align-items: center; gap: 6px; font-weight: 600; line-height: 1.3; }
.admin-row-label, .admin-pattern { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-pattern { color: var(--ink-muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.admin-row.is-hidden .admin-row-label, .admin-row.is-hidden .admin-pattern { opacity: .55; }
.hidden-tag { flex: none; font-size: 11px; font-weight: 600; color: var(--ink-muted); border: 1px solid var(--line-glass); border-radius: var(--radius-chip); padding: 0 6px; }
.icon-action { flex: none; width: var(--size-touch); height: var(--size-touch); display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: var(--radius-chip); background: transparent; color: var(--ink-muted); cursor: pointer; list-style: none; }
.icon-action::-webkit-details-marker { display: none; }
.icon-action:hover:not([disabled]) { background: var(--glass-fill); color: var(--ink); }
.icon-action:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.icon-action[disabled] { opacity: .25; cursor: default; }
.admin-add { display: inline-flex; align-items: center; min-height: var(--size-touch); color: var(--accent); font-size: 14px; font-weight: 600; text-decoration: none; border-top: 1px solid var(--glass-fill); }
.admin-add:hover { color: var(--accent-text); }
.admin-empty { padding: 8px 0; border-top: 1px solid var(--glass-fill); }
.action-menu { position: relative; flex: none; }
.action-panel { position: absolute; z-index: 20; top: 100%; right: 0; width: 240px; padding: 6px; display: flex; flex-direction: column; border-radius: var(--radius-tile); }
.action-item { width: 100%; min-height: var(--size-touch); padding: 0 10px; display: flex; align-items: center; border: 0; border-radius: var(--radius-chip); background: transparent; color: var(--ink); font: inherit; font-size: 14px; font-weight: 500; text-align: left; cursor: pointer; list-style: none; }
a.action-item { text-decoration: none; }
.action-item::-webkit-details-marker { display: none; }
.action-item:hover:not([disabled]) { background: var(--line-glass); }
.action-item[disabled] { opacity: .4; cursor: default; }
.action-danger { color: var(--score-off); }
.action-sub > form { display: flex; flex-direction: column; gap: 8px; padding: 6px 10px 10px; }
.toast { position: fixed; z-index: 30; left: 50%; bottom: 24px; transform: translateX(-50%); max-width: calc(100vw - 40px); padding: 10px 16px; background: var(--ink); color: var(--ground); border-radius: var(--radius-tile); font-size: 14px; font-weight: 600; white-space: nowrap; pointer-events: none; animation: toast-out .3s ease 4s forwards; }
@keyframes toast-out { to { opacity: 0; visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { .toast { animation-duration: 0s; } }
.admin-new-level { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.admin-new-level .field { flex: 1; min-width: 180px; }
.admin-form { max-width: 720px; display: flex; flex-direction: column; gap: 14px; }
.admin-group { margin: 0; border: 0; }
.admin-group > legend { float: left; width: 100%; padding: 0; margin-bottom: 14px; font-size: 17px; font-weight: 700; }
.admin-group > legend + * { clear: both; }
.admin-group .field { scroll-margin-top: 72px; }
.input-with-action { display: flex; gap: 8px; }
.input-with-action input { flex: 1; min-width: 0; }
.input-with-action .btn { flex: none; height: 48px; }
fieldset.field { margin: 0; padding: 0; border: 0; }
fieldset.field > legend { padding: 0; margin-bottom: 6px; font-size: 14px; color: var(--ink-muted); }
.segmented { display: flex; gap: 8px; }
.segmented label { flex: 1; }
.segmented input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.segmented span { display: flex; align-items: center; justify-content: center; height: 48px; border: 1px solid var(--line-glass); border-radius: var(--radius-tile); color: var(--ink); font-size: 15px; font-weight: 600; cursor: pointer; }
.segmented input:checked + span { background: var(--light); color: var(--ink-on-light); border-color: var(--light); }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.admin-save { position: sticky; bottom: 0; z-index: 5; padding: 10px 0; background: var(--ground); }
.admin-save .btn { width: 100%; }
@media (min-width: 900px) {
  .admin-save { position: static; padding: 0; background: none; }
  .admin-save .btn { width: auto; padding: 0 28px; }
}
.check-row { display: flex; align-items: center; gap: 10px; min-height: var(--size-touch); font-size: 15px; cursor: pointer; }
.check-row input { width: 20px; height: 20px; flex: none; accent-color: var(--accent); }

/* Ajustes */
.settings-card { gap: 4px; }
.settings-card > .card-title { margin: 0 0 4px; }
.settings-card [data-settings-level] .choice-row { margin-top: 8px; }
.settings-card .setting { min-height: 56px; }
.settings-card .setting + .setting, .settings-card .setting + form { border-top: 1px solid var(--glass-fill); padding-top: 8px; }
.device-line { color: var(--ink-muted); }
.device-line.configured { color: var(--score-good); }
.device-line.unset { color: var(--accent); }

/* Início */
.home-head { align-items: flex-end; }
.home-greet { display: flex; flex-direction: column; gap: 4px; }
.home-hello { font-size: 14px; color: var(--ink-muted); }
.home-head h1 { font-size: 28px; }
.home-streak { flex: none; }
.home-card { gap: 12px; }
.home-card.daily { border-radius: var(--radius-hero); padding: var(--space-5); gap: var(--space-4); }
@media (min-width: 900px) { .home-head h1 { font-size: 40px; line-height: 1.05; } .home-hello { font-size: 15px; } .home-card.daily { padding: var(--space-6); } }
.home-song { display: flex; align-items: center; gap: 14px; min-width: 0; }
.home-song-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.home-song-title { font-size: 17px; font-weight: 600; }
.cover-warm { background: var(--accent-tint); color: var(--accent); border-radius: var(--radius-icon); }
.cover-s { width: 44px; height: 44px; font-size: 15px; }
.home-action { margin: 0; }
.home-songs { display: flex; flex-direction: column; gap: 8px; }
.home-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; border-radius: var(--radius-card); overflow: hidden; }
.home-row { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 14px; color: var(--ink); text-decoration: none; }
.home-row:hover { background: var(--glass-fill); color: var(--ink); }
.home-row > svg { color: var(--ink-muted); flex: none; }
.home-row-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.steps-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.step-item a, .step-item button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 6px 4px; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 15px; text-align: left; text-decoration: none; cursor: pointer; border-radius: var(--radius-chip); }
.step-item a:hover, .step-item button:hover { background: var(--glass-fill); color: var(--ink); }
.step-item form { margin: 0; }
.step-check { width: 28px; height: 28px; flex: none; border-radius: 14px; border: 1px solid var(--line-glass); display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: var(--ink-muted); }
.step-name { flex: 1; font-weight: 600; }
.step-done { color: var(--score-good); font-size: 13px; font-weight: 600; }
.step-item.done .step-check { background: var(--score-good); border-color: var(--score-good); color: var(--ground); }
.step-item.done .step-name { color: var(--ink-muted); }
.step-item svg { color: var(--ink-muted); flex: none; }
@media (min-width: 900px) {
  .home-head, .home-card, .home-songs, .home-steps { max-width: 720px; width: 100%; margin-left: auto; margin-right: auto; }
}

/* Aviso de música pronta */
.ready-toast { position: fixed; z-index: 50; left: 50%; transform: translateX(-50%); bottom: calc(var(--size-tabbar) + 36px + env(safe-area-inset-bottom)); width: min(560px, calc(100vw - 24px)); display: flex; align-items: center; gap: 10px; padding: 10px 8px 10px 16px; border-radius: var(--radius-pill); }
.ready-toast-text { flex: 1; font-weight: 600; }
.ready-toast-close { margin-left: 0; font-size: 22px; color: var(--ink-muted); }
@media (min-width: 900px) { .ready-toast { bottom: 24px; } }

/* Progresso: convite a aquecer e etapas recolhidas */
.invite-card { flex-direction: row; align-items: flex-start; gap: 14px; }
.invite-icon { color: var(--accent); }
.invite-text { flex: 1; display: flex; flex-direction: column; gap: 12px; }
.invite-text p { margin: 0; }

/* Sua voz: as tendências do cantor */
.tendency { display: flex; flex-direction: column; gap: 12px; }
.tendency-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.tendency-item { gap: 8px; }
.tendency-text { margin: 0; font-weight: 600; }
.tendency-tip { margin: 0; }
.tendency-base { text-align: center; }
.home-tendency-more { margin-left: 8px; }
@media (min-width: 900px) {
  .tendency { max-width: 720px; width: 100%; margin-left: auto; margin-right: auto; }
}

/* Sua voz: a evolução */
.evolution-section { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.evolution-week { gap: 10px; }
.evolution-weeks { height: 110px; }
.evolution-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 14px; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-line { display: inline-block; width: 18px; height: 0; border-top: 3px solid var(--accent); }
.legend-rhythm { border-top: 2px dashed var(--ink-muted); }
.evolution-axis { display: flex; justify-content: space-between; }
.evolution-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.evolution-list li { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.evolution-list a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.evolution-better { color: var(--score-good); font-size: 13px; white-space: nowrap; }
.tendency-gain { margin: 0; color: var(--score-good); }
@media (min-width: 900px) {
  .evolution-section { max-width: 720px; width: 100%; margin-left: auto; margin-right: auto; }
}

/* Treino de hoje */
.daily-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.daily-step { display: flex; align-items: center; gap: var(--space-3); font-size: 14px; line-height: 1.35; }
.daily-step .step-check { width: 30px; height: 30px; border: 1.5px solid var(--line-strong); color: var(--ink-muted); }
.daily-step-text { flex: 1; color: var(--ink-soft); }
.daily-step.done .daily-step-text { color: var(--ink-faint); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--ink-faint) 50%, transparent); }
.daily-step.done .step-done { color: var(--accent); }
.daily-step.current .step-check { border: 2px solid var(--accent); color: var(--accent); box-shadow: var(--shadow-halo); }
.daily-step.current .daily-step-text { color: var(--ink); font-weight: 600; }
.daily-complete { margin: 0; color: var(--score-good); font-weight: 600; }
.daily-next { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.daily-next p { margin: 0; }
.daily-step.done .step-check { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

/* Percepção */
.ear { display: flex; flex-direction: column; gap: 12px; }
.ear-answers { display: flex; flex-wrap: wrap; gap: 8px; }
.ear-answers .btn { flex: 1 1 140px; min-height: 52px; }
.ear-status { margin: 0; }
.ear-feedback { margin: 0; min-height: 1.4em; font-weight: 600; }
.ear-level { margin-top: 2px; }
.sustain-live { font-size: 28px; font-weight: 700; margin: 12px 0 8px; font-variant-numeric: tabular-nums; }
.sustain-bar { height: 10px; border-radius: 5px; background: var(--line-glass); overflow: hidden; margin-bottom: 16px; }
.sustain-fill { display: block; height: 100%; width: 0; background: var(--score-good); transition: width .1s linear; }
.sustain-record { margin: 0; color: var(--accent); font-weight: 700; }
@media (min-width: 900px) {
  .ear { max-width: 720px; width: 100%; margin-left: auto; margin-right: auto; }
}

/* Treino no visual vidro e aurora (design-premium): microfone, ações, chips, folha e atalhos. */
.trainer-head { gap: 10px; }
.trainer-head > .icon-btn:first-child { width: var(--size-touch); height: var(--size-touch); margin: 0; border-radius: 50%; border: 1px solid var(--line-glass); background: linear-gradient(160deg, var(--glass-hi), var(--glass-lo)); }
.trainer-song { font-family: var(--font-display); font-weight: 800; }
.trainer-result { width: var(--size-touch); height: var(--size-touch); margin: 0; gap: 8px; border-radius: var(--radius-pill); border: 1px solid var(--line-glass); background: linear-gradient(160deg, var(--glass-hi), var(--glass-lo)); color: var(--ink); }
.trainer-result-text, .trainer-mic-text { display: none; }
.trainer-mic { flex: none; position: relative; width: var(--size-touch); padding: 0; justify-content: center; border-radius: 50%; }
.trainer-mic .m-mic__shape { position: absolute; right: -2px; top: -2px; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--ground); display: flex; align-items: center; justify-content: center; font-size: 8px; line-height: 1; color: var(--ground); }
.trainer-mic.m-mic--ok .m-mic__shape { background: var(--score-good); }
.trainer-mic.m-mic--pending .m-mic__shape { background: var(--score-near); }
.chart-card { border-radius: var(--radius-hero); padding: 14px 12px 10px; }
.lyric-now { font-family: var(--font-display); font-weight: 800; }
.ctl { border: 1px solid var(--line-glass); background: linear-gradient(160deg, var(--glass-hi), var(--glass-lo)); }
.ctl-rec { border: 0; background: linear-gradient(95deg, var(--accent-hi), var(--accent-deep)); font-family: var(--font-display); font-weight: 800; }
.ctl-settings-label { display: none; }
.ctl-settings .m-settings-btn__value { display: none; }
.trainer-chips { display: flex; gap: var(--space-2); justify-content: center; flex-wrap: wrap; }
.trainer-chips .m-chip { height: var(--size-touch); }
.trainer-chips .m-chip__value { color: var(--ink-muted); }
.trainer-chips .m-chip__value.is-changed { color: var(--accent); }
.trainer-chips [data-chip="cantor"][aria-pressed="false"] .m-chip__dot { background: var(--ink-faint); }
.trainer-shortcuts { display: none; margin: 0; }
.sheet-body .setting-name { font-size: 14px; }
@media (min-width: 900px) {
  .trainer-main { position: relative; }
  .trainer-chips { display: none; }
  .trainer-shortcuts { display: flex; padding-top: 4px; }
  .trainer-result { width: auto; padding: 0 16px; font-size: 13px; font-weight: 600; }
  .trainer-result-text { display: inline; }
  .trainer-mic { width: auto; padding: 0 16px; border-radius: var(--radius-pill); }
  .trainer-mic .m-mic__shape { position: static; width: auto; height: auto; border: 0; background: none !important; color: inherit; font-size: 10px; }
  .trainer-mic-text { display: inline; }
  /* Barra de ações: Ouvir · Cantar · Ajustes, como no celular, em pílulas centralizadas. */
  .controls { display: flex; justify-content: center; align-items: center; gap: 12px; max-width: none; padding-bottom: 0; }
  .ctl { flex-direction: row; gap: 10px; border-radius: var(--radius-pill); font-size: 14px; }
  .ctl-big { width: auto; height: 52px; padding: 0 20px; }
  .ctl-rec { width: auto; height: var(--size-btn); padding: 0 30px; font-size: 16px; box-shadow: var(--shadow-cta); }
  .ctl-settings { width: auto; height: 52px; padding: 0 18px; }
  .ctl-settings-label { display: inline; }
  .ctl-settings .m-settings-btn__value:not([hidden]) { display: inline; }
  /* A folha abre centralizada logo acima da barra de ações, sem escurecer a tela. */
  .sheet { position: absolute; inset: auto 0 calc(var(--size-btn) + 56px) 0; margin-inline: auto; z-index: 20; width: min(760px, 100%); }
  .sheet-backdrop { display: none; }
  /* No modo livre não há gráfico: com a folha aberta, a coluna guarda altura para ela caber inteira. */
  .trainer[data-mode="livre"] .trainer-main:has(> .sheet:not([hidden])) { min-height: calc(70vh + var(--size-btn) + 80px); justify-content: flex-end; }
  .sheet-body {
    position: relative; left: auto; top: auto; transform: none; width: 100%; max-height: 70vh;
    display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 12px; padding: 20px 22px;
    border-radius: var(--radius-card);
    background: linear-gradient(160deg, rgba(40,33,58,.92) 0%, rgba(22,18,34,.94) 100%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 30px 80px rgba(0,0,0,.60);
  }
  .sheet-head { grid-column: 1 / -1; }
  .sheet-body .choice-row { flex-wrap: wrap; }
  .sheet-body .setting { border-radius: var(--radius-tile); padding: 14px 16px; background: var(--glass-fill); border: 1px solid var(--line-soft); min-height: 76px; }
}

/* Veredito da frase (requisito "Avaliação na sessão"). */
.evaluation { gap: 12px; }
.verdict { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: var(--radius-card); background: linear-gradient(160deg, var(--glass-hi), var(--glass-lo)); border: 1px solid var(--line-glass); box-shadow: var(--shadow-glass); }
.verdict-mark { flex: none; width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 22px; border: 1px solid var(--line-glass); }
.verdict[data-level="tom"] .verdict-mark { color: var(--score-good); background: var(--score-good-tint); box-shadow: 0 0 28px color-mix(in srgb, var(--score-good) 60%, transparent); }
.verdict[data-level="perto"] .verdict-mark { color: var(--score-near); background: var(--score-near-tint); box-shadow: 0 0 28px color-mix(in srgb, var(--score-near) 65%, transparent); }
.verdict[data-level="fora"] .verdict-mark { color: var(--score-off); background: var(--score-off-tint); box-shadow: 0 0 28px color-mix(in srgb, var(--score-off) 60%, transparent); }
.verdict-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.verdict-title { margin: 0; font-size: 24px; line-height: 1.1; }
.verdict-support { font-size: 14px; }
.eval-card { background: var(--glass-fill); border: 1px solid var(--line-soft); padding: 12px 14px; }
.eval-value { font-family: var(--font-display); font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.eval-shape[data-level="tom"] { color: var(--score-good); }
.eval-shape[data-level="perto"] { color: var(--score-near); }
.eval-shape[data-level="fora"] { color: var(--score-off); }
.syl { height: var(--size-touch); min-width: var(--size-touch); flex-direction: row; gap: 6px; padding: 0 12px; border-radius: var(--radius-chip); border: 1px solid var(--line-glass); background: linear-gradient(160deg, var(--glass-hi), var(--glass-lo)); }
.syl-text { font-family: var(--font-display); font-weight: 700; }
.syl-shape { order: -1; font-size: 10px; }
.syl-tom[aria-pressed="true"] { border-color: var(--score-good); background: var(--score-good-tint); }
.syl-perto[aria-pressed="true"] { border-color: var(--score-near); background: var(--score-near-tint); }
.syl-fora[aria-pressed="true"] { border-color: var(--score-off); background: var(--score-off-tint); }
.eval-detail { text-align: center; min-height: 1.4em; }
/* Gravada a frase, o destaque passa para "Próxima frase"; o Regravar fica em vidro. */
.trainer:is([data-state="recorded"], [data-state="hearing"]) .ctl-rec { background: linear-gradient(160deg, var(--glass-hi), var(--glass-lo)); border: 1px solid var(--line-glass); color: var(--ink); box-shadow: none; }
@media (min-width: 900px) { .verdict-title { font-size: 28px; } }

/* Resultado e Nova música no visual vidro e aurora (design-premium). */
.results-h1 { font-family: var(--font-display); font-weight: 800; }
.score-value { font-family: var(--font-display); font-weight: 800; font-variant-numeric: tabular-nums; }
.score-card-pitch { align-items: center; }
.score-ring { width: 128px; height: 128px; }
.score-ring .m-ring__num { font-size: 26px; }
.score-delta { color: var(--score-good-text); }
.result-actions { border-radius: var(--radius-card); }
.weak-card { border-radius: var(--radius-tile); }
.phrase-cell { border-radius: var(--radius-sm); }
.phrase-cell.state-tom { background: var(--score-good-tint); color: var(--score-good); border-color: transparent; }
.phrase-cell.state-perto { background: var(--score-near-tint); color: var(--score-near); border-color: transparent; }
.phrase-cell.state-fora { background: var(--score-off-tint); color: var(--score-off); border-color: transparent; }
.phrase-cell.state-none { border-style: dashed; border-color: var(--line-strong); }
.source-picker { flex-direction: column; gap: 10px; }
.source-option {
  justify-content: flex-start; gap: 14px; min-height: 72px; padding: 14px 16px; text-align: left;
  border-radius: var(--radius-tile); background: linear-gradient(160deg, var(--glass-hi), var(--glass-lo));
}
.source-icon { flex: none; width: var(--size-touch); height: var(--size-touch); border-radius: var(--radius-chip); background: var(--glass-fill); display: flex; align-items: center; justify-content: center; color: var(--ink); }
.source-text { display: flex; flex-direction: column; gap: 2px; }
.source-label { font-size: 15px; font-weight: 700; }
.source-hint { font-size: 12px; color: var(--ink-muted); }
.source-picker input[type=radio]:checked + .source-option { border: 1.5px solid var(--accent-line); background: linear-gradient(160deg, var(--accent-tint) 0%, var(--glass-lo) 100%); box-shadow: var(--shadow-select); color: var(--ink); }
.source-picker input[type=radio]:checked + .source-option .source-icon { background: var(--accent-tint); color: var(--accent); }
.dropzone { border-radius: var(--radius-tile); background: var(--glass-fill); }
/* Com largura, as três opções ficam lado a lado e o campo da marcada vem embaixo delas. */
@media (min-width: 640px) {
  .source-picker { flex-direction: row; flex-wrap: wrap; }
  .source-option { flex: 1 1 0; min-width: 0; min-height: 64px; padding: 12px 14px; gap: 12px; }
  .source-icon { width: 36px; height: 36px; }
}

/* O vidro (backdrop-filter) cria um contexto de empilhamento por cartão: o cartão com um menu
   aberto sobe, para o menu não ficar por baixo do cartão seguinte. */
:is(.card, .song-card):has(details[open]) { position: relative; z-index: 6; }

/* Corrigir a letra: o campo ocupa a tela, a ação principal embaixo. */
.lyrics-fix { display: grid; gap: 16px; max-width: 720px; margin: 0 auto; }
.lyrics-form { display: grid; gap: 12px; }
.lyrics-form textarea { width: 100%; min-height: 50vh; resize: vertical; line-height: 1.5; }
.lyrics-form .submit-wrap { display: grid; gap: 8px; }
.lyrics-updating { display: grid; gap: 12px; }
