body.nsw-photo-editor-open { overflow: hidden; }
.nsw-photo-editor { box-sizing: border-box; width: min(1120px, calc(100vw - 48px)); max-width: none; height: min(820px, calc(100dvh - 48px)); max-height: none; margin: auto; padding: 0; border: 1px solid #d3dfeb; border-radius: 16px; background: #fff; color: #30475c; font: 14px/1.4 system-ui, sans-serif; box-shadow: 0 24px 90px #17354d44; }
.nsw-photo-editor[open] { display: flex; flex-direction: column; }
.nsw-photo-editor::backdrop { background: #142c4866; backdrop-filter: blur(3px); }
.nsw-photo-editor *, .nsw-photo-editor *::before, .nsw-photo-editor *::after { box-sizing: border-box; }
.nsw-photo-editor button, .nsw-photo-editor select { font: inherit; color: inherit; border: 1px solid #c9d7e5; border-radius: 7px; background: #fff; min-height: 38px; padding: 7px 12px; cursor: pointer; }
.nsw-photo-editor button:hover:not(:disabled) { background: #eef6fd; border-color: #3081b6; }
.nsw-photo-editor :focus-visible { outline: 2px solid #2584c0; outline-offset: 3px; }
.nsw-photo-editor button:disabled, .nsw-photo-editor input:disabled { opacity: .5; cursor: default; }
.nsw-photo-editor__header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid #e0e8f0; }
.nsw-photo-editor__header h2 { margin: 0; font-size: 21px; }
.nsw-photo-editor__header p { margin: 4px 0 0; font-size: 12px; color: #708498; }
.nsw-photo-editor__header > button { font-size: 24px; line-height: 1; }
.nsw-photo-editor__body { display: grid; grid-template-columns: minmax(0, 1fr) 265px; flex: 1; min-height: 0; overflow: auto; }
.nsw-photo-editor__previews { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: center; gap: 16px; padding: 22px; background: #f4f7fa; min-width: 0; }
.nsw-photo-editor figure { margin: 0; min-width: 0; }
.nsw-photo-editor figcaption { margin-bottom: 10px; font-weight: 600; display: flex; justify-content: space-between; }
.nsw-photo-editor figcaption span { font-weight: 400; font-size: 12px; color: #73879b; }
.nsw-photo-editor__canvas { aspect-ratio: 1; border: 1px solid #dce5ed; border-radius: 10px; overflow: hidden; background: repeating-conic-gradient(#fff 0% 25%, #e9edf2 0% 50%) 0 / 20px 20px; }
.nsw-photo-editor__canvas img { width: 100%; height: 100%; object-fit: contain; display: block; }
.nsw-photo-editor__canvas img:not([src]) { visibility: hidden; }
.nsw-photo-editor small { display: block; font-size: 11px; color: #718598; }
.nsw-photo-editor figure > small { margin-top: 8px; overflow-wrap: anywhere; }
.nsw-photo-editor__settings { border-left: 1px solid #e0e8f0; padding: 18px; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; }
.nsw-photo-editor__settings label { display: flex; flex-wrap: wrap; align-content: start; justify-content: space-between; gap: 7px; font-size: 12px; font-weight: 600; }
.nsw-photo-editor__settings select, .nsw-photo-editor input[type="range"] { width: 100%; min-width: 0; accent-color: #2681bb; }
.nsw-photo-editor input[type="range"] { min-height: 26px; padding: 0; }
.nsw-photo-editor input[type="color"] { width: 100%; height: 35px; padding: 2px; border: 1px solid #ccd8e5; border-radius: 5px; }
.nsw-photo-editor [hidden] { display: none !important; }
.nsw-photo-editor__ai button { width: 100%; background: #eef6fd; border-color: #b6d6ed; color: #2475a8; }
.nsw-photo-editor__ai small { margin-top: 6px; }
.nsw-photo-editor details { border-top: 1px solid #e0e8f0; padding-top: 10px; font-size: 12px; }
.nsw-photo-editor summary { cursor: pointer; }
.nsw-photo-editor details label { margin-top: 12px; }
.nsw-photo-editor label.nsw-photo-editor__check { flex-wrap: nowrap; justify-content: start; align-items: center; font-weight: 400; }
.nsw-photo-editor__about a { color: #2475a8; }
.nsw-photo-editor__footer { display: flex; justify-content: space-between; align-items: center; gap: 16px; border-top: 1px solid #e0e8f0; padding: 14px 22px; }
.nsw-photo-editor__footer [role="status"] { font-size: 12px; color: #6b8296; }
.nsw-photo-editor__footer .is-error { color: #b83838; }
.nsw-photo-editor__footer > div:last-child { display: flex; gap: 8px; flex-shrink: 0; }
.nsw-photo-editor [data-photo-apply] { background: #2785bc; color: #fff; border-color: #2785bc; }
.nsw-photo-editor [data-photo-apply]:hover:not(:disabled) { background: #1c70a1; color: #fff; }
.nsw-photo-retouch { grid-column: 1 / -1; padding: 12px 18px; border-bottom: 1px solid #e0e8f0; background: #fff; }
.nsw-photo-editor__body:has(.nsw-photo-retouch) { grid-template-rows: auto minmax(0, 1fr); }
.nsw-photo-retouch__tools, .nsw-photo-retouch__crop-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.nsw-photo-retouch button[aria-pressed="true"] { background: #e7f3fc; border-color: #2785bc; color: #216da0; }
.nsw-photo-retouch label { display: flex; align-items: center; gap: 10px; font-size: 12px; margin: 10px 0 6px; }
.nsw-photo-retouch input[type="range"] { width: 180px; accent-color: #2785bc; }
.nsw-photo-retouch input[type="number"] { width: 70px; min-height: 34px; border: 1px solid #c9d7e5; border-radius: 6px; padding: 4px 7px; font: inherit; }
.nsw-photo-retouch__coordinates { display: flex; flex-wrap: wrap; gap: 12px; }
.nsw-photo-retouch__coordinates label { display: grid; gap: 4px; margin-top: 4px; }
.nsw-photo-retouch [data-retouch-history] { margin-top: 8px; }
.nsw-photo-editor__canvas { position: relative; }
.nsw-photo-retouch__surface, .nsw-photo-retouch__overlay { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.nsw-photo-retouch__overlay { touch-action: none; }
.nsw-photo-editor__canvas.is-retouching img { visibility: hidden; }
.nsw-photo-editor--retouching .nsw-photo-editor__previews > figure:first-child { display: none; }
.nsw-photo-editor--retouching .nsw-photo-editor__previews { grid-template-columns: minmax(0, 1fr); padding: 12px 22px; }
.nsw-photo-editor--retouching .nsw-photo-editor__previews > figure { width: 100%; min-height: 0; }
.nsw-photo-editor--retouching .nsw-photo-editor__canvas { width: 100%; height: min(45vh, 480px); aspect-ratio: auto; }
@media (max-width: 760px) {
  .nsw-photo-editor { width: 100%; height: 100dvh; border: 0; border-radius: 0; }
  .nsw-photo-editor__header { padding: max(12px, env(safe-area-inset-top)) 14px 12px; }
  .nsw-photo-editor__header h2 { font-size: 18px; }
  .nsw-photo-editor__body { display: block; }
  .nsw-photo-editor__previews { padding: 14px; gap: 10px; }
  .nsw-photo-editor__settings { border-left: 0; border-top: 1px solid #e0e8f0; overflow: visible; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding: 14px; }
  .nsw-photo-editor__settings > details, .nsw-photo-editor__ai { grid-column: 1 / -1; }
  .nsw-photo-editor button, .nsw-photo-editor select { min-height: 44px; }
  .nsw-photo-editor__footer { padding: 10px 14px max(10px, env(safe-area-inset-bottom)); flex-wrap: wrap; gap: 8px; }
  .nsw-photo-editor__footer > div:last-child { width: 100%; }
  .nsw-photo-editor__footer button { flex: 1; }
  .nsw-photo-retouch { padding: 10px 14px; }
  .nsw-photo-retouch__tools { gap: 5px; }
  .nsw-photo-retouch__tools button { padding: 6px 10px; }
  .nsw-photo-retouch__coordinates { gap: 8px; }
  .nsw-photo-retouch__coordinates input { width: 72px; }
  .nsw-photo-editor--retouching .nsw-photo-editor__previews { padding: 12px 14px; }
  .nsw-photo-editor--retouching .nsw-photo-editor__canvas { height: min(42dvh, 400px); }
}
