/* Fontes da marca, servidas pelo proprio site. Sem CDN, para nao furar a CSP
   e para nao depender de terceiro no meio de uma reuniao com cliente. */
@font-face {
  font-family: "Cinzel";
  src: url("assets/fonts/Cinzel-Variable.ttf") format("truetype");
  font-weight: 400 900;
  font-display: swap;
}
@font-face {
  font-family: "Playfair Display";
  src: url("assets/fonts/PlayfairDisplay-Variable.ttf") format("truetype");
  font-weight: 400 900;
  font-display: swap;
}

:root {
  color-scheme: dark;

  /* Preto da marca. Escala do fundo da tela ate a borda de card. */
  --ink: #0d0d0d;
  --ink-2: #161616;
  --ink-3: #1f1f1f;
  --ink-soft: #333333;

  /* Papel, para as paginas claras do deck. */
  --paper: #fbfaf7;
  --paper-2: #f2efe8;
  --white: #ffffff;

  --muted: #9b958a;
  --muted-light: #6f6a62;

  /* Ouro oficial HBM. O gradiente e a assinatura da marca. */
  --gold-1: #ffeaa0;
  --gold-2: #f6ce69;
  --gold-3: #b6781c;
  --gold: #c8902e;
  --gold-light: #f6ce69;
  --gold-deep: #8b5b18;
  --gold-grad: linear-gradient(100deg, var(--gold-1) 0%, var(--gold-2) 46%, var(--gold-3) 100%);

  /* Ouro que sobra legivel sobre fundo CLARO. Nunca usar --gold em papel:
     da contraste 2,5 e a letra some. Foi o bug historico do CRM. */
  --gold-on-paper: #7a4f14;

  /* Cor de categoria, nao e a cor da marca. Tons contidos de proposito,
     para nao brigar com o ouro. */
  --blue: #4a6fa5;
  --green: #3f8574;
  --red: #b3372f;

  --line: rgba(255, 255, 255, 0.1);
  --line-paper: #e2ddd2;
  --shadow: 0 32px 80px rgba(0, 0, 0, 0.45);
  --radius: 18px;
  --preview-scale: 0.72;

  --font-display: "Cinzel", Georgia, "Times New Roman", serif;
  --font-serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-body: "Segoe UI Variable", "Segoe UI", -apple-system, system-ui, sans-serif;

  font-family: var(--font-body);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--ink);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--white);
  background:
    linear-gradient(180deg, #101010 0%, #151515 52%, #111111 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  opacity: 0.16;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.22'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
summary,
label[for] {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
label[role="button"]:focus-visible {
  outline: 2px solid var(--gold-light);
  outline-offset: 2px;
}

.ambient {
  position: fixed;
  z-index: -2;
  width: 38rem;
  height: 38rem;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.1;
  pointer-events: none;
}

.ambient-one {
  top: -18rem;
  right: -8rem;
  background: var(--gold);
}

.ambient-two {
  bottom: -22rem;
  left: 18%;
  background: #6b4a14;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding: 12px clamp(20px, 3.5vw, 56px);
  border-bottom: 1px solid var(--line);
  background: rgba(17, 17, 17, 0.87);
  backdrop-filter: blur(20px);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 17px;
  color: var(--white);
  text-decoration: none;
}

.brand-lockup img {
  width: 198px;
  height: 42px;
  object-fit: contain;
}

.brand-divider {
  width: 1px;
  height: 30px;
  background: rgba(255, 255, 255, 0.18);
}

.product-name {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.header-actions,
.save-status {
  display: flex;
  align-items: center;
}

.header-actions {
  gap: 18px;
}

.save-status {
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.save-dot,
.live-dot,
.ready-badge > span {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(93, 179, 162, 0.12);
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(380px, 450px) minmax(0, 1fr);
  align-items: start;
  width: min(1820px, 100%);
  margin: 0 auto;
}

.editor-panel {
  min-height: calc(100vh - 76px);
  padding: 36px 32px 54px clamp(24px, 3vw, 48px);
  border-right: 1px solid var(--line);
  background: rgba(17, 17, 17, 0.54);
}

.editor-intro {
  padding: 8px 4px 25px;
}

.eyebrow,
.step-label {
  margin: 0 0 8px;
  color: var(--gold-light);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.editor-intro h1 {
  max-width: 360px;
  margin: 0;
  text-wrap: balance;
  font-family: var(--font-serif);
  font-size: clamp(28px, 2.2vw, 38px);
  line-height: 1.14;
  letter-spacing: -0.012em;
}

.editor-intro > p:last-child {
  max-width: 375px;
  margin: 15px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.section-nav {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 2px;
  margin-bottom: 20px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.025);
}

.section-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 9px 3px 8px;
  border: 0;
  border-radius: 9px;
  color: #8e877c;
  background: transparent;
  font-size: 8px;
  font-weight: 700;
  transition: 180ms ease;
}

.section-nav-item span {
  color: inherit;
  font-size: 9px;
}

.section-nav-item:hover,
.section-nav-item.is-active {
  color: var(--gold-light);
  background: rgba(200, 144, 46, 0.1);
}

.form-section,
.brand-settings,
.export-panel {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.1);
}

.form-section {
  padding: 22px;
}

.form-section-heading,
.export-heading,
.thesis-group-title,
.upload-field,
.upload-copy,
.calculation-preview,
.modal-header,
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.form-section-heading {
  margin-bottom: 20px;
}

.form-section h2,
.export-panel h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 17px;
  letter-spacing: -0.005em;
}

.section-status {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid rgba(200, 144, 46, 0.18);
  border-radius: 999px;
  color: #bfbbb5;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

[data-icon] svg {
  display: block;
  width: 17px;
  height: 17px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 14px;
}

.field > span:first-child {
  color: #bebab4;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* "Salvo" e "NÃO salvo" não podem ter a mesma cor no canto da tela. */
.save-status.nao-salvou {
  color: #e08b84;
  font-weight: 600;
}

/* Nota de que o quadro mostra só as maiores teses. Fica discreta, mas legível:
   o cliente conta as barras e precisa saber por que a conta não fecha. */
.chart-restantes {
  margin: 10px 0 0;
  color: #9c968d;
  font-size: 9.5px;
  line-height: 1.4;
}

/* Sem valor apurado a rosca não inventa 50%: ela diz que não há divisão. */
.donut-center .donut-vazio {
  color: #cfcac2;
  font-size: 15px;
}

/* "Não consegui carregar" e "não existe" são coisas diferentes, e confundir as
   duas na frente do cliente custa credibilidade. O estado de falha sai em âmbar
   para não ser lido como o estado vazio normal. */
.anexos-falha {
  color: #e0b352;
}

/* Aviso embaixo do campo, sem bloquear nada. Ambar em vez de vermelho: nao e
   erro do consultor, e um lembrete antes de o arquivo ir para o cliente.
   Contraste conferido sobre o preto do painel. */
.field-aviso {
  color: #e0b352;
  font-size: 11.5px;
  line-height: 1.4;
  margin-top: -2px;
}

/* CAIXA ALTA nos titulos e nos nomes de tese, decisao do dono em 12/08.
   Fica no CSS, e nao no texto guardado: o nome da tese e dado que o consultor
   digitou, e subir a caixa no dado corromperia o que ele escreveu. Aqui e so
   apresentacao, e o exporters.js faz o mesmo na hora de desenhar, para tela,
   PDF e PowerPoint mostrarem a mesma coisa.
   Nao entram a descricao nem o fundamento juridico: medido, a caixa alta e 19%
   mais larga e jogaria o fundamento de 2 para 3 linhas, cortando a citacao. */
.cover-main h2,
.slide-title,
.opportunity-copy h4,
.method-card h4,
.closing-content h2,
.bar-label {
  text-transform: uppercase;
}

/* Dica neutra embaixo do campo: nao e aviso, e a medida do espaco que aquele
   texto tem no documento. Cinza e nao ambar, para nao competir com o
   .field-aviso, que existe para chamar atencao de verdade. */
.field-dica {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.4;
  margin-top: -2px;
}

/* Quem esta usando a sessao. Fica discreto ao lado do estado de gravacao, mas
   legivel: numa maquina compartilhada e o que impede o consultor de trabalhar
   assinando como o colega anterior. */
.quem-esta-dentro {
  color: #cfcac2;
  font-size: 12px;
  max-width: 210px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quem-esta-dentro:empty {
  display: none;
}

.field input,
.field select,
.field textarea,
.input-prefix {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 10px;
  color: var(--white);
  background: rgba(9, 9, 9, 0.48);
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.field input,
.field select,
.field textarea {
  min-height: 43px;
  padding: 10px 12px;
  outline: 0;
  font-size: 12px;
}

.field textarea {
  resize: vertical;
  line-height: 1.5;
}

.field input:hover,
.field select:hover,
.field textarea:hover,
.input-prefix:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.input-prefix:focus-within {
  border-color: var(--gold);
  background: rgba(9, 9, 9, 0.7);
  box-shadow: 0 0 0 3px rgba(200, 144, 46, 0.1);
}

.field select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #ada9a1 50%), linear-gradient(135deg, #ada9a1 50%, transparent 50%);
  background-position: calc(100% - 17px) 18px, calc(100% - 12px) 18px;
  background-repeat: no-repeat;
  background-size: 5px 5px;
}

.input-prefix {
  display: flex;
  align-items: center;
  min-height: 43px;
  overflow: hidden;
}

.input-prefix > span {
  padding-left: 12px;
  color: var(--gold-light);
  font-size: 11px;
  font-weight: 700;
}

.input-prefix input {
  min-width: 0;
  border: 0;
  background: transparent;
  box-shadow: none !important;
}

.upload-field {
  gap: 10px;
  margin-top: 2px;
  padding: 12px;
  border: 1px dashed rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.upload-copy {
  justify-content: flex-start;
  gap: 10px;
  min-width: 0;
}

.upload-copy > div {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.upload-copy strong {
  font-size: 11px;
}

.upload-copy small,
.thesis-group-title small {
  margin-top: 2px;
  color: #8d867b;
  font-size: 9px;
}

.upload-icon {
  display: grid;
  flex: 0 0 35px;
  height: 35px;
  place-items: center;
  border-radius: 10px;
  color: var(--gold-light);
  background: rgba(200, 144, 46, 0.1);
}

.upload-actions {
  display: flex;
  align-items: center;
  gap: 3px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 15px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: var(--white);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:active {
  transform: translateY(0);
}

.button-small,
.button-compact {
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 9px;
  font-size: 10px;
}

.button-ghost,
.button-secondary {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.button-ghost:hover,
.button-secondary:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
}

.button-gold {
  color: #211706;
  background: linear-gradient(135deg, #f6ce69, #c8902e);
  box-shadow: 0 9px 20px rgba(200, 144, 46, 0.18);
}

.button-text {
  padding-inline: 7px;
  color: #a49f96;
}

.button-primary {
  background: linear-gradient(135deg, #c8902e, #f6ce69);
  color: #211706;
}

.button-light {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
}

.is-hidden {
  display: none !important;
}

.thesis-group + .thesis-group {
  margin-top: 22px;
}

.thesis-group-title {
  justify-content: flex-start;
  gap: 9px;
  margin-bottom: 9px;
}

.thesis-group-title > div {
  display: flex;
  flex-direction: column;
}

.thesis-group-title strong {
  font-size: 11px;
}

.area-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.area-dot.fiscal {
  background: var(--blue);
  box-shadow: 0 0 0 4px rgba(112, 143, 187, 0.1);
}

.area-dot.previdenciaria {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(93, 179, 162, 0.1);
}

.thesis-list {
  display: grid;
  gap: 7px;
}

.thesis-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 11px 10px 11px 13px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 11px;
  background: rgba(9, 9, 9, 0.32);
}

.thesis-item:hover {
  border-color: rgba(200, 144, 46, 0.2);
}

.thesis-item-copy {
  min-width: 0;
}

.thesis-item-copy strong,
.thesis-item-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thesis-item-copy strong {
  color: #edecea;
  font-size: 11px;
}

.thesis-item-copy span {
  margin-top: 3px;
  color: #918b81;
  font-size: 9px;
}

.thesis-item-value {
  color: var(--gold-light);
  font-size: 10px;
  font-weight: 700;
}

.thesis-item-actions {
  display: flex;
  gap: 2px;
  grid-column: 1 / -1;
  justify-content: flex-end;
  margin-top: -3px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.thesis-action {
  display: grid;
  width: 26px;
  height: 26px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 7px;
  color: #979288;
  background: transparent;
}

.thesis-action:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.07);
}

.thesis-action.delete:hover {
  color: #dd9792;
  background: rgba(215, 133, 127, 0.08);
}

.thesis-action svg {
  width: 14px;
  height: 14px;
}

.empty-theses {
  padding: 16px;
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: #817b70;
  text-align: center;
  font-size: 10px;
}

.range-row {
  display: grid;
  grid-template-columns: 1fr 58px;
  gap: 12px;
  align-items: center;
}

.range-row input[type="range"] {
  height: 6px;
  min-height: 6px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  accent-color: var(--gold);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: none;
}

.range-row output {
  padding: 8px;
  border: 1px solid rgba(200, 144, 46, 0.18);
  border-radius: 9px;
  color: var(--gold-light);
  background: rgba(200, 144, 46, 0.08);
  text-align: center;
  font-size: 12px;
  font-weight: 700;
}

.calculation-preview {
  gap: 10px;
  align-items: stretch;
  margin-top: 8px;
}

.calculation-preview > div {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 12px;
  border-radius: 11px;
  background: rgba(200, 144, 46, 0.07);
}

.calculation-preview span {
  color: #9e9990;
  font-size: 8px;
  text-transform: uppercase;
}

.calculation-preview strong {
  margin-top: 4px;
  overflow: hidden;
  color: var(--gold-light);
  font-size: 12px;
  text-overflow: ellipsis;
}

.brand-settings {
  overflow: hidden;
}

.brand-settings summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 18px;
  color: #b0aca5;
  font-size: 11px;
  font-weight: 600;
  list-style: none;
}

.brand-settings summary::-webkit-details-marker {
  display: none;
}

.brand-settings summary > span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-settings[open] summary > svg:last-child,
.brand-settings[open] summary > span:last-child svg {
  transform: rotate(180deg);
}

.brand-settings-body {
  padding: 4px 18px 10px;
  border-top: 1px solid var(--line);
}

.brand-settings-body .field:first-child {
  margin-top: 16px;
}

.export-panel {
  padding: 22px;
  border-color: rgba(200, 144, 46, 0.24);
  background:
    radial-gradient(circle at 100% 0%, rgba(200, 144, 46, 0.15), transparent 42%),
    rgba(255, 255, 255, 0.04);
}

.export-panel > p {
  margin: 10px 0 17px;
  color: #9b968c;
  font-size: 11px;
  line-height: 1.5;
}

.ready-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  border: 1px solid rgba(93, 179, 162, 0.16);
  border-radius: 20px;
  color: #7bc1b3;
  background: rgba(93, 179, 162, 0.06);
  font-size: 9px;
  font-weight: 700;
}

.export-buttons {
  display: grid;
  gap: 9px;
}

.export-buttons .button {
  justify-content: flex-start;
  min-height: 58px;
  padding: 10px 14px;
}

.export-buttons .button > span:nth-child(2) {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
}

.export-buttons .button small {
  margin-top: 1px;
  font-size: 9px;
  font-weight: 500;
  opacity: 0.65;
}

.preview-panel {
  position: sticky;
  top: 76px;
  height: calc(100vh - 76px);
  min-width: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 10%, rgba(45, 66, 96, 0.24), transparent 45%),
    rgba(9, 9, 9, 0.45);
}

.preview-toolbar {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 10px clamp(18px, 3vw, 42px);
  border-bottom: 1px solid var(--line);
  background: rgba(17, 17, 17, 0.65);
  backdrop-filter: blur(14px);
}

.preview-toolbar > div,
.preview-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.preview-toolbar strong {
  font-size: 11px;
}

.preview-toolbar > div > span:last-child {
  color: #8a8479;
  font-size: 10px;
}

.preview-toolbar-actions output {
  min-width: 44px;
  color: #b0aca4;
  font-size: 10px;
  text-align: center;
}

.icon-button,
.modal-close {
  display: grid;
  width: 30px;
  height: 30px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: #aba69e;
  background: rgba(255, 255, 255, 0.03);
}

.icon-button:hover,
.modal-close:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
}

.icon-button svg,
.modal-close svg {
  width: 14px;
  height: 14px;
}

.preview-stage {
  height: calc(100vh - 134px);
  padding: 34px 24px 120px;
  overflow: auto;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.slide-deck {
  width: 1200px;
  margin: 0 auto;
  zoom: var(--preview-scale);
}

.slide {
  position: relative;
  width: 1200px;
  height: 675px;
  margin: 0 auto 32px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9px;
  background: var(--paper);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.38);
  color: var(--ink);
  font-family: var(--font-body);
}

.slide.dark {
  color: var(--white);
  background:
    radial-gradient(circle at 80% 20%, rgba(200, 144, 46, 0.12), transparent 34%),
    linear-gradient(145deg, #111111 0%, #191919 70%, #111111 100%);
}

.slide.dark::before,
.slide.cover::after,
.slide.closing::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.slide.dark::before {
  inset: 0;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.65' numOctaves='4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: screen;
}

.slide-number {
  position: absolute;
  right: 48px;
  bottom: 25px;
  z-index: 3;
  color: #8c857a;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.slide.dark .slide-number {
  /* 0.4 dava contraste 3,78 sobre o preto do slide, abaixo dos 4,5 exigidos
     para texto normal. Com 0.55 fica em 6,2 e o numero da pagina para de
     desaparecer no rodape. */
  color: rgba(255, 255, 255, 0.55);
}

.slide-footer {
  position: absolute;
  /* Folga suficiente para o numero da pagina, que fica em right: 48px e
     ocupa cerca de 60px. Com os 102px de antes, a linha institucional
     encostava no numero e os dois se misturavam. */
  right: 128px;
  bottom: 27px;
  left: 48px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-top: 9px;
  border-top: 1px solid rgba(17, 17, 17, 0.1);
  color: #999389;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.slide.dark .slide-footer {
  border-color: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.48);
}

.slide-brand {
  position: absolute;
  top: 35px;
  right: 48px;
  z-index: 5;
  width: 250px;
  height: 55px;
  object-fit: contain;
  object-position: right center;
}

.slide:not(.dark) .slide-brand {
  top: 39px;
  width: 224px;
  height: 42px;
}

.slide-header {
  position: relative;
  z-index: 2;
  padding: 44px 48px 0;
}

.slide-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  color: var(--gold-on-paper);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.26em;
  text-transform: uppercase;
}

.slide.dark .slide-kicker {
  color: var(--gold-light);
}

.slide-kicker::before {
  content: "";
  width: 26px;
  height: 2px;
  background: currentColor;
}

.slide-title {
  max-width: 770px;
  margin: 0;
  /* Cinzel e uma capitular romana: pede entreletra neutra e um respiro
     maior entre linhas. O -0.045em de antes era ajuste de sans-serif. */
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 34px;
  line-height: 1.16;
  letter-spacing: 0.004em;
  text-wrap: balance;
}

.slide-subtitle {
  max-width: 730px;
  margin: 12px 0 0;
  color: var(--muted-light);
  font-size: 15px;
  line-height: 1.55;
}

/* ============================================================================
   DECK 100% ESCURO
   O dono pediu para tirar as paginas claras: elas ficavam mal posicionadas e
   obrigavam a usar a versao preta do logo, que so existe em resolucao baixa.
   Com tudo escuro, o deck usa so o logo dourado, que e de alta resolucao.
   Os cartoes abaixo eram brancos; viraram grafite sobre o preto da marca.
   ========================================================================== */
.slide .metric-card,
.slide .summary-insight,
.slide .opportunity-card,
.slide .chart-panel {
  background: #161616;
  border-color: #2e2e2e;
}

.slide .area-summary-card { background: #1f1f1f; }
.slide .bar-track { background: #2a2a2a; }

.slide .metric-card strong,
.slide .opportunity-value strong,
.slide .empty-slide-state strong,
.slide .summary-insight h4,
.slide .opportunity-copy h4,
.slide .chart-panel-title strong {
  color: #f0ece4;
}

.slide .summary-insight > p { color: #a8a299; }
.slide .bar-label,
.slide .bar-value { color: #c4bfb6; }

/* O valor de cada tese e o numero que o cliente procura na pagina. Em ouro,
   ele para o olho onde deve parar. */
.slide .opportunity-value strong { color: var(--gold-light); }

/* ----------------------------------------------------------------------------
   TAMANHO DE LETRA
   Queixa do dono: "achei algumas escritas pequenas". Os rotulos estavam em
   9 e 10 pixels, que no projetor e no PDF impresso somem. Piso de 11.
   -------------------------------------------------------------------------- */
.slide-footer { font-size: 11px; }
.slide .metric-card span,
.slide .area-summary-card span,
.slide .comp-card span,
.slide .projection-stat span,
.slide .hero-total span,
.slide .opportunity-value span,
.slide .chart-panel-title span,
.slide .area-totals > span,
.slide .cover-meta-item span { font-size: 11px; }

.slide .opportunity-copy p,
.slide .hero-total small,
.slide .opportunity-value small,
.slide .area-totals > p,
.slide .projection-note { font-size: 12px; }

.slide-kicker { font-size: 12px; }
.slide .bar-label,
.slide .bar-value { font-size: 12px; }

/* A pagina do grafico estourou a altura depois que as letras cresceram.
   Aperta o painel lateral e o donut para tudo caber sem cortar nada. */
.slide .chart-layout { padding: 14px 48px 52px; gap: 22px; align-items: start; }
.slide .chart-panel { padding: 16px 20px; }
.slide .chart-panel-title { margin-bottom: 10px; }
.slide .chart-summary > div:first-child { margin-bottom: 10px; }
.slide .chart-summary h4 { font-size: 15px; line-height: 1.3; }
.slide .chart-summary p { font-size: 11px; line-height: 1.45; margin-top: 6px; }
.slide .donut { width: 116px; height: 116px; }
.slide .donut::after { inset: 18px; }
.slide .donut-center strong { font-size: 19px; }
.slide .legend { margin-top: 10px; gap: 5px; }
.slide .compensation-layout { padding: 16px 48px 54px; gap: 20px; }
.slide .comp-card { padding: 12px 18px; }
.slide .method-step { padding: 8px 0; }
.slide .bar-row { margin-bottom: 12px; }
.slide .chart-summary { padding: 20px; }
.slide .donut { width: 134px; height: 134px; }
.slide .donut::after { inset: 21px; }
.slide .legend { margin-top: 14px; gap: 6px; }

/* ----------------------------------------------------------------------------
   PISO DE TAMANHO E DE CONTRASTE, aplicado no fim para vencer o que veio antes.
   Sobraram rotulos em 8 e 9 pixels e tres textos abaixo do contraste minimo
   depois que as paginas viraram escuras. Aqui e onde isso fecha.
   -------------------------------------------------------------------------- */
/* O fundamento juridico de cada tese. A pagina promete "o fundamento que a
   sustenta" no subtitulo, entao ele precisa aparecer de fato. Em ouro, uma
   linha, logo abaixo da descricao. */
.slide .opportunity-basis {
  margin: 5px 0 0;
  color: var(--gold-light);
  font-size: 11px;
  line-height: 1.4;
}

/* ============================================================================
   ANEXOS POR TESE (Fase 2). Ficam SO no editor: nada disso sai no arquivo
   do cliente. Cada chip abre o documento com um clique.
   ========================================================================== */
.anexos-bloco {
  grid-column: 1 / -1;
  margin-top: 4px;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.03);
}

.anexos-cab span {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-light);
}

.anexos-cab small { display: block; margin-top: 4px; color: var(--muted); font-size: 11.5px; }

.anexos-lista { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }

.anexos-vazio { color: var(--muted-light); font-size: 12px; }

.anexo-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 6px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--ink-2);
}

.anexo-chip i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.anexo-chip i.memoria { background: var(--green); }
.anexo-chip i.parecer { background: var(--red); }
.anexo-chip i.apoio { background: var(--blue); }

.anexo-abrir {
  border: 0;
  background: transparent;
  color: var(--white);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  padding: 0;
}
.anexo-abrir small { display: block; color: var(--muted); font-size: 10.5px; font-weight: 400; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.anexo-abrir:hover { color: var(--gold-light); }

.anexo-excluir {
  border: 0;
  background: transparent;
  color: var(--muted-light);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 4px;
}
.anexo-excluir:hover { color: #dd9792; }

.anexos-dica { margin: 10px 0 2px; color: var(--muted); font-size: 12px; }

.anexos-envio { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.anexos-envio select {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--ink);
  color: var(--white);
  font: inherit;
  font-size: 13px;
}

.thesis-anexos-badge {
  display: block;
  margin-top: 3px;
  color: var(--gold-light);
  font-size: 10px;
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* ATENCAO, erro que ja cometi aqui: NAO usar uma regra geral do tipo
   `.slide.dark span, strong { font-size: max(11px, 1em) }`. O `1em` vale o
   tamanho do PAI, nao o do proprio elemento, entao aquilo tambem DERRUBAVA os
   numeros grandes: o total da capa caiu de 44px para 16px sem avisar.
   O piso tem que ser aplicado elemento a elemento, so onde a letra e pequena. */
.slide.dark .donut-center span,
.slide.dark .comp-card small,
.slide.dark .method-step span,
.slide.dark .method-step small,
.slide.dark .month-bar-wrap span,
.slide.dark .chart-summary p,
.slide.dark .next-step,
.slide.dark .cover-tag,
.slide.dark .closing-contact {
  font-size: 11px;
}

.slide .area-summary-card b { color: var(--gold-light); }
.slide .area-summary-card strong { color: #e8e3da; }
.slide .opportunity-copy p { color: #a49e94; }
.slide .opportunity-value small { color: #a49e94; }
.slide .cover-cnpj { color: #a8a29a; }

/* CONTRASTE EM PAGINA CLARA.
   Os mesmos rotulos aparecem em pagina escura, onde o cinza claro esta certo
   e legivel. No papel eles somem: davam de 2,5 a 4,2 contra o minimo de 4,5.
   Por isso a correcao vale so no claro, com .slide:not(.dark).
   Regra da casa, herdada do CRM: nenhuma letra pode sumir em nenhum fundo.

   .hero-total NAO entra aqui: e um cartao PRETO dentro de pagina clara,
   entao o rotulo dele tem que continuar cinza claro. Escurecer ali derrubou
   o contraste de 2,6, o oposto do que se queria. */
.slide:not(.dark) .metric-card span,
.slide:not(.dark) .area-summary-card span,
.slide:not(.dark) .comp-card span,
.slide:not(.dark) .projection-stat span,
.slide:not(.dark) .chart-panel-title span,
.slide:not(.dark) .opportunity-value span,
.slide:not(.dark) .opportunity-value small,
.slide:not(.dark) .opportunity-copy p,
.slide:not(.dark) .slide-footer span,
.slide:not(.dark) .slide-number {
  color: #5f5a52;
}

/* Numero de dinheiro em Playfair Display: os algarismos dela tem desenho
   de livro, nao de planilha. tabular-nums para que as casas fiquem
   alinhadas quando um valor fica embaixo do outro. */
.hero-total strong,
.metric-card strong,
.area-summary-card b,
.area-totals > strong,
.opportunity-value strong,
.bar-value,
.donut-center strong,
.comp-card strong,
.projection-stat strong,
.calculation-preview strong,
.thesis-item-value {
  font-family: var(--font-serif);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}


.slide.dark .slide-subtitle {
  color: #bab6b0;
}

/* Precisa ser .slide.cover, com duas classes: a capa tambem carrega a classe
   .dark, e .slide.dark tem especificidade 2. Escrito so como .cover, o fundo
   da capa perdia para o degrade generico das paginas escuras. */
.slide.cover {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  /* capa-hbm.jpg ja vem com o veu escuro assado dentro da propria imagem.
     E de proposito: o MESMO arquivo alimenta a tela, o PDF e o PowerPoint,
     entao a capa sai identica nos tres, sem truque de composicao em cada um. */
  background:
    url("assets/capa-hbm.jpg") center / cover no-repeat,
    linear-gradient(135deg, #101010 0%, #191919 58%, #222222 100%);
}

/* O circulo decorativo saiu: a textura ja desenha a capa, e os dois juntos
   poluiam o canto direito, onde fica o cartao da marca. */
.cover::after {
  display: none;
}

.cover-main {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 115px 50px 92px 66px;
}

.cover-mark {
  width: 48px;
  height: 4px;
  margin-bottom: 23px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
}

.cover-label {
  margin: 0 0 18px;
  color: var(--gold-light);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.cover h2 {
  max-width: 690px;
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 48px;
  line-height: 1.12;
  letter-spacing: 0.004em;
  text-wrap: balance;
}

.cover-company {
  max-width: 680px;
  margin: 24px 0 0;
  color: #d5d2ce;
  font-size: 21px;
  line-height: 1.3;
}

.cover-cnpj {
  margin: 9px 0 0;
  color: #a19b92;
  font-size: 14px;
  letter-spacing: 0.06em;
}

.cover-meta {
  display: flex;
  gap: 27px;
  margin-top: auto;
  padding-top: 36px;
}

.cover-meta-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.cover-meta-item span {
  color: #8c857a;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.cover-meta-item strong {
  color: #e2e0dd;
  font-size: 13px;
}

.cover-side {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 80px 54px 80px 38px;
}

.cover-brand-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 470px;
  padding: 38px 34px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 26px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03));
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(16px);
}

.cover-brand-card > img.hbm-cover-logo {
  width: 100%;
  /* altura livre: a proporcao vem do proprio arquivo (6,4 para 1).
     Os 95px fixos de antes deixavam um vao morto acima e abaixo. */
  height: auto;
}

.client-logo-wrap {
  display: grid;
  min-height: 160px;
  place-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.client-logo-wrap img {
  max-width: 260px;
  max-height: 115px;
  object-fit: contain;
}

.client-logo-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  color: #817b70;
  font-size: 10px;
  text-transform: uppercase;
}

.client-logo-placeholder svg {
  width: 30px;
  height: 30px;
}

.cover-brand-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #9a948a;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.summary-body {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 28px;
  padding: 33px 48px 70px;
}

.hero-total {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 210px;
  padding: 30px;
  overflow: hidden;
  border-radius: 20px;
  color: var(--white);
  background: linear-gradient(145deg, #181818, #282828);
}

.hero-total::after {
  content: "";
  position: absolute;
  right: -70px;
  bottom: -120px;
  width: 280px;
  height: 280px;
  border: 1px solid rgba(200, 144, 46, 0.3);
  border-radius: 50%;
  box-shadow: 0 0 0 35px rgba(200, 144, 46, 0.035), 0 0 0 70px rgba(200, 144, 46, 0.025);
}

.hero-total span,
.metric-card span,
.area-summary-card span,
.comp-card span,
.projection-stat span {
  color: #a19b92;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-total strong {
  position: relative;
  z-index: 1;
  margin: 11px 0 8px;
  color: var(--gold-light);
  font-size: 44px;
  line-height: 1;
  letter-spacing: -0.008em;
}

.hero-total small {
  position: relative;
  z-index: 1;
  max-width: 450px;
  color: #c4c1bb;
  font-size: 12px;
  line-height: 1.5;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.metric-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 96px;
  padding: 14px;
  border: 1px solid #e4dfd5;
  border-radius: 14px;
  background: var(--white);
}

.metric-card strong {
  margin-top: 7px;
  color: var(--ink);
  font-size: 17px;
}

.summary-insight {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 28px;
  border: 1px solid #e4dfd5;
  border-radius: 20px;
  background: var(--white);
}

.summary-insight h4 {
  margin: 0;
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: -0.035em;
}

.summary-insight > p {
  margin: 12px 0 23px;
  color: #7e786e;
  font-size: 12px;
  line-height: 1.6;
}

.area-summary-list {
  display: grid;
  gap: 9px;
}

.area-summary-card {
  display: grid;
  grid-template-columns: 9px 1fr auto;
  gap: 11px;
  align-items: center;
  padding: 13px;
  border-radius: 12px;
  background: #f5f2ec;
}

.area-summary-card i {
  width: 9px;
  height: 35px;
  border-radius: 6px;
}

.area-summary-card i.fiscal {
  background: var(--blue);
}

.area-summary-card i.previdenciaria {
  background: var(--green);
}

.area-summary-card div {
  display: flex;
  flex-direction: column;
}

.area-summary-card strong {
  font-size: 14px;
}

.area-summary-card > b {
  color: var(--ink-soft);
  font-size: 15px;
}

.section-body {
  position: relative;
  z-index: 2;
  padding: 28px 48px 70px;
}

.opportunity-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 22px;
}

.opportunity-list {
  display: grid;
  gap: 10px;
}

.opportunity-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 150px;
  gap: 16px;
  align-items: center;
  min-height: 100px;
  padding: 17px;
  border: 1px solid #e1ddd4;
  border-radius: 16px;
  background: var(--white);
}

.opportunity-index {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  background: var(--ink-3);
}

.opportunity-card.fiscal .opportunity-index {
  background: #3f6396;
}

.opportunity-card.previdenciaria .opportunity-index {
  background: #2f6d5f;
}

.opportunity-copy {
  min-width: 0;
}

.opportunity-copy h4 {
  margin: 0;
  overflow: hidden;
  font-size: 16px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.opportunity-copy p {
  display: -webkit-box;
  margin: 6px 0 0;
  overflow: hidden;
  color: #817b70;
  font-size: 10px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.opportunity-value {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding-left: 14px;
  border-left: 1px solid #e6e1d8;
}

.opportunity-value span {
  color: #958f85;
  font-size: 9px;
  text-transform: uppercase;
}

.opportunity-value strong {
  margin-top: 4px;
  color: var(--ink);
  font-size: 17px;
}

.opportunity-value small {
  margin-top: 5px;
  color: var(--gold-deep);
  font-size: 9px;
  font-weight: 700;
}

.area-totals {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100%;
  padding: 23px;
  border-radius: 18px;
  color: var(--white);
  background: var(--ink-2);
}

.area-totals.fiscal {
  background: linear-gradient(150deg, #293c56, #1c1c1c);
}

.area-totals.previdenciaria {
  background: linear-gradient(150deg, #1f413a, #0f201d);
}

.area-totals > span {
  color: rgba(255, 255, 255, 0.6);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.area-totals > strong {
  margin-top: 10px;
  color: var(--gold-light);
  font-size: 28px;
  line-height: 1;
  letter-spacing: -0.008em;
}

.area-totals > p {
  margin: 13px 0 18px;
  color: rgba(255, 255, 255, 0.63);
  font-size: 10px;
  line-height: 1.5;
}

.area-totals-meta {
  display: grid;
  gap: 8px;
  padding-top: 17px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.area-totals-meta div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 9px;
}

.area-totals-meta strong {
  color: var(--white);
}

.empty-slide-state {
  display: grid;
  min-height: 300px;
  place-items: center;
  border: 1px dashed #cfc9bf;
  border-radius: 18px;
  color: #9d978e;
  text-align: center;
}

.empty-slide-state div {
  max-width: 420px;
}

.empty-slide-state strong {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 20px;
}

.chart-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 32px;
  align-items: stretch;
  padding: 30px 48px 76px;
}

.chart-panel {
  padding: 22px 24px;
  border: 1px solid #e1ddd4;
  border-radius: 18px;
  background: var(--white);
}

.chart-panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 25px;
}

.chart-panel-title strong {
  font-size: 14px;
}

.chart-panel-title span {
  color: #9f9990;
  font-size: 9px;
}

.bar-chart {
  display: grid;
  gap: 18px;
}

.bar-row {
  display: grid;
  /* A ultima coluna era 88px, medida para o valor CURTO ("R$ 2,5 mi"). Agora o
     valor sai exato, porque a soma das partes tem que fechar com o total, e
     "R$ 2.500.000,00" pede 94px. 108px cobre ate a casa dos bilhoes sem
     estourar, e a coluna do meio e flexivel, entao nada mais se mexe. */
  grid-template-columns: 170px minmax(0, 1fr) 108px;
  gap: 12px;
  align-items: center;
}

.bar-label {
  overflow: hidden;
  color: #494640;
  font-size: 10px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-track {
  position: relative;
  height: 14px;
  overflow: hidden;
  border-radius: 9px;
  background: #ebe8e2;
}

.bar-fill {
  height: 100%;
  min-width: 4px;
  border-radius: inherit;
  background: linear-gradient(90deg, #c8902e, #f6ce69);
}

.bar-fill.fiscal {
  background: linear-gradient(90deg, #466796, #7b98c1);
}

.bar-fill.previdenciaria {
  background: linear-gradient(90deg, #3b7e70, #70bcad);
}

.bar-value {
  color: #494640;
  font-size: 9px;
  font-weight: 700;
  text-align: right;
}

.chart-summary {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px;
  border-radius: 18px;
  color: var(--white);
  background: linear-gradient(150deg, #1f1f1f, #111111);
}

.chart-summary h4 {
  margin: 0;
  color: var(--gold-light);
  font-size: 19px;
  line-height: 1.28;
}

.chart-summary p {
  margin: 10px 0 23px;
  color: #b4b0a9;
  font-size: 10px;
  line-height: 1.55;
}

.donut {
  --fiscal-share: 50%;
  position: relative;
  display: grid;
  width: 165px;
  height: 165px;
  margin: 0 auto;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--blue) 0 var(--fiscal-share), var(--green) var(--fiscal-share) 100%);
}

.donut::after {
  content: "";
  position: absolute;
  inset: 25px;
  border-radius: 50%;
  background: #161616;
}

.donut-center {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.donut-center strong {
  color: var(--white);
  font-size: 22px;
}

.donut-center span {
  color: #999389;
  font-size: 8px;
  text-transform: uppercase;
}

.legend {
  display: grid;
  gap: 8px;
  margin-top: 20px;
}

.legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: #bebbb5;
  font-size: 9px;
}

.legend-item span:first-child {
  display: flex;
  align-items: center;
  gap: 7px;
}

.legend-item i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.compensation-layout {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 25px;
  padding: 34px 48px 76px;
}

.compensation-flow {
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  gap: 24px;
  align-items: center;
}

.flow-column {
  display: grid;
  gap: 11px;
}

.comp-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 116px;
  padding: 21px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
}

.comp-card.highlight {
  border-color: rgba(200, 144, 46, 0.35);
  background: linear-gradient(145deg, rgba(200, 144, 46, 0.18), rgba(200, 144, 46, 0.05));
}

.comp-card.positive {
  border-color: rgba(93, 179, 162, 0.28);
  background: rgba(93, 179, 162, 0.09);
}

.comp-card strong {
  margin-top: 7px;
  color: var(--white);
  font-size: 24px;
}

.comp-card small {
  margin-top: 6px;
  color: #938d83;
  font-size: 9px;
  line-height: 1.45;
}

.flow-separator {
  width: 1px;
  height: 76%;
  background: linear-gradient(180deg, transparent, rgba(200, 144, 46, 0.42), transparent);
}

.method-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 27px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
}

.method-card h4 {
  margin: 0;
  color: var(--gold-light);
  font-size: 21px;
}

.method-card > p {
  margin: 10px 0 21px;
  color: #ada8a0;
  font-size: 11px;
  line-height: 1.6;
}

.method-steps {
  display: grid;
  gap: 10px;
}

.method-step {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 11px;
  align-items: center;
  padding: 11px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.045);
}

.method-step span {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 8px;
  color: var(--ink);
  background: var(--gold-light);
  font-size: 10px;
  font-weight: 800;
}

.method-step div {
  display: flex;
  flex-direction: column;
}

.method-step strong {
  font-size: 11px;
}

.method-step small {
  margin-top: 2px;
  color: #969086;
  font-size: 8px;
}

.projection-layout {
  position: relative;
  z-index: 2;
  padding: 30px 48px 76px;
}

.projection-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 21px;
}

.projection-stat {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 90px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
}

.projection-stat strong {
  margin-top: 7px;
  color: var(--gold-light);
  font-size: 21px;
}

.projection-chart {
  position: relative;
  height: 215px;
  padding: 18px 16px 28px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.04);
}

.month-bars {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 11px;
  align-items: end;
  height: 100%;
}

.month-bar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
}

.month-bar {
  width: 100%;
  min-height: 5px;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, var(--gold-light), var(--gold-deep));
  box-shadow: 0 8px 18px rgba(200, 144, 46, 0.12);
}

/* A partir do mes em que o credito se esgota, a barra vira ouro apagado: a
   figura passa a dizer a mesma coisa que a frase do cabecalho, em vez de
   sugerir um uso que o proprio estudo nega. */
.month-bar.esgotado {
  background: linear-gradient(180deg, #8a6221, #4f3610);
  box-shadow: none;
}

.month-bar-wrap span {
  margin-top: 7px;
  color: #8e877c;
  font-size: 8px;
  text-transform: uppercase;
}

.projection-note {
  margin: 12px 0 0;
  color: #9c968d;
  font-size: 9px;
  text-align: right;
}

/* .slide.closing, com duas classes, pelo mesmo motivo da capa: a pagina
   tambem carrega .dark, que tem especificidade 2 e venceria um .closing
   sozinho, comendo a imagem de fundo. */
.slide.closing {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  /* A balanca ja vem com veu forte assado na imagem: vira textura, nao
     concorre com o texto. Ponto mais claro da 5,9 de contraste no branco. */
  background:
    url("assets/encerramento-hbm.jpg") center / cover no-repeat,
    linear-gradient(135deg, #101010 0%, #191919 58%, #111111 100%);
}

.slide.closing .closing-content { position: relative; z-index: 1; }

.closing::after {
  width: 560px;
  height: 560px;
  border: 1px solid rgba(200, 144, 46, 0.16);
  border-radius: 50%;
  box-shadow: 0 0 0 62px rgba(200, 144, 46, 0.025), 0 0 0 124px rgba(200, 144, 46, 0.018);
}

.closing-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 780px;
  padding-bottom: 30px;
}

.closing-content > img {
  width: 300px;
  max-height: 90px;
  object-fit: contain;
}

.closing-line {
  width: 44px;
  height: 3px;
  margin: 29px 0 23px;
  border-radius: 4px;
  background: var(--gold);
}

.closing h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 40px;
  line-height: 1.14;
  letter-spacing: 0.004em;
  text-wrap: balance;
}

.closing p {
  max-width: 650px;
  margin: 15px 0 29px;
  color: #bbb7b1;
  font-size: 14px;
  line-height: 1.6;
}

.next-steps {
  display: flex;
  gap: 10px;
}

.next-step {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: #d0cdc9;
  background: rgba(255, 255, 255, 0.04);
  font-size: 10px;
}

.next-step span {
  color: var(--gold-light);
  font-weight: 800;
}

.closing-contact {
  margin-top: 28px;
  color: var(--gold-light);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Numa tela de 1366x768 o modal batia no teto (732px de altura util) e o botao
   Salvar caia em y=820, ou seja, FORA da tela: era preciso rolar 134px dentro
   da janela para achar onde salvar, e quem nao rolava concluia que nao tinha
   como salvar. Agora quem rola e SO o miolo: cabecalho e rodape ficam parados,
   entao o Salvar esta sempre a vista, em qualquer altura de tela. */
.modal {
  width: min(620px, calc(100vw - 32px));
  max-height: calc(100vh - 36px);
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 20px;
  color: var(--white);
  background: #171717;
  box-shadow: var(--shadow);
  flex-direction: column;
}

/* O display:flex mora AQUI, so com [open], e nao no .modal seco. Regra do
   autor vence o padrao do navegador (dialog:not([open]) { display:none }), que
   e do user-agent, entao um .modal com display:flex fixo deixava o formulario
   inteiro da tese aparecer no rodape da pagina com o dialog FECHADO. Com o
   recorte por [open], fechado volta a herdar o display:none do navegador. */
.modal[open] {
  display: flex;
}

.modal > form {
  display: flex;
  min-height: 0;
  flex-direction: column;
  flex: 1;
}

.modal .modal-body {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  flex: 1;
}

.modal .modal-header,
.modal .modal-footer {
  flex-shrink: 0;
}

.modal::backdrop {
  background: rgba(6, 6, 6, 0.75);
  backdrop-filter: blur(7px);
}

.modal-header,
.modal-footer {
  padding: 20px 22px;
}

.modal-header {
  border-bottom: 1px solid var(--line);
}

.modal-header h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 21px;
}

.modal-body {
  padding: 22px 22px 8px;
}

.modal-footer {
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 300px;
  max-width: calc(100vw - 48px);
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  background: rgba(23, 23, 23, 0.96);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
  backdrop-filter: blur(18px);
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast-icon {
  display: grid;
  flex: 0 0 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  color: #7bc1b3;
  background: rgba(93, 179, 162, 0.1);
}

.toast > div {
  display: flex;
  flex-direction: column;
}

.toast strong {
  font-size: 11px;
}

.toast div span {
  margin-top: 2px;
  color: #a49f97;
  font-size: 10px;
}

.export-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(9, 9, 9, 0.86);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
  backdrop-filter: blur(15px);
}

.export-overlay.is-visible {
  opacity: 1;
  pointer-events: all;
}

.export-overlay strong {
  margin-top: 18px;
  font-family: var(--font-serif);
  font-size: 19px;
}

.export-overlay span {
  margin-top: 6px;
  color: #a5a098;
  font-size: 11px;
}

.export-loader {
  width: 46px;
  height: 46px;
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--gold-light);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 1380px) {
  :root { --preview-scale: 0.62; }
  .app-shell { grid-template-columns: 400px minmax(0, 1fr); }
  .editor-panel { padding-inline: 24px; }
}

@media (max-width: 1080px) {
  :root { --preview-scale: 0.68; }
  .app-shell { display: block; }
  .editor-panel {
    min-height: 0;
    padding: 32px clamp(20px, 5vw, 54px) 46px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .editor-intro h1,
  .editor-intro > p:last-child { max-width: 650px; }
  #presentationForm {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
  #presentationForm .form-section,
  #presentationForm .brand-settings { margin-top: 0; }
  #presentationForm .brand-settings { grid-column: 1 / -1; }
  .export-panel { max-width: none; }
  .preview-panel {
    position: relative;
    top: auto;
    height: 850px;
  }
  .preview-stage { height: 792px; }
}

@media (max-width: 760px) {
  .app-header { min-height: 64px; padding: 10px 16px; }
  .brand-lockup img { width: 145px; height: 34px; }
  .brand-divider,
  .product-name,
  .save-status { display: none; }
  .editor-panel { padding: 24px 16px 38px; }
  .editor-intro { padding-top: 0; }
  .editor-intro h1 { font-size: 29px; }
  .section-nav { overflow-x: auto; }
  .section-nav-item { min-width: 60px; }
  #presentationForm { display: block; }
  #presentationForm .form-section,
  #presentationForm .brand-settings { margin-top: 12px; }
  .field-grid { grid-template-columns: 1fr; gap: 0; }
  .upload-field { align-items: flex-start; flex-direction: column; }
  .calculation-preview { flex-direction: column; }
  .preview-panel { height: 630px; }
  .preview-stage { height: 572px; padding: 24px 16px 80px; }
  .slide-deck { zoom: 0.42; }
  .preview-toolbar { padding-inline: 16px; }
  .toast { right: 16px; bottom: 16px; left: 16px; min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
