/* Messages window (chat.js). Shown in the editor and on the management
   proposal page, so it carries its own colours and does not rely on either
   page's stylesheet. */
.cs-chat { position: fixed; right: 18px; bottom: 18px; z-index: 9000; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; font: 15px/1.45 "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif; color: #20313a; }
.cs-chat [hidden] { display: none !important; }
.cs-chat-launcher { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; border: 0; border-radius: 999px; padding: 0 20px; background: #0d414c; color: #fff; font: inherit; font-weight: 800; box-shadow: 0 8px 26px rgba(13, 65, 76, .35); cursor: pointer; }
.cs-chat-launcher:hover { background: #125868; }
.cs-chat-launcher:focus-visible, .cs-chat-close:focus-visible, .cs-chat-send:focus-visible, .cs-chat-remove:focus-visible { outline: 3px solid #e8926a; outline-offset: 2px; }
.cs-chat-badge { display: inline-grid; place-items: center; min-width: 22px; height: 22px; border-radius: 999px; padding: 0 6px; background: #e8926a; color: #0d414c; font-size: .78rem; font-weight: 900; }
.cs-chat-panel { display: flex; flex-direction: column; width: min(380px, calc(100vw - 36px)); height: min(560px, calc(100vh - 110px)); overflow: hidden; border: 1px solid #d4deda; border-radius: 20px; background: #fffdf9; box-shadow: 0 18px 55px rgba(13, 65, 76, .28); }
.cs-chat-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; background: #0d414c; color: #fff; }
.cs-chat-head strong { display: block; }
.cs-chat-who { display: block; color: #cfe3e6; font-size: .8rem; }
.cs-chat-close { width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; font-size: 1.3rem; line-height: 1; cursor: pointer; }
.cs-chat-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 14px; background: #faf6ee; }
.cs-chat-empty { margin: auto 0; color: #4d5d64; text-align: center; }
.cs-chat-msg { max-width: 88%; align-self: flex-start; border: 1px solid #d4deda; border-radius: 4px 16px 16px 16px; padding: 8px 11px; background: #fff; }
.cs-chat-msg.from-admin { border-color: #b9d3d7; background: #dfecee; }
.cs-chat-msg.mine { align-self: flex-end; border-radius: 16px 4px 16px 16px; }
.cs-chat-meta { margin: 0 0 2px; color: #4d5d64; font-size: .76rem; }
.cs-chat-meta strong { color: #0d414c; }
.cs-chat-body { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.cs-chat-remove { margin-top: 4px; border: 0; padding: 0; background: none; color: #9c3030; font: inherit; font-size: .78rem; font-weight: 800; text-decoration: underline; cursor: pointer; }
.cs-chat-form { display: grid; gap: 8px; padding: 12px 14px 14px; border-top: 1px solid #d4deda; background: #fffdf9; }
.cs-chat-name span { display: block; margin-bottom: 3px; color: #0d414c; font-size: .8rem; font-weight: 800; }
.cs-chat-form input, .cs-chat-form textarea { width: 100%; min-height: 40px; border: 1px solid #d4deda; border-radius: 12px; padding: 8px 11px; background: #fff; color: #20313a; font: inherit; }
.cs-chat-form textarea { resize: vertical; min-height: 70px; }
.cs-chat-form input:focus, .cs-chat-form textarea:focus { border-color: #125868; outline: 3px solid rgba(18, 88, 104, .15); }
.cs-chat-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cs-chat-status { flex: 1; margin: 0; color: #8f3030; font-size: .84rem; }
.cs-chat-send { min-height: 40px; border: 0; border-radius: 999px; padding: 0 20px; background: #125868; color: #fff; font: inherit; font-weight: 800; cursor: pointer; }
.cs-chat-send:disabled { opacity: .6; cursor: wait; }
.cs-chat-note { margin: 0; color: #4d5d64; font-size: .76rem; }
.cs-chat-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 520px) { .cs-chat { right: 10px; bottom: 10px; } .cs-chat-panel { height: min(520px, calc(100vh - 90px)); } }

/* Administrator's alert line, links, the website sign-in prompt, embedded mode */
.cs-chat-admin { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; padding: 7px 14px; border-bottom: 1px solid #d4deda; background: #f4ecdc; color: #5c4b18; font-size: .8rem; }
.cs-chat-link { border: 0; padding: 0; background: none; color: #125868; font: inherit; font-weight: 800; text-decoration: underline; cursor: pointer; }
.cs-chat-link:disabled { opacity: .6; cursor: wait; }
.cs-chat-sitelink { display: block; padding: 0 14px 12px; background: #fffdf9; color: #125868; font-size: .8rem; font-weight: 800; }
.cs-chat-signin { display: flex; align-items: center; gap: 6px; }
.cs-chat-signin .cs-chat-launcher { text-decoration: none; }
.cs-chat-dismiss { width: 34px; height: 34px; border: 0; border-radius: 50%; background: #0d414c; color: #fff; font-size: 1.1rem; line-height: 1; cursor: pointer; box-shadow: 0 6px 18px rgba(13, 65, 76, .3); }
html[data-chat-embed], body.cs-chat-embed { margin: 0; background: transparent; }
html[data-chat-embed] .cs-chat { right: 8px; bottom: 8px; }
html[data-chat-embed] .cs-chat-panel { width: calc(100vw - 16px); height: calc(100vh - 78px); box-shadow: 0 6px 20px rgba(13, 65, 76, .25); }
.cs-chat, .cs-chat * { box-sizing: border-box; }

/* Pictures: waiting to be sent, and in the messages */
.cs-chat-attach { min-height: 40px; border: 1.5px solid #125868; border-radius: 999px; padding: 0 14px; background: #fff; color: #125868; font: inherit; font-weight: 800; white-space: nowrap; cursor: pointer; }
.cs-chat-attach:hover { background: #e9f2f3; }
.cs-chat-attach:disabled { opacity: .55; cursor: not-allowed; }
.cs-chat-attach:focus-visible, .cs-chat-pic:focus-visible, .cs-chat-thumb button:focus-visible { outline: 3px solid #e8926a; outline-offset: 2px; }
.cs-chat-tray { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.cs-chat-thumb { position: relative; display: grid; place-items: center; width: 68px; height: 68px; overflow: hidden; border: 1px solid #b9d3d7; border-radius: 12px; background: #fff; color: #4d5d64; font-weight: 800; }
.cs-chat-thumb.preparing { border-style: dashed; }
.cs-chat-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cs-chat-thumb button { position: absolute; top: 3px; right: 3px; width: 26px; height: 26px; border: 0; border-radius: 50%; background: #0d414c; color: #fff; font-size: 1rem; line-height: 1; cursor: pointer; }
.cs-chat-pics { display: grid; gap: 6px; margin-top: 6px; }
.cs-chat-pics.many { grid-template-columns: 1fr 1fr; }
.cs-chat-pic { display: block; width: fit-content; max-width: 100%; overflow: hidden; border: 1px solid #c5d6d8; border-radius: 10px; background: #eef3f2; line-height: 0; }
.cs-chat-pic img { display: block; max-width: 100%; height: auto; }
.cs-chat-pics.many .cs-chat-pic { width: 100%; }
.cs-chat-pics.many .cs-chat-pic img { width: 100%; max-height: none; aspect-ratio: 4 / 3; object-fit: cover; }
.cs-chat-panel.dropping { outline: 3px dashed #125868; outline-offset: -7px; }

/* Two views in one window: messages, and the assistant (chat.js). */
.cs-chat-tabs { display: flex; gap: 4px; padding: 8px 12px 0; background: var(--cs-chat-head, #0d414c); }
.cs-chat-tab { min-height: 40px; border: 0; border-radius: 10px 10px 0 0; padding: 0 14px; background: rgba(255,255,255,.12); color: #d7e5e7; font: inherit; font-size: .88rem; font-weight: 800; cursor: pointer; }
.cs-chat-tab.is-on { background: #fffdf9; color: #0d414c; }
.cs-chat-tab:focus-visible { outline: 3px solid #e8926a; outline-offset: -3px; }
.cs-chat-ai { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.cs-chat-ai-log { flex: 1; overflow-y: auto; display: grid; align-content: end; gap: 10px; padding: 14px; }
.cs-chat-ai-form { display: flex; gap: 8px; padding: 10px 14px 0; }
.cs-chat-ai-form textarea { flex: 1; min-height: 46px; border: 1px solid #9fb3b6; border-radius: 12px; padding: 9px 11px; font: inherit; resize: vertical; }
.cs-chat-ai-change { border: 1px solid #b8d2d6; border-left: 5px solid #125868; border-radius: 12px; padding: 12px 14px; background: #eff7f7; display: grid; gap: 5px; }
.cs-chat-ai-change strong { color: #0d414c; }
.cs-chat-ai-change p { margin: 0; }
.cs-chat-ai-change span { color: #5f6f76; font-size: .84rem; }
.cs-chat-msg.is-error p { color: #8f2f2f; }
