.tb-image-editor{box-sizing:border-box;width:min(760px,calc(100% - 24px));max-height:calc(100dvh - 24px);padding:20px;border:1px solid #cbd5e1;border-radius:16px;color:#172033;background:#fff;overflow:auto}
.tb-image-editor::backdrop{background:rgba(15,23,42,.65)}
.tb-image-editor *{box-sizing:border-box}.tb-image-editor h2{margin:0;font-size:21px}.tb-image-editor header{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:12px}
.tb-image-editor button,.tb-image-editor input,.tb-image-editor select{font:inherit;min-height:44px;border:1px solid #cbd5e1;border-radius:8px;padding:8px;max-width:100%}
.tb-image-editor button{cursor:pointer;background:#f8fafc;color:#172033}.tb-image-editor button:focus-visible,.tb-image-editor input:focus-visible{outline:3px solid #6366f1;outline-offset:2px}
.tb-image-editor .tb-preview{position:relative;line-height:0;max-width:100%;margin:12px auto;background:repeating-conic-gradient(#e2e8f0 0% 25%,#fff 0% 50%) 0/16px 16px}
.tb-image-editor canvas{width:100%;display:block;touch-action:none;cursor:crosshair}.tb-image-editor .tb-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.tb-image-editor label{display:flex;flex-direction:column;gap:5px;font-size:14px}
.tb-image-editor input{width:100%;min-width:0}.tb-image-editor .tb-row{display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin:12px 0}.tb-image-editor .tb-row label{display:flex;flex-direction:row;align-items:center}.tb-image-editor input[type=checkbox]{width:20px;min-height:20px}
.tb-image-editor p{font-size:14px;line-height:1.5;margin:10px 0}.tb-image-editor .tb-save{background:#4f46e5;color:white;flex:1}.tb-image-editor [role=status]{min-height:22px;color:#475569}.tb-image-editor button:disabled{opacity:.5;cursor:wait}
@media(max-width:480px){.tb-image-editor{padding:14px}.tb-image-editor h2{font-size:18px}}
.tb-image-editor{margin:auto;inset:0}.tb-image-editor header{position:sticky;top:0;z-index:1;background:#fff;padding:6px 0}.tb-image-editor #tb-edit-close{min-width:44px;flex-shrink:0}
/* iPhone Safari zooms focused fields below 16 px, cropping the modal viewport. */
.tb-image-editor input,.tb-image-editor select{font-size:16px}
.tb-image-editor label{min-width:0}.tb-image-editor p{overflow-wrap:anywhere}
