/* lowerdot — estilos da home
   Fonte Jost no body, fundo claro, texto preto. Mobile-first. */

:root {
  --ink: #111111;
  --bg: #f9f9fd;
  --paper: #ffffff;
  --muted: #c4c4c4;
  --line: #efeff4;
  --line-2: #d6d6db;
  --chip: #111111;
  --chip-ink: #ffffff;
  --radius-bar: 32px;
  --radius-pop: 16px;
  --minw: 1080px;
  --maxw: 1366px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Jost", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.page {
  min-height: 100dvh;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(24px, 8vh, 96px) clamp(16px, 4vw, 32px) 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ---------- Logo ---------- */
.logo {
  margin: 0 0 clamp(20px, 4vh, 40px);
  line-height: 0;
}
.logo__img {
  display: block;
  height: auto;
  width: clamp(200px, 42vw, 320px);
}

/* Glifos reutilizáveis (fill preto) */
.g-pill, .g-circle, .g-minidot { fill: var(--ink); }
.g-dunot { fill: none; stroke: var(--ink); stroke-width: 2.2; }

/* ---------- Campo de busca ---------- */
.search {
  width: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.search__bar {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 6px 12px 6px 22px;
  border: 3px solid var(--line);
  border-radius: var(--radius-bar);
  background: var(--paper);
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.04);
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.search__bar:focus-within {
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.15);
  border-color: var(--ink);
}

.search__input {
  flex: 1 1 auto;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font: inherit;
  font-size: 20px;
  font-weight: 500;
  color: var(--ink);
  padding: 7px 0;
}
.search__input::placeholder { color: var(--muted); }

/* ---------- Chips de filtro ---------- */
.chips {
  display: flex;
  align-items: center;
  gap: 1px;
  flex: 0 0 auto;
}
.chip {
  font: inherit;
  font-size: 0.8125em;
  font-weight: 500;
  color: var(--chip-ink);
  background: var(--chip);
  border: none;
  border-radius: 999px;
  padding: 5px 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.12s ease, transform 0.06s ease;
}
.chip:hover { opacity: 0.85; }
.chip:active { transform: scale(0.96); }

/* ---------- Botão gerar (chip Morse: fundo transparente, borda preta) ---------- */
.chip--go {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  background: transparent;
  border: 2px solid var(--ink);
  padding: 5px 12px;
}
.chip--go .morse-glyph {
  display: block;
  height: 15px; /* 2 linhas (ir/go) */
  width: auto;
  fill: var(--ink);
}
.chip--go:hover { opacity: 1; background: var(--ink); }
.chip--go:hover .morse-glyph { fill: var(--paper); }

/* ---------- Chip de design (D1): cinza-escuro, separado dos filtros por gap ---------- */
.chip--design {
  flex: 0 0 auto;
  color: #fff;
}
.chip--design:hover { opacity: 0.9; }

/* ---------- Chips multi (categorias de preparação) no form de design ---------- */
.ff-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ---------- Popover de filtros ---------- */
.filters {
  position: absolute;
  top: 0;                 /* topo na borda superior do searchwrap (desktop) */
  right: 0;
  width: min(420px, 100%);
  max-height: 78vh;       /* evita ficar comprido demais */
  overflow-y: auto;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-pop);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
  padding: 20px;
  z-index: 20;
}
/* quando há espaço em tela: desloca o dialog para ABAIXO da barra de pesquisa */
.filters.filters--below { top: calc(100% + 8px); }
.filters__hint { margin: 0; color: var(--muted); font-size: 0.875em; }

/* ---------- Área de fretboards ---------- */
.boards {
  width: 100%;
  margin-top: clamp(28px, 6vh, 56px);
  display: flex;
  flex-wrap: wrap;
  gap: 28px 32px;
  justify-content: center;
  align-items: flex-start;
}
.boards__empty {
  width: 100%;
  text-align: center;
  color: var(--muted);
  font-size: 0.9375em;
  margin: 8px 0 0;
}
/* Sequência com grupos (separados por |): cada grupo ocupa a largura toda e empilha;
   o limite entre grupos é um border-bottom (no último grupo não há linha). */
