/* Dosímetro da Xu — paleta e tipos herdados do infográfico da aula. */
:root {
  --papel: #FFF1EC;
  --folha: #FFFBF9;
  --tinta: #5A3848;
  --grafite: #8A6474;
  --linha: #F6D9D6;
  --rosa: #F08AA7;
  --rosa-texto: #A83D65;
  --rosa-claro: #FFE6EA;
  --rubro: #B0455A;
  --rubro-claro: #FFE9EB;
  --verde: #25765F;
  --verde-claro: #E3F6EF;
  --lilas: #B39BE0;
  --lilas-claro: #F4EEFD;
  --foco: #A83D65;
  --sombra: 0 1px 2px rgba(180, 90, 110, .05), 0 6px 20px rgba(242, 139, 168, .12);
  --topo-fundo: rgba(255, 241, 236, .94);
  --no-rosa: #5A3848;
  --botao: #F7A8BE;
  --botao-texto: #5A3848;

  --f-corpo: "Atkinson Hyperlegible", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --f-titulo: "Fredoka", "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
  --f-doc: "Bitter", Georgia, "Times New Roman", serif;
  --f-mono: "Atkinson Hyperlegible Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --f-carinho: "Caveat", "Segoe Print", "Bradley Hand", cursive;

  --raio: 16px;
  --gutter: clamp(16px, 4vw, 28px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --papel: #1D1320; --folha: #2A1C2E; --tinta: #F9E9F1; --grafite: #C7A9BC; --linha: #4B3350;
    --rosa: #FF8DB8; --rosa-texto: #FF9EC4; --rosa-claro: #47243A;
    --rubro: #FF7D8F; --rubro-claro: #4A2229; --verde: #7DD6B7; --verde-claro: #1E3A33;
    --lilas: #C4A9F2; --lilas-claro: #342A4B; --foco: #FF9EC4;
    --sombra: 0 1px 2px rgba(0, 0, 0, .35), 0 6px 20px rgba(0, 0, 0, .3);
    --topo-fundo: rgba(29, 19, 32, .94);
    --no-rosa: #1D1320;
    --botao: #FF8DB8;
    --botao-texto: #1D1320;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --papel: #1D1320; --folha: #2A1C2E; --tinta: #F9E9F1; --grafite: #C7A9BC; --linha: #4B3350;
  --rosa: #FF8DB8; --rosa-texto: #FF9EC4; --rosa-claro: #47243A;
  --rubro: #FF7D8F; --rubro-claro: #4A2229; --verde: #7DD6B7; --verde-claro: #1E3A33;
  --lilas: #C4A9F2; --lilas-claro: #342A4B; --foco: #FF9EC4;
  --sombra: 0 1px 2px rgba(0, 0, 0, .35), 0 6px 20px rgba(0, 0, 0, .3);
  --topo-fundo: rgba(29, 19, 32, .94);
  --no-rosa: #1D1320;
  --botao: #FF8DB8;
  --botao-texto: #1D1320;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: radial-gradient(900px 360px at 50% -80px, var(--rosa-claro), transparent 70%) no-repeat, var(--papel);
  color: var(--tinta);
  font: 400 1rem/1.55 var(--f-corpo);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--foco); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--f-titulo); line-height: 1.2; margin: 0; }

.pular {
  position: absolute; left: 8px; top: -60px; z-index: 50;
  background: var(--tinta); color: var(--folha); padding: .5rem .8rem; border-radius: 6px;
}
.pular:focus { top: 8px; }

