:root {
  color-scheme: light;
  --navy:#05284f; --navy-2:#0b3d70; --gold:#d8a640; --gold-soft:#f7edd8;
  --ink:#102238; --muted:#5e6b7a; --line:#d4dbe4; --surface:#ffffff; --bg:#eef2f6;
  --danger:#c83e35; --warning:#d19a24; --success:#18825d; --radius:16px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}
* { box-sizing:border-box; }
html { min-width:320px; background:var(--bg); }
body { margin:0; min-height:100vh; min-height:100svh; min-height:100dvh; color:var(--ink); background:linear-gradient(180deg,#edf2f7,#f8fafc 320px); overflow-x:hidden; }
button,input,select,textarea { font:inherit; }
button { min-height:44px; cursor:pointer; }
.skip-link { position:fixed; left:12px; top:-80px; z-index:9999; background:#fff; color:#000; padding:10px 14px; border-radius:8px; }
.skip-link:focus { top:12px; }
.sr-only { position:absolute!important; width:1px!important; height:1px!important; padding:0!important; margin:-1px!important; overflow:hidden!important; clip:rect(0,0,0,0)!important; white-space:nowrap!important; border:0!important; }

.app-toolbar { position:sticky; top:0; z-index:50; display:flex; align-items:center; gap:18px; justify-content:space-between; padding:max(10px,env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) 10px max(16px,env(safe-area-inset-left)); background:rgba(5,40,79,.98); color:#fff; border-bottom:3px solid var(--gold); box-shadow:0 8px 24px rgba(5,40,79,.16); }
.app-title { display:flex; align-items:center; gap:10px; min-width:210px; }
.app-title img { width:38px; height:38px; }
.app-title strong { display:block; font-size:1rem; }
.app-title small { display:block; color:#cad7e5; margin-top:2px; font-size:.73rem; }
.toolbar-actions { display:flex; align-items:center; justify-content:flex-end; gap:7px; flex-wrap:wrap; }
.toolbar-actions button, .more-menu summary { border:1px solid rgba(255,255,255,.26); background:rgba(255,255,255,.08); color:#fff; border-radius:9px; padding:8px 11px; font-size:.82rem; white-space:nowrap; }
.toolbar-actions button:hover,.toolbar-actions button:focus-visible,.more-menu summary:focus-visible { background:rgba(255,255,255,.17); outline:3px solid rgba(216,166,64,.45); outline-offset:1px; }
.toolbar-actions .primary { background:var(--gold); border-color:var(--gold); color:#102238; font-weight:800; }
.more-menu { position:relative; }
.more-menu summary { list-style:none; display:grid; place-items:center; width:44px; }
.more-menu summary::-webkit-details-marker { display:none; }
.more-menu:not([open]) > div { display:none; }
.more-menu div { position:absolute; right:0; top:50px; background:#fff; border:1px solid var(--line); border-radius:10px; padding:8px; width:245px; box-shadow:0 16px 40px rgba(0,0,0,.17); }
.more-menu div button { width:100%; color:var(--danger); background:#fff; border-color:#ead3d0; }

.tabs-shell { position:sticky; top:67px; z-index:40; display:grid; grid-template-columns:44px minmax(0,1fr) 44px; align-items:stretch; gap:8px; padding:9px max(12px,env(safe-area-inset-right)) 9px max(12px,env(safe-area-inset-left)); background:rgba(238,242,246,.96); backdrop-filter:blur(8px); border-bottom:1px solid #dce3eb; }
.form-tabs { display:flex; gap:7px; overflow-x:auto; overscroll-behavior-inline:contain; scrollbar-width:thin; scroll-snap-type:x proximity; min-width:0; }
.sim-tab { flex:0 0 auto; min-width:155px; max-width:260px; display:flex; align-items:flex-start; flex-direction:column; justify-content:center; gap:2px; border:1px solid var(--line); background:#fff; color:var(--ink); border-radius:10px; padding:7px 12px; scroll-snap-align:start; text-align:left; }
.sim-tab span { max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:.83rem; font-weight:700; }
.sim-tab small { color:var(--muted); }
.sim-tab.active { background:var(--navy); color:#fff; border-color:var(--navy); box-shadow:0 5px 16px rgba(5,40,79,.25); }
.sim-tab.active small { color:#d8e4f0; }
.sim-tab:focus-visible,.tab-arrow:focus-visible { outline:3px solid rgba(216,166,64,.65); outline-offset:1px; }
.tab-arrow { border:1px solid var(--line); border-radius:10px; background:#fff; color:var(--navy); font-size:1.6rem; line-height:1; }

.status-message { position:fixed; z-index:100; right:18px; bottom:max(18px,env(safe-area-inset-bottom)); max-width:min(430px,calc(100vw - 36px)); border:1px solid var(--line); border-left:5px solid var(--navy); background:#fff; padding:13px 16px; border-radius:10px; box-shadow:0 16px 42px rgba(0,0,0,.18); }
.status-message[data-type="error"] { border-left-color:var(--danger); }
.status-message[data-type="success"] { border-left-color:var(--success); }

.app-main { width:min(1380px,calc(100% - 28px)); margin:18px auto 40px; }
.proposal-form { position:relative; display:grid; gap:16px; }
.card { position:relative; background:rgba(255,255,255,.96); border:1px solid var(--line); border-radius:var(--radius); box-shadow:0 8px 24px rgba(28,51,78,.07); overflow:hidden; }
.hero-card { display:flex; align-items:center; justify-content:space-between; padding:22px 26px; background:linear-gradient(135deg,#042448,#0b3d70); color:#fff; border:0; border-bottom:4px solid var(--gold); }
.hero-brand { display:flex; align-items:center; gap:16px; }
.brand-icon { width:62px; height:62px; display:grid; place-items:center; border:2px solid var(--gold); color:var(--gold); border-radius:14px; font-size:2.1rem; }
.hero-card h1 { margin:0; font-size:clamp(1.4rem,2.4vw,2.2rem); letter-spacing:.02em; text-transform:uppercase; }
.hero-card p { margin:4px 0 0; color:var(--gold); text-transform:uppercase; font-size:clamp(.95rem,1.6vw,1.25rem); letter-spacing:.06em; }
.simulation-id { min-width:170px; padding:12px 16px; border:1px solid rgba(216,166,64,.75); border-radius:12px; text-align:center; }
.simulation-id span { display:block; font-size:.74rem; text-transform:uppercase; color:var(--gold); font-weight:800; }
.simulation-id strong { display:block; margin-top:4px; font-size:1.3rem; letter-spacing:.08em; }

.header-fields { padding:18px; display:grid; grid-template-columns:1.45fr .9fr 1.5fr 1.15fr .82fr; gap:16px; align-items:start; }
.header-fields .date-field { grid-column:span 1; }
.header-fields .date-field:nth-of-type(6) { grid-column:1 / span 2; }
.header-fields .date-field:nth-of-type(7) { grid-column:3 / span 2; }
.header-fields .date-field:nth-of-type(8) { grid-column:5; }
.field { min-width:0; }
.field label,.field legend { display:block; color:#16324f; font-size:.73rem; font-weight:800; text-transform:uppercase; letter-spacing:.02em; margin:0 0 7px; }
.field input:not([type="radio"]):not([type="checkbox"]), .field select, .observations-card textarea { width:100%; min-height:46px; border:1px solid #c9d3de; border-radius:8px; background:#fff; color:#14263b; padding:10px 13px; font-size:16px; transition:border-color .15s,box-shadow .15s; }
.field input:focus,.field select:focus,.observations-card textarea:focus { outline:0; border-color:var(--navy-2); box-shadow:0 0 0 3px rgba(11,61,112,.16); }
.field input[readonly] { background:#f4f7fa; color:#526170; }
.field input.is-empty,.field select.is-empty { border-color:#d4a22b; background:#fffdf7; }
.field input.is-invalid,.field select.is-invalid { border-color:var(--danger); background:#fff8f7; }
.field input.is-valid,.field select.is-valid { border-color:#b8c6d5; }
.field-message { display:block; min-height:1.05em; margin-top:4px; color:var(--danger); font-size:.72rem; }
.field-hint { color:#9b6915; font-size:.73rem; margin-top:4px; }
.field-hint.block { display:block; max-width:520px; line-height:1.3; }
.discount-control { display:grid; grid-template-columns:46px minmax(0,1fr); gap:8px; }
.stamp-toggle { appearance:none; width:46px; height:46px; margin:0; border:1px solid #aebdcd; border-radius:8px; background:#fff; position:relative; cursor:pointer; }
.stamp-toggle:checked { background:var(--navy); border-color:var(--navy); }
.stamp-toggle:checked::after { content:'✓'; position:absolute; inset:0; display:grid; place-items:center; color:#fff; font-size:1.35rem; font-weight:900; }
.stamp-toggle:focus-visible { outline:3px solid rgba(216,166,64,.6); outline-offset:2px; }

.segmented { border:0; padding:0; margin:0; min-width:0; }
.segmented-options { display:flex; align-items:stretch; gap:7px; flex-wrap:wrap; }
.segmented-options label { flex:1 1 88px; margin:0; cursor:pointer; text-transform:none; letter-spacing:0; }
.segmented-options.wide label { flex-basis:180px; }
.segmented-options input { position:absolute; opacity:0; pointer-events:none; }
.segmented-options span { min-height:46px; display:flex; align-items:center; justify-content:center; padding:8px 10px; border:1px solid #c9d3de; border-radius:8px; background:#fff; color:#203650; text-align:center; font-size:.82rem; font-weight:650; }
.segmented-options input:checked + span { color:#fff; background:linear-gradient(180deg,var(--navy-2),var(--navy)); border-color:var(--navy); box-shadow:0 5px 12px rgba(5,40,79,.18); }
.segmented-options input:focus-visible + span { outline:3px solid rgba(216,166,64,.55); outline-offset:2px; }

.content-grid,.bottom-grid { display:grid; grid-template-columns:minmax(0,1.65fr) minmax(330px,.95fr); gap:16px; align-items:stretch; }
.client-card,.observations-card,.calculations-card { padding:19px; }
.card h2 { margin:0 0 16px; color:var(--navy); text-transform:uppercase; font-size:1.06rem; letter-spacing:.02em; padding-bottom:10px; border-bottom:1px solid #e1e6ec; }
.card h2::after { content:''; display:block; width:54px; height:3px; background:var(--gold); margin-top:9px; border-radius:3px; }
.card h2 span { font-weight:500; font-size:.8rem; }
.client-card { display:grid; gap:10px; }
.row-field { display:grid; grid-template-columns:minmax(190px,.95fr) minmax(260px,1.35fr); align-items:start; gap:16px; padding-bottom:9px; border-bottom:1px solid #edf0f4; }
.row-field:last-child { border-bottom:0; padding-bottom:0; }
.row-field > label,.row-field > legend { align-self:center; margin:0; }
.row-field > .field-message { grid-column:2; margin-top:-10px; }
.observations-card { min-height:100%; display:flex; flex-direction:column; }
.observations-card textarea { flex:1 1 auto; min-height:345px; resize:vertical; line-height:31px; background-color:#fff; background-image:repeating-linear-gradient(to bottom,transparent 0,transparent 30px,#e1e6ec 31px); position:relative; z-index:2; }
.ruled-lines { display:none; }

.calculations-card { display:grid; gap:8px; }
.result-row { display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:44px; padding:8px 11px; border:1px solid #dce3ea; border-radius:8px; background:#f8fafc; }
.result-row span { color:#1b3551; font-size:.79rem; font-weight:800; text-transform:uppercase; }
.result-row strong { font-size:1.02rem; }
.total-small { background:var(--navy); color:#fff; border-color:var(--navy); }
.total-small span { color:#fff; }
.calculation-alert { margin:2px 0 0; padding:10px 12px; border-radius:8px; background:#fff1ef; color:#a82d25; font-size:.8rem; border:1px solid #f0c8c4; }
.summary-column { display:grid; grid-template-rows:auto 1fr; gap:16px; }
.total-card { display:flex; flex-direction:column; align-items:center; justify-content:center; min-height:165px; padding:20px; color:#fff; background:linear-gradient(135deg,#05284f,#0b3d70); border-radius:var(--radius); border-bottom:4px solid var(--gold); box-shadow:0 12px 28px rgba(5,40,79,.18); }
.total-card span { text-transform:uppercase; font-weight:800; font-size:1.05rem; }
.total-card strong { width:100%; margin-top:15px; padding-top:15px; border-top:1px solid rgba(216,166,64,.7); color:#f0bd53; text-align:center; font-size:clamp(1.65rem,3vw,2.45rem); line-height:1; }
.info-card { background:#fffdf8; border:1px solid #dfb65f; border-radius:var(--radius); padding:20px 22px; box-shadow:0 8px 24px rgba(28,51,78,.06); }
.info-card h3 { margin:0 0 18px; padding-bottom:12px; border-bottom:1px solid #dce3ea; font-size:.92rem; color:#203650; }
.info-card p { margin:14px 0 0; font-size:.95rem; }
.legal-card { display:grid; grid-template-columns:56px 120px minmax(0,1fr); align-items:center; gap:18px; padding:16px 20px; border-color:#dfb65f; background:linear-gradient(90deg,#fffaf0,#fff); }
.warning-icon { width:48px; height:48px; display:grid; place-items:center; background:#d7a43b; color:#fff; font-size:1.65rem; font-weight:900; clip-path:polygon(50% 0,100% 92%,0 92%); padding-top:8px; }
.legal-card > strong { text-transform:uppercase; color:#203650; }
.legal-card p { margin:0; font-size:.83rem; line-height:1.5; }
.form-watermark { position:absolute; z-index:-1; left:50%; top:45%; transform:translate(-50%,-50%) rotate(-15deg); color:rgba(5,40,79,.025); font-weight:900; font-size:clamp(4rem,10vw,9rem); line-height:.9; text-align:center; pointer-events:none; white-space:nowrap; }
.discount-stamp { position:fixed; z-index:30; right:5vw; top:44vh; transform:rotate(-9deg); border:6px double #d93a30; color:#d93a30; background:rgba(255,255,255,.87); padding:12px 24px; font-size:clamp(1.15rem,2.3vw,2.1rem); font-weight:950; text-align:center; line-height:1.05; text-transform:uppercase; box-shadow:0 0 0 3px rgba(217,58,48,.08); pointer-events:none; }

#print-host { display:none; }

@media (max-width:1100px) {
  .app-toolbar { align-items:flex-start; }
  .toolbar-actions { overflow-x:auto; flex-wrap:nowrap; max-width:70vw; justify-content:flex-start; }
  .tabs-shell { top:68px; }
  .header-fields { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .header-fields .date-field:nth-of-type(n) { grid-column:auto; }
  .content-grid,.bottom-grid { grid-template-columns:1fr; }
  .observations-card textarea { min-height:240px; }
  .summary-column { grid-template-columns:1fr 1fr; grid-template-rows:auto; }
}

@media (max-width:760px) {
  .app-toolbar { position:relative; display:block; padding:12px; }
  .app-title { margin-bottom:10px; }
  .toolbar-actions { width:100%; max-width:100%; min-width:0; overflow-x:auto; padding-bottom:4px; justify-content:flex-start; }
  .tabs-shell { position:sticky; top:0; }
  .app-main { width:min(100% - 18px,1380px); margin-top:10px; }
  .hero-card { padding:18px; gap:12px; }
  .brand-icon { width:46px; height:46px; font-size:1.5rem; border-radius:10px; }
  .simulation-id { min-width:128px; padding:9px; }
  .header-fields { grid-template-columns:1fr 1fr; padding:14px; gap:13px; }
  .type-property { grid-column:1 / -1; }
  .discount-field { grid-column:1 / -1; }
  .row-field { grid-template-columns:1fr; gap:7px; }
  .row-field > .field-message { grid-column:auto; margin-top:-4px; }
  .client-card,.observations-card,.calculations-card { padding:14px; }
  .summary-column { grid-template-columns:1fr; }
  .legal-card { grid-template-columns:46px 1fr; gap:10px; }
  .legal-card p { grid-column:1 / -1; }
  .discount-stamp { position:absolute; top:52%; right:4%; font-size:1rem; border-width:4px; padding:9px 12px; }
}

@media (max-width:480px) {
  .header-fields { grid-template-columns:1fr; }
  .type-property,.discount-field { grid-column:auto; }
  .hero-card { align-items:flex-start; }
  .hero-brand { gap:10px; }
  .hero-card h1 { font-size:1.18rem; }
  .hero-card p { font-size:.82rem; }
  .simulation-id { min-width:112px; }
  .simulation-id strong { font-size:1rem; }
  .segmented-options { flex-direction:column; }
  .segmented-options label { flex-basis:auto; }
  .tab-arrow { display:none; }
  .tabs-shell { grid-template-columns:1fr; }
  .toolbar-actions button { padding:8px 10px; }
  .form-watermark { display:none; }
}

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


/* v1.1.0 - cronograma intermediário e refinamentos responsivos */
.intermediate-value-row > div { min-width:0; }
.intermediate-value-row > label { align-self:start; padding-top:14px; }
.decoration-payment .segmented-options { display:grid; grid-template-columns:minmax(120px,.8fr) minmax(180px,1.2fr); }
.intermediate-summary { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:5px 12px; margin-top:7px; padding:9px 11px; border:1px solid #d7e0e9; border-radius:8px; background:linear-gradient(90deg,#f5f8fb,#fff); color:#334b64; }
.intermediate-summary strong { color:var(--navy); font-size:.79rem; }
.intermediate-summary span { font-size:.75rem; }
.intermediate-result { border-color:#ead9b7; background:#fffaf0; }
.toolbar-actions,.form-tabs { -webkit-overflow-scrolling:touch; }
.toolbar-actions { scrollbar-width:thin; overscroll-behavior-inline:contain; }
.hero-card,.header-fields,.content-grid,.bottom-grid { container-type:inline-size; }

@media (max-width:1100px) and (min-width:761px) {
  .header-fields { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .type-property,.discount-field { grid-column:auto; }
  .content-grid { grid-template-columns:minmax(0,1.25fr) minmax(290px,.75fr); }
  .bottom-grid { grid-template-columns:minmax(0,1.15fr) minmax(300px,.85fr); }
  .row-field { grid-template-columns:minmax(170px,.8fr) minmax(230px,1.2fr); }
  .observations-card textarea { min-height:100%; }
}

@media (max-width:760px) {
  .app-toolbar { border-bottom-width:2px; }
  .toolbar-actions { scroll-snap-type:x proximity; gap:8px; }
  .toolbar-actions > button,.toolbar-actions > details { scroll-snap-align:start; flex:0 0 auto; }
  .tabs-shell { box-shadow:0 5px 14px rgba(16,34,56,.08); }
  .sim-tab { min-width:min(78vw,245px); padding:9px 12px; }
  .proposal-form { gap:12px; }
  .card { border-radius:12px; }
  .hero-card { flex-wrap:wrap; }
  .hero-brand { min-width:0; }
  .hero-card h1 { line-height:1.15; }
  .header-fields { gap:10px; }
  .field label,.field legend { line-height:1.3; }
  .content-grid,.bottom-grid { gap:12px; }
  .observations-card textarea { min-height:220px; }
  .intermediate-summary { align-items:flex-start; flex-direction:column; }
  .result-row { min-height:48px; }
  .result-row strong { text-align:right; }
  .total-card { min-height:145px; }
  .info-card { padding:17px; }
}

@media (max-width:520px) {
  .app-main { width:calc(100% - 12px); margin:8px auto 28px; }
  .hero-card { display:grid; grid-template-columns:1fr; padding:15px; }
  .simulation-id { width:100%; min-width:0; display:flex; align-items:center; justify-content:space-between; text-align:left; }
  .simulation-id strong { margin-top:0; }
  .header-fields,.client-card,.observations-card,.calculations-card { padding:12px; }
  .segmented-options { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; }
  .type-property .segmented-options,.intermediate-type .segmented-options { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .segmented-options label,.segmented-options.wide label { min-width:0; }
  .segmented-options span { padding:7px 5px; font-size:.77rem; overflow-wrap:anywhere; }
  .decoration-payment .segmented-options { grid-template-columns:1fr; }
  .row-field { padding-bottom:12px; }
  .legal-card { padding:13px; }
  .status-message { right:8px; max-width:calc(100vw - 16px); }
}

@media (max-width:360px) {
  .toolbar-actions button { padding-inline:9px; }
  .hero-brand { align-items:flex-start; }
  .brand-icon { width:40px; height:40px; flex:0 0 40px; }
  .hero-card h1 { font-size:1.03rem; }
  .hero-card p { font-size:.74rem; }
  .type-property .segmented-options,.intermediate-type .segmented-options { grid-template-columns:1fr; }
  .result-row { align-items:flex-start; flex-direction:column; gap:4px; }
  .result-row strong { text-align:left; }
}


/* v1.2.0 - resumo executivo, máscara monetária em tempo real e impressão A4 integral */
input[data-type="currency"] { font-variant-numeric:tabular-nums; }
.executive-summary { padding:0; overflow:hidden; }
.executive-summary .contract-value { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:16px; padding:15px 20px; background:#f6f7f9; border-bottom:1px solid #cbd3dc; text-transform:uppercase; }
.executive-summary .contract-value strong { color:#172a40; font-size:.92rem; text-align:center; }
.executive-summary .contract-value span { min-width:260px; text-align:center; color:#102238; font-size:1.35rem; font-weight:850; font-variant-numeric:tabular-nums; }
.executive-summary > h2 { margin:0; padding:10px 16px; border:0; background:#172a40; color:#fff; text-align:center; font-size:.98rem; letter-spacing:.04em; }
.executive-summary > h2::after { display:none; }
.executive-table-wrap { width:100%; overflow:hidden; }
.executive-summary table { width:100%; border-collapse:collapse; table-layout:fixed; }
.executive-summary th,.executive-summary td { border:1px solid #cbd3dc; padding:10px 8px; text-align:center; vertical-align:middle; overflow-wrap:anywhere; }
.executive-summary th { background:#edf0f3; color:#172a40; font-size:.72rem; line-height:1.25; text-transform:uppercase; }
.executive-summary td { background:#fff; color:#182b40; font-size:.82rem; font-variant-numeric:tabular-nums; }
.executive-summary th:nth-child(1),.executive-summary td:nth-child(1) { width:7%; }
.executive-summary th:nth-child(2),.executive-summary td:nth-child(2) { width:14%; }
.executive-summary th:nth-child(3),.executive-summary td:nth-child(3) { width:15%; }
.executive-summary th:nth-child(4),.executive-summary td:nth-child(4) { width:16%; }
.executive-summary th:nth-child(5),.executive-summary td:nth-child(5) { width:18%; }
.executive-summary th:nth-child(6),.executive-summary td:nth-child(6) { width:12%; }
.executive-summary th:nth-child(7),.executive-summary td:nth-child(7) { width:18%; }

@media (max-width:760px) {
  .executive-summary .contract-value { grid-template-columns:1fr auto; padding:13px 14px; }
  .executive-summary .contract-value strong { text-align:left; }
  .executive-summary .contract-value span { min-width:0; font-size:1.05rem; }
  .executive-table-wrap { padding:10px; background:#f4f6f8; }
  .executive-summary table,.executive-summary tbody,.executive-summary tr,.executive-summary td { display:block; width:100%!important; }
  .executive-summary thead { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); }
  .executive-summary tbody { display:grid; gap:10px; }
  .executive-summary tr { border:1px solid #cbd3dc; border-radius:10px; overflow:hidden; background:#fff; box-shadow:0 3px 10px rgba(16,34,56,.05); }
  .executive-summary td { display:grid; grid-template-columns:minmax(130px,.9fr) minmax(0,1.1fr); align-items:center; gap:10px; border:0; border-bottom:1px solid #e3e7ec; padding:9px 11px; text-align:right; }
  .executive-summary td:last-child { border-bottom:0; }
  .executive-summary td::before { content:attr(data-label); color:#526276; font-size:.7rem; font-weight:800; text-align:left; text-transform:uppercase; }
}

@media (max-width:420px) {
  .executive-summary .contract-value { grid-template-columns:1fr; gap:7px; }
  .executive-summary .contract-value strong,.executive-summary .contract-value span { text-align:center; }
  .executive-summary td { grid-template-columns:1fr; gap:3px; text-align:left; }
}

/* Impressão dedicada, estática e ajustada à área útil A4 de 190 x 277 mm. */
@page { size:A4 portrait; margin:10mm; }
@media print {
  * { -webkit-print-color-adjust:exact!important; print-color-adjust:exact!important; }
  html,body { width:190mm!important; min-width:0!important; height:277mm!important; margin:0!important; padding:0!important; background:#fff!important; overflow:hidden!important; }
  body > *:not(#print-host) { display:none!important; }
  #print-host { display:block!important; width:190mm!important; height:277mm!important; margin:0!important; padding:0!important; overflow:hidden!important; }
  .print-sheet { box-sizing:border-box; position:relative; display:grid; grid-template-rows:22mm 34mm 70mm 52mm 60mm 29mm; row-gap:2mm; width:190mm; height:277mm; margin:0; padding:0; color:#1d2732; background:#fff; font-family:Arial,sans-serif; overflow:hidden; page-break-after:avoid; break-after:avoid-page; }
  .print-sheet * { box-sizing:border-box; }
  .print-watermark { position:absolute; z-index:0; left:50%; top:49%; transform:translate(-50%,-50%) rotate(-23deg); width:165mm; color:rgba(70,76,84,.055); text-align:center; font-size:16mm; line-height:1.02; font-weight:900; pointer-events:none; }
  .print-header,.print-box,.print-main-grid,.print-lower-grid,.print-executive,.print-legal { position:relative; z-index:1; min-width:0; min-height:0; }

  /* Os antigos blocos azuis são impressos em cinza-claro com texto escuro. */
  .print-header { display:flex; align-items:center; justify-content:space-between; padding:3mm 5mm; color:#1c2732; background:#e3e6e9; border:.3mm solid #9ba3ac; border-bottom:1mm solid #8b949e; }
  .print-brand { display:flex; align-items:center; gap:3mm; min-width:0; }
  .building-mark { width:11mm; height:11mm; display:grid; place-items:center; color:#3b4651; border:.45mm solid #717a84; font-size:6mm; flex:0 0 auto; }
  .print-header h1 { margin:0; font-size:5mm; line-height:1; color:#1c2732; }
  .print-header p { margin:1mm 0 0; color:#4a5560; font-size:3mm; letter-spacing:.25mm; }
  .print-number { min-width:31mm; border:.35mm solid #717a84; border-radius:1.5mm; padding:1.5mm 3mm; text-align:center; background:#f7f8f9; }
  .print-number small { display:block; color:#3c4752; font-size:2.2mm; font-weight:bold; }
  .print-number strong { display:block; margin-top:.7mm; color:#18232e; font-size:3.5mm; }

  .print-box { border:.3mm solid #aeb5bd; border-radius:1.4mm; background:rgba(255,255,255,.92); break-inside:avoid; overflow:hidden; }
  .print-top { padding:2.4mm; display:grid; grid-template-columns:1.3fr .8fr 1fr 1.1fr .75fr; grid-template-rows:1fr 1fr; gap:1.4mm; }
  .print-top > div { min-width:0; border-right:.22mm solid #d2d6da; padding:.5mm 1.2mm; overflow:hidden; }
  .print-top > div:nth-child(5),.print-top > div:last-child { border-right:0; }
  .print-top > div:nth-child(n+6) { border-top:.22mm solid #d2d6da; padding-top:1.8mm; }
  .print-top > div:nth-child(6) { grid-column:1 / span 2; }
  .print-top > div:nth-child(7) { grid-column:3 / span 2; }
  .print-top small,.print-box dt { display:block; font-size:1.9mm; font-weight:bold; color:#34414d; }
  .print-top strong { display:block; min-height:5.4mm; margin-top:1mm; padding:1mm 1.2mm; border:.22mm solid #c4cad0; border-radius:.8mm; color:#18232e; font-size:2.65mm; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; background:#fff; }

  .print-main-grid { display:grid; grid-template-columns:1.65fr .95fr; gap:2mm; }
  .print-main-grid .print-box { padding:2.7mm; }
  .print-sheet h2 { margin:0 0 1.5mm; padding-bottom:1.2mm; border-bottom:.22mm solid #d5d9dd; color:#26333f; font-size:2.8mm; }
  .print-sheet h2::after { content:''; display:block; width:10mm; height:.45mm; margin-top:.8mm; background:#929aa3; }
  .print-sheet dl { margin:0; }
  .print-sheet dl > div { display:grid; grid-template-columns:39% 61%; align-items:center; min-height:8.15mm; border-bottom:.2mm solid #dfe2e5; overflow:hidden; }
  .print-sheet dd { margin:0; padding:.75mm 1.1mm; border:.2mm solid #c7ccd1; border-radius:.65mm; min-height:5.5mm; color:#17222d; background:#fff; font-size:2.15mm; font-weight:bold; overflow:hidden; line-height:1.18; }
  .print-observations p { height:57mm; margin:0; padding:1.5mm; color:#17222d; font-size:2.2mm; font-weight:bold; line-height:5.2mm; background-image:repeating-linear-gradient(to bottom,transparent 0,transparent 4.9mm,#d8dce0 5.1mm); white-space:pre-wrap; overflow:hidden; }

  .print-lower-grid { display:grid; grid-template-columns:1.45fr 1fr; gap:2mm; }
  .print-calc { padding:2.5mm; }
  .print-calc dl > div { min-height:5.95mm; }
  .print-calc dd { min-height:4.5mm; font-size:2mm; }
  .print-summary { display:grid; grid-template-rows:20mm 1fr; gap:2mm; min-height:0; }
  .print-total { display:flex; flex-direction:column; align-items:center; justify-content:center; color:#1c2732; background:#e3e6e9; border:.3mm solid #9ba3ac; border-bottom:.8mm solid #8b949e; border-radius:1.4mm; padding:2mm; }
  .print-total small { font-size:2.8mm; font-weight:bold; }
  .print-total strong { margin-top:1.5mm; padding-top:1.2mm; width:90%; border-top:.25mm solid #7f8993; color:#111b25; font-size:5.2mm; text-align:center; font-variant-numeric:tabular-nums; }
  .print-info { border:.3mm solid #aeb5bd; border-radius:1.4mm; padding:2.5mm; color:#1d2732; font-size:2.15mm; background:#f4f5f6; overflow:hidden; }
  .print-info > strong { display:block; padding-bottom:1.4mm; border-bottom:.2mm solid #ccd1d6; }
  .print-info p { margin:2.4mm 0 0; }

  .print-executive { border:.3mm solid #383d42; overflow:hidden; background:#fff; }
  .print-contract-value { height:9mm; display:grid; grid-template-columns:1fr 1.05fr; align-items:center; border-bottom:.3mm solid #383d42; background:#f0f1f2; }
  .print-contract-value strong,.print-contract-value span { height:100%; display:flex; align-items:center; justify-content:center; padding:1mm 2mm; color:#151b21; font-size:2.8mm; font-weight:bold; text-align:center; }
  .print-contract-value strong { border-right:.3mm solid #383d42; }
  .print-contract-value span { font-size:3.6mm; font-variant-numeric:tabular-nums; }
  .print-flow-title { height:7mm; display:flex; align-items:center; justify-content:center; color:#fff; background:#3d4247; font-size:3mm; font-weight:bold; }
  .print-executive table { width:100%; height:44mm; border-collapse:collapse; table-layout:fixed; }
  .print-executive th,.print-executive td { border:.23mm solid #4f555b; padding:.6mm .8mm; text-align:center; vertical-align:middle; overflow:hidden; }
  .print-executive th { height:8mm; color:#1a222a; background:#e7e9eb; font-size:1.75mm; line-height:1.12; }
  .print-executive td { height:9mm; color:#131b23; background:#fff; font-size:2.25mm; font-variant-numeric:tabular-nums; }
  .print-executive th:nth-child(1),.print-executive td:nth-child(1) { width:7%; }
  .print-executive th:nth-child(2),.print-executive td:nth-child(2) { width:14%; }
  .print-executive th:nth-child(3),.print-executive td:nth-child(3) { width:15%; }
  .print-executive th:nth-child(4),.print-executive td:nth-child(4) { width:16%; }
  .print-executive th:nth-child(5),.print-executive td:nth-child(5) { width:18%; }
  .print-executive th:nth-child(6),.print-executive td:nth-child(6) { width:12%; }
  .print-executive th:nth-child(7),.print-executive td:nth-child(7) { width:18%; }

  .print-legal { border:.3mm solid #aeb5bd; border-radius:1.4mm; display:grid; grid-template-columns:31mm 1fr; align-items:center; background:#f3f4f5; padding:2.4mm 4mm; overflow:hidden; }
  .print-legal > strong { color:#283540; font-size:2.8mm; text-transform:uppercase; border-right:.25mm solid #9da5ad; height:100%; display:flex; align-items:center; }
  .print-legal p { margin:0; padding-left:4mm; color:#1d2732; font-size:2.15mm; line-height:1.35; }
  .print-stamp { position:absolute; z-index:4; top:111mm; right:15mm; transform:rotate(-10deg); border:1.2mm double #a72720; color:#a72720; background:rgba(255,255,255,.92); padding:2.5mm 5mm; font-size:4.8mm; font-weight:900; line-height:1.05; text-align:center; }
}