.boards__group {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 28px 32px;
  justify-content: center;
  align-items: flex-start;
}
.boards__group:not(:last-child) {
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

/* ---------- Cartão de acorde + diagrama ---------- */
.chord {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.chord__name {
  font-size: 1.125em;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.fretboard { display: block; height: auto; max-width: 100%; }

/* Glifos do braço (todos pretos; sem bordas/preenchimento de grade) */
.gl-pill, .gl-circle, .gl-minidot, .gl-disc { fill: var(--ink); }
.gl-disc-hole { fill: #fff; }  /* furo branco do disc (sem stroke) */
/* PREP: nota de preparação = o GLIFO REAL da nota no acorde de destino, sempre à
   DIREITA, desenhado em cinza claro OPACO (#d7d7da). Em encavalamento, a base (preta)
   e a prep (cinza) se combinam conforme o tipo (ver comboGlyph em glyphs.js). */
.gl-prep { opacity: 1; }
.gl-prep .gl-pill, .gl-prep .gl-circle, .gl-prep .gl-minidot, .gl-prep .gl-disc { fill: #d7d7da; }
.fb-open-bg, .fb-fret-ref { fill: rgba(0, 0, 0, 0.028); }
.fb-label { fill: var(--muted); font-size: 11px; font-family: monospace; cursor: pointer; }
.fb-fretnum { fill: var(--muted); font-size: 9px; font-family: monospace; cursor: pointer; }
.fb-label:hover, .fb-fretnum:hover { fill: var(--ink); }

/* R5 — célula clicável (hit-rect transparente cobrindo toda a célula) */
.fb-hit { fill: transparent; pointer-events: all; }
.fb-cell:hover .fb-hit { fill: rgba(0, 0, 0, 0.04); }
/* célula ativa: borda fina cinza-escuro, cantos levemente arredondados */
.fb-cell--active .fb-hit { fill: none; stroke: #4a4a52; stroke-width: 1.1; rx: 3px; ry: 3px; }

/* R5 — balão de hint (nota da célula) */
.cellhint {
  position: fixed; z-index: 1000; left: 0; top: 0;
  max-width: 270px; padding: 0; border-radius: 12px; overflow: hidden;
  background: #1c1c22; color: #f3f3f6;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28), 0 2px 6px rgba(0, 0, 0, 0.2);
  font-family: 'Jost', system-ui, sans-serif; font-size: 12px; line-height: 1.35;
  /* Entrada: scale no lugar (sem deslizar do canto). left/top entram na transição só
     no FLIP (classe --move), p/ a posição inicial ser instantânea. */
  opacity: 0; transform: scale(0.82); transform-origin: center;
  transition: opacity .15s ease, transform .17s cubic-bezier(.2,.75,.3,1);
}
.cellhint.cellhint--in { opacity: 1; transform: scale(1); }
.cellhint.cellhint--move {
  transition: opacity .15s ease, transform .17s cubic-bezier(.2,.75,.3,1),
    left .22s cubic-bezier(.22,.61,.36,1), top .22s cubic-bezier(.22,.61,.36,1);
}
.cellhint__head {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 11px; background: rgba(255, 255, 255, 0.06);
}
.cellhint__badge {
  flex: 0 0 auto; min-width: 22px; height: 22px; padding: 0 5px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 11px; background: #f3f3f6; color: #1c1c22;
  font-weight: 600; font-size: 12px;
}
.cellhint__pos { color: #b9b9c4; font-size: 11px; }
.cellhint__body { list-style: none; margin: 0; padding: 7px 11px 9px; }
.cellhint__row { padding: 4px 0; }
.cellhint__row + .cellhint__row { border-top: 1px solid rgba(255, 255, 255, 0.08); }
.cellhint__line { display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; }
.cellhint__main { font-weight: 500; }
.cellhint__tag {
  font-size: 10px; text-transform: uppercase; letter-spacing: .03em;
  color: #1c1c22; background: #c9c9d2; border-radius: 4px; padding: 1px 5px;
}
.cellhint__row--prep .cellhint__tag { background: #d7d7da; }
.cellhint__sub { display: block; color: #9a9aa6; font-size: 10.5px; margin-top: 1px; }
.cellhint__row--target { display: flex; align-items: baseline; gap: 6px; color: #d9d9e2; }
.cellhint__lead { color: #ffffff; font-weight: 600; }
@media (max-width: 480px) { .cellhint { max-width: 78vw; } }

/* R5 — conector visual entre a nota e o balão (linha + ponto na nota) */
.cellhint-link {
  position: fixed; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 999; overflow: visible;
}
.cellhint-link__line { stroke: #1c1c22; stroke-width: 1.5; stroke-linecap: round; opacity: 0.55; }

/* ---------- Barra de ferramentas ---------- */
.toolbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: flex-end;
  padding: 12px 16px;
  background: transparent;
  z-index: 30;
  pointer-events: none;
}
.toolbar__right { pointer-events: auto; }
.lang { position: relative; }
.toolbar__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: inherit;
  font-size: 0.8125em;
  font-weight: 500;
  color: var(--ink);
  background: transparent;
  border: none;
  border-radius: 999px;
  padding: 4px 10px;
  cursor: pointer;
}
.toolbar__btn:hover { background: rgba(0, 0, 0, 0.05); }
.lang__icon { display: inline-flex; }

/* Material Symbols — fonte subsetada self-hosted (só os glifos usados). */
@font-face {
  font-family: 'Material Symbols Outlined';
  font-style: normal;
  font-weight: 400;
  font-display: block; /* evita mostrar o nome do ícone antes da fonte carregar */
  src: url('/fonts/material-symbols-subset.woff2') format('woff2');
}
.mi {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  font-feature-settings: 'liga';
  -webkit-font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  color: currentColor;
  user-select: none;
}

/* ---------- Menus flutuantes genéricos ---------- */
.menu {
  position: absolute;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
  padding: 6px;
  z-index: 40;
  min-width: 180px;
}
.lang__menu { top: calc(100% + 8px); right: 0; }
.menu__item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font: inherit;
  font-size: 0.875em;
  color: var(--ink);
  background: transparent;
  border: none;
  border-radius: 10px;
  padding: 9px 11px;
  cursor: pointer;
  text-align: left;
}
.menu__item:hover { background: rgba(0, 0, 0, 0.05); }
.menu__item.is-active { font-weight: 600; }
.menu__check { display: inline-flex; }

/* ---------- Formulário de filtros ---------- */
.menu.filters {
  padding: 16px;
  border-radius: var(--radius-pop);
  min-width: 0;
  width: min(480px, 100%);
}
.ff-title { margin: 4px 6px 12px; font-size: 0.9375em; font-weight: 600; }
.ff-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px;
}
/* Divisor de 1px entre grupos de campos do form (ex.: separa as preparações). */
.ff-divider { height: 1px; margin: 8px 6px; background: var(--line); border: 0; }
.ff-row__label { flex: 0 0 92px; color: var(--muted); font-size: 0.8125em; }
.ff-row__opts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; flex: 1 1 auto; }
.seg {
  font: inherit;
  font-size: 0.8125em;
  color: var(--ink);
  background: #f2f2f4;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 2px 10px;
  cursor: pointer;
}
.seg:hover { background: #eaeaee; }
.seg.is-active { background: var(--ink); color: #fff; }
.ff-select {
  font: inherit;
  font-size: 0.8125em;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 30px 6px 10px;     /* espaço à direita p/ o chevron */
  color: var(--ink);
  /* caret nativo → chevron custom (normalizado entre navegadores) */
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-color: var(--paper);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='%23111111' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;  /* chevron maior e mais à direita */
}
.ff-tune-row { display: flex; flex-wrap: wrap; gap: 6px; }
.ff-tune {
  width: 42px;
  font: inherit;
  font-size: 0.8125em;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 4px;
  background: var(--paper);
  color: var(--ink);
}
.ff-reset {
  font: inherit;
  font-size: 0.75em;
  color: var(--muted);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 5px 4px;
  text-decoration: underline;
}

/* Ações do formulário (rodapé): Cancelar / Aplicar */
.ff-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.ff-btn {
  font: inherit;
  font-size: 0.875em;
  font-weight: 500;
  border-radius: 999px;
  padding: 5px 15px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: opacity 0.12s ease, transform 0.06s ease, background 0.12s ease;
}
.ff-btn:active { transform: scale(0.97); }
.ff-btn--primary { background: var(--ink); color: var(--paper); }
.ff-btn--primary:hover { opacity: 0.85; }
.ff-btn--ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.ff-btn--ghost:hover { background: rgba(0, 0, 0, 0.05); }

/* ---------- Feedback do parser ---------- */
.parse-hint {
  position: absolute;          /* overlay: não empurra os elementos vizinhos */
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 30;
  margin: 0;
  padding: 8px 14px;
  font-size: 0.8125em;
  color: #b00020;
  background: var(--paper);
  border: 2px solid rgba(176, 0, 32, 0.25);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
.parse-hint[hidden] { display: none; }
.parse-hint code {
  font-family: "Ubuntu Mono", ui-monospace, monospace;
  background: rgba(176, 0, 32, 0.08);
  border-radius: 4px;
  padding: 1px 5px;
}

/* ===================== Layout v2 (header/main/footer fixos) ===================== */
:root { --appbar-h: 56px; }

body {
  height: 100dvh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;            /* só a main rola */
}

/* ---------- Header ---------- */
.appbar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--appbar-h);
  padding:
    max(8px, env(safe-area-inset-top))
    max(14px, env(safe-area-inset-right))
    8px
    max(14px, env(safe-area-inset-left));
  position: relative;
  z-index: 30;
}
body[data-view="results"] .appbar { border-bottom: 1px solid var(--line); }
/* Blur/gradiente num ::before (NÃO na .appbar) para não criar containing block
   em descendentes fixed — senão os menus fullscreen do mobile ficariam presos à appbar. */
body[data-view="results"] .appbar::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to bottom, rgba(249, 249, 253, 0.92), rgba(249, 249, 253, 0.55));
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.appbar__center { flex: 1 1 auto; display: flex; justify-content: center; min-width: 0; }
.appbar__tools { flex: none; display: flex; align-items: center; justify-content: flex-end; min-width:150px; }

.appbar__morse, .appbar__logo { display: none; flex: none; }
.appbar__morse {
  align-items: center; justify-content: center;
  width: 56px; height: 36px; padding: 5px 8px;
  border: none; border-radius: 12px; background: transparent;
  color: var(--ink); cursor: pointer;
}
.appbar__morse:hover { background: rgba(0, 0, 0, 0.08); }
.appbar__morse svg { width: 40px; height: auto; }
.appbar__logo { line-height: 0; }
.appbar__logo img { display: block; height: 25px; width: auto; }
body[data-view="results"] .appbar__logo { display: flex; width:150px; }

/* ---------- Main rolável ---------- */
.main {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.main__inner {
  width: 100%;
  min-height: 100%;
  margin: 0 auto;
  padding: 16px max(16px, env(safe-area-inset-right)) 28px max(16px, env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
}

/* ---------- Hero (estado home) ---------- */
.hero {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(20px, 5vh, 40px);
  padding-bottom: 10vh;
  margin: 0 auto;
  margin-top: -25vh;
  min-width: var(--minw);
  max-width: var(--maxw);
}
.hero__logo { line-height: 0; }
.hero__logo img { display: block; width: clamp(190px, 40vw, 300px); height: auto; }
.hero__slot { width: 100%; display: flex; justify-content: center; }
.hero__hint { margin: 4px 0 0; color: var(--muted); font-size: 0.9375em; text-align: center; }
body[data-view="results"] .hero { display: none; }
body[data-view="home"] .boards { display: none; }

/* ---------- Searchwrap (realocada entre hero e header) ---------- */
.searchwrap { position: relative; width: 100%; }
.hero .searchwrap { max-width: var(--minw); }
.appbar__center .searchwrap { max-width: var(--minw); }

/* ---------- Barra de label (estado results) ---------- */
.resultbar {
  display: none;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 2px 14px;
  min-width: var(--minw);
  max-width: var(--maxw);
  margin: 0 auto;
}
body[data-view="results"] .resultbar { display: flex; }
.resultbar__type { font-size: 0.9375em; color: var(--muted); }
.resultbar__type b { color: var(--ink); font-weight: 600; letter-spacing: 1px; }
.resultbar__inst { display: none; font-size: 0.9375em; font-weight: 600; color: var(--ink); white-space: nowrap; }
/* tipo de escala/acorde (vindo do design) + "com preparações" — à direita */
.resultbar__design { font-size: 0.9375em; font-weight: 600; color: var(--ink); white-space: nowrap; text-align: right; }
.resultbar__design .resultbar__preps { font-weight: 400; color: var(--muted); }

/* ---------- Boards ---------- */
.boards { flex: 0 0 auto; }

/* ---------- Footer ---------- */
.footer {
  flex: none;
  z-index: 30;
  background: linear-gradient(to top, rgba(249, 249, 253, 0.95), rgba(249, 249, 253, 0.4));
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.footer__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding:
    10px
    max(18px, env(safe-area-inset-right))
    max(10px, env(safe-area-inset-bottom))
    max(18px, env(safe-area-inset-left));
  font-size: 0.9em;
  color: var(--muted);
}
.footer__copy { font-weight: 300; }
.footer__copy b { color: var(--ink); font-weight: 700; }
.footer__links { display: flex; gap: 18px; }
.footer__links a { color: var(--muted); text-decoration: none; }
.footer__links a:hover { color: var(--ink); }

/* ===================== Login / Conta ===================== */
.account { position: relative; }
.account__btn { padding: 4px; }
.account__face { display: inline-flex; align-items: center; justify-content: center; color: var(--ink); }
/* avatar texticon: círculo preto, letra branca */
.account__avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  font-size: 0.9375em;
  line-height: 1;
}
.account__menu { top: calc(100% + 8px); right: 0; min-width: 160px; }

/* View de autenticação: ocupa a main, escondendo hero/resultbar/boards */
.authview { display: none; }
body[data-view="auth"] .hero,
body[data-view="auth"] .resultbar,
body[data-view="auth"] .boards { display: none; }
body[data-view="auth"] .authview {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: clamp(16px, 8vh, 80px);
}
.authcard {
  position: relative;
  width: min(380px, 100%);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-pop);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.14);
  padding: 28px 26px 22px;
}
.authcard__close {
  position: absolute; top: 12px; right: 12px;
  display: inline-flex; padding: 4px;
  border: none; background: transparent; color: var(--muted); cursor: pointer; border-radius: 8px;
}
.authcard__close:hover { background: rgba(0, 0, 0, 0.05); color: var(--ink); }
.authcard__title { margin: 0 0 6px; font-size: 1.375em; font-weight: 600; }
.authcard__hint { margin: 0 0 14px; font-size: 0.8125em; color: var(--muted); }
.authform { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.authfield { display: flex; flex-direction: column; gap: 5px; }
.authfield__label { font-size: 0.75em; color: var(--muted); font-weight: 500; }
.authfield__input {
  font: inherit; font-size: 0.9375em;
  padding: 10px 12px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--paper); color: var(--ink);
}
.authfield__input:focus { outline: none; border-color: var(--ink); }
.authsubmit {
  margin-top: 4px;
  font: inherit; font-size: 0.9375em; font-weight: 600;
  color: #fff; background: var(--ink);
  border: none; border-radius: 999px;
  padding: 11px 16px; cursor: pointer;
  transition: opacity 0.12s ease, transform 0.06s ease;
}
.authsubmit:hover { opacity: 0.88; }
.authsubmit:active { transform: scale(0.98); }
.authsubmit:disabled { opacity: 0.5; cursor: default; }
.authmsg { margin: 4px 0 0; font-size: 0.8125em; }
.authmsg--error { color: #b00020; }
.authmsg--ok { color: #1a7f37; }
.authcard__links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-top: 16px; }
.authlink {
  font: inherit; font-size: 0.8125em;
  color: var(--muted); background: transparent; border: none; cursor: pointer;
  text-decoration: underline; padding: 2px;
}
.authlink:hover { color: var(--ink); }

/* ===================== Responsividade ===================== */
@media (max-width: 720px) {
  /* fonte geral (base) maior no mobile para leitura */
  html, body { font-size: 18px; }

  /* CORREÇÃO mobile: no desktop o hero/resultbar fixam min-width:1080px (--minw); no
     mobile isso estourava a largura da tela (barra saindo pela direita). Solta a
     largura para caber no viewport. */
  .hero, .resultbar { min-width: 0; max-width: none; }
  .hero .searchwrap, .appbar__center .searchwrap { max-width: none; }

  /* logo central do hero: +15px de altura no mobile (proporção 6.667 do PNG) */
  .hero__logo img { width: auto; height: clamp(43.5px, calc(40vw / 6.667 + 15px), 60px); }

  /* chips menores e centralizados; input em linha própria */
  .search__bar { flex-wrap: wrap; justify-content: center; padding: 6px 10px 10px; }
  .search__input { flex-basis: 100%; order: -1; text-align: left; padding: 8px 6px; }
  /* filtros + chip de design DIVIDEM a 2ª linha (o input ocupa a 1ª sozinho). Os
     filtros ficam agrupados (nowrap) e o chip de design encosta ao lado, tudo
     centralizado; a fonte encolhe com a tela para caber sem estourar. */
  .chips { flex-wrap: nowrap; justify-content: center; gap: 3px; width: auto; min-width: 0; flex: 0 1 auto; }
  .chip { font-size: clamp(8px, 2.7vw, 13px); padding: 3px 6px; flex: 0 1 auto; min-width: 0; white-space: nowrap; }
  .search__bar { column-gap: 6px; row-gap: 8px; }

  /* gerar pelo Enter/“Ir” do teclado; oculta o botão no mobile */
  .chip--go { display: none; }

  /* results: morse aparece, logo some, searchbar flutuante */
  body[data-view="results"] .appbar__logo { display: none; }
  body[data-view="results"] .appbar__morse { display: inline-flex; }
  body[data-view="results"] .appbar__center { position: static; }
  body[data-view="results"] .searchwrap {
    position: fixed;
    left: 8px; right: 8px;
    top: calc(env(safe-area-inset-top) + var(--appbar-h) + 4px);
    width: auto;
    max-width: none;
    z-index: 50;
    padding: 0;                /* sem gap entre a borda do campo e o shadow */
    border-radius: 16px;
    background: var(--paper);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.2);
    display: none;
  }
  /* o campo interno preenche o flutuante (mesmo raio, sem sobra) */
  body[data-view="results"] .searchwrap .search__bar { border-radius: 16px; }
  body[data-view="results"] .searchwrap.is-open { display: block; }

  /* label mostra o instrumento no mobile */
  .resultbar__inst { display: inline; }
  .resultbar__type { font-size: 0.875em; }

  .boards { gap: 22px; }
}

/* ---------- C1 — Resultado de cifra (cabeçalho + grupos rotulados) ---------- */
.cifrahead {
  width: 100%;
  text-align: center;
  margin: 0 0 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.cifrahead__title {
  margin: 0;
  font-family: "Jost", system-ui, sans-serif;
  font-size: 1.5em;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.cifrahead__artist {
  margin: 0;
  font-size: 1em;
  color: var(--muted);
}
.cifrahead__meta {
  margin: 6px 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.875em;
  color: var(--muted);
}
.cifrahead__tom { font-weight: 600; color: var(--ink); }
.cifrahead__dot { color: var(--line-2); }
.cifrahead__src {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.cifrahead__src:hover { color: var(--ink); border-bottom-color: var(--line-2); }
.cifrahead__ext { vertical-align: middle; }

.cifragroup {
  width: 100%;
  margin-top: clamp(20px, 4vh, 36px);
}
.cifragroup__label {
  width: 100%;
  margin: 0 0 14px;
  padding-bottom: 6px;
  font-family: "Jost", system-ui, sans-serif;
  font-size: 0.9375em;
  font-weight: 600;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.cifragroup__boards {
  display: flex;
  flex-wrap: wrap;
  gap: 28px 32px;
  justify-content: center;
  align-items: flex-start;
}

/* ---------- C1 — Tipbox de acesso (recurso só para registrados) ---------- */
.authtip {
  width: 100%;
  max-width: 520px;
  margin: clamp(20px, 6vh, 56px) auto 0;
  padding: 20px 22px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  text-align: left;
}
.authtip[hidden] { display: none; }
.authtip__title {
  margin: 0 0 4px;
  font-family: "Jost", system-ui, sans-serif;
  font-weight: 600;
  font-size: 1em;
  color: var(--ink);
}
.authtip__body {
  margin: 0 0 12px;
  font-size: 0.875em;
  color: var(--muted);
  line-height: 1.4;
}
.authtip__actions { display: flex; gap: 10px; flex-wrap: wrap; }
.authtip__btn {
  flex: 1 1 auto;
  padding: 8px 14px;
  font: inherit;
  font-size: 0.875em;
  font-weight: 600;
  border-radius: 10px;
  border: 2px solid var(--ink);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.authtip__btn--primary { background: var(--ink); color: var(--paper); }
.authtip__btn:hover { opacity: 0.85; }

/* No mobile, os grupos centralizam o rótulo */
@media (max-width: 720px) {
  .cifragroup__label { text-align: center; }
  .cifragroup__boards { gap: 22px; }
}

/* Mobile PORTRAIT: cada diagrama ocupa 100% da largura, empilhado e SEM scroll lateral. */
@media (max-width: 720px) and (orientation: portrait) {
  .main { overflow-x: hidden; }
  .boards, .cifragroup__boards, .boards__group {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 22px;
  }
  .chord { width: 100%; }
  .fretboard { width: 100%; }   /* SVG (com viewBox) escala p/ a largura, altura proporcional */
}