/* ——— Topo fixo ——— */
.topo {
  position: sticky; top: 0; z-index: 20;
  background: var(--topo-fundo);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--linha);
  padding: calc(env(safe-area-inset-top, 0px) + .5rem) var(--gutter) 0;
}
.topo > * { max-width: 1240px; margin-left: auto; margin-right: auto; }
.topo-linha { display: flex; align-items: center; gap: .5rem; }
.topo-crime {
  flex: 1; min-width: 0; text-align: left; background: none; border: 0; padding: .2rem 0;
  display: flex; flex-direction: column;
}
.topo-marca { font: 600 1rem/1 var(--f-carinho); color: var(--rosa-texto); }
.topo-marca::after { content: " ♥"; font-family: var(--f-corpo); font-size: .7em; vertical-align: .1em; }
.topo-caso {
  font: 600 1.08rem/1.3 var(--f-titulo);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topo-caso::after { content: " ▾"; font-size: .7em; color: var(--grafite); }
.topo-acoes { display: flex; gap: .25rem; flex-shrink: 0; }
.botao-icone {
  width: 40px; height: 40px; display: grid; place-items: center;
  background: none; border: 1px solid transparent; border-radius: 8px;
}
.botao-icone:hover { border-color: var(--linha); }
.botao-icone svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.botao-texto {
  background: none; border: 1.5px solid var(--linha); border-radius: 99px;
  padding: .45rem .75rem; font-weight: 700; font-size: .9rem; min-height: 40px;
}
.botao-texto:hover { background: var(--folha); }
.botao-primario {
  background: var(--botao); color: var(--botao-texto); border: 0; border-radius: 99px;
  padding: .6rem 1.25rem; font-weight: 700; min-height: 44px; box-shadow: 0 3px 0 rgba(120, 30, 70, .18);
}
.botao-primario:hover { filter: brightness(1.05); }

/* Dúvidas para o professor */
.botao-duvidas {
  position: relative; display: inline-flex; align-items: center; gap: .35rem; min-height: 40px; min-width: 40px;
  background: none; border: 1px solid transparent; border-radius: 8px; padding: 0 .45rem;
  font-weight: 700; font-size: .88rem;
}
.botao-duvidas:hover { border-color: var(--linha); }
.duvidas-icone {
  display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--lilas); color: var(--no-rosa); font: 700 .85rem/1 var(--f-titulo);
}
.duvidas-contagem:not(:empty) {
  position: absolute; top: 2px; left: 24px;
  font: 600 .66rem/1 var(--f-mono); background: var(--rosa); color: var(--no-rosa); border-radius: 99px; padding: .18rem .34rem;
  box-shadow: 0 0 0 2px var(--papel);
}
.duvidas-rotulo { margin-left: .2rem; }
@media (max-width: 520px) { .duvidas-rotulo { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } }

.lembrete { margin: -.25rem 0 1rem; }
.lembrete button {
  width: 100%; text-align: left; display: block;
  background: var(--lilas-claro); border: 0; border-left: 3px solid var(--lilas); border-radius: 0 8px 8px 0;
  padding: .5rem .75rem; font-size: .88rem; line-height: 1.4; color: var(--tinta);
}
.lembrete button:hover { filter: brightness(.98); }
.lembrete strong { color: var(--lilas); margin-right: .35rem; font-size: .78rem; letter-spacing: .03em; text-transform: uppercase; }
.lembrete button + button { margin-top: .35rem; }
.lembrete span { display: inline; }

dialog.duvidas { width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); }
#duvidas-lista { display: grid; gap: .6rem; }
.duvidas-corpo { padding: 1.25rem; display: grid; gap: .9rem; }
.duvida { border: 1px solid var(--linha); border-radius: var(--raio); padding: .75rem .85rem; display: grid; gap: .45rem; background: var(--papel); }
.duvida.resolvida { opacity: .8; }
.duvida.resolvida .duvida-pergunta { text-decoration: line-through; text-decoration-color: var(--grafite); }
.duvida-pergunta { font-weight: 700; margin: 0; }
.duvida-hoje { margin: 0; font-size: .88rem; color: var(--grafite); }
.duvida-marcar { display: flex; align-items: center; gap: .45rem; font-size: .9rem; min-height: 36px; }
.duvida-marcar input { width: 20px; height: 20px; accent-color: var(--botao); }
.duvida textarea {
  width: 100%; min-height: 3.2rem; resize: vertical; border: 1.5px solid var(--linha); border-radius: 8px;
  padding: .45rem .6rem; background: var(--folha); color: var(--tinta); font: inherit; font-size: .92rem;
}
.duvida-destaque { outline: 3px solid var(--lilas); outline-offset: 2px; }

