/* PATCH 18: One parent-owned composer geometry. No !important declarations. */
.hgai-client{--hgai-compose-gutter:9.5px;min-width:0;max-width:100%}
.hgai-client .hgai-composer{position:relative;display:flex;flex-direction:column;flex:0 0 auto;gap:0;align-items:stretch;width:calc(100% - 19px);max-width:calc(100% - 19px);min-width:0;min-height:151px;margin:8px var(--hgai-compose-gutter) 9px;padding:9px 52px 10px 11px;border:1px solid #c4d6ef;border-radius:16px;background:#fff;box-shadow:0 4px 16px #001d6e0c}
.hgai-client .hgai-composer:focus-within{border-color:#7fb5ff;box-shadow:0 0 0 2px #7fb5ff33}
.hgai-client .hgai-compose-chooser{display:block;flex:0 0 auto;width:100%;min-width:0;margin:0;padding:0}
.hgai-client .hgai-compose-tools{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-start;gap:5px;min-width:0;width:100%;margin:0;padding:0 0 7px;border-bottom:1px solid #edf1f9}
.hgai-client .hgai-composer .hgai-compose-tools button{display:grid;place-items:center;position:relative;flex:0 0 33px;width:33px;min-width:33px;height:33px;min-height:33px;margin:0;padding:0;border:1px solid #dfb990;border-radius:9px;background:#fee2c5;color:#001d6e;box-shadow:none;cursor:pointer;font-size:19px}
.hgai-client .hgai-composer .hgai-compose-tools button.active,.hgai-client .hgai-composer .hgai-compose-tools button[aria-pressed=true]{background:#f5cda8;border-color:#c88d5a}
.hgai-client .hgai-compose-tools svg{width:19px;height:19px;pointer-events:none}
.hgai-client .hgai-composer .hgai-compose-tools .screen-reader-text{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
.hgai-client .hgai-compose-line{display:flex;align-items:stretch;flex:1 1 auto;width:100%;min-width:0;max-width:100%;min-height:63px;margin:0;padding:0;border:0}
.hgai-client .hgai-compose-line textarea[data-compose],.hgai-client .hgai-compose-line textarea[data-compose]:focus{display:block;position:static;float:none;flex:1 1 auto;width:100%;min-width:0;max-width:100%;height:100%;min-height:63px;max-height:155px;margin:0;padding:13px 3px 9px;border:0;outline:0;border-radius:0;box-shadow:none;background:transparent;color:#183156;resize:vertical;font:400 16px/1.45 system-ui;opacity:1}
.hgai-client .hgai-compose-corner{position:absolute;bottom:10px;right:9px;z-index:2;display:flex;flex-direction:column;align-items:center;gap:9px;width:34px}
.hgai-client .hgai-compose-corner .hgai-expand-compose,.hgai-client .hgai-compose-corner .hgai-send-icon{position:static;display:grid;place-items:center;flex:0 0 34px;width:34px;min-width:34px;height:34px;min-height:34px;margin:0;padding:0;border:1px solid #cbdaee;border-radius:10px;background:#edf4ff;color:#001d6e;box-shadow:none;cursor:pointer}
.hgai-client .hgai-compose-corner .hgai-send-icon{border-color:#001d6e;border-radius:50%;background:#001d6e;color:white}
.hgai-client .hgai-compose-corner svg{width:19px;height:19px}
.hgai-client .hgai-compose-corner [data-send][hidden]{display:none}
.hgai-client .hgai-composer .hgai-attachment-caption{width:100%;max-width:100%;min-width:0;margin:3px 0 0;padding:0;color:#375379;font:12px/1.4 system-ui;overflow-wrap:anywhere;white-space:normal}
.hgai-client .hgai-write-modal[hidden],.hgai-client .hgai-write-modal-media[hidden]{display:none}
.hgai-client .hgai-write-modal{position:absolute;z-index:38;inset:0;display:flex;align-items:stretch;justify-content:center;box-sizing:border-box;width:100%;height:100%;min-width:0;min-height:0;max-width:100%;max-height:100%;padding:9.5px;background:#071c49e8}
.hgai-client .hgai-write-modal-card{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr) minmax(105px,.8fr) auto auto;width:100%;height:100%;max-width:100%;max-height:100%;min-width:0;min-height:0;overflow:hidden;border-radius:13px;background:#fff;box-shadow:0 10px 32px #0004}
.hgai-client .hgai-write-modal-card header{display:flex;align-items:center;justify-content:space-between;gap:12px;flex:0 0 auto;padding:11px 13px;background:#001d6e;color:white}
.hgai-client .hgai-write-modal-card header strong{color:white;font-size:15px}
.hgai-client .hgai-write-modal-card header button{display:grid;place-items:center;min-width:36px;min-height:36px;border:1px solid #ffffff5c;border-radius:9px;background:#ffffff20;color:white;cursor:pointer;font-size:23px}
.hgai-client .hgai-write-modal-media{display:flex;align-items:center;justify-content:center;width:100%;min-width:0;min-height:0;padding:10px;overflow:hidden;background:#edf3ff}
.hgai-client .hgai-write-modal-media img,.hgai-client .hgai-write-modal-media video{display:block;width:100%;height:100%;max-width:100%;max-height:100%;object-fit:contain}
.hgai-client .hgai-write-modal-media iframe{width:100%;height:100%;border:0;background:#fff}
.hgai-client .hgai-write-modal-media audio{max-width:100%}
.hgai-client .hgai-compose-modal-slot{display:flex;align-items:stretch;width:100%;min-width:0;min-height:0;overflow:hidden;padding:9px 12px}
.hgai-client .hgai-compose-modal-slot .hgai-compose-line{display:flex;flex:1 1 auto;min-height:0;height:100%}
.hgai-client .hgai-compose-modal-slot .hgai-compose-line textarea[data-compose]{flex:1 1 auto;min-height:100%;height:100%;max-height:none;padding:10px;border:1px solid #d0def3;border-radius:11px;background:#fff;resize:none;font-size:16px}
.hgai-client .hgai-write-modal-card:has(.hgai-write-modal-media[hidden]){grid-template-rows:auto minmax(0,1fr) auto auto}
.hgai-client .hgai-write-modal-media[hidden]+.hgai-compose-modal-slot{min-height:0}
.hgai-client .hgai-write-modal-hint{flex:0 0 auto;margin:0;padding:3px 13px;font-size:11px;color:#60789c}
.hgai-client .hgai-write-modal-card footer{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:9px;flex:0 0 auto;padding:11px 13px;background:#f7faff;border-top:1px solid #d9e4f5}
.hgai-client .hgai-write-modal-card footer>span{min-width:0;flex:1 1 100px;overflow-wrap:anywhere;font-size:12px;color:#48648c}
.hgai-client .hgai-write-actions{display:flex;flex-wrap:wrap;gap:7px;justify-content:flex-end;margin-left:auto}
.hgai-client .hgai-write-actions button{min-height:38px;padding:8px 12px;border:1px solid #bfd2ef;border-radius:9px;background:white;color:#001d6e;font:600 13px system-ui;cursor:pointer}
.hgai-client .hgai-write-actions [data-write-send]{border-color:#001d6e;background:#001d6e;color:white}
.hgai-client .hgai-write-actions [data-write-send]:disabled{opacity:.5;cursor:not-allowed}
@media(max-width:650px){.hgai-client .hgai-write-modal-card{border-radius:10px;grid-template-rows:auto minmax(0,1fr) minmax(98px,.8fr) auto auto}.hgai-client .hgai-write-modal-card:has(.hgai-write-modal-media[hidden]){grid-template-rows:auto minmax(0,1fr) auto auto}.hgai-client .hgai-write-actions button{padding:7px 9px}.hgai-client .hgai-write-modal-card footer{padding:8px 9px;max-height:115px;overflow-y:auto}}


/* PATCH 19 — Progressive send-state (works immediately as a visitor types,
 * even while the footer script is loading). JS takes authority once ready. */
.hgai-client:not(.hgai-js-ready) .hgai-composer [data-send]{visibility:hidden;pointer-events:none}
.hgai-client:not(.hgai-js-ready) .hgai-composer:has(textarea[data-compose]:not(:placeholder-shown)) [data-send]{visibility:visible;pointer-events:auto}
.hgai-client.hgai-js-ready .hgai-composer [data-send][hidden]{display:none}

/* PATCH 21 — compact one-line composer until engaged, no second draft. */
.hgai-client .hgai-composer:not(.hgai-is-composing){min-height:49px;height:49px;padding:6px 52px 6px 9px;margin-top:6px;margin-bottom:8px;border-radius:12px;overflow:hidden}
.hgai-client .hgai-composer:not(.hgai-is-composing) .hgai-compose-tools{gap:4px;padding-bottom:0;border:0;flex-wrap:nowrap}
.hgai-client .hgai-composer:not(.hgai-is-composing) .hgai-compose-tools button{height:32px;min-height:32px;width:32px;min-width:32px;flex-basis:32px}
.hgai-client .hgai-composer:not(.hgai-is-composing) .hgai-compose-line,.hgai-client .hgai-composer:not(.hgai-is-composing) .hgai-attachment-caption{display:none}
.hgai-client .hgai-composer:not(.hgai-is-composing) .hgai-compose-corner{bottom:6px;right:9px}
.hgai-client .hgai-composer:not(.hgai-is-composing) .hgai-expand-compose{display:none}
.hgai-client .hgai-composer:not(.hgai-is-composing) [data-send]{display:none}
@media(max-width:385px){.hgai-client .hgai-composer:not(.hgai-is-composing) .hgai-compose-tools button{min-width:29px;width:29px;flex-basis:29px}}
