/* ElChatea Fondos y Lectura V3 sin franjas. Sólo el área de mensajes y el selector. */
#ecBackgroundOpen1{gap:6px}
#ecBackgroundOpen1 svg{width:18px;height:18px;fill:none;stroke:currentColor;flex-shrink:0}
html body .chat-app #messages.ec-background-on,
#ecBackgroundDialog1 .ec-bg-preview.ec-background-on{
 --ec-bg-rgb:255,255,255;
 background-image:linear-gradient(rgba(var(--ec-bg-rgb),var(--ec-bg-wash,.65)),rgba(var(--ec-bg-rgb),var(--ec-bg-wash,.65))),var(--ec-bg-image)!important;
 background-color:rgb(var(--ec-bg-rgb))!important;background-size:cover!important;background-position:center!important;background-repeat:no-repeat!important;background-attachment:scroll!important;
}
html body .chat-app #messages.ec-background-on>.chat-line:not(.mentioned-me){text-shadow:0 1px 2px rgba(var(--ec-bg-rgb),.9),0 0 4px rgba(var(--ec-bg-rgb),.65)}
html[data-ec-theme1="dark"] body .chat-app #messages.ec-background-on,
html[data-ec-theme1="dark"] #ecBackgroundDialog1 .ec-bg-preview.ec-background-on{--ec-bg-rgb:29,38,50}
#ecBackgroundDialog1{box-sizing:border-box;width:min(720px,calc(100vw - 24px));max-width:none;max-height:calc(100dvh - 24px);padding:0;margin:auto;border:1px solid #8baac5;border-radius:14px;background:#fff;color:#284760;box-shadow:0 22px 70px #162e4855;font:14px/1.45 'Segoe UI',Arial,sans-serif;overflow:hidden}
#ecBackgroundDialog1:not([open]){display:none}
#ecBackgroundDialog1[open]{display:flex;flex-direction:column}
#ecBackgroundDialog1::backdrop{background:#132f4e80}
#ecBackgroundDialog1 *{box-sizing:border-box}
#ecBackgroundDialog1 header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:16px 20px;background:#f1f6fb;border-bottom:1px solid #d6e2ed;flex-shrink:0}
#ecBackgroundDialog1 header small{font-size:10px;letter-spacing:1.4px;color:#637f98;font-weight:700}
#ecBackgroundDialog1 h2{margin:3px 0 0;font-size:23px;line-height:1.2;color:#274d71}
#ecBackgroundDialog1 button{font:inherit;cursor:pointer;touch-action:manipulation}
#ecBackgroundDialog1 .ec-bg-close{display:flex;align-items:center;justify-content:center;width:44px;min-width:44px;height:44px;padding:0;background:#fff;border:1px solid #bbcfdf;border-radius:9px;color:#426786;font-size:27px;line-height:1}
#ecBackgroundDialog1 .ec-bg-content{overflow:auto;overscroll-behavior:contain;padding:16px 20px;min-height:0}
#ecBackgroundDialog1 #ecBackgroundHelp1{margin:0 0 14px;color:#60788d;font-size:13px}
#ecBackgroundDialog1 .ec-bg-preview{min-height:134px;padding:12px;border:1px solid #d2dfeb;border-radius:10px;background:#fff;color:#2d465b}
#ecBackgroundDialog1 .ec-bg-preview-label{font-size:10px;letter-spacing:.8px;text-transform:uppercase;font-weight:700;background:#ffffffdf;color:#44637d;border-radius:4px;padding:3px 6px}
#ecBackgroundDialog1 .ec-bg-preview p{margin:12px 0 0;padding:4px 6px;background:transparent;text-shadow:0 1px 2px rgba(var(--ec-bg-rgb,255,255,255),.9),0 0 4px rgba(var(--ec-bg-rgb,255,255,255),.65);border-radius:4px;font-size:13px}
#ecBackgroundDialog1 .ec-bg-preview strong{color:#245e91}
#ecBackgroundDialog1 .ec-bg-adjust{display:grid;gap:4px;margin:14px 0 18px}
#ecBackgroundDialog1 .ec-bg-adjust label{font-weight:600;font-size:13px;display:flex;justify-content:space-between;gap:12px}
#ecBackgroundDialog1 input[type="range"]{width:100%;height:28px;margin:0;accent-color:#336699;background:transparent!important;box-shadow:none!important;cursor:pointer}
#ecBackgroundDialog1 .ec-bg-adjust small{font-size:11px;color:#688196}
#ecBackgroundDialog1 h3{font-size:13px;margin:16px 0 8px;color:#395d7b}
#ecBackgroundDialog1 .ec-bg-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
#ecBackgroundDialog1 .ec-bg-choice{min-width:0;padding:4px;border:2px solid #dce6ef;border-radius:10px;background:#fff;color:#365775;display:flex;flex-direction:column;gap:5px;text-align:left;position:relative}
#ecBackgroundDialog1 .ec-bg-choice>span:last-child{padding:1px 5px 4px;font-size:12px;font-weight:600}
#ecBackgroundDialog1 .ec-bg-tile{display:block;width:100%;height:75px;border-radius:6px;background-size:cover;background-position:center;border:1px solid #172f4810}
#ecBackgroundDialog1 .ec-bg-choice[aria-pressed="true"]{border-color:#336699;box-shadow:0 0 0 1px #336699}
#ecBackgroundDialog1 .ec-bg-choice[aria-pressed="true"]::after{content:'✓';position:absolute;right:9px;top:9px;width:23px;height:23px;display:grid;place-items:center;border-radius:50%;background:#336699;color:#fff;font-size:14px;font-weight:700}
#ecBackgroundDialog1 footer{padding:10px 20px 14px;border-top:1px solid #d9e5ee;background:#f8fbfd;flex-shrink:0}
#ecBackgroundDialog1 footer>div{display:flex;justify-content:flex-end;gap:9px}
#ecBackgroundDialog1 footer button{min-height:44px;padding:9px 17px;border:1px solid #a8bfd3;border-radius:8px;font-weight:600;background:#fff;color:#365b7c}
#ecBackgroundDialog1 footer .ec-bg-apply{background:#336699;color:#fff;border-color:#336699}
#ecBackgroundDialog1 .ec-bg-status{margin:0 0 6px;font-size:12px;color:#536f86}
#ecBackgroundDialog1 .ec-bg-status:empty{display:none}
#ecBackgroundDialog1 button:disabled{opacity:.6;cursor:wait}
#ecBackgroundDialog1 :is(button,input):focus-visible{outline:3px solid #80b2df;outline-offset:2px}
html[data-ec-theme1="dark"] #ecBackgroundDialog1{background:#1d2632;color:#e6edf3;border-color:#566b83}
html[data-ec-theme1="dark"] #ecBackgroundDialog1 :is(header,footer){background:#253244;border-color:#566b83}
html[data-ec-theme1="dark"] #ecBackgroundDialog1 :is(h2,h3,.ec-bg-adjust small,header small,#ecBackgroundHelp1,.ec-bg-status){color:#c4d5e6}
html[data-ec-theme1="dark"] #ecBackgroundDialog1 :is(.ec-bg-choice,.ec-bg-close,footer button){background:#253244;color:#e6edf3;border-color:#566b83}
html[data-ec-theme1="dark"] #ecBackgroundDialog1 .ec-bg-choice[aria-pressed="true"]{border-color:#95c5f1;box-shadow:0 0 0 1px #95c5f1}
html[data-ec-theme1="dark"] #ecBackgroundDialog1 footer .ec-bg-apply{background:#336699;border-color:#95c5f1}
html[data-ec-theme1="dark"] #ecBackgroundDialog1 .ec-bg-preview{background:#1d2632;border-color:#566b83}
html[data-ec-theme1="dark"] #ecBackgroundDialog1 .ec-bg-preview .ec-bg-preview-label{background:#1d2632df;color:#e6edf3}
html[data-ec-theme1="dark"] #ecBackgroundDialog1 .ec-bg-preview p{background:transparent;color:#e6edf3}
html[data-ec-theme1="dark"] #ecBackgroundDialog1 .ec-bg-preview strong{color:#a8ceff}
@media(max-width:760px),(max-height:600px) and (max-width:1000px){#ecBackgroundOpen1{display:none!important}}
@media(max-width:480px){#ecBackgroundDialog1{width:calc(100vw - 16px);max-height:calc(100dvh - 16px);border-radius:12px}#ecBackgroundDialog1 header{padding:12px}#ecBackgroundDialog1 .ec-bg-content{padding:12px}#ecBackgroundDialog1 .ec-bg-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}#ecBackgroundDialog1 h2{font-size:21px}#ecBackgroundDialog1 footer{padding:10px 12px}#ecBackgroundDialog1 footer button{flex:1}#ecBackgroundDialog1 .ec-bg-preview{min-height:120px}}
@media(forced-colors:active){html body .chat-app #messages.ec-background-on{background-image:none!important}#ecBackgroundDialog1 .ec-bg-choice[aria-pressed="true"]{outline:3px solid Highlight}}

/* Lectura local. Tamaño real a través del control existente; sólo preview aquí. */
#ecBackgroundDialog1 .ec-bg-reading{margin:0 0 20px;padding:12px 14px;border:1px solid #d2dfeb;border-radius:10px;min-width:0;background:#f7fafc}
#ecBackgroundDialog1 .ec-bg-reading legend{padding:0 6px;font-weight:700;font-size:15px;color:#395d7b}
#ecBackgroundDialog1 .ec-bg-size-label{display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:13px;font-weight:600;margin-bottom:8px}
#ecBackgroundDialog1 .ec-bg-reading select{min-height:44px;max-width:62%;padding:8px;border:1px solid #afc4d6;border-radius:7px;background:#fff;color:#284760;font:inherit}
#ecBackgroundDialog1 .ec-bg-check{display:flex;align-items:center;gap:10px;min-height:44px;font-size:13px;font-weight:600;cursor:pointer}
#ecBackgroundDialog1 .ec-bg-check input{appearance:auto;width:20px;height:20px;margin:0;accent-color:#336699;box-shadow:none!important}
#ecBackgroundDialog1 .ec-bg-reading p{font-size:12px;line-height:1.5;color:#60788d;margin:6px 0 0}
#ecBackgroundDialog1 select:focus-visible{outline:3px solid #80b2df;outline-offset:2px}
#ecBackgroundDialog1 .ec-bg-preview p{font-size:var(--ec-reading-size,13px);line-height:1.5;overflow-wrap:anywhere}
html body .chat-app #messages.ec-reading-bold :is(.chat-body,.chat-body *,.decoration-run),
#ecBackgroundDialog1 .ec-bg-preview.ec-reading-bold p{font-weight:600!important}
html body .chat-app #messages.ec-reading-contrast,
#ecBackgroundDialog1 .ec-bg-preview.ec-reading-contrast{--ec-reading-ink:#172b3d;--ec-reading-nick:#164f7b;--ec-bg-wash:.82!important}
html[data-ec-theme1="dark"] body .chat-app #messages.ec-reading-contrast,
html[data-ec-theme1="dark"] #ecBackgroundDialog1 .ec-bg-preview.ec-reading-contrast{--ec-reading-ink:#f2f6fa;--ec-reading-nick:#b9dcff}
html body .chat-app #messages.ec-reading-contrast :is(.chat-line,.chat-body,.chat-body *,.decoration-run,.system-message),
#ecBackgroundDialog1 .ec-bg-preview.ec-reading-contrast p{color:var(--ec-reading-ink)!important}
html body .chat-app #messages.ec-reading-contrast :is(.chat-body,.chat-body *,.decoration-run){background-color:transparent!important}
html body .chat-app #messages.ec-reading-contrast :is(.chat-nick,.chat-nick *),
#ecBackgroundDialog1 .ec-bg-preview.ec-reading-contrast strong{color:var(--ec-reading-nick)!important}
html body .chat-app #messages.ec-reading-contrast .mentioned-me{background-color:#e1edfc!important}
html[data-ec-theme1="dark"] body .chat-app #messages.ec-reading-contrast .mentioned-me{background-color:#294460!important}
html[data-ec-theme1="dark"] #ecBackgroundDialog1 .ec-bg-reading{background:#253244;border-color:#566b83}
html[data-ec-theme1="dark"] #ecBackgroundDialog1 .ec-bg-reading :is(legend,p){color:#c4d5e6}
html[data-ec-theme1="dark"] #ecBackgroundDialog1 .ec-bg-reading select{background:#1d2632;color:#e6edf3;border-color:#566b83}