/* A régua: faixa de pena, escala em anos e os três marcadores. */
.regua { padding: 1.35rem 6px .1rem; }
.regua-trilho { position: relative; height: 34px; }
.regua-trilho::before {
  content: ""; position: absolute; left: 0; right: 0; top: 12px; height: 2px; background: var(--grafite); opacity: .55;
}
.regua-faixa {
  position: absolute; top: 5px; height: 16px;
  background: var(--lilas-claro); border: 1.5px solid var(--lilas); border-radius: 99px;
  transition: left .5s cubic-bezier(.3, .7, .3, 1), width .5s cubic-bezier(.3, .7, .3, 1);
}
.regua-escala { position: absolute; inset: 0; }
.regua-tique { position: absolute; top: 8px; width: 1px; height: 10px; background: var(--grafite); opacity: .5; }
.regua-tique.maior { top: 5px; height: 16px; opacity: .8; }
.regua-tique span {
  position: absolute; top: 18px; left: 50%; transform: translateX(-50%);
  font: 400 .68rem/1 var(--f-mono); color: var(--grafite); white-space: nowrap;
}
.regua-marca {
  position: absolute; top: -18px; width: 0; height: 40px;
  transition: left .55s cubic-bezier(.3, .7, .3, 1);
}
.regua-marca::before {
  content: ""; position: absolute; left: -1px; top: 14px; width: 2px; height: 16px; background: var(--grafite);
}
.regua-marca span {
  position: absolute; left: 50%; top: 0; transform: translateX(-50%);
  font: 600 .62rem/1 var(--f-mono); color: var(--grafite);
  background: var(--papel); padding: 1px 3px; border-radius: 3px; border: 1px solid var(--linha);
}
.regua-definitiva::before { background: var(--rosa); width: 3px; left: -1.5px; top: 18px; height: 14px; }
/* A pena definitiva é um coraçãozinho. */
.regua-definitiva span {
  top: -4px; width: 24px; height: 22px; padding: 0; border: 0; font-size: 0; background: var(--rosa);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 22'%3E%3Cpath d='M12 21.5 10.3 20C4.2 14.5 0 10.7 0 6.1 0 2.6 2.7 0 6.2 0c2 0 3.9.9 5.8 2.9C13.9.9 15.8 0 17.8 0 21.3 0 24 2.6 24 6.1c0 4.6-4.2 8.4-10.3 13.9z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 22'%3E%3Cpath d='M12 21.5 10.3 20C4.2 14.5 0 10.7 0 6.1 0 2.6 2.7 0 6.2 0c2 0 3.9.9 5.8 2.9C13.9.9 15.8 0 17.8 0 21.3 0 24 2.6 24 6.1c0 4.6-4.2 8.4-10.3 13.9z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.regua-definitiva.fora::before { background: var(--rubro); }
.regua-definitiva.fora span { background: var(--rubro); }
.regua-marca.encoberta span { opacity: 0; }

.topo-pena {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: .1rem .5rem;
  margin: .1rem auto .35rem;
}
.topo-pena-rotulo { font: 600 .7rem/1 var(--f-corpo); letter-spacing: .06em; text-transform: uppercase; color: var(--grafite); }
.topo-pena strong { font: 600 1.25rem/1.2 var(--f-titulo); color: var(--rosa-texto); }
.topo-pena-extra { color: var(--grafite); font-size: .9rem; }

/* Abas */
.abas {
  display: flex; gap: .15rem; overflow-x: auto; scrollbar-width: none;
  margin-left: calc(-1 * var(--gutter)); margin-right: calc(-1 * var(--gutter));
  padding: 0 var(--gutter);
}
.abas::-webkit-scrollbar { display: none; }
.abas { padding-bottom: .5rem; }
.aba {
  flex-shrink: 0; background: none; border: 0; border-radius: 99px;
  padding: .45rem .85rem; font-weight: 700; font-size: .92rem; color: var(--grafite);
  min-height: 40px; white-space: nowrap;
}
.aba:hover { color: var(--tinta); }
.aba[aria-selected="true"] { color: var(--rosa-texto); background: var(--rosa-claro); }
.aba .aba-alerta {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--rubro);
  margin-left: .3rem; vertical-align: .15em;
}

