/* PDF do Overview Semanal (assets/report-pdf.js): folhas 16:9 de 338,7 × 190,5 mm.
   Tudo sob .pdf-mode-root: o app tem estilos globais (footer, .box…) que não podem vazar para cá, nem o contrário.
   Layout do PDF do Apps Script, reproporcionado para o formato largo. */
.pdf-mode-root {
  --navy: #002f6c; --blue: #2d5fa8; --cyan: #00c8d7; --teal: #1fb5a0; --green: #0d8a74;
  --ink: #17223a; --ink2: #58647a; --muted: #8a94a6; --rule: #c4cdda; --grid: #e2e7ee;
  --hair: rgba(0, 47, 108, .12); --ground: #f0f3f7;
  position: fixed; inset: 0; z-index: 900; overflow: auto; padding: 72px 24px 40px; background: #b9bec6;
}
body.pdf-mode { overflow: hidden; }
.pdf-mode-root .pd-tools { position: fixed; top: 0; left: 0; right: 0; z-index: 905; height: 52px; display: flex; align-items: center; gap: 12px; padding: 0 18px; background: var(--navy); color: #fff; font: 13px 'Open Sans', 'Segoe UI', sans-serif; }
.pdf-mode-root .pd-tools .pd-sp { flex: 1; }
.pdf-mode-root .pd-tools .pd-hint { font-size: 11.5px; opacity: .8; }
.pdf-mode-root .pd-tools button { border: 0; border-radius: 999px; padding: 8px 16px; background: rgba(255, 255, 255, .14); color: #fff; font: 600 12px 'Open Sans', sans-serif; cursor: pointer; }
.pdf-mode-root .pd-tools .pd-primary { background: var(--green); }
.pdf-mode-root .pd-tools button:disabled { opacity: .6; cursor: progress; }

.pdf-mode-root .sheet {
  position: relative; box-sizing: border-box; width: 338.67mm; height: 190.5mm; margin: 0 auto 22px; padding: 18mm 18mm 15mm;
  display: flex; flex-direction: column; overflow: hidden; background: #fff; box-shadow: 0 10px 40px rgba(0, 20, 50, .25);
  color: var(--ink); font: 10.5px/1.55 'Open Sans', sans-serif; -webkit-font-smoothing: antialiased;
}
.pdf-mode-root .sheet * { box-sizing: border-box; }
.pdf-mode-root .sheet img { max-width: none; }
.pdf-mode-root .sheet .pd-note { margin: 0; color: var(--muted); font-size: 10px; }

/* Folhas de conteúdo: faixa de cores, cabeçalho e rodapé */
.pdf-mode-root .sheet.content { background: var(--ground); }
.pdf-mode-root .sheet.content::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 2.2mm; background: linear-gradient(90deg, var(--navy) 0 58%, var(--cyan) 58% 76%, var(--teal) 76% 100%); }
.pdf-mode-root .sheet .ph { position: absolute; left: 18mm; right: 18mm; top: 10.5mm; display: flex; gap: 6px; align-items: center; font-size: 7px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.pdf-mode-root .sheet .ph em { font-style: normal; color: var(--rule); padding: 0 2px; }
.pdf-mode-root .sheet .pf { margin: 0; padding: 0; border: 0; text-align: left; font-family: 'Open Sans', sans-serif; position: absolute; left: 18mm; right: 18mm; bottom: 8.5mm; display: flex; justify-content: space-between; align-items: center; font-size: 7.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.pdf-mode-root .sheet .pf .num { font-size: 10px; font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; }
.pdf-mode-root .st { display: flex; flex-direction: column; gap: 6px; margin: 0 0 18px; }
.pdf-mode-root .st h2 { margin: 0; font-size: 22px; font-weight: 300; line-height: 1.1; letter-spacing: -.02em; color: var(--navy); }
.pdf-mode-root .st .s { font-size: 10px; font-weight: 600; color: var(--ink2); }
.pdf-mode-root .pgroup { display: flex; flex-direction: column; min-height: 0; }
.pdf-mode-root .pgroup h3 { margin: 0 0 9px; font-size: 13px; font-weight: 600; letter-spacing: -.01em; color: var(--navy); text-transform: uppercase; }
.pdf-mode-root .cbox { border: .7px solid var(--hair); border-radius: 6px; padding: 12px 14px 10px; background: #fff; }
.pdf-mode-root .cap { margin: 6px 0 0; font-size: 8.5px; color: var(--ink2); }
.pdf-mode-root .pd-chart { display: block; width: 100%; height: 100%; }
.pdf-mode-root .pd-chart text { font-family: 'Open Sans', sans-serif; fill: var(--ink2); font-size: calc(1px * var(--k, 10.5)); }
.pdf-mode-root .pd-chart .val { fill: var(--ink); font-weight: 600; }
.pdf-mode-root .pd-chart .ttl { fill: var(--navy); font-weight: 600; font-size: calc(1.048px * var(--k, 10.5)); }

/* Capa */
.pdf-mode-root .sheet.cover { padding: 0; display: grid; grid-template-columns: 45% 55%; }
.pdf-mode-root .cover .band-top, .pdf-mode-root .back .band-top { position: absolute; left: 0; right: 0; top: 0; height: 4.5mm; background: var(--navy); z-index: 2; }
.pdf-mode-root .back .band-top { background: linear-gradient(90deg, transparent 0 58%, var(--cyan) 58% 76%, var(--teal) 76% 100%); height: 2.2mm; }
.pdf-mode-root .cover .cbody { display: flex; flex-direction: column; min-width: 0; padding: 20mm 16mm 14mm; }
.pdf-mode-root .cover .brand { display: flex; align-items: center; gap: 20px; }
.pdf-mode-root .cover .brand img { height: 34px; width: auto; }
.pdf-mode-root .cover .brand img.cl { height: 34px; max-height: 52px; }
.pdf-mode-root .cover .kicker { display: flex; align-items: center; gap: 10px; margin-top: 39mm; font-size: 8.5px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--ink2); }
.pdf-mode-root .cover .kicker::before { content: ''; width: 28px; height: 1.5px; background: var(--navy); }
.pdf-mode-root .cover h1 { margin: 10px 0 0; font-size: 34px; font-weight: 300; line-height: 1.06; letter-spacing: -.025em; color: var(--navy); }
.pdf-mode-root .cover h1 b { font-weight: 600; }
.pdf-mode-root .cover .mes { margin-top: 10px; font-size: 16px; font-weight: 300; color: var(--blue); }
.pdf-mode-root .cover .ctl { margin: 16mm 8px 0; padding-top: 13px; border-top: .7px solid var(--hair); }
.pdf-mode-root .cover .cttl { font-size: 7.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--ink2); }
.pdf-mode-root .cover .chero { position: relative; overflow: hidden; background: #0b1730; }
.pdf-mode-root .cover .chero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pdf-mode-root .cover .chero.nofoto { background: var(--ground); }
.pdf-mode-root .cover .chero .ph2 { position: absolute; inset: 14mm; display: grid; place-items: center; border: .8px dashed var(--rule); border-radius: 10px; font-size: 8px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
/* Linha do tempo do contrato */
.pdf-mode-root .tl { position: relative; margin: 0 8px; padding: 26px 0 26px; }
.pdf-mode-root .tl .line { height: 2px; background: #bdcddd; }
.pdf-mode-root .tl .dot { position: absolute; top: 23px; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: #829fc5; }
.pdf-mode-root .tl .dot.past { background: #4f74a8; }
.pdf-mode-root .tl .dot.big { top: 18px; width: 16px; height: 16px; margin-left: -8px; background: var(--navy); }
.pdf-mode-root .tl .dot.now { top: 18px; width: 16px; height: 16px; margin-left: -8px; background: var(--green); box-shadow: 0 0 0 4px rgba(13, 138, 116, .22); }
.pdf-mode-root .tl .pill { position: absolute; top: 0; transform: translateX(-50%); padding: 1px 6px; border: .6px solid var(--rule); border-radius: 3px; background: #eef2f7; color: var(--navy); font-size: 7px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.pdf-mode-root .tl .lab { position: absolute; bottom: 0; }
.pdf-mode-root .tl .oval { display: inline-block; padding: 2px 7px; border: .6px solid var(--grid); border-radius: 999px; background: #fff; font-size: 7.5px; color: var(--ink2); white-space: nowrap; }

/* Fotos: mosaico de até 8 */
.pdf-mode-root .fg { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(12, 1fr); grid-template-rows: repeat(6, 1fr); gap: 9px; }
.pdf-mode-root .fg figure { position: relative; margin: 0; overflow: hidden; border-radius: 6px; background: #dce3ec; }
.pdf-mode-root .fg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pdf-mode-root .fg figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 12px 9px; background: linear-gradient(transparent, rgba(0, 20, 50, .82)); color: #fff; font-size: 9px; font-weight: 600; }
.pdf-mode-root .fg figcaption:empty { display: none; }
.pdf-mode-root .fg.n1 figure { grid-area: 1/1/7/13; }
.pdf-mode-root .fg.n2 figure:nth-child(1) { grid-area: 1/1/7/7; } .pdf-mode-root .fg.n2 figure:nth-child(2) { grid-area: 1/7/7/13; }
.pdf-mode-root .fg.n3 figure:nth-child(1) { grid-area: 1/1/7/7; } .pdf-mode-root .fg.n3 figure:nth-child(2) { grid-area: 1/7/4/13; } .pdf-mode-root .fg.n3 figure:nth-child(3) { grid-area: 4/7/7/13; }
.pdf-mode-root .fg.n4 figure:nth-child(1) { grid-area: 1/1/7/7; } .pdf-mode-root .fg.n4 figure:nth-child(2) { grid-area: 1/7/4/13; } .pdf-mode-root .fg.n4 figure:nth-child(3) { grid-area: 4/7/7/10; } .pdf-mode-root .fg.n4 figure:nth-child(4) { grid-area: 4/10/7/13; }
.pdf-mode-root .fg.n5 figure:nth-child(1) { grid-area: 1/1/7/6; } .pdf-mode-root .fg.n5 figure:nth-child(2) { grid-area: 1/6/4/9; } .pdf-mode-root .fg.n5 figure:nth-child(3) { grid-area: 1/9/4/13; } .pdf-mode-root .fg.n5 figure:nth-child(4) { grid-area: 4/6/7/9; } .pdf-mode-root .fg.n5 figure:nth-child(5) { grid-area: 4/9/7/13; }
.pdf-mode-root .fg.n6 figure:nth-child(1) { grid-area: 1/1/5/6; } .pdf-mode-root .fg.n6 figure:nth-child(2) { grid-area: 1/6/4/9; } .pdf-mode-root .fg.n6 figure:nth-child(3) { grid-area: 1/9/4/13; } .pdf-mode-root .fg.n6 figure:nth-child(4) { grid-area: 5/1/7/6; } .pdf-mode-root .fg.n6 figure:nth-child(5) { grid-area: 4/6/7/9; } .pdf-mode-root .fg.n6 figure:nth-child(6) { grid-area: 4/9/7/13; }
.pdf-mode-root .fg.n7 figure:nth-child(1) { grid-area: 1/1/5/5; } .pdf-mode-root .fg.n7 figure:nth-child(2) { grid-area: 1/5/3/9; } .pdf-mode-root .fg.n7 figure:nth-child(3) { grid-area: 1/9/3/13; } .pdf-mode-root .fg.n7 figure:nth-child(4) { grid-area: 3/5/5/9; } .pdf-mode-root .fg.n7 figure:nth-child(5) { grid-area: 3/9/5/13; } .pdf-mode-root .fg.n7 figure:nth-child(6) { grid-area: 5/1/7/5; } .pdf-mode-root .fg.n7 figure:nth-child(7) { grid-area: 5/5/7/13; }
.pdf-mode-root .fg.n8 figure:nth-child(1) { grid-area: 1/1/5/5; } .pdf-mode-root .fg.n8 figure:nth-child(2) { grid-area: 1/5/3/9; } .pdf-mode-root .fg.n8 figure:nth-child(3) { grid-area: 1/9/3/13; } .pdf-mode-root .fg.n8 figure:nth-child(4) { grid-area: 3/5/5/9; } .pdf-mode-root .fg.n8 figure:nth-child(5) { grid-area: 3/9/5/13; } .pdf-mode-root .fg.n8 figure:nth-child(6) { grid-area: 5/1/7/5; } .pdf-mode-root .fg.n8 figure:nth-child(7) { grid-area: 5/5/7/9; } .pdf-mode-root .fg.n8 figure:nth-child(8) { grid-area: 5/9/7/13; }

/* Avanço físico */
.pdf-mode-root .g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.pdf-mode-root .box { padding: 16px 16px; border: .7px solid var(--hair); border-radius: 6px; background: #fff; }
.pdf-mode-root .big { font-size: 28px; font-weight: 600; line-height: 1; letter-spacing: -.03em; color: var(--navy); font-variant-numeric: tabular-nums; }
.pdf-mode-root .lbl { margin-top: 8px; font-size: 7.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ink2); }
.pdf-mode-root .advbody { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; /* mesma grade dos cartões de % acima: bordas alinhadas */ margin-top: 14px; }
.pdf-mode-root .advbody .cbox { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.pdf-mode-root .advbody.solo { grid-template-columns: 1fr; }
.pdf-mode-root .advbody .cbox .pd-chart { flex: 1; min-height: 0; }
.pdf-mode-root .pdeliver { --delivery-font: 8.25px; flex: 1; min-height: 0; display: grid; gap: 6px; grid-auto-rows: minmax(0, 1fr); }
.pdf-mode-root .pdeliver .item { min-height: 0; overflow: hidden; padding: 7px 10px; border: .7px solid var(--hair); border-left: 3px solid var(--c); border-radius: 5px; background: #fff; }
.pdf-mode-root .pdeliver .head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.pdf-mode-root .pdeliver h4 { margin: 0; font-size: 10px; font-weight: 700; color: var(--navy); }
.pdf-mode-root .pdeliver .status { flex: 0 1 auto; max-width: 58%; padding: 3px 7px; border-radius: 3px; background: var(--c); color: #fff; font-size: 7.5px; font-weight: 700; letter-spacing: .06em; line-height: 1.25; text-align: center; text-transform: uppercase; }
.pdf-mode-root .pdeliver p { margin: 5px 0 0; font-size: var(--delivery-font); line-height: 1.4; color: var(--ink2); overflow-wrap: anywhere; }

/* Histograma */
.pdf-mode-root .hoursbox { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 148px; border-radius: 6px; background: linear-gradient(145deg, #fff 0%, #f4f8fb 100%); text-align: center; }
.pdf-mode-root .hoursbox .big { font-size: 44px; letter-spacing: -.035em; }
.pdf-mode-root .hoursbox .lbl { margin-top: 10px; font-size: 10px; letter-spacing: .17em; color: var(--ink); }
.pdf-mode-root .cbox.hist { flex: 1; min-height: 0; display: flex; flex-direction: column; margin-top: 10px; }
.pdf-mode-root .cbox.hist .pd-chart { flex: 1; min-height: 0; }
.pdf-mode-root .leg { display: flex; flex-wrap: wrap; gap: 16px; margin: 10px 2px 0; font-size: 11px; color: var(--ink2); }
.pdf-mode-root .leg i { display: inline-block; width: 14px; height: 3px; margin-right: 6px; border-radius: 2px; vertical-align: middle; }

/* HSE (faixa larga) e qualidade (2 colunas), como no Apps Script */
.pdf-mode-root .hsestack { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.pdf-mode-root .hsestack .pgroup + .pgroup { margin-top: 14px; padding-top: 12px; border-top: .7px solid var(--hair); }
.pdf-mode-root .psafe { display: flex; align-items: center; justify-content: center; gap: 48px; min-height: 60mm; padding: 12px 42px; border-radius: 6px; background: var(--navy); color: #fff; }
.pdf-mode-root .psafe .ring { position: relative; flex: none; width: 200px; height: 200px; }
.pdf-mode-root .psafe .ring svg { width: 100%; height: 100%; }
.pdf-mode-root .psafe .num { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.pdf-mode-root .psafe .num b { font-size: 64px; font-weight: 600; letter-spacing: -.03em; }
.pdf-mode-root .psafe .num small { margin-top: 4px; font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; opacity: .7; }
.pdf-mode-root .psafe .t { font-size: 28px; font-weight: 600; line-height: 1.16; max-width: 16ch; }
.pdf-mode-root .psafe .s { margin-top: 11px; font-size: 12.5px; color: rgba(255, 255, 255, .75); }
.pdf-mode-root .psafe .s b { color: #fff; }
.pdf-mode-root .qchecks { display: grid; grid-template-columns: 1fr; gap: 8px 12px; align-content: start; }
.pdf-mode-root .qchecks.two { grid-template-columns: 1fr 1fr; }
.pdf-mode-root .qcheck { display: grid; grid-template-columns: 27px 1fr auto; align-items: center; gap: 10px; min-height: 46px; padding: 5px 2px; }
.pdf-mode-root .qcheck .qi { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 50%; background: var(--c); color: #fff; font-size: 13px; font-weight: 700; }
.pdf-mode-root .qcheck .qb { min-width: 0; }
.pdf-mode-root .qcheck .t { font-size: 9.5px; font-weight: 700; line-height: 1.35; color: var(--navy); }
.pdf-mode-root .qcheck .bar { height: 6px; margin-top: 7px; border-radius: 999px; background: var(--c); }
.pdf-mode-root .qcheck .n { font-size: 9px; font-weight: 800; text-transform: uppercase; white-space: nowrap; color: var(--c); }

/* Contracapa */
.pdf-mode-root .sheet.back { padding: 0; background: var(--navy); color: #fff; }
.pdf-mode-root .back .bk { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 40mm 16mm 12mm; }
.pdf-mode-root .back .blogo { display: flex; align-items: center; gap: 16px; }
.pdf-mode-root .back .blogo img.mse { height: 52px; width: auto; filter: brightness(0) invert(1); }
.pdf-mode-root .back .blogo img.cl { height: 40px; width: auto; }
.pdf-mode-root .back .claim { margin-top: 12mm; font-size: 36px; font-weight: 300; line-height: 1.12; letter-spacing: -.01em; }
.pdf-mode-root .back .claim b { font-weight: 600; }
.pdf-mode-root .back .bband { display: grid; grid-template-columns: 1fr 1fr; column-gap: 42px; align-items: center; margin-top: auto; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .22); }
.pdf-mode-root .back .soc { display: flex; flex-wrap: wrap; gap: 8px; }
.pdf-mode-root .back .soc a { padding: 8px 16px; border: .8px solid rgba(255, 255, 255, .35); border-radius: 3px; color: #fff; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; text-decoration: none; }
.pdf-mode-root .back .sub { margin: 0 0 8px; padding-bottom: 6px; border-bottom: .6px solid rgba(255, 255, 255, .2); font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: rgba(255, 255, 255, .6); }
.pdf-mode-root .back .big2 { margin-bottom: 18px; font-size: 17px; }
.pdf-mode-root .back .ct { font-size: 10px; line-height: 1.6; color: rgba(255, 255, 255, .85); }
.pdf-mode-root .back .canais a { color: #fff; }
.pdf-mode-root .back .bfoot { display: flex; justify-content: space-between; gap: 16px; margin-top: 22px; padding-top: 12px; border-top: .6px solid rgba(255, 255, 255, .18); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: rgba(255, 255, 255, .6); }

/* Versão legível (em teste): textos pequenos sobem para 9,5 px ≈ 7,1 pt. */
.pdf-mode-root.legivel .sheet .ph { font-size: 9.5px; letter-spacing: .1em; }
.pdf-mode-root.legivel .sheet .pf { font-size: 9.5px; letter-spacing: .04em; }
.pdf-mode-root.legivel .sheet .pf .num { font-size: 11px; }
.pdf-mode-root.legivel .cover .kicker, .pdf-mode-root.legivel .cover .cttl { font-size: 9.5px; letter-spacing: .14em; }
.pdf-mode-root.legivel .tl .oval, .pdf-mode-root.legivel .tl .pill { font-size: 9.5px; }
.pdf-mode-root.legivel .tl { padding: 30px 0; }
.pdf-mode-root.legivel .lbl { font-size: 9.5px; letter-spacing: .1em; }
.pdf-mode-root.legivel .pdeliver .status { font-size: 9.5px; }
.pdf-mode-root.legivel .fg figcaption { font-size: 9.5px; }
.pdf-mode-root.legivel .qcheck .n { font-size: 9.5px; }

@media print {
 @page { size: 338.67mm 190.5mm; margin: 0; }
  html, body { margin: 0 !important; padding: 0 !important; background: #fff !important; overflow: visible !important; }
  body.pdf-mode > *:not(.pdf-mode-root) { display: none !important; }
  .pdf-mode-root { position: static; padding: 0; background: none; overflow: visible; }
  .pdf-mode-root .pd-tools { display: none !important; }
  /* Folga de 0,2 mm: o arredondamento para pixels não empurra uma página em branco. */
  .pdf-mode-root .sheet { height: 190.3mm; margin: 0; box-shadow: none; break-inside: avoid-page; break-after: page; }
  .pdf-mode-root .sheet:last-child { break-after: auto; }
  .pdf-mode-root * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
}
