.image-attachment-zone{--attachment-accent:#2865ec;--attachment-line:#cddbf1;--attachment-bg:#f7faff;display:flex;align-items:center;flex-wrap:wrap;gap:10px;position:relative;width:100%;min-width:0;box-sizing:border-box;padding:12px;border:1px dashed var(--attachment-line);border-radius:14px;background:var(--attachment-bg);transition:border-color .18s,background .18s,box-shadow .18s;text-align:left;cursor:pointer}
.image-attachment-zone:focus-visible{outline:3px solid #78a3ff;outline-offset:3px}
.image-attachment-hint{flex:1 1 170px;font-size:12px;line-height:1.65;font-weight:500;color:#587395;pointer-events:none}
.image-attachment-zone.is-dragging{border:2px dashed var(--attachment-accent);padding:11px;background:#eaf1ff;box-shadow:0 0 0 4px #2865ec16}
.image-attachment-zone.is-dragging .image-attachment-hint{color:var(--attachment-accent);font-weight:750}
.image-attachment-zone[aria-busy=true]{cursor:progress;opacity:.8}
.image-attachment-thumbnail{width:56px!important;height:56px!important;max-height:56px!important;object-fit:contain!important;border-radius:9px;border:1px solid var(--attachment-line);background:#fff}
.image-attachment-actions{display:flex;gap:8px}.image-attachment-actions button{border:1px solid #e8b9c1;background:#fff5f6;color:#a43a4b;border-radius:9px;padding:8px 10px;font:inherit;font-size:12px;cursor:pointer}
.image-attachment-error{flex:1 0 100%;font-size:12px;line-height:1.7;color:#b52d42}
.image-attachment-zone [hidden]{display:none!important}
.image-attachment-picker{width:min(520px,calc(100vw - 32px));max-height:calc(100dvh - 40px);overflow:auto;box-sizing:border-box;border:1px solid #d7e2f5;border-radius:23px;padding:22px;color:#183454;background:#fff;box-shadow:0 24px 80px #09172c4d}
.image-attachment-picker::backdrop{background:#13233b80;backdrop-filter:blur(5px)}
.image-attachment-picker:not([open]){display:none}
.image-attachment-picker header{display:flex;align-items:flex-start;gap:12px}.image-attachment-picker h2{font-size:21px;margin:0 0 6px}.image-attachment-picker p{font-size:12px;line-height:1.7;color:#627b98;margin:0}.image-attachment-picker header button{margin-left:auto;flex-shrink:0;width:34px;height:34px;border:1px solid #dbe5f5;border-radius:50%;background:#f4f7fd;color:#587395;font-size:23px;cursor:pointer}
.image-attachment-source{display:flex;justify-content:center;padding:16px}.image-attachment-source img{max-width:100%;width:auto;max-height:170px;object-fit:contain;border-radius:10px}
.image-attachment-options{display:grid;gap:9px}.image-attachment-option{display:flex;align-items:center;gap:12px;width:100%;border:1px solid #d7e2f5;border-radius:13px;padding:12px;background:#f6f9ff;color:inherit;text-align:left;font:inherit;font-weight:650;cursor:pointer}
.image-attachment-option img,.image-attachment-placeholder{width:48px;height:48px;flex:none;object-fit:contain;border-radius:9px;background:#e8efff}.image-attachment-placeholder{display:grid;place-items:center;font-size:27px;color:#4d76b5}
.image-attachment-option:hover{border-color:#759eff;background:#edf3ff}.image-attachment-picker :focus-visible{outline:3px solid #7d9fff;outline-offset:2px}
.image-attachment-cancel{display:block;margin:16px 0 0 auto;border:1px solid #cad8ed;background:#f2f6fc;color:#496585;border-radius:10px;padding:10px 20px;font:inherit;cursor:pointer}
.image-attachment-notice{position:fixed;z-index:1600;bottom:24px;left:50%;transform:translateX(-50%);padding:12px 18px;border:1px solid #e7aab3;border-radius:12px;background:#fff1f3;color:#a42e41;font-size:13px;max-width:90vw}
html[data-theme=dark] .image-attachment-zone{--attachment-line:#536b8a;--attachment-bg:#243249;--attachment-accent:#9cbcff}
html[data-theme=dark] .image-attachment-hint{color:#c2d2e9}html[data-theme=dark] .image-attachment-zone.is-dragging{background:#30476a}html[data-theme=dark] .image-attachment-error{color:#ffacb9}
html[data-theme=dark] .image-attachment-actions button{background:#4b2f3c;color:#ffd0d9;border-color:#986072}
html[data-theme=dark] .image-attachment-picker{background:#202e43;color:#ecf3ff;border-color:#536b8a}html[data-theme=dark] .image-attachment-picker p{color:#b8c9e2}
html[data-theme=dark] .image-attachment-option,html[data-theme=dark] .image-attachment-cancel,html[data-theme=dark] .image-attachment-picker header button{background:#2d3e58;color:#e4eeff;border-color:#536b8a}
html[data-theme=dark] .image-attachment-option:hover{background:#3a5072;border-color:#9cbcff}
@media(max-width:600px){.image-attachment-zone{gap:8px;padding:10px}.image-attachment-zone.is-dragging{padding:9px}.image-attachment-hint{flex-basis:100%}.image-attachment-picker{padding:18px}}
@media(prefers-reduced-motion:reduce){.image-attachment-zone{transition:none}}
@media print{.image-attachment-picker,.image-attachment-notice{display:none!important}}