/* ——— Layout ——— */
.layout {
  max-width: 1240px; margin: 0 auto;
  padding: 1rem var(--gutter) 3rem;
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem;
}
.lateral { display: none; }
.conteudo:focus { outline: none; }

@media (min-width: 1000px) {
  .layout { grid-template-columns: minmax(0, 1fr) minmax(340px, 430px); align-items: start; }
  .lateral {
    display: block; position: sticky; top: var(--altura-topo, 200px);
    max-height: calc(100vh - var(--altura-topo, 200px) - 1rem); overflow: auto;
    padding-right: 4px;
  }
}

/* ——— Painéis ——— */
.painel-cab { margin-bottom: 1rem; }
.sobretitulo { font: 700 .72rem/1 var(--f-corpo); letter-spacing: .08em; text-transform: uppercase; color: var(--rosa-texto); margin: 0 0 .35rem; }
.painel-cab h2 { font-size: clamp(1.45rem, 4.8vw, 1.9rem); font-weight: 600; }
.painel-cab p.guia { margin: .4rem 0 0; color: var(--grafite); max-width: 62ch; }

.bloco { margin: 1.25rem 0; }
.bloco > h3 { font-size: 1.05rem; margin: 0 0 .5rem; }

/* Fita de cálculo: entrada → operações → saída */
.fita {
  letter-spacing: -.03em;
  background: var(--folha); border: 1px solid var(--linha); border-left: 5px solid var(--rosa);
  border-radius: var(--raio); padding: .8rem .95rem; box-shadow: var(--sombra);
  font: 400 .88rem/1.5 var(--f-mono);
}
.fita h3 { font: 700 .72rem/1 var(--f-corpo); letter-spacing: .08em; text-transform: uppercase; color: var(--rosa-texto); margin: 0 0 .5rem; }
.fita ol { list-style: none; margin: 0; padding: 0; }
.fita li { padding: .28rem 0 .28rem 1.3rem; position: relative; border-top: 1.5px dotted var(--linha); overflow-wrap: anywhere; }
.fita li::before { content: "→"; position: absolute; left: 0; color: var(--grafite); }
.fita .fita-entrada { color: var(--grafite); margin: 0 0 .25rem; }
.fita .fita-saida {
  margin: .35rem 0 0; padding-top: .5rem; border-top: 2px solid var(--rosa); color: var(--rosa-texto);
  font-weight: 600; font-size: .95rem;
}
.fita + .fita { margin-top: .75rem; }

details.fund-fase {
  margin-top: .75rem; background: var(--folha); border: 1px solid var(--linha); border-radius: var(--raio);
}
details.fund-fase summary {
  cursor: pointer; padding: .7rem .95rem; font-weight: 700; min-height: 44px; list-style-position: inside;
}
details.fund-fase .doc { padding: 0 .95rem .9rem; }

/* Opções */
.grupo { border: 0; margin: 0 0 1rem; padding: 0; min-width: 0; }
.grupo > legend, .grupo > summary { font: 700 1.02rem/1.3 var(--f-titulo); padding: 0; margin-bottom: .45rem; }
details.grupo > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: .5rem; }
details.grupo > summary .contagem { font: 600 .75rem/1 var(--f-mono); color: var(--rosa-texto); background: var(--rosa-claro); border-radius: 99px; padding: .2rem .45rem; }
.lista { display: grid; gap: .45rem; }

