.attachment-quality{position:relative;display:flex;align-items:center;justify-content:space-between;margin-top:12px;font-size:12px;color:var(--muted)}.attachment-quality-menu{position:absolute;top:44px;right:0;z-index:8;width:min(300px,85vw);padding:18px;background:var(--panel);border:1px solid var(--line);border-radius:20px;box-shadow:0 12px 40px #0003;color:var(--text)}.attachment-quality-menu p{font-size:11px;line-height:1.55;color:var(--muted);margin-top:10px}.attachment-quality-menu input{width:20px;height:20px;accent-color:var(--accent)}
.modal-backdrop:has(.photo-editor-modal){padding:0;background:#0b0e14;align-items:stretch}
.modal.photo-editor-modal{position:fixed;inset:0;margin:0;padding:0;width:100%;max-width:none;height:100%;height:100dvh;max-height:none;border-radius:0;border:0;overflow:hidden;background:#0b0e14;color:#f5f7fb;box-shadow:none;animation:photo-editor-enter .2s ease-out}
.photo-editor-modal>.row{display:none}.photo-editor-modal #attachment-sheet{height:100%}.photo-editor-modal .photo-editor{height:100%;display:grid;grid-template-rows:64px minmax(0,1fr) auto;gap:0;padding:0;color:#f5f7fb;--accent:#93b5ff}
.photo-editor button{color:inherit;transition:background .15s,transform .15s,opacity .15s}.photo-editor button:active{transform:scale(.93)}.photo-editor button:disabled{opacity:.25}.photo-editor button:focus-visible{outline:2px solid #93b5ff;outline-offset:-3px}
.photo-top{display:flex;align-items:center;gap:12px;padding:8px 12px;background:#141922;z-index:3}.photo-top>button,.photo-history button{width:44px;height:44px;background:none;border-radius:50%;display:grid;place-items:center;font-size:28px}.photo-top>div:nth-child(2){flex:1}.photo-top strong{display:block;font-size:15px}.photo-top span{display:block;font-size:11px;color:#9ca8ba;margin-top:3px}.photo-history{display:flex;gap:2px}
.photo-editor .photo-workspace{position:relative;display:flex;align-items:center;justify-content:center;overflow:hidden;min-height:0;touch-action:none;background:radial-gradient(ellipse at center,#202733 0,#0b0e14 75%)}
.photo-editor-modal .photo-stage{position:relative;flex:none;margin:0;max-width:none;max-height:none;overflow:visible;border-radius:0;touch-action:none;transform-origin:center;box-shadow:0 12px 40px #0005;will-change:transform}
.photo-editor-modal #photo-canvas{display:block;width:100%;height:100%;max-height:none;max-width:none;border-radius:0;touch-action:none}
.photo-editor-modal #photo-crop{position:absolute;border:1px solid #fff;box-shadow:0 0 0 100vmax #0008;touch-action:none;cursor:move;z-index:2}.photo-editor-modal #photo-crop.hidden{display:none}.crop-grid{position:absolute;inset:0;pointer-events:none;background:linear-gradient(to right,transparent calc(33.333% - .5px),#fff5 33.333%,transparent calc(33.333% + .5px),transparent calc(66.666% - .5px),#fff5 66.666%,transparent calc(66.666% + .5px)),linear-gradient(to bottom,transparent calc(33.333% - .5px),#fff5 33.333%,transparent calc(33.333% + .5px),transparent calc(66.666% - .5px),#fff5 66.666%,transparent calc(66.666% + .5px))}
.photo-editor-modal #photo-crop i{position:absolute;width:38px;height:38px;background:transparent;border:0;border-radius:0;transform:none}.photo-editor-modal #photo-crop i:after{content:"";position:absolute;inset:10px;border:3px solid white}.photo-editor-modal #photo-crop [data-corner=nw]{top:-19px;left:-19px}.photo-editor-modal #photo-crop [data-corner=ne]{top:-19px;right:-19px}.photo-editor-modal #photo-crop [data-corner=sw]{bottom:-19px;left:-19px}.photo-editor-modal #photo-crop [data-corner=se]{bottom:-19px;right:-19px}.photo-editor-modal #photo-crop [data-corner=nw]:after{border-right:0;border-bottom:0}.photo-editor-modal #photo-crop [data-corner=ne]:after{border-left:0;border-bottom:0}.photo-editor-modal #photo-crop [data-corner=sw]:after{border-right:0;border-top:0}.photo-editor-modal #photo-crop [data-corner=se]:after{border-left:0;border-top:0}
.photo-zoom{position:absolute;bottom:8px;left:50%;transform:translateX(-50%);display:flex;align-items:center;border:1px solid #ffffff20;border-radius:22px;background:#10151ed9;z-index:4;backdrop-filter:blur(12px)}.photo-zoom button{height:36px;min-width:40px;background:none;font-size:20px;border-radius:20px}.photo-zoom button:nth-child(2){font-size:11px;min-width:56px;font-variant-numeric:tabular-nums}
.photo-bottom{background:#171d28;border-top:1px solid #ffffff0d;padding:6px 16px max(12px,env(safe-area-inset-bottom));z-index:5}.photo-editor .photo-tools{display:flex;justify-content:center;gap:8px;margin:0;padding:2px 0 8px;flex-wrap:nowrap}.photo-editor .photo-tools button{background:none;border:0;border-radius:16px;min-height:58px;flex:1;padding:4px 8px;display:flex;flex-direction:column;align-items:center;gap:3px;font-size:11px;color:#a4b0c3}.photo-editor .photo-tools b{font-size:25px;line-height:28px;font-weight:400}.photo-editor .photo-tools .active{background:#91b3ff1c;color:#a7c2ff}
.photo-editor .photo-controls{min-height:108px;padding:6px 0;animation:photo-controls-in .15s ease-out}.photo-ratios{display:flex;gap:6px;justify-content:center;overflow-x:auto;padding:2px 0 8px}.photo-ratios button{background:#ffffff09;border:1px solid transparent;padding:9px 10px;border-radius:12px;white-space:nowrap;font-size:12px;min-height:36px}.photo-ratios .selected{background:#91b3ff22;border-color:#91b3ff70;color:#c6d8ff}.photo-transforms{display:flex;justify-content:space-between;gap:4px}.photo-transforms button{display:flex;align-items:center;justify-content:center;gap:5px;min-width:40px;min-height:44px;border-radius:12px;background:none;font-size:24px}.photo-transforms span{font-size:10px}.photo-transforms button:last-child{color:#a7c2ff;background:#91b3ff1c}
.photo-editor .photo-colors{display:flex;justify-content:space-between;align-items:center;gap:7px;padding:7px 4px}.photo-editor .photo-colors button{width:27px;height:27px;flex:none;background:var(--ink);border:3px solid #171d28;border-radius:50%;outline:1px solid #ffffff40;box-shadow:none}.photo-editor .photo-colors button.selected{outline:2px solid #c9d9ff;transform:scale(1.15)}.photo-editor .photo-colors input{width:30px;height:30px;padding:0;border:0;background:conic-gradient(red,yellow,lime,cyan,blue,magenta,red);border-radius:50%;overflow:hidden}.photo-editor .brush-width{display:flex;align-items:center;gap:12px;height:44px;color:#a4b0c3;margin:10px 0 0}.photo-editor input[type=range]{min-width:0;flex:1;accent-color:#a7c2ff;height:32px;touch-action:pan-x}.photo-editor output{min-width:28px;font-size:11px;text-align:right;font-variant-numeric:tabular-nums}#photo-brush-dot{width:32px;height:32px;display:grid;place-items:center;flex:none}#photo-brush-dot:after{content:"";width:clamp(2px,var(--brush),28px);height:clamp(2px,var(--brush),28px);border-radius:50%;background:var(--ink);border:1px solid #ffffff50;transition:width .1s,height .1s}
.photo-adjust-row{display:flex;align-items:center;gap:12px;height:34px;font-size:11px;color:#b8c3d5}.photo-adjust-row>span{width:62px}.photo-footer{display:flex;align-items:center;gap:16px;padding-top:8px;border-top:1px solid #ffffff0d}.photo-footer>span{flex:1;font-size:10px;line-height:1.5;color:#8795ac}.photo-footer .photo-done{display:flex;align-items:center;justify-content:center;gap:7px;min-height:46px;min-width:114px;padding:10px 18px;border-radius:24px;background:#a7c2ff;color:#101f39;font-size:13px;font-weight:650}
@keyframes photo-editor-enter{from{opacity:0;transform:translateY(16px)}to{opacity:1;transform:none}}@keyframes photo-controls-in{from{opacity:.5;transform:translateY(4px)}to{opacity:1;transform:none}}
@media(min-width:760px){.photo-editor-modal .photo-editor{grid-template-columns:minmax(0,1fr) 320px;grid-template-rows:64px minmax(0,1fr)}.photo-top{grid-column:1/-1}.photo-bottom{grid-row:2;grid-column:2;display:flex;flex-direction:column;justify-content:center;padding:22px}.photo-editor .photo-controls{margin:20px 0}.photo-footer{margin-top:24px}.photo-transforms span{display:none}}
@media(max-height:580px) and (max-width:759px){.photo-editor-modal .photo-editor{grid-template-rows:48px minmax(0,1fr) auto}.photo-top{padding:2px 10px}.photo-editor .photo-tools button{min-height:38px;flex-direction:row;justify-content:center}.photo-editor .photo-controls{min-height:70px;padding:0}.photo-bottom{padding:2px 10px 6px}.photo-ratios{padding:0}.photo-ratios button{min-height:30px;padding:5px 10px}.photo-transforms button{min-height:32px}.photo-footer{padding-top:4px}.photo-footer .photo-done{min-height:36px}.photo-adjust-row{height:24px}.photo-editor .brush-width{margin-top:2px;height:30px}}
@media(prefers-reduced-motion:reduce){.modal.photo-editor-modal,.photo-editor .photo-controls{animation:none}.photo-editor button,#photo-brush-dot:after{transition:none}}
