.workspace-page #chat-attach {
    min-block-size: 36px;
    flex: none;
    border: 0;
    background: transparent;
    padding: 0 4px;
}
.workspace-page #chat-attach:disabled { opacity: .55; cursor: default; }
.chat-attach-dialog {
    box-sizing: border-box;
    inline-size: min(24rem, calc(100vw - 24px));
    max-block-size: calc(100dvh - 24px);
    overflow: auto;
    overscroll-behavior: contain;
    padding: 16px;
    border: 1px solid #d8e5d9;
    border-radius: 16px;
    background: #fff;
    color: #234333;
    box-shadow: 0 12px 42px #12271b32;
}
.chat-attach-dialog::backdrop { background: #172b22a6; }
.chat-attach-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-block-end: 12px;
}
.chat-attach-header h2 { margin: 0; color: #234333; font-size: 1.15rem; font-weight: 650; line-height: 1.3; }
.chat-attach-dialog svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.chat-attach-close {
    display: grid;
    min-block-size: 40px;
    min-inline-size: 40px;
    place-items: center;
    border: 0;
    border-radius: 8px;
    background: #edf4ec;
    color: #355744;
    cursor: pointer;
}
.chat-attach-choices { display: grid; gap: 6px; }
.chat-attach-choices button {
    display: flex;
    align-items: center;
    min-block-size: 56px;
    gap: 12px;
    padding: 6px 10px;
    border: 1px solid #e5ede3;
    border-radius: 10px;
    background: #f9fcf8;
    color: #234333;
    font: inherit;
    font-weight: 600;
    line-height: 1.35;
    text-align: start;
    cursor: pointer;
}
.chat-attach-choices button:hover { background: #eef5ea; }
.chat-attach-choices small { display: block; color: #526d5d; font-size: .79rem; font-weight: 400; }
.chat-attach-limit { margin: 9px 0 0; color: #526d5d; font-size: .8rem; }
.chat-image-preview { inline-size: min(38rem, calc(100vw - 24px)); }
.chat-image-stage:not([hidden]) {
    display: grid;
    justify-items: center;
    padding: 6px;
    border: 1px solid #e8eee7;
    border-radius: 10px;
    background: #f1f5f0;
}
.chat-image-frame { position: relative; min-inline-size: 0; max-inline-size: 100%; }
.chat-image-frame canvas { display: block; max-inline-size: 100%; max-block-size: min(43dvh, 24rem); inline-size: auto; block-size: auto; }
.chat-image-frame[data-edit]:not([data-edit=""]) canvas { cursor: crosshair; touch-action: none; }
.chat-image-selection { position: absolute; box-sizing: border-box; pointer-events: none; border: 2px solid #fff; outline: 2px dashed #214c37; }
.chat-image-frame[data-edit="cover"] .chat-image-selection { background: #18231f9e; }
.chat-image-tools, .chat-image-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-block-start: 10px; }
.chat-image-tools button {
    min-block-size: 36px;
    padding: 3px 9px;
    border: 1px solid #dce8dd;
    border-radius: 8px;
    background: #f7faf6;
    color: #234333;
    font: inherit;
    font-size: .85rem;
    cursor: pointer;
}
.chat-image-tools button[aria-pressed="true"] { background: #234333; color: white; }
.chat-image-preview button:disabled { opacity: .52; cursor: default; }
#chat-image-help, #chat-image-status { margin: 6px 0 0; color: #526d5d; font-size: .8rem; line-height: 1.45; }
#chat-image-status:empty { display: none; }
.chat-image-actions { justify-content: end; }
.chat-image-actions button { min-block-size: 40px; }
.chat-attach-dialog :focus-visible { outline: 2px solid #234333; outline-offset: 2px; }
.workspace-page #attachment-pill {
    display: flex;
    flex-wrap: wrap;
    justify-content: start;
    gap: 6px;
    padding: 0;
    border: 0;
    background: transparent;
}
.workspace-page #attachment-pill.hidden { display: none; }
.chat-attachment { display: inline-flex; align-items: center; min-inline-size: 0; max-inline-size: 100%; gap: 4px; padding: 1px 4px 1px 10px; border: 1px solid #dce8dd; border-radius: 8px; background: #f1f6ef; color: #365b46; }
.chat-attachment span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-attachment button { flex: none; width: 35px; height: 34px; border-radius: 6px; color: #365b46; font-size: 1.1rem; }
.chat-attachment button:hover { background: #e1ebdf; }

@media (max-width: 600px) {
    #chat-attach-options { margin-block-end: max(12px, env(safe-area-inset-bottom)); }
}