.opcao {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .2rem .7rem; align-items: start;
  background: var(--folha); border: 1px solid var(--linha); border-radius: var(--raio);
  padding: .7rem .8rem; cursor: pointer; position: relative;
  transition: border-color .15s, background-color .15s;
}
.opcao:hover { border-color: var(--grafite); }
.opcao:has(input:checked) { border-color: var(--rosa); background: linear-gradient(90deg, var(--rosa-claro), var(--folha) 70%); }
.opcao.inativa { cursor: default; opacity: .75; }
.opcao input[type="checkbox"], .opcao input[type="radio"] {
  appearance: none; -webkit-appearance: none; margin: .15rem 0 0;
  width: 22px; height: 22px; border: 2px solid var(--grafite); border-radius: 7px;
  display: grid; place-items: center; background: var(--folha); cursor: pointer;
}
.opcao input[type="radio"] { border-radius: 50%; }
.opcao input:checked { background: var(--botao); border-color: var(--botao); }
.opcao input[type="checkbox"]:checked::after {
  content: ""; width: 6px; height: 11px; border: solid var(--botao-texto); border-width: 0 2.5px 2.5px 0;
  transform: translateY(-1px) rotate(45deg);
}
.opcao input[type="radio"]:checked::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--botao-texto); }
.opcao input:disabled { opacity: .5; cursor: not-allowed; }
.opcao input:focus-visible { outline: 3px solid var(--foco); outline-offset: 2px; }
.opcao-nome { font-weight: 700; }
.opcao-dispositivo { display: block; font-size: .82rem; color: var(--grafite); }
.opcao-fato {
  grid-column: 2 / -1; margin: .35rem 0 0; font-size: .92rem; color: var(--tinta);
  border-left: 3px solid var(--rosa); padding-left: .6rem; border-radius: 2px;
}
.opcao-nota { grid-column: 2 / -1; margin: .25rem 0 0; font-size: .85rem; color: var(--grafite); }

.chip {
  font: 600 .78rem/1 var(--f-mono); white-space: nowrap;
  padding: .3rem .45rem; border-radius: 6px; border: 1px solid currentColor; align-self: start;
}
.chip.mais { color: var(--rubro); background: var(--rubro-claro); }
.chip.menos { color: var(--verde); background: var(--verde-claro); }
.chip.neutro { color: var(--grafite); background: transparent; }

/* Extremos da fração variável */
.extremos {
  grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .45rem;
}
.extremo { position: relative; }
.extremo input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.extremo span {
  display: inline-flex; align-items: center; gap: .35rem; min-height: 40px;
  padding: .35rem .75rem; border: 1.5px solid var(--linha); border-radius: 99px; font-weight: 700; background: var(--folha);
}
.extremo span small { font-weight: 400; color: var(--grafite); }
.extremo input:checked + span { border-color: var(--botao); background: var(--botao); color: var(--botao-texto); }
.extremo input:checked + span small { color: inherit; opacity: .8; }
.extremo input:focus-visible + span { outline: 3px solid var(--foco); outline-offset: 2px; }

