/* =========================================================
   ESTILOS · Cotizador de aluminio y PVC
   El color de marca (--cell) se cambia desde "Ajustes > Marca"
   ========================================================= */
:root {
  --cell: #0F5257;                                        /* color de marca */
  --cell-dark: color-mix(in srgb, var(--cell) 70%, #000);
  --cell-soft: color-mix(in srgb, var(--cell) 8%, #fff);
  --sun: #F2B705;
  --paper: #FBFCFD;
  --ink: #0F1B2A;
  --mute: #5B6B7C;
  --line: #D8DEE6;
  --ok: #2E7D5B;
  --warn: #B4541A;
  --f: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box }
html, body { margin: 0 }
body { font-family: var(--f); color: var(--ink); background: var(--paper); font-size: 16px; line-height: 1.45 }
button, input, select, textarea { font: inherit; color: inherit }
img { max-width: 100% }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px }

/* ---------- cabecera y navegación ---------- */
.top { background: var(--cell); color: #fff; padding: 14px clamp(16px, 4vw, 48px); display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none }
.brand-logo { width: 40px; height: 40px; display: grid; place-items: center; flex: none }
.brand-logo img { max-height: 40px; max-width: 40px; object-fit: contain; background: #fff; border-radius: 8px; padding: 3px }
/* logo por defecto: una ventana de dos hojas */
.brand-mark { width: 32px; height: 32px; border-radius: 4px; display: block; border: 3px solid var(--sun);
  background: linear-gradient(var(--sun), var(--sun)) center / 3px 100% no-repeat, linear-gradient(135deg, #D6EEF8, #8CC4DE) }
.brand b { font-stretch: 115%; font-weight: 800; font-size: 1.1rem; display: block; line-height: 1.1 }
.brand small { display: block; font-size: .78rem; opacity: .75 }
.nav { display: flex; gap: 4px; flex-wrap: wrap }
.nav a { color: #fff; text-decoration: none; padding: 8px 12px; border-radius: 8px; font-size: .92rem; opacity: .8 }
.nav a:hover { opacity: 1; background: rgba(255, 255, 255, .1) }
.nav a[aria-current=page] { opacity: 1; background: rgba(255, 255, 255, .16); font-weight: 600 }
.nav .badge { background: var(--sun); color: var(--ink); border-radius: 10px; padding: 0 7px; font-size: .75rem; font-weight: 700; margin-left: 4px }

/* ---------- botones ---------- */
.btn { border: 0; border-radius: 8px; padding: 10px 16px; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; font-size: .95rem }
.btn-sun { background: var(--sun); color: var(--ink) }
.btn-sun:hover { filter: brightness(1.05) }
.btn-cell { background: var(--cell); color: #fff }
.btn-cell:hover { background: var(--cell-dark) }
.btn-line { background: #fff; border: 1px solid var(--line); color: var(--ink) }
.btn-line:hover { border-color: var(--cell) }
.btn-ghost { background: rgba(255, 255, 255, .12); color: #fff }
.btn-ghost:hover { background: rgba(255, 255, 255, .2) }
.btn-sm { padding: 6px 10px; font-size: .85rem }
.btn-wa { background: #1FA855; color: #fff }
.btn-wa:hover { background: #188C46 }

/* ---------- layout cotizador ---------- */
.wrap { display: grid; grid-template-columns: minmax(300px, 420px) 1fr; min-height: calc(100vh - 68px) }
.form { padding: 28px clamp(16px, 3vw, 36px); border-right: 1px solid var(--line); background: #fff }
.out { padding: 28px clamp(16px, 4vw, 56px); min-width: 0 }
@media (max-width: 880px) { .wrap { grid-template-columns: 1fr } .form { border-right: 0; border-bottom: 1px solid var(--line) } }

h1 { font-stretch: 120%; font-weight: 800; font-size: 1.6rem; line-height: 1.1; margin: 0 0 6px }
.lead { color: var(--mute); margin: 0 0 24px; font-size: .95rem; max-width: 60ch }
fieldset { border: 0; margin: 0 0 22px; padding: 0 }
legend { font-weight: 700; font-size: 1rem; margin-bottom: 10px; padding: 0; display: flex; align-items: center; gap: 8px }
legend i { font-style: normal; width: 22px; height: 22px; border-radius: 50%; background: var(--cell); color: #fff; font-size: .75rem; display: inline-grid; place-items: center }
label { display: block; font-size: .85rem; color: var(--mute); margin: 10px 0 4px }
input[type=text], input[type=number], input[type=email], input[type=tel], select, textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff }
input:focus, select:focus, textarea:focus { border-color: var(--cell); outline: none; box-shadow: 0 0 0 3px var(--cell-soft) }
input[type=color] { width: 100%; height: 42px; border: 1px solid var(--line); border-radius: 8px; padding: 3px; background: #fff }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px }
.seg { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden }
.seg button { flex: 1; border: 0; background: #fff; padding: 9px 6px; cursor: pointer; font-size: .88rem }
.seg button + button { border-left: 1px solid var(--line) }
.seg button[aria-pressed=true] { background: var(--cell); color: #fff; font-weight: 600 }
input[type=range] { width: 100%; accent-color: var(--cell) }
.range-val { float: right; font-weight: 700; color: var(--ink) }
.photo-drop { border: 1px dashed var(--line); border-radius: 8px; padding: 12px; display: flex; gap: 12px; align-items: center; cursor: pointer; font-size: .88rem; color: var(--mute) }
.photo-drop:hover { border-color: var(--cell) }
.photo-drop img { width: 64px; height: 48px; object-fit: cover; border-radius: 4px }
.photo-drop input { display: none }
.from-lead { background: #FFF6DB; color: #6B4E00; border-radius: 8px; padding: 10px 12px; font-size: .88rem; margin-bottom: 18px }
[hidden] { display: none !important }

/* ---------- líneas de huecos ---------- */
.legend-n { margin-left: auto; font-weight: 500; font-size: .8rem; color: var(--mute) }
legend { width: 100% }
.hueco { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px 12px; margin-bottom: 10px; background: #fff; border-left: 3px solid var(--cell) }
.hueco-h { display: flex; align-items: center; gap: 8px }
.hueco-h input { flex: 1; min-width: 0; padding: 6px 8px; font-size: .88rem; border-color: transparent; background: var(--cell-soft) }
.hueco-n { width: 22px; height: 22px; border-radius: 50%; background: var(--cell-soft); color: var(--cell); font-size: .75rem; font-weight: 700; display: inline-grid; place-items: center; flex: none }
.hueco-p { font-size: .9rem; font-variant-numeric: tabular-nums; white-space: nowrap }
.icon-btn { border: 1px solid var(--line); background: #fff; border-radius: 6px; width: 28px; height: 28px; cursor: pointer; font-size: 1rem; line-height: 1; flex: none; color: var(--mute) }
.icon-btn:hover:not(:disabled) { border-color: var(--cell); color: var(--ink) }
.icon-btn:disabled { opacity: .35; cursor: default }
.hueco label { margin-top: 8px }
.hueco select, .hueco input[type=number] { padding: 8px 10px }
.row3 { display: grid; grid-template-columns: 1fr 1fr .7fr; gap: 10px }
.add-line { width: 100%; justify-content: center; border-style: dashed }
.add-line:disabled { opacity: .5; cursor: default }
.rates-h { margin: 18px 0 0; font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; color: var(--cell) }

/* ---------- resultado ---------- */
.quote-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 20px }
.quote-head h2 { margin: 0; font-stretch: 115%; font-size: 1.25rem }
.quote-meta { color: var(--mute); font-size: .85rem }
.state-pill { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: .78rem; font-weight: 600; background: var(--line) }
.st-borrador { background: #E9EDF2; color: var(--mute) }
.st-enviado { background: #E3EEFA; color: #1F5A99 }
.st-visto { background: #FFF1C9; color: #7A5900 }
.st-aceptado { background: #DDF2E7; color: var(--ok) }
.st-rechazado { background: #F7E1D6; color: var(--warn) }

.hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 28px; align-items: center; background: var(--cell); color: #fff; border-radius: 16px; padding: clamp(18px, 3vw, 32px); position: relative; overflow: hidden }
@media (max-width: 1100px) { .hero { grid-template-columns: 1fr } }
.roof-cap { font-size: .78rem; opacity: .7; margin-top: 8px; display: flex; justify-content: space-between; gap: 8px }

/* ---------- huecos dibujados a escala ----------
   .win = hueco completo (cajón de persiana opcional + marco); .sash = hoja.
   El sentido de apertura se dibuja con degradados: ">" bisagra a la izquierda, "<" a la derecha, "^" abatible (oscilobatiente) */
.facade { position: relative; background: var(--cell-dark); border-radius: 10px; padding: 14px; min-height: 180px; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: center; gap: 14px 16px; overflow: hidden }
.wi { display: flex; flex-direction: column; align-items: center; gap: 5px; transform-origin: bottom; animation: pop .35s ease both }
.wcap { font-size: .7rem; opacity: .8; white-space: nowrap; font-variant-numeric: tabular-nums }
.wcap b { color: var(--sun) }
@keyframes pop { from { transform: scaleY(.2); opacity: 0 } to { transform: none; opacity: 1 } }
@media (prefers-reduced-motion: reduce) { .wi { animation: none !important } }

.win { --frame: #F3F5F7; --edge: #B9C3CD; --sym: rgba(15, 27, 42, .5); display: flex; flex-direction: column }
.win.f-ral { --frame: #3A4047; --edge: #23282D; --sym: rgba(15, 27, 42, .55) }
.win.f-madera { --frame: #8B5E3C; --edge: #5E3D25; --sym: rgba(60, 35, 15, .55) }
.win .frame { display: flex; gap: var(--fr); padding: var(--fr); background: var(--frame); border: 1px solid var(--edge); border-radius: 2px; position: relative; box-sizing: border-box }
.win .cajon { background: repeating-linear-gradient(0deg, var(--frame) 0 2px, var(--edge) 2px 3px); border: 1px solid var(--edge); border-bottom: 0; border-radius: 2px 2px 0 0 }
.sash { flex: 1; position: relative; background: linear-gradient(135deg, #D6EEF8, #9CCDE3 55%, #B9DDEE); outline: 1px solid var(--edge); min-width: 0 }
.sash::before, .sash::after { content: ''; position: absolute; inset: 0; pointer-events: none }
.sash.hl::before { background: linear-gradient(to top right, transparent calc(50% - .8px), var(--sym) 50%, transparent calc(50% + .8px)) top / 100% 50% no-repeat,
                               linear-gradient(to bottom right, transparent calc(50% - .8px), var(--sym) 50%, transparent calc(50% + .8px)) bottom / 100% 50% no-repeat }
.sash.hr::before { background: linear-gradient(to top left, transparent calc(50% - .8px), var(--sym) 50%, transparent calc(50% + .8px)) top / 100% 50% no-repeat,
                               linear-gradient(to bottom left, transparent calc(50% - .8px), var(--sym) 50%, transparent calc(50% + .8px)) bottom / 100% 50% no-repeat }
.sash.ob::after { background: linear-gradient(to bottom right, transparent calc(50% - .8px), var(--sym) 50%, transparent calc(50% + .8px)) left / 50% 100% no-repeat,
                              linear-gradient(to top right, transparent calc(50% - .8px), var(--sym) 50%, transparent calc(50% + .8px)) right / 50% 100% no-repeat }
/* corredera: flecha hacia donde se desliza la hoja */
.sash.co::after { content: '→'; display: grid; place-items: center; color: var(--sym); font-weight: 700; font-size: 1em }
.sash.co.al::after { content: '←' }
.sash.co + .sash.co { margin-left: calc(var(--fr) * -1.5) }
/* puerta de entrada: panel ciego con tirador y una franja de vidrio */
.sash.door { background: linear-gradient(90deg, transparent 42%, rgba(214, 238, 248, .9) 42% 58%, transparent 58%) center 18% / 100% 50% no-repeat,
                         repeating-linear-gradient(0deg, var(--frame) 0 14%, var(--edge) 14% 15%); flex: 2 }
.sash.door::after { inset: 48% auto auto 8%; width: 3px; height: 14%; background: var(--sym); border-radius: 2px }
.sash.side { flex: 1 }
/* mosquitera: malla fina por encima del marco */
.win.mq .frame::after { content: ''; position: absolute; inset: var(--fr); background: repeating-linear-gradient(0deg, rgba(15, 27, 42, .14) 0 1px, transparent 1px 3px), repeating-linear-gradient(90deg, rgba(15, 27, 42, .14) 0 1px, transparent 1px 3px); pointer-events: none }
.sunglow { position: absolute; right: -60px; top: -60px; width: 180px; height: 180px; border-radius: 50%; background: radial-gradient(circle, rgba(242, 183, 5, .55), transparent 65%); pointer-events: none }
.big { font-stretch: 125%; font-weight: 800; font-size: clamp(2.4rem, 5vw, 3.6rem); line-height: 1; margin: 4px 0 2px }
.big small { font-size: .4em; font-weight: 600; font-stretch: 100%; opacity: .8 }
.hero p { margin: 0; opacity: .85 }
.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 22px; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, .18) }
.hero-stats div { font-size: .8rem; opacity: .85 }
.hero-stats b { display: block; font-size: 1.25rem; font-weight: 700; opacity: 1; color: var(--sun) }

.cols { display: grid; grid-template-columns: 1.2fr 1fr; gap: 28px; margin-top: 28px }
@media (max-width: 1100px) { .cols { grid-template-columns: 1fr } }
h3 { font-size: 1rem; margin: 0 0 10px }
table { width: 100%; border-collapse: collapse; font-size: .92rem }
td, th { padding: 9px 0; border-bottom: 1px solid var(--line); vertical-align: top; text-align: left }
.breakdown td:last-child { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums }
td small { display: block; color: var(--mute); font-size: .8rem }
tr.sub td { border-bottom: 0; padding-top: 12px; color: var(--mute) }
tr.total td { border-top: 2px solid var(--ink); border-bottom: 0; font-weight: 800; font-size: 1.1rem; padding-top: 12px }
.saving { border: 1px solid var(--line); border-radius: 12px; padding: 18px; background: #fff }
/* comparativa de materiales */
.cmp-sub { font-size: .82rem; color: var(--mute); margin: -4px 0 10px }
.cmp { display: flex; flex-direction: column; gap: 6px }
.cmp-row { display: grid; grid-template-columns: 8.5em 1fr auto; align-items: center; gap: 10px; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 8px 10px; cursor: pointer; text-align: left; font-size: .88rem }
.cmp-row:hover { border-color: var(--cell) }
.cmp-row[aria-pressed=true] { border-color: var(--cell); background: var(--cell-soft); font-weight: 600 }
.cmp-bar { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden }
.cmp-bar i { display: block; height: 100%; background: var(--mute); border-radius: 4px }
.cmp-row[aria-pressed=true] .cmp-bar i { background: var(--cell) }
.cmp-row b { font-variant-numeric: tabular-nums; white-space: nowrap }
@media (max-width: 420px) { .cmp-row { grid-template-columns: 1fr auto } .cmp-bar { grid-column: 1 / -1; grid-row: 2 } }
.kv { display: flex; justify-content: space-between; padding: 6px 0; font-size: .92rem; gap: 12px }
.kv b { font-variant-numeric: tabular-nums; white-space: nowrap }
.note { margin-top: 14px; padding: 10px 12px; border-radius: 8px; font-size: .85rem; background: #FFF6DB; color: #6B4E00 }
.note.warn { background: #FBE9DF; color: var(--warn) }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px }
.fine { color: var(--mute); font-size: .78rem; margin-top: 18px; max-width: 70ch }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 10px; font-size: .92rem; opacity: 0; transition: .25s; pointer-events: none; z-index: 50 }
.toast.show { opacity: 1; transform: translateX(-50%) }

/* ---------- diálogo de ajustes ---------- */
dialog { border: 0; border-radius: 14px; padding: 0; max-width: 560px; width: calc(100% - 32px); box-shadow: 0 20px 60px rgba(15, 27, 42, .3) }
dialog::backdrop { background: rgba(15, 27, 42, .5) }
.dlg-h { padding: 18px 22px 0; display: flex; justify-content: space-between; align-items: center }
.dlg-h h3 { margin: 0 }
.tabs { display: flex; gap: 4px; padding: 12px 22px 0; border-bottom: 1px solid var(--line) }
.tabs button { border: 0; background: none; padding: 10px 12px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; color: var(--mute) }
.tabs button[aria-selected=true] { border-color: var(--cell); color: var(--ink); font-weight: 600 }
.dlg-b { padding: 8px 22px 20px; max-height: 62vh; overflow: auto }
.dlg-f { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 8px }
.x { background: none; border: 0; font-size: 1.4rem; cursor: pointer; line-height: 1 }

/* ---------- panel de presupuestos ---------- */
.page { padding: 28px clamp(16px, 4vw, 56px); max-width: 1280px; margin: 0 auto }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border: 1px solid var(--line); border-radius: 12px; background: #fff; margin: 20px 0 28px }
.kpis div { padding: 16px 18px; font-size: .85rem; color: var(--mute) }
.kpis div + div { border-left: 1px solid var(--line) }
.kpis b { display: block; font-size: 1.6rem; color: var(--ink); font-stretch: 115%; font-weight: 800; font-variant-numeric: tabular-nums }
@media (max-width: 760px) { .kpis { grid-template-columns: 1fr 1fr } .kpis div:nth-child(3) { border-left: 0 } .kpis div:nth-child(n+3) { border-top: 1px solid var(--line) } }
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px }
.filters button { border: 1px solid var(--line); background: #fff; border-radius: 20px; padding: 6px 12px; cursor: pointer; font-size: .85rem }
.filters button[aria-pressed=true] { background: var(--cell); border-color: var(--cell); color: #fff }
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 12px }
.list { min-width: 760px }
.list th { font-size: .8rem; color: var(--mute); font-weight: 600; padding: 12px 14px; background: var(--cell-soft) }
.list td { padding: 12px 14px; vertical-align: middle }
.list tr:last-child td { border-bottom: 0 }
.list .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap }
.list select { width: auto; padding: 5px 8px; font-size: .85rem }
.follow { color: var(--warn); font-size: .8rem; font-weight: 600; display: block; margin-top: 2px }
.row-actions { display: flex; gap: 6px; justify-content: flex-end }
.list td:first-child, .list td:last-child { white-space: nowrap }
.section-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 36px 0 12px }
.section-h h2 { margin: 0; font-size: 1.2rem; font-stretch: 115% }
.empty-state { padding: 28px; text-align: center; color: var(--mute) }

/* ---------- web pública (captación) ---------- */
.pub-hero { background: var(--cell); color: #fff; padding: clamp(36px, 7vw, 80px) clamp(16px, 5vw, 64px) clamp(120px, 14vw, 160px); position: relative; overflow: hidden }
.pub-hero h1 { font-size: clamp(2rem, 5vw, 3.4rem); max-width: 16ch; margin: 0 0 12px }
.pub-hero p { max-width: 52ch; opacity: .85; margin: 0; font-size: 1.05rem }
.pub-hero .sunglow { width: 380px; height: 380px; right: -120px; top: -140px }
.pub-card { max-width: 980px; margin: -100px auto 40px; background: #fff; border-radius: 16px; box-shadow: 0 18px 50px rgba(15, 27, 42, .14); display: grid; grid-template-columns: 1fr 1fr; position: relative; overflow: hidden }
@media (max-width: 820px) { .pub-card { grid-template-columns: 1fr; margin: -100px 16px 40px } }
.pub-in, .pub-res { padding: clamp(20px, 3vw, 36px) }
.pub-res { background: var(--cell-soft); display: flex; flex-direction: column }
.pub-bill { font-stretch: 125%; font-weight: 800; font-size: 2.6rem; line-height: 1; margin: 6px 0 }
.pub-range { font-stretch: 115%; font-weight: 800; font-size: 1.7rem; line-height: 1.1 }
.pub-res .kv { border-bottom: 1px solid var(--line) }
.pub-form { margin-top: auto; padding-top: 20px }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: .8rem; color: var(--mute) }
.check input { margin-top: 3px }
.done { text-align: center; padding: 24px 8px }
.done b { display: block; font-size: 1.3rem; margin-bottom: 6px; font-stretch: 115% }
.pub-foot { text-align: center; color: var(--mute); font-size: .85rem; padding: 0 16px 40px }
.demo-bar { background: var(--ink); color: #fff; font-size: .85rem; padding: 8px 16px; text-align: center }
.demo-bar a { color: var(--sun) }

/* ---------- PDF (solo impresión) ---------- */
#pdf { display: none }
@page { size: A4; margin: 0 }
@media print {
  body > *:not(#pdf) { display: none !important }
  body { background: #fff }
  #pdf { display: block }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact }
  .wi { animation: none !important }
}
.pdf-page { width: 210mm; min-height: 297mm; padding: 16mm 16mm 14mm; position: relative; page-break-after: always; break-after: page; display: flex; flex-direction: column; font-size: 10.5pt }
.pdf-page:last-child { page-break-after: auto; break-after: auto }
.pdf-cover { background: var(--cell); color: #fff; padding: 0 }
.pdf-cover .in { padding: 18mm 16mm 0; flex: 1; display: flex; flex-direction: column }
.pdf-brand { display: flex; align-items: center; gap: 12px }
.pdf-brand img { max-height: 48px; max-width: 120px; background: #fff; border-radius: 8px; padding: 4px }
.pdf-brand b { font-stretch: 115%; font-size: 15pt; display: block }
.pdf-cover h1 { font-size: 34pt; max-width: 12ch; margin: 22mm 0 6mm; line-height: 1.02 }
.pdf-cover .who { font-size: 12pt; opacity: .9 }
.pdf-cover .photo { margin: 10mm 0 0; height: 78mm; border-radius: 10px; overflow: hidden; background: var(--cell-dark); padding: 10px }
.pdf-cover .photo img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; display: block }
.pdf-cover .photo { display: grid; place-items: center }
.pdf-cover .photo .facade { width: 100%; height: 100%; background: none; padding: 6px; align-content: center }
.pdf-cover .stats { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--sun); color: var(--ink); margin-top: auto; padding: 8mm 16mm }
.pdf-cover .stats div { font-size: 9pt }
.pdf-cover .stats b { display: block; font-size: 15pt; font-stretch: 110%; white-space: nowrap }
.pdf-h { display: flex; justify-content: space-between; align-items: center; padding-bottom: 6mm; margin-bottom: 8mm; border-bottom: 2px solid var(--cell); font-size: 9pt; color: var(--mute) }
.pdf-h b { color: var(--ink); font-size: 11pt }
.pdf-page h2 { font-stretch: 115%; font-size: 18pt; margin: 0 0 4mm; color: var(--cell) }
.pdf-page h3 { font-size: 11pt; margin: 8mm 0 3mm }
.pdf-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10mm }
.pdf-foot { margin-top: auto; padding-top: 6mm; border-top: 1px solid var(--line); font-size: 8.5pt; color: var(--mute); display: flex; justify-content: space-between; gap: 8px }
.pdf-cond { font-size: 9.5pt; line-height: 1.5; padding-left: 5mm }
.pdf-cond li { margin-bottom: 2mm }
.sign { display: grid; grid-template-columns: 1fr 1fr; gap: 10mm; margin-top: 12mm }
.sign > div { font-size: 9pt; color: var(--mute) }
.sign .box { border: 1px solid var(--line); border-radius: 6px; height: 30mm; margin-bottom: 2mm }

/* tabla de huecos del PDF: con muchas líneas se compacta (compact > 5, dense > 8) para que quepa en la página 2 */
.pdf-huecos { font-size: 9pt; margin-bottom: 2mm }
.pdf-huecos th { font-size: 7.5pt; color: var(--mute); font-weight: 600; padding: 0 2mm 1.5mm 0; text-transform: uppercase; letter-spacing: .03em }
.pdf-huecos td { padding: 2mm 2mm 2mm 0; vertical-align: middle }
.pdf-huecos td small { font-size: 7.5pt }
.pdf-huecos .r { text-align: right; padding-right: 0; white-space: nowrap; font-variant-numeric: tabular-nums }
.pdf-huecos .dw { width: 1%; padding-right: 3mm }
.pdf-huecos .mini { display: flex; align-items: flex-end; justify-content: center }
.pdf-huecos.compact { font-size: 8.5pt }
.pdf-huecos.compact td { padding-block: 1.2mm }
.pdf-huecos.dense { font-size: 7.5pt; line-height: 1.25 }
.pdf-huecos.dense td { padding-block: .6mm }
.pdf-huecos.dense td small { font-size: 6.5pt }
.pdf-page .pdf-two h3 { margin-top: 5mm }
.pdf-page .pdf-two .kv { font-size: 9pt; padding: 1.2mm 0; border-bottom: 1px solid var(--line) }
.pdf-page .pdf-two .breakdown { font-size: 9pt }
.pdf-page .pdf-two .breakdown td { padding: 1.4mm 0 }
.pdf-page .pdf-two tr.total td { font-size: 11pt; padding-top: 2.5mm }
.pdf-note { font-size: 7.5pt; color: var(--mute); margin: 2mm 0 0 }

/* selector de 4 opciones en dos filas (web pública) */
.seg-wrap { display: grid; grid-template-columns: 1fr 1fr }
.seg-wrap button + button { border-left: 0 }
.seg-wrap button:nth-child(even) { border-left: 1px solid var(--line) }
.seg-wrap button:nth-child(n+3) { border-top: 1px solid var(--line) }
/* en modo denso cada hueco ocupa una sola línea: el detalle va a continuación */
.pdf-huecos.dense td small { display: inline; color: var(--mute) }
.pdf-huecos.dense td small::before { content: ' · ' }
.pdf-huecos.dense td { padding-block: .4mm }
/* red de seguridad: cada página del PDF mide exactamente un A4 */
.pdf-page { height: 297mm; overflow: hidden }
.pdf-huecos.dense td.one { white-space: nowrap }
.pdf-huecos.dense .room { display: inline-block; max-width: 24mm; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; color: var(--mute) }
.pdf-two.dense h3 { margin-top: 3mm }
.pdf-two.dense td small { display: none }
.pdf-two.dense .breakdown td, .pdf-two.dense .kv { padding-block: .9mm }
