.attachment-editor{border:1px solid var(--line,#dedee4);border-radius:16px;padding:0;background:var(--card,#fff);color:var(--ink,#20232b);width:min(1280px,calc(100vw - 32px));max-width:none;height:min(92dvh,940px);max-height:none;overflow:hidden;margin:auto;box-shadow:0 24px 100px #0005;font-family:inherit}
.attachment-editor::backdrop{background:#141821b8;backdrop-filter:blur(3px)}
.ae-shell{height:100%;display:flex;flex-direction:column;min-height:0;direction:rtl}
.ae-head,.ae-footer,.ae-toolbar,.ae-adjust{display:flex;align-items:center;gap:8px;padding:10px 16px;flex-shrink:0}
.ae-head{justify-content:space-between;border-bottom:1px solid var(--line,#e7e7ec)}
.ae-head h2{margin:0;font-size:17px}.ae-meta{font-size:11px;color:var(--muted,#747984);margin-top:3px}
.attachment-editor button{font-family:inherit;cursor:pointer;font-size:12px;font-weight:600;border:1px solid var(--line,#e1e2e8);border-radius:8px;background:var(--card,#fff);color:inherit;min-height:34px;padding:6px 11px;white-space:nowrap}
.attachment-editor button:disabled{opacity:.4;cursor:default}.attachment-editor button:focus-visible,.attachment-editor input:focus-visible{outline:2px solid var(--brand,#c7202f);outline-offset:2px}
.attachment-editor button[aria-pressed=true]{background:#c7202f12;border-color:var(--brand,#c7202f);color:var(--brand,#c7202f)}
.attachment-editor .ae-primary{background:var(--brand,#c7202f);border-color:var(--brand,#c7202f);color:#fff}
.ae-toolbar{flex-wrap:wrap;padding-block:8px;border-bottom:1px solid var(--line,#e7e7ec)}
.ae-tools{display:flex;gap:6px;align-items:center;flex-wrap:wrap}.ae-spacer{flex:1}.ae-divider{height:24px;width:1px;background:var(--line,#e1e2e8);margin-inline:3px}
.ae-adjust{background:var(--canvas,#f6f6f8);font-size:12px;flex-wrap:wrap;padding-block:7px}
.ae-adjust input[type=range]{width:160px;accent-color:var(--brand,#c7202f)}
.ae-adjust input[type=number]{width:76px;min-height:32px;border:1px solid var(--line,#dedee4);border-radius:7px;padding:4px 7px;background:var(--card,#fff);color:inherit;direction:ltr;font:inherit}
.ae-hint{font-size:11px;color:var(--muted,#747984)}
.ae-stage{position:relative;flex:1;min-height:80px;overflow:hidden;background:#e6e8ec;touch-action:none;direction:ltr;cursor:grab}
.ae-stage:active{cursor:grabbing}.ae-stage.ae-cropping{cursor:crosshair}
.ae-surface{position:absolute;transform:translate(-50%,-50%);box-shadow:0 4px 24px #0002;line-height:0;user-select:none}
.ae-surface canvas,.ae-original{width:100%;height:100%;display:block;pointer-events:none}.ae-original{object-fit:contain;background:white}
.ae-grid{position:absolute;inset:0;pointer-events:none;background-image:linear-gradient(#2791d055 1px,transparent 1px),linear-gradient(90deg,#2791d055 1px,transparent 1px);background-size:8.333% 8.333%}
.ae-crop{position:absolute;border:2px solid #fff;box-shadow:0 0 0 9999px #10172788;cursor:move;touch-action:none;box-sizing:border-box}
.ae-crop:before,.ae-crop:after{content:'';position:absolute;inset:33.333% 0;border-block:1px solid #fff7;pointer-events:none}.ae-crop:after{inset:0 33.333%;border-block:0;border-inline:1px solid #fff7}
.ae-handle{position:absolute;width:18px;height:18px;background:#c7202f;border:2px solid white;border-radius:50%;transform:translate(-50%,-50%);z-index:1}
.ae-handle[data-handle=nw]{left:0;top:0;cursor:nwse-resize}.ae-handle[data-handle=ne]{left:100%;top:0;cursor:nesw-resize}.ae-handle[data-handle=sw]{left:0;top:100%;cursor:nesw-resize}.ae-handle[data-handle=se]{left:100%;top:100%;cursor:nwse-resize}
.ae-handle[data-handle=n]{left:50%;top:0;cursor:ns-resize}.ae-handle[data-handle=s]{left:50%;top:100%;cursor:ns-resize}.ae-handle[data-handle=w]{left:0;top:50%;cursor:ew-resize}.ae-handle[data-handle=e]{left:100%;top:50%;cursor:ew-resize}
.ae-footer{border-top:1px solid var(--line,#e1e2e8);justify-content:space-between;flex-wrap:wrap}.ae-status{font-size:12px;line-height:1.6;flex:1;min-width:140px}.ae-status.ae-error{color:#c7202f}.ae-footer-actions{display:flex;gap:7px}
.attachment-editor [hidden]{display:none!important}.ae-loading{position:absolute;inset:0;display:grid;place-items:center;font-size:13px;color:#49515f;pointer-events:none}
@media(max-width:600px){.attachment-editor{width:100vw;height:100dvh;border:0;border-radius:0}.ae-head,.ae-toolbar,.ae-adjust,.ae-footer{padding-inline:10px}.ae-head h2{font-size:15px}.ae-meta{max-width:260px}.attachment-editor button{padding:6px 9px;min-height:36px;font-size:11px}.ae-toolbar{gap:6px}.ae-tools{gap:5px}.ae-divider{display:none}.ae-adjust{gap:6px}.ae-adjust input[type=range]{width:100px;flex:1}.ae-adjust .ae-hint{flex-basis:100%}.ae-footer{gap:5px}.ae-status{font-size:11px}.ae-handle{width:22px;height:22px}.ae-footer-actions{margin-inline-start:auto}}

@media(max-width:600px){.ae-toolbar>.ae-tools:first-child,.ae-edit-tools{display:contents}.ae-toolbar>.ae-spacer{flex-basis:100%;height:0}.ae-meta{line-height:1.5}.ae-adjust .ae-hint{display:none}}