/* Crime e forma */
.crimes { display: grid; gap: .45rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.forma-faixa { grid-column: 2 / -1; font: 400 .9rem/1.4 var(--f-corpo); color: var(--grafite); margin-top: .15rem; }

/* Alertas */
.alertas { display: grid; gap: .5rem; margin: 0 0 1rem; }
.alerta {
  display: grid; grid-template-columns: auto 1fr; gap: .6rem; align-items: start;
  background: var(--rubro-claro); border: 1px solid var(--rubro); border-radius: var(--raio);
  padding: .65rem .8rem; font-size: .93rem;
}
.alerta::before {
  content: "!"; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: var(--rubro); color: var(--folha); font: 700 .85rem/1 var(--f-mono);
}
.alerta strong { display: block; font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; color: var(--rubro); }

.notas { margin: .75rem 0 0; padding: .7rem .9rem .7rem 1.9rem; background: var(--lilas-claro); border-radius: var(--raio); font-size: .92rem; }
.notas li + li { margin-top: .3rem; }

/* Resultado grande (multa, regime) */
.veredito {
  background: var(--folha); border: 1px solid var(--linha); border-radius: var(--raio); padding: .9rem 1rem; box-shadow: var(--sombra);
}
.veredito + .veredito { margin-top: .75rem; }
.veredito h3 { font-size: 1.05rem; display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
.selo {
  font: 600 .78rem/1 var(--f-mono); letter-spacing: .04em; text-transform: uppercase;
  padding: .35rem .55rem; border-radius: 99px; border: 1.5px solid currentColor;
}
.selo.sim { color: var(--verde); background: var(--verde-claro); }
.selo.nao { color: var(--rubro); background: var(--rubro-claro); }
.selo.regime { color: var(--rosa-texto); background: var(--rosa-claro); border-color: var(--rosa); }
.veredito ul { margin: .5rem 0 0; padding-left: 1.2rem; }
.veredito li + li { margin-top: .25rem; }
.veredito .nota { color: var(--grafite); font-size: .88rem; margin: .5rem 0 0; }
.vazio { color: var(--grafite); background: var(--folha); border: 1px dashed var(--linha); border-radius: var(--raio); padding: 1rem; }

.valores { display: flex; flex-wrap: wrap; gap: .4rem; }

/* Fundamentação: a folha da sentença */
.doc { font-family: var(--f-doc); font-weight: 500; font-size: 1rem; line-height: 1.7; }
.doc h3 {
  font: 700 .8rem/1.2 var(--f-corpo); letter-spacing: .1em; text-transform: uppercase;
  margin: 1.4rem 0 .5rem; color: var(--rosa-texto);
}
.doc h3:first-child { margin-top: 0; }
.doc p { margin: 0 0 .7rem; text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
.doc p.item { padding-left: 1.5rem; text-indent: -1.5rem; margin-bottom: .35rem; }
.folha {
  background: var(--folha); border: 1px solid var(--linha); border-radius: 6px;
  box-shadow: var(--sombra); padding: clamp(1.1rem, 4vw, 2.6rem) clamp(1rem, 5vw, 3rem);
  max-width: 72ch;
}
.folha-cab {
  display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap;
  margin-bottom: 1rem; max-width: 72ch;
}
.copiado { color: var(--verde); font-weight: 700; font-size: .9rem; }

.navegacao { display: flex; justify-content: space-between; gap: .75rem; margin-top: 2rem; }
.navegacao button { min-height: 48px; }
.navegacao .proxima { margin-left: auto; }

/* Lateral (tablet/notebook) */
.lateral h2 { font-size: 1.05rem; margin: 0 0 .6rem; }
.lateral section + section { margin-top: 1.25rem; }
.lateral .fita { box-shadow: none; font-size: .82rem; }
.lateral .folha { padding: 1rem 1.1rem; }
.lateral .doc { font-size: .92rem; }

/* Configurações */
dialog.config {
  border: 1px solid var(--linha); border-radius: 22px; padding: 0; width: min(440px, calc(100vw - 32px));
  background: var(--folha); color: var(--tinta); box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
}
dialog.config::backdrop { background: rgba(59, 34, 64, .45); }
dialog.config form { padding: 1.25rem; display: grid; gap: .9rem; }
.config-ajuda { margin: -.4rem 0 0; color: var(--grafite); font-size: .92rem; }
.campo { display: grid; gap: .3rem; }
.campo span { font-weight: 700; }
.campo small { display: block; font-weight: 400; color: var(--grafite); }
.campo input {
  border: 1.5px solid var(--linha); border-radius: 8px; padding: .55rem .7rem; background: var(--papel); min-height: 44px;
  font-family: var(--f-mono);
}
.campo-carinho { display: grid; grid-template-columns: auto 1fr; gap: .6rem; align-items: start; }
.campo-carinho input { width: 22px; height: 22px; margin-top: .1rem; accent-color: var(--botao); }
.campo-carinho span { font-weight: 700; }
.campo-carinho small { display: block; font-weight: 400; color: var(--grafite); }
.campo-tema { border: 1.5px solid var(--linha); border-radius: 8px; display: flex; flex-wrap: wrap; gap: .3rem 1rem; padding: .5rem .8rem .7rem; }
.campo-tema legend { font-weight: 700; padding: 0 .3rem; }
.campo-tema label { display: flex; align-items: center; gap: .35rem; min-height: 36px; }
.config-acoes { display: flex; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }

/* ——— Carinhos ——— */
.bilhete {
  position: fixed; z-index: 40; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  width: min(440px, calc(100vw - 32px)); transform: translateX(-50%);
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .8rem; align-items: center;
  background: var(--folha); border: 2px solid var(--rosa-claro); border-radius: 22px;
  padding: .75rem .8rem .75rem .75rem; box-shadow: 0 10px 40px rgba(180, 45, 102, .25);
  animation: bilhete-entra .45s cubic-bezier(.2, .9, .3, 1.2);
}
@keyframes bilhete-entra { from { opacity: 0; transform: translate(-50%, 24px) scale(.96); } }
.bilhete-foto, .bilhete-sem-foto {
  width: 58px; height: 58px; border-radius: 50%; object-fit: cover; border: 3px solid var(--rosa-claro);
}
.bilhete-sem-foto { display: grid; place-items: center; background: var(--rosa-claro); color: var(--rosa); }
.bilhete p { margin: 0; font: 600 1.35rem/1.15 var(--f-carinho); color: var(--tinta); }
.bilhete .assinatura { display: block; margin-top: .15rem; font: 600 1.1rem/1 var(--f-carinho); color: var(--rosa-texto); }
.bilhete-fechar {
  align-self: start; width: 36px; height: 36px; border-radius: 50%; border: 0; background: none;
  color: var(--grafite); font-size: 1.3rem; line-height: 1;
}
.bilhete-fechar:hover { background: var(--rosa-claro); }

dialog.boas-vindas { width: min(420px, calc(100vw - 32px)); text-align: center; }
.boas-vindas-corpo { padding: 1.6rem 1.4rem 1.4rem; display: grid; gap: .8rem; justify-items: center; }
.boas-vindas .bilhete-foto, .boas-vindas .bilhete-sem-foto { width: 110px; height: 110px; font-size: 3rem; border-width: 4px; }
.boas-vindas h2 { font-size: 1.7rem; font-weight: 600; color: var(--rosa-texto); }
.boas-vindas p { margin: 0; font: 600 1.45rem/1.25 var(--f-carinho); }
.boas-vindas .assinatura { font: 600 1.3rem/1 var(--f-carinho); color: var(--rosa-texto); }

.ps {
  max-width: 72ch; margin: 1.2rem 0 0; padding: 0 .5rem;
  font: 600 1.45rem/1.25 var(--f-carinho); color: var(--rosa-texto); transform: rotate(-1deg);
}
.nota-limite { margin: .75rem 0 0; padding: .6rem .8rem; border-radius: 12px; background: var(--rosa-claro); font-size: .92rem; }
.nota-limite span { display: block; font: 600 1.25rem/1.15 var(--f-carinho); color: var(--rosa-texto); margin-top: .15rem; }

.coracao-voando {
  position: fixed; z-index: 60; pointer-events: none; color: var(--rosa); font-size: var(--tam, 22px);
  left: var(--x); top: var(--y); animation: coracao-sobe 1.6s ease-out forwards; animation-delay: var(--atraso, 0s);
}
@keyframes coracao-sobe {
  0% { opacity: 0; transform: translate(0, 0) scale(.4); }
  15% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx), -38vh) scale(1.1) rotate(var(--giro)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

@media print {
  .topo, .lateral, .navegacao, .folha-cab button { display: none !important; }
  .folha { box-shadow: none; border: 0; }
}
