@font-face {
  font-family: 'SF Pro Display';
  src: url('/fontes/SF-Pro-Display-Medium.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'SF Pro Display';
  src: url('/fontes/SF-Pro-Display-Bold.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'SF Pro Display';
  src: url('/fontes/SF-Pro-Display-Black.woff2') format('woff2');
  font-weight: 900;
  font-display: swap;
}

/* Dark Trader: neutros puros (R = G = B), âmbar como luz, vermelho só no que cobra ação. */
:root {
  --fundo: #000000;
  --superficie: #141414;
  --superficie-2: #1c1c1c;
  --linha: #2a2a2a;
  --texto: #f2f2f2;
  --texto-2: #b8b8b8;
  --texto-3: #8a8a8a;
  --ambar: #d9c7a8;
  --vermelho: #d10000;
  --vermelho-texto: #f01818;
  --escala-leitura: 1;
  --raio: 14px;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  background: var(--fundo);
}

body {
  margin: 0;
  background:
    radial-gradient(120% 60% at 100% 0%, rgba(217, 199, 168, 0.09), transparent 60%),
    radial-gradient(80% 40% at 0% 100%, rgba(209, 0, 0, 0.06), transparent 70%),
    var(--fundo);
  background-attachment: fixed;
  color: var(--texto);
  font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  font-weight: 500;
  font-size: 16px;
  line-height: 1.45;
  min-height: 100svh;
}

body.com-barra {
  padding-bottom: 190px;
}

h1,
h2,
h3 {
  margin: 0;
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

b {
  font-weight: 700;
  color: var(--texto);
}

.app {
  max-width: 680px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 28px) 16px calc(env(safe-area-inset-bottom) + 40px);
}

.tela-carregando,
.tela-erro {
  min-height: 70svh;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 10px;
  color: var(--texto-2);
}

.tela-erro h1 {
  font-weight: 900;
  font-size: 32px;
  color: var(--texto);
}

/* ---------------------------------------------------------------- topo */

.topo {
  padding: 8px 0 28px;
}

.sobretitulo {
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ambar);
}

.topo h1 {
  font-weight: 900;
  font-size: clamp(44px, 13vw, 76px);
  line-height: 0.98;
  letter-spacing: -0.03em;
  margin: 14px 0 16px;
}

.abertura {
  color: var(--texto-2);
  font-size: 17px;
  max-width: 34em;
}

.progresso {
  margin-top: 24px;
}

.progresso-barra {
  height: 6px;
  background: var(--superficie-2);
  border-radius: 99px;
  overflow: hidden;
}

.progresso-barra span {
  display: block;
  height: 100%;
  background: var(--ambar);
  border-radius: inherit;
  transition: width 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.progresso p {
  margin-top: 10px;
  font-size: 14px;
  color: var(--texto-3);
}

.offline {
  margin-top: 14px;
  padding: 12px 14px;
  border-left: 3px solid var(--ambar);
  background: var(--superficie);
  font-size: 14px;
  color: var(--texto-2);
}

/* ---------------------------------------------------------------- blocos */

.bloco {
  background: var(--superficie);
  border: 1px solid var(--linha);
  border-radius: var(--raio);
  padding: 22px 18px;
  margin-bottom: 18px;
}

.bloco h2 {
  font-weight: 900;
  font-size: 22px;
  letter-spacing: -0.01em;
}

.bloco > p {
  margin-top: 8px;
  color: var(--texto-2);
}

.bloco-cabeca {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.contagem {
  font-size: 13px;
  color: var(--texto-3);
  white-space: nowrap;
}

.checklist {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
}

.checklist li + li {
  border-top: 1px solid var(--linha);
}

.checklist label {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 13px 0;
  cursor: pointer;
  color: var(--texto-2);
}

.checklist input {
  appearance: none;
  flex: none;
  width: 22px;
  height: 22px;
  margin: 1px 0 0;
  border: 1.5px solid var(--texto-3);
  border-radius: 6px;
  display: grid;
  place-content: center;
  transition: background 0.15s, border-color 0.15s;
}

.checklist input::after {
  content: '';
  width: 10px;
  height: 6px;
  border-left: 2px solid var(--fundo);
  border-bottom: 2px solid var(--fundo);
  transform: translateY(-1px) rotate(-45deg) scale(0);
  transition: transform 0.15s;
}

.checklist input:checked {
  background: var(--ambar);
  border-color: var(--ambar);
}

.checklist input:checked::after {
  transform: translateY(-1px) rotate(-45deg) scale(1);
}

.checklist input:checked + span {
  color: var(--texto-3);
}

.teste {
  margin-top: 18px;
  padding: 18px;
  border-radius: 10px;
  background: var(--superficie-2);
  display: grid;
  gap: 14px;
}

.teste h3 {
  font-weight: 700;
  font-size: 17px;
}

.teste p {
  margin-top: 4px;
  color: var(--texto-3);
  font-size: 14px;
}

.campo {
  display: grid;
  gap: 6px;
  margin-top: 16px;
  font-size: 14px;
  color: var(--texto-3);
}

.campo select {
  font: inherit;
  color: var(--texto);
  background: var(--superficie-2);
  border: 1px solid var(--linha);
  border-radius: 10px;
  padding: 12px;
}

.tamanho-texto {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--texto-3);
}

.tamanho-texto span {
  margin-right: auto;
}

.tamanho-texto .link {
  font-size: 17px;
  min-width: 44px;
  min-height: 40px;
  border: 1px solid var(--linha);
  border-radius: 10px;
}

/* ---------------------------------------------------------------- partes */

.partes {
  display: grid;
  gap: 18px;
  margin-bottom: 18px;
}

.parte {
  position: relative;
  background: var(--superficie);
  border: 1px solid var(--linha);
  border-radius: var(--raio);
  padding: 22px 18px 18px;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.parte[data-tipo='livre'] {
  background:
    linear-gradient(180deg, rgba(217, 199, 168, 0.06), transparent 55%),
    var(--superficie);
}

.parte-feita {
  border-color: rgba(217, 199, 168, 0.35);
}

.parte-gravando {
  border-color: var(--vermelho);
  box-shadow: 0 0 0 1px var(--vermelho), 0 18px 60px -20px rgba(209, 0, 0, 0.55);
}

.parte-cabeca {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: start;
}

.parte-numero {
  font-weight: 900;
  font-size: 34px;
  line-height: 0.9;
  letter-spacing: -0.04em;
  color: var(--ambar);
  font-variant-numeric: tabular-nums;
}

.parte-numero small {
  font-size: 13px;
  letter-spacing: 0;
  color: var(--texto-3);
  font-weight: 700;
  margin-left: 2px;
}

.parte h2 {
  font-weight: 900;
  font-size: 21px;
  line-height: 1.15;
}

.instrucao {
  margin-top: 4px;
  font-size: 14px;
  color: var(--texto-3);
}

.selo-feita {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fundo);
  background: var(--ambar);
  padding: 5px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

/* Texto de leitura: grande, como teleprompter. */
.leitura {
  margin: 20px 0 0;
  font-size: calc(20px * var(--escala-leitura));
  line-height: 1.5;
  color: var(--texto);
}

.leitura-frases {
  padding: 0;
  list-style: none;
  counter-reset: frase;
}

.leitura-frases li {
  counter-increment: frase;
  position: relative;
  padding: 12px 0 12px 34px;
}

.leitura-frases li + li {
  border-top: 1px solid var(--linha);
}

.leitura-frases li::before {
  content: counter(frase);
  position: absolute;
  left: 0;
  top: 16px;
  font-size: 13px;
  font-weight: 700;
  color: var(--texto-3);
  font-variant-numeric: tabular-nums;
}

.leitura-corrida p + p {
  margin-top: 0.9em;
}

.leitura-climas {
  padding: 0;
  list-style: none;
}

.leitura-climas li {
  padding: 12px 0;
}

.leitura-climas li + li {
  border-top: 1px solid var(--linha);
}

.clima {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ambar);
  margin-bottom: 2px;
}

.leitura-livre .pergunta {
  font-weight: 900;
  font-size: calc(26px * var(--escala-leitura));
  line-height: 1.15;
  letter-spacing: -0.015em;
}

.leitura-livre .dica {
  margin-top: 10px;
  font-size: 15px;
  color: var(--texto-3);
}

.parte-acoes {
  margin-top: 20px;
}

/* ---------------------------------------------------------------- botões */

.botao {
  appearance: none;
  border: 0;
  font: inherit;
  font-weight: 700;
  font-size: 17px;
  color: var(--texto);
  border-radius: 999px;
  padding: 15px 22px;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: transform 0.12s, background 0.2s, opacity 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.botao:active {
  transform: scale(0.97);
}

.botao:disabled {
  opacity: 0.35;
  cursor: default;
}

.botao-gravar {
  width: 100%;
  background: var(--vermelho);
}

.botao-gravar .ponto {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ffffff;
}

.botao-pequeno {
  width: auto;
  min-height: 42px;
  padding: 10px 18px;
  font-size: 15px;
}

.botao-pequeno .ponto {
  width: 9px;
  height: 9px;
}

.botao-secundario {
  background: transparent;
  border: 1.5px solid var(--ambar);
  color: var(--ambar);
  border-radius: 12px;
}

.botao-arquivo {
  margin-top: 16px;
  width: 100%;
}

.botao-parar {
  width: 100%;
  background: var(--texto);
  color: var(--fundo);
  margin-top: 12px;
}

.link {
  appearance: none;
  background: none;
  border: 0;
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  color: var(--ambar);
  padding: 6px 4px;
  cursor: pointer;
}

.link-apagar {
  color: var(--texto-3);
}

/* ---------------------------------------------------------------- tomadas */

.tomadas {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  border-top: 1px solid var(--linha);
}

.tomada {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--linha);
  font-size: 14px;
}

.tomada-nome {
  font-weight: 700;
  color: var(--texto);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tomada-meta {
  grid-column: 1;
  color: var(--texto-3);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.tomada .chip {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
}

.tomada-acoes {
  grid-column: 2;
  grid-row: 2;
  justify-self: end;
  display: flex;
  gap: 10px;
}

.chip {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 99px;
  background: var(--superficie-2);
  color: var(--texto-2);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.chip-ok {
  background: rgba(217, 199, 168, 0.16);
  color: var(--ambar);
}

.chip-andamento {
  color: var(--texto);
}

.chip-alerta {
  color: var(--vermelho-texto);
  background: rgba(209, 0, 0, 0.12);
  white-space: normal;
  text-align: right;
}

/* ---------------------------------------------------------------- extras */

.extras {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
}

.extra {
  padding: 16px 0;
  border-top: 1px solid var(--linha);
}

.extra p {
  font-weight: 700;
  font-size: calc(18px * var(--escala-leitura));
  line-height: 1.3;
  margin-bottom: 12px;
}

.extra.parte-gravando p {
  color: var(--vermelho-texto);
}

.bloco-instalar {
  background: transparent;
  border-style: dashed;
}

.bloco-instalar .botao {
  margin-top: 14px;
}

.rodape {
  padding: 10px 2px 0;
  font-size: 13px;
  color: var(--texto-3);
}

/* ---------------------------------------------------------------- barra de gravação */

.barra {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  padding: 16px 16px calc(env(safe-area-inset-bottom) + 16px);
  background: rgba(10, 10, 10, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--linha);
}

.barra > * {
  max-width: 648px;
  margin-left: auto;
  margin-right: auto;
}

.barra-topo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ponto-rec {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--vermelho);
  animation: pulsar 1.2s ease-in-out infinite;
  flex: none;
}

@keyframes pulsar {
  50% {
    opacity: 0.3;
  }
}

.barra-rotulo {
  font-weight: 700;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.barra-tempo {
  font-weight: 900;
  font-size: 24px;
  font-variant-numeric: tabular-nums;
}

.medidor {
  position: relative;
  height: 14px;
  margin-top: 12px;
  border-radius: 99px;
  background: var(--superficie-2);
  overflow: hidden;
}

/* faixa confortável: de -30 a -12 dBFS na escala de -60 a 0 */
.medidor-faixa {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 30%;
  background: rgba(217, 199, 168, 0.16);
}

.medidor-nivel {
  position: absolute;
  inset: 0;
  /* gradiente fixo na largura toda; o nível só revela até onde chegou */
  clip-path: inset(0 100% 0 0);
  background: linear-gradient(90deg, #6e6e6e 0%, #8a8a8a 45%, var(--ambar) 62%, var(--ambar) 85%, var(--vermelho) 97%);
  transition: clip-path 0.08s linear;
}

.medidor-pico {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  left: 0;
  background: var(--texto);
}

.barra-aviso {
  margin-top: 10px;
  font-size: 14px;
  color: var(--texto-2);
  min-height: 2.9em;
}

.barra-aviso[data-tom='alerta'] {
  color: var(--vermelho-texto);
}

.barra-aviso[data-tom='ok'] {
  color: var(--ambar);
}

.aviso {
  position: fixed;
  left: 16px;
  right: 16px;
  top: calc(env(safe-area-inset-top) + 12px);
  z-index: 20;
  max-width: 648px;
  margin: 0 auto;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--texto);
  color: var(--fundo);
  font-weight: 700;
  font-size: 15px;
  box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.8);
}

@media (min-width: 720px) {
  .app {
    padding-top: 64px;
  }
  .bloco,
  .parte {
    padding: 28px 28px 24px;
  }
  .teste {
    grid-template-columns: 1fr auto;
    align-items: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}
