/* Estilo de cotización: editor, diálogo y hoja A4 de ejemplo (estilo_cotizacion.js). La hoja es siempre papel blanco. */
.est-ed { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 860px) { .est-ed { grid-template-columns: minmax(0, 1fr); } }
.est-ctrl { display: grid; gap: 20px; min-width: 0; }
.est-ctrl h5 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--suave); margin: 0 0 10px; display: flex; justify-content: space-between; }
.est-ctrl h5 small { text-transform: none; letter-spacing: 0; font-weight: 500; }
.est-plantillas { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.est-plantilla { border: 1px solid var(--borde); border-radius: 12px; padding: 6px 6px 8px; background: var(--panel); color: var(--texto); cursor: pointer; display: grid; gap: 6px; text-align: center; font: inherit; font-size: 12px; font-weight: 700; transition: border-color .15s, box-shadow .15s; }
.est-plantilla:hover { border-color: var(--marca-cian, #17b3c8); }
.est-plantilla[aria-pressed="true"] { border-color: var(--marca-cian, #17b3c8); box-shadow: 0 0 0 3px rgba(23, 179, 200, .22); }
.est-plantilla .est-a4 { pointer-events: none; border-radius: 4px; box-shadow: 0 1px 3px rgba(14, 34, 54, .15); }
.est-plantilla small { font-weight: 500; color: var(--suave); font-size: 10.5px; display: block; }
.est-paletas { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.est-paleta { display: grid; gap: 6px; padding: 8px; border: 1px solid var(--borde); border-radius: 12px; background: var(--panel); color: var(--texto); cursor: pointer; font: inherit; font-size: 11.5px; font-weight: 650; text-align: left; transition: border-color .15s, box-shadow .15s; }
.est-paleta[aria-pressed="true"] { border-color: var(--marca-cian, #17b3c8); box-shadow: 0 0 0 3px rgba(23, 179, 200, .22); }
.est-paleta i { display: flex; height: 20px; border-radius: 6px; overflow: hidden; }
.est-paleta i span { flex: 1; }
.est-seg { display: flex; background: var(--fondo); border: 1px solid var(--borde); border-radius: 12px; padding: 3px; gap: 2px; }
.est-seg button { flex: 1; border: 0; background: transparent; color: var(--suave); font: inherit; font-weight: 700; font-size: 12.5px; min-height: 36px; border-radius: 9px; cursor: pointer; }
.est-seg button[aria-pressed="true"] { background: var(--marca-marino, #0e2236); color: #fff; box-shadow: 0 2px 6px rgba(14, 34, 54, .25); }
.est-ed button:focus-visible { outline: 2px solid var(--marca-cian, #17b3c8); outline-offset: 2px; }
.est-escenas { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 10px; }
.est-escenas button { padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; cursor: pointer; background: none; position: relative; }
.est-escenas button[aria-pressed="true"] { border-color: var(--marca-cian, #17b3c8); }
.est-escenas img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; display: block; }
.est-escenas span { position: absolute; left: 4px; bottom: 4px; font-size: 10px; font-weight: 700; color: #fff; background: rgba(0, 0, 0, .5); border-radius: 4px; padding: 0 4px; }
.est-ayuda { display: block; margin-top: 6px; font-size: 12px; color: var(--suave); }
.est-drop { margin-top: 10px; border: 1.5px dashed var(--borde); border-radius: 12px; padding: 16px; text-align: center; color: var(--suave); cursor: pointer; display: grid; gap: 4px; place-items: center; font-size: 12.5px; position: relative; }
.est-drop b { color: var(--texto); }
.est-drop:hover { border-color: var(--marca-cian, #17b3c8); }
.est-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.est-drop:focus-within { outline: 2px solid var(--marca-cian, #17b3c8); outline-offset: 2px; }
.est-vista { position: sticky; top: 12px; border-radius: 20px; padding: 24px; display: grid; justify-items: center; gap: 12px; background: radial-gradient(var(--borde) 1px, transparent 1px) 0 0 / 14px 14px, var(--fondo); border: 1px solid var(--borde); }
.est-vista > div { width: 100%; display: grid; justify-items: center; }
.est-vista .est-a4 { width: min(100%, 520px); box-shadow: 0 18px 40px rgba(14, 34, 54, .18); }
.est-nota { font-size: 12px; color: var(--suave); }

/* diálogo */
dialog.est-dlg { width: min(1080px, calc(100vw - 24px)); max-width: none; max-height: calc(100dvh - 24px); padding: 0; border: 1px solid var(--borde); border-radius: 20px; background: var(--panel); color: var(--texto); box-shadow: 0 24px 90px rgba(14, 34, 54, .35); }
dialog.est-dlg::backdrop { background: rgba(14, 34, 54, .55); }
.est-dlg > header { display: flex; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--borde); }
.est-dlg h2 { font-size: 18px; margin: 0 0 4px; outline: none; }
.est-dlg header p { margin: 0; color: var(--suave); font-size: 13px; }
.est-x { border: 0; background: transparent; font-size: 26px; line-height: 1; color: var(--suave); cursor: pointer; width: 40px; height: 40px; border-radius: 10px; }
.est-cuerpo { padding: 20px 22px; overflow: auto; max-height: calc(100dvh - 190px); }
.est-dlg > footer { display: flex; gap: 8px; align-items: center; padding: 14px 22px; border-top: 1px solid var(--borde); }
.est-dlg > footer span { flex: 1; }

/* ------------------------------------------------------------ hoja A4 de ejemplo (medidas relativas al ancho, cqw) */
.est-a4 { container-type: inline-size; aspect-ratio: 210 / 297; width: 100%; background: #fff; color: #1B2733; overflow: hidden; position: relative; border-radius: 6px; color-scheme: light; font-variant-numeric: tabular-nums; text-align: left; font-weight: 400; --q1: #0E2236; --q2: #17B3C8; --q3: #F5A623; --q4: #E8F7FA; }
.est-a4 * { box-sizing: border-box; }
.est-a4 :is(h3, h4, p, dl) { margin: 0; font-weight: 750; }
.est-a4 p { font-weight: 400; }
.est-a4 small { font-size: 1.6cqw; line-height: 1.3; }
.est-a4-in { padding: 6cqw 6.5cqw; font-size: 1.95cqw; line-height: 1.4; display: grid; gap: 2.6cqw; }
.qa-cab { display: grid; grid-template-columns: auto 1fr auto; gap: 2.4cqw; align-items: center; padding-bottom: 2.4cqw; border-bottom: .5cqw solid var(--q2); }
.qa-logo { width: 9cqw; height: 9cqw; border-radius: 2cqw; background: var(--q1); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 3.4cqw; letter-spacing: -.04em; overflow: hidden; }
.qa-logo.con-img { background: #fff; border: .15cqw solid #E1E8EE; }
.qa-logo img { width: 100%; height: 100%; object-fit: contain; }
.qa-emp b { display: block; font-size: 2.9cqw; color: var(--q1); } .qa-emp span { color: #5B6B78; font-size: 1.7cqw; }
.qa-folio { text-align: right; font-size: 1.7cqw; color: #5B6B78; } .qa-folio b { display: block; font-size: 2.4cqw; color: var(--q1); }
.qa-banda { display: block; width: 100%; height: 15cqw; border-radius: 1.6cqw; object-fit: cover; object-position: center 60%; }
.est-a4 .qa-h { font-size: 4cqw; letter-spacing: -.02em; color: var(--q1); line-height: 1.15; }
.qa-para { color: #5B6B78; margin-top: -1.6cqw !important; }
.qa-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.6cqw; }
.qa-kpis div { background: var(--q4); border-radius: 1.6cqw; padding: 1.8cqw 2cqw; }
.qa-kpis small { display: block; font-size: 1.55cqw; color: #5B6B78; } .qa-kpis b { font-size: 2.9cqw; color: var(--q1); letter-spacing: -.02em; }
.qa-2c { display: grid; grid-template-columns: 1.1fr 1fr; gap: 3cqw; align-items: start; }
.qa-t { width: 100%; border-collapse: collapse; font-size: 1.75cqw; }
.qa-t th { text-align: left; background: var(--q1); color: #fff; padding: 1cqw 1.4cqw; font-weight: 650; }
.qa-t td { padding: 1cqw 1.4cqw; border-bottom: .15cqw solid #E6ECF1; } .qa-t .n { text-align: right; }
.qa-t tr.tot td { font-weight: 800; color: var(--q1); border-bottom: 0; background: var(--q4); }
.qa-graf { display: grid; gap: 1cqw; } .qa-graf > span { font-weight: 700; color: var(--q1); font-size: 1.9cqw; }
.qa-graf svg, .est-a4 .qt-2c svg { width: 100%; height: auto; display: block; }
.qa-ley { display: flex; gap: 2.4cqw; font-size: 1.5cqw; color: #5B6B78; } .qa-ley i { display: inline-block; width: 1.6cqw; height: 1.6cqw; border-radius: .4cqw; margin-right: .8cqw; vertical-align: -.2cqw; }
.qa-pagos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.6cqw; font-size: 1.65cqw; }
.qa-pagos div { border: .15cqw solid #E1E8EE; border-left: .6cqw solid var(--q2); border-radius: 1cqw; padding: 1.2cqw 1.6cqw; } .qa-pagos b { display: block; color: var(--q1); }
.qa-pie { position: absolute; left: 6.5cqw; right: 6.5cqw; bottom: 4.5cqw; display: flex; justify-content: space-between; font-size: 1.5cqw; color: #7A8A98; border-top: .15cqw solid #E1E8EE; padding-top: 1.4cqw; }
.qe-portada { position: relative; height: 52cqw; background: var(--q1); color: #fff; display: grid; align-content: space-between; padding: 6cqw 6.5cqw; overflow: hidden; }
.qe-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 60%; }
.qe-portada::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, color-mix(in srgb, var(--q1) 30%, transparent) 0%, color-mix(in srgb, var(--q1) 92%, transparent) 88%); }
.qe-portada.sin::before { background: radial-gradient(circle at 85% 10%, color-mix(in srgb, var(--q2) 60%, transparent), transparent 55%), linear-gradient(135deg, var(--q1), color-mix(in srgb, var(--q1) 70%, var(--q2))); }
.qe-portada > :not(.qe-img) { position: relative; z-index: 2; }
.qe-marca { display: flex; align-items: center; gap: 2cqw; font-size: 2.6cqw; font-weight: 750; }
.qe-marca .qa-logo { background: rgba(255, 255, 255, .16); }
.qe-tit span { font-size: 1.9cqw; text-transform: uppercase; letter-spacing: .14em; opacity: .85; }
.est-a4 .qe-tit h3 { font-size: 6.4cqw; letter-spacing: -.03em; line-height: 1.05; margin: 1cqw 0; }
.qe-tit p { font-size: 2cqw; opacity: .9; }
.qe-banda { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--q4); color: var(--q1); }
.qe-banda div { padding: 2.6cqw 3cqw; border-right: .15cqw solid rgba(0, 0, 0, .12); } .qe-banda div:last-child { border: 0; }
.qe-banda b { display: block; font-size: 4.4cqw; letter-spacing: -.03em; line-height: 1.1; } .qe-banda small { font-size: 1.6cqw; font-weight: 650; }
.qe-cuerpo { padding-top: 4cqw; }
.qe-incl { display: grid; gap: 1.2cqw; } .qe-incl > b { color: var(--q1); font-size: 2.2cqw; }
.qe-incl div { display: flex; gap: 1.4cqw; align-items: baseline; } .qe-incl i { flex: none; width: 1.6cqw; height: 1.6cqw; border-radius: 50%; background: var(--q3); }
.qe-total { display: flex; justify-content: space-between; align-items: center; padding: 2.4cqw 3cqw; border-radius: 1.6cqw; background: var(--q1); color: #fff; }
.qe-total b { font-size: 4.2cqw; letter-spacing: -.02em; } .qe-total small { opacity: .8; }
.qt-cab { display: flex; justify-content: space-between; align-items: center; gap: 2cqw; border-bottom: .3cqw solid var(--q1); padding-bottom: 1.8cqw; }
.qt-cab b { font-size: 2.8cqw; color: var(--q1); display: block; } .qt-cab span { font-size: 1.7cqw; color: #5B6B78; }
.qt-img { width: 18cqw; height: 10cqw; border-radius: 1cqw; object-fit: cover; }
.est-a4 .qt-h { font-size: 3.4cqw; color: var(--q1); letter-spacing: -.02em; }
.qt-2c { display: grid; grid-template-columns: 1fr 1.2fr; gap: 3.4cqw; align-items: start; }
.est-a4 .qt-2c h4 { font-size: 1.6cqw; text-transform: uppercase; letter-spacing: .12em; color: var(--q2); margin: 0 0 1cqw; filter: brightness(.8); }
.qt-dl { display: grid; grid-template-columns: 1fr auto; font-size: 1.75cqw; margin: 0 0 2.6cqw !important; }
.qt-dl dt, .qt-dl dd { padding: .8cqw 0; border-bottom: .15cqw dotted #CBD5DD; margin: 0; } .qt-dl dt { color: #5B6B78; } .qt-dl dd { font-weight: 650; text-align: right; color: var(--q1); }
.qt-t { width: 100%; border-collapse: collapse; font-size: 1.6cqw; margin-top: 1.4cqw; }
.qt-t th { text-align: right; color: #5B6B78; font-weight: 600; border-bottom: .3cqw solid var(--q1); padding: .6cqw .8cqw; } .qt-t th:first-child, .qt-t td:first-child { text-align: left; }
.qt-t td { text-align: right; padding: .45cqw .8cqw; border-bottom: .1cqw solid #EEF2F5; }
.qt-t tr:nth-child(even) td { background: color-mix(in srgb, var(--q4) 60%, #fff); }
.qg-b { fill: var(--q2); } .qg-c { fill: none; stroke: var(--q1); stroke-width: 1.4; stroke-dasharray: 3 2; } .qg-cp { fill: var(--q1); } .qg-f { fill: var(--q4); stroke: #C9D5DF; stroke-width: .6; }
.qg-a { fill: var(--q2); opacity: .22; } .qg-l { fill: none; stroke: var(--q2); stroke-width: 2.2; stroke-linejoin: round; }
.qg-e { fill: #7A8A98; font-size: 7px; } .qg-r { stroke: #E6ECF1; stroke-width: .6; }
.qg-dona-f { stroke: var(--q4); } .qg-dona { stroke: var(--q2); }
.qg-cifra { font-size: 20px; font-weight: 800; fill: var(--q1); text-anchor: middle; } .qg-sub { font-size: 7.5px; fill: #5B6B78; text-anchor: middle; }
.qg-lt { font-size: 8px; fill: #1B2733; }

/* Panorámica: todo el contenido de la imagen, separado de los textos. Clásica se
   conserva para las revisiones antiguas que ya la tenían congelada. */
.est-panoramica .qa-banda {height:40cqw;object-fit:contain;object-position:center;background:var(--q4);}
.est-a4.est-panoramica {min-height:141.4cqw;height:auto;aspect-ratio:auto;}
.est-panoramica .est-a4-in {padding-bottom:12cqw;}
.fv-a4.q-panoramica .a4-banda-img,.com-hoja.q-panoramica .h-banda {width:100%;height:auto;max-height:270px;object-fit:contain;object-position:center;background:var(--q4);border-radius:12px;}
.q-chart {min-width:0;}
.q-chart>span{font-weight:600;display:block;margin-bottom:8px;}
.q-chart svg {display:block;width:100%;height:auto;fill:none;}
.fv-a4 .q-chart .qa-ley,.com-hoja .q-chart .qa-ley {display:flex;flex-wrap:wrap;gap:12px;font-size:10px;color:#52616d;}
.fv-a4 .q-chart .qa-ley i,.com-hoja .q-chart .qa-ley i {display:inline-block;width:9px;height:9px;margin-right:4px;}
.com-hoja .q-chart .qg-e,.fv-a4 .q-chart .qg-e {font-size:8px;}
.com-hoja .h-grafica{grid-column:1/-1;max-width:550px;width:100%;margin-inline:auto;break-inside:avoid;}
.com-pres .pres-hoja.pres-visual {display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:clamp(24px,4vw,60px);text-align:left;align-items:center;max-width:1300px;margin:auto;width:100%;padding:25px 30px;overflow:auto;}
.pres-ilustracion{min-width:0;}
.pres-ilustracion>img{display:block;width:100%;height:auto;max-height:55vh;object-fit:contain;border-radius:18px;}
.pres-ilustracion>.q-chart{background:#fff;color:#0e2236;padding:24px;border-radius:18px;}
.pres-ilustracion .qa-ley {font-size:12px;color:#43586a;gap:18px;}
.pres-ilustracion .qa-ley i {width:10px;height:10px;}
.pres-relato {min-width:0;}
.pres-relato h2 {font-size:clamp(27px,3vw,45px);letter-spacing:-.035em;line-height:1.1;margin:12px 0 20px;}
.com-pres .pres-relato .gr{font-size:clamp(30px,4vw,58px);line-height:1.2;white-space:normal;overflow-wrap:anywhere;}
.com-pres .pres-relato p {font-size:clamp(14px,1.3vw,18px);line-height:1.6;max-width:600px;}
.pres-comparacion {width:100%;display:grid;gap:18px;margin:20px 0;}
.pres-comparacion>div{display:grid;grid-template-columns:1fr auto;gap:8px;font-size:15px;}
.pres-comparacion i{display:block;grid-column:1/-1;height:24px;border-radius:5px;background:#627e96;}
.pres-comparacion i.con{background:#17b3c8;}
.pres-comparacion small{font-size:12px;}
.pres-siguientes{padding-left:22px;line-height:1.7;}
@media(max-width:760px){
 .com-pres .pres-hoja.pres-visual{grid-template-columns:minmax(0,1fr);gap:20px;padding:18px;align-content:start;}
 .pres-ilustracion>img{max-height:27dvh;}.pres-relato h2{font-size:26px;}.pres-relato>small{font-size:12px;}
 .pres-ilustracion>.q-chart{padding:12px;max-width:380px;margin:auto;}.pres-ilustracion .qa-ley{font-size:10px;}
 .com-pres .pres-relato .gr{font-size:34px;}.pres-comparacion{gap:12px;margin:12px 0;}
 .pres-siguientes{font-size:14px;}.pres-comparacion>div{font-size:13px;}
}
@media print{
 :is(#fv-print,#descargas-print) .q-panoramica .a4-banda-img,:is(#fv-print,#descargas-print) .q-panoramica .h-banda{height:auto;max-height:70mm;object-fit:contain;break-inside:avoid;}
 .q-chart{break-inside:avoid;}.com-hoja .q-chart svg{max-height:170px;}
}

/* ---- 11-nov: plantillas en tarjetas horizontales compactas (antes eran hojas A4 completas, muy alargadas) ---- */
.est-ed { grid-template-columns: 380px minmax(0, 1fr); }
.est-plantillas { grid-template-columns: minmax(0, 1fr); gap: 8px; }
.est-plantilla { grid-template-columns: 84px minmax(0, 1fr); align-items: center; gap: 12px; padding: 8px 12px 8px 8px; text-align: left; font-size: 14px; min-height: 0; }
.est-plantilla [data-mini] { display: block; height: 100px; overflow: hidden; border-radius: 6px; box-shadow: 0 1px 4px rgba(14, 34, 54, .18); background: #fff; }
.est-plantilla [data-mini] .est-a4 { box-shadow: none; border-radius: 0; }
.est-plantilla small { font-size: 12px; line-height: 1.35; margin-top: 2px; }
.est-plantilla[aria-pressed="true"] { background: color-mix(in srgb, var(--marca-cian, #17b3c8) 8%, var(--panel)); }
.est-plantilla { position: relative; }
.est-pl-txt { display: grid; gap: 2px; padding-right: 26px; }
.est-pl-txt b { font-size: 14px; }
.est-plantilla[aria-pressed="true"]::after { content: "✓"; position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--marca-cian, #17b3c8); color: #fff; font-size: 13px; }
.est-paletas { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.est-vista .est-a4 { width: min(100%, 460px); }
@media (max-width: 860px) {
  .est-ed { grid-template-columns: minmax(0, 1fr); }
  .est-plantillas { grid-auto-flow: column; grid-auto-columns: minmax(250px, 80%); grid-template-columns: none; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
  .est-plantilla { scroll-snap-align: start; }
  .est-paletas { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .est-vista { position: static; padding: 14px; }
}

/* 13-11-2026 · gráfica «Generación solar y consumo por periodo» */
.qg-r0 { stroke: #9AA9B6; stroke-width: .8; } .qg-b2 { fill: var(--q2); opacity: .38; } .qg-lp { fill: var(--q2); }
.q-chart .qg-c { stroke-dasharray: none; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; } .q-chart .qg-cp { fill: #fff; stroke: var(--q1); stroke-width: 1.1; }
.qg-v { fill: #33424F; font-size: 6.2px; font-weight: 700; }
.q-chart > span { display: flex !important; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.qa-cubre { font-style: normal; font-weight: 700; font-size: .82em; padding: 1px 8px; border-radius: 999px; background: color-mix(in srgb, var(--q2) 16%, #fff); color: var(--q1); white-space: nowrap; }
.q-chart .qa-ley i.lin { height: 3px !important; border-radius: 2px; vertical-align: 3px; } .q-chart .qa-tot { margin-left: auto; font-weight: 700; color: #33424F; }

/* Todo el selector se puede recorrer con un único desplazamiento vertical. */
.com-cfg-cuerpo, .est-ed, .est-ed > * { min-width: 0; }
@media (max-width: 860px) {
  .est-plantillas { grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: minmax(0, 1fr); overflow: visible; }
  .est-paletas { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .est-paleta { min-width: 0; overflow-wrap: anywhere; }
  .est-escenas { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Marca y opciones: jerarquía estable con la hoja como referencia visual. */
.est-ctrl h5 { font-size:14px;text-transform:none;letter-spacing:0; }
.est-marca { border-block:1px solid var(--borde);padding-block:18px; }
.est-opciones { border-top:1px solid var(--borde);padding-top:16px; }
.est-opciones summary { cursor:pointer;font-weight:650;margin-bottom:16px; }
.est-opciones[open] { display:grid;gap:18px; }
.est-marca .est-paletas { grid-template-columns:repeat(3,minmax(0,1fr));margin-top:12px; }
.est-ctrl [hidden] { display:none !important; }
.est-plantilla .est-a4 small { font-size:1.6cqw;line-height:1.3;margin:0; }
@media(max-width:860px) { .est-vista { order:-1; } .est-vista .est-a4 { max-width:330px; } .est-dlg footer { flex-wrap:wrap; } }
